1
0
DESKTOP-2K9OVK9\siwei 3 недель назад
Родитель
Сommit
e4c37982e7

+ 6 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/ProjectMapper.java

@@ -96,4 +96,10 @@ public interface ProjectMapper {
 
 
 
+    String getNodeSourceIdByTable(@Param("nodeId")String nodeId,@Param("tableName") String tableName);
+
+
+
+
+
 }

+ 17 - 8
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/NodeAttachmentImpl.java

@@ -448,16 +448,25 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
                     nodeAttachment = this.assemblyAttachment(projectId,GyjsydscdjAttachmentNameEnum.NAME_3,nodeAttachment);
                     nodeAttachment = this.assemblyAttachment(projectId,GyjsydscdjAttachmentNameEnum.NAME_4,nodeAttachment);
                 } else if(AloneWorkFlowEnum.NODE_4.getTableName().equalsIgnoreCase(nodeTableName)){
-                    nodeAttachment = this.assemblyAttachment(projectId,JsydghxkAttachmentNameEnum.NAME_3,nodeAttachment);
-                    nodeAttachment = this.assemblyAttachment(projectId,JsydghxkAttachmentNameEnum.NAME_4,nodeAttachment);
-                    nodeAttachment = this.assemblyAttachment(projectId,JsydghxkAttachmentNameEnum.NAME_5,nodeAttachment);
+                    String sourceId =  projectMapper.getNodeSourceIdByTable(nodeId,nodeTableName);
+                    if(StringUtils.isBlank(sourceId)){
+                        nodeAttachment = this.assemblyAttachment(projectId,JsydghxkAttachmentNameEnum.NAME_3,nodeAttachment);
+                        nodeAttachment = this.assemblyAttachment(projectId,JsydghxkAttachmentNameEnum.NAME_4,nodeAttachment);
+                        nodeAttachment = this.assemblyAttachment(projectId,JsydghxkAttachmentNameEnum.NAME_5,nodeAttachment);
+                    }
                 }else if(AloneWorkFlowEnum.NODE_5.getTableName().equalsIgnoreCase(nodeTableName)){
-                    nodeAttachment = this.assemblyAttachment(projectId,JsgcghxkAttachmentNameEnum.NAME_2,nodeAttachment);
-                    nodeAttachment = this.assemblyAttachment(projectId,JsgcghxkAttachmentNameEnum.NAME_3,nodeAttachment);
-                    nodeAttachment = this.assemblyAttachment(projectId,JsgcghxkAttachmentNameEnum.NAME_5,nodeAttachment);
+                    String sourceId =  projectMapper.getNodeSourceIdByTable(nodeId,nodeTableName);
+                    if(StringUtils.isBlank(sourceId)) {
+                        nodeAttachment = this.assemblyAttachment(projectId, JsgcghxkAttachmentNameEnum.NAME_2, nodeAttachment);
+                        nodeAttachment = this.assemblyAttachment(projectId, JsgcghxkAttachmentNameEnum.NAME_3, nodeAttachment);
+                        nodeAttachment = this.assemblyAttachment(projectId, JsgcghxkAttachmentNameEnum.NAME_5, nodeAttachment);
+                    }
                 }else if(AloneWorkFlowEnum.NODE_6.getTableName().equalsIgnoreCase(nodeTableName)){
-                    nodeAttachment = this.assemblyAttachment(projectId,TdhyhsAttachmentNameEnum.NAME_3,nodeAttachment);
-                    nodeAttachment = this.assemblyAttachment(projectId,TdhyhsAttachmentNameEnum.NAME_5,nodeAttachment);
+                    String sourceId =  projectMapper.getNodeSourceIdByTable(nodeId,nodeTableName);
+                    if(StringUtils.isBlank(sourceId)) {
+                        nodeAttachment = this.assemblyAttachment(projectId, TdhyhsAttachmentNameEnum.NAME_3, nodeAttachment);
+                        nodeAttachment = this.assemblyAttachment(projectId, TdhyhsAttachmentNameEnum.NAME_5, nodeAttachment);
+                    }
                 }else if(AloneWorkFlowEnum.NODE_7.getTableName().equalsIgnoreCase(nodeTableName)){
                     nodeAttachment = this.assemblyAttachment(projectId,GyjsydjfwscdjAttachmentNameEnum.NAME_1,nodeAttachment);
                     nodeAttachment = this.assemblyAttachment(projectId,GyjsydjfwscdjAttachmentNameEnum.NAME_2,nodeAttachment);

+ 7 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/ProjectMapper.xml

@@ -814,6 +814,13 @@
         WHERE id = #{nodeId}
     </delete>
 
+
+    <select id="getNodeSourceIdByTable"   resultType="string" >
+        SELECT source_id FROM ${tableName}
+        WHERE id = #{nodeId}
+    </select>
+
+
     <!-- 1.查询项目代码存在的所有项目,并且工程建设环节无新增数据的条数。2.查询当前环节已经新增数据但是未上链并且未同步过的数据(source_id-同步数据id)) -->
     <select id="getZrzysiteProjectList" resultMap="projectMap">
         SELECT    p.id,p.name,p.code ,p.project_type,  '1'  as creator_id