|
|
@@ -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(()->{
|