|
|
|
@ -44,6 +44,8 @@ public class LaKaLaLedgerService { |
|
|
|
|
private BsMerService merService; |
|
|
|
|
@Resource |
|
|
|
|
private BsMerAttachService merAttachService; |
|
|
|
|
@Resource |
|
|
|
|
private BsMerPlatformNoService merPlatformNoService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 商户分账业务开通申请 |
|
|
|
@ -57,8 +59,8 @@ public class LaKaLaLedgerService { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
// 商户
|
|
|
|
|
MerBasisModel merDetail = merService.getMerDetail(merLedger.getMerId()); |
|
|
|
|
if (merDetail == null) { |
|
|
|
|
BsMer mer = merService.getMer(merLedger.getMerId()); |
|
|
|
|
if (mer == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -71,9 +73,9 @@ public class LaKaLaLedgerService { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("version", "1.0"); |
|
|
|
|
map.put("orderNo", orderNo); |
|
|
|
|
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code()); |
|
|
|
|
map.put("orgCode", mer.getOrgNo()); |
|
|
|
|
map.put("merCupNo", merLedger.getCupNo()); |
|
|
|
|
map.put("contactMobile", merDetail.getRegPhone()); |
|
|
|
|
map.put("contactMobile", mer.getRegPhone()); |
|
|
|
|
map.put("splitLowestRatio", merLedger.getSplitLowestRatio()); |
|
|
|
|
map.put("splitEntrustFileName", merLedger.getSplitEntrustFileName()); |
|
|
|
|
// 转换成bas64
|
|
|
|
@ -118,11 +120,10 @@ public class LaKaLaLedgerService { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
// 商户
|
|
|
|
|
MerBasisModel merDetail = merService.getMerDetail(merLedger.getMerId()); |
|
|
|
|
if (merDetail == null) { |
|
|
|
|
BsMer mer = merService.getMer(merLedger.getMerId()); |
|
|
|
|
if (mer == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String, Object> commonParam = new HashMap<>(); |
|
|
|
|
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
|
|
|
|
commonParam.put("version", "1.0.0"); |
|
|
|
@ -132,10 +133,10 @@ public class LaKaLaLedgerService { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("version", "1.0"); |
|
|
|
|
map.put("orderNo", orderNo); |
|
|
|
|
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code()); |
|
|
|
|
map.put("orgCode", mer.getOrgNo()); |
|
|
|
|
map.put("receiverNo", merLedger.getReceiverNo()); |
|
|
|
|
map.put("merCupNo", merLedger.getCupNo()); |
|
|
|
|
map.put("contactMobile", merDetail.getRegPhone()); |
|
|
|
|
map.put("contactMobile", mer.getRegPhone()); |
|
|
|
|
map.put("splitLowestRatio", merLedger.getSplitLowestRatio()); |
|
|
|
|
map.put("splitEntrustFileName", merLedger.getSplitEntrustFileName()); |
|
|
|
|
// 转换成bas64
|
|
|
|
@ -183,8 +184,8 @@ public class LaKaLaLedgerService { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
// 商户
|
|
|
|
|
MerBasisModel merDetail = merService.getMerDetail(merLedger.getId()); |
|
|
|
|
if (merDetail == null) { |
|
|
|
|
BsMer mer = merService.getMer(merLedger.getId()); |
|
|
|
|
if (mer == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -197,9 +198,9 @@ public class LaKaLaLedgerService { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("version", "1.0"); |
|
|
|
|
map.put("orderNo", orderNo); |
|
|
|
|
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code()); |
|
|
|
|
map.put("orgCode", mer.getOrgNo()); |
|
|
|
|
map.put("merCupNo", merLedger.getCupNo()); |
|
|
|
|
map.put("contactMobile", merDetail.getRegPhone()); |
|
|
|
|
map.put("contactMobile", mer.getRegPhone()); |
|
|
|
|
map.put("splitLowestRatio", merLedger.getSplitLowestRatio()); |
|
|
|
|
map.put("splitEntrustFileName", merLedger.getSplitEntrustFileName()); |
|
|
|
|
// map.put("splitEntrustFilePath", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ merLedger.getSplitEntrustFilePath()), "SPLIT_ENTRUST_FILE", "0").getString("url"));
|
|
|
|
@ -244,6 +245,15 @@ public class LaKaLaLedgerService { |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public JSONObject queryLedgerMer(String merCupNo) { |
|
|
|
|
BsMerPlatformNo merPlatform = merPlatformNoService.getPlatformNoByCupNo(merCupNo); |
|
|
|
|
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, "未找到商户"); |
|
|
|
|
} |
|
|
|
|
Map<String, Object> commonParam = new HashMap<>(); |
|
|
|
|
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
|
|
|
|
commonParam.put("version", "1.0.0"); |
|
|
|
@ -253,7 +263,7 @@ public class LaKaLaLedgerService { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("version", "1.0"); |
|
|
|
|
map.put("orderNo", orderNo); |
|
|
|
|
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code()); |
|
|
|
|
map.put("orgCode", mer.getOrgNo()); |
|
|
|
|
map.put("merCupNo", merCupNo); |
|
|
|
|
commonParam.put("reqData", map); |
|
|
|
|
|
|
|
|
@ -290,7 +300,7 @@ public class LaKaLaLedgerService { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("version", "1.0"); |
|
|
|
|
map.put("orderNo", System.currentTimeMillis()+""); |
|
|
|
|
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code()); |
|
|
|
|
map.put("orgCode", merDetail.getOrgNo()); |
|
|
|
|
map.put("receiverName", merDetail.getMerName()); |
|
|
|
|
map.put("contactMobile", merDetail.getRegPhone()); |
|
|
|
|
map.put("acctTypeCode", merDetail.getMerSettleAcct().getSettleType().equals(MerSettleType.status1.getNumber())?57:58);// 57:对公 58:对私
|
|
|
|
@ -355,7 +365,7 @@ public class LaKaLaLedgerService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 创建分账接收方 |
|
|
|
|
* 修改分账接收方 |
|
|
|
|
*/ |
|
|
|
|
public void updateLedgerReceiver(Long merId) { |
|
|
|
|
// 商户
|
|
|
|
@ -371,7 +381,7 @@ public class LaKaLaLedgerService { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("version", "1.0"); |
|
|
|
|
map.put("orderNo", System.currentTimeMillis()+""); |
|
|
|
|
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code()); |
|
|
|
|
map.put("orgCode", merDetail.getOrgNo()); |
|
|
|
|
map.put("receiverNo", "1"); |
|
|
|
|
map.put("receiverName", merDetail.getMerName()); |
|
|
|
|
map.put("contactMobile", merDetail.getRegPhone()); |
|
|
|
@ -432,6 +442,11 @@ public class LaKaLaLedgerService { |
|
|
|
|
if (merLedgerReceiver == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到分账关系"); |
|
|
|
|
} |
|
|
|
|
// 商户
|
|
|
|
|
BsMer mer = merService.getMer(merLedgerReceiver.getMerId()); |
|
|
|
|
if (mer == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); |
|
|
|
|
} |
|
|
|
|
Map<String, Object> commonParam = new HashMap<>(); |
|
|
|
|
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
|
|
|
|
commonParam.put("version", "1.0.0"); |
|
|
|
@ -440,7 +455,7 @@ public class LaKaLaLedgerService { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("version", "1.0"); |
|
|
|
|
map.put("orderNo", System.currentTimeMillis()+""); |
|
|
|
|
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code()); |
|
|
|
|
map.put("orgCode", mer.getOrgNo()); |
|
|
|
|
map.put("merCupNo", merLedgerReceiver.getCupNo()); |
|
|
|
|
map.put("receiverNo", merLedgerReceiver.getReceiverNo()); |
|
|
|
|
|
|
|
|
@ -488,6 +503,11 @@ public class LaKaLaLedgerService { |
|
|
|
|
if (merLedgerReceiver == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到分账关系"); |
|
|
|
|
} |
|
|
|
|
// 商户
|
|
|
|
|
BsMer mer = merService.getMer(merLedgerReceiver.getMerId()); |
|
|
|
|
if (mer == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); |
|
|
|
|
} |
|
|
|
|
Map<String, Object> commonParam = new HashMap<>(); |
|
|
|
|
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
|
|
|
|
commonParam.put("version", "1.0.0"); |
|
|
|
@ -496,7 +516,7 @@ public class LaKaLaLedgerService { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("version", "1.0"); |
|
|
|
|
map.put("orderNo", System.currentTimeMillis()+""); |
|
|
|
|
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code()); |
|
|
|
|
map.put("orgCode", mer.getOrgNo()); |
|
|
|
|
map.put("merCupNo", merLedgerReceiver.getCupNo()); |
|
|
|
|
map.put("receiverNo", merLedgerReceiver.getReceiverNo()); |
|
|
|
|
String base64ImgUrl = ImageUtils.getBase64ByImgUrl(CommonSysConst.getSysConfig().getObs_url() + merLedgerReceiver.getRelieveEntrustFilePath()); |
|
|
|
|