Commit 24986b3c authored by yangyang's avatar yangyang

对接聚富通

parent 332a411c
...@@ -85,14 +85,29 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -85,14 +85,29 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
private static final String APIGW_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwFgHD4kzEVPdOj03ctKM7KV+16bWZ5BMNgvEeuEQwfQYkRVwI9HFOGkwNTMn5hiJXHnlXYCX+zp5r6R52MY0O7BsTCLT7aHaxsANsvI9ABGx3OaTVlPB59M6GPbJh0uXvio0m1r/lTW3Z60RU6Q3oid/rNhP3CiNgg0W6O3AGqwIDAQAB"; private static final String APIGW_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwFgHD4kzEVPdOj03ctKM7KV+16bWZ5BMNgvEeuEQwfQYkRVwI9HFOGkwNTMn5hiJXHnlXYCX+zp5r6R52MY0O7BsTCLT7aHaxsANsvI9ABGx3OaTVlPB59M6GPbJh0uXvio0m1r/lTW3Z60RU6Q3oid/rNhP3CiNgg0W6O3AGqwIDAQAB";
private static final String OUT_VENDOR_ID = "071301"; private static final String OUT_VENDOR_ID = "071301";
private static final String PROJECT_ID = "PJ14001401B000160171"; private static final String PROJECT_ID = "PJ14001401B000160171";
@Value ("${hygf.icbc.trxLmtAmt:200000}") /**
* 协议总限额
*/
@Value ("${hygf.icbc.protocolLimitAmount:2500000000}")
private String protocolLimitAmount;
/**
* 单笔限额
*/
@Value ("${hygf.icbc.trxLmtAmt:10000000}")
private String trxLmtAmt; private String trxLmtAmt;
@Value ("${hygf.icbc.dayLmtAmt:200000}") /**
* 日累计限额
*/
@Value ("${hygf.icbc.dayLmtAmt:20000000}")
private String dayLmtAmt; private String dayLmtAmt;
@Value ("${hygf.icbc.loanTotalAmt:200000}")
@Value ("${hygf.icbc.loanTotalAmt:0}")
private String loanTotalAmt; private String loanTotalAmt;
@Value ("${hygf.icbc.notifyUrl:}") /**
private String notifyUrl; * 合作方接收结果通知 URL
*/
@Value ("${hygf.icbc.callbackUrl:}")
private String callbackUrl;
@Resource (type = PeasantHouseholdServiceImpl.class) @Resource (type = PeasantHouseholdServiceImpl.class)
...@@ -133,14 +148,14 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -133,14 +148,14 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
String formattedDate = formatter.format(newDate); String formattedDate = formatter.format(newDate);
bizContent.setProtocolEndDate(formattedDate); // 协议到期日 bizContent.setProtocolEndDate(formattedDate); // 协议到期日
bizContent.setProtocolLimitAmount("99999999999999999"); // 协议累计额 bizContent.setProtocolLimitAmount(protocolLimitAmount); // 协议累计额
JSONObject templateParams = new JSONObject(); JSONObject templateParams = new JSONObject();
templateParams.put("prtl_enddate", formattedDate); templateParams.put("prtl_enddate", formattedDate);//协议到期日
templateParams.put("loan_total_amt", loanTotalAmt); templateParams.put("loan_total_amt", loanTotalAmt);// 贷款限额(单位:分)
templateParams.put("trx_lmt_amt", trxLmtAmt); templateParams.put("trx_lmt_amt", trxLmtAmt);// 单笔限额(单位:分)
templateParams.put("day_lmt_amt", dayLmtAmt); templateParams.put("day_lmt_amt", dayLmtAmt);// 日累计限额(单位:分)
bizContent.setTemplateParams(templateParams.toJSONString()); bizContent.setTemplateParams(templateParams.toJSONString());
bizContent.setCallbackUrl(notifyUrl); bizContent.setCallbackUrl(callbackUrl);
bizContent.setCamsPublicKey(CAMS_PUBLIC_KEY); bizContent.setCamsPublicKey(CAMS_PUBLIC_KEY);
request.setBizContent(bizContent); request.setBizContent(bizContent);
...@@ -207,9 +222,8 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -207,9 +222,8 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
*/ */
public Object registerWalletCallback(HttpServletRequest request, HttpServletResponse response) throws Exception { public Object registerWalletCallback(HttpServletRequest request, HttpServletResponse response) throws Exception {
log.info("户用光伏开户签约异步通知, => 验签"); log.info("户用光伏开户签约异步通知, => 验签");
boolean verifyFlag = verifySignData(request, notifyUrl); boolean verifyFlag = verifySignData(request, callbackUrl);
String returnJson; String returnJson;
// 获取其他参数略...
if (verifyFlag) { if (verifyFlag) {
// 验签成功 // 验签成功
String biz_content = request.getParameter("biz_content"); String biz_content = request.getParameter("biz_content");
...@@ -224,8 +238,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -224,8 +238,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
String projectId = data.get("projectId"); String projectId = data.get("projectId");
String openAccoutSucceedFlag = data.get("openAccoutSucceedFlag"); String openAccoutSucceedFlag = data.get("openAccoutSucceedFlag");
String signEntrsutPrtlSucceedFlag = data.get("signEntrsutPrtlSucceedFlag"); String signEntrsutPrtlSucceedFlag = data.get("signEntrsutPrtlSucceedFlag");
JftApiUserEntrustopenacctQueryResponseV1 jftApiUserEntrustopenacctQueryResponse = this.getHygfIcbcWalletInfo(outUserId); JftApiUserEntrustopenacctQueryResponseV1 hygfIcbcWalletInfo = this.getHygfIcbcWalletInfo(outUserId);
System.out.println(jftApiUserEntrustopenacctQueryResponse);
// region 保存数据 // region 保存数据
HygfIcbcRecord hygfIcbcRecord = this.lambdaQuery().eq(HygfIcbcRecord::getAmosUserId, outUserId).last(" limit 1").one(); HygfIcbcRecord hygfIcbcRecord = this.lambdaQuery().eq(HygfIcbcRecord::getAmosUserId, outUserId).last(" limit 1").one();
if (hygfIcbcRecord == null) { if (hygfIcbcRecord == null) {
...@@ -237,16 +250,18 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -237,16 +250,18 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
hygfIcbcRecord.setMediumId(newPayAcc); hygfIcbcRecord.setMediumId(newPayAcc);
hygfIcbcRecord.setProjectId(projectId); hygfIcbcRecord.setProjectId(projectId);
hygfIcbcRecord.setOpenAccountStatus(openAccoutSucceedFlag); hygfIcbcRecord.setOpenAccountStatus(openAccoutSucceedFlag);
hygfIcbcRecord.setProtocolStatus(jftApiUserEntrustopenacctQueryResponse.getProtocolStatus());
hygfIcbcRecord.setProtocolStartTime(jftApiUserEntrustopenacctQueryResponse.getProtocolStartDate());
hygfIcbcRecord.setProtocolEndTime(jftApiUserEntrustopenacctQueryResponse.getProtocolEndDate());
hygfIcbcRecord.setTrxLimitAmount(jftApiUserEntrustopenacctQueryResponse.getTrxLimitAmount());
hygfIcbcRecord.setDayLimitAmount(jftApiUserEntrustopenacctQueryResponse.getDayLimitAmount());
hygfIcbcRecord.setProtocolLimitAmount(jftApiUserEntrustopenacctQueryResponse.getProtocolLimitAmount());
hygfIcbcRecord.setAppId(jftApiUserEntrustopenacctQueryResponse.getAppId());
hygfIcbcRecord.setOutUserId(jftApiUserEntrustopenacctQueryResponse.getOutUserId());
hygfIcbcRecord.setOutVendorId(jftApiUserEntrustopenacctQueryResponse.getOutVendorId());
hygfIcbcRecord.setSignEntrsutPrtlStatus(signEntrsutPrtlSucceedFlag); hygfIcbcRecord.setSignEntrsutPrtlStatus(signEntrsutPrtlSucceedFlag);
if (hygfIcbcWalletInfo != null) {
hygfIcbcRecord.setProtocolStatus(hygfIcbcWalletInfo.getProtocolStatus());
hygfIcbcRecord.setProtocolStartTime(hygfIcbcWalletInfo.getProtocolStartDate());
hygfIcbcRecord.setProtocolEndTime(hygfIcbcWalletInfo.getProtocolEndDate());
hygfIcbcRecord.setTrxLimitAmount(hygfIcbcWalletInfo.getTrxLimitAmount());
hygfIcbcRecord.setDayLimitAmount(hygfIcbcWalletInfo.getDayLimitAmount());
hygfIcbcRecord.setProtocolLimitAmount(hygfIcbcWalletInfo.getProtocolLimitAmount());
hygfIcbcRecord.setAppId(hygfIcbcWalletInfo.getAppId());
hygfIcbcRecord.setOutUserId(hygfIcbcWalletInfo.getOutUserId());
hygfIcbcRecord.setOutVendorId(hygfIcbcWalletInfo.getOutVendorId());
}
// hygfIcbcRecord.setDiscardStatus(); // hygfIcbcRecord.setDiscardStatus();
hygfIcbcRecord.setAmosUserId(outUserId); hygfIcbcRecord.setAmosUserId(outUserId);
hygfIcbcRecord.setRecDate(new Date()); hygfIcbcRecord.setRecDate(new Date());
...@@ -255,7 +270,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -255,7 +270,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
String copReturnCode = "0";// 通知合作方接收成功的返回码,固定 String copReturnCode = "0";// 通知合作方接收成功的返回码,固定
String copReturnMsg = "success";// 合作方的返回信息,固定 String copReturnMsg = "success";// 合作方的返回信息,固定
returnJson = sign(request, copReturnCode, copReturnMsg); returnJson = sign(request, copReturnCode, copReturnMsg);
log.error("通知响应json结果:{}", returnJson); log.info("通知响应json结果:{}", returnJson);
return returnJson; return returnJson;
} else {// 验签失败 } else {// 验签失败
String copReturnCode = "‐12345"; String copReturnCode = "‐12345";
......
...@@ -248,4 +248,4 @@ spring.elasticsearch.rest.password=123456 ...@@ -248,4 +248,4 @@ spring.elasticsearch.rest.password=123456
spring.elasticsearch.rest.read-timeout=30000 spring.elasticsearch.rest.read-timeout=30000
## 聚富通 配置 ## 聚富通 配置
hygf.icbc.notifyUrl=http://47.92.234.253:8088/hygf/icbc/notify hygf.icbc.callbackUrl=http://47.92.234.253:8088/hygf/icbc/notify
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment