Pārlūkot izejas kodu

同步push数据

cgy 7 mēneši atpakaļ
vecāks
revīzija
00575bc34a

+ 5 - 0
jsglkh-common/src/main/java/com/rongwei/bscommon/sys/service/SynchronizationDataService.java

@@ -4,6 +4,9 @@ import com.rongwei.rwcommon.base.R;
 
 import java.util.List;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * @author :sc
  * @since :2024/12/2
@@ -14,4 +17,6 @@ public interface SynchronizationDataService {
     R deleteDataSync(List<String> id, List<String>  dataIds, String code);
 
     R uploadFile(String fileId);
+
+    R allPush(List<String> ids);
 }

+ 212 - 0
jsglkh-common/src/main/java/com/rongwei/bscommon/sys/service/impl/SynchronizationDataServiceImpl.java

@@ -1,9 +1,11 @@
 package com.rongwei.bscommon.sys.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.rongwei.bscommon.sys.service.SynchronizationDataService;
 import com.rongwei.bscommon.sys.strategy.api.*;
 import com.rongwei.bscommon.sys.utils.AttendanceAssessmentSdk;
+import com.rongwei.bsentity.domain.*;
 import com.rongwei.bsentity.dto.ApiCallDto;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.base.exception.CustomException;
@@ -13,8 +15,11 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -29,6 +34,213 @@ public class SynchronizationDataServiceImpl implements SynchronizationDataServic
     private SysFileItemServiceImpl sysFileItemServiceImpl;
     @Autowired
     private AttendanceAssessmentSdk attendanceAssessmentSdk;
