Bläddra i källkod

Merge remote-tracking branch 'origin/test' into test-dismantle

785834757 2 år sedan
förälder
incheckning
4d034dd301

+ 1 - 1
src/main/java/com/ydtech/modules/order/dao/InsOrdersMapper.java

@@ -35,6 +35,6 @@ public interface InsOrdersMapper extends BaseMapper<InsOrders> {
 
     Long getPolicyInsuranceReportCount(@Param("policyReqVo") PolicyInsuranceReportReqVo policyInsuranceReportReqVo);
 
-
+    boolean updateStatus(@Param("orderno") String orderno, @Param("status") String status);
 
 }

+ 2 - 2
src/main/java/com/ydtech/modules/order/service/impl/IdentifyServiceImpl.java

@@ -71,7 +71,7 @@ public class IdentifyServiceImpl implements IdentifyService {
             if (StringUtils.isNotBlank(s2) && !ObjectUtil.isAllFieldNull(redisTemplate.opsForValue().get(s2Key))) {
                 //走缓存
                 CustomerInfoVO customerInfoVO2 = new CustomerInfoVO();
-                BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s2Key)), customerInfoVO);
+                BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s2Key)), customerInfoVO2);
                 Idcard.conversionBack(customerInfoVO, customerInfoVO2);
             } else {
                 //识别身份证背面
@@ -97,7 +97,7 @@ public class IdentifyServiceImpl implements IdentifyService {
             if (StringUtils.isNotBlank(s1) && !ObjectUtil.isAllFieldNull(redisTemplate.opsForValue().get(s1Key))) {
                 //走缓存
                 CardUserInfo cardUserInfo1 = new CardUserInfo();
-                BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s1Key)), cardUserInfo);
+                BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s1Key)), cardUserInfo1);
                 MultiObjectDetect.conversionFront(cardUserInfo, cardUserInfo1);
 
             } else {

+ 52 - 20
src/main/java/com/ydtech/modules/xxl/handler/QueryStatusHandler.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.xxl.handler;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
 import com.ydtech.modules.order.components.ConfigureParametersComponents;
@@ -10,6 +11,10 @@ import com.ydtech.modules.order.components.gouren.GuorenRequestApiComponent;
 import com.ydtech.modules.order.components.huatai.HuaTaiRequestApiComponents;
 import com.ydtech.modules.order.components.yongcheng.YongchengRequestApiComponents;
 import com.ydtech.modules.order.components.zijin.ZijinRequestApiComponents;
+import com.ydtech.modules.order.dao.InsOrdersMapper;
+import com.ydtech.modules.order.entity.InsOrders;
+import com.ydtech.modules.order.entity.InsOrdersTrack;
+import com.ydtech.modules.order.service.InsOrdersTrackService;
 import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
 import com.ydtech.modules.protocol.service.PtlCrawlerApiService;
 import com.ydtech.modules.xxl.mapper.XxlInsAreaCompanyMapper;
@@ -33,6 +38,9 @@ import java.util.Random;
 @Component
 public class QueryStatusHandler {
 
+    @Autowired
+    InsOrdersMapper insOrdersMapper;
+
     @Autowired
     XxlInsAreaCompanyMapper insAreaCompanyMapper;
 
@@ -66,16 +74,18 @@ public class QueryStatusHandler {
     @Autowired
     PtlAgreementAttributionService ptlAgreementAttributionService;
 
+    @Autowired
+    InsOrdersTrackService insOrdersTrackService;
 
     @XxlJob("queryStatusHandler")
     public void queryStatus() {
         Random random = new Random();
-        HashMap<String,Object> components = getComponents();
-        HashMap<String,String> time = get24HourTime();
+        HashMap<String, Object> components = getComponents();
+        HashMap<String, String> time = get24HourTime();
         //获取24小时内未支付的订单
         List<InsAreaCompany> noPayList = insAreaCompanyMapper.getNoPayList(time.get("startTime"), time.get("endTime"));
         noPayList.forEach(insAreaCompany -> {
-            if(insAreaCompany.getAgreementId() != null) {
+            if (insAreaCompany.getAgreementId() != null) {
                 //实例化
                 try {
                     //添加延迟
@@ -87,10 +97,32 @@ public class QueryStatusHandler {
                             //更新 ins_area_company
                             insAreaCompany.setInsideOrderStatus(Integer.parseInt(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode()));
                             insAreaCompany.setInsidePayTime(queryStatusResult.getPayTime());
+                            //设置支付时间
+                            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                            LocalDateTime dateTime = LocalDateTime.parse(queryStatusResult.getPayTime(), formatter);
+                            insAreaCompany.setPayDate(dateTime);
+                            //设置状态为已承保
+                            insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
                             insAreaCompanyMapper.updateInsideOrder(insAreaCompany);
+                            InsOrders insOrders = insOrdersMapper.selectOne(new LambdaQueryWrapper<InsOrders>().eq(InsOrders::getOrderno, insAreaCompany.getOrderno()));
+                            //设置主订单为已承保
+                            insOrders.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
+                            insOrdersMapper.updateStatus(insOrders.getOrderno(),InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
+
+                            //添加轨迹信息
+                            InsOrdersTrack insOrdersTrack = new InsOrdersTrack();
+                            insOrdersTrack.setOrderNo(insAreaCompany.getOrderno());
+                            insOrdersTrack.setInsCompany(insAreaCompany.getInscompany());
+                            insOrdersTrack.setCompanyId(insAreaCompany.getCompanyId());
+                            insOrdersTrack.setSuborder(insAreaCompany.getId());
+                            insOrdersTrack.setOrderStatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
+                            insOrdersTrack.setOperatorId("admin");
+                            insOrdersTrack.setOperator("自动操作");
+                            insOrdersTrack.setCreateTime(LocalDateTime.now());
+                            insOrdersTrackService.save(insOrdersTrack);
                         }
                     }
-                }catch(Exception e){
+                } catch (Exception e) {
                     e.printStackTrace();
                 }
             }
@@ -98,31 +130,31 @@ public class QueryStatusHandler {
     }
 
 
-    private HashMap<String,Object> getComponents(){
-        HashMap<String,Object> components = new HashMap<>();
-        components.put("configureParametersComponents",configureParametersComponents);
-        components.put("daJiaRequestApiComponents",daJiaRequestApiComponents);
-        components.put("yongchengRequestApiComponents",yongchengRequestApiComponents);
-        components.put("guorenRequestApiComponent",guorenRequestApiComponent);
-        components.put("huaTaiRequestApiComponents",huaTaiRequestApiComponents);
-        components.put("zhongmeiRequestApiComponents",zhongmeiRequestApiComponents);
-        components.put("zijinRequestApiComponents",zijinRequestApiComponents);
-        components.put("insCrawlerOrderComponents",insCrawlerOrderComponents);
-        components.put("ptlCrawlerApiService",ptlCrawlerApiService);
-        components.put("ptlAgreementAttributionService",ptlAgreementAttributionService);
+    private HashMap<String, Object> getComponents() {
+        HashMap<String, Object> components = new HashMap<>();
+        components.put("configureParametersComponents", configureParametersComponents);
+        components.put("daJiaRequestApiComponents", daJiaRequestApiComponents);
+        components.put("yongchengRequestApiComponents", yongchengRequestApiComponents);
+        components.put("guorenRequestApiComponent", guorenRequestApiComponent);
+        components.put("huaTaiRequestApiComponents", huaTaiRequestApiComponents);
+        components.put("zhongmeiRequestApiComponents", zhongmeiRequestApiComponents);
+        components.put("zijinRequestApiComponents", zijinRequestApiComponents);
+        components.put("insCrawlerOrderComponents", insCrawlerOrderComponents);
+        components.put("ptlCrawlerApiService", ptlCrawlerApiService);
+        components.put("ptlAgreementAttributionService", ptlAgreementAttributionService);
         return components;
     }
 
-    private HashMap<String,String> get24HourTime(){
-        HashMap<String,String> components = new HashMap<>();
+    private HashMap<String, String> get24HourTime() {
+        HashMap<String, String> components = new HashMap<>();
         // 获取当前时间
         LocalDateTime currentTime = LocalDateTime.now();
         // 获取前24小时的时间
         LocalDateTime previous24Hours = currentTime.minus(Duration.ofHours(24));
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         LocalDateTime current = LocalDateTime.now();
-        components.put("startTime",previous24Hours.format(formatter));
-        components.put("endTime",current.format(formatter));
+        components.put("startTime", previous24Hours.format(formatter));
+        components.put("endTime", current.format(formatter));
         return components;
     }
 }

+ 1 - 1
src/main/java/com/ydtech/utils/baidu/Idcard.java

@@ -145,7 +145,7 @@ public class Idcard {
     }
 
     public static void conversionBack(CustomerInfoVO customerInfo, CustomerInfoVO customerInfoNew) {
-        customerInfo.setIdentifyValidDate(customerInfoNew.getName());
+        customerInfo.setIdentifyValidDate(customerInfoNew.getIdentifyValidDate());
         customerInfo.setIdentifyValidEndDate(customerInfoNew.getIdentifyValidEndDate());
     }
 

+ 4 - 0
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -677,4 +677,8 @@
         </if>
         ) as s
     </select>
+
+    <update id="updateStatus">
+        update ins_orders set orderstatus = #{status} where orderno = #{orderno}
+    </update>
 </mapper>