|
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.*;
|
|
|
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
|
|
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
|
|
|
import com.ydtech.components.InsAlltrustRequestApiComponents;
|
|
import com.ydtech.components.InsAlltrustRequestApiComponents;
|
|
|
import com.ydtech.constants.InsTaskHistoryEnum;
|
|
import com.ydtech.constants.InsTaskHistoryEnum;
|
|
|
|
|
+import com.ydtech.constants.SysConstants;
|
|
|
import com.ydtech.constants.enums.InsOrderStatus;
|
|
import com.ydtech.constants.enums.InsOrderStatus;
|
|
|
import com.ydtech.constants.enums.InsQuoteFlow;
|
|
import com.ydtech.constants.enums.InsQuoteFlow;
|
|
|
import com.ydtech.constants.enums.dict.AttachInsureEnum;
|
|
import com.ydtech.constants.enums.dict.AttachInsureEnum;
|
|
@@ -111,7 +112,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
@Value("${api.url}")
|
|
@Value("${api.url}")
|
|
|
private String apiUrl;
|
|
private String apiUrl;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private YcBuildData ycBuildData;
|
|
private YcBuildData ycBuildData;
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -902,6 +902,27 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
AssertionUtils.isEmpty(iac,"报价订单不存在");
|
|
AssertionUtils.isEmpty(iac,"报价订单不存在");
|
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ String licensePlate = order.getLicenseno();
|
|
|
|
|
+
|
|
|
|
|
+ //如果保单已经生成了就直接返回
|
|
|
|
|
+ if (policyPrintVo.getType().equals("2")) {
|
|
|
|
|
+ Map m = new HashMap();
|
|
|
|
|
+
|
|
|
|
|
+ String jqFlagUrl = gainExistCarInsPolicy(licensePlate + "-交强险标志.pdf",licensePlate);
|
|
|
|
|
+ String jqUrl = gainExistCarInsPolicy(licensePlate + "-交强险保单.pdf",licensePlate);
|
|
|
|
|
+ String syUrl = gainExistCarInsPolicy(licensePlate + "-商业险保单.pdf",licensePlate);
|
|
|
|
|
+ if(null !=jqFlagUrl || null != jqUrl || null != syUrl ){
|
|
|
|
|
+ m.put("jqFlagUrl", jqFlagUrl);
|
|
|
|
|
+ m.put("jqUrl", jqUrl);
|
|
|
|
|
+ m.put("syUrl", syUrl);
|
|
|
|
|
+ return HttpResult.ok(m);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// 获取协议配置信息
|
|
// 获取协议配置信息
|
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
|
|
|
String policyNo = policyPrintVo.getRiskCode().equals("0507") ? iac.getJqpolicyno() : iac.getSypolicyno();
|
|
String policyNo = policyPrintVo.getRiskCode().equals("0507") ? iac.getJqpolicyno() : iac.getSypolicyno();
|
|
@@ -927,8 +948,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
Map m = new HashMap();
|
|
Map m = new HashMap();
|
|
|
|
|
|
|
|
String bzInsUrl = StringUtils.isNotEmpty(pResp.getPolicyBZUrl())?pResp.getPolicyBZUrl().replaceAll(";pkid", "&pkid"):"";
|
|
String bzInsUrl = StringUtils.isNotEmpty(pResp.getPolicyBZUrl())?pResp.getPolicyBZUrl().replaceAll(";pkid", "&pkid"):"";
|
|
|
- String licensePlate = order.getLicenseno();
|
|
|
|
|
- String jqFlagUrl = gainCarInsPolicy(bzInsUrl,licensePlate + "-交强险标志.pdf");
|
|
|
|
|
|
|
+ String jqFlagUrl = gainCarInsPolicy(bzInsUrl,licensePlate + "-交强险标志.pdf",licensePlate);
|
|
|
if (policyPrintVo.getType().equals("1")) {
|
|
if (policyPrintVo.getType().equals("1")) {
|
|
|
m.put("jqFlagUrl", jqFlagUrl);
|
|
m.put("jqFlagUrl", jqFlagUrl);
|
|
|
m.put("jqUrl", "");
|
|
m.put("jqUrl", "");
|
|
@@ -938,8 +958,8 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
String jqInsUrl = StringUtils.isNotEmpty(pResp.getJqpolicyUrl())?pResp.getJqpolicyUrl().replaceAll(";pkid", "&pkid"):"";
|
|
String jqInsUrl = StringUtils.isNotEmpty(pResp.getJqpolicyUrl())?pResp.getJqpolicyUrl().replaceAll(";pkid", "&pkid"):"";
|
|
|
String syInsUrl = StringUtils.isNotEmpty(pResp.getSypolicyUrl())?pResp.getSypolicyUrl().replaceAll(";pkid", "&pkid"):"";
|
|
String syInsUrl = StringUtils.isNotEmpty(pResp.getSypolicyUrl())?pResp.getSypolicyUrl().replaceAll(";pkid", "&pkid"):"";
|
|
|
|
|
|
|
|
- String jqUrl = gainCarInsPolicy(jqInsUrl,licensePlate + "-交强险保单.pdf");
|
|
|
|
|
- String syUrl = gainCarInsPolicy(syInsUrl,licensePlate + "-商业险保单.pdf");
|
|
|
|
|
|
|
+ String jqUrl = gainCarInsPolicy(jqInsUrl,licensePlate + "-交强险保单.pdf",licensePlate);
|
|
|
|
|
+ String syUrl = gainCarInsPolicy(syInsUrl,licensePlate + "-商业险保单.pdf",licensePlate);
|
|
|
|
|
|
|
|
m.put("jqFlagUrl", jqFlagUrl);
|
|
m.put("jqFlagUrl", jqFlagUrl);
|
|
|
m.put("jqUrl", jqUrl);
|
|
m.put("jqUrl", jqUrl);
|
|
@@ -1767,29 +1787,29 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
|
|
|
|
|
|
|
|
|
|
if(null != owner){
|
|
if(null != owner){
|
|
|
- InsAlltrustRegion insAlltrustRegion = findRegion(owner);
|
|
|
|
|
- if(null != insAlltrustRegion){
|
|
|
|
|
- m.getRequestLabel().getCondition().getVhlowner().setCProvince(insAlltrustRegion.getProvinceCode());
|
|
|
|
|
- m.getRequestLabel().getCondition().getVhlowner().setCCity(insAlltrustRegion.getCityCode());
|
|
|
|
|
- m.getRequestLabel().getCondition().getVhlowner().setCCounty(insAlltrustRegion.getAreaCode());
|
|
|
|
|
|
|
+ InsAlltrustRegion ownerRegion = findRegion(owner);
|
|
|
|
|
+ if(null != ownerRegion){
|
|
|
|
|
+ m.getRequestLabel().getCondition().getVhlowner().setCProvince(ownerRegion.getProvinceCode());
|
|
|
|
|
+ m.getRequestLabel().getCondition().getVhlowner().setCCity(ownerRegion.getCityCode());
|
|
|
|
|
+ m.getRequestLabel().getCondition().getVhlowner().setCCounty(ownerRegion.getAreaCode());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(null != insured){
|
|
if(null != insured){
|
|
|
- InsAlltrustRegion insAlltrustRegion = findRegion(insured);
|
|
|
|
|
- if(null != insAlltrustRegion){
|
|
|
|
|
- m.getRequestLabel().getCondition().getInsured().setCProvince(insAlltrustRegion.getProvinceCode());
|
|
|
|
|
- m.getRequestLabel().getCondition().getInsured().setCCity(insAlltrustRegion.getCityCode());
|
|
|
|
|
- m.getRequestLabel().getCondition().getInsured().setCCounty(insAlltrustRegion.getAreaCode());
|
|
|
|
|
|
|
+ InsAlltrustRegion insuredRegion = findRegion(insured);
|
|
|
|
|
+ if(null != insuredRegion){
|
|
|
|
|
+ m.getRequestLabel().getCondition().getInsured().setCProvince(insuredRegion.getProvinceCode());
|
|
|
|
|
+ m.getRequestLabel().getCondition().getInsured().setCCity(insuredRegion.getCityCode());
|
|
|
|
|
+ m.getRequestLabel().getCondition().getInsured().setCCounty(insuredRegion.getAreaCode());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(null != applicant){
|
|
if(null != applicant){
|
|
|
- InsAlltrustRegion insAlltrustRegion = findRegion(applicant);
|
|
|
|
|
- if(null != insAlltrustRegion){
|
|
|
|
|
- m.getRequestLabel().getCondition().getApplicant().setCProvince(insAlltrustRegion.getProvinceCode());
|
|
|
|
|
- m.getRequestLabel().getCondition().getApplicant().setCCity(insAlltrustRegion.getCityCode());
|
|
|
|
|
- m.getRequestLabel().getCondition().getApplicant().setCCounty(insAlltrustRegion.getAreaCode());
|
|
|
|
|
|
|
+ InsAlltrustRegion applicantRegion = findRegion(applicant);
|
|
|
|
|
+ if(null != applicantRegion){
|
|
|
|
|
+ m.getRequestLabel().getCondition().getApplicant().setCProvince(applicantRegion.getProvinceCode());
|
|
|
|
|
+ m.getRequestLabel().getCondition().getApplicant().setCCity(applicantRegion.getCityCode());
|
|
|
|
|
+ m.getRequestLabel().getCondition().getApplicant().setCCounty(applicantRegion.getAreaCode());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1800,6 +1820,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
String city = info.getCity();
|
|
String city = info.getCity();
|
|
|
String area = info.getCounty();
|
|
String area = info.getCounty();
|
|
|
|
|
|
|
|
|
|
+ //lig 2023-09-21 临时解决 页面解决后可删除。
|
|
|
|
|
+ if(StringUtils.isEmpty(province) && StringUtils.isEmpty(city) && StringUtils.isEmpty(area)){
|
|
|
|
|
+ throw new SystemException("永诚报价需要录入省市县");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
LambdaQueryWrapper<InsAlltrustRegion> lqw = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<InsAlltrustRegion> lqw = new LambdaQueryWrapper<>();
|
|
|
lqw.eq(StringUtils.isNotEmpty(province),InsAlltrustRegion::getProvince, province);
|
|
lqw.eq(StringUtils.isNotEmpty(province),InsAlltrustRegion::getProvince, province);
|
|
|
lqw.eq(StringUtils.isNotEmpty(city),InsAlltrustRegion::getCity, city);
|
|
lqw.eq(StringUtils.isNotEmpty(city),InsAlltrustRegion::getCity, city);
|
|
@@ -1999,10 +2024,22 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
* @author: lig
|
|
* @author: lig
|
|
|
* @date: 2023年09月21日 0021
|
|
* @date: 2023年09月21日 0021
|
|
|
*/
|
|
*/
|
|
|
- public String gainCarInsPolicy(String url,String fileName){
|
|
|
|
|
- String dir = "carInsPolicy/";
|
|
|
|
|
|
|
+ public String gainCarInsPolicy(String url,String fileName,String licensePlate){
|
|
|
|
|
+ String dir = "carInsPolicy/" + licensePlate + "/";
|
|
|
return FileUtil.netUrlToFile(url,dir,fileName,uploadFilePath,apiUrl + showFileUrl);
|
|
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);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|