1
0
فهرست منبع

调整划拨相关问题

chenendian 2 ماه پیش
والد
کامیت
61ff20c146

+ 12 - 4
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/NodeAttachmentController.java

@@ -3,6 +3,7 @@ package com.siwei.apply.controller;
 import com.siwei.apply.domain.NodeAttachment;
 import com.siwei.apply.domain.ProjectWorkflow;
 import com.siwei.apply.domain.res.TdgyRes;
+import com.siwei.apply.enums.AloneWorkFlowEnum;
 import com.siwei.apply.service.NodeAttachmentService;
 import com.siwei.apply.service.ProjectService;
 import com.siwei.apply.service.TdgyService;
@@ -55,7 +56,14 @@ public class NodeAttachmentController extends BaseController {
                 return R.fail("nodeId不能为空");
             }
             ProjectWorkflow projectWorkflow = projectService.getProjectWorkflowByNodeId(projectId,nodeId);
-            String id = nodeAttachmentService.processFileAndSave(filePath,projectWorkflow.getNodeTableName());
+
+            String gdType = "";
+            if(AloneWorkFlowEnum.NODE_2.getTableName().equals(projectWorkflow.getNodeTableName())){
+                TdgyRes tdgy = tdgyService.getById(nodeId);
+                gdType = tdgy.getGdType();
+                gdType= "出让".equals(gdType) ? "1" : "划拨".equals(gdType)? "2":"1";
+            }
+            String id = nodeAttachmentService.processFileAndSave(filePath,projectWorkflow.getNodeTableName(),gdType);
 
             if (id != null) {
                 Map<String, String> responseData = new HashMap<>();
@@ -264,7 +272,7 @@ public class NodeAttachmentController extends BaseController {
             NodeAttachment nodeAttachment = nodeAttachmentService.getByNodeId(nodeId);
             //增加一条空目录结构
             if (Objects.isNull(nodeAttachment)) {
-                nodeAttachmentService.addDefaultAttachment(projectId, nodeId);
+                nodeAttachmentService.addDefaultAttachment(projectId, nodeId,"1");
             }
             //这里重新获取依赖关系
             nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId,null);
@@ -304,14 +312,14 @@ public class NodeAttachmentController extends BaseController {
                     nodeAttachment = nodeAttachmentService.getByNodeId(nodeId);
                     //增加一条空目录结构
                     if (Objects.isNull(nodeAttachment)) {
-                        nodeAttachmentService.addDefaultAttachment(projectId, nodeId);
+                        nodeAttachmentService.addDefaultAttachment(projectId, nodeId,gdType);
                     }
                     //这里重新获取依赖关系
                     nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId,gdType);
                 }else {
                     //1.先删除当前节点
                     nodeAttachmentService.deleteByNodeId(nodeId);
-                    nodeAttachmentService.addDefaultAttachment(projectId, nodeId);
+                    nodeAttachmentService.addDefaultAttachment(projectId,nodeId,gdType);
                     //这里重新获取依赖关系
                     nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId,gdType);
                 }

+ 6 - 7
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/enums/RegistrationProcessType.java

