|
|
@ -282,7 +282,6 @@ public class SaasMerService { |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public JSONObject updateSettleApply(Long applyId) { |
|
|
|
public JSONObject updateSettleApply(Long applyId) { |
|
|
|
try { |
|
|
|
|
|
|
|
// 结算申请
|
|
|
|
// 结算申请
|
|
|
|
BsMerSettleAcctApply merSettleAcctApply = merSettleAcctApplyService.getApplyById(applyId); |
|
|
|
BsMerSettleAcctApply merSettleAcctApply = merSettleAcctApplyService.getApplyById(applyId); |
|
|
|
if (merSettleAcctApply == null) { |
|
|
|
if (merSettleAcctApply == null) { |
|
|
@ -338,11 +337,75 @@ public class SaasMerService { |
|
|
|
merSettleAcctApply.setApplyNo(responseObj.getString("reviewRelatedId")); |
|
|
|
merSettleAcctApply.setApplyNo(responseObj.getString("reviewRelatedId")); |
|
|
|
merSettleAcctApplyService.editData(merSettleAcctApply); |
|
|
|
merSettleAcctApplyService.editData(merSettleAcctApply); |
|
|
|
return responseObj; |
|
|
|
return responseObj; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
/** |
|
|
|
System.out.println(e); |
|
|
|
* 修改费率 |
|
|
|
return null; |
|
|
|
* @param merId 申请id |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public JSONObject updateFee(Long merId) { |
|
|
|
|
|
|
|
// 平台商户
|
|
|
|
|
|
|
|
BsMerPlatformNo merPlatformNo = merPlatformNoService.getPlatformNo(merId, PlatformTypeEnum.type1); |
|
|
|
|
|
|
|
if (merPlatformNo == null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到平台商户号"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
|
|
|
|
param.put("productCode", "WECHAT_PAY"); |
|
|
|
|
|
|
|
param.put("settlementType", "AUTOMATIC"); |
|
|
|
|
|
|
|
// 商户费率
|
|
|
|
|
|
|
|
List<Map<String, Object>> feesMapList = new ArrayList<>(); |
|
|
|
|
|
|
|
Map<String, Object> feesMap; |
|
|
|
|
|
|
|
List<BsMerRate> rateList = merRateService.getRateListByMerId(merId); |
|
|
|
|
|
|
|
for (BsMerRate rate : rateList) { |
|
|
|
|
|
|
|
feesMap = new HashMap<>(); |
|
|
|
|
|
|
|
feesMap.put("fee", rate.getRatePct()); |
|
|
|
|
|
|
|
feesMap.put("feeType", rate.getRateSaasTypeCode()); |
|
|
|
|
|
|
|
feesMapList.add(feesMap); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
param.put("fees", feesMapList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> header = new HashMap<>(); |
|
|
|
|
|
|
|
header.put("Authorization", "bearer " + saasCommon.getUpdateToken()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject responseObj = HttpsUtils.doPost(SaasConfig.requestMerUrl + "channel/customer/update/fee/" + merPlatformNo.getPlatformNo(), param, header); |
|
|
|
|
|
|
|
System.out.println("商户号:" + merPlatformNo.getPlatformNo() + " " + merPlatformNo.getCupNo()); |
|
|
|
|
|
|
|
System.out.println("body:" + JSONObject.toJSONString(param)); |
|
|
|
|
|
|
|
System.out.println("response:" + responseObj.toJSONString()); |
|
|
|
|
|
|
|
if (responseObj == null || !responseObj.getString("message").equals("SUCCESS")) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
merPlatformNo.setExt1(responseObj.getString("reviewRelatedId")); |
|
|
|
|
|
|
|
merPlatformNoService.editMerPlatformNo(merPlatformNo); |
|
|
|
|
|
|
|
return responseObj; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 修改费率 |
|
|
|
|
|
|
|
* @param merId 申请id |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public JSONObject queryFee(Long merId) { |
|
|
|
|
|
|
|
// 平台商户
|
|
|
|
|
|
|
|
BsMerPlatformNo merPlatformNo = merPlatformNoService.getPlatformNo(merId, PlatformTypeEnum.type1); |
|
|
|
|
|
|
|
if (merPlatformNo == null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到平台商户号"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
|
|
|
|
// param.put("productCode", "WECHAT_PAY");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> header = new HashMap<>(); |
|
|
|
|
|
|
|
header.put("Authorization", "bearer " + saasCommon.getUpdateToken()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String doSaasGet = HttpsUtils.doSaasGet(SaasConfig.requestMerUrl + "channel/customer/update/fee/" + merPlatformNo.getPlatformNo(), param, header, false); |
|
|
|
|
|
|
|
JSONObject responseObj = JSONObject.parseObject(doSaasGet); |
|
|
|
|
|
|
|
System.out.println("商户号:" + merPlatformNo.getPlatformNo() + " " + merPlatformNo.getCupNo()); |
|
|
|
|
|
|
|
System.out.println("body:" + JSONObject.toJSONString(param)); |
|
|
|
|
|
|
|
System.out.println("response:" + responseObj.toJSONString()); |
|
|
|
|
|
|
|
if (responseObj == null || !responseObj.getString("message").equals("SUCCESS")) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return responseObj; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -367,6 +430,7 @@ public class SaasMerService { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JSONObject getMerSettle(String customerNo) { |
|
|
|
public JSONObject getMerSettle(String customerNo) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
@ -451,4 +515,5 @@ public class SaasMerService { |
|
|
|
|
|
|
|
|
|
|
|
return str; |
|
|
|
return str; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|