liub hace 2 meses
padre
commit
36b75ed95b

+ 16 - 19
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/api/entity/Request/PremiumRequest.java

@@ -6,15 +6,11 @@ import com.alibaba.fastjson.annotation.JSONField;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.jzg.commons.constants.InsuranceRisk;
-import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
-import com.jzg.commons.entity.quote.vo.KindInfoVo;
-import com.jzg.commons.entity.quote.vo.RiskInfoVo;
-import com.jzg.commons.entity.quote.vo.VehicleAndVesselTaxVo;
-import com.jzg.commons.util.AssertionUtils;
-import com.jzg.commons.util.StringUtils;
 import com.jzg.commons.constants.quote.enums.quote.EnergyTypeCode;
 import com.jzg.commons.constants.quote.enums.quote.KindCode;
-import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.commons.entity.quote.vo.*;
+import com.jzg.commons.util.AssertionUtils;
+import com.jzg.commons.util.StringUtils;
 import com.jzg.quotation.commons.utils.DateTimeUtil;
 import com.jzg.quotation.guoren.api.constant.enums.BaseTaxation;
 import com.jzg.quotation.guoren.api.constant.enums.ClauseTypeSystem;
@@ -335,10 +331,7 @@ public class PremiumRequest {
             //乘客数
             BigDecimal passengerNum = BigDecimal.valueOf(StringUtils.toInt(vinQ.getSeatCountBC()) - 1);
 
-            boolean isEnergy = false;
-            if (EnergyTypeCode.getNewEnergy().contains(vinQ.getFuelType())) {
-                isEnergy = true;
-            }
+            boolean isEnergy = EnergyTypeCode.getNewEnergy().contains(vinQ.getFuelType());
 
             //起保时间
             prptitemkind.setStartDate(biRiskInfo.getStartDate());
@@ -682,12 +675,14 @@ public class PremiumRequest {
             String newEndDate;
             //及时起保
             if (start.getHour() > 0) {
-                LocalDateTime end = start.plusYears(1L);
-                newStartDate = DateTimeUtil.format(start, DateTimeUtil.DATETIME_PATTERN);
+                // 即时起保:起保时间改为下一日零时
+                LocalDateTime adjustedStart = start.plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
+                LocalDateTime end = adjustedStart.plusYears(1L);
+                newStartDate = DateTimeUtil.format(adjustedStart, DateTimeUtil.DATETIME_PATTERN);
                 newEndDate = DateTimeUtil.format(end, DateTimeUtil.DATETIME_PATTERN);
 
-                this.getPrpTmain().setStartHour(StringUtils.toString(start.getHour()));
-                this.getPrpTmain().setEndHour(StringUtils.toString(start.getHour()));
+                this.getPrpTmain().setStartHour("0");
+                this.getPrpTmain().setEndHour("0");
                 this.getPrpTmain().setImmeValidStartDate(newStartDate);
                 this.getPrpTmain().setImmeValidEndDate(newEndDate);
                 this.getPrpTmain().setImmeValiFlag("1");
@@ -1092,11 +1087,13 @@ public class PremiumRequest {
             String newEndDate;
             //及时起保
             if (start.getHour() > 0) {
-                LocalDateTime end = start.plusYears(1L);
-                newStartDate = DateTimeUtil.format(start, DateTimeUtil.DATETIME_PATTERN);
+                // 即时起保:起保时间改为下一日零时
+                LocalDateTime adjustedStart = start.plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
+                LocalDateTime end = adjustedStart.plusYears(1L);
+                newStartDate = DateTimeUtil.format(adjustedStart, DateTimeUtil.DATETIME_PATTERN);
                 newEndDate = DateTimeUtil.format(end, DateTimeUtil.DATETIME_PATTERN);
-                this.getPrpTmain().setStartHour(StringUtils.toString(start.getHour()));
-                this.getPrpTmain().setEndHour(StringUtils.toString(start.getHour()));
+                this.getPrpTmain().setStartHour("0");
+                this.getPrpTmain().setEndHour("0");
                 this.getPrpTmain().setImmeValidStartDate(newStartDate);
                 this.getPrpTmain().setImmeValidEndDate(newEndDate);
                 this.getPrpTmain().setImmeValiFlag("1");