|
|
@@ -115,8 +115,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
private final YongchengApiConfigurationProperties apiComponents;
|
|
|
|
|
|
- private final InsAlltrustRegionMapper insAlltrustRegionMapper;
|
|
|
-
|
|
|
private final InsOrdersComponents insOrdersComponents;
|
|
|
|
|
|
private final StringRedisTemplate redisTemplate;
|
|
|
@@ -325,15 +323,25 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
*/
|
|
|
private StringBuilder getErrorInfo(RuoteResponse rr) {
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
- if (rr.getHead().getErrorCode().equals("E0001") && rr.getHead().getErrorMessage().equals("车主省市县码值不符合规范")) {
|
|
|
- sb.append("|永诚 - 保司 - 车主地区自动解析失败,请检查车主地区县级市名称已变更");
|
|
|
- }
|
|
|
- if (rr.getHead().getErrorCode().equals("E0001") && rr.getHead().getErrorMessage().equals("投保人省市县码值不符合规范")) {
|
|
|
- sb.append("|永诚 - 保司 - 投保人地区自动解析失败,请检查投保人地区县级市名称已变更");
|
|
|
+ String errorCode = rr.getHead().getErrorCode();
|
|
|
+ if (!MessageStatusCode.E0001.getCode().equals(errorCode)) {
|
|
|
+ return sb;
|
|
|
}
|
|
|
- if (rr.getHead().getErrorCode().equals("E0001") && rr.getHead().getErrorMessage().equals("被保人省市县码值不符合规范")) {
|
|
|
- sb.append("|永诚 - 保司 - 被保人地区自动解析失败,请检查被保人地区县级市名称已变更");
|
|
|
+
|
|
|
+ switch (rr.getHead().getErrorMessage()) {
|
|
|
+ case "车主省市县码值不符合规范":
|
|
|
+ sb.append("|永诚 - 保司 - 车主地区自动解析失败,请检查车主地区县级市名称已变更");
|
|
|
+ break;
|
|
|
+ case "投保人省市县码值不符合规范":
|
|
|
+ sb.append("|永诚 - 保司 - 投保人地区自动解析失败,请检查投保人地区县级市名称已变更");
|
|
|
+ break;
|
|
|
+ case "被保人省市县码值不符合规范":
|
|
|
+ sb.append("|永诚 - 保司 - 被保人地区自动解析失败,请检查被保人地区县级市名称已变更");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ return sb;
|
|
|
}
|
|
|
+
|
|
|
return sb;
|
|
|
}
|
|
|
|
|
|
@@ -360,7 +368,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
}
|
|
|
|
|
|
//报价失败
|
|
|
- if (!rr.getHead().getErrorCode().equals("000000")) {
|
|
|
+ if (!"000000".equals(rr.getHead().getErrorCode())) {
|
|
|
return HttpResult.error(rr.getHead().getErrorMessage());
|
|
|
}
|
|
|
|
|
|
@@ -808,8 +816,8 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
* @throws JsonProcessingException
|
|
|
*/
|
|
|
public void submitPolicy(BigDecimal jyPremium, YcConfigureParameters ycConfigureParameters, String insOrderNo) throws JsonProcessingException {
|
|
|
- if(jyPremium.compareTo(new BigDecimal(0)) <= 0){
|
|
|
- return;
|
|
|
+ if (jyPremium.compareTo(new BigDecimal(0)) <= 0) {
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
AccidentUnderwritingRequest accidentUnderwritingRequest =
|
|
|
@@ -825,21 +833,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 补传回调
|
|
|
- */
|
|
|
- @Override
|
|
|
- public void callbackAnOrder() {
|
|
|
- LambdaQueryWrapper<InsAreaCompany> lqw = new LambdaQueryWrapper<>();
|
|
|
- lqw.eq(InsAreaCompany::getOrderstatus, InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
- lqw.gt(InsAreaCompany::getAudittime, LocalDate.now().minusDays(1));
|
|
|
- List<InsAreaCompany> list = insAreaCompanyService.list(lqw);
|
|
|
-
|
|
|
- if (null != list && !list.isEmpty()) {
|
|
|
- list.forEach(a -> callbackAnOrder(a.getId()));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 6 电子保单
|
|
|
*/
|
|
|
@@ -928,58 +921,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * 驾意外险
|
|
|
- */
|
|
|
- @Override
|
|
|
- public HttpResult gainAccidentList(AccidentalDrivingQueryVo accidentalDrivingVo) {
|
|
|
- HttpResult httpResult = new HttpResult();
|
|
|
-
|
|
|
- // 获取协议配置信息
|
|
|
- YcConfigureParameters ycConfigureParameters = gainYcConfigParams(accidentalDrivingVo.getAgreementId());
|
|
|
- //组装参数
|
|
|
- Accident accident = Accident.buildPayParam(accidentalDrivingVo, ycConfigureParameters, null);
|
|
|
-
|
|
|
- try {
|
|
|
- AccidentResponse accidentResp = yongchengRequestApiComponents.newQueryYwCvrgWeb(accident);
|
|
|
-
|
|
|
- if (accidentResp.getHead().getResponseCompleteMessageStatus().getMessageStatusCode().equals("E0000")) {
|
|
|
- //清空旧的存入表
|
|
|
- LambdaQueryWrapper<EsmInsAttachInsure> lqw = new LambdaQueryWrapper<>();
|
|
|
- lqw.eq(EsmInsAttachInsure::getCompanyId, accidentalDrivingVo.getCompanyCode());
|
|
|
- lqw.eq(EsmInsAttachInsure::getSeating, accidentalDrivingVo.getSeatNum());
|
|
|
- esmInsAttachInsureMapper.delete(lqw);
|
|
|
-
|
|
|
- List<ResponseYwCvrg.CvrgList> cList = accidentResp.getResponseYwCvrg().getCvrgList();
|
|
|
-
|
|
|
- List<EsmInsAttachInsure> eiaiList = new ArrayList<>();
|
|
|
- cList.forEach(a -> {
|
|
|
- EsmInsAttachInsure ati = new EsmInsAttachInsure();
|
|
|
- ati.setCode(a.getCInsuranceTypeCode());
|
|
|
- ati.setName(a.getCInsuranceType());
|
|
|
- ati.setSeating(accidentalDrivingVo.getSeatNum() + "");
|
|
|
- ati.setCompanyId(accidentalDrivingVo.getCompanyCode());
|
|
|
- ati.setType(AttachInsureEnum.AI001.getCode());
|
|
|
- ati.setEnable(WhetherEnum.YES.getCode());
|
|
|
- ati.setRestrictNum(StringUtils.toInt(a.getNPurchaseLimitsNum()));
|
|
|
- esmInsAttachInsureMapper.insert(ati);
|
|
|
- eiaiList.add(ati);
|
|
|
- });
|
|
|
-
|
|
|
- httpResult.setData(eiaiList);
|
|
|
- httpResult.setMsg(accidentResp.getHead().getResponseCompleteMessageStatus().getMessageStatusDescription());
|
|
|
- } else {
|
|
|
- httpResult.setMsg(accidentResp.getHead().getResponseCompleteMessageStatus().getMessageStatusDescription());
|
|
|
- }
|
|
|
- } catch (JsonProcessingException jsonProcessingException) {
|
|
|
- jsonProcessingException.printStackTrace();
|
|
|
- throw new SystemException("获取支付连接失败");
|
|
|
- }
|
|
|
-
|
|
|
- return httpResult;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 驾意外险 查询
|
|
|
*/
|
|
|
@@ -1164,51 +1105,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- @Override
|
|
|
- @Transactional
|
|
|
- public HttpResult callBackApi(CallBackRequest param) {
|
|
|
- //成功
|
|
|
- if (param.getResult().equals("0")) {
|
|
|
- LambdaQueryWrapper<InsAreaCompany> lqw = new LambdaQueryWrapper<>();
|
|
|
- //交强投保单号查询
|
|
|
- lqw.eq(StringUtils.isNotEmpty(param.getCiPolicyAppNo()), InsAreaCompany::getJqapplyno, param.getCiPolicyAppNo());
|
|
|
- //商业投保单号查询
|
|
|
- lqw.eq(StringUtils.isNotEmpty(param.getBizPolicyAppNo()), InsAreaCompany::getSyapplyno, param.getBizPolicyAppNo());
|
|
|
- InsAreaCompany iac = insAreaCompanyService.getOne(lqw);
|
|
|
-
|
|
|
- if (null != iac) {
|
|
|
- if (StringUtils.isNotEmpty(param.getBizPolicyNo())) {
|
|
|
- iac.setSypolicyno(param.getBizPolicyNo());
|
|
|
- }
|
|
|
- if (StringUtils.isNotEmpty(param.getCiPolicyNo())) {
|
|
|
- iac.setJqpolicyno(param.getCiPolicyNo());
|
|
|
- }
|
|
|
-
|
|
|
- iac = buildCallBack(iac, param);
|
|
|
-
|
|
|
- InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
- if (StringUtils.toInt(order.getOrderstatus()) < StringUtils.toInt(iac.getOrderstatus())) {
|
|
|
- order.setOrderstatus(iac.getOrderstatus());
|
|
|
- }
|
|
|
-
|
|
|
- insAreaCompanyService.updateCompanyAndOrders(iac);
|
|
|
-
|
|
|
- //支付后 手工确认意外险
|
|
|
- } else {
|
|
|
- log.info(String.format("永诚API方式 - 回调 - 信息,订单不存在,交强保单号:{} ,商业保单号:{}", param.getCiPolicyNo(), param.getBizPolicyNo()));
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- //失败原因
|
|
|
- param.getMessage();
|
|
|
- log.info(String.format("永诚API方式 - 回调 - 失败,交强保单号:{} ,商业保单号:{},类型:{}", param.getCiPolicyNo(), param.getBizPolicyNo(),
|
|
|
- param.getType()));
|
|
|
- }
|
|
|
- return HttpResult.ok(param);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* @description:构造车型查询参数
|
|
|
* @author: lig
|
|
|
@@ -1303,125 +1199,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
return insAreaCompany;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public Map<String, String> gainRegionCode(String address) {
|
|
|
-
|
|
|
- log.debug("*********永诚API方式 - 身份证地址解析 参数:" + address);
|
|
|
- Map rMap = new HashMap();
|
|
|
-
|
|
|
- if (address.contains("邢台县")) {
|
|
|
- address.replaceAll("邢台县", "信都区");
|
|
|
- }
|
|
|
- if (address.contains("旬阳县")) {
|
|
|
- address.replaceAll("旬阳县", "旬阳市");
|
|
|
- }
|
|
|
- if (address.contains("开县")) {
|
|
|
- address.replaceAll("开县", "开州区");
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, String> m = IDCardUtils.addressResolution(address);
|
|
|
- if (null == m) return null;
|
|
|
- String city = m.get("city");
|
|
|
- String district = m.get("district");
|
|
|
-
|
|
|
- List<InsAlltrustRegion> areaList = new ArrayList<>();
|
|
|
- if (StringUtils.isNotEmpty(district)) {
|
|
|
- //查询地区
|
|
|
- LambdaQueryWrapper<InsAlltrustRegion> lqw = new LambdaQueryWrapper<>();
|
|
|
- lqw.eq(InsAlltrustRegion::getArea, district);
|
|
|
- areaList = insAlltrustRegionMapper.selectList(lqw);
|
|
|
- }
|
|
|
-
|
|
|
- //如果地区查不到 用城市当地区查
|
|
|
- if (null == areaList || areaList.isEmpty()) {
|
|
|
- LambdaQueryWrapper<InsAlltrustRegion> cityLqw = new LambdaQueryWrapper<>();
|
|
|
- cityLqw.eq(InsAlltrustRegion::getArea, city);
|
|
|
- areaList = insAlltrustRegionMapper.selectList(cityLqw);
|
|
|
- }
|
|
|
- //如果地区查不到 用城市当地区查
|
|
|
- if (null == areaList || areaList.isEmpty()) {
|
|
|
- LambdaQueryWrapper<InsAlltrustRegion> cityLqw = new LambdaQueryWrapper<>();
|
|
|
- cityLqw.eq(InsAlltrustRegion::getArea, city);
|
|
|
- areaList = insAlltrustRegionMapper.selectList(cityLqw);
|
|
|
- }
|
|
|
- //如果地区查不到 查市
|
|
|
- if (null == areaList || areaList.isEmpty()) {
|
|
|
- LambdaQueryWrapper<InsAlltrustRegion> cityLqw = new LambdaQueryWrapper<>();
|
|
|
- cityLqw.eq(InsAlltrustRegion::getCity, city);
|
|
|
- areaList = insAlltrustRegionMapper.selectList(cityLqw);
|
|
|
- }
|
|
|
-
|
|
|
- if (null != areaList && !areaList.isEmpty()) {
|
|
|
- rMap.put("provinceCode", areaList.get(0).getProvinceCode());
|
|
|
- rMap.put("cityCode", areaList.get(0).getCityCode());
|
|
|
- rMap.put("areaCode", areaList.get(0).getAreaCode());
|
|
|
- return rMap;
|
|
|
- }
|
|
|
- throw new SystemException("永诚(日志号:" + IPUtil.gainServerNo() + ") - 被保人地区自动解析失败,请手动填写。");
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 新的
|
|
|
- *
|
|
|
- * @author: lig
|
|
|
- * @date: 2023年10月12日 0012
|
|
|
- */
|
|
|
- public Map<String, String> gainRegionCode(String address, String type) {
|
|
|
-
|
|
|
- log.debug("*********永诚API方式 - 身份证地址解析 参数:" + address);
|
|
|
- Map rMap = new HashMap();
|
|
|
-
|
|
|
- if (address.contains("旬阳县")) {
|
|
|
- address.replaceAll("旬阳县", "旬阳市");
|
|
|
- }
|
|
|
- if (address.contains("开县")) {
|
|
|
- address.replaceAll("开县", "开州区");
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, String> m = IDCardUtils.addressResolution(address);
|
|
|
- if (null == m) return null;
|
|
|
- String city = m.get("city");
|
|
|
- String district = m.get("district");
|
|
|
-
|
|
|
- List<InsAlltrustRegion> areaList = new ArrayList<>();
|
|
|
- if (StringUtils.isNotEmpty(district)) {
|
|
|
- //查询地区
|
|
|
- LambdaQueryWrapper<InsAlltrustRegion> lqw = new LambdaQueryWrapper<>();
|
|
|
- lqw.eq(InsAlltrustRegion::getArea, district);
|
|
|
- areaList = insAlltrustRegionMapper.selectList(lqw);
|
|
|
- }
|
|
|
-
|
|
|
- //如果地区查不到 用城市当地区查
|
|
|
- if (null == areaList || areaList.isEmpty()) {
|
|
|
- LambdaQueryWrapper<InsAlltrustRegion> cityLqw = new LambdaQueryWrapper<>();
|
|
|
- cityLqw.eq(InsAlltrustRegion::getArea, city);
|
|
|
- areaList = insAlltrustRegionMapper.selectList(cityLqw);
|
|
|
- }
|
|
|
- //如果地区查不到 用城市当地区查
|
|
|
- if (null == areaList || areaList.isEmpty()) {
|
|
|
- LambdaQueryWrapper<InsAlltrustRegion> cityLqw = new LambdaQueryWrapper<>();
|
|
|
- cityLqw.eq(InsAlltrustRegion::getArea, city);
|
|
|
- areaList = insAlltrustRegionMapper.selectList(cityLqw);
|
|
|
- }
|
|
|
- //如果地区查不到 查市
|
|
|
- if (null == areaList || areaList.isEmpty()) {
|
|
|
- LambdaQueryWrapper<InsAlltrustRegion> cityLqw = new LambdaQueryWrapper<>();
|
|
|
- cityLqw.eq(InsAlltrustRegion::getCity, city);
|
|
|
- areaList = insAlltrustRegionMapper.selectList(cityLqw);
|
|
|
- }
|
|
|
-
|
|
|
- if (null != areaList && !areaList.isEmpty()) {
|
|
|
- rMap.put("provinceCode", areaList.get(0).getProvinceCode());
|
|
|
- rMap.put("cityCode", areaList.get(0).getCityCode());
|
|
|
- rMap.put("areaCode", areaList.get(0).getAreaCode());
|
|
|
- return rMap;
|
|
|
- }
|
|
|
-
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
private void buildRegion(Ruote m, BaseQuoteInfoVo yaQuoteInfoVo) {
|
|
|
//车主
|
|
|
CustomerInfoVo owner = yaQuoteInfoVo.getOwnerInfo();
|
|
|
@@ -1538,17 +1315,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取《存在》的保单地址
|
|
|
- *
|
|
|
- * @author: lig
|
|
|
- * @date: 2023年09月21日 0021
|
|
|
- */
|
|
|
- public String gainExistCarInsPolicy(String fileName, String licensePlate) {
|
|
|
- String dir = SysConstants.CAR_INS_POLICY + "/" + licensePlate + "/";
|
|
|
- return FileUtil.fileExist(dir, fileName, uploadFilePath, apiUrl + showFileUrl);
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
private void buildCarInfo(CarInfoVo carInfo, ModelsQueryResponse.VehicleInfo vehicleInfo) {
|
|
|
carInfo.setModelCode(vehicleInfo.getVehicleId());
|