|
|
@@ -1,9 +1,21 @@
|
|
|
package com.siwei.apply.service.impl;
|
|
|
|
|
|
import com.siwei.apply.domain.NodeAttachment;
|
|
|
+import com.siwei.apply.domain.Project;
|
|
|
+import com.siwei.apply.domain.ProjectWorkflow;
|
|
|
+import com.siwei.apply.domain.res.TdgyRes;
|
|
|
+import com.siwei.apply.enums.*;
|
|
|
import com.siwei.apply.mapper.NodeAttachmentMapper;
|
|
|
+import com.siwei.apply.mapper.ProjectMapper;
|
|
|
+import com.siwei.apply.mapper.ProjectWorkflowMapper;
|
|
|
import com.siwei.apply.service.NodeAttachmentService;
|
|
|
+import com.siwei.apply.service.TdgyService;
|
|
|
import com.siwei.apply.utils.FileExtractUtil;
|
|
|
+import com.siwei.apply.utils.ServiceUtil;
|
|
|
+import com.siwei.common.core.domain.R;
|
|
|
+import com.siwei.common.core.exception.ServiceException;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -13,6 +25,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.nio.file.*;
|
|
|
import java.util.*;
|
|
|
|
|
|
+import static com.siwei.apply.utils.ServiceUtil.assemblyAttachment;
|
|
|
+
|
|
|
/**
|
|
|
* 记录流程对应的附件材料 服务实现类
|
|
|
*/
|
|
|
@@ -24,6 +38,15 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
|
|
|
@Autowired
|
|
|
private NodeAttachmentMapper nodeAttachmentMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ProjectWorkflowMapper projectWorkflowMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ProjectMapper projectMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TdgyService tdgyService;
|
|
|
+
|
|
|
/**
|
|
|
* 根据ID查询附件信息
|
|
|
* @param id 附件ID
|
|
|
@@ -275,5 +298,109 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据节点ID获取当前节点的附件信息
|
|
|
+ * 这里需要合并依赖关系的附件资料引用复用等
|
|
|
+ * @param nodeId 节点ID
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ *
|
|
|
+ * 1.先判断,当前节点是否存在引用关系。
|
|
|
+ * 2.如果不存在直接返回。
|
|
|
+ * 3.查询出当前节点信息,解析object对象
|
|
|
+ * 4.如果存在引用关系,查询出所有被引用节点的附件信息
|
|
|
+ * 5.重新组装object信息并且生成json对象展示。
|
|
|
+ *
|
|
|
+ * 找到当前枚举类,
|
|
|
+ * 查看其依赖关系
|
|
|
+ * 根据依赖关系把其它数据进行整理。
|
|
|
+ *
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public NodeAttachment getNodeAttachmentData(String nodeId) {
|
|
|
+ try {
|
|
|
+ NodeAttachment nodeAttachment = this.getByNodeId(nodeId);
|
|
|
+ ProjectWorkflow projectWorkflow = null;
|
|
|
+ //根据节点获取表名
|
|
|
+ List<ProjectWorkflow> projectWorkflowList = projectWorkflowMapper.selectByNodeId(nodeId,null);
|
|
|
+ if(CollectionUtils.isNotEmpty(projectWorkflowList) && Objects.nonNull(projectWorkflowList.get(0))) {
|
|
|
+ projectWorkflow = projectWorkflowList.get(0);
|
|
|
+ }
|
|
|
+ if(Objects.isNull(projectWorkflow)) {
|
|
|
+ throw new ServiceException("未查询到节点对应的流程信息,nodeId: " + nodeId);
|
|
|
+ }
|
|
|
+ String nodeTableName = projectWorkflow.getNodeTableName();
|
|
|
+ Project project =projectMapper.get(projectWorkflow.getProjectId());
|
|
|
+ Integer projectType = project.getProjectType();
|
|
|
+
|
|
|
+ //最终结果集合
|
|
|
+ Map <String, List<String>> currentNodeAttachmentMap = new LinkedHashMap<>();
|
|
|
+ Map <String, List<String>> relationNodeAttachmentMap = new LinkedHashMap<>();
|
|
|
+
|
|
|
+ //单独选址
|
|
|
+ if(ProjectType.ALONE.getCode().equals(String.valueOf(projectType))){
|
|
|
+ nodeTableName = "t_ydbp";
|
|
|
+ }else if(ProjectType.BATCH.getCode().equals(String.valueOf(projectType))){
|
|
|
+ if(AloneWorkFlowEnum.NODE_2.getTableName().equalsIgnoreCase(nodeTableName)){
|
|
|
+ //规划条件,用地红线出具:查找所有的批次报批节点进行合并
|
|
|
+ //取当前节点数据内容;
|
|
|
+ TdgyRes tdgy = tdgyService.getById(nodeId);
|
|
|
+ String gdType = tdgy.getGdType();
|
|
|
+ if("出让".equals(gdType)) {
|
|
|
+ //处理-规划条件出具依赖
|
|
|
+ currentNodeAttachmentMap = ServiceUtil.assemblyAttachment(TdgyAttachmentNameEnum.NAME_2,currentNodeAttachmentMap,relationNodeAttachmentMap);
|
|
|
+ //处理-出让图形依赖
|
|
|
+ relationNodeAttachmentMap = new LinkedHashMap<>();
|
|
|
+ currentNodeAttachmentMap = ServiceUtil.assemblyAttachment(TdgyAttachmentNameEnum.NAME_3,currentNodeAttachmentMap,relationNodeAttachmentMap);
|
|
|
+
|
|
|
+ }else if("划拨".equals(gdType)) {
|
|
|
+
|
|
|
+ }
|
|
|
+ } else if(AloneWorkFlowEnum.NODE_3.getTableName().equalsIgnoreCase(nodeTableName)){
|
|
|
+ //处理-规划条件出具依赖
|
|
|
+ relationNodeAttachmentMap = new LinkedHashMap<>();
|
|
|
+ currentNodeAttachmentMap = ServiceUtil.assemblyAttachment(GyjsydscdjAttachmentNameEnum.NAME_2,currentNodeAttachmentMap,relationNodeAttachmentMap);
|
|
|
+
|
|
|
+ relationNodeAttachmentMap = new LinkedHashMap<>();
|
|
|
+ currentNodeAttachmentMap = ServiceUtil.assemblyAttachment(GyjsydscdjAttachmentNameEnum.NAME_3,currentNodeAttachmentMap,relationNodeAttachmentMap);
|
|
|
+
|
|
|
+ relationNodeAttachmentMap = new LinkedHashMap<>();
|
|
|
+ currentNodeAttachmentMap = ServiceUtil.assemblyAttachment(GyjsydscdjAttachmentNameEnum.NAME_4,currentNodeAttachmentMap,relationNodeAttachmentMap);
|
|
|
+
|
|
|
+ } else if(AloneWorkFlowEnum.NODE_4.getTableName().equalsIgnoreCase(nodeTableName)){
|
|
|
+ //处理-规划条件出具依赖
|
|
|
+ relationNodeAttachmentMap = new LinkedHashMap<>();
|
|
|
+ currentNodeAttachmentMap = ServiceUtil.assemblyAttachment(JsydghxkAttachmentNameEnum.NAME_3,currentNodeAttachmentMap,relationNodeAttachmentMap);
|
|
|
+
|
|
|
+ } else if(AloneWorkFlowEnum.NODE_5.getTableName().equalsIgnoreCase(nodeTableName)){
|
|
|
+ //处理-规划条件出具依赖
|
|
|
+ relationNodeAttachmentMap = new LinkedHashMap<>();
|
|
|
+ currentNodeAttachmentMap = ServiceUtil.assemblyAttachment(JsgcghxkAttachmentNameEnum.NAME_2,currentNodeAttachmentMap,relationNodeAttachmentMap);
|
|
|
+
|
|
|
+ } else if(AloneWorkFlowEnum.NODE_6.getTableName().equalsIgnoreCase(nodeTableName)){
|
|
|
+ //处理-规划条件出具依赖
|
|
|
+ relationNodeAttachmentMap = new LinkedHashMap<>();
|
|
|
+ currentNodeAttachmentMap = ServiceUtil.assemblyAttachment(TdhyhsAttachmentNameEnum.NAME_2,currentNodeAttachmentMap,relationNodeAttachmentMap);
|
|
|
+ }else if(AloneWorkFlowEnum.NODE_7.getTableName().equalsIgnoreCase(nodeTableName)){
|
|
|
+ //处理-规划条件出具依赖
|
|
|
+ relationNodeAttachmentMap = new LinkedHashMap<>();
|
|
|
+ currentNodeAttachmentMap = ServiceUtil.assemblyAttachment(GyjsydjfwscdjAttachmentNameEnum.NAME_1,currentNodeAttachmentMap,relationNodeAttachmentMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return null;
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("查询节点附件信息异常,nodeId: {}", nodeId, e);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|