@@ -9,13 +9,12 @@ public enum RegistrationProcessType {
     Registration02(2,"02", "规划条件与用地红线出具","t_tjyydhx"),
     Registration03(3,"03", "用地报批","t_ydbp"),
     Registration04(4,"04", "土地供应","t_tdgy"),
-    Registration05(5,"05", "建设用地规划许可","t_jsydghxk"),
-    Registration06(6,"05", "建设工程规划许可","t_jsgcghxk"),
-    Registration07(7,"06", "土地核验与规划核实","t_tdhyhs");
-
-    //    Registration10(100,"00", "全部办结","");
-    //Registration05(5,"05", "国有建设用地使用权首次登记","t_gyjsydscdj"),
-    //Registration09(9,"09", "国有建设用地使用权及房屋所有权首次登记","t_gyjsydjfwscdj"),
+    Registration05(5,"05", "国有建设用地使用权及房屋所有权首次登记","t_gyjsydjfwscdj"),
+    Registration06(6,"06", "建设用地规划许可","t_jsydghxk"),
+    Registration07(7,"07", "建设工程规划许可","t_jsgcghxk"),
+    Registration08(8,"08", "土地核验与规划核实","t_tdhyhs"),
+    Registration09(9,"09", "国有建设用地使用权及房屋所有权首次登记","t_gyjsydjfwscdj"),
+    Registration10(10,"10", "全部办结","");
 
     private final Integer index;
     private final String name;

+ 1 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/enums/TdgyAttachmentNameEnum.java

@@ -8,7 +8,7 @@ import com.siwei.apply.common.UnifyAttachmentEnum;
  */
 public enum TdgyAttachmentNameEnum implements UnifyAttachmentEnum {
     NAME_1("1", "土地权属来源文件", "用地批复:t_ydbp", "土地供应阶段"),
-    NAME_1_B("1", "土地权属来源文件", "用地批复:t_ydbp_data", "土地供应阶段"),
+    NAME_1_B("1.1", "土地权属来源文件", "用地批复:t_ydbp_data", "土地供应阶段"),
     NAME_2("2", "规划条件出具", "用地红线:t_tjyydhx|规划条件出具:t_tjyydhx", "土地供应阶段"),
     NAME_3("3", "出让图形", "用地红线:t_tjyydhx", "土地供应阶段"),
     NAME_4("4", "出让方案批复文件", "", "土地供应阶段"),

+ 2 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/NodeAttachmentService.java

@@ -32,7 +32,7 @@ public interface NodeAttachmentService {
      * @param filePath 文件路径
      * @return 数据库存储后的id
      */
-    String processFileAndSave(String filePath,String nodeTableName);
+    String processFileAndSave(String filePath,String nodeTableName,String gdType);
     
     /**
      * 删除节点附件信息
@@ -58,7 +58,7 @@ public interface NodeAttachmentService {
 
     NodeAttachment getAttachmentByProjectIdAndTable(String projectId,String nodeTableName) ;
 
-    String addDefaultAttachment(String projectId, String nodeId);
+    String addDefaultAttachment(String projectId, String nodeId,String gdType);
 
     String restFileAttachment(String rootPath,String nodeAttachmentId);
 

+ 53 - 37
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/NodeAttachmentImpl.java

@@ -132,7 +132,7 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public String processFileAndSave(String filePath,String nodeTableName) {
+    public String processFileAndSave(String filePath,String nodeTableName,String gdType) {
         try {
             if (filePath == null || filePath.trim().isEmpty()) {
                 logger.warn("处理文件失败:filePath不能为空");
@@ -153,7 +153,7 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
                 String extractDir = FileExtractUtil.extractToSameNameFolder(filePath);
                 if (extractDir != null) {
                     //todo 这里需要校验文件名称,如果不在枚举类中,需要删除整个目录,并且提示
-                    if(!this.validUploadZipFile(extractDir,nodeTableName)){
+                    if(!this.validUploadZipFile(extractDir,nodeTableName,gdType)){
                         //把当前解压的目录删除
                         ServiceFileUtil.deleteDirectory(extractDir);
                         throw new ServiceException("请按照固定目录名上传");
@@ -292,7 +292,7 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
      * @return
      */
     @Override
-    public String addDefaultAttachment(String projectId,String nodeId) {
+    public String addDefaultAttachment(String projectId,String nodeId,String gdType) {
         String nodeAttachmentId = null;
         String tableName = "";
         //获取当前节点表名
@@ -302,7 +302,7 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
             tableName = projectWorkflow.getNodeTableName();
             logger.info("这里获取projectWorkflow表的节点表名:{}",tableName);
             //获取枚举配置的目录信息
-            Map<String,List<String>> resultMap =  this.getCurrentAttachmentName(tableName);
+            Map<String,List<String>> resultMap =  this.getCurrentAttachmentName(tableName,gdType);
             String directoryName = resultMap.keySet().stream().findFirst().get();
             List<String> subDirectoryName = resultMap.values().stream().findFirst().get();
             String[] subDirectoryNameArr = subDirectoryName.toArray(new String[0]);
@@ -401,19 +401,40 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
                         gdType = tdgy.getGdType();
                         gdType= "出让".equals(gdType) ? "1" : "划拨".equals(gdType)? "2":"";
                     }
-                    if("1".equals(gdType)) {
-                        //处理-规划条件出具依赖
-                        nodeAttachment = this.assemblyAttachment(projectId,TdgyAttachmentNameEnum.NAME_2,nodeAttachment);
-                        //处理-出让图形依赖
-                        nodeAttachment = this.assemblyAttachment(projectId,TdgyAttachmentNameEnum.NAME_3,nodeAttachment);
-                    }else if("2".equals(gdType)) {
-                        //处理-项目批准文件
-                        nodeAttachment = this.assemblyAttachment(projectId,TdgyHbAttachmentNameEnum.NAME_1,nodeAttachment);
-                        //处理-土地权属来源文件
-                        nodeAttachment = this.assemblyAttachment(projectId,TdgyHbAttachmentNameEnum.NAME_2_B,nodeAttachment);
-                        //处理-测量报告
-                        nodeAttachment = this.assemblyAttachment(projectId,TdgyHbAttachmentNameEnum.NAME_4_B,nodeAttachment);
+
+                    // 需要区分双重条件,单独选址时候,引用批次报批的数据源不同,还需要区分出让和划拨
+                    if(ProjectType.ALONE.getCode().equals(String.valueOf(projectType))){
+                        if("1".equals(gdType)) {
+                            nodeAttachment = this.assemblyAttachment(projectId,TdgyAttachmentNameEnum.NAME_1,nodeAttachment);
+                            //处理-规划条件出具依赖
+                            nodeAttachment = this.assemblyAttachment(projectId,TdgyAttachmentNameEnum.NAME_2,nodeAttachment);
+                            //处理-出让图形依赖
+                            nodeAttachment = this.assemblyAttachment(projectId,TdgyAttachmentNameEnum.NAME_3,nodeAttachment);
+                        }else if("2".equals(gdType)) {
+                            //处理-项目批准文件
+                            nodeAttachment = this.assemblyAttachment(projectId,TdgyHbAttachmentNameEnum.NAME_1,nodeAttachment);
+                            //处理-土地权属来源文件
+                            nodeAttachment = this.assemblyAttachment(projectId,TdgyHbAttachmentNameEnum.NAME_2,nodeAttachment);
+                            //处理-测量报告
+                            nodeAttachment = this.assemblyAttachment(projectId,TdgyHbAttachmentNameEnum.NAME_4,nodeAttachment);
+                        }
+                    }else  if(ProjectType.BATCH.getCode().equals(String.valueOf(projectType))){
+                        if("1".equals(gdType)) {
+                            //处理-规划条件出具依赖
+                            nodeAttachment = this.assemblyAttachment(projectId,TdgyAttachmentNameEnum.NAME_1_B,nodeAttachment);
+                            nodeAttachment = this.assemblyAttachment(projectId,TdgyAttachmentNameEnum.NAME_2,nodeAttachment);
+                            //处理-出让图形依赖
+                            nodeAttachment = this.assemblyAttachment(projectId,TdgyAttachmentNameEnum.NAME_3,nodeAttachment);
+                        }else if("2".equals(gdType)) {
+                            //处理-项目批准文件
+                            nodeAttachment = this.assemblyAttachment(projectId,TdgyHbAttachmentNameEnum.NAME_1,nodeAttachment);
+                            //处理-土地权属来源文件
+                            nodeAttachment = this.assemblyAttachment(projectId,TdgyHbAttachmentNameEnum.NAME_2_B,nodeAttachment);
+                            //处理-测量报告
+                            nodeAttachment = this.assemblyAttachment(projectId,TdgyHbAttachmentNameEnum.NAME_4_B,nodeAttachment);
+                        }
                     }
+
                 }else if(AloneWorkFlowEnum.NODE_3.getTableName().equalsIgnoreCase(nodeTableName)){
                     //处理-主体资格文件
                     nodeAttachment = this.assemblyAttachment(projectId,GyjsydscdjAttachmentNameEnum.NAME_2,nodeAttachment);
@@ -492,22 +513,12 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
                     }
                 }//end for
             }
-
             if(CollectionUtils.isNotEmpty(currentAttachmentList)){
                 currentAttachmentList.forEach(o->o.put("physicalFlag", "0"));
+                Map<String, Object> currentNodeAttachmentMap = ServiceUtil.getDirChildrenMap(name,nodeAttachment);
+                currentNodeAttachmentMap.put("children", currentAttachmentList);
+                attachmentChildrenList.add(currentNodeAttachmentMap);
             }
-            //这里构建当前节点的附件信息
-//            Map<String, Object> currentNodeAttachmentMap = new LinkedHashMap<>();
-//            currentNodeAttachmentMap.put("name", name);
-//            currentNodeAttachmentMap.put("path", "");
-//            currentNodeAttachmentMap.put("physicalFlag", "0");
-//            currentNodeAttachmentMap.put("type", "directory");
-//            currentNodeAttachmentMap.put("children", currentAttachmentList);
-            //获取当前的节点
-            Map<String, Object> currentNodeAttachmentMap = ServiceUtil.getDirChildrenMap(name,nodeAttachment);
-            //currentNodeAttachmentMap.put("physicalFlag", "0");
-            currentNodeAttachmentMap.put("children", currentAttachmentList);
-            attachmentChildrenList.add(currentNodeAttachmentMap);
         }
         //这里构建最终的附件信息list
         attachmentMap.put("children",attachmentChildrenList);
@@ -522,7 +533,7 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
      * @param tableName
      * @return
      */
-    public Map<String,List<String>> getCurrentAttachmentName(String tableName) {
+    public Map<String,List<String>> getCurrentAttachmentName(String tableName,String gdType) {
         Map<String,List<String>> retMap = new LinkedHashMap<>();
         String parentName = "";
         List<String> nameList = null;
@@ -535,9 +546,16 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
             YdbpAttachmentNameEnum[] enumValues = YdbpAttachmentNameEnum.values();
             nameList = Arrays.stream(enumValues).map(YdbpAttachmentNameEnum::getName).collect(Collectors.toList());
         }else if(AloneWorkFlowEnum.NODE_2.getTableName().equalsIgnoreCase(tableName)){
-            parentName = TdgyAttachmentNameEnum.NAME_1.getParentName();
-            TdgyAttachmentNameEnum[] enumValues = TdgyAttachmentNameEnum.values();
-            nameList = Arrays.stream(enumValues).map(TdgyAttachmentNameEnum::getName).collect(Collectors.toList());
+            //出让 (两种类型,获取的目录结构不同,这里区分)
+            if("1".equals(gdType)){
+                parentName = YdbpAttachmentNameEnum.NAME_1.getParentName();
+                YdbpAttachmentNameEnum[] enumValues = YdbpAttachmentNameEnum.values();
+                nameList = Arrays.stream(enumValues).map(YdbpAttachmentNameEnum::getName).collect(Collectors.toList());
+            }else if("2".equals(gdType)){//划拨
+                parentName = TdgyHbAttachmentNameEnum.NAME_1.getParentName();
+                TdgyHbAttachmentNameEnum[] enumValues = TdgyHbAttachmentNameEnum.values();
+                nameList = Arrays.stream(enumValues).map(TdgyHbAttachmentNameEnum::getName).collect(Collectors.toList());
+            }
         }else if(AloneWorkFlowEnum.NODE_3.getTableName().equalsIgnoreCase(tableName)){
             parentName = GyjsydscdjAttachmentNameEnum.NAME_1.getParentName();
             GyjsydscdjAttachmentNameEnum[] enumValues = GyjsydscdjAttachmentNameEnum.values();
@@ -568,8 +586,8 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
     }
 
 
-    public  Boolean  validUploadZipFile(String uploadFilePath,String tableName){
-        Map<String,List<String>>  currentAttachmentMap =  getCurrentAttachmentName(tableName);
+    public  Boolean  validUploadZipFile(String uploadFilePath,String tableName,String gdType){
+        Map<String,List<String>>  currentAttachmentMap =  getCurrentAttachmentName(tableName,gdType);
         List<String> currentAttachmentList = currentAttachmentMap.values().stream().findFirst().get();
         boolean retFlag = true;
         try {
@@ -595,14 +613,12 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
      * 3.再次更新
      *
      *
-     *
      * 更新附件信息关联全文检索
      * @param projectId
      * @param nodeId
      * @param rootPath
      * @return
      */
-
     public  Boolean  modifyAttachmentInfo(String projectId,String nodeId,String rootPath){
         //这里使用异步方法
         CompletableFuture.supplyAsync(()->{

+ 1 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/ProjectImpl.java

@@ -324,7 +324,7 @@ public class ProjectImpl implements ProjectService {
         }
         Map<String, Object> map = new HashMap<>();
         map.put("projects", projects);
-        map.put("count", count);
+         map.put("count", count);
         map.put("attachmentCount", attachmentCount);
         map.put("graphicLayerCount", graphicLayerCount);
         return map;