|
|
@@ -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
|