فهرست منبع

永诚重复投保修改

wks 2 سال پیش
والد
کامیت
ef6fc7dfdf

+ 5 - 4
src/main/java/com/ydtech/modules/order/controller/ZijinOrderApiController.java

@@ -1,6 +1,8 @@
 package com.ydtech.modules.order.controller;
 
 
+import cn.hutool.http.server.HttpServerRequest;
+import cn.hutool.http.server.HttpServerResponse;
 import com.ydtech.aop.request.RequestSingleParam;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
@@ -19,11 +21,10 @@ import com.ydtech.modules.order.entity.vo.zj.ZjVehicleProductsQueryVo;
 import com.ydtech.modules.order.service.ZijinOrderApiService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.util.List;
 
 @Api(tags = "紫金财险 Api")

+ 10 - 9
src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java

@@ -372,9 +372,11 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
             log.info("永诚API方式 - xml请求 ------------报价 ->   交强重复投保----------------");
 
             //截取0 到 机动车交通事故强制险
-            String ciMsg = errorMsg;
-            //终保日期
-            String coverageEndDate = ciMsg.substring(ciMsg.indexOf("终保日期") + 5, ciMsg.indexOf("终保日期") + 5 + 16);
+            if(!errorMsg.contains("终保日期")){
+                throw new SystemException(errorMsg);
+            }
+            String coverageEndDate = errorMsg.substring(errorMsg.indexOf("终保日期") + 5, errorMsg.indexOf("终保日期") + 5 + 16);
+
             LocalDateTime start = DateTimeUtil.parseLocalDateTime(coverageEndDate, DateTimeUtil.DATETIME_PATTERN_EXT1);
             LocalDateTime end = start.plusYears(1L).minusDays(1L);
             String newStartDate = DateTimeUtil.getStartTimeOfDayStr(start, DateTimeUtil.DATETIME_PATTERN);
@@ -409,10 +411,11 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
             requestInfoList.add(errorMsg);
             log.info("永诚API方式 - xml请求 ------------报价 ->   商业险重复投保----------------");
 
-            //截取0 到 机动车交通事故强制险
-            String ciMsg = errorMsg;
-            //终保日期
-            String coverageEndDate = ciMsg.substring(ciMsg.indexOf("保险止期") + 6, ciMsg.indexOf("保险止期") + 6 + 19);
+            //保险止期
+            if(!errorMsg.contains("保险止期")){
+                throw new SystemException(errorMsg);
+            }
+            String coverageEndDate = errorMsg.substring(errorMsg.indexOf("保险止期") + 6, errorMsg.indexOf("保险止期") + 6 + 19);
             LocalDateTime start;
 
             if(coverageEndDate.contains("23:59:59")){
@@ -422,7 +425,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
             }
 
             LocalDateTime end = start.plusYears(1L).minusDays(1L);
-
             String newStartDate = DateTimeUtil.getStartTimeOfDayStr(start, DateTimeUtil.DATETIME_PATTERN);
             String newEndDate = DateTimeUtil.getEndTimeOfDayStr(end, DateTimeUtil.DATETIME_PATTERN);
             System.err.println("商业新起:" + newStartDate);
@@ -430,7 +432,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
 
             m.getRequestLabel().getCondition().getBase().setTInsrncBgnTmSY(newStartDate);
             m.getRequestLabel().getCondition().getBase().setTInsrncEndTmSY(newEndDate);
-
             //转保信息清空  重新报价
             m.getRequestLabel().getCondition().getVhl().setCBusType("0");