From a154924d9a00ed5a9be65412aa29e2b09a086886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E6=9C=A8c?= <857448963@qq.com> Date: Wed, 19 Jul 2023 14:27:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=80=E6=9C=AF=E7=9B=91=E7=9D=A3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/njcn/process/pojo/po/SupvProblem.java | 6 ++++++ .../njcn/process/controller/SupvFileController.java | 4 ++-- .../com/njcn/process/service/ISupvFileService.java | 2 +- .../process/service/impl/SupvFileServiceImpl.java | 6 +++--- .../service/impl/SupvProblemServiceImpl.java | 13 ++++++++++--- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java index 7b620b491..ca512269e 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java @@ -127,8 +127,14 @@ public class SupvProblem extends BaseEntity { private String remark; @TableField(exist = false) + @ApiModelProperty(name = "attachmentName",value = "盖章报告") private String attachmentName; + @TableField(exist = false) + @ApiModelProperty(name = "attachmentNameTwo",value = "佐证材料") + private String attachmentNameTwo; + + } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvFileController.java b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvFileController.java index 51eee5cdf..78c4fdbe9 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvFileController.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvFileController.java @@ -48,9 +48,9 @@ public class SupvFileController extends BaseController { @PostMapping("detail") @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DOWNLOAD) @ApiOperation("监督计划问题附件下载") - public HttpResult detail(HttpServletResponse response, @RequestParam("busId") String busId, @RequestParam("type") Integer type){ + public HttpResult detail(HttpServletResponse response, @RequestParam("busId") String busId, @RequestParam("type") Integer type,@RequestParam("attachmentType") String attachmentType){ String methodDescribe = getMethodDescribe("detail"); - iSupvFileService.detail(response,busId,type); + iSupvFileService.detail(response,busId,type,attachmentType); return null; } } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvFileService.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvFileService.java index c7bbbdce7..a644eac53 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvFileService.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvFileService.java @@ -25,6 +25,6 @@ public interface ISupvFileService extends IService { boolean planUpload(MultipartFile file,String planId, Integer type,String attachmentType); - String detail(HttpServletResponse response,String busId,Integer type); + String detail(HttpServletResponse response,String busId,Integer type,String attachmentType); } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvFileServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvFileServiceImpl.java index e62e3850c..38832b296 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvFileServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvFileServiceImpl.java @@ -37,7 +37,7 @@ public class SupvFileServiceImpl extends ServiceImpl i @Override public boolean planUpload(MultipartFile file, String planId, Integer type,String attachmentType) { - SupvFile supvFile = this.getOne(new LambdaQueryWrapper().eq(SupvFile::getBusiId,planId).eq(SupvFile::getType,type)); + SupvFile supvFile = this.getOne(new LambdaQueryWrapper().eq(SupvFile::getBusiId,planId).eq(SupvFile::getType,type).eq(SupvFile::getAttachmentType,attachmentType)); String url = fileStorageUtil.uploadMultipart(file, OssPath.SURVEY_RESULT); SupvFile supvFilePO = new SupvFile(); supvFilePO.setAttachmentName(file.getOriginalFilename()); @@ -57,8 +57,8 @@ public class SupvFileServiceImpl extends ServiceImpl i } @Override - public String detail(HttpServletResponse response,String busId, Integer type) { - SupvFile supvFile = this.getOne(new LambdaQueryWrapper().eq(SupvFile::getBusiId,busId).eq(SupvFile::getType,type)); + public String detail(HttpServletResponse response,String busId, Integer type,String attachmentType) { + SupvFile supvFile = this.getOne(new LambdaQueryWrapper().eq(SupvFile::getBusiId,busId).eq(SupvFile::getType,type).eq(SupvFile::getAttachmentType,attachmentType)); if(Objects.nonNull(supvFile)){ fileStorageUtil.downloadStream(response,supvFile.getFileUrl()); return null; diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java index dae033133..7bb8bdc02 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java @@ -110,9 +110,16 @@ public class SupvProblemServiceImpl extends ServiceImpl().eq(SupvFile::getBusiId, item.getProblemId()).eq(SupvFile::getType, 1)); - if (Objects.nonNull(supvFile)) { - item.setAttachmentName(supvFile.getAttachmentName()); + List supvFileList = supvFileMapper.selectList(new LambdaQueryWrapper().eq(SupvFile::getBusiId, item.getProblemId()).eq(SupvFile::getType, 1)); + if (CollUtil.isNotEmpty(supvFileList)) { + for(SupvFile supvFile:supvFileList){ + if(supvFile.getAttachmentType().equals("01")){ + item.setAttachmentName(supvFile.getAttachmentName()); + }else { + item.setAttachmentNameTwo(supvFile.getAttachmentName()); + } + + } } }