档案目录展示
材料附件列表
Showing
13 changed files
with
244 additions
and
83 deletions
... | @@ -3,7 +3,7 @@ package com.pashanhoo.archive.controller; | ... | @@ -3,7 +3,7 @@ package com.pashanhoo.archive.controller; |
3 | import com.baomidou.mybatisplus.core.metadata.IPage; | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; |
4 | import com.pashanhoo.archive.entity.vo.*; | 4 | import com.pashanhoo.archive.entity.vo.*; |
5 | import com.pashanhoo.archive.service.DgArchivesService; | 5 | import com.pashanhoo.archive.service.DgArchivesService; |
6 | import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogWithFileVO; | 6 | import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogListVO; |
7 | import com.pashanhoo.catalog.entity.vo.UpdateDgArchivesCatalogRequest; | 7 | import com.pashanhoo.catalog.entity.vo.UpdateDgArchivesCatalogRequest; |
8 | import com.pashanhoo.common.Result; | 8 | import com.pashanhoo.common.Result; |
9 | import org.springframework.web.bind.annotation.RestController; | 9 | import org.springframework.web.bind.annotation.RestController; |
... | @@ -90,6 +90,7 @@ public class DgArchivesController { | ... | @@ -90,6 +90,7 @@ public class DgArchivesController { |
90 | } | 90 | } |
91 | 91 | ||
92 | /** | 92 | /** |
93 | * 目录修改保存 | ||
93 | * 1.比对新增的记录数据库是否存在,如果不存在则新增 | 94 | * 1.比对新增的记录数据库是否存在,如果不存在则新增 |
94 | * 2.比对数据库的数据是否存在前端传递的集合中,不存在则删除,并且删除对应的电子附件数据 | 95 | * 2.比对数据库的数据是否存在前端传递的集合中,不存在则删除,并且删除对应的电子附件数据 |
95 | * 3.如果目录记录标识码与数据库一致,直接更新当前的记录 | 96 | * 3.如果目录记录标识码与数据库一致,直接更新当前的记录 |
... | @@ -98,7 +99,7 @@ public class DgArchivesController { | ... | @@ -98,7 +99,7 @@ public class DgArchivesController { |
98 | * @return | 99 | * @return |
99 | */ | 100 | */ |
100 | @PostMapping("saveCatalogs") | 101 | @PostMapping("saveCatalogs") |
101 | @ApiOperation(value = "目录保存") | 102 | @ApiOperation(value = "目录修改保存") |
102 | public Result saveCatalogs(@RequestBody List<UpdateDgArchivesCatalogRequest> requests) { | 103 | public Result saveCatalogs(@RequestBody List<UpdateDgArchivesCatalogRequest> requests) { |
103 | 104 | ||
104 | if (dgarchivesService.updateCatalog(requests)) { | 105 | if (dgarchivesService.updateCatalog(requests)) { |
... | @@ -106,4 +107,17 @@ public class DgArchivesController { | ... | @@ -106,4 +107,17 @@ public class DgArchivesController { |
106 | } | 107 | } |
107 | return Result.error("修改失败"); | 108 | return Result.error("修改失败"); |
108 | } | 109 | } |
110 | |||
111 | /** | ||
112 | * 档案目录查找 | ||
113 | * | ||
114 | * @param bsmArchive | ||
115 | * @return | ||
116 | */ | ||
117 | @GetMapping("searchCatalog") | ||
118 | @ApiOperation(value = "查询档案目录") | ||
119 | public Result<List<DgArchivesCatalogListVO>> searchCatalog(@RequestParam String bsmArchive) { | ||
120 | |||
121 | return Result.ok(dgarchivesService.searchCatalog(bsmArchive)); | ||
122 | } | ||
109 | } | 123 | } | ... | ... |
... | @@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | ... | @@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
6 | import com.pashanhoo.archive.entity.DgArchivesDO; | 6 | import com.pashanhoo.archive.entity.DgArchivesDO; |
7 | import com.pashanhoo.archive.entity.vo.SearchArchiveRequest; | 7 | import com.pashanhoo.archive.entity.vo.SearchArchiveRequest; |
8 | import com.pashanhoo.archive.entity.vo.SearchArchiveVO; | 8 | import com.pashanhoo.archive.entity.vo.SearchArchiveVO; |
9 | import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogWithFileVO; | ||
10 | import com.pashanhoo.file.entity.vo.DgFileSearchRequest; | ||
9 | import org.apache.ibatis.annotations.Param; | 11 | import org.apache.ibatis.annotations.Param; |
10 | 12 | ||
11 | import java.util.List; | 13 | import java.util.List; |
... | @@ -24,4 +26,10 @@ public interface DgArchivesMapper extends BaseMapper<DgArchivesDO> { | ... | @@ -24,4 +26,10 @@ public interface DgArchivesMapper extends BaseMapper<DgArchivesDO> { |
24 | 26 | ||
25 | IPage<SearchArchiveVO> searchArchive(@Param("pageParam") IPage<SearchArchiveVO> pageParam, @Param("request") SearchArchiveRequest request); | 27 | IPage<SearchArchiveVO> searchArchive(@Param("pageParam") IPage<SearchArchiveVO> pageParam, @Param("request") SearchArchiveRequest request); |
26 | 28 | ||
29 | /** | ||
30 | * 查询附件以及名称和排序 | ||
31 | * @param request | ||
32 | * @return | ||
33 | */ | ||
34 | List<DgArchivesCatalogWithFileVO> selectCatalogWithFile(@Param("request") DgFileSearchRequest request); | ||
27 | } | 35 | } | ... | ... |
... | @@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.extension.service.IService; | ... | @@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.extension.service.IService; |
5 | import com.pashanhoo.archive.entity.DgArchivesDO; | 5 | import com.pashanhoo.archive.entity.DgArchivesDO; |
6 | import com.pashanhoo.archive.entity.vo.*; | 6 | import com.pashanhoo.archive.entity.vo.*; |
7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
8 | import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogListVO; | ||
8 | import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogWithFileVO; | 9 | import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogWithFileVO; |
9 | import com.pashanhoo.catalog.entity.vo.UpdateDgArchivesCatalogRequest; | 10 | import com.pashanhoo.catalog.entity.vo.UpdateDgArchivesCatalogRequest; |
11 | import com.pashanhoo.file.entity.vo.DgFileSearchRequest; | ||
10 | 12 | ||
11 | import java.util.List; | 13 | import java.util.List; |
12 | 14 | ||
... | @@ -84,4 +86,18 @@ public interface DgArchivesService extends IService<DgArchivesDO> { | ... | @@ -84,4 +86,18 @@ public interface DgArchivesService extends IService<DgArchivesDO> { |
84 | * @return | 86 | * @return |
85 | */ | 87 | */ |
86 | boolean updateCatalog(List<UpdateDgArchivesCatalogRequest> requests); | 88 | boolean updateCatalog(List<UpdateDgArchivesCatalogRequest> requests); |
89 | |||
90 | /** | ||
91 | * 根据条件进行列表查询 | ||
92 | * @param request | ||
93 | * @return | ||
94 | */ | ||
95 | List<DgArchivesCatalogWithFileVO> searchDgFileList(DgFileSearchRequest request); | ||
96 | |||
97 | /** | ||
98 | * 档案目录查找 | ||
99 | * @param bsmArchive | ||
100 | * @return | ||
101 | */ | ||
102 | List<DgArchivesCatalogListVO> searchCatalog(String bsmArchive); | ||
87 | } | 103 | } | ... | ... |
... | @@ -20,9 +20,13 @@ import com.pashanhoo.business.entity.vo.UpdateDgBusinessRequest; | ... | @@ -20,9 +20,13 @@ import com.pashanhoo.business.entity.vo.UpdateDgBusinessRequest; |
20 | import com.pashanhoo.business.service.DgBusinessService; | 20 | import com.pashanhoo.business.service.DgBusinessService; |
21 | import com.pashanhoo.catalog.entity.DgArchivesCatalogConverter; | 21 | import com.pashanhoo.catalog.entity.DgArchivesCatalogConverter; |
22 | import com.pashanhoo.catalog.entity.DgArchivesCatalogDO; | 22 | import com.pashanhoo.catalog.entity.DgArchivesCatalogDO; |
23 | import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogListVO; | ||
24 | import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogWithFileVO; | ||
23 | import com.pashanhoo.catalog.entity.vo.UpdateDgArchivesCatalogRequest; | 25 | import com.pashanhoo.catalog.entity.vo.UpdateDgArchivesCatalogRequest; |
24 | import com.pashanhoo.catalog.service.DgArchivesCatalogService; | 26 | import com.pashanhoo.catalog.service.DgArchivesCatalogService; |
27 | import com.pashanhoo.common.util.fileupload.MinioUtil; | ||
25 | import com.pashanhoo.file.entity.DgFileDO; | 28 | import com.pashanhoo.file.entity.DgFileDO; |
29 | import com.pashanhoo.file.entity.vo.DgFileSearchRequest; | ||
26 | import com.pashanhoo.file.service.DgFileService; | 30 | import com.pashanhoo.file.service.DgFileService; |
27 | import org.springframework.beans.factory.annotation.Autowired; | 31 | import org.springframework.beans.factory.annotation.Autowired; |
28 | import org.springframework.stereotype.Service; | 32 | import org.springframework.stereotype.Service; |
... | @@ -75,6 +79,9 @@ public class DgArchivesServiceImpl extends ServiceImpl<DgArchivesMapper, DgArchi | ... | @@ -75,6 +79,9 @@ public class DgArchivesServiceImpl extends ServiceImpl<DgArchivesMapper, DgArchi |
75 | @Autowired | 79 | @Autowired |
76 | private DgFileService dgFileService; | 80 | private DgFileService dgFileService; |
77 | 81 | ||
82 | @Autowired | ||
83 | private MinioUtil minioUtil; | ||
84 | |||
78 | /** | 85 | /** |
79 | * 新增记录 | 86 | * 新增记录 |
80 | * | 87 | * |
... | @@ -273,6 +280,41 @@ public class DgArchivesServiceImpl extends ServiceImpl<DgArchivesMapper, DgArchi | ... | @@ -273,6 +280,41 @@ public class DgArchivesServiceImpl extends ServiceImpl<DgArchivesMapper, DgArchi |
273 | 280 | ||
274 | } | 281 | } |
275 | 282 | ||
283 | /** | ||
284 | * 查找档案目录和对应的附件列表 | ||
285 | * @param request | ||
286 | * @return | ||
287 | */ | ||
288 | @Override | ||
289 | public List<DgArchivesCatalogWithFileVO> searchDgFileList(DgFileSearchRequest request) { | ||
290 | |||
291 | List<DgArchivesCatalogWithFileVO> fileListVOS = dgarchivesMapper.selectCatalogWithFile(request); | ||
292 | |||
293 | for (DgArchivesCatalogWithFileVO fileListVO : fileListVOS) { | ||
294 | for (DgFileDO dgFileDO : fileListVO.getDgFileDOS()) { | ||
295 | if (dgFileDO.getFjurl() != null) { | ||
296 | String previewUrl = minioUtil.getPreviewUrl(dgFileDO.getFjurl()); | ||
297 | dgFileDO.setFjurl(previewUrl); | ||
298 | } | ||
299 | } | ||
300 | } | ||
301 | return fileListVOS; | ||
302 | } | ||
303 | |||
304 | /** | ||
305 | * 档案目录查找 | ||
306 | * | ||
307 | * @param bsmArchive | ||
308 | * @return | ||
309 | */ | ||
310 | @Override | ||
311 | public List<DgArchivesCatalogListVO> searchCatalog(String bsmArchive) { | ||
312 | QueryWrapper<DgArchivesCatalogDO> catalogWrapper = new QueryWrapper<>(); | ||
313 | catalogWrapper.lambda().eq(DgArchivesCatalogDO::getBsmArchives, bsmArchive).orderByAsc(DgArchivesCatalogDO::getXh); | ||
314 | List<DgArchivesCatalogDO> list = catalogService.list(catalogWrapper); | ||
315 | return catalogConverter.doList2ListVOList(list); | ||
316 | } | ||
317 | |||
276 | private ArchiveDetailAndCoverVO getCover(String bsmArchive) { | 318 | private ArchiveDetailAndCoverVO getCover(String bsmArchive) { |
277 | DgArchivesDO archivesDO = this.getById(bsmArchive); | 319 | DgArchivesDO archivesDO = this.getById(bsmArchive); |
278 | DgArchivesDetailVO dgArchivesDetailVO = dgarchivesConverter.do2DetailVO(archivesDO); | 320 | DgArchivesDetailVO dgArchivesDetailVO = dgarchivesConverter.do2DetailVO(archivesDO); | ... | ... |
1 | package com.pashanhoo.file.controller; | 1 | package com.pashanhoo.file.controller; |
2 | 2 | ||
3 | |||
4 | import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogWithFileVO; | ||
5 | import com.pashanhoo.common.Result; | 3 | import com.pashanhoo.common.Result; |
6 | import com.pashanhoo.file.entity.vo.AddDgFileRequest; | 4 | import com.pashanhoo.file.entity.vo.AddDgFileRequest; |
5 | import com.pashanhoo.file.entity.vo.DgCatalogWithFileVO; | ||
6 | import com.pashanhoo.file.entity.vo.DgFileListVO; | ||
7 | import com.pashanhoo.file.entity.vo.UpdateDgFileRequest; | 7 | import com.pashanhoo.file.entity.vo.UpdateDgFileRequest; |
8 | import com.pashanhoo.file.entity.vo.DgFileSearchRequest; | ||
9 | import com.pashanhoo.file.service.DgFileService; | 8 | import com.pashanhoo.file.service.DgFileService; |
10 | import org.springframework.web.bind.annotation.RestController; | 9 | import org.springframework.web.bind.annotation.RestController; |
11 | import org.springframework.web.bind.annotation.*; | 10 | import org.springframework.web.bind.annotation.*; |
... | @@ -58,15 +57,17 @@ public class DgFileController { | ... | @@ -58,15 +57,17 @@ public class DgFileController { |
58 | } | 57 | } |
59 | 58 | ||
60 | @GetMapping("getDgFileDetailById") | 59 | @GetMapping("getDgFileDetailById") |
61 | @ApiOperation(value = "读取明细") | 60 | @ApiOperation(value = "获取附件列表") |
62 | public Result getDgFileDetailById(@ApiParam("档案文件信息ID") @RequestParam String id){ | 61 | public Result<List<DgCatalogWithFileVO>> getDgFileDetailById(@ApiParam("档案标识码") @RequestParam String bsmArchive){ |
63 | return Result.ok(dgfileService.getDgFileDetailById(id)); | 62 | return Result.ok(dgfileService.getFileList(bsmArchive)); |
64 | } | 63 | } |
65 | 64 | ||
66 | @PostMapping("search") | 65 | // @PutMapping("updateFileSort") |
67 | @ApiOperation(value = "查询档案目录和对应的附件") | 66 | // @ApiOperation("附件排序") |
68 | public Result<List<DgArchivesCatalogWithFileVO>> searchDgFileList(@RequestBody DgFileSearchRequest request) { | 67 | // public Result updateFileSort(@RequestBody UpdateDgFileRequest request){ |
69 | 68 | // if(dgfileService.updateFileSort(request)) { | |
70 | return Result.ok(dgfileService.searchDgFileList(request)); | 69 | // return Result.ok("修改成功"); |
71 | } | 70 | // } |
71 | // return Result.error("修改失败"); | ||
72 | // } | ||
72 | } | 73 | } | ... | ... |
1 | package com.pashanhoo.file.entity.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModel; | ||
4 | import io.swagger.annotations.ApiModelProperty; | ||
5 | import lombok.Data; | ||
6 | import lombok.EqualsAndHashCode; | ||
7 | |||
8 | import java.io.Serializable; | ||
9 | import java.util.List; | ||
10 | |||
11 | @Data | ||
12 | @EqualsAndHashCode(callSuper = false) | ||
13 | @ApiModel(value="档案目录对应文件信息列表VO") | ||
14 | public class DgCatalogWithFileVO implements Serializable { | ||
15 | |||
16 | private static final long serialVersionUID = 1L; | ||
17 | |||
18 | /** | ||
19 | * 目录标识码 | ||
20 | */ | ||
21 | @ApiModelProperty(name = "bsmCatalog", value = "目录标识码") | ||
22 | private String bsmCatalog; | ||
23 | |||
24 | /** | ||
25 | * 文件名称 | ||
26 | */ | ||
27 | @ApiModelProperty(name = "wjmc", value = "档案目录信息") | ||
28 | private String wjmc; | ||
29 | |||
30 | /** | ||
31 | * 序号 | ||
32 | */ | ||
33 | @ApiModelProperty(name = "xh", value = "序号") | ||
34 | private Integer xh; | ||
35 | |||
36 | /** | ||
37 | * 档案文件信息列表VO | ||
38 | */ | ||
39 | @ApiModelProperty(name = "fileLists", value = "档案文件信息列表VO") | ||
40 | private List<DgFileListVO> fileLists; | ||
41 | } |
... | @@ -2,13 +2,13 @@ package com.pashanhoo.file.entity.vo; | ... | @@ -2,13 +2,13 @@ package com.pashanhoo.file.entity.vo; |
2 | 2 | ||
3 | import java.util.Date; | 3 | import java.util.Date; |
4 | import java.io.Serializable; | 4 | import java.io.Serializable; |
5 | import java.util.List; | ||
6 | 5 | ||
7 | import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogListVO; | 6 | import com.fasterxml.jackson.annotation.JsonFormat; |
8 | import io.swagger.annotations.ApiModel; | 7 | import io.swagger.annotations.ApiModel; |
9 | import io.swagger.annotations.ApiModelProperty; | 8 | import io.swagger.annotations.ApiModelProperty; |
10 | import lombok.Data; | 9 | import lombok.Data; |
11 | import lombok.EqualsAndHashCode; | 10 | import lombok.EqualsAndHashCode; |
11 | import org.springframework.format.annotation.DateTimeFormat; | ||
12 | 12 | ||
13 | /** | 13 | /** |
14 | * <p> | 14 | * <p> |
... | @@ -47,6 +47,8 @@ public class DgFileListVO implements Serializable { | ... | @@ -47,6 +47,8 @@ public class DgFileListVO implements Serializable { |
47 | * 上传日期 | 47 | * 上传日期 |
48 | */ | 48 | */ |
49 | @ApiModelProperty(name = "scrq", value = "上传日期") | 49 | @ApiModelProperty(name = "scrq", value = "上传日期") |
50 | @DateTimeFormat(pattern = "yyyy-MM-dd") | ||
51 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | ||
50 | private Date scrq; | 52 | private Date scrq; |
51 | 53 | ||
52 | /** | 54 | /** |
... | @@ -67,16 +69,4 @@ public class DgFileListVO implements Serializable { | ... | @@ -67,16 +69,4 @@ public class DgFileListVO implements Serializable { |
67 | @ApiModelProperty(name = "fjsize", value = "附件大小") | 69 | @ApiModelProperty(name = "fjsize", value = "附件大小") |
68 | private String fjsize; | 70 | private String fjsize; |
69 | 71 | ||
70 | /** | ||
71 | * 文件名称 | ||
72 | */ | ||
73 | @ApiModelProperty(name = "wjmc", value = "档案目录信息") | ||
74 | private String wjmc; | ||
75 | |||
76 | /** | ||
77 | * 序号 | ||
78 | */ | ||
79 | @ApiModelProperty(name = "xh", value = "序号") | ||
80 | private Integer xh; | ||
81 | |||
82 | } | 72 | } | ... | ... |
1 | package com.pashanhoo.file.entity.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModel; | ||
4 | import io.swagger.annotations.ApiModelProperty; | ||
5 | import lombok.Data; | ||
6 | import lombok.EqualsAndHashCode; | ||
7 | |||
8 | import java.io.Serializable; | ||
9 | |||
10 | @Data | ||
11 | @EqualsAndHashCode(callSuper = false) | ||
12 | @ApiModel(value="附件列表排序修改实体") | ||
13 | public class UpdateFileSortRequest implements Serializable { | ||
14 | |||
15 | private static final long serialVersionUID = 1L; | ||
16 | |||
17 | /** | ||
18 | * 目录标识码 | ||
19 | */ | ||
20 | @ApiModelProperty(name = "bsmCatalog", value = "目录标识码") | ||
21 | private String bsmCatalog; | ||
22 | |||
23 | /** | ||
24 | * 档案标识码 | ||
25 | */ | ||
26 | @ApiModelProperty(name = "bsmArchives", value = "档案标识码") | ||
27 | private String bsmArchives; | ||
28 | |||
29 | /** | ||
30 | * 序号 | ||
31 | */ | ||
32 | @ApiModelProperty(name = "xh", value = "序号") | ||
33 | private Integer xh; | ||
34 | } |
... | @@ -2,14 +2,13 @@ package com.pashanhoo.file.mapper; | ... | @@ -2,14 +2,13 @@ package com.pashanhoo.file.mapper; |
2 | 2 | ||
3 | 3 | ||
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
5 | import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogWithFileVO; | ||
6 | import com.pashanhoo.file.entity.DgFileDO; | 5 | import com.pashanhoo.file.entity.DgFileDO; |
7 | import com.pashanhoo.file.entity.vo.DgFileListVO; | 6 | import com.pashanhoo.file.entity.vo.DgCatalogWithFileVO; |
8 | import com.pashanhoo.file.entity.vo.DgFileSearchRequest; | ||
9 | import org.apache.ibatis.annotations.Param; | 7 | import org.apache.ibatis.annotations.Param; |
10 | 8 | ||
11 | import java.util.List; | 9 | import java.util.List; |
12 | 10 | ||
11 | |||
13 | /** | 12 | /** |
14 | * <p> | 13 | * <p> |
15 | * 档案文件信息 Mapper 接口 | 14 | * 档案文件信息 Mapper 接口 |
... | @@ -21,9 +20,10 @@ import java.util.List; | ... | @@ -21,9 +20,10 @@ import java.util.List; |
21 | public interface DgFileMapper extends BaseMapper<DgFileDO> { | 20 | public interface DgFileMapper extends BaseMapper<DgFileDO> { |
22 | 21 | ||
23 | /** | 22 | /** |
24 | * 查询附件以及名称和排序 | 23 | * 获取附件列表 |
25 | * @param request | 24 | * |
25 | * @param bsmArchive | ||
26 | * @return | 26 | * @return |
27 | */ | 27 | */ |
28 | List<DgArchivesCatalogWithFileVO> selectCatalogWithFile(@Param("request") DgFileSearchRequest request); | 28 | List<DgCatalogWithFileVO> getFileList(@Param("bsmArchive") String bsmArchive); |
29 | } | 29 | } | ... | ... |
1 | package com.pashanhoo.file.service; | 1 | package com.pashanhoo.file.service; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
4 | import com.baomidou.mybatisplus.extension.service.IService; | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogWithFileVO; | ||
6 | import com.pashanhoo.file.entity.DgFileDO; | 4 | import com.pashanhoo.file.entity.DgFileDO; |
7 | import com.pashanhoo.file.entity.vo.*; | 5 | import com.pashanhoo.file.entity.vo.*; |
8 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
9 | 6 | ||
10 | import java.util.List; | 7 | import java.util.List; |
11 | 8 | ||
... | @@ -40,9 +37,9 @@ public interface DgFileService extends IService<DgFileDO> { | ... | @@ -40,9 +37,9 @@ public interface DgFileService extends IService<DgFileDO> { |
40 | boolean updateDgFile(UpdateDgFileRequest request); | 37 | boolean updateDgFile(UpdateDgFileRequest request); |
41 | 38 | ||
42 | /** | 39 | /** |
43 | * 根据条件进行列表查询 | 40 | * 获取附件列表 |
44 | * @param request | 41 | * @param bsmArchive |
45 | * @return | 42 | * @return |
46 | */ | 43 | */ |
47 | List<DgArchivesCatalogWithFileVO> searchDgFileList(DgFileSearchRequest request); | 44 | List<DgCatalogWithFileVO> getFileList(String bsmArchive); |
48 | } | 45 | } | ... | ... |
1 | package com.pashanhoo.file.service.impl; | 1 | package com.pashanhoo.file.service.impl; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
4 | import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogWithFileVO; | ||
5 | import com.pashanhoo.common.util.fileupload.MinioUtil; | 4 | import com.pashanhoo.common.util.fileupload.MinioUtil; |
6 | import com.pashanhoo.file.entity.DgFileConverter; | 5 | import com.pashanhoo.file.entity.DgFileConverter; |
7 | import com.pashanhoo.file.entity.DgFileDO; | 6 | import com.pashanhoo.file.entity.DgFileDO; |
... | @@ -13,6 +12,7 @@ import org.springframework.stereotype.Service; | ... | @@ -13,6 +12,7 @@ import org.springframework.stereotype.Service; |
13 | 12 | ||
14 | 13 | ||
15 | import java.util.List; | 14 | import java.util.List; |
15 | import java.util.stream.Collectors; | ||
16 | 16 | ||
17 | /** | 17 | /** |
18 | * <p> | 18 | * <p> |
... | @@ -71,24 +71,15 @@ public class DgFileServiceImpl extends ServiceImpl<DgFileMapper, DgFileDO> imple | ... | @@ -71,24 +71,15 @@ public class DgFileServiceImpl extends ServiceImpl<DgFileMapper, DgFileDO> imple |
71 | } | 71 | } |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * 根据条件进行列表查询 | 74 | * 获取附件列表 |
75 | * @param request | 75 | * @param bsmArchive |
76 | * @return | 76 | * @return |
77 | */ | 77 | */ |
78 | @Override | 78 | @Override |
79 | public List<DgArchivesCatalogWithFileVO> searchDgFileList(DgFileSearchRequest request) { | 79 | public List<DgCatalogWithFileVO> getFileList(String bsmArchive) { |
80 | 80 | List<DgCatalogWithFileVO> fileList = dgfileMapper.getFileList(bsmArchive); | |
81 | List<DgArchivesCatalogWithFileVO> fileListVOS = dgfileMapper.selectCatalogWithFile(request); | 81 | fileList.forEach(catalogWithFiles->catalogWithFiles.getFileLists().forEach(file->file.setFjurl(minioUtil.getPreviewUrl(file.getFjurl())))); |
82 | 82 | return fileList; | |
83 | for (DgArchivesCatalogWithFileVO fileListVO : fileListVOS) { | ||
84 | for (DgFileDO dgFileDO : fileListVO.getDgFileDOS()) { | ||
85 | if (dgFileDO.getFjurl() != null) { | ||
86 | String previewUrl = minioUtil.getPreviewUrl(dgFileDO.getFjurl()); | ||
87 | dgFileDO.setFjurl(previewUrl); | ||
88 | } | ||
89 | } | ||
90 | } | ||
91 | return fileListVOS; | ||
92 | } | 83 | } |
93 | 84 | ||
94 | } | 85 | } | ... | ... |
... | @@ -89,4 +89,41 @@ | ... | @@ -89,4 +89,41 @@ |
89 | </where> | 89 | </where> |
90 | </select> | 90 | </select> |
91 | 91 | ||
92 | |||
93 | <resultMap id="CatalogWithFile" type="com.pashanhoo.catalog.entity.vo.DgArchivesCatalogWithFileVO"> | ||
94 | <result column="bsm_catalog" property="bsmCatalog"/> | ||
95 | <result column="bsm_archives" property="bsmArchives"/> | ||
96 | <result column="xh" property="xh"/> | ||
97 | <result column="wjbm" property="wjbm"/> | ||
98 | <result column="wjmc" property="wjmc"/> | ||
99 | <result column="cllxbm" property="cllxbm"/> | ||
100 | <result column="cllxmc" property="cllxmc"/> | ||
101 | <result column="ys" property="ys"/> | ||
102 | <result column="yh" property="yh"/> | ||
103 | <result column="fs" property="fs"/> | ||
104 | <result column="wh" property="wh"/> | ||
105 | <result column="bz" property="bz"/> | ||
106 | <collection property="dgFileDOS" ofType="com.pashanhoo.file.entity.DgFileDO"> | ||
107 | <result column="BSM_FILE" property="bsmFile"/> | ||
108 | <result column="DF_BSM_CATALOG" property="bsmCatalog"/> | ||
109 | <result column="KZM" property="kzm"/> | ||
110 | <result column="SCRQ" property="scrq"/> | ||
111 | <result column="SCR" property="scr"/> | ||
112 | <result column="FJURL" property="fjurl"/> | ||
113 | <result column="FJSIZE" property="fjsize"/> | ||
114 | </collection> | ||
115 | </resultMap> | ||
116 | |||
117 | <select id="selectCatalogWithFile" resultMap="CatalogWithFile"> | ||
118 | select DAC.*, DF.BSM_FILE as BSM_FILE, DF.BSM_CATALOG as DF_BSM_CATALOG, DF.KZM as KZM,DF.SCRQ as SCRQ,DF.SCR as SCR,DF.FJURL as FJURL,DF.FJSIZE as FJSIZE | ||
119 | from DG_FILE DF | ||
120 | left join DG_ARCHIVES_CATALOG DAC on DAC.BSM_CATALOG = | ||
121 | DF.BSM_CATALOG | ||
122 | <where> | ||
123 | <if test="request.bsmArchives != null and request.bsmArchives != ''"> | ||
124 | BSM_ARCHIVES = #{request.bsmArchives,jdbcType=VARCHAR} | ||
125 | </if> | ||
126 | </where> | ||
127 | order by XH | ||
128 | </select> | ||
92 | </mapper> | 129 | </mapper> | ... | ... |
... | @@ -23,40 +23,30 @@ | ... | @@ -23,40 +23,30 @@ |
23 | FJSIZE | 23 | FJSIZE |
24 | </sql> | 24 | </sql> |
25 | 25 | ||
26 | <resultMap id="CatalogWithFile" type="com.pashanhoo.catalog.entity.vo.DgArchivesCatalogWithFileVO"> | 26 | <resultMap id="result" type="com.pashanhoo.file.entity.vo.DgCatalogWithFileVO"> |
27 | <result column="bsm_catalog" property="bsmCatalog"/> | 27 | <result column="bsm_catalog" property="bsmCatalog"/> |
28 | <result column="bsm_archives" property="bsmArchives"/> | ||
29 | <result column="xh" property="xh"/> | ||
30 | <result column="wjbm" property="wjbm"/> | ||
31 | <result column="wjmc" property="wjmc"/> | 28 | <result column="wjmc" property="wjmc"/> |
32 | <result column="cllxbm" property="cllxbm"/> | 29 | <result column="xh" property="xh"/> |
33 | <result column="cllxmc" property="cllxmc"/> | 30 | <collection property="fileLists" ofType="com.pashanhoo.file.entity.vo.DgFileListVO"> |
34 | <result column="ys" property="ys"/> | 31 | <result column="bsm_file" property="bsmFile"/> |
35 | <result column="yh" property="yh"/> | 32 | <result column="bsm_catalog" property="bsmCatalog"/> |
36 | <result column="fs" property="fs"/> | 33 | <result column="kzm" property="kzm"/> |
37 | <result column="wh" property="wh"/> | 34 | <result column="scrq" property="scrq"/> |
38 | <result column="bz" property="bz"/> | 35 | <result column="scr" property="scr"/> |
39 | <collection property="dgFileDOS" ofType="com.pashanhoo.file.entity.DgFileDO"> | 36 | <result column="fjurl" property="fjurl"/> |
40 | <result column="BSM_FILE" property="bsmFile"/> | 37 | <result column="fjsize" property="fjsize"/> |
41 | <result column="DF_BSM_CATALOG" property="bsmCatalog"/> | ||
42 | <result column="KZM" property="kzm"/> | ||
43 | <result column="SCRQ" property="scrq"/> | ||
44 | <result column="SCR" property="scr"/> | ||
45 | <result column="FJURL" property="fjurl"/> | ||
46 | <result column="FJSIZE" property="fjsize"/> | ||
47 | </collection> | 38 | </collection> |
48 | </resultMap> | 39 | </resultMap> |
49 | 40 | ||
50 | <select id="selectCatalogWithFile" resultMap="CatalogWithFile"> | 41 | <select id="getFileList" resultType="com.pashanhoo.file.entity.vo.DgFileListVO"> |
51 | select DAC.*, DF.BSM_FILE as BSM_FILE, DF.BSM_CATALOG as DF_BSM_CATALOG, DF.KZM as KZM,DF.SCRQ as SCRQ,DF.SCR as SCR,DF.FJURL as FJURL,DF.FJSIZE as FJSIZE | 42 | select DF.*, DAC.XH, DAC.WJMC,DAC.BSM_CATALOG |
52 | from DG_FILE DF | 43 | from DG_FILE DF |
53 | left join DG_ARCHIVES_CATALOG DAC on DAC.BSM_CATALOG = | 44 | join DG_ARCHIVES_CATALOG DAC on DAC.BSM_CATALOG = DF.BSM_CATALOG |
54 | DF.BSM_CATALOG | ||
55 | <where> | 45 | <where> |
56 | <if test="request.bsmArchives != null and request.bsmArchives != ''"> | 46 | <if test="bsmArchive != null and bsmArchive != ''"> |
57 | BSM_ARCHIVES = #{request.bsmArchives,jdbcType=VARCHAR} | 47 | BSM_ARCHIVES = #{bsmArchive,jdbcType=VARCHAR} |
58 | </if> | 48 | </if> |
59 | </where> | 49 | </where> |
60 | order by XH | 50 | order by DAC.XH |
61 | </select> | 51 | </select> |
62 | </mapper> | 52 | </mapper> | ... | ... |
-
Please register or sign in to post a comment