Qchen 1 год назад
Родитель
Сommit
4264309165

+ 1 - 1
src/main/java/com/ydtech/modules/ins/model/vo/QuoteRespVo.java

@@ -129,7 +129,7 @@ public class QuoteRespVo {
     private double syLossRation;
 
     @ApiModelProperty("阳光 交商含增值服务合并经营成本率")
-    private double margeCostRate;
+    private String mergeCostRate;
 
     @ApiModelProperty("核心返回车型")
     private CoreModelsVo coreModels;

+ 2 - 2
src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java

@@ -574,7 +574,7 @@ public class InsAreaCompany implements Serializable {
      * 交商含增值服务合并经营成本率 阳光使用
      */
     @TableField(value = "merge_cost_rate")
-    private Double mergeCostRate;
+    private String mergeCostRate;
 
     //入口总金额
     @TableField(exist = false)
@@ -628,7 +628,7 @@ public class InsAreaCompany implements Serializable {
         this.lossRation = quoteRespVo.getLossRation();
         this.jqLossRation = quoteRespVo.getJqLossRation();
         this.syLossRation = quoteRespVo.getSyLossRation();
-        this.mergeCostRate = quoteRespVo.getMargeCostRate();
+        this.mergeCostRate = quoteRespVo.getMergeCostRate();
         // 保单号
         this.jqapplyno = quoteRespVo.getJqApplyNo();
         this.syapplyno = quoteRespVo.getSyApplyNo();

+ 17 - 19
src/main/java/com/ydtech/modules/order/entity/api/yangguang/request/YangGuangAccuracyCalculateRequest.java

@@ -286,7 +286,7 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
         this.NonVehicleProductInformationList = quoteVo.getAccidentalDrivingVo().stream().map(NonVehicleProductInformationListDTO::new).collect(Collectors.toList());
         this.CasualtyFlag = "1";
     }
-    this.carshipyTaxInfo = new CarshipyTaxInfoDTO(quoteInfoVo.getVehicleAndVesselTax(),riskInfoVo);
+    this.carshipyTaxInfo = new CarshipyTaxInfoDTO(quoteInfoVo.getVehicleAndVesselTax(),riskInfoVo,quoteInfoVo.getOwnerInfo());
     }
 
     public static List<NonVehicleProductInformationListDTO> toCarPolicySubInfoListDTO(List<YgQuoteAccidentVo> ygQuoteAccidentVos) {
@@ -397,21 +397,17 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
             this.Name = policyHolderInfo.getName();
             this.Mobile = policyHolderInfo.getMobile();
             this.PostAddress = policyHolderInfo.getAddr();
-            int sex = IdcardUtil.getGenderByIdCard(policyHolderInfo.getIdentifyNumber());
-            this.Gender = sex == 1 ? "1" : "2";
-            this.IdentifyUseFullifeStart = policyHolderInfo.getIdentifyValidDate();
             this.IdentifyUseFullife = policyHolderInfo.getIdentifyValidEndDate();
             if (policyHolderInfo.getProperty() != null && policyHolderInfo.getProperty().equals("1")) {
                 this.InsuredType = "1";
                 this.IdentifyType = "01";
                 this.IdentifyNumber = policyHolderInfo.getIdentifyNumber();
-            } else if (policyHolderInfo.getProperty() != null && policyHolderInfo.getProperty().equals("2")) {
-                this.IdentifyType = "09";
-                this.InsuredType = "2";
-                this.IdentifyNumber = policyHolderInfo.getOrganizationCode();
-            } else if (policyHolderInfo.getProperty() != null && policyHolderInfo.getProperty().equals("3")) {
+                int sex = IdcardUtil.getGenderByIdCard(policyHolderInfo.getIdentifyNumber());
+                this.Gender = sex == 1 ? "1" : "2";
+                this.IdentifyUseFullifeStart = policyHolderInfo.getIdentifyValidDate();
+            } else if (policyHolderInfo.getProperty() != null && policyHolderInfo.getProperty().equals("0")) {
                 this.InsuredType = "2";
-                this.IdentifyType = "99";
+                this.IdentifyType = "09";
                 this.IdentifyNumber = policyHolderInfo.getOrganizationCode();
             }
         }
@@ -503,16 +499,11 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
                 this.IdentifyType = "01";
                 this.CarInsuredRelation = "1";
                 this.IdentifyNumber = customerInfoVo.getIdentifyNumber();
-            } else if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("2")) {
+            } else if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("0")) {
                 this.IdentifyType = "09";
                 this.InsuredType = "2";
                 this.CarInsuredRelation = "1";
                 this.IdentifyNumber = customerInfoVo.getOrganizationCode();
-            } else if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("3")) {
-                this.InsuredType = "1";
-                this.IdentifyType = "99";
-                this.CarInsuredRelation = "3";
-                this.IdentifyNumber = customerInfoVo.getOrganizationCode();
             }
         }
     }
@@ -1129,7 +1120,7 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
         //不征
         private static final String TAX_NOT_CHARGE = "9";
 
