From c0723231d651fe1a25a6ef8c78b03a9f82065ee8 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 8 Jun 2023 17:29:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cweb/notify/LaKaLaController.java | 11 +++++- .../channel/lakala/LaKaLaWalletService.java | 34 ++++++++++++++----- .../com/hfkj/service/BsMerLedgerService.java | 7 ++++ .../service/impl/BsMerLedgerServiceImpl.java | 11 ++++++ 4 files changed, 54 insertions(+), 9 deletions(-) diff --git a/cweb/src/main/java/com/cweb/notify/LaKaLaController.java b/cweb/src/main/java/com/cweb/notify/LaKaLaController.java index 271744b..2109e6a 100644 --- a/cweb/src/main/java/com/cweb/notify/LaKaLaController.java +++ b/cweb/src/main/java/com/cweb/notify/LaKaLaController.java @@ -144,11 +144,20 @@ public class LaKaLaController { // 审核状态 1:通过,2拒绝 if (respData.getString("auditStatus").equals("1")) { merLedger.setStatus(MerLedgerStatusEnum.status1.getNumber()); + merLedgerService.editMerLedger(merLedger); + // 延迟3秒 + Thread.sleep(3000); + + // 配置账户自动结算 + laKaLaWalletService.ewalletSettleProfile(1,merLedger.getCupNo(), "02", "06"); + + // 配置分账接收方账户自动结算 + laKaLaWalletService.ewalletSettleProfile(2,merLedger.getReceiverNo(), "02", "06"); } else { merLedger.setStatus(MerLedgerStatusEnum.status3.getNumber()); merLedger.setRejectReason(respData.getString("remark")); + merLedgerService.editMerLedger(merLedger); } - merLedgerService.editMerLedger(merLedger); } } diff --git a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaWalletService.java b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaWalletService.java index 1d0a7a7..9fb9e02 100644 --- a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaWalletService.java +++ b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaWalletService.java @@ -9,8 +9,10 @@ import com.hfkj.common.utils.GenerateUtil; import com.hfkj.common.utils.HttpsUtils; import com.hfkj.config.CommonSysConst; import com.hfkj.entity.BsMer; +import com.hfkj.entity.BsMerLedger; import com.hfkj.entity.BsMerPlatformNo; import com.hfkj.entity.SecDictionary; +import com.hfkj.service.BsMerLedgerService; import com.hfkj.service.BsMerPlatformNoService; import com.hfkj.service.BsMerService; import com.hfkj.service.CommonService; @@ -32,6 +34,8 @@ public class LaKaLaWalletService { @Resource private BsMerPlatformNoService merPlatformNoService; @Resource + private BsMerLedgerService merLedgerService; + @Resource private BsMerService merService; @Resource private CommonService commonService; @@ -248,19 +252,33 @@ public class LaKaLaWalletService { /** * 账管家提款模式设置 - * @param merCupNo 商户号 + * @param merCupType 商户号类型 1:商户号 2:分账接收方账户 + * @param merCupNo 商户号 * @param settleType 提款模式(01主动提款 02自动结算) * @param settleTime 结算时间(小时)- 默认值:06。如08:00-09:00到账,则传入08 * @return */ - public JSONObject ewalletSettleProfile(String merCupNo, String settleType, String settleTime) { - // 查询平台商户号 - BsMerPlatformNo merPlatform = merPlatformNoService.getPlatformNoByCupNo(merCupNo); - if (merPlatform == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到平台商户号"); + public JSONObject ewalletSettleProfile(Integer merCupType,String merCupNo, String settleType, String settleTime) { + BsMer mer = null; + + if (merCupType.equals(1)) { + // 查询平台商户号 + BsMerPlatformNo merPlatform = merPlatformNoService.getPlatformNoByCupNo(merCupNo); + if (merPlatform == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到平台商户号"); + } + // 商户平台 + mer = merService.getMer(merPlatform.getMerId()); + + } else if (merCupType.equals(2)) { + // 查询分账信息 + BsMerLedger merLedger = merLedgerService.getMerLedgerByReceiverNo(merCupNo); + if (merLedger == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户分账信息"); + } + // 商户平台 + mer = merService.getMer(merLedger.getMerId()); } - // 商户平台 - BsMer mer = merService.getMer(merPlatform.getMerId()); if (mer == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); } diff --git a/service/src/main/java/com/hfkj/service/BsMerLedgerService.java b/service/src/main/java/com/hfkj/service/BsMerLedgerService.java index 6940d02..c28a68a 100644 --- a/service/src/main/java/com/hfkj/service/BsMerLedgerService.java +++ b/service/src/main/java/com/hfkj/service/BsMerLedgerService.java @@ -34,6 +34,13 @@ public interface BsMerLedgerService { */ BsMerLedger getMerLedger(Long merId, PlatformTypeEnum platformType); + /** + * 获取商户分账信息 + * @param receiverNo + * @return + */ + BsMerLedger getMerLedgerByReceiverNo(String receiverNo); + /** * 查询商户分账信息 * @param id diff --git a/service/src/main/java/com/hfkj/service/impl/BsMerLedgerServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsMerLedgerServiceImpl.java index 2776e4b..139f38f 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsMerLedgerServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsMerLedgerServiceImpl.java @@ -69,6 +69,17 @@ public class BsMerLedgerServiceImpl implements BsMerLedgerService { return null; } + @Override + public BsMerLedger getMerLedgerByReceiverNo(String receiverNo) { + BsMerLedgerExample example = new BsMerLedgerExample(); + example.createCriteria().andReceiverNoEqualTo(receiverNo); + List list = merLedgerMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; + } + @Override public BsMerLedger getMerLedgerById(Long id) { return merLedgerMapper.selectByPrimaryKey(id);