|
@@ -251,7 +251,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
|
|
|
|
|
PremiumCalculationResponse premiumCalculationResponse = chengTaiRequestApiComponent.premiumCalculation(premiumCalculationRequest);
|
|
PremiumCalculationResponse premiumCalculationResponse = chengTaiRequestApiComponent.premiumCalculation(premiumCalculationRequest);
|
|
|
maxQuoteNum--;
|
|
maxQuoteNum--;
|
|
|
- if (!premiumCalculationResponse.getHead().getResponseCode().equals("0000")) {
|
|
|
|
|
|
|
+ if (!premiumCalculationResponse.getHead().getErrorMessage().equals("成功")) {
|
|
|
/**
|
|
/**
|
|
|
* 重复投保
|
|
* 重复投保
|
|
|
*/
|
|
*/
|
|
@@ -325,6 +325,31 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
}
|
|
}
|
|
|
return premiumCalculationResponse;
|
|
return premiumCalculationResponse;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public String autoConvertToNormalTime(String timeStr) {
|
|
|
|
|
+ DateTimeFormatter NORMAL_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+
|
|
|
|
|
+ if (timeStr == null || timeStr.isEmpty()) {
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 判断是否是 ISO 8601 格式(包含 T 和 +)
|
|
|
|
|
+ if (timeStr.contains("T") && timeStr.contains("+")) {
|
|
|
|
|
+ // ISO 格式
|
|
|
|
|
+ OffsetDateTime odt = OffsetDateTime.parse(timeStr);
|
|
|
|
|
+ return odt.format(NORMAL_FORMAT);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 普通格式,直接解析再输出(保证格式统一)
|
|
|
|
|
+ LocalDateTime ldt = LocalDateTime.parse(timeStr, NORMAL_FORMAT);
|
|
|
|
|
+ return ldt.format(NORMAL_FORMAT);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ return "时间格式错误";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
private HttpResult<QuoteRespVo> respOrder(PremiumCalculationResponse premiumCalculationResponse, QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution, String orderNumber,
|
|
private HttpResult<QuoteRespVo> respOrder(PremiumCalculationResponse premiumCalculationResponse, QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution, String orderNumber,
|
|
|
BaseQuoteInfoVo quoteInfoVo,PremiumCalculationRequest premiumCalculationRequest) {
|
|
BaseQuoteInfoVo quoteInfoVo,PremiumCalculationRequest premiumCalculationRequest) {
|
|
|
// 保存订单信息
|
|
// 保存订单信息
|
|
@@ -353,6 +378,11 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
insAreaCompanyAccidentalDrivings.add(insAreaCompanyAccidentalDriving);
|
|
insAreaCompanyAccidentalDrivings.add(insAreaCompanyAccidentalDriving);
|
|
|
});
|
|
});
|
|
|
insAreaCompany.setAccidentInfo(JSONArray.parseArray(JSONArray.toJSONString(accident)));
|
|
insAreaCompany.setAccidentInfo(JSONArray.parseArray(JSONArray.toJSONString(accident)));
|
|
|
|
|
+
|
|
|
|
|
+ insAreaCompany.setJqStartDate(this.autoConvertToNormalTime(insAreaCompany.getJqStartDate()));
|
|
|
|
|
+ insAreaCompany.setJqEndDate(this.autoConvertToNormalTime(insAreaCompany.getJqEndDate()));
|
|
|
|
|
+ insAreaCompany.setSyStartDate(this.autoConvertToNormalTime(insAreaCompany.getSyStartDate()));
|
|
|
|
|
+ insAreaCompany.setSyEndDate(this.autoConvertToNormalTime(insAreaCompany.getSyEndDate()));
|
|
|
insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, insAreaCompanyAccidentalDrivings);
|
|
insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, insAreaCompanyAccidentalDrivings);
|
|
|
// 保存交强特约信息
|
|
// 保存交强特约信息
|
|
|
InsAreaCompanyRelatedInfo info = new InsAreaCompanyRelatedInfo();
|
|
InsAreaCompanyRelatedInfo info = new InsAreaCompanyRelatedInfo();
|
|
@@ -462,6 +492,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
return quoteRespVo;
|
|
return quoteRespVo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
public HttpResult<Object> submitImages(String companyId) {
|
|
public HttpResult<Object> submitImages(String companyId) {
|
|
|
try {
|
|
try {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
@@ -679,8 +710,8 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
parameters, insAreaCompany,policyHolderInfo,insuredPersonInfo);
|
|
parameters, insAreaCompany,policyHolderInfo,insuredPersonInfo);
|
|
|
SubmitResponse submitResponse = chengTaiRequestApiComponent.submit(submitRequest);
|
|
SubmitResponse submitResponse = chengTaiRequestApiComponent.submit(submitRequest);
|
|
|
// 响应失败
|
|
// 响应失败
|
|
|
- if (!submitResponse.getResponseCode().equals("0000")) {
|
|
|
|
|
- return HttpResult.error(submitResponse.getErrorMessage());
|
|
|
|
|
|
|
+ if (!submitResponse.getHead().getErrorMessage().equals("成功")) {
|
|
|
|
|
+ return HttpResult.error(submitResponse.getHead().getErrorMessage());
|
|
|
}
|
|
}
|
|
|
// 双险审核通过
|
|
// 双险审核通过
|
|
|
if (submitResponse.getProposal().getUnderWriteInd().equals("1")
|
|
if (submitResponse.getProposal().getUnderWriteInd().equals("1")
|
|
@@ -728,6 +759,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
public HttpResult<Object> submitCallBack(SubmitCallBackRequest submitCallBackRequest) throws Exception {
|
|
public HttpResult<Object> submitCallBack(SubmitCallBackRequest submitCallBackRequest) throws Exception {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(submitCallBackRequest.getOrderCode());
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(submitCallBackRequest.getOrderCode());
|
|
|
if (insAreaCompany == null) {
|
|
if (insAreaCompany == null) {
|
|
@@ -736,6 +768,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
return HttpResult.ok("核保回调请求成功");
|
|
return HttpResult.ok("核保回调请求成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
public HttpResult<Object> paymentCallBack(PaymentCallBackRequest paymentCallBackRequest) throws Exception {
|
|
public HttpResult<Object> paymentCallBack(PaymentCallBackRequest paymentCallBackRequest) throws Exception {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(paymentCallBackRequest.getOrderCode());
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(paymentCallBackRequest.getOrderCode());
|
|
|
if (insAreaCompany == null) {
|
|
if (insAreaCompany == null) {
|
|
@@ -751,20 +784,24 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
return HttpResult.ok("核保回调请求成功");
|
|
return HttpResult.ok("核保回调请求成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
public HttpResult<Object> underwriteCallBack(UnderwriteCallBackRequest underwriteCallBackRequest) throws Exception {
|
|
public HttpResult<Object> underwriteCallBack(UnderwriteCallBackRequest underwriteCallBackRequest) throws Exception {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(underwriteCallBackRequest.getOrderCode());
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(underwriteCallBackRequest.getOrderCode());
|
|
|
if (insAreaCompany == null) {
|
|
if (insAreaCompany == null) {
|
|
|
return HttpResult.error("无此订单");
|
|
return HttpResult.error("无此订单");
|
|
|
}
|
|
}
|
|
|
- // 更新保单号
|
|
|
|
|
- insAreaCompany.setJqpolicyno(underwriteCallBackRequest.getSailPolicyNo());
|
|
|
|
|
- insAreaCompany.setSypolicyno(underwriteCallBackRequest.getCiPolicyNo());
|
|
|
|
|
- // 更新非车保单号
|
|
|
|
|
- if (underwriteCallBackRequest.getNvhlPolicyNo() != null) {
|
|
|
|
|
- JSONArray crossInsurance = insAreaCompany.getCrossInsurance();
|
|
|
|
|
- crossInsurance.getJSONObject(0).put("policy", underwriteCallBackRequest.getNvhlPolicyNo());
|
|
|
|
|
- }
|
|
|
|
|
- insAreaCompanyService.updateById(insAreaCompany);
|
|
|
|
|
|
|
+// // 更新保单号
|
|
|
|
|
+// insAreaCompany.setJqpolicyno(underwriteCallBackRequest.getSailPolicyNo());
|
|
|
|
|
+// insAreaCompany.setSypolicyno(underwriteCallBackRequest.getCiPolicyNo());
|
|
|
|
|
+// // 更新非车保单号
|
|
|
|
|
+// if (underwriteCallBackRequest.getNvhlPolicyNo() != null) {
|
|
|
|
|
+// JSONArray crossInsurance = insAreaCompany.getCrossInsurance();
|
|
|
|
|
+// crossInsurance.getJSONObject(0).put("policy", underwriteCallBackRequest.getNvhlPolicyNo());
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
|
|
+//
|
|
|
|
|
+// insAreaCompanyService.updateById(insAreaCompany);
|
|
|
return HttpResult.ok("核保回调请求成功");
|
|
return HttpResult.ok("核保回调请求成功");
|
|
|
}
|
|
}
|
|
|
|
|
|