|
|
@@ -2,21 +2,20 @@ package com.ydtech.modules.ins.model.guoren;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import com.alibaba.fastjson.annotation.JSONField;
|
|
|
-import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
-import com.ydtech.constants.enums.InsuranceRisk;
|
|
|
import com.ydtech.modules.ins.model.vo.CarInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.RiskInfoVo;
|
|
|
-import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
+import com.ydtech.modules.order.entity.vo.guoren.GuorenAccidentalDrivingVo;
|
|
|
import com.ydtech.utils.StringUtils;
|
|
|
import lombok.Data;
|
|
|
import lombok.NoArgsConstructor;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -30,298 +29,272 @@ public class NonAutoInsOrderReq {
|
|
|
@JsonProperty(value = "channelCode")
|
|
|
@JSONField(name = "channelCode")
|
|
|
private String channelCode;
|
|
|
+
|
|
|
@JsonProperty(value = "data")
|
|
|
@JSONField(name = "data")
|
|
|
private DataDTO data;
|
|
|
+
|
|
|
@JsonProperty(value = "othBusinessNo")
|
|
|
@JSONField(name = "othBusinessNo")
|
|
|
private String othBusinessNo;
|
|
|
+
|
|
|
@JsonProperty(value = "requestTime")
|
|
|
@JSONField(name = "requestTime")
|
|
|
private String requestTime;
|
|
|
|
|
|
- /**
|
|
|
- * 构造报价请求参数
|
|
|
- */
|
|
|
- @JsonIgnore
|
|
|
- public static NonAutoInsOrderReq buildParam(BaseQuoteInfoVo yaQuoteInfoVo, VinQueryResp.DataDTO vinQ, AccidentalDrivingVo accidentalDrivingVo, ChannelInfoDto channelInfo, String carPriceUuid) {
|
|
|
-
|
|
|
- //车辆信息
|
|
|
- CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
|
|
|
- //投保人
|
|
|
- CustomerInfoVo policyHolder = yaQuoteInfoVo.getPolicyHolderInfo();
|
|
|
- //被保人
|
|
|
- CustomerInfoVo insuredPerson = yaQuoteInfoVo.getInsuredPersonInfo();
|
|
|
-
|
|
|
- List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
|
|
|
- //交强
|
|
|
- RiskInfoVo ciRiskInfo = riskList.stream().filter(x -> x.getRiskCode().equals(InsuranceRisk.TRAFFIC.getCode())).findFirst().orElse(null);
|
|
|
- //商业
|
|
|
- RiskInfoVo biRiskInfo = riskList.stream().filter(x -> x.getRiskCode().equals(InsuranceRisk.BUSINESS.getCode())).findFirst().orElse(null);
|
|
|
-
|
|
|
-
|
|
|
- NonAutoInsOrderReq req = new NonAutoInsOrderReq();
|
|
|
- req.setChannelCode("TQDL");
|
|
|
- //外部订单号 订单号或者uuid 使用的车价查询返回的
|
|
|
- req.setOthBusinessNo(carPriceUuid);
|
|
|
- req.setRequestTime(DateUtil.today());
|
|
|
-
|
|
|
- List<DataDTO.OrderListDTO> orderList = new ArrayList();
|
|
|
-
|
|
|
- DataDTO.OrderListDTO orderListDto = new DataDTO.OrderListDTO();
|
|
|
-
|
|
|
- /**
|
|
|
- * 被保险人信息
|
|
|
- */
|
|
|
- List<DataDTO.OrderListDTO.InsuredListDTO> insuredList = new ArrayList<>();
|
|
|
- DataDTO.OrderListDTO.InsuredListDTO insuredListDTO = new DataDTO.OrderListDTO.InsuredListDTO();
|
|
|
- insuredListDTO.setCertfNo(insuredPerson.getIdentifyNumber());
|
|
|
- insuredListDTO.setCertfType("01");
|
|
|
- insuredListDTO.setCountryName("中国");
|
|
|
- insuredListDTO.setInsuredName(insuredPerson.getName());
|
|
|
- //客户类型 insuredType String Y 1-个人,2-企业
|
|
|
- insuredListDTO.setInsuredType("1");
|
|
|
- insuredListDTO.setPhoneNo(insuredPerson.getMobile());
|
|
|
- insuredListDTO.setPlanNo("1");
|
|
|
- insuredList.add(insuredListDTO);
|
|
|
- /**
|
|
|
- * 车辆信息
|
|
|
- */
|
|
|
- List<DataDTO.OrderListDTO.ObjCarListDTO> objCarList = new ArrayList<>();
|
|
|
- DataDTO.OrderListDTO.ObjCarListDTO objCarListDTO = new DataDTO.OrderListDTO.ObjCarListDTO();
|
|
|
- objCarListDTO.setCarModels(vinQ.getBrandNameBC());
|
|
|
- objCarListDTO.setCarType("0");
|
|
|
- //车辆性质
|
|
|
- objCarListDTO.setCarTypeCode("8A");
|
|
|
- //是否新车 1-是 2-否
|
|
|
- objCarListDTO.setClnt(StringUtils.isNotEmpty(carInfo.getLicenseNo()) ? "2" : "1");
|
|
|
- objCarListDTO.setFrameNo(carInfo.getFrameNo());
|
|
|
- objCarListDTO.setLicenseNo(carInfo.getLicenseNo());
|
|
|
- objCarListDTO.setPlanNo("1");
|
|
|
- objCarListDTO.setPurchasePrice(StringUtils.toInt(vinQ.getPriceShow()));
|
|
|
- objCarListDTO.setSeatNum(StringUtils.toInt(vinQ.getSeatCountBC()));
|
|
|
- objCarListDTO.setToncount(StringUtils.toDouble(vinQ.getTonCount()));
|
|
|
- objCarList.add(objCarListDTO);
|
|
|
-
|
|
|
- /**
|
|
|
- * 投保人信息
|
|
|
- */
|
|
|
- DataDTO.OrderListDTO.OrderApplDTO orderAppl = new DataDTO.OrderListDTO.OrderApplDTO();
|
|
|
- orderAppl.setApplName(policyHolder.getName());
|
|
|
- orderAppl.setApplType("1");
|
|
|
- orderAppl.setCertfNo(policyHolder.getIdentifyNumber());
|
|
|
- orderAppl.setCertfType("01");
|
|
|
- orderAppl.setContactName(policyHolder.getName());
|
|
|
- orderAppl.setPhoneNo(policyHolder.getMobile());
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 订单信息
|
|
|
- */
|
|
|
- DataDTO.OrderListDTO.OrderMainDTO orderMain = new DataDTO.OrderListDTO.OrderMainDTO();
|
|
|
- //( 总保额 = 份数*人数(特殊产品默认人数为1)*每份保额)
|
|
|
- //@TODO 后续补
|
|
|
- BigDecimal orderAmount = BigDecimal.ONE;
|
|
|
- orderMain.setAmount(orderAmount.intValue());
|
|
|
- orderMain.setPremium(orderAmount.intValue());
|
|
|
-
|
|
|
- //yyyy-MM-dd hh:mm:ss搭售非车险保险起期规则:
|
|
|
- //(1)搭售车险是即时生效的,非车险起期为车险起期的第二天0时。
|
|
|
- //(2)搭售车险非即时生效的,非车险起期从车险保单起期。
|
|
|
- if (null != ciRiskInfo && null != biRiskInfo) {
|
|
|
- Date ciStartDate = DateUtil.parse(ciRiskInfo.getStartDate());
|
|
|
- Date biStartDate = DateUtil.parse(biRiskInfo.getStartDate());
|
|
|
- int ciBiCompare = DateUtil.compare(ciStartDate, biStartDate);
|
|
|
- //1、非即时生效
|
|
|
- if (StringUtils.isEmpty(ciRiskInfo.getInstantFlag()) && StringUtils.isEmpty(biRiskInfo.getInstantFlag())) {
|
|
|
- if (ciBiCompare == 1) {
|
|
|
- //(1)交强起期 > 商业起期,非车起期取商业起期
|
|
|
- orderMain.setStartDate(biRiskInfo.getStartDate());
|
|
|
- orderMain.setEndDate(biRiskInfo.getEndDate());
|
|
|
- } else if (ciBiCompare == -1) {
|
|
|
- //(2)交强起期 < 商业起期,非车起期取交强起期
|
|
|
- orderMain.setStartDate(ciRiskInfo.getStartDate());
|
|
|
- orderMain.setEndDate(ciRiskInfo.getEndDate());
|
|
|
- } else if (ciBiCompare == 0) {
|
|
|
- //(3)交强起期 = 商业起期,非车起期任取
|
|
|
- orderMain.setStartDate(ciRiskInfo.getStartDate());
|
|
|
- orderMain.setEndDate(ciRiskInfo.getEndDate());
|
|
|
- }
|
|
|
- } else {
|
|
|
- //2、即时生效
|
|
|
- //(1)交强即时起保起期 > 商业起期,非车起期取商业起期(不含小时数据的起期)+1天
|
|
|
- //(2)交强即时起保起期 > 商业即时起保起期,,非车起期取商业起期(不含小时数据的起期)+1天
|
|
|
- //(3)交强起期 < 商业即时起保起期,取交强起期,非车起期取交强起期(不含小时数据的起期)+1天
|
|
|
- //(4)交强即时起保起期 < 商业即时起保起期,取交强起期,非车起期取交强起期(不含小时数据的起期)+1天
|
|
|
- //(5)交强起期 = 商业起期,非车起保(不含小时数据的起期)+1天期任取
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //家用车驾乘意外险-山西版(02746425173001)
|
|
|
- orderMain.setGoodsCode("02746425173001");
|
|
|
- orderMain.setOperatorCode(channelInfo.getHandlerCode());
|
|
|
- //订单号或UUID 不确定参数,暂时使用车价的uuid
|
|
|
- orderMain.setOthOrderNo(carPriceUuid);
|
|
|
- orderMain.setProdCode(accidentalDrivingVo.getRideRiskCode());
|
|
|
- orderMain.setRenewalInd(StringUtils.isEmpty(carInfo.getLicenseNo()) ? 0 : 1);
|
|
|
- //险种代码 数组
|
|
|
- List<String> riskCodeList = new ArrayList<>();
|
|
|
- orderMain.setRiskCode(riskCodeList);
|
|
|
- orderMain.setUwCount(accidentalDrivingVo.getQuantity());
|
|
|
- //1:鼓励类 4:其他类 6:网销类
|
|
|
- orderMain.setBusinessMode("1");
|
|
|
-
|
|
|
- //0:直接业务
|
|
|
- //1:个人代理
|
|
|
- //2:专业代理
|
|
|
- //3:兼业代理
|
|
|
- //4:经纪业务—境内经纪
|
|
|
- //5:经纪业务—境外经纪
|
|
|
- //6:电销业务
|
|
|
- //7:柜台业务
|
|
|
- //8:网上业务 ......
|
|
|
- orderMain.setBusinessSource("2");
|
|
|
- orderListDto.setInsuredList(insuredList);
|
|
|
- /**
|
|
|
- * 方案信息
|
|
|
- */
|
|
|
- List<DataDTO.OrderListDTO.PlanListDTO> planList = new ArrayList<>();
|
|
|
- DataDTO.OrderListDTO.PlanListDTO planListDto = new DataDTO.OrderListDTO.PlanListDTO();
|
|
|
- //按照示例传的
|
|
|
- planListDto.setOccupationCode("0500020");
|
|
|
- planListDto.setOccupationGrade("1");
|
|
|
- planListDto.setOccupationName("其他");
|
|
|
- planListDto.setPlanNo("1");
|
|
|
- planListDto.setQuantity("1");
|
|
|
- planListDto.setSocialSecInd("01");
|
|
|
- planList.add(planListDto);
|
|
|
-
|
|
|
- /**
|
|
|
- * 业务员信息
|
|
|
- */
|
|
|
- List<DataDTO.OrderListDTO.SalesmanListDTO> salesmanList = new ArrayList<>();
|
|
|
- DataDTO.OrderListDTO.SalesmanListDTO salesmanListDTO = new DataDTO.OrderListDTO.SalesmanListDTO();
|
|
|
- salesmanListDTO.setAgentCode(channelInfo.getAgentCode());
|
|
|
- salesmanListDTO.setCompanyCode(channelInfo.getComCode());
|
|
|
- salesmanListDTO.setSalesmanCode(channelInfo.getHandlerCode());
|
|
|
- //0-辅合作方,1-主合作方(默认1-主合作方
|
|
|
- salesmanListDTO.setSalesmanFlag(1);
|
|
|
- salesmanListDTO.setSalesmanName(channelInfo.getHandlerName());
|
|
|
- salesmanListDTO.setSerialNo(1);
|
|
|
- salesmanListDTO.setTeamCode("");
|
|
|
- salesmanListDTO.setTeamName("");
|
|
|
- salesmanList.add(salesmanListDTO);
|
|
|
-
|
|
|
- orderListDto.setInsuredList(insuredList);
|
|
|
- orderListDto.setOrderAppl(orderAppl);
|
|
|
- orderListDto.setOrderMain(orderMain);
|
|
|
- orderListDto.setPlanList(planList);
|
|
|
- orderListDto.setSalesmanList(salesmanList);
|
|
|
- orderListDto.setObjCarList(objCarList);
|
|
|
- orderList.add(orderListDto);
|
|
|
- DataDTO data = new DataDTO();
|
|
|
- data.setOrderList(orderList);
|
|
|
- req.setData(data);
|
|
|
- return req;
|
|
|
+ public NonAutoInsOrderReq(BaseQuoteInfoVo yaQuoteInfoVo,
|
|
|
+ VinQueryResp.DataDTO vinQ,
|
|
|
+ GuorenAccidentalDrivingVo accidentalDrivingVo,
|
|
|
+ ChannelInfoDto channelInfo,
|
|
|
+ String carPriceUuid,
|
|
|
+ String channelCode
|
|
|
+ ) {
|
|
|
+
|
|
|
+ this.channelCode = channelCode;
|
|
|
+ this.data = new DataDTO(yaQuoteInfoVo, vinQ, accidentalDrivingVo, channelInfo, carPriceUuid);
|
|
|
+ this.othBusinessNo = carPriceUuid;
|
|
|
+ this.requestTime = DateUtil.today();
|
|
|
}
|
|
|
|
|
|
@NoArgsConstructor
|
|
|
@Data
|
|
|
public static class DataDTO {
|
|
|
+
|
|
|
@JsonProperty(value = "orderList")
|
|
|
@JSONField(name = "orderList")
|
|
|
private List<OrderListDTO> orderList;
|
|
|
|
|
|
+ public DataDTO(BaseQuoteInfoVo yaQuoteInfoVo, VinQueryResp.DataDTO vinQ, GuorenAccidentalDrivingVo accidentalDrivingVo, ChannelInfoDto channelInfo, String carPriceUuid) {
|
|
|
+ OrderListDTO orderListDTO = new OrderListDTO(yaQuoteInfoVo, vinQ, accidentalDrivingVo, channelInfo, carPriceUuid);
|
|
|
+ this.orderList = Collections.singletonList(orderListDTO);
|
|
|
+ }
|
|
|
+
|
|
|
@NoArgsConstructor
|
|
|
@Data
|
|
|
public static class OrderListDTO {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 被保险人信息
|
|
|
+ */
|
|
|
@JsonProperty(value = "insuredList")
|
|
|
@JSONField(name = "insuredList")
|
|
|
private List<InsuredListDTO> insuredList;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 车辆标的信息
|
|
|
+ */
|
|
|
@JsonProperty(value = "objCarList")
|
|
|
@JSONField(name = "objCarList")
|
|
|
private List<ObjCarListDTO> objCarList;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 投保人信息
|
|
|
+ */
|
|
|
@JsonProperty(value = "orderAppl")
|
|
|
@JSONField(name = "orderAppl")
|
|
|
private OrderApplDTO orderAppl;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 订单信息
|
|
|
+ */
|
|
|
@JsonProperty(value = "orderMain")
|
|
|
@JSONField(name = "orderMain")
|
|
|
private OrderMainDTO orderMain;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 方案信息
|
|
|
+ */
|
|
|
@JsonProperty(value = "planList")
|
|
|
@JSONField(name = "planList")
|
|
|
private List<PlanListDTO> planList;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 业务员信息
|
|
|
+ */
|
|
|
@JsonProperty(value = "salesmanList")
|
|
|
@JSONField(name = "salesmanList")
|
|
|
private List<SalesmanListDTO> salesmanList;
|
|
|
|
|
|
+ public OrderListDTO(BaseQuoteInfoVo quoteInfoVo, VinQueryResp.DataDTO vinQ, GuorenAccidentalDrivingVo accidentalDrivingVo, ChannelInfoDto channelInfo, String carPriceUuid) {
|
|
|
+ //被保人
|
|
|
+ CustomerInfoVo insuredPerson = quoteInfoVo.getInsuredPersonInfo();
|
|
|
+ InsuredListDTO insuredListDTO = new InsuredListDTO(insuredPerson);
|
|
|
+ this.insuredList = Collections.singletonList(insuredListDTO);
|
|
|
+
|
|
|
+ //车辆信息
|
|
|
+ CarInfoVo carInfo = quoteInfoVo.getCarInfo();
|
|
|
+ ObjCarListDTO objCarListDTO = new ObjCarListDTO(carInfo, vinQ);
|
|
|
+ this.objCarList = Collections.singletonList(objCarListDTO);
|
|
|
+
|
|
|
+ //投保人
|
|
|
+ CustomerInfoVo policyHolder = quoteInfoVo.getPolicyHolderInfo();
|
|
|
+ this.orderAppl = new OrderApplDTO(policyHolder);
|
|
|
+
|
|
|
+ // 订单信息
|
|
|
+ List<RiskInfoVo> riskList = quoteInfoVo.getRiskList();
|
|
|
+
|
|
|
+ this.orderMain = new OrderMainDTO(riskList, accidentalDrivingVo, channelInfo.getHandlerCode(), carPriceUuid);
|
|
|
+
|
|
|
+ // 方案信息
|
|
|
+ PlanListDTO planListDTO = new PlanListDTO();
|
|
|
+ this.planList = Collections.singletonList(planListDTO);
|
|
|
+
|
|
|
+ // 业务员信息
|
|
|
+ SalesmanListDTO salesmanListDTO = new SalesmanListDTO(channelInfo);
|
|
|
+ this.salesmanList = Collections.singletonList(salesmanListDTO);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@NoArgsConstructor
|
|
|
@Data
|
|
|
public static class OrderApplDTO {
|
|
|
+
|
|
|
@JsonProperty(value = "applName")
|
|
|
@JSONField(name = "applName")
|
|
|
private String applName;
|
|
|
+
|
|
|
@JsonProperty(value = "applType")
|
|
|
@JSONField(name = "applType")
|
|
|
private String applType;
|
|
|
+
|
|
|
@JsonProperty(value = "certfNo")
|
|
|
@JSONField(name = "certfNo")
|
|
|
private String certfNo;
|
|
|
+
|
|
|
@JsonProperty(value = "certfType")
|
|
|
@JSONField(name = "certfType")
|
|
|
private String certfType;
|
|
|
+
|
|
|
@JsonProperty(value = "contactName")
|
|
|
@JSONField(name = "contactName")
|
|
|
private String contactName;
|
|
|
+
|
|
|
@JsonProperty(value = "phoneNo")
|
|
|
@JSONField(name = "phoneNo")
|
|
|
private String phoneNo;
|
|
|
+
|
|
|
+ public OrderApplDTO(CustomerInfoVo customerInfoVo) {
|
|
|
+ this.applName = customerInfoVo.getName();
|
|
|
+ this.applType = "1";
|
|
|
+ this.certfNo = customerInfoVo.getIdentifyNumber();
|
|
|
+ this.certfType = "01";
|
|
|
+ this.contactName = customerInfoVo.getName();
|
|
|
+ this.phoneNo = customerInfoVo.getMobile();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@NoArgsConstructor
|
|
|
@Data
|
|
|
public static class OrderMainDTO {
|
|
|
+
|
|
|
@JsonProperty(value = "amount")
|
|
|
@JSONField(name = "amount")
|
|
|
private Integer amount;
|
|
|
+
|
|
|
@JsonProperty(value = "endDate")
|
|
|
@JSONField(name = "endDate")
|
|
|
private String endDate;
|
|
|
+
|
|
|
@JsonProperty(value = "goodsCode")
|
|
|
@JSONField(name = "goodsCode")
|
|
|
private String goodsCode;
|
|
|
+
|
|
|
@JsonProperty(value = "operatorCode")
|
|
|
@JSONField(name = "operatorCode")
|
|
|
private String operatorCode;
|
|
|
+
|
|
|
@JsonProperty(value = "othOrderNo")
|
|
|
@JSONField(name = "othOrderNo")
|
|
|
private String othOrderNo;
|
|
|
+
|
|
|
@JsonProperty(value = "premium")
|
|
|
@JSONField(name = "premium")
|
|
|
private Integer premium;
|
|
|
+
|
|
|
@JsonProperty(value = "prodCode")
|
|
|
@JSONField(name = "prodCode")
|
|
|
private String prodCode;
|
|
|
+
|
|
|
@JsonProperty(value = "renewalInd")
|
|
|
@JSONField(name = "renewalInd")
|
|
|
private Integer renewalInd;
|
|
|
+
|
|
|
@JsonProperty(value = "riskCode")
|
|
|
@JSONField(name = "riskCode")
|
|
|
+
|
|
|
private List<String> riskCode;
|
|
|
@JsonProperty(value = "startDate")
|
|
|
@JSONField(name = "startDate")
|
|
|
private String startDate;
|
|
|
+
|
|
|
@JsonProperty(value = "uwCount")
|
|
|
@JSONField(name = "uwCount")
|
|
|
private Integer uwCount;
|
|
|
+
|
|
|
@JsonProperty(value = "businessMode")
|
|
|
@JSONField(name = "businessMode")
|
|
|
private String businessMode;
|
|
|
+
|
|
|
@JsonProperty(value = "businessSource")
|
|
|
@JSONField(name = "businessSource")
|
|
|
private String businessSource;
|
|
|
+
|
|
|
+ public OrderMainDTO(List<RiskInfoVo> riskList, GuorenAccidentalDrivingVo accidentalDrivingVo, String operatorCode, String carPriceUuid) {
|
|
|
+ this.amount = accidentalDrivingVo.getAmount();
|
|
|
+ this.premium = accidentalDrivingVo.getPremium();
|
|
|
+ this.goodsCode = accidentalDrivingVo.getGoodsCode();
|
|
|
+ this.prodCode = accidentalDrivingVo.getProdCode();
|
|
|
+ this.uwCount = accidentalDrivingVo.getQuantity();
|
|
|
+
|
|
|
+ this.operatorCode = operatorCode;
|
|
|
+ this.othOrderNo = carPriceUuid;
|
|
|
+ this.renewalInd = 0;
|
|
|
+ this.riskCode = Collections.singletonList(accidentalDrivingVo.getRiskCode());
|
|
|
+
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ String start;
|
|
|
+ RiskInfoVo riskInfoVo = getRiskInfoVo(riskList, formatter);
|
|
|
+
|
|
|
+ start = riskInfoVo.getStartDate();
|
|
|
+ LocalDateTime startLocalDateTime;
|
|
|
+ LocalDateTime localDateTime = LocalDateTime.parse(start, formatter);
|
|
|
+ if (start.contains("00:00:00")) {
|
|
|
+ startLocalDateTime = localDateTime;
|
|
|
+ } else {
|
|
|
+ LocalDate localDate = localDateTime.toLocalDate().plusDays(1);
|
|
|
+ startLocalDateTime = localDate.atStartOfDay();
|
|
|
+ start = startLocalDateTime.format(formatter);
|
|
|
+ }
|
|
|
+ String end = startLocalDateTime.plusYears(1).plusSeconds(-1).format(formatter);
|
|
|
+
|
|
|
+ this.startDate = start;
|
|
|
+ this.endDate = end;
|
|
|
+
|
|
|
+ this.businessMode = "1";
|
|
|
+ this.businessSource = "2";
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private static RiskInfoVo getRiskInfoVo(List<RiskInfoVo> riskList, DateTimeFormatter formatter) {
|
|
|
+ if (riskList.size() == 1) {
|
|
|
+ return riskList.get(0);
|
|
|
+ } else {
|
|
|
+ RiskInfoVo riskInfoVo1 = riskList.get(0);
|
|
|
+ RiskInfoVo riskInfoVo2 = riskList.get(1);
|
|
|
+ String startDate1 = riskInfoVo1.getStartDate();
|
|
|
+ String startDate2 = riskInfoVo2.getStartDate();
|
|
|
+ LocalDateTime localDateTime1 = LocalDateTime.parse(startDate1, formatter);
|
|
|
+ LocalDateTime localDateTime2 = LocalDateTime.parse(startDate2, formatter);
|
|
|
+ boolean after = localDateTime1.isAfter(localDateTime2);
|
|
|
+ if (after) {
|
|
|
+ return riskInfoVo2;
|
|
|
+ }
|
|
|
+ return riskInfoVo1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@NoArgsConstructor
|
|
|
@@ -330,111 +303,194 @@ public class NonAutoInsOrderReq {
|
|
|
@JsonProperty(value = "certfNo")
|
|
|
@JSONField(name = "certfNo")
|
|
|
private String certfNo;
|
|
|
+
|
|
|
@JsonProperty(value = "certfType")
|
|
|
@JSONField(name = "certfType")
|
|
|
private String certfType;
|
|
|
+
|
|
|
@JsonProperty(value = "countryName")
|
|
|
@JSONField(name = "countryName")
|
|
|
private String countryName;
|
|
|
+
|
|
|
@JsonProperty(value = "insuredName")
|
|
|
@JSONField(name = "insuredName")
|
|
|
private String insuredName;
|
|
|
+
|
|
|
@JsonProperty(value = "insuredType")
|
|
|
@JSONField(name = "insuredType")
|
|
|
private String insuredType;
|
|
|
+
|
|
|
@JsonProperty(value = "phoneNo")
|
|
|
@JSONField(name = "phoneNo")
|
|
|
private String phoneNo;
|
|
|
+
|
|
|
@JsonProperty(value = "planNo")
|
|
|
@JSONField(name = "planNo")
|
|
|
private String planNo;
|
|
|
+
|
|
|
+ public InsuredListDTO(CustomerInfoVo customerInfoVo) {
|
|
|
+ this.certfNo = customerInfoVo.getIdentifyNumber();
|
|
|
+ this.certfType = "01";
|
|
|
+ this.countryName = "中国";
|
|
|
+ this.insuredName = customerInfoVo.getName();
|
|
|
+ //客户类型 insuredType String Y 1-个人,2-企业
|
|
|
+ this.insuredType = "1";
|
|
|
+ this.phoneNo = customerInfoVo.getMobile();
|
|
|
+ this.planNo = "1";
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@NoArgsConstructor
|
|
|
@Data
|
|
|
public static class ObjCarListDTO {
|
|
|
+
|
|
|
@JsonProperty(value = "carModels")
|
|
|
@JSONField(name = "carModels")
|
|
|
private String carModels;
|
|
|
+
|
|
|
@JsonProperty(value = "carType")
|
|
|
@JSONField(name = "carType")
|
|
|
private String carType;
|
|
|
+
|
|
|
@JsonProperty(value = "carTypeCode")
|
|
|
@JSONField(name = "carTypeCode")
|
|
|
private String carTypeCode;
|
|
|
+
|
|
|
@JsonProperty(value = "clnt")
|
|
|
@JSONField(name = "clnt")
|
|
|
private String clnt;
|
|
|
+
|
|
|
@JsonProperty(value = "frameNo")
|
|
|
@JSONField(name = "frameNo")
|
|
|
private String frameNo;
|
|
|
+
|
|
|
@JsonProperty(value = "licenseNo")
|
|
|
@JSONField(name = "licenseNo")
|
|
|
private String licenseNo;
|
|
|
+
|
|
|
@JsonProperty(value = "planNo")
|
|
|
@JSONField(name = "planNo")
|
|
|
private String planNo;
|
|
|
+
|
|
|
@JsonProperty(value = "purchasePrice")
|
|
|
@JSONField(name = "purchasePrice")
|
|
|
- private Integer purchasePrice;
|
|
|
+ private Double purchasePrice;
|
|
|
+
|
|
|
@JsonProperty(value = "seatNum")
|
|
|
@JSONField(name = "seatNum")
|
|
|
private Integer seatNum;
|
|
|
+
|
|
|
@JsonProperty(value = "toncount")
|
|
|
@JSONField(name = "toncount")
|
|
|
private Double toncount;
|
|
|
+
|
|
|
+ public ObjCarListDTO(CarInfoVo carInfo, VinQueryResp.DataDTO vinQ) {
|
|
|
+ this.carModels = vinQ.getBrandNameBC();
|
|
|
+ this.carType = "0";
|
|
|
+ this.carTypeCode = "8A";
|
|
|
+ this.clnt = StringUtils.isNotEmpty(carInfo.getLicenseNo()) ? "2" : "1";
|
|
|
+ this.frameNo = carInfo.getFrameNo();
|
|
|
+ this.licenseNo = carInfo.getLicenseNo();
|
|
|
+ this.planNo = "1";
|
|
|
+ this.purchasePrice = Double.valueOf(vinQ.getPriceShow());
|
|
|
+ this.seatNum = Integer.valueOf(vinQ.getSeatCountBC());
|
|
|
+ this.toncount = Double.valueOf(vinQ.getTonCount());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- @NoArgsConstructor
|
|
|
@Data
|
|
|
public static class PlanListDTO {
|
|
|
+
|
|
|
@JsonProperty(value = "occupationCode")
|
|
|
@JSONField(name = "occupationCode")
|
|
|
private String occupationCode;
|
|
|
+
|
|
|
@JsonProperty(value = "occupationGrade")
|
|
|
@JSONField(name = "occupationGrade")
|
|
|
private String occupationGrade;
|
|
|
+
|
|
|
@JsonProperty(value = "occupationName")
|
|
|
@JSONField(name = "occupationName")
|
|
|
private String occupationName;
|
|
|
+
|
|
|
@JsonProperty(value = "planNo")
|
|
|
@JSONField(name = "planNo")
|
|
|
private String planNo;
|
|
|
+
|
|
|
@JsonProperty(value = "quantity")
|
|
|
@JSONField(name = "quantity")
|
|
|
private String quantity;
|
|
|
+
|
|
|
@JsonProperty(value = "socialSecInd")
|
|
|
@JSONField(name = "socialSecInd")
|
|
|
private String socialSecInd;
|
|
|
+
|
|
|
+ public PlanListDTO() {
|
|
|
+ //按照示例传的
|
|
|
+ this.occupationCode = "0500020";
|
|
|
+ this.occupationGrade = "1";
|
|
|
+ this.occupationName = "其他";
|
|
|
+ this.planNo = "1";
|
|
|
+ this.quantity = "1";
|
|
|
+ this.socialSecInd = "01";
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@NoArgsConstructor
|
|
|
@Data
|
|
|
public static class SalesmanListDTO {
|
|
|
+
|
|
|
@JsonProperty(value = "agentCode")
|
|
|
@JSONField(name = "agentCode")
|
|
|
private String agentCode;
|
|
|
+
|
|
|
+ @JsonProperty(value = "agentCnrtNo")
|
|
|
+ @JSONField(name = "agentCnrtNo")
|
|
|
+ private String agentCnrtNo;
|
|
|
+
|
|
|
@JsonProperty(value = "companyCode")
|
|
|
@JSONField(name = "companyCode")
|
|
|
private String companyCode;
|
|
|
+
|
|
|
@JsonProperty(value = "salesmanCode")
|
|
|
@JSONField(name = "salesmanCode")
|
|
|
private String salesmanCode;
|
|
|
+
|
|
|
@JsonProperty(value = "salesmanFlag")
|
|
|
@JSONField(name = "salesmanFlag")
|
|
|
private Integer salesmanFlag;
|
|
|
+
|
|
|
@JsonProperty(value = "salesmanName")
|
|
|
@JSONField(name = "salesmanName")
|
|
|
private String salesmanName;
|
|
|
+
|
|
|
@JsonProperty(value = "serialNo")
|
|
|
@JSONField(name = "serialNo")
|
|
|
private Integer serialNo;
|
|
|
+
|
|
|
@JsonProperty(value = "teamCode")
|
|
|
@JSONField(name = "teamCode")
|
|
|
private String teamCode;
|
|
|
+
|
|
|
@JsonProperty(value = "teamName")
|
|
|
@JSONField(name = "teamName")
|
|
|
private String teamName;
|
|
|
+
|
|
|
+
|
|
|
+ public SalesmanListDTO(ChannelInfoDto channelInfo) {
|
|
|
+ this.agentCnrtNo = channelInfo.getAgreementNo();
|
|
|
+ this.agentCode = channelInfo.getAgentCode();
|
|
|
+ this.companyCode = channelInfo.getComCode();
|
|
|
+ this.salesmanCode = channelInfo.getHandlerCode();
|
|
|
+ this.salesmanFlag = 1;
|
|
|
+ this.salesmanName = channelInfo.getHandlerName();
|
|
|
+ this.serialNo = 1;
|
|
|
+ this.teamCode = "";
|
|
|
+ this.teamName = "";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|