|
|
@@ -1,6 +1,8 @@
|
|
|
package com.ydtech.modules.ins.service.impl;
|
|
|
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
@@ -9,7 +11,6 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.fasterxml.jackson.databind.*;
|
|
|
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
|
|
|
import com.ydtech.components.InsAlltrustRequestApiComponents;
|
|
|
-import com.ydtech.constants.InsTaskHistoryEnum;
|
|
|
import com.ydtech.constants.SysConstants;
|
|
|
import com.ydtech.constants.enums.InsQuoteFlow;
|
|
|
import com.ydtech.constants.enums.InsuranceRisk;
|
|
|
@@ -219,8 +220,8 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
|
|
|
log.info("===永诚--车型查询接口请求开始--" + carInfo.getLicenseNo() + "===");
|
|
|
// InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_MODEL);
|
|
|
- String responseData = httpPostResultLog(m, YcBuildData.API_MODEL, "永诚API方式 - 车型查询(vin:"+carInfo.getVinNo()+") - ");
|
|
|
- AssertionUtils.isEmpty(responseData,"永诚 车型查询接口响应返回空!");
|
|
|
+ String responseData = httpPostResultLog(m, YcBuildData.API_MODEL, "永诚API方式 - 车型查询(vin:" + carInfo.getVinNo() + ") - ");
|
|
|
+ AssertionUtils.isEmpty(responseData, "永诚 车型查询接口响应返回空!");
|
|
|
// String responseData = apiLog.getResponseData();
|
|
|
log.info("===永诚--车型查询接口请求结束--" + carInfo.getLicenseNo() + "===");
|
|
|
ModelsQueryResponse rd = null;
|
|
|
@@ -264,7 +265,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 2 报价
|
|
|
+ * 2 报价-
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
|
@@ -422,12 +423,12 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
System.err.println("新起:" + newStartDate);
|
|
|
System.err.println("新止:" + newEndDate);
|
|
|
|
|
|
- CarInsDateDto cidd = Base.buildInsDate(newStartDate,newEndDate);
|
|
|
+ CarInsDateDto cidd = Base.buildInsDate(newStartDate, newEndDate);
|
|
|
|
|
|
|
|
|
m.getRequestLabel().getCondition().getBase().setTInsrncBgnTmJQ(cidd.getStartDate());
|
|
|
m.getRequestLabel().getCondition().getBase().setTInsrncEndTmJQ(cidd.getEndDate());
|
|
|
- m.getRequestLabel().getCondition().getBase().setCImmeffMrk(cidd.isForthwith()?"1":"0");
|
|
|
+ m.getRequestLabel().getCondition().getBase().setCImmeffMrk(cidd.isForthwith() ? "1" : "0");
|
|
|
|
|
|
|
|
|
return false;
|
|
|
@@ -580,7 +581,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
try {
|
|
|
//子订单
|
|
|
InsAreaCompany iac = insAreaCompanyService.getById(quoteOrderNo);
|
|
|
- AssertionUtils.isEmpty(iac,"子订单不存在");
|
|
|
+ AssertionUtils.isEmpty(iac, "子订单不存在");
|
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
|
|
|
// 获取协议配置信息
|
|
|
@@ -613,8 +614,8 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
// findRegion()
|
|
|
|
|
|
//接口请求
|
|
|
- String responseData = httpPostResultLog(m, YcBuildData.API_AUDIT, "永诚API方式 - 核保(车牌号:"+order.getLicenseno()+") - ");
|
|
|
- AssertionUtils.isEmpty(responseData,logNo + "核保请求超时请重试。");
|
|
|
+ String responseData = httpPostResultLog(m, YcBuildData.API_AUDIT, "永诚API方式 - 核保(车牌号:" + order.getLicenseno() + ") - ");
|
|
|
+ AssertionUtils.isEmpty(responseData, logNo + "核保请求超时请重试。");
|
|
|
|
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
|
AuditResponse rd = gainXmlMapper().readValue(cleanStr, AuditResponse.class);
|
|
|
@@ -642,10 +643,10 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
buildOrderStatus(order, iac);
|
|
|
|
|
|
} else {
|
|
|
- return HttpResult.error(logNo + "核保失败,车牌号:"+ order.getLicenseno() + " ," + rd.getResponseHead().getReturnMessage());
|
|
|
+ return HttpResult.error(logNo + "核保失败,车牌号:" + order.getLicenseno() + " ," + rd.getResponseHead().getReturnMessage());
|
|
|
}
|
|
|
|
|
|
- iac.setAuditid(order.getUserid());
|
|
|
+ iac.setAuditid(StpUtil.getLoginId().toString());
|
|
|
|
|
|
iac.setInsOrderNo(rd.getOrderCode());
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
@@ -686,10 +687,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
|
|
|
String logNo = String.format("(日志号:%s)", IPUtil.gainServerNo());
|
|
|
InsAreaCompany iac = insAreaCompanyService.getByIdIsExist(quoteOrderNo);
|
|
|
- if(!iac.getOrderstatus().equals(InsOrderStatusEnum.QUOTE_ING.getCode())) return HttpResult.error("报价中的订单才允许核保");
|
|
|
+ if (!iac.getOrderstatus().equals(InsOrderStatusEnum.QUOTE_ING.getCode()))
|
|
|
+ return HttpResult.error("报价中的订单才允许核保");
|
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
List<InsTaskImagesBase64> insTaskImages = insTaskImagesService.findByOrderNo(iac.getOrderno());
|
|
|
- if(CollUtil.isEmpty(insTaskImages)) return HttpResult.error("获取影像失败");
|
|
|
+ if (CollUtil.isEmpty(insTaskImages)) return HttpResult.error("获取影像失败");
|
|
|
|
|
|
//获取协议配置信息
|
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
|
|
|
@@ -703,7 +705,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
|
//接口请求
|
|
|
// apiLog = httpPost(xmlMapper, iUp, YcBuildData.API_UPLOAD);
|
|
|
- String responseData = httpPostResultLog(iUp, YcBuildData.API_UPLOAD, logNo +"永诚API方式(车牌号:)"+order.getLicenseno()+" - 影像上传 - "+iUp.getNewImgUpLoadInfoRequest().getRequestBase().getPicTureName()+" - ");
|
|
|
+ String responseData = httpPostResultLog(iUp, YcBuildData.API_UPLOAD, logNo + "永诚API方式(车牌号:)" + order.getLicenseno() + " - 影像上传 - " + iUp.getNewImgUpLoadInfoRequest().getRequestBase().getPicTureName() + " - ");
|
|
|
try {
|
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
|
log.error("===永诚API方式--上传影像清洗返回参数:" + cleanStr);
|
|
|
@@ -736,7 +738,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
|
//接口请求
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取缴费链接开始======");
|
|
|
- String responseData = httpPostResultLog( pay, YcBuildData.API_PAY, "永诚API方式 - 获取缴费链接 - ");
|
|
|
+ String responseData = httpPostResultLog(pay, YcBuildData.API_PAY, "永诚API方式 - 获取缴费链接 - ");
|
|
|
// InsApiLog apiLog = httpPost(xmlMapper, pay, YcBuildData.API_PAY);
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取缴费链接结束!======");
|
|
|
// verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_3);
|
|
|
@@ -770,25 +772,21 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
try {
|
|
|
InsAreaCompany iac = insAreaCompanyService.getById(quoteOrderNo);
|
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
- if (iac == null) {
|
|
|
- return HttpResult.error("报价订单不存在");
|
|
|
- }
|
|
|
+ AssertionUtils.isEmpty(iac, "报价订单不存在");
|
|
|
|
|
|
if (StringUtils.isEmpty(iac.getAgreementId())) return HttpResult.error("协议号空");
|
|
|
|
|
|
// 获取协议配置信息
|
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
|
|
|
//0 支付回调 1核保回调 5直接返回字符串信息
|
|
|
-// String type = "0";
|
|
|
String type = "5";
|
|
|
-// if(iac.getOrderstatus().equals(InsOrderStatusEnum.WAIT_AUDIT.getCode())) type = "1";
|
|
|
//组装参数
|
|
|
CallbackAnOrder o = CallbackAnOrder.buildCallbackAnOrderParam(iac, ycConfigureParameters.gainAuthorityDataXml(), type);
|
|
|
|
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
|
//接口请求
|
|
|
// InsApiLog apiLog = httpPostResultLog(xmlMapper, o, YcBuildData.API_ORDER_QUERY);
|
|
|
- String respData = httpPostResultLog( o, YcBuildData.API_ORDER_QUERY, "永诚API方式 - 补传回调 - ");
|
|
|
+ String respData = httpPostResultLog(o, YcBuildData.API_ORDER_QUERY, "永诚API方式 - 补传回调 - ");
|
|
|
|
|
|
|
|
|
String cleanStr = YcBuildData.cleanResponseStr(respData);
|
|
|
@@ -796,24 +794,33 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
|
|
|
if (StringUtils.isNotEmpty(cleanStr)) {
|
|
|
if (cleanStr.equals("账户不存在或没有权限")) return HttpResult.ok("账户不存在或没有权限");
|
|
|
- log.info("永诚API方式 - 补传回调 - 参数:" + cleanStr);
|
|
|
+// log.info("永诚API方式 - 补传回调 - 参数:" + cleanStr);
|
|
|
CallBackRequest param = CallBackRequest.buildCallBackParam(cleanStr);
|
|
|
|
|
|
+ log.info("永诚API方式 - 补传回调 - 参数:{},车牌号:{}", JSON.toJSONString(param), order.getLicenseno());
|
|
|
+
|
|
|
//成功
|
|
|
if (param.getResult().equals("0")) {
|
|
|
- if (StringUtils.isEmpty(param.getBizPolicyNo()) && StringUtils.isEmpty(param.getCiPolicyNo()))
|
|
|
- return HttpResult.ok("操作成功,状态未变动。");
|
|
|
- ;
|
|
|
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(param.getBizPolicyNo())) iac.setSypolicyno(param.getBizPolicyNo());
|
|
|
- if (StringUtils.isNotEmpty(param.getCiPolicyNo())) iac.setJqpolicyno(param.getCiPolicyNo());
|
|
|
+ if (iac.getOrderstatus().equals(InsOrderStatusEnum.WAIT_PAY.getCode())) {
|
|
|
+ buildCallBackStatus(iac, param.getJqstatus());
|
|
|
+ if (StringUtils.isNotEmpty(param.getBizPolicyNo())) iac.setSypolicyno(param.getBizPolicyNo());
|
|
|
+ if (StringUtils.isNotEmpty(param.getCiPolicyNo())) iac.setJqpolicyno(param.getCiPolicyNo());
|
|
|
+
|
|
|
+ } else {
|
|
|
+ iac = buildCallBack(iac, param);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(iac.getOrderstatus().equals(InsOrderStatusEnum.TO_BACK.getCode())){
|
|
|
+ iac.setAuditopinion("交强审核意见:" + param.getJqmessage() + "| 商业审核意见:" +param.getSymessage());
|
|
|
+ }
|
|
|
|
|
|
- iac = buildCallBack(iac, param);
|
|
|
//构造订单状态
|
|
|
buildOrderStatus(order, iac);
|
|
|
+
|
|
|
insAreaCompanyService.updateById(iac);
|
|
|
- insOrdersService.updateByOrderStatus(order.getOrderno(), order.getOrderstatus());
|
|
|
+ insOrdersService.updateById(order);
|
|
|
|
|
|
} else {
|
|
|
//失败原因
|
|
|
@@ -940,7 +947,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
|
|
|
|
|
|
//接口请求
|
|
|
- String responseData = httpPostResultLog( p, YcBuildData.API_GUARANTEE_SLIP, "车牌号:" + order.getLicenseno() + ",永诚API方式 - 获取保单 - ");
|
|
|
+ String responseData = httpPostResultLog(p, YcBuildData.API_GUARANTEE_SLIP, "车牌号:" + order.getLicenseno() + ",永诚API方式 - 获取保单 - ");
|
|
|
|
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
|
PolicyResponse pResp = xmlMapper.readValue(cleanStr, PolicyResponse.class);
|
|
|
@@ -1006,7 +1013,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
|
//接口请求
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询开始======");
|
|
|
- String responseData = httpPostResultLog( accident, YcBuildData.API_ACCIDENT, "永诚API方式 - 获取意健险方案及险种 - ");
|
|
|
+ String responseData = httpPostResultLog(accident, YcBuildData.API_ACCIDENT, "永诚API方式 - 获取意健险方案及险种 - ");
|
|
|
// InsApiLog apiLog = httpPost(xmlMapper, accident, YcBuildData.API_ACCIDENT);
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询结束!======");
|
|
|
// verifyRequest(apiLog, iac,InsQuoteFlow.);
|
|
|
@@ -1157,7 +1164,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
|
//接口请求
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询开始======");
|
|
|
- String responseData = httpPostResultLog( accident, YcBuildData.API_ACCIDENT, "永诚API方式 - 获取意健险方案及险种 - ");
|
|
|
+ String responseData = httpPostResultLog(accident, YcBuildData.API_ACCIDENT, "永诚API方式 - 获取意健险方案及险种 - ");
|
|
|
// InsApiLog apiLog = httpPost(xmlMapper, accident, YcBuildData.API_ACCIDENT);
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询结束!======");
|
|
|
// verifyRequest(apiLog, iac,InsQuoteFlow.);
|
|
|
@@ -1625,8 +1632,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
insAreaCompany.setSypremium(BigDecimal.valueOf(syPremium));
|
|
|
insAreaCompany.setTaxamount(BigDecimal.valueOf(jq_falg ? quoteRespVo.getTaxAmount() : 0));
|
|
|
insAreaCompany.setSumpremium(BigDecimal.valueOf(quoteRespVo.getSumPermium()));
|
|
|
-// insAreaCompany.setSumpremium(BigDecimal.valueOf(add(quoteRespVo.getSumPermium(), insOrder.getTaxamount())));
|
|
|
- insAreaCompany.setOrderstatus(InsTaskHistoryEnum.IN_QUOTATION.getState() + "");
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
|
|
|
|
|
|
insAreaCompany.setCreatetime(LocalDateTime.now());
|
|
|
@@ -1660,7 +1666,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
//评分
|
|
|
insAreaCompany.setScore(quoteRespVo.getILogPreUdwMess());
|
|
|
//欠税信息
|
|
|
- if(null != quoteRespVo.getTaxArrears()){
|
|
|
+ if (null != quoteRespVo.getTaxArrears()) {
|
|
|
insAreaCompany.setTaxArrears(JSONObject.parseArray(JSONObject.toJSONString(quoteRespVo.getTaxArrears())));
|
|
|
}
|
|
|
|
|
|
@@ -1683,20 +1689,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static String getUserName() {
|
|
|
-
|
|
|
- return "";
|
|
|
-// String userName = null;
|
|
|
-// Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
|
|
-//
|
|
|
-// if (principal instanceof UserDetails) {
|
|
|
-// userName = ((UserDetails) principal).getUsername();
|
|
|
-// } else {
|
|
|
-// userName = principal.toString();
|
|
|
-// }
|
|
|
-// return userName;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 验证远程请求
|
|
|
*
|
|
|
@@ -2303,7 +2295,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void buildRegionParam(Ruote m,BaseQuoteInfoVo yaQuoteInfoVo,List<String> ownerProvinceData,List<String> insuredProvinceData,List<String> applicantProvinceData) {
|
|
|
+ private void buildRegionParam(Ruote m, BaseQuoteInfoVo yaQuoteInfoVo, List<String> ownerProvinceData, List<String> insuredProvinceData, List<String> applicantProvinceData) {
|
|
|
yaQuoteInfoVo.getOwnerInfo().setProvinceData(ownerProvinceData);
|
|
|
m.getRequestLabel().getCondition().getVhlowner().setCProvince(ownerProvinceData.get(0));
|
|
|
m.getRequestLabel().getCondition().getVhlowner().setCCity(ownerProvinceData.get(1));
|