Procházet zdrojové kódy

1.国任非车险订单修改

wks před 2 roky
rodič
revize
e5b1c5fbcd
16 změnil soubory, kde provedl 702 přidání a 411 odebrání
  1. 5 25
      src/main/java/com/ydtech/modules/ins/model/guoren/CarPriceReq.java
  2. 250 194
      src/main/java/com/ydtech/modules/ins/model/guoren/NonAutoInsOrderReq.java
  3. 47 26
      src/main/java/com/ydtech/modules/ins/model/guoren/NonAutoInsResp.java
  4. 76 0
      src/main/java/com/ydtech/modules/ins/model/guoren/VinQueryResp.java
  5. 6 11
      src/main/java/com/ydtech/modules/order/controller/GuoRenOrderApiController.java
  6. 30 0
      src/main/java/com/ydtech/modules/order/entity/api/guoren/request/ApplicationDetailsRequest.java
  7. 44 0
      src/main/java/com/ydtech/modules/order/entity/api/guoren/request/NonAutoInsuranceRequest.java
  8. 35 0
      src/main/java/com/ydtech/modules/order/entity/api/guoren/response/NonAutoInsOrderResponse.java
  9. 32 0
      src/main/java/com/ydtech/modules/order/entity/vo/guoren/GuorenAccidentalDrivingVo.java
  10. 16 0
      src/main/java/com/ydtech/modules/order/entity/vo/guoren/NonAutoInsuranceList.java
  11. 24 0
      src/main/java/com/ydtech/modules/order/entity/vo/guoren/NonAutoInsuranceQueryVo.java
  12. 5 0
      src/main/java/com/ydtech/modules/order/entity/vo/zm/ZmQuoteSpiderVo.java
  13. 7 6
      src/main/java/com/ydtech/modules/order/service/GuorenOrderApiService.java
  14. 57 84
      src/main/java/com/ydtech/modules/order/service/impl/GuorenOrderApiServiceImpl.java
  15. 14 15
      src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java
  16. 54 50
      src/main/java/com/ydtech/modules/order/service/impl/ZhongMeiOrderApiServiceImpl.java

+ 5 - 25
src/main/java/com/ydtech/modules/ins/model/guoren/CarPriceReq.java

