|
@@ -880,37 +880,64 @@ public class HuaNongCrawlerRequestImpl implements HuaNongCrawlerRequest {
|
|
|
HuaNongCrawlerFtpDownloadRequestRequest huaNongCrawlerFtpDownloadRequest = new HuaNongCrawlerFtpDownloadRequestRequest(loginInfoDto.getToken());
|
|
HuaNongCrawlerFtpDownloadRequestRequest huaNongCrawlerFtpDownloadRequest = new HuaNongCrawlerFtpDownloadRequestRequest(loginInfoDto.getToken());
|
|
|
HuaNongCrawlerFtpDownloadRequestRequest.FtpDowloadListDTO ftpDowloadListDTO = new HuaNongCrawlerFtpDownloadRequestRequest.FtpDowloadListDTO();
|
|
HuaNongCrawlerFtpDownloadRequestRequest.FtpDowloadListDTO ftpDowloadListDTO = new HuaNongCrawlerFtpDownloadRequestRequest.FtpDowloadListDTO();
|
|
|
huaNongCrawlerFtpDownloadRequest.setFtpDowloadList(List.of(ftpDowloadListDTO));
|
|
huaNongCrawlerFtpDownloadRequest.setFtpDowloadList(List.of(ftpDowloadListDTO));
|
|
|
|
|
+
|
|
|
|
|
+ // 投保单号获取保单号
|
|
|
|
|
+ String policyNo = StringUtils.hasText(order.getBiPolicyNumber()) ? order.getBiPolicyNumber() : order.getCiPolicyNumber();
|
|
|
|
|
+ HuaNongCrawlerFindBusinessesRequestRequest huaNongCrawlerFindBusinessesRequest
|
|
|
|
|
+ = new HuaNongCrawlerFindBusinessesRequestRequest(loginInfoDto.getToken(), loginInfoDto.getLoginComCode(), policyNo, order.getRecordingTime());
|
|
|
|
|
+ HuaNongCrawlerFindBusinessesResponse businesses = huaNongCrawlerRequestComponent.findBusinesses(huaNongCrawlerFindBusinessesRequest, httpHeaders);
|
|
|
|
|
+ // 与Python hn_state.py一致:遍历business按riskCode匹配contractNo字段
|
|
|
|
|
+ String ciNo = businesses.getBusiness().get(0).getContractNo6();
|
|
|
|
|
+ String biNo = businesses.getBusiness().get(0).getContractNo1();
|
|
|
|
|
+
|
|
|
// 交强保单 标志
|
|
// 交强保单 标志
|
|
|
- Optional.ofNullable(order.getCiPolicyNo())
|
|
|
|
|
|
|
+ Optional.ofNullable(order.getCiPolicyNumber())
|
|
|
.filter(s -> !s.isEmpty())
|
|
.filter(s -> !s.isEmpty())
|
|
|
.ifPresent(ciPolicyNo -> {
|
|
.ifPresent(ciPolicyNo -> {
|
|
|
|
|
+
|
|
|
|
|
+ // DocumentsPrint 前置调用
|
|
|
|
|
+ HuaNongCrawlerDocumentsPrintRequestRequest ciDocumentsPrintRequest =
|
|
|
|
|
+ new HuaNongCrawlerDocumentsPrintRequestRequest(loginInfoDto.getToken(), ciNo, attributionInformationVo.getUsername(), loginInfoDto.getLoginComCode(), "3", "AB05016A32015A");
|
|
|
|
|
+ huaNongCrawlerRequestComponent.documentsPrintForCi(ciDocumentsPrintRequest, httpHeaders);
|
|
|
|
|
+
|
|
|
// 交强保单
|
|
// 交强保单
|
|
|
- ftpDowloadListDTO.setBiztype("4");
|
|
|
|
|
- ftpDowloadListDTO.setBusinessNo(ciPolicyNo);
|
|
|
|
|
|
|
+ ftpDowloadListDTO.setBiztype("3");
|
|
|
|
|
+ ftpDowloadListDTO.setBusinessNo(ciNo);
|
|
|
ftpDowloadListDTO.setRiskCode(Risk.RISK_0507.getRiskCode());
|
|
ftpDowloadListDTO.setRiskCode(Risk.RISK_0507.getRiskCode());
|
|
|
String ciPolicyUrl = huaNongCrawlerRequestComponent.ftpDownload(huaNongCrawlerFtpDownloadRequest, httpHeaders);
|
|
String ciPolicyUrl = huaNongCrawlerRequestComponent.ftpDownload(huaNongCrawlerFtpDownloadRequest, httpHeaders);
|
|
|
downloadPolicyResultVo.setJqUrl(ciPolicyUrl);
|
|
downloadPolicyResultVo.setJqUrl(ciPolicyUrl);
|
|
|
|
|
+ // 交强险标志
|
|
|
ftpDowloadListDTO.setIsBZDown("1");
|
|
ftpDowloadListDTO.setIsBZDown("1");
|
|
|
- // 商业标志
|
|
|
|
|
String ciSignUrl = huaNongCrawlerRequestComponent.ftpDownload(huaNongCrawlerFtpDownloadRequest, httpHeaders);
|
|
String ciSignUrl = huaNongCrawlerRequestComponent.ftpDownload(huaNongCrawlerFtpDownloadRequest, httpHeaders);
|
|
|
downloadPolicyResultVo.setJqFlagUrl(ciSignUrl);
|
|
downloadPolicyResultVo.setJqFlagUrl(ciSignUrl);
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
// 商业保单
|
|
// 商业保单
|
|
|
- Optional.ofNullable(order.getBiPolicyNo())
|
|
|
|
|
|
|
+ Optional.ofNullable(order.getBiPolicyNumber())
|
|
|
.filter(s -> !s.isEmpty())
|
|
.filter(s -> !s.isEmpty())
|
|
|
.ifPresent(biPolicyNo -> {
|
|
.ifPresent(biPolicyNo -> {
|
|
|
// 商业保单
|
|
// 商业保单
|
|
|
ftpDowloadListDTO.setIsBZDown("0");
|
|
ftpDowloadListDTO.setIsBZDown("0");
|
|
|
- ftpDowloadListDTO.setBusinessNo(biPolicyNo);
|
|
|
|
|
|
|
+ ftpDowloadListDTO.setBiztype("3");
|
|
|
|
|
+ ftpDowloadListDTO.setBusinessNo(biNo);
|
|
|
|
|
+ ftpDowloadListDTO.setRiskCode(Risk.RISK_0515.getRiskCode());
|
|
|
String biPolicyUrl = huaNongCrawlerRequestComponent.ftpDownload(huaNongCrawlerFtpDownloadRequest, httpHeaders);
|
|
String biPolicyUrl = huaNongCrawlerRequestComponent.ftpDownload(huaNongCrawlerFtpDownloadRequest, httpHeaders);
|
|
|
downloadPolicyResultVo.setSyUrl(biPolicyUrl);
|
|
downloadPolicyResultVo.setSyUrl(biPolicyUrl);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// 非车险
|
|
// 非车险
|
|
|
order.getNiInfos().forEach(niInfo -> {
|
|
order.getNiInfos().forEach(niInfo -> {
|
|
|
- Optional.ofNullable(niInfo.getNiPolicyNo()).ifPresent(niPolicyNo -> {
|
|
|
|
|
- HuaNongCrawlerDocumentsPrintRequestRequest huaNongCrawlerDocumentsPrintRequest = new HuaNongCrawlerDocumentsPrintRequestRequest(loginInfoDto.getToken(), niPolicyNo, attributionInformationVo.getUsername(), loginInfoDto.getLoginComCode());
|
|
|
|
|
|
|
+ Optional.ofNullable(niInfo.getNiPolicyNumber()).ifPresent(niPolicyNo -> {
|
|
|
|
|
+ HuaNongCrawlerFindBusinessesRequestRequest niFindBusinessesRequest
|
|
|
|
|
+ = new HuaNongCrawlerFindBusinessesRequestRequest(loginInfoDto.getToken(), loginInfoDto.getLoginComCode(), niPolicyNo, order.getRecordingTime());
|
|
|
|
|
+ HuaNongCrawlerFindBusinessesResponse niBusinesses = huaNongCrawlerRequestComponent.findBusinesses(niFindBusinessesRequest, httpHeaders);
|
|
|
|
|
+ // 与Python hn_state.py一致:NI(非0507/0510/0515)使用contractNo4
|
|
|
|
|
+ String niContractNo = Optional.ofNullable(niBusinesses.getBusiness())
|
|
|
|
|
+ .filter(list -> !list.isEmpty())
|
|
|
|
|
+ .map(list -> list.get(0).getContractNo4())
|
|
|
|
|
+ .orElse(niPolicyNo);
|
|
|
|
|
+
|
|
|
|
|
+ HuaNongCrawlerDocumentsPrintRequestRequest huaNongCrawlerDocumentsPrintRequest = new HuaNongCrawlerDocumentsPrintRequestRequest(loginInfoDto.getToken(), niContractNo, attributionInformationVo.getUsername(), loginInfoDto.getLoginComCode());
|
|
|
String niPolicyUrl = huaNongCrawlerRequestComponent.documentsPrint(huaNongCrawlerDocumentsPrintRequest, httpHeaders);
|
|
String niPolicyUrl = huaNongCrawlerRequestComponent.documentsPrint(huaNongCrawlerDocumentsPrintRequest, httpHeaders);
|
|
|
downloadPolicyResultVo.setJyUrl(niPolicyUrl);
|
|
downloadPolicyResultVo.setJyUrl(niPolicyUrl);
|
|
|
});
|
|
});
|