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()); 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(); 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) 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)