+    @Autowired
+    private JtFjglxmServiceImpl jtFjglxmService;
+    @Autowired
+    private JtKcsjxmServiceImpl jtKcsjxmService;
+    @Autowired
+    private JtGzdgServiceImpl jtGzdgService;
+    @Autowired
+    private JtZtfapsServiceImpl jtZtfapsService;
+    @Autowired
+    private JtWyysServiceImpl jtWyysService;
+    @Autowired
+    private JtYjbhglServiceImpl jtYjbhglService;
+    @Autowired
+    private JtScsdlServiceImpl jtScsdlService;
+    @Autowired
+    private JtWtbhglServiceImpl jtWtbhglService;
+    @Autowired
+    private JtScbhglServiceImpl jtScbhglService;
+    @Autowired
+    private JtSjjdqdServiceImpl jtSjjdqdService;
+    @Autowired
+    private JtSjbgqdServiceImpl jtSjbgqdService;
+    @Autowired
+    private JtZdxmszmnServiceImpl jtZdxmszmnService;
+    @Autowired
+    private JtXcjhqdServiceImpl jtXcjhqdService;
+
+    /**
+     * allPush数据推送
+     * @param ids
+     * @return
+     */
+    @PostMapping("/allpush")
+    public R allPush(@RequestBody List<String> ids) {
+        //分别用每个 id 去查询"jt_fjglxm"表中的数据  用的是这些表中的 mainid  关联
+
+        List<JtFjglxm> fjglxmList = jtFjglxmService.list(new LambdaQueryWrapper<JtFjglxm>()
+                .in(JtFjglxm::getMainid, ids)
+                .eq(JtFjglxm::getDeleted, "0"));
+        if (fjglxmList != null && !fjglxmList.isEmpty()) {
+            // 遍历每一行数据
+            for (JtFjglxm fjglxm : fjglxmList) {
+                String id = fjglxm.getId();
+                this.pushDataSync(id, "KC103");
+            }
+        } else {
+           log.info("项目考核-分级管理项目数据为 null");
+        }
+
+        List<JtKcsjxm> jtKcsjxmList = jtKcsjxmService.list(new LambdaQueryWrapper<JtKcsjxm>()
+                .in(JtKcsjxm::getMainid, ids)
+                .eq(JtKcsjxm::getDeleted, "0"));
+        if (jtKcsjxmList != null && !jtKcsjxmList.isEmpty()) {
+            // 遍历每一行数据
+            for (JtKcsjxm jtKcsjxm : jtKcsjxmList) {
+                String id = jtKcsjxm.getId();
+                this.pushDataSync(id, "KC105");
+            }
+        } else {
+            log.info("项目考核-勘察设计项目清单数据为 null");
+        }
+
+        List<JtGzdg> jtGzdgList = jtGzdgService.list(new LambdaQueryWrapper<JtGzdg>()
+                .in(JtGzdg::getMainid, ids)
+                .eq(JtGzdg::getDeleted, "0"));
+        if (jtGzdgList != null && !jtGzdgList.isEmpty()) {
+            // 遍历每一行数据
+            for (JtGzdg jtGzdg : jtGzdgList) {
+                String id = jtGzdg.getId();
+                this.pushDataSync(id, "KC107");
+            }
+        } else {
+            log.info("项目考核-工作大纲/指导书审查率数据为 null");
+        }
+
+        List<JtZtfaps> jtZtfapsList = jtZtfapsService.list(new LambdaQueryWrapper<JtZtfaps>()
+                .in(JtZtfaps::getMainid, ids)
+                .eq(JtZtfaps::getDeleted, "0"));
+        if (jtZtfapsList != null && !jtZtfapsList.isEmpty()) {
+            // 遍历每一行数据
+            for (JtZtfaps jtZtfaps : jtZtfapsList) {
+                String id = jtZtfaps.getId();
+                this.pushDataSync(id, "KC109");
+            }
+        } else {
+            log.info("项目考核-总体方案评审清单数据为 null");
+        }
+
+        List<JtWyys> jtWyysList = jtWyysService.list(new LambdaQueryWrapper<JtWyys>()
+                .in(JtWyys::getMainid, ids)
+                .eq(JtWyys::getDeleted, "0"));
+        if (jtWyysList != null && !jtWyysList.isEmpty()) {
+            // 遍历每一行数据
+            for (JtWyys jtWyys : jtWyysList) {
+                String id = jtWyys.getId();
+                this.pushDataSync(id, "KC111");
+            }
+        } else {
+            log.info("项目考核-外业验收清单数据为 null");
+        }
+
+        List<JtYjbhgl> jtYjbhglList = jtYjbhglService.list(new LambdaQueryWrapper<JtYjbhgl>()
+                .in(JtYjbhgl::getMainid, ids)
+                .eq(JtYjbhgl::getDeleted, "0"));
+        if (jtYjbhglList != null && !jtYjbhglList.isEmpty()) {
+            // 遍历每一行数据
+            for (JtYjbhgl jtYjbhgl : jtYjbhglList) {
+                String id = jtYjbhgl.getId();
+                this.pushDataSync(id, "KC113");
+            }
+        } else {
+            log.info("项目考核-意见闭环管理数据为 null");
+        }
+
+        List<JtScsdl> jtScsdlList = jtScsdlService.list(new LambdaQueryWrapper<JtScsdl>()
+                .in(JtScsdl::getMainid, ids)
+                .eq(JtScsdl::getDeleted, "0"));
+        if (jtScsdlList != null && !jtScsdlList.isEmpty()) {
+            // 遍历每一行数据
+            for (JtScsdl jtScsdl : jtScsdlList) {
+                String id = jtScsdl.getId();
+                this.pushDataSync(id, "KC115");
+            }
+        } else {
+            log.info("项目考核- 审查审定率数据为 null");
+        }
+
+
+        List<JtWtbhgl> jtWtbhglList = jtWtbhglService.list(new LambdaQueryWrapper<JtWtbhgl>()
+                .in(JtWtbhgl::getMainid, ids)
+                .eq(JtWtbhgl::getDeleted, "0"));
+        if (jtWtbhglList != null && !jtWtbhglList.isEmpty()) {
+            // 遍历每一行数据
+            for (JtWtbhgl jtWtbhgl : jtWtbhglList) {
+                String id = jtWtbhgl.getId();
+                this.pushDataSync(id, "KC117");
+            }
+        } else {
+            log.info("项目考核-问题闭环管理数据为 null");
+        }
+
+        List<JtScbhgl> jtScbhglList = jtScbhglService.list(new LambdaQueryWrapper<JtScbhgl>()
+                .in(JtScbhgl::getMainid, ids)
+                .eq(JtScbhgl::getDeleted, "0"));
+        if (jtScbhglList != null && !jtScbhglList.isEmpty()) {
+            // 遍历每一行数据
+            for (JtScbhgl jtScbhgl : jtScbhglList) {
+                String id = jtScbhgl.getId();
+                this.pushDataSync(id, "KC119");
+            }
+        } else {
+            log.info("项目考核-审查闭环管理数据为 null");
+        }
+
+        List<JtSjjdqd> jtSjjdqdList = jtSjjdqdService.list(new LambdaQueryWrapper<JtSjjdqd>()
+                .in(JtSjjdqd::getMainid, ids)
+                .eq(JtSjjdqd::getDeleted, "0"));
+        if (jtSjjdqdList != null && !jtSjjdqdList.isEmpty()) {
+            // 遍历每一行数据
+            for (JtSjjdqd jtSjjdqd : jtSjjdqdList) {
+                String id = jtSjjdqd.getId();
+                this.pushDataSync(id, "KC121");
+            }
+        } else {
+            log.info("项目考核-设计交底清单数据为 null");
+        }
+
+        List<JtSjbgqd> jtSjbgqdList = jtSjbgqdService.list(new LambdaQueryWrapper<JtSjbgqd>()
+                .in(JtSjbgqd::getMainid, ids)
+                .eq(JtSjbgqd::getDeleted, "0"));
+        if (jtSjbgqdList != null && !jtSjbgqdList.isEmpty()) {
+            // 遍历每一行数据
+            for (JtSjbgqd jtsjbgqd : jtSjbgqdList) {
+                String id = jtsjbgqd.getId();
+                this.pushDataSync(id, "KC123");
+            }
+        } else {
+            log.info("项目考核-设计变更清单数据为 null");
+        }
+
+        List<JtZdxmszmn> jtZdxmszmnList = jtZdxmszmnService.list(new LambdaQueryWrapper<JtZdxmszmn>()
+                .in(JtZdxmszmn::getMainid, ids)
+                .eq(JtZdxmszmn::getDeleted, "0"));
+        if (jtZdxmszmnList != null && !jtZdxmszmnList.isEmpty()) {
+            // 遍历每一行数据
+            for (JtZdxmszmn jtZdxmszmn : jtZdxmszmnList) {
+                String id = jtZdxmszmn.getId();
+                this.pushDataSync(id, "KC131");
+            }
+        } else {
+            log.info("项目考核-数值模拟材料数据为 null");
+        }
+
+        List<JtXcjhqd> jtXcjhqdList = jtXcjhqdService.list(new LambdaQueryWrapper<JtXcjhqd>()
+                .in(JtXcjhqd::getMainid, ids)
+                .eq(JtXcjhqd::getDeleted, "0"));
+        if (jtXcjhqdList != null && !jtXcjhqdList.isEmpty()) {
+            // 遍历每一行数据
+            for (JtXcjhqd jtXcjhqd : jtXcjhqdList) {
+                String id = jtXcjhqd.getId();
+                this.pushDataSync(id, "KC133");
+            }
+        } else {
+            log.info("项目考核-巡查通报清单数据为 null");
+        }
+        return R.ok();
+    }
 
 
     /**

+ 17 - 0
jsglkh-server/src/main/java/com/rongwei/controller/SynchronizationDataController.java

@@ -14,6 +14,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * @author :sc
  * @since :2024/12/2
@@ -65,6 +68,20 @@ public class SynchronizationDataController {
             return null;
         }
     }
+    /**
+     * allpush
+     */
+    @PostMapping("/allpush")
+    public R allPush(@RequestBody List<String> ids) {
+        //ids 参数形式为数组[
+        //            "ea1afd0a0c714c07919a151874cb9bac",
+        //            "dd9f3ceaeba84f2b8a42ba8124d377c1",
+        //            "6cf6097622b04195b739ee1d1d5aaa2e"
+        //        ]  遍历每个 id  去
+
+        return R.ok();
+    }
+
 
     /**
      * 文件上传对接接口