From ce3dfb492dc9ecd2775da228edb29fe39dcbc709 Mon Sep 17 00:00:00 2001 From: liuyingfang <1357764963@qq.com> Date: Mon, 9 Oct 2023 13:47:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E8=BF=81=E7=A7=BB=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MerchantChannelStatusController.java | 63 ++++- .../service/MerchantChannelStatusService.java | 228 +++++++++++------- .../system/service/NotificationService.java | 8 +- .../common/system/config/RespBody.java | 3 +- .../common/system/util/ExceptionUtil.java | 1 + .../dao/TbPlussMerchantChannelMapper.java | 1 + .../TbPlussMerchantChannelStatusMapper.java | 6 + .../dao/system/dao/TbPlussNoticeMapper.java | 2 + .../dao/TbPlussOperationRecordMapper.java | 7 + .../dao/system/dao/TbPlussUserAppMapper.java | 2 + .../mapper/TbPlussMerchantChannelMapper.xml | 3 + .../TbPlussMerchantChannelStatusMapper.xml | 22 ++ .../resources/mapper/TbPlussNoticeMapper.xml | 14 +- .../mapper/TbPlussOperationRecordMapper.xml | 22 +- .../resources/mapper/TbPlussUserAppMapper.xml | 6 + .../merchant/service/MerchantService.java | 68 +++++- 16 files changed, 351 insertions(+), 105 deletions(-) diff --git a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/MerchantChannelStatusController.java b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/MerchantChannelStatusController.java index 51723c6..ce0631e 100644 --- a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/MerchantChannelStatusController.java +++ b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/MerchantChannelStatusController.java @@ -1,5 +1,6 @@ package com.chaozhanggui.admin.system.controller; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.chaozhanggui.admin.system.service.MerchantChannelStatusService; import com.chaozhanggui.common.system.config.RespBody; import com.chaozhanggui.merchant.service.MerchantService; @@ -7,6 +8,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; /** * 商户通道相关信息 @@ -128,25 +131,69 @@ public class MerchantChannelStatusController { // } /** - * 后台进件 + * 后台进件/驳回 * @param userId * @param channelId * @param merchantCode * @return */ - @GetMapping(value = "/manualMerchantIncom/{userId}/{channelId}/{merchantCode}") - public RespBody manualMerchantIncome(@PathVariable("userId") String userId, @PathVariable("channelId") String channelId, @PathVariable("merchantCode") String merchantCode){ - merchantService.merchantAudit(userId,channelId); - return new RespBody (); + @GetMapping(value = "/manualMerchantIncom") + public RespBody manualMerchantIncome(@RequestParam("userId") String userId, @RequestParam("channelId") String channelId, + @RequestParam("merchantCode") String merchantCode,@RequestParam("type")String type, + @RequestParam("errMsg")String errMsg){ + if ("1".equals(type)) { + //进件 + merchantService.merchantAudit(userId, channelId); + }else if ("2".equals(type)){ + //驳回 + merchantService.rejectAudit(merchantCode,errMsg); + } + + return new RespBody ("000000"); } + /** + * 进件审核驳回 + */ +// @GetMapping(value = "/rejectAudit/{userId}") +// @ResponseBody +// public Map rejectAudit(@PathVariable("userId") Integer userId, String errMsg) { +// UserApp userApp = new UserApp().setUserId(userId.longValue()).setUserType("promoter"); +// userApp = userAppService.queryUserApp(userApp); +// +// Map result = new HashMap<>(2); +// try { +// mcsService.rejectAudit(userApp.getMerchantCode(), errMsg); +// result.put("code", "1"); +// result.put("msg", "处理成功"); +// } catch (Exception e) { +// result.put("code", "0"); +// result.put("msg", e.getMessage()); +// } +// +// return result; +// } + /** * 通道进件信息 * @return */ - @GetMapping("/messageChannel/{userId}") - public RespBody messageChannel(@PathVariable("userId") Integer userId){ - return merchantChannelStatusService.messageChannel(userId); + @GetMapping("/messageChannel/{userId}/{merchantCode}") + public RespBody messageChannel(@PathVariable("userId") Integer userId,@PathVariable("merchantCode")String merchantCode){ + return merchantChannelStatusService.messageChannel(userId, merchantCode); } + /** + * ip记录 + * @param userId + * @return + */ + @GetMapping("/userIpPage") + public RespBody userIpPageInfo(@RequestParam("userId") Integer userId, @RequestParam("currPage") Integer currPage, + @RequestParam("size") Integer size) { + return merchantChannelStatusService.userIpPageInfo(userId,currPage,size); + } + + + } diff --git a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/service/MerchantChannelStatusService.java b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/service/MerchantChannelStatusService.java index 69b94c8..78196ad 100644 --- a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/service/MerchantChannelStatusService.java +++ b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/service/MerchantChannelStatusService.java @@ -2,23 +2,18 @@ package com.chaozhanggui.admin.system.service; import cn.hutool.core.util.ObjectUtil; import com.chaozhanggui.common.system.config.RespBody; -import com.chaozhanggui.dao.system.dao.TbPlussAccountMapper; -import com.chaozhanggui.dao.system.dao.TbPlussMerchantChannelMapper; -import com.chaozhanggui.dao.system.dao.TbPlussMerchantChannelStatusMapper; -import com.chaozhanggui.dao.system.dao.TbPlussMerchantRejectDescMapper; -import com.chaozhanggui.dao.system.entity.TbPlussAccount; -import com.chaozhanggui.dao.system.entity.TbPlussMerchantChannel; -import com.chaozhanggui.dao.system.entity.TbPlussMerchantChannelStatus; -import com.chaozhanggui.dao.system.entity.TbPlussMerchantRejectDesc; +import com.chaozhanggui.dao.system.dao.*; +import com.chaozhanggui.dao.system.entity.*; import com.chaozhanggui.merchant.service.sxf.SxfMerchantAuditService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.RequestParam; import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.Objects; +import java.util.*; /** * @author lyf @@ -105,78 +100,80 @@ public class MerchantChannelStatusService { private TbPlussMerchantChannelMapper merchantChannelMapper; @Resource private TbPlussAccountMapper accountMapper; + @Resource + private TbPlussOperationRecordMapper operationRecordMapper; - /** - * 后台进件 - * @param userId - * @param channelId - * @param merchantCode - * @return - */ - public RespBody manualMerchantIncome(Integer userId, String channelId, String merchantCode){ - //检查进件通道 - if (ObjectUtil.isEmpty(channelId)){ - return new RespBody("000080"); - } - TbPlussMerchantChannelStatus merchantChannelStatus = merchantChannelStatusMapper.selectByPrimaryKey(Integer.valueOf(channelId)); - if (ObjectUtil.isEmpty(merchantChannelStatus)){ - return new RespBody("000081"); - } - //通道互不干扰 - if ("1".equals(channelId)) { - TbPlussMerchantChannelStatus sxfChannel = merchantChannelStatusMapper.selectByMerchantCode(merchantCode, 3); - if (sxfChannel != null || Objects.equals(sxfChannel.getChannel(),3)){ - return new RespBody("000082"); - } - } - if ("3".equals(channelId)) { - TbPlussMerchantChannelStatus ryxChannel = merchantChannelStatusMapper.selectByMerchantCode(merchantCode, 1); - if (ryxChannel != null && Objects.equals(ryxChannel.getChannel(), 1)) { - return new RespBody("000083"); - } - } - //先查询该通道下是否有记录 - TbPlussMerchantChannelStatus mcs = merchantChannelStatusMapper.selectByMerchantCode(merchantCode, Integer.valueOf(channelId)); - if (mcs == null) { - return new RespBody("000084"); - } else { - if (mcs.getChannel() != null) { - if (Integer.parseInt(channelId) == mcs.getChannel() - && TbPlussMerchantChannelStatus.isAudited(mcs)) { - return new RespBody("000085"); - } - } - } - TbPlussMerchantChannelStatus.checkCanAudit(mcs); - //选择通道 - switch (channelId) { - case "1": - // 随行付 - sxfMerchantAuditService.merchantAudit(String.valueOf(userId), false); - break; -// case "2": -// // 乐刷,暂不支持 -// leshuaMerchantAuditService.merchantAudit(userId, false); +// /** +// * 后台进件 +// * @param userId +// * @param channelId +// * @param merchantCode +// * @return +// */ +// public RespBody manualMerchantIncome(Integer userId, String channelId, String merchantCode){ +// //检查进件通道 +// if (ObjectUtil.isEmpty(channelId)){ +// return new RespBody("000080"); +// } +// TbPlussMerchantChannelStatus merchantChannelStatus = merchantChannelStatusMapper.selectByPrimaryKey(Integer.valueOf(channelId)); +// if (ObjectUtil.isEmpty(merchantChannelStatus)){ +// return new RespBody("000081"); +// } +// //通道互不干扰 +// if ("1".equals(channelId)) { +// TbPlussMerchantChannelStatus sxfChannel = merchantChannelStatusMapper.selectByMerchantCode(merchantCode, 3); +// if (sxfChannel != null || Objects.equals(sxfChannel.getChannel(),3)){ +// return new RespBody("000082"); +// } +// } +// if ("3".equals(channelId)) { +// TbPlussMerchantChannelStatus ryxChannel = merchantChannelStatusMapper.selectByMerchantCode(merchantCode, 1); +// if (ryxChannel != null && Objects.equals(ryxChannel.getChannel(), 1)) { +// return new RespBody("000083"); +// } +// } +// //先查询该通道下是否有记录 +// TbPlussMerchantChannelStatus mcs = merchantChannelStatusMapper.selectByMerchantCode(merchantCode, Integer.valueOf(channelId)); +// if (mcs == null) { +// return new RespBody("000084"); +// } else { +// if (mcs.getChannel() != null) { +// if (Integer.parseInt(channelId) == mcs.getChannel() +// && TbPlussMerchantChannelStatus.isAudited(mcs)) { +// return new RespBody("000085"); +// } +// } +// } +// TbPlussMerchantChannelStatus.checkCanAudit(mcs); +// //选择通道 +// switch (channelId) { +// case "1": +// // 随行付 +// sxfMerchantAuditService.merchantAudit(String.valueOf(userId), false); // break; -// case "3": -// // 瑞银信 -// ryxMerchantAuditService.merchantAudit(userId, false); -// break; -// case "4": -// // 银盛 -// ysAuditServiceV3.merchantAuditV3(userId, false, 4); -// break; -// case "5": -// laKalaInterface.createTuoKeInfo(userId); -// break; -// case "6": -// ysAuditServiceV3.merchantAuditV3(userId, false, 6); -// break; -// default: -// MsgException.throwException("未知的进件通道"); - } - return new RespBody("000000"); - } +//// case "2": +//// // 乐刷,暂不支持 +//// leshuaMerchantAuditService.merchantAudit(userId, false); +//// break; +//// case "3": +//// // 瑞银信 +//// ryxMerchantAuditService.merchantAudit(userId, false); +//// break; +//// case "4": +//// // 银盛 +//// ysAuditServiceV3.merchantAuditV3(userId, false, 4); +//// break; +//// case "5": +//// laKalaInterface.createTuoKeInfo(userId); +//// break; +//// case "6": +//// ysAuditServiceV3.merchantAuditV3(userId, false, 6); +//// break; +//// default: +//// MsgException.throwException("未知的进件通道"); +// } +// return new RespBody("000000"); +// } public TbPlussMerchantChannelStatus getValidData(String merchantCode){ if (StringUtils.isEmpty(merchantCode)) { @@ -191,18 +188,79 @@ public class MerchantChannelStatusService { return merchantChannelStatusMapper.getIncomingInfoAnother(merchantCode); } - public RespBody messageChannel(Integer userId){ - HashMap> map = new HashMap<>(); + public RespBody messageChannel(Integer userId,String merchantCode){ //获取审核备注组 List merchantRejectDescs = merchantRejectDescMapper.selectRejectList(); //通道选择 List merchantChannels = merchantChannelMapper.selectAll(); //默认结算方式 TbPlussAccount account = accountMapper.selectDefault(userId); + //初始化 + HashMap channelMap = new HashMap<>(); + channelMap.put("reviewRemarks",merchantRejectDescs); + channelMap.put("merchantChannels",merchantChannels); - //TODO + List merchantChannelMessage = new ArrayList<>(); + //D1(已完成) + List channelD1 = merchantChannelStatusMapper.getByCodeAndChannelFlagList(merchantCode, "D1"); + if (channelD1.size()>1){ + return new RespBody("000087"); + } + if (channelD1.size() != 0) { + HashMap d1 = new HashMap<>(); + //审核备注 + d1.put("remake", channelD1.get(0).getRemark()); + d1.put("status",channelD1.get(0).getStatus()); + d1.put("channel",channelD1.get(0).getChannel()); + d1.put("valid",account == null? null:account.getChanneltype()); + d1.put("thirdStatus",channelD1.get(0).getThirdstatus()); + merchantChannelMessage.add(d1); + } - return new RespBody(); + //D0(已完成) + List channelD0 = merchantChannelStatusMapper.getByCodeAndChannelFlagList(merchantCode, "D0"); + if (channelD0.size()>1){ + return new RespBody("000087"); + } + if (channelD0.size() != 0) { + HashMap d0 = new HashMap<>(); + //审核备注 + d0.put("remake", channelD0.get(0).getRemark()); + d0.put("status",channelD0.get(0).getStatus()); + d0.put("channel",channelD0.get(0).getChannel()); + d0.put("valid",account == null? null:account.getChanneltype()); + d0.put("thirdStatus",channelD0.get(0).getThirdstatus()); + merchantChannelMessage.add(d0); + } + + //未审核 + List channel = merchantChannelStatusMapper.getByCodeAndChannelFlagList(merchantCode, "1"); + if (channel.size()>1){ + return new RespBody("000087"); + } + if (channel.size() != 0) { + HashMap unaudited = new HashMap<>(); + //审核备注 + unaudited.put("remake", channel.get(0).getRemark()); + unaudited.put("status",channel.get(0).getStatus()); + unaudited.put("channel",channel.get(0).getChannel()); + unaudited.put("valid",account == null? null:account.getChanneltype()); + unaudited.put("thirdStatus",channel.get(0).getThirdstatus()); + merchantChannelMessage.add(unaudited); + } + channelMap.put("merchantChannelMessage",merchantChannelMessage); + return new RespBody(channelMap); + } + /** + * ip记录 + * @param userId + * @return + */ + public RespBody userIpPageInfo(Integer userId, Integer currPage, Integer size){ + PageHelper.startPage(currPage, size); + List operationRecord = operationRecordMapper.selectUserSameIpCountPage(userId); + PageInfo mercOrderDetailPageInfo = new PageInfo<>(operationRecord); + return new RespBody(mercOrderDetailPageInfo); } } diff --git a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/service/NotificationService.java b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/service/NotificationService.java index 1551769..f746b76 100644 --- a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/service/NotificationService.java +++ b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/service/NotificationService.java @@ -23,8 +23,14 @@ public class NotificationService { public RespBody notificationQuery(Integer currPage, Integer size){ PageHelper.startPage(currPage, size); + //消失列表 List notificationList = tbPlussNoticeMapper.queryNotification(); PageInfo pageInfo=new PageInfo(notificationList); - return new RespBody(pageInfo); + //未读信息 + Integer unread = tbPlussNoticeMapper.unreadMessage(); + HashMap map = new HashMap<>(); + map.put("unread",unread); + map.put("list",pageInfo); + return new RespBody(map); } } diff --git a/newadmin/common-api/src/main/java/com/chaozhanggui/common/system/config/RespBody.java b/newadmin/common-api/src/main/java/com/chaozhanggui/common/system/config/RespBody.java index 62ca198..d5eb1e8 100644 --- a/newadmin/common-api/src/main/java/com/chaozhanggui/common/system/config/RespBody.java +++ b/newadmin/common-api/src/main/java/com/chaozhanggui/common/system/config/RespBody.java @@ -25,7 +25,8 @@ public class RespBody { setMessage(e.getMessage(),"-60009"); }else { try { - setCode(e.getMessage()); + setCode(RespBody.fail); + setMessage(e.getMessage()); } catch (NumberFormatException e1) { setMessage(e.getMessage(),"-1"); logger.info("", e); diff --git a/newadmin/common-api/src/main/java/com/chaozhanggui/common/system/util/ExceptionUtil.java b/newadmin/common-api/src/main/java/com/chaozhanggui/common/system/util/ExceptionUtil.java index 1b81a12..a77bc1c 100644 --- a/newadmin/common-api/src/main/java/com/chaozhanggui/common/system/util/ExceptionUtil.java +++ b/newadmin/common-api/src/main/java/com/chaozhanggui/common/system/util/ExceptionUtil.java @@ -85,6 +85,7 @@ public class ExceptionUtil { map.put("000084","商户未提交进件请求"); map.put("000085","当前通道下已进件,请选择别的进件通道"); map.put("000086","不是目标用户"); + map.put("000087","数据有误"); diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantChannelMapper.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantChannelMapper.java index 6d4720a..1e7338a 100644 --- a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantChannelMapper.java +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantChannelMapper.java @@ -25,4 +25,5 @@ public interface TbPlussMerchantChannelMapper extends IService selectAll(); + List getValidChannelIdList(); } \ No newline at end of file diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantChannelStatusMapper.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantChannelStatusMapper.java index 375df33..b1b4220 100644 --- a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantChannelStatusMapper.java +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantChannelStatusMapper.java @@ -32,9 +32,13 @@ public interface TbPlussMerchantChannelStatusMapper { Map selectByUserId(@Param("userId") String userId, @Param("channel") String channel); TbPlussMerchantChannelStatus getByCodeAndChannelFlag(@Param("merchantCode") String merchantCode, @Param("virChannelFlag") String virChannelFlag); + List getByCodeAndChannelFlagList(@Param("merchantCode") String merchantCode, @Param("virChannelFlag") String virChannelFlag); + TbPlussMerchantChannelStatus getByCodeNullChannel(@Param("merchantCode") String merchantCode); TbPlussMerchantChannelStatus getByMerchantCode(@Param("merchantCode") String merchantCode,@Param("channel") String channel ); + List getByMerchantCodes(@Param("merchantCode") String merchantCode); + TbPlussMerchantChannelStatus getByIdLock(@Param("id") Integer id); List getByMerchantCodeList(@Param("merchantCode") String merchantCode); @@ -46,4 +50,6 @@ public interface TbPlussMerchantChannelStatusMapper { TbPlussMerchantChannelStatus getIncomingInfo(@Param("status1")String status1, @Param("status2")String status2, @Param("merchantCode")String merchantCode); TbPlussMerchantChannelStatus getIncomingInfoAnother(@Param("merchantCode")String merchantCode); + + TbPlussMerchantChannelStatus reject(@Param("merchantCode") String merchantCode,@Param("ids") List ids); } \ No newline at end of file diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussNoticeMapper.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussNoticeMapper.java index c4aec89..15aba85 100644 --- a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussNoticeMapper.java +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussNoticeMapper.java @@ -25,5 +25,7 @@ public interface TbPlussNoticeMapper { int updateByPrimaryKey(TbPlussNotice record); + Integer unreadMessage(); + List queryNotification(); } \ No newline at end of file diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussOperationRecordMapper.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussOperationRecordMapper.java index 953d413..cf40282 100644 --- a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussOperationRecordMapper.java +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussOperationRecordMapper.java @@ -1,10 +1,14 @@ package com.chaozhanggui.dao.system.dao; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.chaozhanggui.dao.system.entity.TbPlussOperationRecord; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Component; +import java.util.List; + @Component @Mapper public interface TbPlussOperationRecordMapper { @@ -21,4 +25,7 @@ public interface TbPlussOperationRecordMapper { int updateByPrimaryKeyWithBLOBs(TbPlussOperationRecord record); int updateByPrimaryKey(TbPlussOperationRecord record); + + List selectUserSameIpCountPage(@Param("userId") Integer userId); + } \ No newline at end of file diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussUserAppMapper.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussUserAppMapper.java index b163d5b..d1090ba 100644 --- a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussUserAppMapper.java +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussUserAppMapper.java @@ -20,6 +20,8 @@ public interface TbPlussUserAppMapper { int insertSelective(TbPlussUserApp record); TbPlussUserApp selectByPrimaryKey(Integer id); + + TbPlussUserApp selectByMerchantCode(@Param("merchantCode")String merchantCode); TbPlussUserApp selectByUserId(Integer userId); int updateByPrimaryKeySelective(TbPlussUserApp record); diff --git a/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelMapper.xml b/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelMapper.xml index 381f08f..fdff326 100644 --- a/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelMapper.xml +++ b/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelMapper.xml @@ -94,4 +94,7 @@ + \ No newline at end of file diff --git a/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelStatusMapper.xml b/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelStatusMapper.xml index 6e1940d..9118920 100644 --- a/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelStatusMapper.xml +++ b/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelStatusMapper.xml @@ -454,4 +454,26 @@ SELECT * FROM tb_pluss_merchant_channel_status WHERE id = #{id} FOR UPDATE; + + + \ No newline at end of file diff --git a/newadmin/dao-api/src/main/resources/mapper/TbPlussNoticeMapper.xml b/newadmin/dao-api/src/main/resources/mapper/TbPlussNoticeMapper.xml index b24ef20..3ac41fb 100644 --- a/newadmin/dao-api/src/main/resources/mapper/TbPlussNoticeMapper.xml +++ b/newadmin/dao-api/src/main/resources/mapper/TbPlussNoticeMapper.xml @@ -38,9 +38,21 @@ - + + + + delete from tb_pluss_notice where id = #{id,jdbcType=INTEGER} diff --git a/newadmin/dao-api/src/main/resources/mapper/TbPlussOperationRecordMapper.xml b/newadmin/dao-api/src/main/resources/mapper/TbPlussOperationRecordMapper.xml index d510a0e..2d9a1d0 100644 --- a/newadmin/dao-api/src/main/resources/mapper/TbPlussOperationRecordMapper.xml +++ b/newadmin/dao-api/src/main/resources/mapper/TbPlussOperationRecordMapper.xml @@ -27,7 +27,27 @@ from tb_pluss_operation_record where id = #{id,jdbcType=INTEGER} - + + delete from tb_pluss_operation_record where id = #{id,jdbcType=INTEGER} diff --git a/newadmin/dao-api/src/main/resources/mapper/TbPlussUserAppMapper.xml b/newadmin/dao-api/src/main/resources/mapper/TbPlussUserAppMapper.xml index bc7c112..d2d1eaf 100644 --- a/newadmin/dao-api/src/main/resources/mapper/TbPlussUserAppMapper.xml +++ b/newadmin/dao-api/src/main/resources/mapper/TbPlussUserAppMapper.xml @@ -572,4 +572,10 @@ from tb_pluss_user_app where userId = #{userId} + \ No newline at end of file diff --git a/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/MerchantService.java b/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/MerchantService.java index 4ba7a81..f607e0e 100644 --- a/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/MerchantService.java +++ b/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/MerchantService.java @@ -1,20 +1,20 @@ package com.chaozhanggui.merchant.service; import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.chaozhanggui.common.system.config.MsgException; -import com.chaozhanggui.dao.system.dao.TbPlussMerchantBaseInfoMapper; -import com.chaozhanggui.dao.system.dao.TbPlussMerchantChannelMapper; -import com.chaozhanggui.dao.system.dao.TbPlussMerchantChannelStatusMapper; -import com.chaozhanggui.dao.system.dao.TbPlussUserInfoMapper; -import com.chaozhanggui.dao.system.entity.TbPlussMerchantBaseInfo; -import com.chaozhanggui.dao.system.entity.TbPlussMerchantChannel; -import com.chaozhanggui.dao.system.entity.TbPlussMerchantChannelStatus; -import com.chaozhanggui.dao.system.entity.TbPlussUserInfo; +import com.chaozhanggui.dao.system.dao.*; +import com.chaozhanggui.dao.system.entity.*; import com.chaozhanggui.merchant.service.sxf.SxfMerchantAuditService; +import com.chaozhanggui.merchant.service.ys.YSAuditServiceV3; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.Collections; +import java.util.Date; +import java.util.List; import java.util.Map; @Service @@ -36,6 +36,12 @@ public class MerchantService { private LklAuditService lklAuditService; @Resource private SxfMerchantAuditService sxfMerchantAuditService; + @Resource + private YSAuditServiceV3 ysAuditServiceV3; + @Resource + private TbPlussUserAppMapper tbPlussUserAppMapper; + @Resource + private TbPlussNoticeMapper tbPlussNoticeMapper; /** * 通用进件方法 @@ -94,6 +100,7 @@ public class MerchantService { case "3": break; case "4": + ysAuditServiceV3.merchantAuditV3(userId,false, Integer.valueOf(channelId)); break; case "5": @@ -104,6 +111,7 @@ public class MerchantService { break; case "6": + ysAuditServiceV3.merchantAuditV3(userId,false, Integer.valueOf(channelId)); break; default: MsgException.throwException("未知的进件通道"); @@ -113,7 +121,51 @@ public class MerchantService { } + @Transactional(rollbackFor = Exception.class) + public void rejectAudit(String merchantCode, String errMsg){ + MsgException.checkBlank(errMsg, "请补充驳回原因"); + List validChannelIdList = tbPlussMerchantChannelMapper.getValidChannelIdList(); + +// LambdaQueryWrapper qWrapper = new LambdaQueryWrapper() +// .eq(MerchantChannelStatus::getMerchantCode, merchantCode) +// .and(wrapper -> wrapper.in(MerchantChannelStatus::getChannel, validChannelIdList) +// .or() +// .isNull(MerchantChannelStatus::getChannel)) +// .eq(MerchantChannelStatus::getStatus, "1") +// .eq(MerchantChannelStatus::getThirdStatus, "-100"); +// +// MerchantChannelStatus merchantChannelStatus = getOne(qWrapper); + + TbPlussMerchantChannelStatus merchantChannelStatus = tbPlussMerchantChannelStatusMapper.reject(merchantCode, validChannelIdList); + + TbPlussMerchantChannelStatus.checkCanAudit(merchantChannelStatus); + + // 添加行数据锁 + merchantChannelStatus = tbPlussMerchantChannelStatusMapper.getByIdLock(merchantChannelStatus.getId()); + + // + TbPlussMerchantChannelStatus merchant = new TbPlussMerchantChannelStatus(); + merchant.setId(merchantChannelStatus.getId()); + merchant.setStatus(TbPlussMerchantChannelStatus.AUDIT_STATUS_REJECT); + merchant.setRemark(errMsg); + merchant.setCallbackstatus("1"); + merchant.setUpdatetime(new Date()); + merchant.setThirdstatus(""); + tbPlussMerchantChannelStatusMapper.updateByPrimaryKeySelective(merchant); + + TbPlussUserApp userApp = tbPlussUserAppMapper.selectByMerchantCode(merchantCode); + + + TbPlussNotice notice = new TbPlussNotice(1, 1, userApp); + notice.setNoticecode(System.currentTimeMillis() + ""); + notice.setUniquekey(System.currentTimeMillis() + ""); + notice.setCreatedt(new Date()); + notice.setConrtent("商户进件驳回, " + errMsg); + + tbPlussNoticeMapper.insertSelective(notice); + + } public static boolean isAudited(TbPlussMerchantChannelStatus mcs) {