소스 검색

定时更新承保状态和支付时间,添加渤海财险、平安财险、永安财险的更新方式

hxl13994548489 2 년 전
부모
커밋
ecbe401feb

+ 12 - 1
src/main/java/com/ydtech/modules/order/service/BoHaiOrderApiService.java

@@ -13,7 +13,6 @@ import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
 import com.ydtech.modules.order.entity.vo.bohai.BoHaiQuoteAccidentVo;
 import com.ydtech.modules.order.entity.vo.bohai.ProductDetailsQueryVo;
 import com.ydtech.modules.order.entity.vo.bohai.ProductQueryVo;
-import com.ydtech.modules.order.entity.vo.zj.ZjQuoteAccidentVo;
 
 import java.util.List;
 
@@ -101,4 +100,16 @@ public interface BoHaiOrderApiService {
      */
     String policyResultCallback(PolicyResultCallbackRequest policyResultCallbackRequest)  throws Exception;
 
+
+     /**
+     * @Description 更新承保状态和支付时间
+     * @Author  hxl
+     * @Date   2024/4/2 11:31
+     * @Param
+     * @Return
+     * @Exception
+     *
+     */
+    public void getOrderDetailNew(String subOrderNo) throws Exception;
+
 }

+ 9 - 0
src/main/java/com/ydtech/modules/order/service/YongAnOrderService.java

@@ -17,4 +17,13 @@ public interface YongAnOrderService extends BaseOrderService<Object> {
 
     String updatePolicy(Map<String, String> paramMap);
 
+    /**
+     *  @version  更新更薄状态和支付时间
+     *  @author: hxl
+     *  @Date: 2024/4/2 12:49
+     *  @Description:
+     */
+    public void getOrderDetailNew(String subOrderNo);
+
+
 }

+ 27 - 0
src/main/java/com/ydtech/modules/order/service/impl/BoHaiOrderApiServiceImpl.java

@@ -506,6 +506,33 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
         quoteRespVo.setCompanyId(orderId);
         return HttpResult.ok("报价成功", quoteRespVo);
     }
+    /**
+    * @Description  更新承保状态和支付时间
+    * @Author  hxl
+    * @Date   2024/4/2 11:29
+    * @Param
+    * @Return
+    * @Exception
+    *
+    */
+    @Override
+    public void getOrderDetailNew(String subOrderNo) throws Exception {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
+        List<StatusDocumentsResponse.DataDTO.DocumentListDTO> documentList = getDocumentListDTO(insAreaCompany);
+        List<StatusDocumentsResponse.DataDTO.DocumentListDTO> documentListDTOS =
+                documentList.stream().filter(x -> ResultCode.RC_B5.getCode().equals(x.getStatus())).collect(Collectors.toList());
 
+        if (documentListDTOS.size() == documentList.size()) {
+            for (StatusDocumentsResponse.DataDTO.DocumentListDTO documentListDTO : documentListDTOS) {
+                if (InsuranceType.IT_0.getCode().equals(documentListDTO.getInsuranceType())) {
+                    insAreaCompany.setSypolicyno(documentListDTO.getPolicyNo());
+                } else if (InsuranceType.IT_1.getCode().equals(documentListDTO.getInsuranceType())) {
+                    insAreaCompany.setJqpolicyno(documentListDTO.getPolicyNo());
+                }
+            }
 
+            insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
+            insAreaCompanyService.updateCompanyAndOrdersNew(insAreaCompany);
+        }
+    }
 }

+ 10 - 0
src/main/java/com/ydtech/modules/order/service/impl/YongAnOrderServiceImpl.java

@@ -42,6 +42,7 @@ import org.springframework.util.StringUtils;
 
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
 import java.util.*;
 
 @Slf4j
@@ -1178,5 +1179,14 @@ public class YongAnOrderServiceImpl implements YongAnOrderService {
         return HttpResult.ok("success", quoteRespVo);
     }
 
