Browse Source

Merge branch 'dev' of http://219.151.181.73:3000/zhuwei/bladex into dev

laibulaizheli 1 month ago
parent
commit
a5dee77ce8

+ 1 - 1
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/vo/ArchivesAutoVO.java

@@ -236,7 +236,7 @@ public class ArchivesAutoVO extends ArchivesAuto {
 
 		private  String archiveId;
 
-		private Long id;
+		private String id;
 		private Long fileSize;
 		private Integer isElement;
 	}

+ 8 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/ArchiveFile.java

@@ -422,4 +422,12 @@ public class ArchiveFile extends BaseEntity {
         this.setIsDeleted(0);
 
     }
+
+    public void setFileTime(String fileTime) {
+        if (fileTime == null || fileTime.equals("null") ) {
+            this.fileTime = "";
+            return;
+        }
+        this.fileTime = fileTime.replaceAll("[^0-9]", "");
+    }
 }

+ 9 - 2
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveFileController.java

@@ -417,8 +417,15 @@ public class ArchiveFileController extends BladeController {
     @GetMapping("/getMetadataFile")
     @ApiOperationSupport(order = 16)
     @ApiOperation(value = "文件收集-上传文件责任者")
-    public R getMetadataFile(Long fileId) {
-        return R.data(metadataClassificationClient.getMetadataFile(fileId));
+    public R getMetadataFile(String fileId) {
+        long id;
+        try  {
+            fileId = fileId.split("_")[0];
+            id = Long.parseLong(fileId);
+        } catch (Exception e) {
+            return R.data(null);
+        }
+        return R.data(metadataClassificationClient.getMetadataFile(id));
     }
 
     /**

+ 9 - 2
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveInspectionInfoController.java

@@ -97,9 +97,16 @@ public class ArchiveInspectionInfoController {
     @GetMapping("/opinion")
     @ApiOperationSupport(order = 6)
     @ApiOperation(value = "获取抽检意见", notes = "传入fileId")
-    public R<ArchiveInspectionDTO> getOpinion(@RequestParam Long fileId) {
+    public R<ArchiveInspectionDTO> getOpinion(@RequestParam String fileId) {
         Long userId = AuthUtil.getUserId();
-        ArchiveInspectionDTO archiveInspectionDTO = archiveInspectionService.getbyFileId(fileId, userId);
+        long id;
+        try  {
+            fileId = fileId.split("_")[0];
+            id = Long.parseLong(fileId);
+        } catch (Exception e) {
+            return R.data(null);
+        }
+        ArchiveInspectionDTO archiveInspectionDTO = archiveInspectionService.getbyFileId(id, userId);
         return R.data(archiveInspectionDTO);
     }
 

+ 84 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java

@@ -383,6 +383,90 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 		} else {
 			vo.setPageNumber(0);
 		}
+		String outUrl = vo.getOutUrl();
+		if (StringUtils.isNotBlank(outUrl)) {
+			// 根据 factorType 字符串生成档案号码字符串链表
+			ArchiveProjectConfig config = archiveProjectConfigService.getByProjectIdOrNew(vo.getProjectId());
+			String[] frontUrls = outUrl.split(",");
+			ArchivesAutoVO.ApprovalFile front = new ArchivesAutoVO.ApprovalFile();
+			ArchivesAutoVO.ApprovalFile cataLog = new ArchivesAutoVO.ApprovalFile();
+			ArchivesAutoVO.ApprovalFile spare = new ArchivesAutoVO.ApprovalFile();
+			ArchivesAutoVO.ApprovalFile back = new ArchivesAutoVO.ApprovalFile();
+			for (String frontUrl : frontUrls) {
+				// 封面(原r_Archives_front)增加中文"封面"匹配
+				if ((frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[0])
+						|| frontUrl.contains("封面"))
+						&& config.getFactorType().contains("1")) {
+					front.setFileName("封面");
+					if(frontUrl.contains("@@@")){
+						front.setFileUrl(frontUrl.substring(0,frontUrl.indexOf("@@@")));
+					}else {
+						front.setFileUrl(frontUrl);
+					}
+				}
+				// 卷内目录(原r_Archives_catalog)增加中文匹配
+				else if ((frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[1])
+						|| frontUrl.contains("卷内目录"))
+						&& config.getFactorType().contains("2")) {
+					cataLog.setFileName("卷内目录");
+					if(frontUrl.contains("@@@")){
+						cataLog.setFileUrl(frontUrl.substring(0,frontUrl.indexOf("@@@")));
+					}else {
+						cataLog.setFileUrl(frontUrl);
+					}
+				}
+				// 备考表(原r_Archives_spare)增加中文匹配
+				else if ((frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[2])
+						|| frontUrl.contains("备考表"))
+						&& config.getFactorType().contains("3")) {
+					spare.setFileName("备考表");
+					if(frontUrl.contains("@@@")){
+						spare.setFileUrl(frontUrl.substring(0,frontUrl.indexOf("@@@")));
+					}else {
+						spare.setFileUrl(frontUrl);
+					}
+				}
+				// 背脊(原r_Archives_back)增加中文匹配
+				else if ((frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[3])
+						|| frontUrl.contains("背脊"))
+						&& config.getFactorType().contains("4")) {
+					back.setFileName("背脊");
+					if(frontUrl.contains("@@@")){
+						back.setFileUrl(frontUrl.substring(0,frontUrl.indexOf("@@@")));
+					}else {
+						back.setFileUrl(frontUrl);
+					}
+				}
+			}
+			List<ArchivesAutoVO.ApprovalFile> files = vo.getApprovalFileList();
+			if (files != null && !files.isEmpty()) {
+				ArchivesAutoVO.ApprovalFile temp = files.get(0);
+				if (front.getFileUrl() != null) {
+					front.setId(temp.getId() + "_1");
+					front.setPdfFileUrl(front.getFileUrl());
+					files.add(0,front);
+				}
+				if (cataLog.getFileUrl() != null) {
+					cataLog.setId(temp.getId()  + "_2");
+					cataLog.setPdfFileUrl(cataLog.getFileUrl());
+					if (front.getFileUrl() != null) {
+						files.add(1,cataLog);
+					} else {
+						files.add(0,cataLog);
+					}
+				}
+				if (spare.getFileUrl() != null) {
+					spare.setId(temp.getId()  + "_3");
+					spare.setPdfFileUrl(spare.getFileUrl());
+					files.add(spare);
+				}
+				if (back.getFileUrl() != null) {
+					back.setId(temp.getId()  + "_4");
+					back.setPdfFileUrl(back.getFileUrl());
+					files.add(back);
+				}
+			}
+		}
 		return vo;
 	}
 

+ 11 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeController.java

@@ -532,6 +532,17 @@ public class WbsTreeController extends BladeController {
         return R.data(result);
     }
 
+    /**
+     * 根据节点类型,内业资料类型查询节点数据
+     */
+    @GetMapping("/getQueryValueByNodeType")
+    @ApiOperationSupport(order = 21)
+    @ApiOperation(value = "根据节点类型,内业资料类型查询节点数据", notes = "传入wbsId、projectId、nodeType、majorDataType")
+    public Object getQueryValueByNodeType(@RequestParam String wbsId, @RequestParam String projectId, @RequestParam String queryValue, @RequestParam(required = false,defaultValue = "6") Integer nodeType, @RequestParam(required = false, defaultValue = "-1") Integer majorDataType) {
+        Object result = wbsTreeService.getQueryValueByNodeType(wbsId, projectId, queryValue, nodeType, majorDataType);
+        return R.data(result);
+    }
+
     @GetMapping("setContractIsPid")
     public void setContractIsPid(){
         //为合同段节点没有设置is_pid的字段设置isPid

+ 2 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreeService.java

@@ -6,12 +6,9 @@ import org.springblade.core.tool.api.R;
 import org.springblade.manager.dto.FormElementDTO;
 import org.springblade.manager.dto.WbsTreeContractDTO;
 import org.springblade.manager.dto.WbsTreeDTO2;
-import org.springblade.manager.entity.TableInfo;
-import org.springblade.manager.entity.WbsFormElement;
 import org.springblade.manager.entity.WbsTree;
 import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.vo.*;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
@@ -82,4 +79,6 @@ public interface IWbsTreeService extends BaseService<WbsTree> {
     Object getQueryValueByType(String queryValue, String wbsId, String projectId, String type);
 
     List<WbsTreePrivate> getTitleRange(String projectId);
+
+    Object getQueryValueByNodeType(String wbsId, String projectId, String queryValue, Integer nodeType, Integer majorDataType);
 }

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArchiveTreeContractSyncImpl.java

@@ -597,7 +597,7 @@ public class ArchiveTreeContractSyncImpl {
                     else  if ( (info.getNodePdfUrl() != null && !info.getNodePdfUrl().equals(archiveFile.getPdfFileUrl()))
                                 || (sort != null && !sort.equals(archiveFile.getSort()))
                                 || (nodeId != null && !nodeId.toString().equals(archiveFile.getNodeId()))
-                                || (StringUtils.isNotEmpty(info.getBusinessTime() ) && !info.getBusinessTime().equals(archiveFile.getFileTime()))
+                                || (StringUtils.isNotEmpty(info.getBusinessTime() ) && !info.getBusinessTime().replaceAll("[^0-9]", "").equals(archiveFile.getFileTime()))
                                 || (info.getEVisaPdfSize()!= null && info.getEVisaPdfSize() > 0L && !info.getEVisaPdfSize().equals(archiveFile.getFileSize()))
                     ) {
 

+ 30 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeServiceImpl.java

@@ -1,13 +1,12 @@
 package org.springblade.manager.service.impl;
 
 import cn.hutool.core.date.DateTime;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.google.common.collect.Lists;
-import jodd.util.ArraysUtil;
 import lombok.AllArgsConstructor;
-import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
 import org.springblade.common.utils.FileUtils;
 import org.springblade.common.utils.SnowFlakeUtil;
@@ -41,7 +40,6 @@ import org.springframework.web.multipart.MultipartFile;
 import java.io.File;
 import java.io.IOException;
 import java.util.*;
-import java.util.function.Function;
 import java.util.stream.Collectors;
 
 @Service
@@ -558,6 +556,35 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
         return this.baseMapper.getTitleRange(Long.valueOf(projectId));
     }
 
+    @Override
+    public Object getQueryValueByNodeType(String wbsId, String projectId, String queryValue, Integer nodeType, Integer majorDataType) {
+        Set<WbsTreePrivate> resultNodes = new HashSet<>();
+        LambdaQueryWrapper<WbsTreePrivate> wrapper = Wrappers.<WbsTreePrivate>lambdaQuery()
+                .eq(WbsTreePrivate::getType, 1).eq(WbsTreePrivate::getWbsId, wbsId).eq(WbsTreePrivate::getProjectId, projectId).eq(WbsTreePrivate::getNodeType, nodeType);
+        if (majorDataType != null) {
+            if (majorDataType > 0) {
+                wrapper.eq(WbsTreePrivate::getMajorDataType, majorDataType);
+            } else if (majorDataType == -1) {
+                wrapper.and(wrapper1 -> wrapper1.isNull(WbsTreePrivate::getMajorDataType).or().eq(WbsTreePrivate::getMajorDataType, 0));
+            }
+        }
+        if (queryValue != null && !queryValue.trim().isEmpty()) {
+            wrapper.like(WbsTreePrivate::getNodeName, queryValue);
+        }
+        List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateMapper.selectList(wrapper);
+        this.getParentNodesPrivateWbs(wbsTreePrivates, resultNodes, projectId, wbsId);
+        resultNodes.addAll(wbsTreePrivates);
+        List<WbsTreePrivateQueryValueVO> wbsTreePrivateQueryValueVOS = BeanUtil.copyProperties(resultNodes, WbsTreePrivateQueryValueVO.class);
+        if (wbsTreePrivateQueryValueVOS.size() > 0) {
+            List<WbsTreePrivateQueryValueVO> listRoot = wbsTreePrivateQueryValueVOS.stream().filter(f -> f.getParentId() == 0L).collect(Collectors.toList());
+            Map<Long, List<WbsTreePrivateQueryValueVO>> mapAll = wbsTreePrivateQueryValueVOS.stream().collect(Collectors.groupingBy(WbsTreePrivateQueryValueVO::getParentId));
+            this.buildWbsTreePrivateByGetQueryValueByType(listRoot, mapAll);
+            this.sortListPrivate(listRoot);
+            return listRoot;
+        }
+        return null;
+    }
+
     /**
      * 公有排序
      */