From 48e850f8721a5562c2d0c23f9281f92ec1ba947a Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期一, 13 一月 2025 15:18:30 +0800
Subject: [PATCH] DNC平移航宇救生修改

---
 lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProcessController.java     |    3 ++-
 lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DocFileController.java     |   19 ++++++++++---------
 lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DocInfoController.java     |   13 +++++++------
 lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProductInfoController.java |    9 +++++----
 4 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DocFileController.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DocFileController.java
index cf3da58..f3c7b3a 100644
--- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DocFileController.java
+++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DocFileController.java
@@ -9,6 +9,7 @@
 import org.jeecg.modules.dnc.entity.DocFile;
 import org.jeecg.modules.dnc.response.*;
 import org.jeecg.modules.dnc.service.IDocFileService;
+import org.jeecg.modules.dnc.utils.ValidateUtil;
 import org.jeecg.modules.dnc.utils.file.FileUtilS;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -61,8 +62,8 @@
     @GetMapping("/preview/{id}")
     public QueryListResponseResult previewDocFile(@PathVariable("id") String id) {
         DocFile docFile = docFileService.getById(id);
-        if(!StrUtil.isEmpty(docFile.getFilePath()) || !StrUtil.isEmpty(docFile.getFileName()) ||
-                /*!StrUtil.isEmpty(docFile.getFileSuffix()) ||*/ !StrUtil.isEmpty(docFile.getFileEncodeName()))
+        if(!ValidateUtil.validateString(docFile.getFilePath()) || !ValidateUtil.validateString(docFile.getFileName()) ||
+                /*!ValidateUtil.validateString(docFile.getFileSuffix()) ||*/ !ValidateUtil.validateString(docFile.getFileEncodeName()))
             return new QueryListResponseResult(CommonCode.FAIL, null);
         String filePath = docFile.getFilePath();
         String fileEncodeName = docFile.getFileEncodeName();
@@ -77,11 +78,11 @@
     @GetMapping("/preview/pdf/{id}")
     public ResponseResult previewPdfDocFile(HttpServletRequest request, HttpServletResponse response, @PathVariable("id") String id) {
         DocFile docFile = docFileService.getById(id);
-        if(!StrUtil.isEmpty(docFile.getFilePath()) || !StrUtil.isEmpty(docFile.getFileName()) ||
-                /*!StrUtil.isEmpty(docFile.getFileSuffix()) ||*/ !StrUtil.isEmpty(docFile.getFileEncodeName()))
+        if(!ValidateUtil.validateString(docFile.getFilePath()) || !ValidateUtil.validateString(docFile.getFileName()) ||
+                /*!ValidateUtil.validateString(docFile.getFileSuffix()) ||*/ !ValidateUtil.validateString(docFile.getFileEncodeName()))
             return new ResponseResult(CommonCode.FAIL);
         String fileName;
-        if(StrUtil.isEmpty(docFile.getFileSuffix())) {
+        if(ValidateUtil.validateString(docFile.getFileSuffix())) {
             fileName = docFile.getFileName() + "." + docFile.getFileSuffix();
         }else {
             fileName = docFile.getFileName();
@@ -97,12 +98,12 @@
     @GetMapping("/comparison/{firstFileId}/{secondFileId}")
     public DataResponseResult<ComparisonFilesResponse> comparisonFileDiff(@PathVariable("firstFileId") String firstFileId, @PathVariable("secondFileId") String secondFileId) {
         DocFile firstFile = docFileService.getById(firstFileId);
-        if(firstFile == null || !StrUtil.isEmpty(firstFile.getFilePath()) || !StrUtil.isEmpty(firstFile.getFileName()) ||
-                /*!StrUtil.isEmpty(firstFile.getFileSuffix()) ||*/ !StrUtil.isEmpty(firstFile.getFileEncodeName()))
+        if(firstFile == null || !ValidateUtil.validateString(firstFile.getFilePath()) || !ValidateUtil.validateString(firstFile.getFileName()) ||
+                /*!ValidateUtil.validateString(firstFile.getFileSuffix()) ||*/ !ValidateUtil.validateString(firstFile.getFileEncodeName()))
             return new DataResponseResult(CommonCode.FAIL, null);
         DocFile secondFile = docFileService.getById(secondFileId);
-        if(secondFile == null || !StrUtil.isEmpty(secondFile.getFilePath()) || !StrUtil.isEmpty(secondFile.getFileName()) ||
-                /*!StrUtil.isEmpty(secondFile.getFileSuffix()) ||*/ !StrUtil.isEmpty(secondFile.getFileEncodeName()))
+        if(secondFile == null || !ValidateUtil.validateString(secondFile.getFilePath()) || !ValidateUtil.validateString(secondFile.getFileName()) ||
+                /*!ValidateUtil.validateString(secondFile.getFileSuffix()) ||*/ !ValidateUtil.validateString(secondFile.getFileEncodeName()))
             return new DataResponseResult(CommonCode.FAIL, null);
         ComparisonFilesResponse comp = new ComparisonFilesResponse();
         List<String> firstList = FileUtilS.readFile(firstFile.getFileEncodeName(), firstFile.getFilePath());
diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DocInfoController.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DocInfoController.java
index d79d6de..34d77c7 100644
--- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DocInfoController.java
+++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DocInfoController.java
@@ -15,6 +15,7 @@
 import org.jeecg.modules.dnc.response.QueryPageResponseResult;
 import org.jeecg.modules.dnc.response.ResponseResult;
 import org.jeecg.modules.dnc.service.IDocInfoService;
+import org.jeecg.modules.dnc.utils.ValidateUtil;
 import org.jeecg.modules.dnc.utils.file.FileUtilS;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -139,9 +140,9 @@
     @GetMapping("/preview/{id}")
     public QueryListResponseResult previewDocFile(@PathVariable("id") String id) {
         DocFile docFile = docInfoService.previewDocFile(id);
-        if(!StrUtil.isEmpty(docFile.getFilePath()) || !StrUtil.isEmpty(docFile.getFileName())
-//                || !StrUtil.isEmpty(docFile.getFileSuffix())
-                || !StrUtil.isEmpty(docFile.getFileEncodeName()))
+        if(!ValidateUtil.validateString(docFile.getFilePath()) || !ValidateUtil.validateString(docFile.getFileName())
+//                || !ValidateUtil.validateString(docFile.getFileSuffix())
+                || !ValidateUtil.validateString(docFile.getFileEncodeName()))
             return new QueryListResponseResult(CommonCode.FAIL, null);
         String filePath = docFile.getFilePath();
         String fileEncodeName = docFile.getFileEncodeName();
@@ -156,11 +157,11 @@
     @GetMapping("/preview/pdf/{id}")
     public ResponseResult previewPdfDocFile(HttpServletRequest request, HttpServletResponse response, @PathVariable("id") String id) {
         DocFile docFile = docInfoService.previewDocFile(id);
-        if(!StrUtil.isEmpty(docFile.getFilePath()) || !StrUtil.isEmpty(docFile.getFileName()) ||
-                /*!StrUtil.isEmpty(docFile.getFileSuffix()) ||*/ !StrUtil.isEmpty(docFile.getFileEncodeName()))
+        if(!ValidateUtil.validateString(docFile.getFilePath()) || !ValidateUtil.validateString(docFile.getFileName()) ||
+                /*!ValidateUtil.validateString(docFile.getFileSuffix()) ||*/ !ValidateUtil.validateString(docFile.getFileEncodeName()))
             return new ResponseResult(CommonCode.FAIL);
         String fileName;
-        if(StrUtil.isEmpty(docFile.getFileSuffix())) {
+        if(ValidateUtil.validateString(docFile.getFileSuffix())) {
             fileName = docFile.getFileName() + "." + docFile.getFileSuffix();
         }else {
             fileName = docFile.getFileName();
diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProcessController.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProcessController.java
index 030c875..99a3862 100644
--- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProcessController.java
+++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProcessController.java
@@ -11,6 +11,7 @@
 import org.jeecg.modules.dnc.response.QueryListResponseResult;
 import org.jeecg.modules.dnc.response.ResponseResult;
 import org.jeecg.modules.dnc.service.IProcessInfoService;
+import org.jeecg.modules.dnc.utils.ValidateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -40,7 +41,7 @@
     @ApiOperation(value = "鏂板缓宸ュ簭琛�-鏍规嵁宸ュ簭鍚嶇О妯$硦鏌ヨ", notes = "鏂板缓宸ュ簭琛�-鏍规嵁宸ュ簭鍚嶇О妯$硦鏌ヨ")
     @GetMapping("/find/list")
     public QueryListResponseResult<ProcessInfo> findByProcessName(@RequestParam(value = "processName", required = false) String processName) {
-        if(!StrUtil.isEmpty(processName))
+        if(!ValidateUtil.validateString(processName))
             return new QueryListResponseResult(CommonCode.SUCCESS, Collections.emptyList());
         List<ProcessInfo> list = processInfoService.findByProcessName(processName);
         if(list == null)
diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProductInfoController.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProductInfoController.java
index 674fc8c..beec47a 100644
--- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProductInfoController.java
+++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProductInfoController.java
@@ -16,6 +16,7 @@
 import org.jeecg.modules.dnc.service.IProductInfoService;
 import org.jeecg.modules.dnc.ucenter.Department;
 import org.jeecg.modules.dnc.ucenter.UserDepartExt;
+import org.jeecg.modules.dnc.utils.ValidateUtil;
 import org.jeecg.modules.system.entity.SysUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -59,7 +60,7 @@
     public QueryListResponseResult<CommonGenericTree> loadProductTree() {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String userId = user.getId();
-        if(!StrUtil.isEmpty(userId))
+        if(!ValidateUtil.validateString(userId))
             return new QueryListResponseResult<>(CommonCode.SUCCESS, Collections.emptyList());
         List<CommonGenericTree> list = productInfoService.loadProductTree(userId);
         if(list == null)
@@ -73,7 +74,7 @@
     public QueryListResponseResult<CommonGenericTree> loadBaseTree() {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String userId = user.getId();
-        if(!StrUtil.isEmpty(userId))
+        if(!ValidateUtil.validateString(userId))
             return new QueryListResponseResult<>(CommonCode.SUCCESS, Collections.emptyList());
         List<CommonGenericTree> list = productInfoService.loadBaseTree(userId);
         if(list == null)
@@ -87,7 +88,7 @@
     public QueryListResponseResult<CommonGenericTree> loadTree(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId") String paramId) {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String userId = user.getId();
-        if(!StrUtil.isEmpty(userId))
+        if(!ValidateUtil.validateString(userId))
             return new QueryListResponseResult<>(CommonCode.SUCCESS, Collections.emptyList());
         List<CommonGenericTree> list = productInfoService.loadTree(userId, nodeType, paramId);
         if(list == null)
@@ -245,7 +246,7 @@
     public QueryListResponseResult<CommonGenericTree> searchProductTree(String queryParam) {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String userId = user.getId();
-        if(!StrUtil.isEmpty(userId))
+        if(!ValidateUtil.validateString(userId))
             return new QueryListResponseResult<>(CommonCode.SUCCESS, Collections.emptyList());
         List<CommonGenericTree> list = productInfoService.searchProductTree(userId,  queryParam);
         if(list == null)

--
Gitblit v1.9.3