+    @Override
+    public void getOrderDetailNew(String subOrderNo) {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
+        insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());//7 已承保
+       if(insAreaCompany.getPayDate()==null){
+                        insAreaCompany.setPayDate(LocalDateTime.now());
+       }
+        insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
 
+    }
 }

+ 18 - 1
src/main/java/com/ydtech/modules/xxl/factory/QueryStatusFactory.java

@@ -22,36 +22,42 @@ public class QueryStatusFactory {
 
     public static BaseQueryStatusService getQueryStatusService(HashMap map, String companyId) {
         if (companyId.startsWith("AICS1000000")) {
+            //永诚财险
             return new YongChengQueryStatusService(
                     (ConfigureParametersComponents) map.get("configureParametersComponents"),
                     (YongchengRequestApiComponents) map.get("yongchengRequestApiComponents"),
                     (PtlAgreementAttributionService) map.get("ptlAgreementAttributionService"),
                     (YongchengOrderApiService) map.get("yongchengOrderApiService"));
         } else if (companyId.startsWith("DJPC1000000")) {
+            //大家财险
             return new DaJiaQueryStatusService(
                     (ConfigureParametersComponents) map.get("configureParametersComponents"),
                     (DaJiaRequestApiComponents) map.get("daJiaRequestApiComponents"),
                     (PtlAgreementAttributionService) map.get("ptlAgreementAttributionService"),
                     (DaJiaOrderService) map.get("daJiaOrderService"));
         } else if (companyId.startsWith("XDCX1000000")){
+            //国任财险
             return new GuoRenQueryStatusService(
                     (ConfigureParametersComponents) map.get("configureParametersComponents"),
                     (GuorenRequestApiComponent) map.get("guorenRequestApiComponent"),
                     (PtlAgreementAttributionService) map.get("ptlAgreementAttributionService"),
                     (GuorenOrderApiService) map.get("guorenOrderApiService"));
         } else if(companyId.startsWith("HTIC1000000")){
+            //华泰财险
             return new HuaTaiQueryStatusService(
                     (ConfigureParametersComponents) map.get("configureParametersComponents"),
                     (HuaTaiRequestApiComponents) map.get("huaTaiRequestApiComponents"),
                     (PtlAgreementAttributionService) map.get("ptlAgreementAttributionService"),
                     (HuaTaiOrderApiService) map.get("huaTaiOrderApiService"));
         } else if(companyId.startsWith("ZMBX1000000")){
+            //中煤财险
             return new ZhongMeiQueryStatusService(
                     (ConfigureParametersComponents) map.get("configureParametersComponents"),
                     (ZhongmeiRequestApiComponents) map.get("zhongmeiRequestApiComponents"),
                     (PtlAgreementAttributionService) map.get("ptlAgreementAttributionService"),
                     (ZhongMeiOrderApiService) map.get("zhongMeiOrderApiService"));
         } else if(companyId.startsWith("ZKIC1000000")){
+            //紫金财险
             return new ZijinQueryStatusService(
                     (ConfigureParametersComponents) map.get("configureParametersComponents"),
                     (ZijinRequestApiComponents) map.get("zijinRequestApiComponents"),
@@ -59,12 +65,23 @@ public class QueryStatusFactory {
                     (ZijinOrderApiService) map.get("zijinOrderApiService"));
         } else if(companyId.startsWith("TPBX1000000") || companyId.startsWith("TPIC1000000") || companyId.startsWith("HBIC1000000") || companyId.startsWith("GPIC1000000") ||
                     companyId.startsWith("HNIC1000000") || companyId.startsWith("ZAPA1000000")){
+            //安盛财险、 太平财险、 恒邦财险 、中国人寿
+            //华农财险 、众安
             return new InsCrawlerQueryStatusService(
                     (ConfigureParametersComponents) map.get("configureParametersComponents"),
                     (PtlCrawlerApiService) map.get("ptlCrawlerApiService"),
                     (InsCrawlerOrderComponents) map.get("insCrawlerOrderComponents"),
                     (InsCrawlerOrderService) map.get("insCrawlerOrderService"));
-        } else {
+        } else if(companyId.startsWith("BPIC1000000")){
+            //渤海
+            return new BoHaiQueryStatusService((BoHaiOrderApiService) map.get("boHaiOrderApiService"));
+        } else if(companyId.startsWith("PAIC1000000")){
+            //平安
+            return new PingAnQueryStatusService((PingAnOrderApiService) map.get("pingAnOrderApiService"));
+        } else if(companyId.startsWith("YAIC1000000")){
+            //永安
+            return new YongAnQueryStatusService((YongAnOrderService) map.get("yongAnOrderService"));
+        }else{
             return null;
         }
     }

+ 1 - 1
src/main/java/com/ydtech/modules/xxl/service/BaseQueryStatusService.java

@@ -8,5 +8,5 @@ import org.springframework.stereotype.Service;
 public interface BaseQueryStatusService {
     QueryStatusResult queryStatus(InsAreaCompany insAreaCompany);
 
-    void updateOrderStatusAndPayDate(InsAreaCompany insAreaCompany);
+    void updateOrderStatusAndPayDate(InsAreaCompany insAreaCompany) throws Exception;
 }

+ 45 - 0
src/main/java/com/ydtech/modules/xxl/service/impl/PingAnQueryStatusService.java

@@ -0,0 +1,45 @@
+package com.ydtech.modules.xxl.service.impl;
+
+import com.ydtech.modules.order.service.PingAnOrderApiService;
+import com.ydtech.modules.xxl.model.InsAreaCompany;
+import com.ydtech.modules.xxl.model.QueryStatusResult;
+import com.ydtech.modules.xxl.service.BaseQueryStatusService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/3/28 11:33
+ *  @Description:  平安财险
+ */
+@Service
+@RequiredArgsConstructor
+public class PingAnQueryStatusService implements BaseQueryStatusService {
+
+    private final PingAnOrderApiService pingAnOrderApiService;
+
+    /**
+     *
+     * @param insAreaCompany 业务订单
+     * @return
+     */
+    @Override
+    public QueryStatusResult queryStatus(InsAreaCompany insAreaCompany) {
+
+        return null;
+    }
+
+    /**
+     * @Description  更新承保状态和支付时间
+     * @Author  hxl
+     * @Date   2024/3/28 17:58
+     * @Param
+     * @Return
+     * @Exception
+     *
+     */
+    public void updateOrderStatusAndPayDate(InsAreaCompany insAreaCompany) {
+        pingAnOrderApiService.getOrderDetailNew(insAreaCompany.getId());
+    }
+}

+ 46 - 0
src/main/java/com/ydtech/modules/xxl/service/impl/YongAnQueryStatusService.java

@@ -0,0 +1,46 @@
+package com.ydtech.modules.xxl.service.impl;
+
+import com.ydtech.modules.order.service.YongAnOrderService;
+import com.ydtech.modules.xxl.model.InsAreaCompany;
+import com.ydtech.modules.xxl.model.QueryStatusResult;
+import com.ydtech.modules.xxl.service.BaseQueryStatusService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/3/28 11:33
+ *  @Description:  永安财险
+ */
+@Service
+@RequiredArgsConstructor
+public class YongAnQueryStatusService implements BaseQueryStatusService {
+
+    private final YongAnOrderService yongAnOrderService;
+
+
+
+    /**
+     *
+     * @param insAreaCompany 业务订单
+     * @return
+     */
+    @Override
+    public QueryStatusResult queryStatus(InsAreaCompany insAreaCompany) {
+        return null;
+    }
+
+    /**
+     * @Description  更新承保状态和支付时间
+     * @Author  hxl
+     * @Date   2024/3/28 17:58
+     * @Param
+     * @Return
+     * @Exception
+     *
+     */
+    public void updateOrderStatusAndPayDate(InsAreaCompany insAreaCompany) {
+        yongAnOrderService.getOrderDetailNew(insAreaCompany.getId());
+    }
+}