|
|
@@ -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
|