-        public CarshipyTaxInfoDTO(VehicleAndVesselTax vehicleAndVesselTax,RiskInfoVo riskInfoVo) {
+        public CarshipyTaxInfoDTO(VehicleAndVesselTax vehicleAndVesselTax,RiskInfoVo riskInfoVo,CustomerInfoVo customerInfoVo) {
             String flag = vehicleAndVesselTax.getTaxRelifFlag();
             switch (flag) {
                 case TAX_EXEMPTION:
@@ -1147,8 +1138,15 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
             }
             this.TaxRelifFlag = vehicleAndVesselTax.getTaxRelifFlag();
             this.TaxpayerName = vehicleAndVesselTax.getTaxpayerName();
-            this.IdentifyType = vehicleAndVesselTax.getTaxpayerIdentifier();
-            this.Taxpayeridentifier = vehicleAndVesselTax.getIdentifyNumber();
+            if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("1")) {
+                this.IdentifyType = "01";
+                this.Taxpayeridentifier = vehicleAndVesselTax.getIdentifyNumber();
+            }
+            if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("0")) {
+                this.IdentifyType = "09";
+                this.Taxpayeridentifier = customerInfoVo.getOrganizationCode();
+            }
+
             this.PaystartDate = riskInfoVo.getStartDate();
             this.PayendDate = riskInfoVo.getEndDate();
         }

+ 4 - 0
src/main/java/com/ydtech/modules/order/entity/api/yangguang/request/YangGuangSubmitRequest.java