@@ -24,12 +24,15 @@ public class CarPriceReq {
     @JsonProperty(value = "bc")
     @JSONField(name = "bc")
     private BcDTO bc;
+
     @JsonProperty(value = "basePartVo")
     @JSONField(name = "basePartVo")
     private BasePartVoDTO basePartVo;
+
     @JsonProperty(value = "bi")
     @JSONField(name = "bi")
     private BiDTO bi;
+
     @JsonProperty(value = "ci")
     @JSONField(name = "ci")
     private CiDTO ci;
@@ -39,25 +42,13 @@ public class CarPriceReq {
         CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
         CustomerInfoVo ownerInfo = yaQuoteInfoVo.getOwnerInfo();
         List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
-        List<KindInfoVo> kindInfoVList = yaQuoteInfoVo.getKindList();
         //交强
-        RiskInfoVo ciRiskInfo = (RiskInfoVo) riskList.stream().filter(x -> x.getRiskCode().equals(InsuranceRisk.TRAFFIC.getCode())).findFirst().orElse(null);
+        RiskInfoVo ciRiskInfo = riskList.stream().filter(x -> x.getRiskCode().equals(InsuranceRisk.TRAFFIC.getCode())).findFirst().orElse(null);
         //商业
-        RiskInfoVo biRiskInfo = (RiskInfoVo) riskList.stream().filter(x -> x.getRiskCode().equals(InsuranceRisk.BUSINESS.getCode())).findFirst().orElse(null);
-
-//        riskList.stream().forEach(a ->{
-//            if(a.getRiskCode().equals("0507")){
-//                ciRiskInfo = a;
-//            }
-//        });
-
-
+        RiskInfoVo biRiskInfo =  riskList.stream().filter(x -> x.getRiskCode().equals(InsuranceRisk.BUSINESS.getCode())).findFirst().orElse(null);
         CarPriceReq req = new CarPriceReq();
-
         BcDTO bc = new BcDTO();
         bc.setLoginComCode(channelInfo.getComCode());
-
-
         /**
          *  主信息====================
          */
@@ -88,8 +79,6 @@ public class CarPriceReq {
         prpTmain.setEProposalFlag("1");
         //购车发票日期
         prpTmain.setBusiness(carInfo.getIssueDate());
-
-
         prpTmain.setAgentName(channelInfo.getAgentName());
         prpTmain.setChanneltypetwoName(channelInfo.getChannelTypeTwoName());
         prpTmain.setChanneltypeoneName(channelInfo.getChannelTypeOneName());
@@ -100,8 +89,6 @@ public class CarPriceReq {
         prpTmain.setChanneltypeone(channelInfo.getChannelTypeOne());
         prpTmain.setHandler1Name(channelInfo.getHandler1Name());
         prpTmain.setChanneltypetwo(channelInfo.getChannelTypeTwo());
-
-
         /**
          *  车辆信息====================
          */
@@ -123,7 +110,6 @@ public class CarPriceReq {
         prpTitemCar.setVinNo(carInfo.getVinNo());
         prpTitemCar.setVehicleBrand(vinQ.getBrandNameBC());
 //        prpTitemCar.setVehicleBrand(carInfo.getCarBrand());
-
         prpTitemCar.setCompleteKerbMass(vinQ.getCompleteKerbMass());
         prpTitemCar.setLoanVehicleFlag("0");
         prpTitemCar.setChgOwnerFlag(carInfo.isTransferFlag() ? "1" : "0");
@@ -147,8 +133,6 @@ public class CarPriceReq {
 
         //过户日期
         prpTitemCar.setChgOwnerDate(carInfo.getTransferDate());
-
-
         /**
          * vin car
          */
@@ -156,8 +140,6 @@ public class CarPriceReq {
         prpTitemCar.setModelCode(vinQ.getModelCodeBC());
         prpTitemCar.setModelName(vinQ.getBrandNameBC());
         prpTitemCar.setNewFuelModel(vinQ.getNewFuelModel());
-
-
         /**
          * 车主信息
          */
@@ -168,8 +150,6 @@ public class CarPriceReq {
         prpTitemCar.setCarOwnerNature("0");
         prpTitemCar.setIDValidStartDate(ownerInfo.getIdentifyValidDate());
         prpTitemCar.setIdValidDate(ownerInfo.getIdentifyValidEndDate());
-
-
         /**
          *  整合
          */

+ 250 - 194
src/main/java/com/ydtech/modules/ins/model/guoren/NonAutoInsOrderReq.java

@@ -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 = "";
+                }
             }
         }
     }

+ 47 - 26
src/main/java/com/ydtech/modules/ins/model/guoren/NonAutoInsResp.java

@@ -24,10 +24,15 @@ public class NonAutoInsResp {
     @JsonProperty(value = "code")
     @JSONField(name = "code")
     private Integer code;
+
     @JsonProperty(value = "data")
     @JSONField(name = "data")
     private DataDTO data;
 
+    @JsonProperty(value = "msg")
+    @JSONField(name = "msg")
+    private String message;
+
     @NoArgsConstructor
     @Data
     @ApiModel("非车险信息")
@@ -37,21 +42,25 @@ public class NonAutoInsResp {
         @JSONField(name = "goods")
         private GoodsDTO goods;
 
-//        @JsonProperty(value = "goodsAgentSalesmanList")
-//        @JSONField(name = "goodsAgentSalesmanList")
-//        private List<GoodsAgentSalesmanListDTO> goodsAgentSalesmanList;
-//        @JsonProperty(value = "goodsSalesInfo")
-//        @JSONField(name = "goodsSalesInfo")
-//        private GoodsSalesInfoDTO goodsSalesInfo;
-//        @JsonProperty(value = "goodsPrpallConfList")
-//        @JSONField(name = "goodsPrpallConfList")
-//        private List<GoodsPrpallConfListDTO> goodsPrpallConfList;
-//        @JsonProperty(value = "goodsIntroduction")
-//        @JSONField(name = "goodsIntroduction")
-//        private GoodsIntroductionDTO goodsIntroduction;
-//        @JsonProperty(value = "channelContactList")
-//        @JSONField(name = "channelContactList")
-//        private List<ChannelContactListDTO> channelContactList;
+        @JsonProperty(value = "goodsAgentSalesmanList")
+        @JSONField(name = "goodsAgentSalesmanList")
+        private List<GoodsAgentSalesmanListDTO> goodsAgentSalesmanList;
+
+        @JsonProperty(value = "goodsSalesInfo")
+        @JSONField(name = "goodsSalesInfo")
+        private GoodsSalesInfoDTO goodsSalesInfo;
+
+        @JsonProperty(value = "goodsPrpallConfList")
+        @JSONField(name = "goodsPrpallConfList")
+        private List<GoodsPrpallConfListDTO> goodsPrpallConfList;
+
+        @JsonProperty(value = "goodsIntroduction")
+        @JSONField(name = "goodsIntroduction")
+        private GoodsIntroductionDTO goodsIntroduction;
+
+        @JsonProperty(value = "channelContactList")
+        @JSONField(name = "channelContactList")
+        private List<ChannelContactListDTO> channelContactList;
 
         @ApiModelProperty("产品信息")
         @JsonProperty(value = "prodList")
@@ -61,6 +70,7 @@ public class NonAutoInsResp {
         @JsonProperty(value = "checkRepeat")
         @JSONField(name = "checkRepeat")
         private CheckRepeatDTO checkRepeat;
+
         @JsonProperty(value = "checkInsureDef")
         @JSONField(name = "checkInsureDef")
         private CheckInsureDefDTO checkInsureDef;
@@ -526,10 +536,21 @@ public class NonAutoInsResp {
             @JSONField(name = "prodRiskList")
             private List<ProdRiskListDTO> prodRiskList;
 
+            @ApiModelProperty("险种数据")
             @JsonProperty(value = "technologyInd")
             @JSONField(name = "technologyInd")
             private String technologyInd;
 
+            @ApiModelProperty("限购份数")
+            @JsonProperty(value = "policyNum")
+            @JSONField(name = "policyNum")
+            private String policyNum;
+
+            @ApiModelProperty("选购份数")
+            @JsonProperty(value = "appnum")
+            @JSONField(name = "appnum")
+            private String appnum;
+
             @NoArgsConstructor
             @Data
             public static class ProdRiskListDTO {
@@ -566,17 +587,17 @@ public class NonAutoInsResp {
                 @JSONField(name = "invalidFlag")
                 private Integer invalidFlag;
 
-//                @JsonProperty(value = "prodCvgList")
-//                @JSONField(name = "prodCvgList")
-//                private List<ProdCvgListDTO> prodCvgList;
-//
-//                @JsonProperty(value = "prodEngageList")
-//                @JSONField(name = "prodEngageList")
-//                private List<ProdEngageListDTO> prodEngageList;
-//
-//                @JsonProperty(value = "prodClauseList")
-//                @JSONField(name = "prodClauseList")
-//                private List<ProdClauseListDTO> prodClauseList;
+                @JsonProperty(value = "prodCvgList")
+                @JSONField(name = "prodCvgList")
+                private List<ProdCvgListDTO> prodCvgList;
+
+                @JsonProperty(value = "prodEngageList")
+                @JSONField(name = "prodEngageList")
+                private List<ProdEngageListDTO> prodEngageList;
+
+                @JsonProperty(value = "prodClauseList")
+                @JSONField(name = "prodClauseList")
+                private List<ProdClauseListDTO> prodClauseList;
 
                 @ApiModelProperty("产品险别责任表数据传输对象")
                 @JsonProperty(value = "prodCvgLiabList")

+ 76 - 0
src/main/java/com/ydtech/modules/ins/model/guoren/VinQueryResp.java

@@ -29,105 +29,181 @@ public class VinQueryResp {
     @NoArgsConstructor
     @Data
     public static class DataDTO {
+        /**
+         * 车型名称
+         */
         @JsonProperty(value = "brandNameBC")
         @JSONField(name = "brandNameBC")
         private String brandNameBC;
+        /**
+         * 车型别名
+         */
         @JsonProperty(value = "vehicleAlias")
         @JSONField(name = "vehicleAlias")
         private String vehicleAlias;
+        /**
+         * 国家类型
+         */
         @JsonProperty(value = "importFlag")
         @JSONField(name = "importFlag")
         private String importFlag;
+        /**
+         * 厂家
+         */
         @JsonProperty(value = "factory")
         @JSONField(name = "factory")
         private String factory;
+        /**
+         * 交强险名称
+         */
         @JsonProperty(value = "jqxClassname")
         @JSONField(name = "jqxClassname")
         private String jqxClassname;
+        /**
+         * 商业险名称
+         */
         @JsonProperty(value = "syxClassname")
         @JSONField(name = "syxClassname")
         private String syxClassname;
+        /**
+         * 核定座位数
+         */
         @JsonProperty(value = "seatCountBC")
         @JSONField(name = "seatCountBC")
         private String seatCountBC;
+        /**
+         * 最大座位数
+         */
         @JsonProperty(value = "seatMax")
         @JSONField(name = "seatMax")
         private String seatMax;
+        /**
+         * 最小座位数
+         */
         @JsonProperty(value = "seatMin")
         @JSONField(name = "seatMin")
         private String seatMin;
+        /**
+         * 吨位
+         */
         @JsonProperty(value = "tonCount")
         @JSONField(name = "tonCount")
         private String tonCount;
+        /**
+         * 购置价含税
+         */
         @JsonProperty(value = "purchasePriceSZ")
         @JSONField(name = "purchasePriceSZ")
         private String purchasePriceSZ;
+        /**
+         * 新车购置价
+         */
         @JsonProperty(value = "priceShow")
         @JSONField(name = "priceShow")
         private String priceShow;
+        /**
+         * 上市日期
+         */
         @JsonProperty(value = "carYear")
         @JSONField(name = "carYear")
         private String carYear;
+        /**
+         * 排量
+         */
         @JsonProperty(value = "exHaustScale")
         @JSONField(name = "exHaustScale")
         private String exHaustScale;
+        /**
+         * 车船税减免标志
+         */
         @JsonProperty(value = "newFuelModel")
         @JSONField(name = "newFuelModel")
         private String newFuelModel;
+        /**
+         * 最大整备质量
+         */
         @JsonProperty(value = "completeKerbMass")
         @JSONField(name = "completeKerbMass")
         private String completeKerbMass;
+        /**
+         * 最小整备质量
+         */
         @JsonProperty(value = "completeKerbMassMin")
         @JSONField(name = "completeKerbMassMin")
         private String completeKerbMassMin;
+        /**
+         *
+         */
         @JsonProperty(value = "content")
         @JSONField(name = "content")
         private ContentDTO content;
+        /**
+         * 厂牌型号代码
+         */
         @JsonProperty(value = "brandCode")
         @JSONField(name = "brandCode")
         private String brandCode;
+        /**
+         * 功率
+         */
         @JsonProperty(value = "power")
         @JSONField(name = "power")
         private String power;
+        /**
+         * 类比功率
+         */
         @JsonProperty(value = "powerLB")
         @JSONField(name = "powerLB")
         private String powerLB;
+
         @JsonProperty(value = "fuelType")
         @JSONField(name = "fuelType")
         private String fuelType;
+
         @JsonProperty(value = "gearBoxtyPecode")
         @JSONField(name = "gearBoxtyPecode")
         private String gearBoxtyPecode;
+
         @JsonProperty(value = "stopFlagCode")
         @JSONField(name = "stopFlagCode")
         private String stopFlagCode;
+
         @JsonProperty(value = "riskTypeCode")
         @JSONField(name = "riskTypeCode")
         private String riskTypeCode;
+
         @JsonProperty(value = "riskTypeName")
         @JSONField(name = "riskTypeName")
         private String riskTypeName;
+
         @JsonProperty(value = "vehicleClassNewCode")
         @JSONField(name = "vehicleClassNewCode")
         private String vehicleClassNewCode;
+
         @JsonProperty(value = "vehicleClassNewName")
         @JSONField(name = "vehicleClassNewName")
         private String vehicleClassNewName;
+
         @JsonProperty(value = "fullweight")
         @JSONField(name = "fullweight")
         private String fullweight;
+
         @JsonProperty(value = "absFlag")
         @JSONField(name = "absFlag")
         private String absFlag;
+
         @JsonProperty(value = "vehicleSize")
         @JSONField(name = "vehicleSize")
         private String vehicleSize;
+
         @JsonProperty(value = "transmissionttype")
         @JSONField(name = "transmissionttype")
         private String transmissionttype;
+
         @JsonProperty(value = "modelCodeBC")
         @JSONField(name = "modelCodeBC")
         private String modelCodeBC;
+
         @JsonProperty(value = "kindred_PRICE_TAX")
         @JSONField(name = "kindred_PRICE_TAX")
         private String kindredPriceTax;

+ 6 - 11
src/main/java/com/ydtech/modules/order/controller/GuoRenOrderApiController.java

@@ -4,23 +4,19 @@ package com.ydtech.modules.order.controller;
 import com.ydtech.aop.request.RequestSingleParam;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.ins.model.guoren.CarModelResp;
-import com.ydtech.modules.ins.model.guoren.NonAutoInsResp;
 import com.ydtech.modules.ins.model.vo.CarInfoVo;
 import com.ydtech.modules.order.entity.api.guoren.constants.GoodsClassifyList;
-import com.ydtech.modules.order.entity.vo.AccidentalDrivingQueryVo;
-import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
 import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
+import com.ydtech.modules.order.entity.vo.guoren.GuorenAccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.guoren.NonAutoInsuranceList;
+import com.ydtech.modules.order.entity.vo.guoren.NonAutoInsuranceQueryVo;
 import com.ydtech.modules.order.service.GuorenOrderApiService;
 import com.ydtech.utils.StringUtils;
 import io.swagger.annotations.*;
-import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-import javax.validation.Valid;
-import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -62,7 +58,7 @@ public class GuoRenOrderApiController {
     })
     @ApiOperation(value = "报价")
     @PostMapping("/quote")
-    public HttpResult quoteApi(@RequestBody BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
+    public HttpResult quoteApi(@RequestBody BaseQuoteVo<GuorenAccidentalDrivingVo> quoteVo) {
         return guorenOrderApiService.quoteApi(quoteVo);
     }
 
@@ -104,12 +100,11 @@ public class GuoRenOrderApiController {
 
     @ApiOperation(value = "获取非车险列表")
     @PostMapping("/syncNonAutoIns")
-    public HttpResult<Object> syncNonAutoIns(@RequestSingleParam(value = "goodsCode") String goodsCode) {
-        if (StringUtils.isEmpty(goodsCode)) {
+    public HttpResult<Object> syncNonAutoIns(@RequestBody NonAutoInsuranceQueryVo nonAutoInsuranceQueryVo) {
+        if (StringUtils.isEmpty(nonAutoInsuranceQueryVo.getGoodsCode())) {
             return HttpResult.ok(GoodsClassifyList.buildGoodsClassifyDto());
         }
-        List<NonAutoInsuranceList> nonAutoInsuranceLists = guorenOrderApiService.gainNonAutoInsList(goodsCode);
-
+        List<NonAutoInsuranceList> nonAutoInsuranceLists = guorenOrderApiService.gainNonAutoInsList(nonAutoInsuranceQueryVo);
         return HttpResult.ok(nonAutoInsuranceLists);
     }
 

+ 30 - 0
src/main/java/com/ydtech/modules/order/entity/api/guoren/request/ApplicationDetailsRequest.java

@@ -0,0 +1,30 @@
+package com.ydtech.modules.order.entity.api.guoren.request;
+
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description: 投保单状态查询请求参数
+ * @author: wenks
+ * @date: 2023/11/3 9:07
+ **/
+@Data
+@NoArgsConstructor
+public class ApplicationDetailsRequest {
+
+    @JsonProperty("proposalNos")
+    private List<String> proposalNos = new ArrayList<>();
+
+    public void addProposalNos(String proposalNo) {
+        if(StringUtils.isNotEmpty(proposalNo)){
+            this.proposalNos.add(proposalNo);
+        }
+    }
+
+}

+ 44 - 0
src/main/java/com/ydtech/modules/order/entity/api/guoren/request/NonAutoInsuranceRequest.java

@@ -0,0 +1,44 @@
+package com.ydtech.modules.order.entity.api.guoren.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.Instant;
+
+@NoArgsConstructor
+@Data
+public class NonAutoInsuranceRequest implements Serializable {
+
+    private static final long serialVersionUID = -6586947355654972187L;
+
+    @JsonProperty("data")
+    private DataDTO data;
+
+    @JsonProperty("requestTime")
+    private String requestTime;
+
+    @JsonProperty("systemCode")
+    private String systemCode;
+
+
+    public NonAutoInsuranceRequest(String goodsCode, String systemCode) {
+        this.data = new DataDTO(goodsCode);
+        this.requestTime = String.valueOf(Instant.now().getEpochSecond() * 1000);
+        this.systemCode = systemCode;
+    }
+
+    @AllArgsConstructor
+    @NoArgsConstructor
+    @Data
+    public static class DataDTO implements Serializable {
+
+        private static final long serialVersionUID = 7349667092628401850L;
+
+        @JsonProperty("goodsCode")
+        private String goodsCode;
+
+    }
+}

+ 35 - 0
src/main/java/com/ydtech/modules/order/entity/api/guoren/response/NonAutoInsOrderResponse.java

@@ -0,0 +1,35 @@
+package com.ydtech.modules.order.entity.api.guoren.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @description: 创建非车订单 返回参数
+ * @author: wenks
+ * @date: 2023/11/3 15:38
+ **/
+@Data
+@NoArgsConstructor
+public class NonAutoInsOrderResponse  implements Serializable {
+
+    private static final long serialVersionUID = 6655020060862442459L;
+
+    @JsonProperty("code")
+    private String code;
+
+    @JsonProperty("message")
+    private String message;
+
+    @JsonProperty("data")
+    private DataDTO data;
+
+    @NoArgsConstructor
+    @Data
+    public static class DataDTO {
+        @JsonProperty("orderCode")
+        private String orderCode;
+    }
+}

+ 32 - 0
src/main/java/com/ydtech/modules/order/entity/vo/guoren/GuorenAccidentalDrivingVo.java

@@ -0,0 +1,32 @@
+package com.ydtech.modules.order.entity.vo.guoren;
+
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "国任非车险参数")
+public class GuorenAccidentalDrivingVo {
+
+    @ApiModelProperty("商品号")
+    private String goodsCode;
+
+    @ApiModelProperty("份数")
+    private int quantity;
+
+    @ApiModelProperty("产品代码")
+    private String prodCode;
+
+    @ApiModelProperty("险种代码")
+    private String riskCode;
+
+    @ApiModelProperty("保额")
+    private Integer amount;
+
+    @ApiModelProperty("保费")
+    private Integer premium;
+
+}

+ 16 - 0
src/main/java/com/ydtech/modules/order/entity/vo/guoren/NonAutoInsuranceList.java

@@ -135,8 +135,24 @@ public class NonAutoInsuranceList{
     @JSONField(name = "technologyInd")
     private String technologyInd;
 
+    @ApiModelProperty("险种数据")
     @JsonProperty(value = "prodCvgLiabList")
     @JSONField(name = "prodCvgLiabList")
     private List<NonAutoInsResp.DataDTO.ProdListDTO.ProdRiskListDTO.ProdCvgLiabListDTO> prodCvgLiabList;
 
+    @ApiModelProperty("险种代码")
+    @JsonProperty(value = "riskCode")
+    @JSONField(name = "riskCode")
+    private String riskCode;
+
+    @ApiModelProperty("限购份数")
+    @JsonProperty(value = "policyNum")
+    @JSONField(name = "policyNum")
+    private String policyNum;
+
+    @ApiModelProperty("选购份数")
+    @JsonProperty(value = "appnum")
+    @JSONField(name = "appnum")
+    private String appnum;
+
 }

+ 24 - 0
src/main/java/com/ydtech/modules/order/entity/vo/guoren/NonAutoInsuranceQueryVo.java

@@ -0,0 +1,24 @@
+package com.ydtech.modules.order.entity.vo.guoren;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@AllArgsConstructor
+@ApiModel("非车险查询VO")
+public class NonAutoInsuranceQueryVo implements Serializable {
+
+    private static final long serialVersionUID = 8016628984516940499L;
+
+    @ApiModelProperty("商品代码")
+    private String goodsCode;
+
+    @ApiModelProperty("协议id")
+    private String agreementId;
+
+
+}

+ 5 - 0
src/main/java/com/ydtech/modules/order/entity/vo/zm/ZmQuoteSpiderVo.java

@@ -7,6 +7,9 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 
 
 @Data
@@ -15,7 +18,9 @@ import java.io.Serializable;
 public class ZmQuoteSpiderVo implements Serializable {
 
     private static final long serialVersionUID = 6607461674086135437L;
+
     private BaseQuoteInfoVo quoteInfoVo;
+
     private AccidentalDrivingVo accidentalDrivingVo;
 
     private String username;

+ 7 - 6
src/main/java/com/ydtech/modules/order/service/GuorenOrderApiService.java

@@ -2,13 +2,12 @@ package com.ydtech.modules.order.service;
 
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.ins.model.guoren.CarModelResp;
-import com.ydtech.modules.ins.model.guoren.NonAutoInsResp;
 import com.ydtech.modules.ins.model.vo.CarInfoVo;
-import com.ydtech.modules.order.entity.vo.AccidentalDrivingQueryVo;
-import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
 import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
+import com.ydtech.modules.order.entity.vo.guoren.GuorenAccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.guoren.NonAutoInsuranceList;
+import com.ydtech.modules.order.entity.vo.guoren.NonAutoInsuranceQueryVo;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
@@ -31,7 +30,7 @@ public interface GuorenOrderApiService {
     /**
      * 2 报价
      */
-    HttpResult quoteApi(BaseQuoteVo<AccidentalDrivingVo> quoteVo);
+    HttpResult quoteApi(BaseQuoteVo<GuorenAccidentalDrivingVo> quoteVo);
 
 
     /**
@@ -55,9 +54,11 @@ public interface GuorenOrderApiService {
     HttpResult pay(String orderno);
 
     /**
-     * 非车列表
+     * 获取非车列表
+     * @param nonAutoInsuranceQueryVo
+     * @return
      */
-    List<NonAutoInsuranceList> gainNonAutoInsList(String goodsCode);
+    List<NonAutoInsuranceList> gainNonAutoInsList(NonAutoInsuranceQueryVo nonAutoInsuranceQueryVo);
 
     /**
      * 第三方回调通知(支付+承保)

+ 57 - 84
src/main/java/com/ydtech/modules/order/service/impl/GuorenOrderApiServiceImpl.java

@@ -4,26 +4,20 @@ import cn.hutool.core.collection.CollUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.config.properties.GuorenApiConfigurationProperties;
 import com.ydtech.constants.enums.InsurKind;
 import com.ydtech.constants.enums.InsurKindGuoRen;
 import com.ydtech.constants.enums.InsuranceRisk;
-import com.ydtech.constants.enums.dict.AttachInsureEnum;
 import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
-import com.ydtech.constants.enums.dict.WhetherEnum;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
-import com.ydtech.modules.esm.dao.EsmInsAttachInsureDetailsMapper;
-import com.ydtech.modules.esm.dao.EsmInsAttachInsureMapper;
-import com.ydtech.modules.esm.model.EsmInsAttachInsure;
-import com.ydtech.modules.esm.model.EsmInsAttachInsureDetails;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
 import com.ydtech.modules.ins.model.guoren.*;
 import com.ydtech.modules.ins.model.vo.*;
 import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
+import com.ydtech.modules.ins.model.yc.accident.Accident;
 import com.ydtech.modules.order.components.ConfigureParametersComponents;
 import com.ydtech.modules.order.components.InsOrdersComponents;
 import com.ydtech.modules.order.components.gouren.GuorenRequestApiComponent;
@@ -31,11 +25,19 @@ import com.ydtech.modules.order.dao.InsTaskImagesMapper;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.api.guoren.constants.PlatformInterfaceCode;
+import com.ydtech.modules.order.entity.api.guoren.request.ApplicationDetailsRequest;
+import com.ydtech.modules.order.entity.api.guoren.request.NonAutoInsuranceRequest;
 import com.ydtech.modules.order.entity.api.guoren.request.SignatureRequest;
+import com.ydtech.modules.order.entity.api.guoren.response.NonAutoInsOrderResponse;
 import com.ydtech.modules.order.entity.api.guoren.response.SignatureResponse;
 import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
-import com.ydtech.modules.order.entity.vo.*;
+import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
+import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
+import com.ydtech.modules.order.entity.vo.guoren.GuorenAccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.guoren.NonAutoInsuranceList;
+import com.ydtech.modules.order.entity.vo.guoren.NonAutoInsuranceQueryVo;
 import com.ydtech.modules.order.service.GuorenOrderApiService;
 import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.order.service.InsOrdersService;
@@ -58,10 +60,8 @@ import javax.servlet.http.HttpServletRequest;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.math.BigDecimal;
-import java.time.Instant;
 import java.time.LocalDateTime;
 import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 
 
@@ -87,10 +87,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
     private final InsOrdersService insOrdersService;
 
-    private final EsmInsAttachInsureMapper esmInsAttachInsureMapper;
-
-    private final EsmInsAttachInsureDetailsMapper esmInsAttachInsureDetailsMapper;
-
     private final EsmInsCompanyService esmInsCompanyService;
 
     private final ConfigureParametersComponents configureParametersComponents;
@@ -100,23 +96,19 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
     private final GuorenRequestApiComponent guorenRequestApiComponent;
 
 
-    public GuorenOrderApiServiceImpl(EsmInsAttachInsureMapper esmInsAttachInsureMapper,
-                                     GuorenApiConfigurationProperties properties,
+    public GuorenOrderApiServiceImpl(GuorenApiConfigurationProperties properties,
                                      InsOrdersComponents insOrdersComponents,
                                      GuorenRequestApiComponent guorenRequestApiComponent,
                                      InsAreaCompanyService insAreaCompanyService,
                                      InsOrdersService insOrdersService,
-                                     EsmInsAttachInsureDetailsMapper esmInsAttachInsureDetailsMapper,
                                      EsmInsCompanyService esmInsCompanyService,
                                      ConfigureParametersComponents configureParametersComponents,
                                      InsTaskImagesMapper insTaskImagesMapper) {
-        this.esmInsAttachInsureMapper = esmInsAttachInsureMapper;
         this.properties = properties;
         this.insOrdersComponents = insOrdersComponents;
         this.guorenRequestApiComponent = guorenRequestApiComponent;
         this.insAreaCompanyService = insAreaCompanyService;
         this.insOrdersService = insOrdersService;
-        this.esmInsAttachInsureDetailsMapper = esmInsAttachInsureDetailsMapper;
         this.esmInsCompanyService = esmInsCompanyService;
         this.configureParametersComponents = configureParametersComponents;
         this.insTaskImagesMapper = insTaskImagesMapper;
@@ -151,7 +143,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      * 2 报价-
      */
     @Override
-    public HttpResult quoteApi(BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
+    public HttpResult quoteApi(BaseQuoteVo<GuorenAccidentalDrivingVo> quoteVo) {
         log.debug("--------报价开始,订单号:{},协议号:{}--------------", quoteVo.getOrderNo(), quoteVo.getAgreementId());
         // 获取协议配置信息
         ChannelInfoDto channelInfo = gainChannelConfigInfo(quoteVo.getAgreementId());
@@ -167,26 +159,26 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         vinQueryReq.setEngineNo(carInfo.getEngineNo());
 
         VinQueryResp.DataDTO vinQ = vinQuery(vinQueryReq, channelInfo);
-        if (null == vinQ) return HttpResult.error("未找到匹配的车辆信息");
+        AssertionUtils.isEmpty(vinQ, "未找到匹配的车辆信息");
 
         //  2、车价查询
         CarPriceResp.DataDTO carPriceResult = carPriceQuery(yaQuoteInfoVo, vinQ, channelInfo);
-        if (null == carPriceResult) return HttpResult.error("车价获取失败");
+        AssertionUtils.isEmpty(carPriceResult, "车价获取失败");
 
         // 3、保费计算
         PremiumResp.DataDTO premiumResult = premiumQuery(yaQuoteInfoVo, carPriceResult, vinQ);
-        if (null == premiumResult) return HttpResult.error("保费计算失败");
+        AssertionUtils.isEmpty(premiumResult, "保费计算失败");
 
-//        // 4、 创建非车订单
-//        AccidentalDrivingVo accidentalDrivingVo = quoteVo.getAccidentalDrivingVo();
-//        if (!ObjectUtils.isEmpty(accidentalDrivingVo)) {
-//            nonAutoInsOrder(yaQuoteInfoVo, quoteVo.getAccidentalDrivingVo(), carPriceResult.getInputvo(), channelInfo);
-//        }
+        // 4、 创建非车订单
+        GuorenAccidentalDrivingVo accidentalDrivingVo = quoteVo.getAccidentalDrivingVo();
+        if (!ObjectUtils.isEmpty(accidentalDrivingVo)) {
+            NonAutoInsOrderResponse nonAutoInsOrderResponse = nonAutoInsOrder(yaQuoteInfoVo, accidentalDrivingVo, carPriceResult.getInputvo(), channelInfo, vinQ);
+            AssertionUtils.isEmpty(nonAutoInsOrderResponse.getData(), nonAutoInsOrderResponse.getMessage());
+        }
 
         QuoteRespVo quoteRespVo = buildQuoteRespVo(order, premiumResult, yaQuoteInfoVo);
         // 5、 生成订单
         InsAreaCompany iac = responseOrder(order, quoteRespVo, quoteVo);
-
         // 6、 投保单保存
         InsuranceSlipResp insuranceSlip = insuranceSlip(yaQuoteInfoVo, carPriceResult.getInputvo());
         if (insuranceSlip.getResultCode() == 1) {
@@ -194,7 +186,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         }
         iac.setJqapplyno(insuranceSlip.getData().getProposalNoDetailVo().getProposalNoCI());
         iac.setSyapplyno(insuranceSlip.getData().getProposalNoDetailVo().getProposalNoBI());
-
         //生成订单扩展
         responseOrderExtend(iac, quoteRespVo, premiumResult, carPriceResult.getInputvo());
         insAreaCompanyService.save(iac);
@@ -521,7 +512,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
         } else if (flag.equals("3")) {
             fileName += "-商业险电子保单.pdf";
-
         }
         String dir = "carInsPolicy/" + licensePlate + "/";
         return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
@@ -574,7 +564,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      * @author: lig
      * @date: 2023-10-18
      */
-    private InsAreaCompany responseOrder(InsOrders insOrder, QuoteRespVo quoteRespVo, BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
+    private InsAreaCompany responseOrder(InsOrders insOrder, QuoteRespVo quoteRespVo, BaseQuoteVo<GuorenAccidentalDrivingVo> quoteVo) {
         EsmInsCompany eic = esmInsCompanyService.getById(quoteVo.getCompanyId());
         //保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany();
@@ -670,8 +660,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
         rd.getItemVOList().forEach(a -> {
             //交强:0507,商业:0518
-            if (a.getRiskCode().equals("0507")) {
-            }
             if (a.getRiskCode().equals("0518")) {
                 kindRespVoList.add(buildQuoteKindList(a));
 
@@ -896,7 +884,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         PremiumReq req = PremiumReq.buildQuoteParam(yaQuoteInfoVo, carPriceResult, vinQ);
         PremiumResp resp;
         StringBuffer flag = new StringBuffer();
-        for (;;) {
+        for (; ; ) {
             resp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00004, PremiumResp.class);
             req.getCi().getPrpTmain().setAnswer(null);
             req.getBi().getPrpTmain().setAnswer(null);
@@ -964,54 +952,40 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      * @date: 2023-09-26
      */
     public InsOrderStatusResp insOrderStatus(InsAreaCompany iac) {
-        List<String> proposalNos = new ArrayList<>();
-        String jqNo = iac.getJqapplyno();
-        String syNo = iac.getSyapplyno();
-        if (StringUtils.isNotEmpty(jqNo)) {
-            proposalNos.add(jqNo);
-        }
-        if (StringUtils.isNotEmpty(syNo)) {
-            proposalNos.add(syNo);
-        }
-        Map<String, List<String>> paramMap = new HashMap<>();
-        paramMap.put("proposalNos", proposalNos);
+        ApplicationDetailsRequest applicationDetailsRequest = new ApplicationDetailsRequest();
+        // 交强投保单号
+        applicationDetailsRequest.addProposalNos(iac.getJqapplyno());
+        // 商业投保单号
+        applicationDetailsRequest.addProposalNos(iac.getSyapplyno());
         //投保单状态查询
-        return guorenRequestApiComponent.request(paramMap, PlatformInterfaceCode.API_IIRBT00010, InsOrderStatusResp.class);
+        return guorenRequestApiComponent.request(applicationDetailsRequest, PlatformInterfaceCode.API_IIRBT00010, InsOrderStatusResp.class);
     }
 
-
-    /**
-     * 非车列表
-     *
-     * @author: lig
-     * @date: 2023年09月18日 0018
-     */
     @Override
-    public List<NonAutoInsuranceList> gainNonAutoInsList(String goodsCode) {
-        Map<String, Object> bodyMap = new HashMap<>();
-        Map<String, Object> bodyParamsMap = new HashMap<>();
-        bodyParamsMap.put("goodsCode", goodsCode);
-        bodyMap.put("data", bodyParamsMap);
-        bodyMap.put("systemCode", "TQDL");
-        bodyMap.put("requestTime", Instant.now().getEpochSecond() * 1000);
-        NonAutoInsResp resp = guorenRequestApiComponent.request(bodyMap, PlatformInterfaceCode.API_IIIRBT00053, NonAutoInsResp.class);
-
-        if (null != resp.getData()) {
-            NonAutoInsResp.DataDTO data = resp.getData();
-            List<NonAutoInsResp.DataDTO.ProdListDTO> prodList = data.getProdList();
-            List<NonAutoInsuranceList> nonAutoInsuranceLists = new ArrayList<>();
-
-            for (NonAutoInsResp.DataDTO.ProdListDTO prodListDTO : prodList) {
-                NonAutoInsuranceList nonAutoInsuranceList = new NonAutoInsuranceList();
-                BeanUtils.copyProperties(prodListDTO, nonAutoInsuranceList);
-                List<NonAutoInsResp.DataDTO.ProdListDTO.ProdRiskListDTO.ProdCvgLiabListDTO> prodCvgLiabList
-                        = prodListDTO.getProdRiskList().get(0).getProdCvgLiabList();
-                nonAutoInsuranceList.setProdCvgLiabList(prodCvgLiabList);
-                nonAutoInsuranceLists.add(nonAutoInsuranceList);
-            }
-            return nonAutoInsuranceLists;
+    public List<NonAutoInsuranceList> gainNonAutoInsList(NonAutoInsuranceQueryVo nonAutoInsuranceQueryVo) {
+        // 1 构造非车请求
+        NonAutoInsuranceRequest nonAutoInsuranceRequest = new NonAutoInsuranceRequest(nonAutoInsuranceQueryVo.getGoodsCode(), properties.getChannelCode());
+        NonAutoInsResp resp = guorenRequestApiComponent.request(nonAutoInsuranceRequest, PlatformInterfaceCode.API_IIIRBT00053, NonAutoInsResp.class);
+        // 2 构造返回参数
+        NonAutoInsResp.DataDTO data = resp.getData();
+        // 2.1 无法获取数据
+        AssertionUtils.isEmpty(data, resp.getMessage());
+        // 3. 获取险种数据
+        List<NonAutoInsResp.DataDTO.ProdListDTO> prodList = data.getProdList();
+        List<NonAutoInsuranceList> nonAutoInsuranceLists = new ArrayList<>();
+        for (NonAutoInsResp.DataDTO.ProdListDTO prodListDTO : prodList) {
+            NonAutoInsuranceList nonAutoInsuranceList = new NonAutoInsuranceList();
+            BeanUtils.copyProperties(prodListDTO, nonAutoInsuranceList);
+            NonAutoInsResp.DataDTO.ProdListDTO.ProdRiskListDTO prodRiskListDTO = prodListDTO.getProdRiskList().get(0);
+            String riskCode = prodRiskListDTO.getRiskCode();
+            List<NonAutoInsResp.DataDTO.ProdListDTO.ProdRiskListDTO.ProdCvgLiabListDTO> prodCvgLiabList
+                    = prodRiskListDTO.getProdCvgLiabList();
+            nonAutoInsuranceList.setProdCvgLiabList(prodCvgLiabList);
+            nonAutoInsuranceList.setRiskCode(riskCode);
+            nonAutoInsuranceLists.add(nonAutoInsuranceList);
         }
-        return null;
+        return nonAutoInsuranceLists;
+
     }
 
 
@@ -1021,11 +995,10 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      * @author: lig
      * @date: 2023-09-28
      */
-    public SubmitAuditResp nonAutoInsOrder(BaseQuoteInfoVo yaQuoteInfoVo, AccidentalDrivingVo accidentalDrivingVo, String carPriceUuid, ChannelInfoDto channelInfo) {
-        VinQueryResp.DataDTO vinQ = new VinQueryResp.DataDTO();
+    public NonAutoInsOrderResponse nonAutoInsOrder(BaseQuoteInfoVo yaQuoteInfoVo, GuorenAccidentalDrivingVo accidentalDrivingVo, String carPriceUuid, ChannelInfoDto channelInfo, VinQueryResp.DataDTO vinQ) {
         //构造请求参数
-        NonAutoInsOrderReq req = NonAutoInsOrderReq.buildParam(yaQuoteInfoVo, vinQ, accidentalDrivingVo, channelInfo, carPriceUuid);
-        return guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIIRBT00054, SubmitAuditResp.class);
+        NonAutoInsOrderReq nonAutoInsOrderReq = new NonAutoInsOrderReq(yaQuoteInfoVo, vinQ, accidentalDrivingVo, channelInfo, carPriceUuid, properties.getChannelCode());
+        return guorenRequestApiComponent.request(nonAutoInsOrderReq, PlatformInterfaceCode.API_IIIRBT00054, NonAutoInsOrderResponse.class);
     }
 
 
@@ -1046,8 +1019,8 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
             LocalDateTime start = DateTimeUtil.parseLocalDateTime(coverageEndDate, DateTimeUtil.DATETIME_PATTERN_EXT1);
 
-            String newStartDate = "";
-            String newEndDate = "";
+            String newStartDate;
+            String newEndDate;
 
             //及时起保
             if (start.getHour() > 0) {

+ 14 - 15
src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java

@@ -901,7 +901,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
      * 驾意外险 查询
      */
     @Override
-    public HttpResult accidentQuery(AccidentalDrivingQueryVo accidentalDrivingVo){
+    public HttpResult accidentQuery(AccidentalDrivingQueryVo accidentalDrivingVo) {
         //初始化redisKey
         StringBuilder redisKey = new StringBuilder();
         redisKey.append(YC_AGREEMENT_KEY);
@@ -909,22 +909,21 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
         redisKey.append(accidentalDrivingVo.getSeatNum());
 
         //查询redis
-        if(!Objects.isNull(redisTemplate.opsForValue().get(redisKey.toString()))){
+        if (!Objects.isNull(redisTemplate.opsForValue().get(redisKey.toString()))) {
             String redisValue = String.valueOf(redisTemplate.opsForValue().get(redisKey.toString()));
-            if(StringUtils.isNotEmpty(redisValue)){
-                List<EsmInsAttachInsure> esmInsAttachInsureList = JSON.parseArray(redisValue,EsmInsAttachInsure.class);
+            if (StringUtils.isNotEmpty(redisValue)) {
+                List<EsmInsAttachInsure> esmInsAttachInsureList = JSON.parseArray(redisValue, EsmInsAttachInsure.class);
                 return HttpResult.ok(esmInsAttachInsureList);
             }
         }
 
 
-
         //查询接口
         List<EsmInsAttachInsure> insAttachInsureList = new ArrayList<>();
         AccidentResponse ar = gainAccidentInsure(accidentalDrivingVo, null);
-        if(ar.getHead().getResponseCompleteMessageStatus().getMessageStatusCode().equals("E0000")){
+        if (ar.getHead().getResponseCompleteMessageStatus().getMessageStatusCode().equals("E0000")) {
             List<ResponseYwCvrg.CvrgList> cList = ar.getResponseYwCvrg().getCvrgList();
-            cList.forEach(item->{
+            cList.forEach(item -> {
                 EsmInsAttachInsure ati = new EsmInsAttachInsure();
                 ati.setCode(item.getCInsuranceTypeCode());
                 ati.setName(item.getCInsuranceType());
@@ -938,8 +937,8 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
         }
 
         //将insAttachInsureList存入redis
-        if(!insAttachInsureList.isEmpty()){
-            redisTemplate.opsForValue().set(redisKey.toString(),JSON.toJSONString(insAttachInsureList),YC_ACCIDENTAL_DRIVING_TIME, TimeUnit.DAYS);
+        if (!insAttachInsureList.isEmpty()) {
+            redisTemplate.opsForValue().set(redisKey.toString(), JSON.toJSONString(insAttachInsureList), YC_ACCIDENTAL_DRIVING_TIME, TimeUnit.DAYS);
         }
 
         return HttpResult.ok(insAttachInsureList);
@@ -949,7 +948,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
      * 驾意外险详情 查询
      */
     @Override
-    public HttpResult accidentSchemeList(AccidentalDrivingQueryVo accidentalDrivingVo){
+    public HttpResult accidentSchemeList(AccidentalDrivingQueryVo accidentalDrivingVo) {
         //初始化redisKey
         StringBuilder redisKey = new StringBuilder();
         redisKey.append(YC_AGREEMENT_INFO_KEY);
@@ -958,10 +957,10 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
         redisKey.append(accidentalDrivingVo.getCompanyCode());
 
         //查询redis
-        if(!Objects.isNull(redisTemplate.opsForValue().get(redisKey.toString()))){
+        if (!Objects.isNull(redisTemplate.opsForValue().get(redisKey.toString()))) {
             String redisValue = String.valueOf(redisTemplate.opsForValue().get(redisKey.toString()));
-            if(StringUtils.isNotEmpty(redisValue)){
-                List<EsmInsAttachInsureDetails> esmInsAttachInsureDetails = JSON.parseArray(redisValue,EsmInsAttachInsureDetails.class);
+            if (StringUtils.isNotEmpty(redisValue)) {
+                List<EsmInsAttachInsureDetails> esmInsAttachInsureDetails = JSON.parseArray(redisValue, EsmInsAttachInsureDetails.class);
                 return HttpResult.ok(esmInsAttachInsureDetails);
             }
         }
@@ -983,8 +982,8 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
         }
 
         //将esmInsAttachInsureDetails存入redis
-        if(!esmInsAttachInsureDetails.isEmpty()){
-            redisTemplate.opsForValue().set(redisKey.toString(),JSON.toJSONString(esmInsAttachInsureDetails),YC_ACCIDENTAL_DRIVING_TIME, TimeUnit.DAYS);
+        if (!esmInsAttachInsureDetails.isEmpty()) {
+            redisTemplate.opsForValue().set(redisKey.toString(), JSON.toJSONString(esmInsAttachInsureDetails), YC_ACCIDENTAL_DRIVING_TIME, TimeUnit.DAYS);
         }
         return HttpResult.ok(esmInsAttachInsureDetails);
     }

+ 54 - 50
src/main/java/com/ydtech/modules/order/service/impl/ZhongMeiOrderApiServiceImpl.java

@@ -54,7 +54,8 @@ import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
-import static com.ydtech.modules.order.constants.OrderCacheConstant.*;
+import static com.ydtech.modules.order.constants.OrderCacheConstant.BRAND_MODEL_KEY;
+import static com.ydtech.modules.order.constants.OrderCacheConstant.VIN_SEARCH_KEY_TIME;
 
 @Service
 @Slf4j
@@ -99,8 +100,8 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
     public ZhongMeiOrderApiServiceImpl(InsOrdersService insOrdersService, InsAreaCompanyService insAreaCompanyService, InsTaskImagesService insTaskImagesService,
                                        ZhongmeiRequestApiComponents zhongmeiRequestApiComponents, ZhongmeiRequestComponents zhongmeiRequestComponents,
                                        ConfigureParametersComponents configureParametersComponents, PtlAgreementAttributionService ptlAgreementAttributionService,
-                                       FeeRuleSchemeService feeRuleSchemeService, InsFeeOrderService insFeeOrderService,ZhongmeiRepeatInsuranceComponents zhongmeiRepeatInsuranceComponents,
-                                       PtlAgreementNonCarProductCostsService ptlAgreementNonCarProductCostsService,PtlNonCarProductSchemeService ptlNonCarProductSchemeService,StringRedisTemplate redisTemplate) {
+                                       FeeRuleSchemeService feeRuleSchemeService, InsFeeOrderService insFeeOrderService, ZhongmeiRepeatInsuranceComponents zhongmeiRepeatInsuranceComponents,
+                                       PtlAgreementNonCarProductCostsService ptlAgreementNonCarProductCostsService, PtlNonCarProductSchemeService ptlNonCarProductSchemeService, StringRedisTemplate redisTemplate) {
         this.insOrdersService = insOrdersService;
         this.insAreaCompanyService = insAreaCompanyService;
         this.insTaskImagesService = insTaskImagesService;
@@ -111,8 +112,8 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         this.feeRuleSchemeService = feeRuleSchemeService;
         this.insFeeOrderService = insFeeOrderService;
         this.zhongmeiRepeatInsuranceComponents = zhongmeiRepeatInsuranceComponents;
-        this.ptlAgreementNonCarProductCostsService=ptlAgreementNonCarProductCostsService;
-        this.ptlNonCarProductSchemeService=ptlNonCarProductSchemeService;
+        this.ptlAgreementNonCarProductCostsService = ptlAgreementNonCarProductCostsService;
+        this.ptlNonCarProductSchemeService = ptlNonCarProductSchemeService;
         this.redisTemplate = redisTemplate;
     }
 
@@ -143,7 +144,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         redisKey.append(BRAND_MODEL_KEY);
         redisKey.append(modelName);
         //从缓存中查数据
-        if(!Objects.isNull(redisTemplate.opsForValue().get(modelName.toString()))){
+        if (!Objects.isNull(redisTemplate.opsForValue().get(modelName.toString()))) {
             String carModeStr = redisTemplate.opsForValue().get(modelName.toString());
             List<CarModelDTO> carModelDTOS = JSON.parseArray(carModeStr, CarModelDTO.class);
             return HttpResult.ok(carModelDTOS);
@@ -156,8 +157,8 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
 
         List<CarModelDTO> map = SimpleStadarCarDTOConvert.INSTANCE.map(car);
         //数据存储到缓存中
-        if(map.size() > 0){
-            redisTemplate.opsForValue().set(modelName.toString(),JSON.toJSONString(map),VIN_SEARCH_KEY_TIME, TimeUnit.HOURS);
+        if (map.size() > 0) {
+            redisTemplate.opsForValue().set(modelName.toString(), JSON.toJSONString(map), VIN_SEARCH_KEY_TIME, TimeUnit.HOURS);
         }
         return HttpResult.ok(map);
     }
@@ -189,7 +190,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
                 new CarModelsFilterUtils<ModelsQueryResponse.SimpleStadarCarDTO>().to(simpleStadarCarDTOS, carInfo);
 
         //座位数根据前端传入的赋值
-        if(StringUtils.isNotEmpty(carInfo.getSeatCount())){
+        if (StringUtils.isNotEmpty(carInfo.getSeatCount())) {
             int seatCount = Integer.parseInt(carInfo.getSeatCount());
             simpleStadarCarDTO.setApprovedPassengersCapacity(seatCount);
         }
@@ -200,23 +201,23 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         QuotedPriceResponse quotedPriceResponse = zhongmeiRequestApiComponents.quotedPrice(quotedPriceRequest, QuotedPriceResponse.class);
         if ("-1".equals(quotedPriceResponse.getHead().getReturnCode())) {
             if (StringUtils.isNotEmpty(quotedPriceResponse.getHead().getReturnMessage()) && quotedPriceResponse.getHead().getReturnMessage().contains("商业险重复投保") && quotedPriceResponse.getHead().getReturnMessage().contains("重复投保的本公司的保单信息")) {
-                quotedPriceResponse = zhongmeiRepeatInsuranceComponents.dealRepeatDateFormError(quotedPriceRequest,quotedPriceResponse,quoteInfo);
+                quotedPriceResponse = zhongmeiRepeatInsuranceComponents.dealRepeatDateFormError(quotedPriceRequest, quotedPriceResponse, quoteInfo);
             }
         }
         QuoteRespVo quoteRespVo = getQuoteRespVo(quotedPriceResponse, quoteInfo);
         boolean repeatFlag = false;
-        if(quotedPriceResponse.getBizPlatformMsg()!=null && StringUtils.isNotEmpty(quotedPriceResponse.getBizPlatformMsg().getAnswer())&& quotedPriceResponse.getBizPlatformMsg().getAnswer().contains("起保日期")&&quotedPriceResponse.getBizPlatformMsg().getAnswer().contains("终保日期")){
+        if (quotedPriceResponse.getBizPlatformMsg() != null && StringUtils.isNotEmpty(quotedPriceResponse.getBizPlatformMsg().getAnswer()) && quotedPriceResponse.getBizPlatformMsg().getAnswer().contains("起保日期") && quotedPriceResponse.getBizPlatformMsg().getAnswer().contains("终保日期")) {
             repeatFlag = true;
         }
-        if(quotedPriceResponse.getForcePlatformMsg()!=null && StringUtils.isNotEmpty(quotedPriceResponse.getForcePlatformMsg().getAnswer())&& quotedPriceResponse.getForcePlatformMsg().getAnswer().contains("起保日期")&&quotedPriceResponse.getForcePlatformMsg().getAnswer().contains("终保日期")){
+        if (quotedPriceResponse.getForcePlatformMsg() != null && StringUtils.isNotEmpty(quotedPriceResponse.getForcePlatformMsg().getAnswer()) && quotedPriceResponse.getForcePlatformMsg().getAnswer().contains("起保日期") && quotedPriceResponse.getForcePlatformMsg().getAnswer().contains("终保日期")) {
             repeatFlag = true;
         }
-        if(repeatFlag){
-            quotedPriceResponse = zhongmeiRepeatInsuranceComponents.dealRepeatDate(quotedPriceRequest,quotedPriceResponse,quoteInfo);
+        if (repeatFlag) {
+            quotedPriceResponse = zhongmeiRepeatInsuranceComponents.dealRepeatDate(quotedPriceRequest, quotedPriceResponse, quoteInfo);
             quoteRespVo = getQuoteRespVo(quotedPriceResponse, quoteInfo);
         }
         //这里调用费用匹配功能
-        feeRuleSchemeService.dealFeeOrderInfo(quoteInfo,quoteRespVo,ptlAgreementAttribution.getId(),quotedPriceResponse.getBusinessNo());
+        feeRuleSchemeService.dealFeeOrderInfo(quoteInfo, quoteRespVo, ptlAgreementAttribution.getId(), quotedPriceResponse.getBusinessNo());
         return responseOrder(quotedPriceResponse, quoteRespVo, ptlAgreementAttribution);
     }
 
@@ -304,7 +305,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
                 insAreaCompany.setPaymentLink(approvedRequest.getPayUrl());
                 insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
             } else {
-                if(StringUtils.isNotEmpty(approvedRequest.getHandleText())){
+                if (StringUtils.isNotEmpty(approvedRequest.getHandleText())) {
                     insAreaCompany.setAuditopinion(approvedRequest.getHandleText());
                 }
                 insAreaCompany.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
@@ -375,27 +376,27 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         request.setDocumentType(code);
         request.setHead(new BaseRequestHead(zmConfigureParameters));
         InsurancePolicyPrintResponse response = zhongmeiRequestApiComponents.insurancePolicyPrint(request, InsurancePolicyPrintResponse.class);
-        if("1".equals(response.getStatusCode())){
+        if ("1".equals(response.getStatusCode())) {
             List<String> urlList = response.getDownloadUrl();
 
-            if(urlList!=null && !urlList.isEmpty()){
-               String url = urlList.get(0);
-               String templateName = "";
-               if("DZ_AJ".equals(code)){
-                   templateName = "-交强险标志.pdf";
-               }else if("DZ_AE".equals(code)){
-                   if("0330".equals(request.getRiskCode())){
-                       templateName = "-交强险保单.pdf";
-                   }else {
-                       templateName = "-商业险保单.pdf";
-                   }
-               }
+            if (urlList != null && !urlList.isEmpty()) {
+                String url = urlList.get(0);
+                String templateName = "";
+                if ("DZ_AJ".equals(code)) {
+                    templateName = "-交强险标志.pdf";
+                } else if ("DZ_AE".equals(code)) {
+                    if ("0330".equals(request.getRiskCode())) {
+                        templateName = "-交强险保单.pdf";
+                    } else {
+                        templateName = "-商业险保单.pdf";
+                    }
+                }
                 String transferUrl = gainCarInsPolicy(url, licensePlate + templateName, licensePlate);
                 List<String> transferUrlList = new ArrayList<>();
                 transferUrlList.add(transferUrl);
                 response.setDownloadUrl(transferUrlList);
             }
-        }else{
+        } else {
             return HttpResult.error("中煤电子保单生成失败,请重试或联系中煤!");
         }
         return HttpResult.ok("下载成功", response.getDownloadUrl());
@@ -405,6 +406,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         String dir = "carInsPolicy/" + licensePlate + "/";
         return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
     }
+
     /**
      * @param orderNo               中煤订单号
      * @param frameNo               车架号
@@ -445,7 +447,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         // 报价险种放入保费
         List<QuoteRiskRespVo> riskList1 = QuoteRiskRespVo.toQuoteRiskRespVoList(riskList, jqPremium, syPremium);
 
-        for(QuoteRiskRespVo quoteRiskRespVo:riskList1){
+        for (QuoteRiskRespVo quoteRiskRespVo : riskList1) {
             if (InsuranceRisk.TRAFFIC.getCode().equals(quoteRiskRespVo.getRiskCode())) {
                 quoteRespVo.setStartDateJq(quoteRiskRespVo.getStartDate());
                 quoteRespVo.setEndDateJq(quoteRiskRespVo.getEndDate());
@@ -547,14 +549,15 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
             insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());//当核保状态返回核保通过时,调整保单状态为已核保待缴费
             insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
             return HttpResult.ok(underWriteInd);
-        }else if("核保不通过".equals(underWriteInd)){//当状态为核保不通过时,调整保单状态为报价中
+        } else if ("核保不通过".equals(underWriteInd)) {//当状态为核保不通过时,调整保单状态为报价中
             insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
             insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
-            return HttpResult.error("核保不通过:"+submitStatusQueryResponse.getIssuedReason());
-        }else {
+            return HttpResult.error("核保不通过:" + submitStatusQueryResponse.getIssuedReason());
+        } else {
             return HttpResult.ok(underWriteInd);
         }
     }
+
     @Override
     public HttpResult<Object> rideAccidentQuery(AccidentalDrivingQueryVo accidentalDrivingVo) {
         // 1. 协议id获取配置实体
@@ -572,28 +575,29 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
 
     /**
      * 根据协议代码获取可选非车险产品方案信息
+     *
      * @param reqVo
      * @return
      */
-    public HttpResult<List<GeneralNonCarProductResVo>> getDrivingInsurance(GeneralNonCarProductReqVo reqVo){
-        List<GeneralNonCarProductResVo> resultList=new ArrayList<>();
-        if(StringUtils.isNotEmpty(reqVo.getAgreementId())&&StringUtils.isNotEmpty(reqVo.getSeatNum())){
-            List<PtlAgreementNonCarProductCosts> productList= ptlAgreementNonCarProductCostsService.getByAgreementId(reqVo.getAgreementId());
-            if(productList!=null&&productList.size()>0){
-                for(PtlAgreementNonCarProductCosts tempProductDto:productList){
-                    GeneralNonCarProductResVo tempGeneralNonCarProductVo=new GeneralNonCarProductResVo();
+    public HttpResult<List<GeneralNonCarProductResVo>> getDrivingInsurance(GeneralNonCarProductReqVo reqVo) {
+        List<GeneralNonCarProductResVo> resultList = new ArrayList<>();
+        if (StringUtils.isNotEmpty(reqVo.getAgreementId()) && StringUtils.isNotEmpty(reqVo.getSeatNum())) {
+            List<PtlAgreementNonCarProductCosts> productList = ptlAgreementNonCarProductCostsService.getByAgreementId(reqVo.getAgreementId());
+            if (productList != null && productList.size() > 0) {
+                for (PtlAgreementNonCarProductCosts tempProductDto : productList) {
+                    GeneralNonCarProductResVo tempGeneralNonCarProductVo = new GeneralNonCarProductResVo();
                     tempGeneralNonCarProductVo.setProductCode(tempProductDto.getProductId());
                     tempGeneralNonCarProductVo.setProductName(tempProductDto.getProductName());
-                    List<PtlNonCarProductSchemeVo> schemeList=ptlNonCarProductSchemeService.findAllProductSchemeInfo(tempProductDto.getProductId());
+                    List<PtlNonCarProductSchemeVo> schemeList = ptlNonCarProductSchemeService.findAllProductSchemeInfo(tempProductDto.getProductId());
                     //处理保额信息
-                    for(PtlNonCarProductSchemeVo schemeVo:schemeList){
-                        double sumAmount=0.0;
-                        List<PtlNonCarProductSchemeDetailVo> specialInfoList=schemeVo.getSpecialInfo();
-                        for(PtlNonCarProductSchemeDetailVo detailVo:specialInfoList){
-                            if("1".equals(detailVo.getCountType())){
-                                sumAmount=sumAmount+Double.parseDouble(detailVo.getUnitAmount());
-                            }else if("2".equals(detailVo.getCountType())){
-                                sumAmount=sumAmount+(Double.parseDouble(detailVo.getUnitAmount())*Double.parseDouble(reqVo.getSeatNum()));
+                    for (PtlNonCarProductSchemeVo schemeVo : schemeList) {
+                        double sumAmount = 0.0;
+                        List<PtlNonCarProductSchemeDetailVo> specialInfoList = schemeVo.getSpecialInfo();
+                        for (PtlNonCarProductSchemeDetailVo detailVo : specialInfoList) {
+                            if ("1".equals(detailVo.getCountType())) {
+                                sumAmount = sumAmount + Double.parseDouble(detailVo.getUnitAmount());
+                            } else if ("2".equals(detailVo.getCountType())) {
+                                sumAmount = sumAmount + (Double.parseDouble(detailVo.getUnitAmount()) * Double.parseDouble(reqVo.getSeatNum()));
                             }
                         }
                         schemeVo.setUnitAmount(String.valueOf(sumAmount));