‘linchangsheng’ hai 2 días
pai
achega
a37b844641

+ 14 - 0
mall-server-api/src/main/java/com/gree/mall/manager/es/OrderBase2022EsRepository.java

@@ -0,0 +1,14 @@
+package com.gree.mall.manager.es;
+
+
+import com.gree.mall.manager.bean.es.OrderBaseEs2022Date;
+import com.gree.mall.manager.bean.es.OrderBaseEsDate;
+import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
+
+/**
+ * @author
+ * @description
+ * @date 2023/6/19 10:37 星期一
+ */
+public interface OrderBase2022EsRepository extends ElasticsearchRepository<OrderBaseEs2022Date, String> {
+}

+ 14 - 0
mall-server-api/src/main/java/com/gree/mall/manager/es/OrderBase2023EsRepository.java

@@ -0,0 +1,14 @@
+package com.gree.mall.manager.es;
+
+
+import com.gree.mall.manager.bean.es.OrderBaseEs2023Date;
+import com.gree.mall.manager.bean.es.OrderBaseEsDate;
+import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
+
+/**
+ * @author
+ * @description
+ * @date 2023/6/19 10:37 星期一
+ */
+public interface OrderBase2023EsRepository extends ElasticsearchRepository<OrderBaseEs2023Date, String> {
+}

+ 14 - 0
mall-server-api/src/main/java/com/gree/mall/manager/es/OrderBase2024EsRepository.java

@@ -0,0 +1,14 @@
+package com.gree.mall.manager.es;
+
+
+import com.gree.mall.manager.bean.es.OrderBaseEs2024Date;
+import com.gree.mall.manager.bean.es.OrderBaseEsDate;
+import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
+
+/**
+ * @author
+ * @description
+ * @date 2023/6/19 10:37 星期一
+ */
+public interface OrderBase2024EsRepository extends ElasticsearchRepository<OrderBaseEs2024Date, String> {
+}

+ 34 - 7
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseEsLogic.java

@@ -11,16 +11,11 @@ import com.gree.mall.manager.bean.es.*;
 import com.gree.mall.manager.bean.listvo.param.WorkOrderZfireParam;
 import com.gree.mall.manager.bean.listvo.workorder.OrderBaseVO;
 import com.gree.mall.manager.enums.MaterialExamineStatusEnum;
-import com.gree.mall.manager.es.OrderBaseEsRepository;
-import com.gree.mall.manager.es.OrderWorkerEsRepository;
-import com.gree.mall.manager.es.SettlementOrderEsRepository;
+import com.gree.mall.manager.es.*;
 import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.logic.common.CommonLogic;
 import com.gree.mall.manager.plus.entity.*;
-import com.gree.mall.manager.plus.service.PgOrderBaseService;
-import com.gree.mall.manager.plus.service.PgOrderWorkerService;
-import com.gree.mall.manager.plus.service.SettlementOrderService;
-import com.gree.mall.manager.plus.service.WorkerOrderService;
+import com.gree.mall.manager.plus.service.*;
 import com.gree.mall.manager.utils.CommonUtils;
 import com.gree.mall.manager.utils.StringUtil;
 import com.gree.mall.manager.zfire.bean.QueryParamBean;
@@ -69,7 +64,13 @@ public class OrderBaseEsLogic {
 
     private final CommonLogic commonLogic;
     private final OrderBaseEsRepository orderBaseEsRepository;
+    private final OrderBase2022EsRepository orderBase2022EsRepository;
+    private final OrderBase2023EsRepository orderBase2023EsRepository;
+    private final OrderBase2024EsRepository orderBase2024EsRepository;
     private final PgOrderBaseService pgOrderBaseService;
+    private final PgOrderBase2022Service pgOrderBase2022Service;
+    private final PgOrderBase2023Service pgOrderBase2023Service;
+    private final PgOrderBase2024Service pgOrderBase2024Service;
     private final SettlementOrderService settlementOrderService;
     private final SettlementOrderEsRepository settlementOrderEsRepository;
     private final OrderWorkerEsRepository orderWorkerEsRepository;
@@ -721,6 +722,32 @@ public class OrderBaseEsLogic {
 
 
         orderBaseEsRepository.saveAll(orderBaseEsDates);
+
+
+        List<PgOrderBase2022> list2022 = pgOrderBase2022Service.lambdaQuery()
+                .gt(PgOrderBase2022::getUpdateTime,DateUtil.offsetMinute(new Date(),-5))
+                .list();
+
+        List<OrderBaseEs2022Date> orderBaseEsDates2022 = BeanUtil.copyToList(list2022, OrderBaseEs2022Date.class);
+
+        orderBase2022EsRepository.saveAll(orderBaseEsDates2022);
+
+
+        List<PgOrderBase2023> list2023 = pgOrderBase2023Service.lambdaQuery()
+                .gt(PgOrderBase2023::getUpdateTime,DateUtil.offsetMinute(new Date(),-5))
+                .list();
+
+        List<OrderBaseEs2023Date> orderBaseEsDates2023 = BeanUtil.copyToList(list2023, OrderBaseEs2023Date.class);
+
+        orderBase2023EsRepository.saveAll(orderBaseEsDates2023);
+
+        List<PgOrderBase2024> list2024 = pgOrderBase2024Service.lambdaQuery()
+                .gt(PgOrderBase2024::getUpdateTime,DateUtil.offsetMinute(new Date(),-5))
+                .list();
+
+        List<OrderBaseEs2024Date> orderBaseEsDates2024 = BeanUtil.copyToList(list2024, OrderBaseEs2024Date.class);
+
+        orderBase2024EsRepository.saveAll(orderBaseEsDates2024);
     }
 
     public void esSync1() {