技术监督代码bug修改

This commit is contained in:
2023-07-19 14:27:12 +08:00
parent b32e6f252a
commit a154924d9a
5 changed files with 22 additions and 9 deletions

View File

@@ -48,9 +48,9 @@ public class SupvFileController extends BaseController {
@PostMapping("detail")
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DOWNLOAD)
@ApiOperation("监督计划问题附件下载")
public HttpResult<Object> detail(HttpServletResponse response, @RequestParam("busId") String busId, @RequestParam("type") Integer type){
public HttpResult<Object> 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;
}
}

View File

@@ -25,6 +25,6 @@ public interface ISupvFileService extends IService<SupvFile> {
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);
}

View File

@@ -37,7 +37,7 @@ public class SupvFileServiceImpl extends ServiceImpl<SupvFileMapper, SupvFile> i
@Override
public boolean planUpload(MultipartFile file, String planId, Integer type,String attachmentType) {
SupvFile supvFile = this.getOne(new LambdaQueryWrapper<SupvFile>().eq(SupvFile::getBusiId,planId).eq(SupvFile::getType,type));
SupvFile supvFile = this.getOne(new LambdaQueryWrapper<SupvFile>().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<SupvFileMapper, SupvFile> i
}
@Override
public String detail(HttpServletResponse response,String busId, Integer type) {
SupvFile supvFile = this.getOne(new LambdaQueryWrapper<SupvFile>().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<SupvFile>().eq(SupvFile::getBusiId,busId).eq(SupvFile::getType,type).eq(SupvFile::getAttachmentType,attachmentType));
if(Objects.nonNull(supvFile)){
fileStorageUtil.downloadStream(response,supvFile.getFileUrl());
return null;

View File

@@ -110,9 +110,16 @@ public class SupvProblemServiceImpl extends ServiceImpl<SupvProblemMapper, SupvP
item.setDutyOrgName(mapCode.get(item.getDutyOrgId()).getName());
}
SupvFile supvFile = supvFileMapper.selectOne(new LambdaQueryWrapper<SupvFile>().eq(SupvFile::getBusiId, item.getProblemId()).eq(SupvFile::getType, 1));
if (Objects.nonNull(supvFile)) {
item.setAttachmentName(supvFile.getAttachmentName());
List<SupvFile> supvFileList = supvFileMapper.selectList(new LambdaQueryWrapper<SupvFile>().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());
}
}
}
}