|
@@ -1,7 +1,7 @@
|
|
|
package com.jzg.quotation.hengbang.crawler.entity.request;
|
|
package com.jzg.quotation.hengbang.crawler.entity.request;
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
-import com.alibaba.excel.util.StringUtils;
|
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.jzg.commons.entity.quote.vo.AccidentalDrivingVo;
|
|
import com.jzg.commons.entity.quote.vo.AccidentalDrivingVo;
|
|
|
import com.jzg.commons.entity.quote.vo.KindInfoVo;
|
|
import com.jzg.commons.entity.quote.vo.KindInfoVo;
|
|
|
import com.jzg.commons.entity.quote.vo.QuoteVo;
|
|
import com.jzg.commons.entity.quote.vo.QuoteVo;
|
|
@@ -88,16 +88,25 @@ public class HbCrawlerCalculationRequest extends HbBaseRequest {
|
|
|
}
|
|
}
|
|
|
if (CollUtil.isNotEmpty(kindInfoVoList)) {
|
|
if (CollUtil.isNotEmpty(kindInfoVoList)) {
|
|
|
this.epersonliabilityList = getEpersonliabilityList(kindInfoVoList, depreciationPrice);
|
|
this.epersonliabilityList = getEpersonliabilityList(kindInfoVoList, depreciationPrice);
|
|
|
- this.begintimeBi = DateUtil.toUtcDateTime(quoteVo.getBiRiskInfoVo().getStartDate());
|
|
|
|
|
|
|
+ // 防 NPE:BiRiskInfoVo 或 startDate 为空时跳过 begintimeBi 赋值
|
|
|
|
|
+ if (Objects.nonNull(quoteVo.getBiRiskInfoVo()) && Objects.nonNull(quoteVo.getBiRiskInfoVo().getStartDate())) {
|
|
|
|
|
+ this.begintimeBi = DateUtil.toUtcDateTime(quoteVo.getBiRiskInfoVo().getStartDate());
|
|
|
|
|
+ }
|
|
|
this.risktype = "2";
|
|
this.risktype = "2";
|
|
|
} else {
|
|
} else {
|
|
|
this.epersonliabilityList = new ArrayList<>();
|
|
this.epersonliabilityList = new ArrayList<>();
|
|
|
}
|
|
}
|
|
|
- // 驾意险不支持即时起保,起保日期为主险投保日期的下一日0时(北京时间)
|
|
|
|
|
|
|
+ // 驾意险不支持即时起保,若传入时间不是0点则自动改为下一日0点(北京时间),再转为UTC
|
|
|
if ("2".equals(this.risktype) && this.begintimeBi != null) {
|
|
if ("2".equals(this.risktype) && this.begintimeBi != null) {
|
|
|
- this.begintimeAccident = DateUtil.getNextDayMidnightUtc(this.begintimeBi);
|
|
|
|
|
|
|
+ // 商业险起始时间已是北京时间0点,驾意险直接复用,无需取下一日0时
|
|
|
|
|
+ this.begintimeAccident = DateUtil.isBeijingMidnight(this.begintimeBi)
|
|
|
|
|
+ ? this.begintimeBi
|
|
|
|
|
+ : DateUtil.getNextDayMidnightUtc(this.begintimeBi);
|
|
|
} else if ("1".equals(this.risktype) && this.begintimeCi != null) {
|
|
} else if ("1".equals(this.risktype) && this.begintimeCi != null) {
|
|
|
- this.begintimeAccident = DateUtil.getNextDayMidnightUtc(this.begintimeCi);
|
|
|
|
|
|
|
+ // 交强险起始时间已是北京时间0点,驾意险直接复用,无需取下一日0时
|
|
|
|
|
+ this.begintimeAccident = DateUtil.isBeijingMidnight(this.begintimeCi)
|
|
|
|
|
+ ? this.begintimeCi
|
|
|
|
|
+ : DateUtil.getNextDayMidnightUtc(this.begintimeCi);
|
|
|
} else {
|
|
} else {
|
|
|
this.begintimeAccident = DateUtil.getNextDayMidnightUtc();
|
|
this.begintimeAccident = DateUtil.getNextDayMidnightUtc();
|
|
|
}
|
|
}
|
|
@@ -123,6 +132,9 @@ public class HbCrawlerCalculationRequest extends HbBaseRequest {
|
|
|
public List<EpersonliabilityDTO> getEpersonliabilityList(List<KindInfoVo> kindInfoVoList, String depreciationPrice) {
|
|
public List<EpersonliabilityDTO> getEpersonliabilityList(List<KindInfoVo> kindInfoVoList, String depreciationPrice) {
|
|
|
List<EpersonliabilityDTO> epersonliabilityDTOList = new ArrayList<>();
|
|
List<EpersonliabilityDTO> epersonliabilityDTOList = new ArrayList<>();
|
|
|
for (KindInfoVo kindInfoVo : kindInfoVoList) {
|
|
for (KindInfoVo kindInfoVo : kindInfoVoList) {
|
|
|
|
|
+ if (StrUtil.isBlank(kindInfoVo.getAmount())) {
|
|
|
|
|
+ throw new RuntimeException(kindInfoVo.getPlatformKindName() + "保险保额为空,请检查数据!");
|
|
|
|
|
+ }
|
|
|
EpersonliabilityDTO epersonliabilityDTO = new EpersonliabilityDTO();
|
|
EpersonliabilityDTO epersonliabilityDTO = new EpersonliabilityDTO();
|
|
|
epersonliabilityDTO.setKindcode(kindInfoVo.getKindCode());
|
|
epersonliabilityDTO.setKindcode(kindInfoVo.getKindCode());
|
|
|
epersonliabilityDTO.setLiabname(kindInfoVo.getKindName());
|
|
epersonliabilityDTO.setLiabname(kindInfoVo.getKindName());
|
|
@@ -194,9 +206,9 @@ public class HbCrawlerCalculationRequest extends HbBaseRequest {
|
|
|
public static AccidentInsuranceDTO convertToAccidentInsuranceDTO(RiskInfoVo biRiskInfoVo, AccidentalDrivingVo vo) {
|
|
public static AccidentInsuranceDTO convertToAccidentInsuranceDTO(RiskInfoVo biRiskInfoVo, AccidentalDrivingVo vo) {
|
|
|
AccidentInsuranceDTO dto = new AccidentInsuranceDTO();
|
|
AccidentInsuranceDTO dto = new AccidentInsuranceDTO();
|
|
|
dto.setNonriskcode(vo.getProductCode().split("_")[1]);
|
|
dto.setNonriskcode(vo.getProductCode().split("_")[1]);
|
|
|
- dto.setProgramcode(vo.getProductCode());
|
|
|
|
|
- dto.setProgramname("1119险种5座非营运客车保额525000保费99.9(山西)");
|
|
|
|
|
dto.setCompanycode("0107");
|
|
dto.setCompanycode("0107");
|
|
|
|
|
+ dto.setProgramcode(vo.getProductCode());
|
|
|
|
|
+ dto.setProgramname(vo.getProductName());
|
|
|
dto.setIfdefault(true);
|
|
dto.setIfdefault(true);
|
|
|
dto.setBuynum(vo.getQuantity());
|
|
dto.setBuynum(vo.getQuantity());
|
|
|
List<GgriskprogramdetailsDTO> detailsList = getGgriskprogramdetailsList(vo.getProductCode().split("_")[1], vo.getProductCode());
|
|
List<GgriskprogramdetailsDTO> detailsList = getGgriskprogramdetailsList(vo.getProductCode().split("_")[1], vo.getProductCode());
|
|
@@ -331,6 +343,9 @@ public class HbCrawlerCalculationRequest extends HbBaseRequest {
|
|
|
private String clauseType;
|
|
private String clauseType;
|
|
|
private List<String> ecarChargingPosts;
|
|
private List<String> ecarChargingPosts;
|
|
|
private List<String> carInsureDevices;
|
|
private List<String> carInsureDevices;
|
|
|
|
|
+ // 正确请求中 begintimeAccident/endtimeAccident 紧跟 carInsureDevices(位于 drivingtype 之前)
|
|
|
|
|
+ private String begintimeAccident;
|
|
|
|
|
+ private String endtimeAccident;
|
|
|
private String effectfLag;
|
|
private String effectfLag;
|
|
|
private String drivingtype;
|
|
private String drivingtype;
|
|
|
private String relationCarOwner = "a";
|
|
private String relationCarOwner = "a";
|
|
@@ -347,8 +362,6 @@ public class HbCrawlerCalculationRequest extends HbBaseRequest {
|
|
|
private String taxonomyCode;
|
|
private String taxonomyCode;
|
|
|
private String epolicyFlag;
|
|
private String epolicyFlag;
|
|
|
private String accidentEpolicyFlag;
|
|
private String accidentEpolicyFlag;
|
|
|
- private String begintimeAccident;
|
|
|
|
|
- private String endtimeAccident;
|
|
|
|
|
private HbCrawlerRecordResponse transferVehicle;
|
|
private HbCrawlerRecordResponse transferVehicle;
|
|
|
|
|
|
|
|
@Data
|
|
@Data
|
|
@@ -425,19 +438,19 @@ public class HbCrawlerCalculationRequest extends HbBaseRequest {
|
|
|
@Serial
|
|
@Serial
|
|
|
private static final long serialVersionUID = -9183755801236888529L;
|
|
private static final long serialVersionUID = -9183755801236888529L;
|
|
|
|
|
|
|
|
- private String createtime;
|
|
|
|
|
|
|
+ private String programcode;
|
|
|
private String paramname;
|
|
private String paramname;
|
|
|
private String paramvalue;
|
|
private String paramvalue;
|
|
|
- private String programcode;
|
|
|
|
|
|
|
+ private String createtime;
|
|
|
private String updatetime;
|
|
private String updatetime;
|
|
|
private String validind;
|
|
private String validind;
|
|
|
|
|
|
|
|
public GgriskprogramparamlDTO(String createtime, String paramname, String paramvalue, String programcode, String updatetime, String validind) {
|
|
public GgriskprogramparamlDTO(String createtime, String paramname, String paramvalue, String programcode, String updatetime, String validind) {
|
|
|
- this.createtime = createtime;
|
|
|
|
|
- this.updatetime = updatetime;
|
|
|
|
|
|
|
+ this.programcode = programcode;
|
|
|
this.paramname = paramname;
|
|
this.paramname = paramname;
|
|
|
this.paramvalue = paramvalue;
|
|
this.paramvalue = paramvalue;
|
|
|
- this.programcode = programcode;
|
|
|
|
|
|
|
+ this.createtime = createtime;
|
|
|
|
|
+ this.updatetime = updatetime;
|
|
|
this.validind = validind;
|
|
this.validind = validind;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|