|
|
@@ -123,6 +123,10 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
public static final String END_TIME = "23:59:59";
|
|
|
|
|
|
+ public static final String JQ_RULE = "机动车交通事故强制险";
|
|
|
+
|
|
|
+ public static final String SY_RULE = "机动车综合商业保险";
|
|
|
+
|
|
|
|
|
|
@Value("${upload.file.path}")
|
|
|
private String uploadFilePath;
|
|
|
@@ -163,8 +167,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
private final InsImagesUploadCacheComponents insImagesUploadCacheComponents;
|
|
|
|
|
|
- public void gainVehicleModel(YcConfigureParameters ycConfigureParameters, CarInfoVo carInfo,
|
|
|
- CoreModelsVo coreModelsVo) {
|
|
|
+ public void gainVehicleModel(YcConfigureParameters ycConfigureParameters, CarInfoVo carInfo, CoreModelsVo coreModelsVo) {
|
|
|
CarModel_Req carModelReq = new CarModel_Req();
|
|
|
carModelReq.setFrameNo(carInfo.getFrameNo());
|
|
|
carModelReq.setEngineNo(carInfo.getEngineNo());
|
|
|
@@ -193,16 +196,13 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
}
|
|
|
|
|
|
//车辆年款不能超过注册日期
|
|
|
- List<ModelsQueryResponse.VehicleInfo> vehicleInfoList =
|
|
|
- rd.getVehicleInfoList().stream().filter(a -> DateTimeUtil.dateIsAfter(carInfo.getRegisterDate(),
|
|
|
- a.getVehicleYear())).sorted(Comparator.comparing(ModelsQueryResponse.VehicleInfo::getVehiclePrice)).collect(Collectors.toList());
|
|
|
+ List<ModelsQueryResponse.VehicleInfo> vehicleInfoList = rd.getVehicleInfoList().stream().filter(a -> DateTimeUtil.dateIsAfter(carInfo.getRegisterDate(), a.getVehicleYear())).sorted(Comparator.comparing(ModelsQueryResponse.VehicleInfo::getVehiclePrice)).collect(Collectors.toList());
|
|
|
|
|
|
//匹配的车辆信息数据 为空
|
|
|
if (CollUtil.isEmpty(vehicleInfoList)) {
|
|
|
|
|
|
//匹配金额
|
|
|
- vehicleInfoList =
|
|
|
- rd.getVehicleInfoList().stream().filter(a -> a.getVehiclePrice().equals(carInfo.getPurchasePrice())).collect(Collectors.toList());
|
|
|
+ vehicleInfoList = rd.getVehicleInfoList().stream().filter(a -> a.getVehiclePrice().equals(carInfo.getPurchasePrice())).collect(Collectors.toList());
|
|
|
|
|
|
if (CollUtil.isNotEmpty(vehicleInfoList)) {
|
|
|
buildCarInfo(carInfo, vehicleInfoList.get(0), coreModelsVo);
|
|
|
@@ -210,16 +210,14 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
}
|
|
|
|
|
|
//金额升序
|
|
|
- vehicleInfoList =
|
|
|
- rd.getVehicleInfoList().stream().sorted(Comparator.comparing(ModelsQueryResponse.VehicleInfo::getVehiclePrice)).collect(Collectors.toList());
|
|
|
+ vehicleInfoList = rd.getVehicleInfoList().stream().sorted(Comparator.comparing(ModelsQueryResponse.VehicleInfo::getVehiclePrice)).collect(Collectors.toList());
|
|
|
|
|
|
buildCarInfo(carInfo, vehicleInfoList.get(0), coreModelsVo);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
//匹配的车辆信息数据
|
|
|
- ModelsQueryResponse.VehicleInfo matchVehicleInfo =
|
|
|
- vehicleInfoList.stream().filter(a -> a.getVehiclePrice().equals(carInfo.getPurchasePrice())).findFirst().orElse(null);
|
|
|
+ ModelsQueryResponse.VehicleInfo matchVehicleInfo = vehicleInfoList.stream().filter(a -> a.getVehiclePrice().equals(carInfo.getPurchasePrice())).findFirst().orElse(null);
|
|
|
|
|
|
if (null != matchVehicleInfo) {
|
|
|
buildCarInfo(carInfo, matchVehicleInfo, coreModelsVo);
|
|
|
@@ -228,9 +226,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
//匹配的车辆信息数据里 未匹配成功 默认选择第一条
|
|
|
//排序 年款降序 金额升序
|
|
|
- vehicleInfoList =
|
|
|
- vehicleInfoList.stream().sorted(Comparator.comparing(ModelsQueryResponse.VehicleInfo::getVehicleYear).thenComparing((o1,
|
|
|
- o2) -> Integer.compare(StringUtils.toInt(o2.getVehiclePrice()), StringUtils.toInt(o1.getVehiclePrice()))).reversed()).collect(Collectors.toList());
|
|
|
+ vehicleInfoList = vehicleInfoList.stream().sorted(Comparator.comparing(ModelsQueryResponse.VehicleInfo::getVehicleYear).thenComparing((o1, o2) -> Integer.compare(StringUtils.toInt(o2.getVehiclePrice()), StringUtils.toInt(o1.getVehiclePrice()))).reversed()).collect(Collectors.toList());
|
|
|
buildCarInfo(carInfo, vehicleInfoList.get(0), coreModelsVo);
|
|
|
|
|
|
}
|
|
|
@@ -243,8 +239,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
* @param quoteVo
|
|
|
* @return
|
|
|
*/
|
|
|
- private Ruote builderParams(BaseQuoteVo<AccidentalDrivingVo> quoteVo, BaseQuoteInfoVo yaQuoteInfoVo,
|
|
|
- CoreModelsVo coreModelsVo) {
|
|
|
+ private Ruote builderParams(BaseQuoteVo<AccidentalDrivingVo> quoteVo, BaseQuoteInfoVo yaQuoteInfoVo, CoreModelsVo coreModelsVo) {
|
|
|
// 获取协议配置信息
|
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(quoteVo.getAgreementId());
|
|
|
CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
|
|
|
@@ -254,10 +249,8 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
AccidentalDrivingVo adVo = quoteVo.getAccidentalDrivingVo();
|
|
|
|
|
|
//获取查询码
|
|
|
- String cQryCdeJQ =
|
|
|
- redisTemplate.opsForValue().get(REDIS_YONGCHENG_QUERY_CODE_JQ + yaQuoteInfoVo.getUserId() + carInfo.getVinNo() + carInfo.getLicenseNo());
|
|
|
- String cQryCdeSY =
|
|
|
- redisTemplate.opsForValue().get(REDIS_YONGCHENG_QUERY_CODE_SY + yaQuoteInfoVo.getUserId() + carInfo.getVinNo() + carInfo.getLicenseNo());
|
|
|
+ String cQryCdeJQ = redisTemplate.opsForValue().get(REDIS_YONGCHENG_QUERY_CODE_JQ + yaQuoteInfoVo.getUserId() + carInfo.getVinNo() + carInfo.getLicenseNo());
|
|
|
+ String cQryCdeSY = redisTemplate.opsForValue().get(REDIS_YONGCHENG_QUERY_CODE_SY + yaQuoteInfoVo.getUserId() + carInfo.getVinNo() + carInfo.getLicenseNo());
|
|
|
|
|
|
//组装参数
|
|
|
Ruote m = Ruote.buildQuoteParam(yaQuoteInfoVo, ycConfigureParameters, adVo, cQryCdeJQ, cQryCdeSY);
|
|
|
@@ -274,28 +267,23 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
* @return
|
|
|
* @throws JsonProcessingException
|
|
|
*/
|
|
|
- private RuoteResponse getResponse(Ruote m, String vinNo, List<String> requestInfoList,
|
|
|
- BaseQuoteInfoVo yaQuoteInfoVo) throws JsonProcessingException {
|
|
|
+ private RuoteResponse getResponse(Ruote m, String vinNo, List<String> requestInfoList, BaseQuoteInfoVo yaQuoteInfoVo) throws JsonProcessingException {
|
|
|
boolean boo;
|
|
|
RuoteResponse rr = yongchengRequestApiComponents.newPremiumXnyCalculation(m);
|
|
|
//存储 报价返回的查询码 交强和商业
|
|
|
if (rr.getVhl() != null) {
|
|
|
if (rr.getVhl().getCQryCdeJQ() != null) {
|
|
|
- redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_JQ + yaQuoteInfoVo.getUserId() + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(),
|
|
|
- rr.getVhl().getCQryCdeJQ(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
|
|
|
+ redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_JQ + yaQuoteInfoVo.getUserId() + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(), rr.getVhl().getCQryCdeJQ(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
|
|
|
}
|
|
|
if (rr.getVhl().getCQryCdeSY() != null) {
|
|
|
- redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_SY + yaQuoteInfoVo.getUserId() + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(),
|
|
|
- rr.getVhl().getCQryCdeSY(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
|
|
|
+ redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_SY + yaQuoteInfoVo.getUserId() + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(), rr.getVhl().getCQryCdeSY(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//重新设置 请求的查询码
|
|
|
//读取缓存的查询码
|
|
|
- String cQryCdeJQ =
|
|
|
- redisTemplate.opsForValue().get(REDIS_YONGCHENG_QUERY_CODE_JQ + yaQuoteInfoVo.getUserId() + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo());
|
|
|
- String cQryCdeSY =
|
|
|
- redisTemplate.opsForValue().get(REDIS_YONGCHENG_QUERY_CODE_SY + yaQuoteInfoVo.getUserId() + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo());
|
|
|
+ String cQryCdeJQ = redisTemplate.opsForValue().get(REDIS_YONGCHENG_QUERY_CODE_JQ + yaQuoteInfoVo.getUserId() + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo());
|
|
|
+ String cQryCdeSY = redisTemplate.opsForValue().get(REDIS_YONGCHENG_QUERY_CODE_SY + yaQuoteInfoVo.getUserId() + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo());
|
|
|
//交强
|
|
|
m.getRequestLabel().getCondition().getVhl().setCCheckCodeJQ("");
|
|
|
m.getRequestLabel().getCondition().getVhl().setCQryCdeJQ(cQryCdeJQ);
|
|
|
@@ -442,12 +430,10 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
//存储 报价返回的查询码 交强和商业
|
|
|
if (rr.getVhl() != null) {
|
|
|
if (rr.getVhl().getCQryCdeJQ() != null) {
|
|
|
- redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_JQ + order.getUserid() + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(),
|
|
|
- rr.getVhl().getCQryCdeJQ(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
|
|
|
+ redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_JQ + order.getUserid() + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(), rr.getVhl().getCQryCdeJQ(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
|
|
|
}
|
|
|
if (rr.getVhl().getCQryCdeSY() != null) {
|
|
|
- redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_SY + order.getUserid() + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(),
|
|
|
- rr.getVhl().getCQryCdeSY(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
|
|
|
+ redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_SY + order.getUserid() + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(), rr.getVhl().getCQryCdeSY(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -466,9 +452,9 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
requestInfoList.add(errorMsg);
|
|
|
log.info("永诚API方式 - xml请求 ------------报价 -> 交强重复投保----------------");
|
|
|
|
|
|
- TimeEntity timeEntity = getRepeatStartEndTime(errorMsg, JQ_REGEX);
|
|
|
+ TimeEntity timeEntity = getRepeatStartEndTime(errorMsg, JQ_REGEX, JQ_RULE);
|
|
|
|
|
|
- if(StringUtils.isEmpty(timeEntity.getCoverageEndDate())){
|
|
|
+ if (StringUtils.isEmpty(timeEntity.getCoverageEndDate())) {
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
@@ -486,14 +472,15 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
/**
|
|
|
* 处理时间
|
|
|
+ *
|
|
|
* @param errorMsg 报错信息
|
|
|
- * @param regex 正则表达是
|
|
|
+ * @param regex 正则表达是
|
|
|
* @return
|
|
|
*/
|
|
|
- private String processingTime(String errorMsg, String regex){
|
|
|
+ private String processingTime(String errorMsg, String regex, String rule) {
|
|
|
String coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(errorMsg, regex);
|
|
|
|
|
|
- if (coverageEndDate.isEmpty()) {
|
|
|
+ if (coverageEndDate.isEmpty() && errorMsg.contains(rule)) {
|
|
|
coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(errorMsg, REGEX_ALONE);
|
|
|
}
|
|
|
return coverageEndDate;
|
|
|
@@ -502,12 +489,13 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
/**
|
|
|
* 通过报错信息获取开始时间和结束时间
|
|
|
+ *
|
|
|
* @param errorMsg
|
|
|
* @param regex
|
|
|
* @return
|
|
|
*/
|
|
|
- private TimeEntity getRepeatStartEndTime(String errorMsg, String regex){
|
|
|
- String coverageEndDate = processingTime(errorMsg, regex);
|
|
|
+ private TimeEntity getRepeatStartEndTime(String errorMsg, String regex, String rule) {
|
|
|
+ String coverageEndDate = processingTime(errorMsg, regex, rule);
|
|
|
TimeEntity timeEntity = new TimeEntity();
|
|
|
|
|
|
if (coverageEndDate.isEmpty()) {
|
|
|
@@ -535,14 +523,14 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
@NoArgsConstructor
|
|
|
@AllArgsConstructor
|
|
|
@Data
|
|
|
- public static class TimeEntity{
|
|
|
+ public static class TimeEntity {
|
|
|
|
|
|
private String coverageEndDate;
|
|
|
|
|
|
/**
|
|
|
* 开始时间
|
|
|
*/
|
|
|
- private String newStartDate ;
|
|
|
+ private String newStartDate;
|
|
|
|
|
|
/**
|
|
|
* 结束时间
|
|
|
@@ -552,7 +540,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 报价 商业 重复 投保业务处理
|
|
|
*/
|
|
|
@@ -562,9 +549,9 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
if (appSYFlag) {
|
|
|
requestInfoList.add(errorMsg);
|
|
|
log.info("永诚API方式 - xml请求 ------------报价 -> 商业险重复投保----------------");
|
|
|
- TimeEntity timeEntity = getRepeatStartEndTime(errorMsg, SY_REGEX);
|
|
|
+ TimeEntity timeEntity = getRepeatStartEndTime(errorMsg, SY_REGEX, SY_RULE);
|
|
|
|
|
|
- if(StringUtils.isEmpty(timeEntity.getCoverageEndDate())){
|
|
|
+ if (StringUtils.isEmpty(timeEntity.getCoverageEndDate())) {
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
@@ -588,8 +575,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
if (rr.getHead().getErrorCode().equals("000000") && null != rr.getTfiWarnList() && CollUtil.isNotEmpty(rr.getTfiWarnList().getTfiWarnData())) {
|
|
|
|
|
|
- TfiWarnListResponse.TfiWarnData tfiWarnData =
|
|
|
- rr.getTfiWarnList().getTfiWarnData().stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotEmpty(item.getWarnMessage())).filter(item -> item.getWarnMessage().contains("终保日期")).findFirst().orElse(null);
|
|
|
+ TfiWarnListResponse.TfiWarnData tfiWarnData = rr.getTfiWarnList().getTfiWarnData().stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotEmpty(item.getWarnMessage())).filter(item -> item.getWarnMessage().contains("终保日期")).findFirst().orElse(null);
|
|
|
|
|
|
if (null == tfiWarnData) return true;
|
|
|
|
|
|
@@ -601,9 +587,9 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
}
|
|
|
|
|
|
//终保日期
|
|
|
- TimeEntity timeEntity = getRepeatStartEndTime(ciMsg, SY_REGEX);
|
|
|
+ TimeEntity timeEntity = getRepeatStartEndTime(ciMsg, SY_REGEX, SY_RULE);
|
|
|
|
|
|
- if(StringUtils.isEmpty(timeEntity.getCoverageEndDate())){
|
|
|
+ if (StringUtils.isEmpty(timeEntity.getCoverageEndDate())) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -654,8 +640,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
//转保调用自动识别转保码
|
|
|
if (StringUtils.isNotEmpty(cCheckCodeJQ) || StringUtils.isNotEmpty(cCheckCodeSY)) {
|
|
|
- log.info("永诚API方式 - xml请求 报价,车牌号《{}》 -> 转保业务处理----------------",
|
|
|
- m.getRequestLabel().getCondition().getVhl().getCPlateNo());
|
|
|
+ log.info("永诚API方式 - xml请求 报价,车牌号《{}》 -> 转保业务处理----------------", m.getRequestLabel().getCondition().getVhl().getCPlateNo());
|
|
|
//调用python ocr
|
|
|
RecognitionRequest recognitionRequest = new RecognitionRequest();
|
|
|
|
|
|
@@ -711,8 +696,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
Audit m = Audit.buildAuditParam(ownerInfo, insureInfo, applyInfo, ycConfigureParameters, iac);
|
|
|
|
|
|
//投保人地区信息
|
|
|
- PersonAreaVo personAreaVo = sysAreaService.queryByAddressYc(insureInfo.getAddr(),
|
|
|
- insureInfo.getIdentifyNumber());
|
|
|
+ PersonAreaVo personAreaVo = sysAreaService.queryByAddressYc(insureInfo.getAddr(), insureInfo.getIdentifyNumber());
|
|
|
|
|
|
//构造被保人地区
|
|
|
m.getRequestLabel().getCondition().getCustomer().setCProvince(personAreaVo.getProvinceCode());
|
|
|
@@ -789,8 +773,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
for (InsTaskImagesBase64 insTaskImage : insTaskImages) {
|
|
|
//组装参数
|
|
|
//接口请求
|
|
|
- ImageUp iUp = ImageUp.buildImageUpParam(order, ycConfigureParameters, insTaskImage.getBase64String(),
|
|
|
- insTaskImage.getImageType());
|
|
|
+ ImageUp iUp = ImageUp.buildImageUpParam(order, ycConfigureParameters, insTaskImage.getBase64String(), insTaskImage.getImageType());
|
|
|
try {
|
|
|
yongchengRequestApiComponents.newImageUp(iUp);
|
|
|
map.put(insTaskImage.getImageType(), insTaskImage.getImageId());
|
|
|
@@ -818,8 +801,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
// 获取协议配置信息
|
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
|
|
|
//组装参数
|
|
|
- Pay pay = Pay.buildPayParam(iac, ycConfigureParameters.gainAuthorityDataXml(),
|
|
|
- apiComponents.getPayCallBack());
|
|
|
+ Pay pay = Pay.buildPayParam(iac, ycConfigureParameters.gainAuthorityDataXml(), apiComponents.getPayCallBack());
|
|
|
//接口请求
|
|
|
PayResponse payResp = yongchengRequestApiComponents.newGetPayNo(pay);
|
|
|
|
|
|
@@ -858,8 +840,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
//0 支付回调 1核保回调 5直接返回字符串信息
|
|
|
String type = "5";
|
|
|
//组装参数
|
|
|
- CallbackAnOrder o = CallbackAnOrder.buildCallbackAnOrderParam(iac,
|
|
|
- ycConfigureParameters.gainAuthorityDataXml(), type);
|
|
|
+ CallbackAnOrder o = CallbackAnOrder.buildCallbackAnOrderParam(iac, ycConfigureParameters.gainAuthorityDataXml(), type);
|
|
|
//接口请求
|
|
|
try {
|
|
|
submitPolicy(iac.getJypremium(), ycConfigureParameters, iac.getInsOrderNo());
|
|
|
@@ -885,14 +866,12 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
DrivingInsuranceDto drivingInsuranceDto = new DrivingInsuranceDto();
|
|
|
drivingInsuranceDto.setPolicyNumber(param.getYwPolicyNo());
|
|
|
drivingInsuranceDto.setApplicationNumber(param.getYwPolicyAppNo());
|
|
|
- JSONArray objects =
|
|
|
- JSON.parseArray(JSON.toJSONString(Collections.singletonList(drivingInsuranceDto)));
|
|
|
+ JSONArray objects = JSON.parseArray(JSON.toJSONString(Collections.singletonList(drivingInsuranceDto)));
|
|
|
iac.setCrossInsurance(objects);
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotEmpty(param.getPay_date()) && !"null".equals(param.getPay_date())) {
|
|
|
- iac.setPayDate(LocalDateTime.parse(param.getPay_date(), DateTimeFormatter.ofPattern("yyyy-MM" +
|
|
|
- "-dd HH:mm:ss")));
|
|
|
+ iac.setPayDate(LocalDateTime.parse(param.getPay_date(), DateTimeFormatter.ofPattern("yyyy-MM" + "-dd HH:mm:ss")));
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
@@ -912,9 +891,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
} else {
|
|
|
//失败原因
|
|
|
- log.info(String.format("永诚API方式 - 补传回调 - 失败,交强保单号:{} ,商业保单号:{},类型:{}", param.getCiPolicyNo(),
|
|
|
- param.getBizPolicyNo(),
|
|
|
- param.getType()));
|
|
|
+ log.info(String.format("永诚API方式 - 补传回调 - 失败,交强保单号:{} ,商业保单号:{},类型:{}", param.getCiPolicyNo(), param.getBizPolicyNo(), param.getType()));
|
|
|
return HttpResult.error(param.getMessage());
|
|
|
}
|
|
|
return HttpResult.ok("操作成功,状态已更新。");
|
|
|
@@ -939,14 +916,10 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- AccidentUnderwritingRequest accidentUnderwritingRequest =
|
|
|
- new AccidentUnderwritingRequest(ycConfigureParameters.getPassword(),
|
|
|
- ycConfigureParameters.getUserName(), insOrderNo);
|
|
|
+ AccidentUnderwritingRequest accidentUnderwritingRequest = new AccidentUnderwritingRequest(ycConfigureParameters.getPassword(), ycConfigureParameters.getUserName(), insOrderNo);
|
|
|
|
|
|
- AccidentUnderwritingResponse accidentUnderwritingResponse =
|
|
|
- yongchengRequestApiComponents.submitPolicy(accidentUnderwritingRequest);
|
|
|
- AccidentUnderwritingResponse.HeadDTO.ResponseCompleteMessageStatus responseCompleteMessageStatus =
|
|
|
- accidentUnderwritingResponse.getHead().getResponseCompleteMessageStatus();
|
|
|
+ AccidentUnderwritingResponse accidentUnderwritingResponse = yongchengRequestApiComponents.submitPolicy(accidentUnderwritingRequest);
|
|
|
+ AccidentUnderwritingResponse.HeadDTO.ResponseCompleteMessageStatus responseCompleteMessageStatus = accidentUnderwritingResponse.getHead().getResponseCompleteMessageStatus();
|
|
|
|
|
|
if (!MessageStatusCode.E0000.getCode().equals(responseCompleteMessageStatus.getMessageStatusCode())) {
|
|
|
throw new SystemException(responseCompleteMessageStatus.getMessageStatusDescription());
|
|
|
@@ -1029,8 +1002,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
cipDto.setJyUrl(jyUrl);
|
|
|
}
|
|
|
|
|
|
- return HttpResult.ok(pResp.getHead().getResponseCompleteMessageStatus().getMessageStatusDescription()
|
|
|
- , cipDto);
|
|
|
+ return HttpResult.ok(pResp.getHead().getResponseCompleteMessageStatus().getMessageStatusDescription(), cipDto);
|
|
|
|
|
|
} else {
|
|
|
throw new SystemException(pResp.getHead().getResponseCompleteMessageStatus().getMessageStatusDescription());
|
|
|
@@ -1083,9 +1055,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
//将insAttachInsureList存入redis
|
|
|
if (!insAttachInsureList.isEmpty()) {
|
|
|
- redisTemplate.opsForValue().set(redisKey.toString(), JSON.toJSONString(insAttachInsureList),
|
|
|
- YC_ACCIDENTAL_DRIVING_TIME,
|
|
|
- TimeUnit.DAYS);
|
|
|
+ redisTemplate.opsForValue().set(redisKey.toString(), JSON.toJSONString(insAttachInsureList), YC_ACCIDENTAL_DRIVING_TIME, TimeUnit.DAYS);
|
|
|
}
|
|
|
|
|
|
return HttpResult.ok(insAttachInsureList);
|
|
|
@@ -1107,8 +1077,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
if (!Objects.isNull(redisTemplate.opsForValue().get(redisKey.toString()))) {
|
|
|
String redisValue = String.valueOf(redisTemplate.opsForValue().get(redisKey.toString()));
|
|
|
if (StringUtils.isNotEmpty(redisValue)) {
|
|
|
- List<EsmInsAttachInsureDetails> esmInsAttachInsureDetails = JSON.parseArray(redisValue,
|
|
|
- EsmInsAttachInsureDetails.class);
|
|
|
+ List<EsmInsAttachInsureDetails> esmInsAttachInsureDetails = JSON.parseArray(redisValue, EsmInsAttachInsureDetails.class);
|
|
|
return HttpResult.ok(esmInsAttachInsureDetails);
|
|
|
}
|
|
|
}
|
|
|
@@ -1131,9 +1100,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
//将esmInsAttachInsureDetails存入redis
|
|
|
if (!esmInsAttachInsureDetails.isEmpty()) {
|
|
|
- redisTemplate.opsForValue().set(redisKey.toString(), JSON.toJSONString(esmInsAttachInsureDetails),
|
|
|
- YC_ACCIDENTAL_DRIVING_TIME
|
|
|
- , TimeUnit.DAYS);
|
|
|
+ redisTemplate.opsForValue().set(redisKey.toString(), JSON.toJSONString(esmInsAttachInsureDetails), YC_ACCIDENTAL_DRIVING_TIME, TimeUnit.DAYS);
|
|
|
}
|
|
|
return HttpResult.ok(esmInsAttachInsureDetails);
|
|
|
}
|
|
|
@@ -1235,8 +1202,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
* @author: lig
|
|
|
* @date: 2023年02月08日 0008
|
|
|
*/
|
|
|
- private ModelsQueryXml buildModelsQueryParam(CarModel_Req carModelReq,
|
|
|
- YcConfigureParameters ycConfigureParameters) {
|
|
|
+ private ModelsQueryXml buildModelsQueryParam(CarModel_Req carModelReq, YcConfigureParameters ycConfigureParameters) {
|
|
|
ModelsQueryXml m = new ModelsQueryXml();
|
|
|
ModelsQueryXml.RequestLabel requestLabel = new ModelsQueryXml.RequestLabel();
|
|
|
requestLabel.setSearchKeyword(carModelReq.getFrameNo().substring(0, 8));
|
|
|
@@ -1258,15 +1224,12 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
* @author: lig
|
|
|
* @date: 2023年02月16日 0016
|
|
|
*/
|
|
|
- private InsAreaCompany responseOrder(InsOrders insOrder, QuoteRespVo quoteRespVo, RuoteResponse responseData,
|
|
|
- BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
|
|
|
+ private InsAreaCompany responseOrder(InsOrders insOrder, QuoteRespVo quoteRespVo, RuoteResponse responseData, BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
|
|
|
|
|
|
//交强保费 含税
|
|
|
- double jqPremium =
|
|
|
- StringUtils.toDouble(responseData.getBase().getNBefTaxPrmJQ()) + StringUtils.toDouble(responseData.getBase().getNAppTaxAmtJQ());
|
|
|
+ double jqPremium = StringUtils.toDouble(responseData.getBase().getNBefTaxPrmJQ()) + StringUtils.toDouble(responseData.getBase().getNAppTaxAmtJQ());
|
|
|
//商业保费 含税
|
|
|
- double syPremium =
|
|
|
- StringUtils.toDouble(responseData.getBase().getNBefTaxPrmSY()) + StringUtils.toDouble(responseData.getBase().getNAppTaxAmtSY());
|
|
|
+ double syPremium = StringUtils.toDouble(responseData.getBase().getNBefTaxPrmSY()) + StringUtils.toDouble(responseData.getBase().getNAppTaxAmtSY());
|
|
|
//保险公司订单号
|
|
|
String insOrderNo = responseData.getBase().getCresvTxt6();
|
|
|
|
|
|
@@ -1363,8 +1326,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
if (insured.getIdentifyNumber().equals(applicant.getIdentifyNumber())) {
|
|
|
applicantPersonAreaVo = insuredPersonAreaVo;
|
|
|
} else {
|
|
|
- applicantPersonAreaVo = sysAreaService.queryByAddressYc(applicant.getAddr(),
|
|
|
- applicant.getIdentifyNumber());
|
|
|
+ applicantPersonAreaVo = sysAreaService.queryByAddressYc(applicant.getAddr(), applicant.getIdentifyNumber());
|
|
|
}
|
|
|
|
|
|
if (!Objects.isNull(ownerPersonAreaVo)) {
|
|
|
@@ -1452,8 +1414,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
|
|
|
}
|
|
|
|
|
|
- private void buildCarInfo(CarInfoVo carInfo, ModelsQueryResponse.VehicleInfo vehicleInfo,
|
|
|
- CoreModelsVo coreModelsVo) {
|
|
|
+ private void buildCarInfo(CarInfoVo carInfo, ModelsQueryResponse.VehicleInfo vehicleInfo, CoreModelsVo coreModelsVo) {
|
|
|
carInfo.setModelCode(vehicleInfo.getVehicleId());
|
|
|
carInfo.setCiCarName(vehicleInfo.getVehicleName());
|
|
|
carInfo.setModelcname(vehicleInfo.getVehicleName());
|
|
|
@@ -1482,8 +1443,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
//0 支付回调 1核保回调 5直接返回字符串信息
|
|
|
String type = "5";
|
|
|
//组装参数
|
|
|
- CallbackAnOrder o = CallbackAnOrder.buildCallbackAnOrderParam(iac,
|
|
|
- ycConfigureParameters.gainAuthorityDataXml(), type);
|
|
|
+ CallbackAnOrder o = CallbackAnOrder.buildCallbackAnOrderParam(iac, ycConfigureParameters.gainAuthorityDataXml(), type);
|
|
|
//接口请求
|
|
|
try {
|
|
|
submitPolicy(iac.getJypremium(), ycConfigureParameters, iac.getInsOrderNo());
|