|
|
@@ -6,6 +6,7 @@ import com.jzg.commons.constants.quote.enums.quote.LicenseKindCode;
|
|
|
import com.jzg.commons.entity.quote.vo.*;
|
|
|
import com.jzg.commons.util.IDCardUtils;
|
|
|
import com.jzg.commons.util.StringUtils;
|
|
|
+import com.jzg.quotation.commons.utils.DateTimeUtil;
|
|
|
import com.jzg.quotation.zijin.api.constant.enums.MotorVehicleInsuranceEnum;
|
|
|
import com.jzg.quotation.zijin.api.constant.enums.RiskCodeEnum;
|
|
|
import com.jzg.quotation.zijin.crawler.component.ZiJinCrawlerRequestComponent;
|
|
|
@@ -239,22 +240,8 @@ public class ZiJinCrawlerQuoteRequestBuild {
|
|
|
baseInfo.setHandler1Code(parameters.getUserCode());
|
|
|
baseInfo.setHandler1Name(parameters.getUserName());
|
|
|
baseInfo.setOperatorCode(operatorCode);
|
|
|
- // 交强险日期
|
|
|
- baseInfo.setStartDateCI(quoteVo.getCiRiskInfoVo().getStartDate().substring(0, 10));
|
|
|
- baseInfo.setStartHourCI("00");
|
|
|
- baseInfo.setStartMinuteCI("00");
|
|
|
- baseInfo.setEndDateCI(quoteVo.getCiRiskInfoVo().getEndDate().substring(0, 10));
|
|
|
- baseInfo.setEndHourCI("24");
|
|
|
- baseInfo.setEndMinuteCI("00");
|
|
|
- // 商业险日期
|
|
|
- if (quoteVo.getBiRiskInfoVo() != null) {
|
|
|
- baseInfo.setStartDate(quoteVo.getBiRiskInfoVo().getStartDate().substring(0, 10));
|
|
|
- baseInfo.setStartHour("00");
|
|
|
- baseInfo.setStartMinute("00");
|
|
|
- baseInfo.setEndDate(quoteVo.getBiRiskInfoVo().getEndDate().substring(0, 10));
|
|
|
- baseInfo.setEndHour("24");
|
|
|
- baseInfo.setEndMinute("00");
|
|
|
- }
|
|
|
+ // 设置报价日期
|
|
|
+ buildDate(quoteVo, baseInfo);
|
|
|
// 经测试:燃油单强设为0,交三不设置(待确认),会返回转保标志,紫金系统可以忽略进行下一步报价
|
|
|
baseInfo.setXbFlag(quoteVo.getBiRiskInfoVo() == null ? "0" : null);
|
|
|
baseInfo.setXbFlagCI(quoteVo.getBiRiskInfoVo() == null ? "0" : null);
|
|
|
@@ -268,7 +255,7 @@ public class ZiJinCrawlerQuoteRequestBuild {
|
|
|
baseInfo.setHanderName(parameters.getUserName());
|
|
|
baseInfo.setDemandNo("01ZKIC140026051910017933666448");
|
|
|
if (quoteVo.getBiRiskInfoVo() != null) {
|
|
|
- baseInfo.setDemandNoCI("01ZKIC140026051910017933666448");// 这个先放开看行不
|
|
|
+ baseInfo.setDemandNoCI("01ZKIC140026051910017933666448");
|
|
|
}
|
|
|
// 经测试:燃油: 单交设为2,交三设为0
|
|
|
baseInfo.setCalculateFlag(quoteVo.getBiRiskInfoVo() == null ? "2" : "0");
|
|
|
@@ -279,6 +266,64 @@ public class ZiJinCrawlerQuoteRequestBuild {
|
|
|
return baseInfo;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 设置交强险、商业险日期
|
|
|
+ * @param quoteVo
|
|
|
+ * @param baseInfo
|
|
|
+ */
|
|
|
+ private static void buildDate(QuoteVo quoteVo, ZiJinCrawlerQuotationRequest.BaseInfo baseInfo) {
|
|
|
+ buildCiDate(quoteVo.getCiRiskInfoVo().getStartDate(), quoteVo.getCiRiskInfoVo().getEndDate(), baseInfo);
|
|
|
+ if (quoteVo.getBiRiskInfoVo() != null) {
|
|
|
+ buildBiDate(quoteVo.getBiRiskInfoVo().getStartDate(), quoteVo.getBiRiskInfoVo().getEndDate(), baseInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置交强险日期
|
|
|
+ *
|
|
|
+ * @param startDateTime 起保日期时间
|
|
|
+ * @param endDateTime 终保日期时间
|
|
|
+ * @param baseInfo 基础信息对象
|
|
|
+ */
|
|
|
+ private static void buildCiDate(String startDateTime, String endDateTime, ZiJinCrawlerQuotationRequest.BaseInfo baseInfo) {
|
|
|
+ baseInfo.setStartDateCI(DateTimeUtil.extractDate(startDateTime));
|
|
|
+ baseInfo.setStartHourCI(DateTimeUtil.extractHour(startDateTime));
|
|
|
+ baseInfo.setStartMinuteCI(DateTimeUtil.extractMinute(startDateTime));
|
|
|
+ baseInfo.setEndDateCI(DateTimeUtil.extractDate(endDateTime));
|
|
|
+ baseInfo.setEndHourCI(DateTimeUtil.extractHour(endDateTime));
|
|
|
+ baseInfo.setEndMinuteCI(DateTimeUtil.extractMinute(endDateTime));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置商业险日期
|
|
|
+ *
|
|
|
+ * @param startDateTime 起保日期时间
|
|
|
+ * @param endDateTime 终保日期时间
|
|
|
+ * @param baseInfo 基础信息对象
|
|
|
+ */
|
|
|
+ private static void buildBiDate(String startDateTime, String endDateTime, ZiJinCrawlerQuotationRequest.BaseInfo baseInfo) {
|
|
|
+ baseInfo.setStartDate(DateTimeUtil.extractDate(startDateTime));
|
|
|
+ baseInfo.setStartHour(DateTimeUtil.extractHour(startDateTime));
|
|
|
+ baseInfo.setStartMinute(DateTimeUtil.extractMinute(startDateTime));
|
|
|
+ baseInfo.setEndDate(DateTimeUtil.extractDate(endDateTime));
|
|
|
+ baseInfo.setEndHour(DateTimeUtil.extractHour(endDateTime));
|
|
|
+ baseInfo.setEndMinute(DateTimeUtil.extractMinute(endDateTime));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置重复投保日期(用于处理重复投保场景,从重复投保消息中提取结束时间作为新的起保时间)
|
|
|
+ *
|
|
|
+ * @param startDate 起保日期
|
|
|
+ * @param endDate 终保日期
|
|
|
+ * @param quoteVo 报价实体
|
|
|
+ * @param baseInfo 基础信息对象
|
|
|
+ */
|
|
|
+ public static void buildDuplicateInsuranceDate(String startDate, String endDate, QuoteVo quoteVo, ZiJinCrawlerQuotationRequest.BaseInfo baseInfo) {
|
|
|
+ buildCiDate(startDate, endDate, baseInfo);
|
|
|
+ if (quoteVo.getBiRiskInfoVo() != null) {
|
|
|
+ buildBiDate(startDate, endDate, baseInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 构建车主信息对象
|