Commit 8f4153dd by 翁国栋

回滚为使用多个appid

parent 32d7c5e9
......@@ -55,14 +55,6 @@ public class CallBackContorll {
@Value("${insure.batchToPayUrl}")
private String batchToPayUrl;
@Value("${insure.appid}")
private String appid;
@Value("${insure.secret}")
private String secret;
@Value("${insure.appidq}")
private String appidq;
@Value("${insure.secretq}")
private String secretq;
/*支付回调*/
@Value("${pay_page}")
......@@ -120,7 +112,7 @@ public class CallBackContorll {
InsurePolicy insurePolicy = InsurePolicy.builder().id(insureUserList.get(0).getPolicyId()).build().selectById();
InsureApplicant insureApplicant = InsureApplicant.builder().build().selectOne(new QueryWrapper<InsureApplicant>().lambda().eq(InsureApplicant::getOrgCode, insurePolicy.getOrgCode()));
String value = DigestUtils.md5Hex(pid + secretq + timestamp + sb.toString());
String value = DigestUtils.md5Hex(pid + insureApplicant.getSecretq() + timestamp + sb.toString());
if (!value.equals(sign)) {
throw new CustomException("增员核保回调验签失败");
}
......@@ -209,7 +201,7 @@ public class CallBackContorll {
}
InsurePolicy insurePolicy = InsurePolicy.builder().build().selectOne(new QueryWrapper<InsurePolicy>().lambda().eq(InsurePolicy::getPolicyNo, list.get(0).getPolicyNo()));
InsureApplicant insureApplicant = InsureApplicant.builder().build().selectOne(new QueryWrapper<InsureApplicant>().lambda().eq(InsureApplicant::getOrgCode, insurePolicy.getOrgCode()));
String value = DigestUtils.md5Hex(pid + secretq + timestamp + sb.toString());
String value = DigestUtils.md5Hex(pid + insureApplicant.getSecretq() + timestamp + sb.toString());
if (!value.equals(sign)) {
throw new CustomException("保全增员申请回调验签失败");
}
......@@ -320,7 +312,7 @@ public class CallBackContorll {
InsurePay insurePay = InsurePay.builder().build().selectOne(new QueryWrapper<InsurePay>().lambda().eq(InsurePay::getSerialNumber, callBack.getSerial_number()));
InsurePolicy insurePolicy = InsurePolicy.builder().build().selectOne(new QueryWrapper<InsurePolicy>().lambda().eq(InsurePolicy::getId, insurePay.getPolicyId()));
InsureApplicant insureApplicant = InsureApplicant.builder().build().selectOne(new QueryWrapper<InsureApplicant>().lambda().eq(InsureApplicant::getOrgCode, insurePolicy.getOrgCode()));
String value = DigestUtils.md5Hex(pid + secret + timestamp + sb.toString());
String value = DigestUtils.md5Hex(pid + insureApplicant.getSecret() + timestamp + sb.toString());
if (!value.equals(sign)) {
throw new CustomException("投保支付收银台回调验签失败");
}
......@@ -339,7 +331,7 @@ public class CallBackContorll {
paramsMap.put("sign", sign);
Map bodyMap = Maps.newHashMap();
bodyMap.put("quotation_id", callBack.getSerial_number());
String data = HttpUtils.sendPost(getPolicyUrl, InsureContorll.setParams(JSONObject.toJSONString(bodyMap), appid, secret), bodyMap);
String data = HttpUtils.sendPost(getPolicyUrl, InsureContorll.setParams(JSONObject.toJSONString(bodyMap), insureApplicant.getAppid(), insureApplicant.getSecret()), bodyMap);
Map dataMap = JSONObject.parseObject(data, Map.class);
if (dataMap.size() > 0) {
if (dataMap.get("errcode").toString().equals("suc") || dataMap.get("errcode").toString().equals("e25")) {
......@@ -348,7 +340,7 @@ public class CallBackContorll {
insurePolicy.setUpdateTime(new Date());
insurePolicy.updateById();
}
InsureLog.builder().requestParam(JSONObject.toJSONString(InsureContorll.setParams(JSONObject.toJSONString(bodyMap), appid, secret))).type(7)
InsureLog.builder().requestParam(JSONObject.toJSONString(InsureContorll.setParams(JSONObject.toJSONString(bodyMap), insureApplicant.getAppid(), insureApplicant.getSecret()))).type(7)
.requestData(JSONObject.toJSONString(bodyMap)).createTime(new Date()).requestType(1).returnBody(data).requestPath(getPolicyUrl)
.returnCode(dataMap.get("errcode").toString()).policyId(insurePay.getPolicyId()).returnMsg(dataMap.get("errmsg").toString()).build().insert();
}
......@@ -377,9 +369,9 @@ public class CallBackContorll {
PolicyCallBack callBack = JSONObject.parseObject(sb.toString(), PolicyCallBack.class);
// InsurePay insurePay = InsurePay.builder().build().selectOne(new QueryWrapper<InsurePay>().lambda().eq(InsurePay::getSerialNumber, callBack.getSerial_number()));
InsurePolicy insurePolicy = InsurePolicy.builder().build().selectOne(new QueryWrapper<InsurePolicy>().lambda().eq(InsurePolicy::getSerialNumber,callBack.getSerial_number()));
InsurePolicy insurePolicy = InsurePolicy.builder().build().selectOne(new QueryWrapper<InsurePolicy>().lambda().eq(InsurePolicy::getSerialNumber,callBack.getSerial_number()));
InsureApplicant insureApplicant = InsureApplicant.builder().build().selectOne(new QueryWrapper<InsureApplicant>().lambda().eq(InsureApplicant::getOrgCode, insurePolicy.getOrgCode()));
String value = DigestUtils.md5Hex(pid + secret + timestamp + sb.toString());
String value = DigestUtils.md5Hex(pid + insureApplicant.getSecret() + timestamp + sb.toString());
if (!value.equals(sign)) {
throw new CustomException("保单出单回调验签失败");
}
......@@ -437,7 +429,7 @@ public class CallBackContorll {
InsurePay insurePay = InsurePay.builder().build().selectOne(new QueryWrapper<InsurePay>().lambda().eq(InsurePay::getSerialNumber, callBack.getOrder_import_uuid()));
InsurePolicy insurePolicy = InsurePolicy.builder().build().selectOne(new QueryWrapper<InsurePolicy>().lambda().eq(InsurePolicy::getId, insurePay.getPolicyId()));
InsureApplicant insureApplicant = InsureApplicant.builder().build().selectOne(new QueryWrapper<InsureApplicant>().lambda().eq(InsureApplicant::getOrgCode, insurePolicy.getOrgCode()));
String value = DigestUtils.md5Hex(pid + appidq + timestamp + sb.toString());
String value = DigestUtils.md5Hex(pid + insureApplicant.getAppidq() + timestamp + sb.toString());
if (!value.equals(sign)) {
throw new CustomException("增员支付回调验签失败");
}
......
......@@ -261,10 +261,6 @@ wxgzh:
encodingAesKey: 'chAbt69dLAtk8HH0oGMuZwHzK2SuhnxZI5Jbzc4nNzX'
insure:
#投保 appid
appid: '1002209110212305335'
#投保 secret
secret: '1ef7b79471be7f6b5489832c65109f81'
#投保上传文件
uploadUrl: 'https://portal.unistar-ins.com/service/Home/Index/fileUpload'
#投保立即出单
......@@ -282,10 +278,6 @@ insure:
#预付款出单接口
issue: 'https://portal.unistar-ins.com/cps/Labor/Policy/issue'
#保全appid
appidq: '1000706050307154062'
#保全 secret
secretq: 'c1e2e8dcf231c0d0dfc883c09cd42c5b'
#保全上传文件
uploadUrlq: 'https://portal.unistar-ins.com/fuli/Home/Index/file_upload'
#保全申请
......
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