|
|
@@ -21,7 +21,6 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
import java.time.LocalDate;
|
|
|
-import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
@@ -182,30 +181,18 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest {
|
|
|
private String remark;
|
|
|
|
|
|
public ContractMainDto(RiskInfoVo riskInfoVo, InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters) {
|
|
|
- if ("0507".equals(riskInfoVo.getRiskCode())) {
|
|
|
+ if (InsuranceRisk.TRAFFIC.getCode().equals(riskInfoVo.getRiskCode())) {
|
|
|
this.contractNo = insAreaCompany.getJqapplyno();
|
|
|
this.totalPremium = insAreaCompany.getJqpremium().doubleValue();
|
|
|
- } else {
|
|
|
+ this.validDate = insAreaCompany.getJqStartDate();
|
|
|
+ this.expiryDate = insAreaCompany.getJqEndDate();
|
|
|
+ } else if(InsuranceRisk.BUSINESS.getCode().equals(riskInfoVo.getRiskCode())) {
|
|
|
this.contractNo = insAreaCompany.getSyapplyno();
|
|
|
this.totalPremium = insAreaCompany.getSypremium().doubleValue();
|
|
|
+ this.validDate = insAreaCompany.getSyStartDate();
|
|
|
+ this.expiryDate = insAreaCompany.getSyEndDate();
|
|
|
}
|
|
|
this.riskCode = InsuranceTypeCorrespondence.getHuaTaiRisk().get(riskInfoVo.getRiskCode());
|
|
|
- String startDate = riskInfoVo.getStartDate();
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- LocalDate localDate = LocalDate.parse(startDate, formatter);
|
|
|
- LocalDate nextYears = localDate.plusYears(1);
|
|
|
- if (startDate.contains(TimeConstants.START_TIME)) {
|
|
|
- LocalDate expiry = nextYears.minusDays(1);
|
|
|
- this.validDate = riskInfoVo.getStartDate();
|
|
|
- this.expiryDate = expiry + " " + TimeConstants.END_TIME;
|
|
|
- } else {
|
|
|
- // 及时
|
|
|
- LocalDateTime localDateTime = LocalDateTime.parse(startDate, formatter);
|
|
|
- LocalDateTime expiryDateTime = localDateTime.plusYears(1);
|
|
|
- this.validDate = startDate;
|
|
|
- this.expiryDate = expiryDateTime.format(formatter);
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|