|
|
@@ -49,6 +49,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
@@ -150,10 +151,10 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
|
|
|
// 系统类型
|
|
|
List<PtlAttributionTemplateDto> ptlAttributionTemplateDtos = ptlAgreementAttribution.getFields()
|
|
|
- .toJavaList(PtlAttributionTemplateDto.class);
|
|
|
+ .toJavaList(PtlAttributionTemplateDto.class);
|
|
|
List<PtlAttributionTemplateDto> collect = ptlAttributionTemplateDtos.stream()
|
|
|
- .filter(x -> "form".equals(x.getField()))
|
|
|
- .collect(Collectors.toList());
|
|
|
+ .filter(x -> "form".equals(x.getField()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
if (!collect.isEmpty()) {
|
|
|
PtlAttributionTemplateDto ptlAttributionTemplateDto = collect.get(0);
|
|
|
String value = ptlAttributionTemplateDto.getValue();
|
|
|
@@ -203,23 +204,23 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
insAreaCompanyAccidentalDriving.convertCrawler(t);
|
|
|
//如果是太平 将id 设置为 riskcode
|
|
|
if (t.getAccidentalDrivingVo() != null && t.getCompanyId()
|
|
|
- .equals("TPIC1000000")) {
|
|
|
+ .equals("TPIC1000000")) {
|
|
|
JSONObject jsonObject = JSON.parseObject(t.getAccidentalDrivingVo()
|
|
|
- .toString());
|
|
|
+ .toString());
|
|
|
insAreaCompanyAccidentalDriving.setRideRiskCode(jsonObject.get("id")
|
|
|
- .toString());
|
|
|
+ .toString());
|
|
|
} else if (t.getAccidentalDrivingVo() != null && t.getCompanyId()
|
|
|
- .equals("TKIC1000000")) {
|
|
|
+ .equals("TKIC1000000")) {
|
|
|
JSONObject jsonObject = JSON.parseObject(t.getAccidentalDrivingVo()
|
|
|
- .toString());
|
|
|
+ .toString());
|
|
|
insAreaCompanyAccidentalDriving.setRideRiskCode(jsonObject.getString("planCode"));
|
|
|
insAreaCompanyAccidentalDriving.setRideRiskName(jsonObject.getString("planName"));
|
|
|
insAreaCompanyAccidentalDriving.setCompanyId("TKIC1000000");
|
|
|
insAreaCompanyAccidentalDriving.setQuantity(1);
|
|
|
} else if (t.getAccidentalDrivingVo() != null && t.getCompanyId()
|
|
|
- .equals("DJPC1000000")) {
|
|
|
+ .equals("DJPC1000000")) {
|
|
|
JSONObject jsonObject = JSON.parseObject(t.getAccidentalDrivingVo()
|
|
|
- .toString());
|
|
|
+ .toString());
|
|
|
InsDrivingIntentionInsurance one = insDrivingIntentionInsuranceService.getOne(new LambdaQueryWrapper<InsDrivingIntentionInsurance>()
|
|
|
.eq(InsDrivingIntentionInsurance::getCompanyId, t.getCompanyId())
|
|
|
.eq(InsDrivingIntentionInsurance::getProjectCode, jsonObject.getString("planId")));
|
|
|
@@ -227,28 +228,38 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
insAreaCompanyAccidentalDriving.setRideRiskCode(one.getProjectCode());
|
|
|
insAreaCompanyAccidentalDriving.setQuantity(1);
|
|
|
insAreaCompanyAccidentalDriving.setCompanyId(t.getCompanyId());
|
|
|
+ } else if(t.getAccidentalDrivingVo() != null && t.getCompanyId().equals("HBIC1000000")){
|
|
|
+ JSONObject jsonObject = JSON.parseObject(t.getAccidentalDrivingVo()
|
|
|
+ .toString());
|
|
|
+ Integer buynum = jsonObject.getInteger("buynum");
|
|
|
+ if(!quoteRespVo.getAccident().isEmpty()){
|
|
|
+ BigDecimal price = new BigDecimal(response.getDrivingInsurances().get(0).getPrice());
|
|
|
+ BigDecimal total = price.multiply(BigDecimal.valueOf(buynum));
|
|
|
+ BigDecimal rounded = total.setScale(2, RoundingMode.HALF_UP);
|
|
|
+ quoteRespVo.setJyPremium(rounded.doubleValue());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//处理订单信息
|
|
|
QuoteRespVo responseVo = responseOrder(response, quoteRespVo, ptlAgreementAttribution, insAreaCompanyAccidentalDriving, quoteInfoVo);
|
|
|
if (!Objects.isNull(response.getOther()
|
|
|
- .getMaxQuoteNum())) {
|
|
|
+ .getMaxQuoteNum())) {
|
|
|
int quoteNum = maxQuoteNum - Integer.parseInt(response.getOther()
|
|
|
- .getMaxQuoteNum());
|
|
|
+ .getMaxQuoteNum());
|
|
|
for (int i = 0; i < quoteNum; i++) {
|
|
|
SysQuoteRecord sysQuoteRecord;
|
|
|
if (i == quoteNum - 1) {
|
|
|
sysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(), t.getCompanyId(), quoteInfoVo.getCarInfo()
|
|
|
- .getLicenseNo(),
|
|
|
+ .getLicenseNo(),
|
|
|
QuoteNumberConstant.QuoteAction.QUOTE_SUCCESS.getCode()
|
|
|
- .toString(), QuoteNumberConstant.QuoteResult.SUCCESS.getCode()
|
|
|
- .toString());
|
|
|
+ .toString(), QuoteNumberConstant.QuoteResult.SUCCESS.getCode()
|
|
|
+ .toString());
|
|
|
} else {
|
|
|
sysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(), t.getCompanyId(), quoteInfoVo.getCarInfo()
|
|
|
- .getLicenseNo(),
|
|
|
+ .getLicenseNo(),
|
|
|
QuoteNumberConstant.QuoteAction.QUOTE_FAILED.getCode()
|
|
|
- .toString(), QuoteNumberConstant.QuoteResult.FAIL.getCode()
|
|
|
- .toString());
|
|
|
+ .toString(), QuoteNumberConstant.QuoteResult.FAIL.getCode()
|
|
|
+ .toString());
|
|
|
}
|
|
|
|
|
|
sysQuoteRecords.add(sysQuoteRecord);
|
|
|
@@ -267,7 +278,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
public HttpResult<Object> submitImage(String subOrderNo) {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getById(subOrderNo);
|
|
|
if (insAreaCompany.getCompanyId()
|
|
|
- .equals("TKIC1000000")) {
|
|
|
+ .equals("TKIC1000000")) {
|
|
|
//泰康
|
|
|
return HttpResult.ok("上传成功");
|
|
|
}
|
|
|
@@ -285,7 +296,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
}
|
|
|
|
|
|
CrawlerImageRequest crawlerImageRequest = new CrawlerImageRequest(insAreaCompany.getInsOrderNo(),
|
|
|
- CrawlerImageRequest.toB64phoListDTO(insTaskImagesBase64s),ptlAgreementAttribution.getUsername());
|
|
|
+ CrawlerImageRequest.toB64phoListDTO(insTaskImagesBase64s), ptlAgreementAttribution.getUsername());
|
|
|
// 发送请求
|
|
|
CrawlerBaseResponse response = insCrawlerOrderComponents.request(apiUrl, insAreaCompany.getCompanyId(),
|
|
|
PtlCrawlerApiType.API_3.getDesc(), crawlerImageRequest, CrawlerBaseResponse.class);
|
|
|
@@ -307,7 +318,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
// 请求地址
|
|
|
String apiUrl = ptlCrawlerApiService.getApiUrl(insAreaCompany.getAgreementId(), PtlCrawlerApiType.API_4);
|
|
|
//组装参数
|
|
|
- CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(),ptlAgreementAttribution.getUsername());
|
|
|
+ CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(), ptlAgreementAttribution.getUsername());
|
|
|
CrawlerAuditResponse crawlerAuditResponse = insCrawlerOrderComponents.request(apiUrl, insAreaCompany.getCompanyId(),
|
|
|
PtlCrawlerApiType.API_4.getDesc(), crawlerBaseRequest, CrawlerAuditResponse.class);
|
|
|
|
|
|
@@ -348,7 +359,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
//组装参数
|
|
|
// 账号信息
|
|
|
PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
- CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(),ptlAgreementAttribution.getUsername());
|
|
|
+ CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(), ptlAgreementAttribution.getUsername());
|
|
|
CrawlerVerifyPaymentResponse crawlerAuditResponse = insCrawlerOrderComponents.request(apiUrl, insAreaCompany.getCompanyId(),
|
|
|
PtlCrawlerApiType.API_5.getDesc(), crawlerBaseRequest, CrawlerVerifyPaymentResponse.class);
|
|
|
|
|
|
@@ -384,7 +395,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
// 账号信息
|
|
|
PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
//组装参数
|
|
|
- CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(),ptlAgreementAttribution.getUsername());
|
|
|
+ CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(), ptlAgreementAttribution.getUsername());
|
|
|
CrawlerPolicyPrintResponse response = insCrawlerOrderComponents.request(apiUrl, insAreaCompany.getCompanyId(),
|
|
|
PtlCrawlerApiType.API_6.getDesc(), crawlerBaseRequest, CrawlerPolicyPrintResponse.class);
|
|
|
|
|
|
@@ -395,7 +406,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
// 支付时间
|
|
|
if (StringUtils.isNotEmpty(response.getPaytime())) {
|
|
|
insAreaCompany.setPayDate(LocalDateTime.parse(response.getPaytime()
|
|
|
- .trim(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
+ .trim(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
insAreaCompanyService.updateById(insAreaCompany);
|
|
|
}
|
|
|
|
|
|
@@ -404,15 +415,15 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
crawlerPolicyPrintVo.setJqxPolicyUrl(gainCarInsPolicy(response.getJqxPolicyUrl(), licensePlate + "-交强险保单.pdf", insAreaCompany.getId()));
|
|
|
crawlerPolicyPrintVo.setSyxPolicyUrl(gainCarInsPolicy(response.getSyxPolicyUrl(), licensePlate + "-商业险保单.pdf", insAreaCompany.getId()));
|
|
|
crawlerPolicyPrintVo.setJyxInfoList(response.getJyxInfoList()
|
|
|
- .stream()
|
|
|
- .map(x -> {
|
|
|
- CrawlerPolicyPrintVo.JyxInfoListDTO jyxInfoListDTO = new CrawlerPolicyPrintVo.JyxInfoListDTO();
|
|
|
- jyxInfoListDTO.setApplication(x.getApplication());
|
|
|
- jyxInfoListDTO.setJyxPolicyUrl(gainCarInsPolicy(x.getJyxPolicyUrl(), licensePlate + "-" + x.getApplication() + "-非车险保单.pdf",
|
|
|
- insAreaCompany.getId()));
|
|
|
- return jyxInfoListDTO;
|
|
|
- })
|
|
|
- .collect(Collectors.toList()));
|
|
|
+ .stream()
|
|
|
+ .map(x -> {
|
|
|
+ CrawlerPolicyPrintVo.JyxInfoListDTO jyxInfoListDTO = new CrawlerPolicyPrintVo.JyxInfoListDTO();
|
|
|
+ jyxInfoListDTO.setApplication(x.getApplication());
|
|
|
+ jyxInfoListDTO.setJyxPolicyUrl(gainCarInsPolicy(x.getJyxPolicyUrl(), licensePlate + "-" + x.getApplication() + "-非车险保单.pdf",
|
|
|
+ insAreaCompany.getId()));
|
|
|
+ return jyxInfoListDTO;
|
|
|
+ })
|
|
|
+ .collect(Collectors.toList()));
|
|
|
return HttpResult.ok(crawlerPolicyPrintVo);
|
|
|
}
|
|
|
|
|
|
@@ -454,19 +465,19 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
}
|
|
|
|
|
|
if (InsurKind.A.getCode()
|
|
|
- .equals(kindInfoVo.getKindCode())) {
|
|
|
+ .equals(kindInfoVo.getKindCode())) {
|
|
|
kind.setAmount(map.get("A_amount"));
|
|
|
} else {
|
|
|
kind.setAmount(kindInfoVo.getAmount());
|
|
|
}
|
|
|
|
|
|
if (InsurKind.SY_WBDWGZ.getCode()
|
|
|
- .equals(kindInfoVo.getKindCode())) {
|
|
|
+ .equals(kindInfoVo.getKindCode())) {
|
|
|
KindInfoVo aKind = kindList.stream()
|
|
|
- .filter(x -> x.getKindCode()
|
|
|
- .equals(InsurKind.A.getCode()))
|
|
|
- .findFirst()
|
|
|
- .orElse(null);
|
|
|
+ .filter(x -> x.getKindCode()
|
|
|
+ .equals(InsurKind.A.getCode()))
|
|
|
+ .findFirst()
|
|
|
+ .orElse(null);
|
|
|
if (aKind != null) {
|
|
|
kind.setAmount(map.get("A_amount"));
|
|
|
}
|
|
|
@@ -518,9 +529,9 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(other.getPredictInfo())) {
|
|
|
quoteRespVo.setPredictInfo(other.getPredictInfo()
|
|
|
- .stream()
|
|
|
- .map(QuoteRespVo.PreUnderwritingInfoDTO::new)
|
|
|
- .collect(Collectors.toList()));
|
|
|
+ .stream()
|
|
|
+ .map(QuoteRespVo.PreUnderwritingInfoDTO::new)
|
|
|
+ .collect(Collectors.toList()));
|
|
|
}
|
|
|
|
|
|
// 起保日期和终保日期
|
|
|
@@ -544,10 +555,10 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
quoteRespVo.setWarnMessageList(strings);
|
|
|
|
|
|
List<String> infoList = response.getOther()
|
|
|
- .getInfoList();
|
|
|
+ .getInfoList();
|
|
|
if (!ObjectUtils.isEmpty(infoList)) {
|
|
|
quoteRespVo.getWarnMessageList()
|
|
|
- .addAll(infoList);
|
|
|
+ .addAll(infoList);
|
|
|
}
|
|
|
// 交强是否续保
|
|
|
quoteRespVo.setJqRenewal(other.getJqRenewalFlag());
|
|
|
@@ -576,26 +587,26 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
|
|
|
// 此单是否需要验车
|
|
|
if (CrawlerQuoteResponse.QuoteGreenWayEnum.Q_1.getCode()
|
|
|
- .equals(response.getOther()
|
|
|
- .getIsQuoteGreenWay())) {
|
|
|
+ .equals(response.getOther()
|
|
|
+ .getIsQuoteGreenWay())) {
|
|
|
quoteRespVo.setTips(CrawlerQuoteResponse.QuoteGreenWayEnum.Q_1.getDesc());
|
|
|
quoteRespVo.setWarnMessageList(response.getOther()
|
|
|
- .getErrorCodeMap());
|
|
|
+ .getErrorCodeMap());
|
|
|
}
|
|
|
// 验车支付链接
|
|
|
insAreaCompany.setVehicleInspectionUrl(response.getOther()
|
|
|
- .getUpimageUrl());
|
|
|
+ .getUpimageUrl());
|
|
|
quoteRespVo.setVehicleInspectionUrl(response.getOther()
|
|
|
- .getUpimageUrl());
|
|
|
+ .getUpimageUrl());
|
|
|
|
|
|
if (response.getOther()
|
|
|
- .getCiMessage() != null && !response.getOther()
|
|
|
- .getCiMessage()
|
|
|
- .equals("")) {
|
|
|
+ .getCiMessage() != null && !response.getOther()
|
|
|
+ .getCiMessage()
|
|
|
+ .equals("")) {
|
|
|
quoteRespVo.setCiMessage(response.getOther()
|
|
|
- .getCiMessage());
|
|
|
+ .getCiMessage());
|
|
|
insAreaCompany.setCiMessage(response.getOther()
|
|
|
- .getCiMessage());
|
|
|
+ .getCiMessage());
|
|
|
}
|
|
|
|
|
|
//太平绿黄红区
|
|
|
@@ -606,8 +617,8 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
if (matcher.find()) {
|
|
|
|
|
|
String tpColorScore = item.replace("小货车鼓励承保业务", "绿区")
|
|
|
- .replace("小货车一般承保业务", "黄区")
|
|
|
- .replace("小货车谨慎承保业务", "红区");
|
|
|
+ .replace("小货车一般承保业务", "黄区")
|
|
|
+ .replace("小货车谨慎承保业务", "红区");
|
|
|
|
|
|
insAreaCompany.setTpColorScore(tpColorScore);
|
|
|
break;
|
|
|
@@ -643,7 +654,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
// 账号信息
|
|
|
PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
//组装参数
|
|
|
- CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(),ptlAgreementAttribution.getUsername());
|
|
|
+ CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(), ptlAgreementAttribution.getUsername());
|
|
|
|
|
|
CrawlerAuditResponse crawlerAuditResponse = insCrawlerOrderComponents.request(apiUrl, insAreaCompany.getCompanyId(),
|
|
|
PtlCrawlerApiType.API_8.getDesc(), crawlerBaseRequest, CrawlerAuditResponse.class);
|
|
|
@@ -681,7 +692,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
// 账号信息
|
|
|
PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
//组装参数
|
|
|
- CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(),ptlAgreementAttribution.getUsername());
|
|
|
+ CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(), ptlAgreementAttribution.getUsername());
|
|
|
CrawlerVerifyPaymentResponse crawlerAuditResponse = insCrawlerOrderComponents.request(apiUrl, insAreaCompany.getCompanyId(),
|
|
|
PtlCrawlerApiType.API_5.getDesc(), crawlerBaseRequest, CrawlerVerifyPaymentResponse.class);
|
|
|
|
|
|
@@ -724,7 +735,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
private boolean quashOrder(InsAreaCompany insAreaCompany) {
|
|
|
// 账号信息
|
|
|
PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
- CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(),ptlAgreementAttribution.getUsername());
|
|
|
+ CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(), ptlAgreementAttribution.getUsername());
|
|
|
CrawlerBaseResponse request = insCrawlerOrderComponents.request(apiUrl, insAreaCompany.getCompanyId(),
|
|
|
PtlCrawlerApiType.API_9.getDesc(), crawlerBaseRequest, CrawlerBaseResponse.class);
|
|
|
if (request.getCode() == CrawlerAuditStatus.CAS_200.getCode()) {
|
|
|
@@ -750,9 +761,9 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
throw new SystemException(e.getMessage());
|
|
|
}
|
|
|
String jyPath = (vo.getJyxInfoList() != null && !vo.getJyxInfoList()
|
|
|
- .isEmpty()) ? vo.getJyxInfoList()
|
|
|
- .get(0)
|
|
|
- .getJyxPolicyUrl() : null;
|
|
|
+ .isEmpty()) ? vo.getJyxInfoList()
|
|
|
+ .get(0)
|
|
|
+ .getJyxPolicyUrl() : null;
|
|
|
InsAreaCompanyExternalPolicy insAreaCompanyExternalPolicy = new InsAreaCompanyExternalPolicy(insAreaCompany.getId(), vo.getJqxPolicyUrl(), vo.getSyxPolicyUrl(), jyPath, vo.getJqxFlagUrl());
|
|
|
return new ReadPdfUrlListDto(insAreaCompanyExternalPolicy, insAreaCompany, null);
|
|
|
}
|
|
|
@@ -767,7 +778,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
|
|
|
//组装参数
|
|
|
- CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(),ptlAgreementAttribution.getUsername());
|
|
|
+ CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(), ptlAgreementAttribution.getUsername());
|
|
|
CrawlerPolicyPrintResponse response = insCrawlerOrderComponents.request(apiUrl, insAreaCompany.getCompanyId(), PtlCrawlerApiType.API_6.getDesc(), crawlerBaseRequest, CrawlerPolicyPrintResponse.class);
|
|
|
if (response.getCode() == 200) {
|
|
|
//交强险标志地址
|
|
|
@@ -782,16 +793,16 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
crawlerPolicyPrintVo.setSyxPolicyUrl(gainCarInsPolicyNew(response.getSyxPolicyUrl(), pathPrefix + insAreaCompany.getSypolicyno() + "-" + InsuranceOrderPdf.SYBD.getDesc(), insAreaCompany.getId(), flag));
|
|
|
}
|
|
|
if (response.getJyxInfoList() != null && !response.getJyxInfoList()
|
|
|
- .isEmpty()) {
|
|
|
+ .isEmpty()) {
|
|
|
crawlerPolicyPrintVo.setJyxInfoList(response.getJyxInfoList()
|
|
|
- .stream()
|
|
|
- .map(x -> {
|
|
|
- CrawlerPolicyPrintVo.JyxInfoListDTO jyxInfoListDTO = new CrawlerPolicyPrintVo.JyxInfoListDTO();
|
|
|
- jyxInfoListDTO.setApplication(x.getApplication());
|
|
|
- jyxInfoListDTO.setJyxPolicyUrl(gainCarInsPolicyNew(x.getJyxPolicyUrl(), pathPrefix + insAreaCompany.getJyPolicyNo() + "-" + InsuranceOrderPdf.JYBD.getDesc(), insAreaCompany.getId(), flag));
|
|
|
- return jyxInfoListDTO;
|
|
|
- })
|
|
|
- .collect(Collectors.toList()));
|
|
|
+ .stream()
|
|
|
+ .map(x -> {
|
|
|
+ CrawlerPolicyPrintVo.JyxInfoListDTO jyxInfoListDTO = new CrawlerPolicyPrintVo.JyxInfoListDTO();
|
|
|
+ jyxInfoListDTO.setApplication(x.getApplication());
|
|
|
+ jyxInfoListDTO.setJyxPolicyUrl(gainCarInsPolicyNew(x.getJyxPolicyUrl(), pathPrefix + insAreaCompany.getJyPolicyNo() + "-" + InsuranceOrderPdf.JYBD.getDesc(), insAreaCompany.getId(), flag));
|
|
|
+ return jyxInfoListDTO;
|
|
|
+ })
|
|
|
+ .collect(Collectors.toList()));
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
@@ -822,7 +833,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
TsCrawlerLoginRequest crawlerLoginRequest = new TsCrawlerLoginRequest(attributionDto);
|
|
|
TsCrawlerBaseResponse response = insCrawlerOrderComponents.request(apiUrl, attribution.getInsCompanyId(), "获取验证码",
|
|
|
crawlerLoginRequest, TsCrawlerBaseResponse.class);
|
|
|
- if(!response.getCode().equals(200)){
|
|
|
+ if (!response.getCode().equals(200)) {
|
|
|
throw new SystemException(response.getMessage());
|
|
|
}
|
|
|
// 将返回参数放入redis
|
|
|
@@ -841,15 +852,15 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
attributionDto.setFields(attributionTemplateDtos);
|
|
|
String apiUrl = ptlCrawlerApiService.getByTemplateId(attribution.getTemplateId(), PtlCrawlerApiType.API_1);
|
|
|
String token = redisTemplate.opsForValue().get(OrderCacheConstant.TS_ACCESS_TOKEN + attributionDto.getUsername());
|
|
|
- if(StringUtils.isNotBlank(token)){
|
|
|
+ if (StringUtils.isNotBlank(token)) {
|
|
|
TsCrawlerLoginRequest request = JSON.parseObject(token).toJavaObject(TsCrawlerLoginRequest.class);
|
|
|
- TsCrawlerLoginRequest tsRequest = new TsCrawlerLoginRequest(attributionDto,smscode,request);
|
|
|
+ TsCrawlerLoginRequest tsRequest = new TsCrawlerLoginRequest(attributionDto, smscode, request);
|
|
|
TsCrawlerBaseResponse response = insCrawlerOrderComponents.request(apiUrl, attribution.getInsCompanyId(), "登录",
|
|
|
tsRequest, TsCrawlerBaseResponse.class);
|
|
|
- if(!response.getCode().equals(200)){
|
|
|
+ if (!response.getCode().equals(200)) {
|
|
|
throw new SystemException("泰山登录失败:" + response.getMessage());
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
throw new SystemException("验证码已失效!请重新发送!");
|
|
|
}
|
|
|
|