|
|
@@ -54,6 +54,8 @@ import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.OffsetDateTime;
|
|
|
@@ -262,13 +264,24 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
if (startDate.endsWith("00:00:00")) {
|
|
|
endDate = TimeProcessing.minusOneSecondAfterYear(startDate);
|
|
|
} else {
|
|
|
- endDate = TimeProcessing.minusOneDayAfterYear(startDate);
|
|
|
+ endDate = TimeProcessing.plusOneYearToString(startDate);
|
|
|
}
|
|
|
- final String formatStartDate = XmlDateTimeFormatter.format(startDate);
|
|
|
- final String formatEndDate = XmlDateTimeFormatter.format(endDate);
|
|
|
+ final String formatStartDate = startDate;
|
|
|
+ final String formatEndDate = endDate;
|
|
|
quoteInfoVo.getRiskList().forEach(riskInfoVo -> {
|
|
|
- riskInfoVo.setStartDate(formatStartDate);
|
|
|
- riskInfoVo.setEndDate(formatEndDate);
|
|
|
+ String start,end = "";
|
|
|
+ // 处理商业险的即时起保
|
|
|
+ if(riskInfoVo.getRiskCode().equals("0510")){
|
|
|
+ if(!formatStartDate.endsWith("00:00:00")){
|
|
|
+ start = TimeProcessing.tomorrowDateTime(formatStartDate);
|
|
|
+ end = TimeProcessing.tomorrowDateTime(formatEndDate);
|
|
|
+ riskInfoVo.setStartDate(start);
|
|
|
+ riskInfoVo.setEndDate(end);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ riskInfoVo.setStartDate(formatStartDate);
|
|
|
+ riskInfoVo.setEndDate(formatEndDate);
|
|
|
+ }
|
|
|
});
|
|
|
premiumCalculationRequest = new PremiumCalculationRequest(quoteInfoVo,carActualValue,parameters,vehicle,quoteVo,quoteInfoVo.getRiskList(),null);
|
|
|
premiumCalculationResponse = chengTaiRequestApiComponent.premiumCalculation(premiumCalculationRequest);
|
|
|
@@ -931,6 +944,8 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
|
|
|
@Override
|
|
|
public HttpResult<Object> policyStatus(String companyId) throws Exception {
|
|
|
+
|
|
|
+ StringBuilder errorMessage = new StringBuilder();
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
|
|
|
|
// 1 通过 协议id获取配置实体
|
|
|
@@ -992,13 +1007,18 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
return HttpResult.ok("状态更新成功");
|
|
|
}
|
|
|
- } else {
|
|
|
+
|
|
|
+ if (ebCallbackData.getUnderWriteInd().equals("2") || ebCallbackData.getUnderWriteInd().equals("4")){
|
|
|
+ errorMessage.append(ebCallbackData.getOperateText());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!errorMessage.toString().equals("")){
|
|
|
insSubOrderUpdateDetailService.insertData(insAreaCompany, insAreaCompany.getOrderstatus(), InsOrderStatusEnum.TO_BACK.getCode(), "1");
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
|
|
|
- insAreaCompanyService.updateCompanyAndOrdersMessage(insAreaCompany, policyStatusResponse.getResponseHead().getErrorMessage());
|
|
|
- return HttpResult.error(policyStatusResponse.getResponseHead().getErrorMessage());
|
|
|
+ insAreaCompanyService.updateCompanyAndOrdersMessage(insAreaCompany, errorMessage.toString());
|
|
|
+ return HttpResult.error(errorMessage.toString());
|
|
|
}
|
|
|
- return null;
|
|
|
+ return HttpResult.error(errorMessage.toString());
|
|
|
}
|
|
|
|
|
|
|