Ver Fonte

国任车船税问题

wks há 2 anos atrás
pai
commit
c715d6d870

+ 111 - 12
src/main/java/com/ydtech/modules/ins/model/guoren/PremiumReq.java

@@ -11,9 +11,10 @@ import com.ydtech.constants.enums.InsuranceRisk;
 import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
 import com.ydtech.modules.ins.model.vo.KindInfoVo;
 import com.ydtech.modules.ins.model.vo.RiskInfoVo;
-import com.ydtech.modules.order.entity.api.guoren.constants.ClauseTypeSystem;
-import com.ydtech.modules.order.entity.api.guoren.constants.FuelType;
+import com.ydtech.modules.order.entity.api.guoren.constants.*;
+import com.ydtech.modules.order.entity.api.zijin.request.CalculatePremiumRequest;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.VehicleAndVesselTax;
 import com.ydtech.modules.order.entity.vo.guoren.GuoRenSpecialAgreementVo;
 import com.ydtech.utils.DateTimeUtil;
 import com.ydtech.utils.StringUtils;
@@ -72,12 +73,13 @@ public class PremiumReq {
         List<KindInfoVo> kindInfoVList = yaQuoteInfoVo.getKindList();
 
         PremiumReq quoteReq = new PremiumReq();
+        VehicleAndVesselTax vehicleAndVesselTax = yaQuoteInfoVo.getVehicleAndVesselTax();
 
         riskList.forEach(a -> {
             if (a.getRiskCode().equals(InsuranceRisk.TRAFFIC_CODE)) {
                 List<GuoRenSpecialAgreementVo> trafficSpecialAgreement =
                         specialAgreementVo.stream().filter(x -> InsuranceRisk.TRAFFIC_CODE.equals(x.getRiskCode())).collect(Collectors.toList());
-                CiDTO ciDto = buildCiDto(ownerInfo, a, isNoCar, trafficSpecialAgreement);
+                CiDTO ciDto = buildCiDto(vehicleAndVesselTax, ownerInfo, a, isNoCar, trafficSpecialAgreement);
                 ciDto.setTrafficTime(a.getStartDate());
                 quoteReq.setCi(ciDto);
             } else if (a.getRiskCode().equals(InsuranceRisk.BUSINESS_CODE)) {
@@ -91,7 +93,7 @@ public class PremiumReq {
 
         //未投保交强
         if (null == quoteReq.getCi()) {
-            CiDTO ciDto = buildCiDto(ownerInfo, null, false, new ArrayList<>());
+            CiDTO ciDto = buildCiDto(null, ownerInfo, null, false, new ArrayList<>());
             quoteReq.setCi(ciDto);
         }
         //未投保商业
@@ -116,7 +118,8 @@ public class PremiumReq {
      * @date: 2023-08-15
      */
     @JsonIgnore
-    public static CiDTO buildCiDto(CustomerInfoVo ownerInfo, RiskInfoVo ciRiskInfo, boolean isNoCar,
+    public static CiDTO buildCiDto(VehicleAndVesselTax vehicleAndVesselTax, CustomerInfoVo ownerInfo, RiskInfoVo ciRiskInfo,
+                                   boolean isNoCar,
                                    List<GuoRenSpecialAgreementVo> specialAgreementVo) {
         CiDTO ciDto = new CiDTO();
         ciDto.setPrpTrenewal(new ArrayList<>());
@@ -139,7 +142,6 @@ public class PremiumReq {
          * 车船税
          */
         CiDTO.PrpTcarshipTaxDTO prpTcarshipTax = new CiDTO.PrpTcarshipTaxDTO();
-        prpTcarshipTax.setPaidCertificate("");
         //交强起保
         if (null != ciRiskInfo) {
             ciDto.setCalculateFlagCI("1");
@@ -154,7 +156,7 @@ public class PremiumReq {
                 //车+非车标识    车加非车必传:N
                 ciPrpTmain.setOrderFlag("N");
             }
-
+            prpTcarshipTax = new CiDTO.PrpTcarshipTaxDTO(vehicleAndVesselTax);
             /**
              * 平台交互信息
              */
@@ -227,9 +229,9 @@ public class PremiumReq {
          */
         BiDTO.PrpTitemCarDTO biPrpTitemCar = new BiDTO.PrpTitemCarDTO();
 
-        if(FuelType.getEnergy().contains(vinQ.getFuelType())){
+        if (FuelType.getEnergy().contains(vinQ.getFuelType())) {
             biPrpTitemCar.setTermsSystem(ClauseTypeSystem.CTS_05.getCode());
-        }else {
+        } else {
             biPrpTitemCar.setTermsSystem(ClauseTypeSystem.CTS_04.getCode());
         }
 
@@ -784,13 +786,110 @@ public class PremiumReq {
         @Data
         public static class PrpTcarshipTaxDTO {
 
+            /**
+             * 见纳税类型码表
+             */
             @JsonProperty(value = "taxRelifFlag")
             @JSONField(name = "taxRelifFlag")
             private String taxRelifFlag;
 
-            @JsonProperty(value = "paidCertificate")
-            @JSONField(name = "paidCertificate")
-            private String paidCertificate;
+            /**
+             * 见减免税原因码表
+             */
+            @JsonProperty(value = "taxRelifFlag")
+            @JSONField(name = "taxRelifFlag")
+            private String relifReason;
+            /**
+             * 减免税计算方式
+             * 1减免金额
+             * 2 减免比例
+             * 3免税(纳税类型为免税时默认为3)
+             * 纳税类型为减免税的必录
+             */
+            @JsonProperty(value = "baseTaxation")
+            @JSONField(name = "baseTaxation")
+            private String baseTaxation;
+            /**
+             * 减免金额
+             * 减免类型为减免金额的时候必录
+             */
+            @JsonProperty(value = "taxRelief")
+            @JSONField(name = "taxRelief")
+            private String taxRelief;
+
+            /**
+             * 减免比例
+             * 减免类型为减免比例的时候必录(单位%)
+             */
+            @JsonProperty(value = "freeRate")
+            @JSONField(name = "freeRate")
+            private String freeRate;
+
+            /**
+             * 完/减免税凭证号
+             * 当纳税类型为减税、免税、已完税时必传
+             */
+            @JsonProperty(value = "paidFreeCertificate")
+            @JSONField(name = "paidFreeCertificate")
+            private String paidFreeCertificate;
+
+            /**
+             * 开具税务机关
+             * 当纳税类型为减税、免税、已完税时必传
+             */
+            @JsonProperty(value = "taxComName")
+            @JSONField(name = "taxComName")
+            private String taxComName;
+
+            /**
+             * 税务机关代码
+             * 当纳税类型为已完税时必传
+             */
+            @JsonProperty(value = "taxComCode")
+            @JSONField(name = "taxComCode")
+            private String taxComCode;
+
+            /**
+             * 开具完税凭证地区代码
+             * 当纳税类型为已完税时必传
+             */
+            @JsonProperty(value = "taxPaidAreaCode")
+            @JSONField(name = "taxPaidAreaCode")
+            private String taxPaidAreaCode;
+
+            /**
+             * 完税凭证填发日期
+             * 当纳税类型为已完税时必传
+             */
+            @JsonProperty(value = "taxDocumentDate")
+            @JSONField(name = "taxDocumentDate")
+            private String taxDocumentDate;
+
+            public PrpTcarshipTaxDTO(VehicleAndVesselTax vehicleAndVesselTax) {
+                TaxRelifFlag flag = Enum.valueOf(TaxRelifFlag.class, TaxRelifFlag.TITLE + vehicleAndVesselTax.getTaxRelifFlag());
+                this.taxRelifFlag = flag.getCode();
+
+                RelifReason reason = Enum.valueOf(RelifReason.class, RelifReason.TITLE + vehicleAndVesselTax.getRelifReason());
+                this.relifReason = reason.getCode();
+
+                switch (this.relifReason) {
+                    case "3":
+                        this.baseTaxation = BaseTaxation.BR_2.getCode();
+                        this.freeRate = vehicleAndVesselTax.getTaxRelief();
+                        break;
+                    case "2":
+                        this.baseTaxation = BaseTaxation.BR_3.getCode();
+                        break;
+                    default:
+                        break;
+                }
+
+                this.paidFreeCertificate = vehicleAndVesselTax.getPaidFreeCertificate();
+                this.taxComName = vehicleAndVesselTax.getTaxComName();
+                this.taxComCode = vehicleAndVesselTax.getTaxComCode();
+                this.taxPaidAreaCode = vehicleAndVesselTax.getTaxPaidAreaCode();
+                this.taxDocumentDate = vehicleAndVesselTax.getTaxDocumentDate();
+            }
         }
 
         @NoArgsConstructor

+ 25 - 0
src/main/java/com/ydtech/modules/order/entity/api/guoren/constants/BaseTaxation.java

@@ -0,0 +1,25 @@
+package com.ydtech.modules.order.entity.api.guoren.constants;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @version
+ * @description: 国任财险 减免税计算方式
+ * @author: wenks
+ * @date: 2024/2/6 10:23
+ **/
+@Getter
+@AllArgsConstructor
+public enum BaseTaxation {
+
+    BR_1("1", "减免金额"),
+    BR_2("2", "减免比例"),
+    BR_3("3", "免税");
+
+    private final String code;
+
+    private final String desc;
+
+}

+ 33 - 0
src/main/java/com/ydtech/modules/order/entity/api/guoren/constants/RelifReason.java

@@ -0,0 +1,33 @@
+package com.ydtech.modules.order.entity.api.guoren.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+
+
+
+/**
+ * @version
+ * @description: 国任财险 纳税类型
+ * @author: wenks
+ * @date: 2024/2/6 10:23
+ **/
+@Getter
+@AllArgsConstructor
+public enum RelifReason {
+
+    RR_01("1", "正常缴税"),
+    RR_02("2", "免税"),
+    RR_03("3", "减税"),
+    RR_04("4", "已完税"),
+    RR_6("6", "拒缴"),
+    RR_8("8", "不征");
+
+    private final String code;
+
+    private final String desc;
+
+
+    public static final String TITLE = "RR_";
+
+}

+ 31 - 0
src/main/java/com/ydtech/modules/order/entity/api/guoren/constants/TaxRelifFlag.java

@@ -0,0 +1,31 @@
+package com.ydtech.modules.order.entity.api.guoren.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+
+/**
+ * @description: 国任财险  减免原因
+ * @author: wenks
+ * @date: 2024/2/6 10:20
+ **/
+@Getter
+@AllArgsConstructor
+public enum TaxRelifFlag {
+
+    TRF_F("01", "拖拉机"),
+    TRF_A("02", "军队、武警专用车"),
+    TRF_P("03", "警车"),
+    TRF_C("04", "具备减免税证明"),
+    TRF_D("05", "外国使领馆、国际组织及其人员"),
+    TRF_O("06", "其他"),
+    TRF_E("07", "能源减免"),
+    TRF_09("09", "农村地区摩托车");
+
+    private final String code;
+
+    private final String desc;
+
+    public static final String TITLE = "TRF_";
+
+}