diff --git a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaLedgerService.java b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaLedgerService.java index 1238883..6417092 100644 --- a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaLedgerService.java +++ b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaLedgerService.java @@ -46,6 +46,8 @@ public class LaKaLaLedgerService { private BsMerAttachService merAttachService; @Resource private BsMerPlatformNoService merPlatformNoService; + @Resource + private CommonService commonService; /** * 商户分账业务开通申请 @@ -63,7 +65,10 @@ public class LaKaLaLedgerService { if (mer == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } - + SecDictionary org = commonService.mappingSysCode("ORG_NO", mer.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } Map commonParam = new HashMap<>(); commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); commonParam.put("version", "1.0.0"); @@ -73,7 +78,7 @@ public class LaKaLaLedgerService { Map map = new HashMap<>(); map.put("version", "1.0"); map.put("orderNo", orderNo); - map.put("orgCode", mer.getOrgNo()); + map.put("orgCode", org.getExt1()); map.put("merCupNo", merLedger.getCupNo()); map.put("contactMobile", mer.getRegPhone()); map.put("splitLowestRatio", merLedger.getSplitLowestRatio()); @@ -124,6 +129,11 @@ public class LaKaLaLedgerService { if (mer == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } + SecDictionary org = commonService.mappingSysCode("ORG_NO", mer.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } + Map commonParam = new HashMap<>(); commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); commonParam.put("version", "1.0.0"); @@ -133,7 +143,7 @@ public class LaKaLaLedgerService { Map map = new HashMap<>(); map.put("version", "1.0"); map.put("orderNo", orderNo); - map.put("orgCode", mer.getOrgNo()); + map.put("orgCode", org.getExt1()); map.put("receiverNo", merLedger.getReceiverNo()); map.put("merCupNo", merLedger.getCupNo()); map.put("contactMobile", mer.getRegPhone()); @@ -188,7 +198,10 @@ public class LaKaLaLedgerService { if (mer == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } - + SecDictionary org = commonService.mappingSysCode("ORG_NO", mer.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } Map commonParam = new HashMap<>(); commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); commonParam.put("version", "1.0.0"); @@ -198,7 +211,7 @@ public class LaKaLaLedgerService { Map map = new HashMap<>(); map.put("version", "1.0"); map.put("orderNo", orderNo); - map.put("orgCode", mer.getOrgNo()); + map.put("orgCode", org.getExt1()); map.put("merCupNo", merLedger.getCupNo()); map.put("contactMobile", mer.getRegPhone()); map.put("splitLowestRatio", merLedger.getSplitLowestRatio()); @@ -254,6 +267,10 @@ public class LaKaLaLedgerService { if (mer == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } + SecDictionary org = commonService.mappingSysCode("ORG_NO", mer.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } Map commonParam = new HashMap<>(); commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); commonParam.put("version", "1.0.0"); @@ -263,7 +280,7 @@ public class LaKaLaLedgerService { Map map = new HashMap<>(); map.put("version", "1.0"); map.put("orderNo", orderNo); - map.put("orgCode", mer.getOrgNo()); + map.put("orgCode", org.getExt1()); map.put("merCupNo", merCupNo); commonParam.put("reqData", map); @@ -292,6 +309,10 @@ public class LaKaLaLedgerService { if (merDetail == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } + SecDictionary org = commonService.mappingSysCode("ORG_NO", merDetail.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } Map commonParam = new HashMap<>(); commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); commonParam.put("version", "1.0.0"); @@ -300,7 +321,7 @@ public class LaKaLaLedgerService { Map map = new HashMap<>(); map.put("version", "1.0"); map.put("orderNo", System.currentTimeMillis()+""); - map.put("orgCode", merDetail.getOrgNo()); + map.put("orgCode", org.getExt1()); map.put("receiverName", merDetail.getMerName()); map.put("contactMobile", merDetail.getRegPhone()); map.put("acctTypeCode", merDetail.getMerSettleAcct().getSettleType().equals(MerSettleType.status1.getNumber())?57:58);// 57:对公 58:对私 @@ -373,6 +394,10 @@ public class LaKaLaLedgerService { if (merDetail == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } + SecDictionary org = commonService.mappingSysCode("ORG_NO", merDetail.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } Map commonParam = new HashMap<>(); commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); commonParam.put("version", "1.0.0"); @@ -381,7 +406,7 @@ public class LaKaLaLedgerService { Map map = new HashMap<>(); map.put("version", "1.0"); map.put("orderNo", System.currentTimeMillis()+""); - map.put("orgCode", merDetail.getOrgNo()); + map.put("orgCode", org.getExt1()); map.put("receiverNo", "1"); map.put("receiverName", merDetail.getMerName()); map.put("contactMobile", merDetail.getRegPhone()); @@ -447,6 +472,10 @@ public class LaKaLaLedgerService { if (mer == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } + SecDictionary org = commonService.mappingSysCode("ORG_NO", merDetail.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } Map commonParam = new HashMap<>(); commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); commonParam.put("version", "1.0.0"); @@ -455,7 +484,7 @@ public class LaKaLaLedgerService { Map map = new HashMap<>(); map.put("version", "1.0"); map.put("orderNo", System.currentTimeMillis()+""); - map.put("orgCode", mer.getOrgNo()); + map.put("orgCode", org.getExt1()); map.put("merCupNo", merLedgerReceiver.getCupNo()); map.put("receiverNo", merLedgerReceiver.getReceiverNo()); @@ -508,6 +537,10 @@ public class LaKaLaLedgerService { if (mer == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } + SecDictionary org = commonService.mappingSysCode("ORG_NO", mer.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } Map commonParam = new HashMap<>(); commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); commonParam.put("version", "1.0.0"); @@ -516,7 +549,7 @@ public class LaKaLaLedgerService { Map map = new HashMap<>(); map.put("version", "1.0"); map.put("orderNo", System.currentTimeMillis()+""); - map.put("orgCode", mer.getOrgNo()); + map.put("orgCode", org.getExt1()); map.put("merCupNo", merLedgerReceiver.getCupNo()); map.put("receiverNo", merLedgerReceiver.getReceiverNo()); String base64ImgUrl = ImageUtils.getBase64ByImgUrl(CommonSysConst.getSysConfig().getObs_url() + merLedgerReceiver.getRelieveEntrustFilePath()); diff --git a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeSeparateService.java b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeSeparateService.java index 9413fc5..06aaf0d 100644 --- a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeSeparateService.java +++ b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeSeparateService.java @@ -40,6 +40,8 @@ public class LaKaLaTradeSeparateService { private BsTradeOrderProfitSharingReceiverService tradeOrderProfitSharingReceiverService; @Resource private BsMerService merService; + @Resource + private CommonService commonService; /** * 发起分账 @@ -63,6 +65,11 @@ public class LaKaLaTradeSeparateService { // 分账接收方 List profitSharingReceiverList = tradeOrderProfitSharingReceiverService.getReceiverListByProfitSharingId(tradeOrderProfitSharing.getId()); + SecDictionary org = commonService.mappingSysCode("ORG_NO", mer.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } + Map commonParam = new HashMap<>(); commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss")); commonParam.put("version", "3.0"); @@ -73,7 +80,7 @@ public class LaKaLaTradeSeparateService { map.put("log_date", DateUtil.date2String(tradeOrder.getPayTime(), "yyyyMMdd")); map.put("out_separate_no", tradeOrderProfitSharing.getProfitSharingOrderNo()); map.put("total_amt", tradeOrderProfitSharing.getProfitSharingAmoun().multiply(new BigDecimal("100")).longValue()); - map.put("lkl_org_no", mer.getOrgNo()); + map.put("lkl_org_no", org.getExt1()); map.put("cal_type", "0"); List> recvDatasMapList = new ArrayList<>(); 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 7a7cf8b..1d0a7a7 100644 --- a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaWalletService.java +++ b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaWalletService.java @@ -10,8 +10,10 @@ import com.hfkj.common.utils.HttpsUtils; import com.hfkj.config.CommonSysConst; import com.hfkj.entity.BsMer; import com.hfkj.entity.BsMerPlatformNo; +import com.hfkj.entity.SecDictionary; import com.hfkj.service.BsMerPlatformNoService; import com.hfkj.service.BsMerService; +import com.hfkj.service.CommonService; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -31,6 +33,8 @@ public class LaKaLaWalletService { private BsMerPlatformNoService merPlatformNoService; @Resource private BsMerService merService; + @Resource + private CommonService commonService; /** * 商户开通主动结算业务 @@ -43,7 +47,15 @@ public class LaKaLaWalletService { if (merPlatform == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到平台商户号"); } + // 商户平台 BsMer mer = merService.getMer(merPlatform.getMerId()); + if (mer == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + SecDictionary org = commonService.mappingSysCode("ORG_NO", mer.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } // 请求参数 Map param = new HashMap<>(); @@ -55,7 +67,7 @@ public class LaKaLaWalletService { Map map = new HashMap<>(); map.put("version", "1.0"); map.put("orderNo", System.currentTimeMillis()+""); - map.put("orgCode", mer.getOrgNo()); + map.put("orgCode", org.getExt1()); map.put("merCupNo", merCupNo); param.put("reqData", map); @@ -87,7 +99,15 @@ public class LaKaLaWalletService { if (merPlatform == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到平台商户号"); } + // 商户平台 BsMer mer = merService.getMer(merPlatform.getMerId()); + if (mer == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + SecDictionary org = commonService.mappingSysCode("ORG_NO", mer.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } // 请求参数 Map param = new HashMap<>(); @@ -97,7 +117,7 @@ public class LaKaLaWalletService { param.put("reqId", new Date().getTime()); Map map = new HashMap<>(); - map.put("orgNo", mer.getOrgNo()); + map.put("orgNo", org.getExt1()); map.put("merchantNo", merCupNo); map.put("drawAmt", drawAmt); map.put("notifyUrl", ""); @@ -134,7 +154,15 @@ public class LaKaLaWalletService { if (merPlatform == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到平台商户号"); } + // 商户平台 BsMer mer = merService.getMer(merPlatform.getMerId()); + if (mer == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + SecDictionary org = commonService.mappingSysCode("ORG_NO", mer.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } // 请求参数 Map param = new HashMap<>(); @@ -144,7 +172,7 @@ public class LaKaLaWalletService { param.put("reqId", new Date().getTime()); Map map = new HashMap<>(); - map.put("orgNo", mer.getOrgNo()); + map.put("orgNo", org.getExt1()); map.put("merchantNo", merCupNo); map.put("payNo", payNo); map.put("payType", payType); @@ -178,7 +206,15 @@ public class LaKaLaWalletService { if (merPlatform == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到平台商户号"); } + // 商户平台 BsMer mer = merService.getMer(merPlatform.getMerId()); + if (mer == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + SecDictionary org = commonService.mappingSysCode("ORG_NO", mer.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } // 请求参数 Map param = new HashMap<>(); @@ -188,7 +224,7 @@ public class LaKaLaWalletService { param.put("reqId", new Date().getTime()); Map map = new HashMap<>(); - map.put("orgNo", mer.getOrgNo()); + map.put("orgNo", org.getExt1()); map.put("merchantNo", merCupNo); map.put("drawJnl", drawJnl); param.put("reqData", map); @@ -223,7 +259,15 @@ public class LaKaLaWalletService { if (merPlatform == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到平台商户号"); } + // 商户平台 BsMer mer = merService.getMer(merPlatform.getMerId()); + if (mer == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + SecDictionary org = commonService.mappingSysCode("ORG_NO", mer.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } // 请求参数 Map param = new HashMap<>(); @@ -233,7 +277,7 @@ public class LaKaLaWalletService { param.put("reqId", new Date().getTime()); Map map = new HashMap<>(); - map.put("bmcpNo", mer.getOrgNo()); + map.put("bmcpNo", org.getExt1()); map.put("mercId", merCupNo); map.put("settleType", settleType); map.put("settleTime", settleTime); @@ -268,8 +312,15 @@ public class LaKaLaWalletService { if (merPlatform == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到平台商户号"); } + // 商户平台 BsMer mer = merService.getMer(merPlatform.getMerId()); - + if (mer == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + SecDictionary org = commonService.mappingSysCode("ORG_NO", mer.getOrgNo()); + if (org == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的机构"); + } // 请求参数 Map param = new HashMap<>(); param.put("timestamp", new Date().getTime()); @@ -278,7 +329,7 @@ public class LaKaLaWalletService { param.put("reqId", new Date().getTime()); Map map = new HashMap<>(); - map.put("bmcpNo", mer.getOrgNo()); + map.put("bmcpNo", org.getExt1()); map.put("mercId", merCupNo); param.put("reqData", map);