|
@@ -2,6 +2,7 @@ package com.ydtech.modules.order.entity.api.zj.response;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
import com.ydtech.modules.ins.model.vo.AccidentResponseVo;
|
|
import com.ydtech.modules.ins.model.vo.AccidentResponseVo;
|
|
|
|
|
+import com.ydtech.modules.order.entity.api.zm.constants.TimeConstants;
|
|
|
import com.ydtech.modules.order.entity.vo.zj.ZjQuoteAccidentVo;
|
|
import com.ydtech.modules.order.entity.vo.zj.ZjQuoteAccidentVo;
|
|
|
import com.ydtech.utils.StringUtils;
|
|
import com.ydtech.utils.StringUtils;
|
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
@@ -10,6 +11,8 @@ import lombok.NoArgsConstructor;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
import java.io.Serializable;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -271,32 +274,43 @@ public class CalculatePremiumResponse extends BaseResponse implements Serializab
|
|
|
|
|
|
|
|
public static final String DATE_FORMAT = "%s %s:%s:%s";
|
|
public static final String DATE_FORMAT = "%s %s:%s:%s";
|
|
|
|
|
|
|
|
- public String getJqStartTime() {
|
|
|
|
|
- if (StringUtils.isEmpty(this.getStartDateCI())) {
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取上一秒时间
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return 上一秒时间
|
|
|
|
|
+ */
|
|
|
|
|
+ private String getInTheLastSecond(String dateTime) {
|
|
|
|
|
+ if (dateTime.contains(TimeConstants.START_TIME)) {
|
|
|
|
|
+ return dateTime;
|
|
|
}
|
|
}
|
|
|
- return String.format(DATE_FORMAT, this.getStartDateCI(), this.getStartHourCI(), this.getStartMinuteCI(), "00");
|
|
|
|
|
|
|
+ LocalDateTime parse = LocalDateTime.parse(dateTime, DATE_TIME_FORMATTER);
|
|
|
|
|
+ LocalDateTime localDateTime = parse.plusSeconds(-1);
|
|
|
|
|
+ return localDateTime.format(DATE_TIME_FORMATTER);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public String getJqEndTime() {
|
|
|
|
|
- if (StringUtils.isEmpty(this.getEndDateCI())) {
|
|
|
|
|
|
|
+ private String nullData(String date, String dateTime) {
|
|
|
|
|
+ if (StringUtils.isEmpty(date)) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- return String.format(DATE_FORMAT, this.getEndDateCI(), this.getEndHourCI(), this.getEndMinuteCI(), "00");
|
|
|
|
|
|
|
+ return dateTime;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String getJqStartTime() {
|
|
|
|
|
+ return nullData(this.getStartDateCI(), String.format(DATE_FORMAT, this.getStartDateCI(), this.getStartHourCI(), this.getStartMinuteCI(), "00"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String getJqEndTime() {
|
|
|
|
|
+ return nullData(this.getEndDateCI(), getInTheLastSecond(String.format(DATE_FORMAT, this.getEndDateCI(), this.getEndHourCI(), this.getEndMinuteCI(), "00")));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public String getSyStartTime() {
|
|
public String getSyStartTime() {
|
|
|
- if (StringUtils.isEmpty(this.getStartDate())) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- return String.format(DATE_FORMAT, this.getStartDate(), this.getStartHour(), this.getStartMinute(), "00");
|
|
|
|
|
|
|
+ return nullData(this.getStartDate(), String.format(DATE_FORMAT, this.getStartDate(), this.getStartHour(), this.getStartMinute(), "00"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public String getSyEndTime() {
|
|
public String getSyEndTime() {
|
|
|
- if (StringUtils.isEmpty(this.getEndDate())) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- return String.format(DATE_FORMAT, this.getEndDate(), this.getEndHour(), this.getEndMinute(), "00");
|
|
|
|
|
|
|
+ return nullData(this.getEndDate(), getInTheLastSecond(String.format(DATE_FORMAT, this.getEndDate(), this.getEndHour(), this.getEndMinute(), "00")));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|