|
|
@@ -337,7 +337,7 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public void handleInsuranceQuery(BigDecimal amount, String policyNo, Long id, String status, String service) {
|
|
|
+ public void handleInsuranceQuery(BigDecimal amount, String policyNo, Long id, String status, String service, String msg) {
|
|
|
InsuranceDO insuranceDO = insuranceMapper.selectById(id);
|
|
|
if(insuranceDO == null){
|
|
|
log.error("handleInsuranceQuery》insuranceDO is null{}", id);
|
|
|
@@ -345,6 +345,7 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|
|
}
|
|
|
insuranceDO.setPremium(amount);
|
|
|
insuranceDO.setPolicyNo(policyNo);
|
|
|
+ insuranceDO.setResMsg(msg);
|
|
|
Integer insuranceStatus = InsuranceStatusEnum.INSURE.getValue();
|
|
|
if ("SUCCESS".equals(status)) {
|
|
|
if("applyTeam".equals(service)) {
|
|
|
@@ -379,23 +380,26 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|
|
BigDecimal paiedAmount = jsonObject.getBigDecimal("paiedAmount");
|
|
|
JSONArray policies = jsonObject.getJSONArray("policies");
|
|
|
if(policies == null) {
|
|
|
- handleInsuranceQuery(paiedAmount, "", insuranceDO.getOrderId(), "FAIL", "");
|
|
|
+ return;
|
|
|
}
|
|
|
com.alibaba.fastjson.JSONObject policy = policies.getJSONObject(0);
|
|
|
if(policy == null) {
|
|
|
- handleInsuranceQuery(paiedAmount, "", insuranceDO.getOrderId(), "FAIL", "");
|
|
|
+ return;
|
|
|
}
|
|
|
String status = policy.getString("status");
|
|
|
String service = policy.getString("service");
|
|
|
+ String msg = policy.getString("msg");
|
|
|
if("PROCESSING".equals(status)) {
|
|
|
log.error("保险查询结果,投保中,继续查询"+insuranceDO.getInsuranceNo());
|
|
|
} else if("FAIL".equals(status)) {
|
|
|
log.error("保险查询结果,投保失败,不再查询"+insuranceDO.getInsuranceNo());
|
|
|
+ Long externalPolicyNumber = policy.getLong("externalPolicyNumber");
|
|
|
+ handleInsuranceQuery(paiedAmount, "", externalPolicyNumber, status, service, msg);
|
|
|
} else if("SUCCESS".equals(status)) {
|
|
|
log.error("保险查询结果,投保成功,不再查询"+insuranceDO.getInsuranceNo());
|
|
|
Long externalPolicyNumber = policy.getLong("externalPolicyNumber");
|
|
|
String policyNo = policy.getString("policyNo");
|
|
|
- handleInsuranceQuery(paiedAmount, policyNo, externalPolicyNumber, status, service);
|
|
|
+ handleInsuranceQuery(paiedAmount, policyNo, externalPolicyNumber, status, service, msg);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -418,23 +422,26 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|
|
BigDecimal paiedAmount = jsonObject.getBigDecimal("paiedAmount");
|
|
|
JSONArray policies = jsonObject.getJSONArray("policies");
|
|
|
if(policies == null) {
|
|
|
- handleInsuranceQuery(paiedAmount, "", insuranceDO.getOrderId(), "FAIL", "");
|
|
|
+ continue;
|
|
|
}
|
|
|
com.alibaba.fastjson.JSONObject policy = policies.getJSONObject(0);
|
|
|
if(policy == null) {
|
|
|
- handleInsuranceQuery(paiedAmount, "", insuranceDO.getOrderId(), "FAIL", "");
|
|
|
+ continue;
|
|
|
}
|
|
|
String status = policy.getString("status");
|
|
|
String service = policy.getString("service");
|
|
|
+ String msg = policy.getString("msg");
|
|
|
if("PROCESSING".equals(status)) {
|
|
|
log.error("保险查询结果,投保中,继续查询"+insuranceDO.getInsuranceNo());
|
|
|
} else if("FAIL".equals(status)) {
|
|
|
log.error("保险查询结果,投保失败,不再查询"+insuranceDO.getInsuranceNo());
|
|
|
+ Long externalPolicyNumber = policy.getLong("externalPolicyNumber");
|
|
|
+ handleInsuranceQuery(paiedAmount, "", externalPolicyNumber, status, service, msg);
|
|
|
} else if("SUCCESS".equals(status)) {
|
|
|
log.error("保险查询结果,投保成功,不再查询"+insuranceDO.getInsuranceNo());
|
|
|
Long externalPolicyNumber = policy.getLong("externalPolicyNumber");
|
|
|
String policyNo = policy.getString("policyNo");
|
|
|
- handleInsuranceQuery(paiedAmount, policyNo, externalPolicyNumber, status, service);
|
|
|
+ handleInsuranceQuery(paiedAmount, policyNo, externalPolicyNumber, status, service, msg);
|
|
|
}
|
|
|
}
|
|
|
}
|