@@ -243,12 +243,15 @@ public class YangGuangSubmitRequest extends YangGuangBaseRequest{
          public CustomerList(InsOrders insOrders,boolean flag) {
             String addrapply= insOrders.getApplyinfo().getString("addr");
             String addrinsurer = insOrders.getInsureinfo().getString("addr");
+            String codeapply = insOrders.getApplyinfo().getString("organizationCode");
+            String codeinsurer = insOrders.getInsureinfo().getString("organizationCode");
              if (flag) {
                     this.customerFlag = "1";
                     this.Taxpayertype = "2";
                     this.Vatinvoiceflag = "0";
                     this.Revenueaddress = addrapply;
                     this.InsuredFlag = "2";
+                    this.Taxpayernumber = codeapply;
              }
              if (!flag) {
                     this.customerFlag = "0";
@@ -256,6 +259,7 @@ public class YangGuangSubmitRequest extends YangGuangBaseRequest{
                     this.Vatinvoiceflag = "0";
                     this.Revenueaddress = addrinsurer;
                     this.InsuredFlag = "1";
+                    this.Taxpayernumber = codeinsurer;
              }
         }
         public static List<YangGuangSubmitRequest.CustomerList> toCustomerList(InsOrders insOrders) {

+ 17 - 17
src/main/java/com/ydtech/modules/order/entity/api/yangguang/response/YangGuangBaseResponse.java

@@ -20,21 +20,21 @@ public class YangGuangBaseResponse {
     @JsonProperty("ResponseDate")
     private String ResponseDate;
 
-    public String message(String ErrorMessage) {
-        try {
-            ObjectMapper objectMapper = new ObjectMapper();
-            JsonNode rootNode = objectMapper.readTree(ErrorMessage);
-            JsonNode hintNode = rootNode.get("hint");
-            if (hintNode != null) {
-                JsonNode systemMsgNode = hintNode.get("systemMsg");
-                if (systemMsgNode.isArray() && systemMsgNode.size() > 0) {
-                    JsonNode firstSystemMsg = systemMsgNode.get(0);
-                    return firstSystemMsg.get("info").asText();
-                }
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
+//    public String message(String ErrorMessage) {
+//        try {
+//            ObjectMapper objectMapper = new ObjectMapper();
+//            JsonNode rootNode = objectMapper.readTree(ErrorMessage);
+//            JsonNode hintNode = rootNode.get("hint");
+//            if (hintNode != null) {
+//                JsonNode systemMsgNode = hintNode.get("systemMsg");
+//                if (systemMsgNode.isArray() && systemMsgNode.size() > 0) {
+//                    JsonNode firstSystemMsg = systemMsgNode.get(0);
+//                    return firstSystemMsg.get("info").asText();
+//                }
+//            }
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        return null;
+//    }
 }

+ 4 - 0
src/main/java/com/ydtech/modules/order/entity/vo/InsOrdersEditingVo.java

@@ -224,6 +224,9 @@ public class InsOrdersEditingVo extends InsOrders implements Serializable {
         @TableField(value = "紫金能源车(鼎然-车辆风险评分)")
         private String ubiPredictedInfoScore;
 
+        @ApiModelProperty("交商合并经营成本率")
+        private String mergeCostRate;
+
         @ApiModelProperty("交强出口费用")
         private BigDecimal jqExportFee;
 
@@ -314,6 +317,7 @@ public class InsOrdersEditingVo extends InsOrders implements Serializable {
             this.jqLossRation = insAreaCompany.getJqLossRation();
             this.syLossRation = insAreaCompany.getSyLossRation();
             this.ubiPredictedInfoScore = insAreaCompany.getUbiPredictedInfoScore();
+            this.mergeCostRate = insAreaCompany.getMergeCostRate();
             this.feeMatchErrMsg = insAreaCompany.getFeeMatchErrMsg();
             this.quoteErrMsg = insAreaCompany.getQuoteErrMsg();
             this.orderStatusInfo = InsOrderStatusEnum.matchKey(insAreaCompany.getOrderstatus()).getDesc();

+ 3 - 0
src/main/java/com/ydtech/modules/order/entity/vo/OrderVo.java

@@ -393,6 +393,9 @@ public class OrderVo implements Serializable {
     @TableField(value = "ubi_predicted_info_score")
     private String ubiPredictedInfoScore;
 
+    @TableField(value = "merge_cost_rate")
+    private String mergeCostRate;
+
 
     /**
      * 推荐人工号

+ 4 - 2
src/main/java/com/ydtech/modules/order/service/impl/YangGuangOrderApiServiceImpl.java

@@ -129,6 +129,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
         // 如果险种为单商或交商 需要报两次价 将第一次报出的车实际价值取到
         //报价
         InsOrders insOrders = insOrdersService.getById(quoteInfoVo.getOrderNo());
+        quoteInfoVo.setProductId(insOrders.getProductid());
 
         YangGuangAccuracyCalculateRequest yangGuangAccuracyCalculateRequest = new YangGuangAccuracyCalculateRequest(quoteInfoVo, purchasePrice, carModelList1, riskList.get(0),startDate,ygConfigureParameters,quoteVo);
         yangGuangAccuracyCalculateRequest.setInfotransNo(yangGuangQueryVehicleModelResponse.getInfotransNo());
@@ -309,7 +310,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
         YangGuangSubmitRequest yangGuangSubmitRequest = new YangGuangSubmitRequest(insOrders, insAreaCompany, productid, ygConfigureParameters);
         YangGuangSubmitResponse yangGuangSubmitResponse = yangGuangRequestApiComponents.submit(yangGuangSubmitRequest);
         if (!yangGuangSubmitResponse.getErrorCode().equals("0")) {
-            return HttpResult.error(yangGuangSubmitResponse.message(yangGuangSubmitResponse.getErrorMessage()));
+            return HttpResult.error(yangGuangSubmitResponse.getErrorMessage());
         }
         if (yangGuangSubmitResponse.getCiProposalNo() != null) {
             insAreaCompany.setJqapplyno(yangGuangSubmitResponse.getCiProposalNo());
@@ -793,6 +794,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
         quoteRespVo.setCiSumPermium(CalculateUtils.add(jqPremium, sumPayTax));//交强险和车船税合计
         quoteRespVo.setSumPermium(CalculateUtils.add(jqPremium, syPremium, sumPayTax, jyPremium));//保费合计
         quoteRespVo.setTotalAdjustRate(0);
+        quoteRespVo.setMergeCostRate(yangGuangAccuracyCalculateResponse.getVascostmarginbc());
         quoteRespVo.setOrderno(yaQuoteInfoVo.getOrderNo()); //订单号
         return quoteRespVo;
     }
@@ -809,7 +811,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
         insAreaCompany.setReptxt(JSON.parseObject(JSON.toJSONString(yangGuangAccuracyCalculateResponse)));
         insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
         insAreaCompany.setInsOrderNo(yangGuangAccuracyCalculateResponse.getInfotransNo());
-        insAreaCompany.setMergeCostRate(Double.parseDouble(yangGuangAccuracyCalculateResponse.getVascostmarginbc()));
+        insAreaCompany.setMergeCostRate(quoteRespVo.getMergeCostRate());
         InsOrders insOrders = insOrdersService.getById(orderId);
         //车船税
         if (!insOrders.getProductid().equals("034001") && !insOrders.getProductid().equals("034002")) {

+ 2 - 0
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -129,6 +129,7 @@
         <result property="crossInsurance" column="cross_insurance" javaType="com.alibaba.fastjson.JSONArray"
                 typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
         <result property="ubiPredictedInfoScore" column="ubi_predicted_info_score" jdbcType="VARCHAR"/>
+        <result property="mergeCostRate" column="merge_cost_rate" jdbcType="VARCHAR"/>
         <result property="signingTime" column="signingTime" jdbcType="TIMESTAMP"/>
         <result property="payDate" column="payDate" jdbcType="TIMESTAMP"/>
         <result property="partnerCompaniesName" column="partnerCompaniesName" jdbcType="VARCHAR"/>
@@ -245,6 +246,7 @@
                iac.tax_arrears,
                iac.cross_insurance,
                iac.ubi_predicted_info_score,
+               iac.merge_cost_rate,
                iac.signing_time as signingTime,
                iac.pay_date  as payDate,
                iac.agreement_id,