1
0
DESKTOP-2K9OVK9\siwei 1 месяц назад
Родитель
Сommit
bdb722f4c7

+ 2 - 3
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/zrzysite/ZrzysiteConstructController.java

@@ -30,7 +30,6 @@ public class ZrzysiteConstructController extends BaseController {
     private IZrzysiteGhhsService zrzysiteGhhsService;
 
 
-
     @GetMapping("/list")
     public TableDataInfo list(ZrzysiteConstructFilterVo filterVo) {
         startPage();
@@ -53,7 +52,6 @@ public class ZrzysiteConstructController extends BaseController {
     }
 
 
-
     @GetMapping("/construct/{param}")
     //@InnerAuth
     public R<String> runConstructScheduled( @PathVariable("param") String param ) {
@@ -90,11 +88,12 @@ public class ZrzysiteConstructController extends BaseController {
 
 
     @GetMapping("/dingshi")
-    @InnerAuth
+    //@InnerAuth
     public R<String> dingshi() {
         //zrzysiteLandService.syncLandInfo();
         //zrzysiteGhhsService.syncGhhsInfo();
         //zrzysiteConstructService.syncConstructInfo("");
+        zrzysiteConstructService.batchUpdateOnChina("t_jsgcghxk");
         System.out.println("daole--22");
         return R.ok("success1");
     }

+ 4 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/IZrzysiteCommonService.java

@@ -22,4 +22,8 @@ public interface IZrzysiteCommonService {
 
     String getNodeAttachment(String projectId, String nodeId, String sourceId, String nodeName);
 
+
+    void batchUpdateOnChina(String nodeTableName);
+
+
 }

+ 109 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/impl/ZrzysiteCommonServiceImpl.java

@@ -2,6 +2,7 @@ package com.siwei.apply.service.zrzysite.impl;
 
 import com.siwei.apply.domain.BaseId;
 import com.siwei.apply.domain.Jsgcghxk;
+import com.siwei.apply.domain.NodeLand;
 import com.siwei.apply.domain.Project;
 import com.siwei.apply.domain.vo.JsgcghxkUpdateVo;
 import com.siwei.apply.domain.vo.JsgcghxkVo;
@@ -13,8 +14,7 @@ import com.siwei.apply.mapper.JsgcghxkMapper;
 import com.siwei.apply.mapper.ProjectMapper;
 import com.siwei.apply.mapper.zrzysite.ZrzysiteAttachmentMapper;
 import com.siwei.apply.mapper.zrzysite.ZrzysiteConstructMapper;
-import com.siwei.apply.service.JsgcghxkService;
-import com.siwei.apply.service.NodeAttachmentService;
+import com.siwei.apply.service.*;
 import com.siwei.apply.service.zrzysite.IZrzysiteCommonService;
 import com.siwei.apply.utils.ServiceFileUtil;
 import com.siwei.common.core.exception.ServiceException;
@@ -22,6 +22,7 @@ import com.siwei.common.core.utils.DateUtils;
 import com.siwei.common.core.utils.StringUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -47,6 +48,9 @@ public class ZrzysiteCommonServiceImpl implements IZrzysiteCommonService {
     @Autowired
     private JsgcghxkService jsgcghxkService;
 
+    @Autowired
+    private TdhyhsService tdhyhsService;
+
 
     @Autowired
     private NodeAttachmentService nodeAttachmentService;
@@ -56,6 +60,24 @@ public class ZrzysiteCommonServiceImpl implements IZrzysiteCommonService {
     private ZrzysiteAttachmentMapper zrzysiteAttachmentMapper;
 
 
+
+    @Autowired
+    private NodeLandService nodeLandService;
+
+
+    @Autowired
+    private ProjectService projectService;
+
+    @Autowired
+    private LandOneCodeService landOneCodeService;
+
+
+
+    @Autowired
+    private JsydghxkService jsydghxkService;
+
+
+
     @Override
     public List<ZrzysiteConstruct> selectList(ZrzysiteConstructFilterVo filterVo) {
         return zrzysiteConstructMapper.selectList(filterVo);
@@ -74,6 +96,91 @@ public class ZrzysiteCommonServiceImpl implements IZrzysiteCommonService {
     private final SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.YYYY_MM_DD);
 
 
+
+
+    /**
+     * 1手动引入所有的前序图形
+     * 2手动引入所有的前序图形(方法作废,因为,当前三个节点,都是复用的首次登记的图形,这里没有自己的图形)
+     *
+     * @param nodeTableName
+     */
+    public void introducePrecedingShip(String nodeTableName) {
+        List<Map<String,String>>  nodeInfoList = jsgcghxkMapper.getNoShipNode(nodeTableName);
+        if(CollectionUtils.isEmpty(nodeInfoList)){
+            return;
+        }
+        for(Map<String,String>  nodeInfo : nodeInfoList){
+            String projectId = nodeInfo.get("projectId");
+            String nodeId =  nodeInfo.get("id");
+            String preTableName = "";
+
+            if(AloneWorkFlowEnum.NODE_4.getName().equalsIgnoreCase(nodeTableName)){
+                preTableName = AloneWorkFlowEnum.NODE_3.getName();
+            }else if(AloneWorkFlowEnum.NODE_5.getName().equalsIgnoreCase(nodeTableName)){
+                preTableName = AloneWorkFlowEnum.NODE_4.getName();
+            }else if(AloneWorkFlowEnum.NODE_6.getName().equalsIgnoreCase(nodeTableName)){
+                preTableName = AloneWorkFlowEnum.NODE_5.getName();
+            }
+            if(StringUtils.isNotBlank(preTableName)){
+                Map<String, Object> geomInfo = nodeLandService.getGeomByProjectAndNodeTable(projectId, preTableName);
+                if(MapUtils.isNotEmpty(geomInfo) && geomInfo.containsKey("geomDbId") ){
+                    String geomDbId = String.valueOf(geomInfo.get("geomDbId"));
+                    if(StringUtils.isNotBlank(geomDbId)){
+                        //这里引入前序节点图形
+                        nodeLandService.createNodeLand(nodeId, geomDbId);
+                        log.info("引入前序节点成功----projectId:{},tableName:{}",projectId,preTableName);
+                    }
+                }
+            }
+        }
+    }
+
+
+
+    /**
+     *
+     *  同步后的数据,更新批量上链,
+     * @param nodeTableName
+     */
+    @Override
+    public void batchUpdateOnChina(String nodeTableName) {
+        List<Map<String,String>>  nodeInfoList = jsgcghxkMapper.getNoOnchainNodeList(nodeTableName);
+        if(CollectionUtils.isEmpty(nodeInfoList)){
+            return;
+        }
+        for(Map<String,String>  nodeInfo : nodeInfoList){
+            String projectId = nodeInfo.get("project_id");
+            String nodeId =  nodeInfo.get("id");
+            String preTableName = "t_gyjsydscdj"; //流程都是引入的当前节点矢量
+            //这里更新上链
+            Map<String, Object> geomInfo = nodeLandService.getGeomByProjectAndNodeTable(projectId, preTableName);
+            if(MapUtils.isNotEmpty(geomInfo) && geomInfo.containsKey("geomDbId") ){
+                String geomDbId = String.valueOf(geomInfo.get("geomDbId"));
+                if(StringUtils.isNotBlank(geomDbId)){
+                    //是否要判断,当前节点已经填充了数据,不做判断,因为如果已经同步过来的数据以同步为准。
+                    // 这里根据不同的表名称,获取不动的service;
+                    if(AloneWorkFlowEnum.NODE_4.getTableName().equalsIgnoreCase(nodeTableName)){
+                        jsydghxkService.updateHasOnchain(nodeId,true);
+                    }else if(AloneWorkFlowEnum.NODE_5.getTableName().equalsIgnoreCase(nodeTableName)){
+                        jsgcghxkService.updateHasOnchain(nodeId,true);
+                    }else if(AloneWorkFlowEnum.NODE_6.getTableName().equalsIgnoreCase(nodeTableName)){
+                        tdhyhsService.updateHasOnchain(nodeId,true);
+                    }
+                    // 更新项目表的上链数量
+                    projectService.countOnChinaNum(projectId);
+                    //这里生成资源吗
+                    landOneCodeService.addOrUpdateLandOneCodeInfo(projectId, nodeId);
+                    log.info("当前节点上链成功----nodeId:{},tableName:{}",nodeId,nodeTableName);
+                }
+            }
+        }
+    }
+
+
+
+
+
+
     /**
      * 手动同步当前环节数据
      * @param projectId