补录业务逻辑调整:判断卷内目录和每个卷内目录对应的附件列表是否为空,如果为空不能归档
Showing
2 changed files
with
25 additions
and
2 deletions
| ... | @@ -50,7 +50,7 @@ public interface DgArchivesReplenishService extends IService<DgArchivesReplenish | ... | @@ -50,7 +50,7 @@ public interface DgArchivesReplenishService extends IService<DgArchivesReplenish |
| 50 | 50 | ||
| 51 | /** | 51 | /** |
| 52 | * 补录归档 | 52 | * 补录归档 |
| 53 | * 补录记录的状态为已归档和归档日期,一并修改档案记录的状态为在库 | 53 | * 补录记录的状态为已归档和归档日期,一并修改档案记录的状态为在库,判断卷内目录和每个卷内目录对应的附件列表是否为空,如果为空不能归档 |
| 54 | * | 54 | * |
| 55 | * @param bsmModify 补录标识码 | 55 | * @param bsmModify 补录标识码 |
| 56 | * @param bsmArchive 档案标识码 | 56 | * @param bsmArchive 档案标识码 | ... | ... |
| 1 | package com.pashanhoo.replenish.service.impl; | 1 | package com.pashanhoo.replenish.service.impl; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | import cn.hutool.core.collection.CollUtil; | ||
| 5 | import cn.hutool.core.collection.CollectionUtil; | ||
| 4 | import cn.hutool.core.date.DateTime; | 6 | import cn.hutool.core.date.DateTime; |
| 5 | import cn.hutool.core.date.DateUtil; | 7 | import cn.hutool.core.date.DateUtil; |
| 6 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 8 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| ... | @@ -235,7 +237,7 @@ public class DgArchivesReplenishServiceImpl extends ServiceImpl<DgArchivesReplen | ... | @@ -235,7 +237,7 @@ public class DgArchivesReplenishServiceImpl extends ServiceImpl<DgArchivesReplen |
| 235 | 237 | ||
| 236 | /** | 238 | /** |
| 237 | * 补录归档 | 239 | * 补录归档 |
| 238 | * 补录记录的状态为已归档和归档日期,一并修改档案记录的状态为在库 | 240 | * 补录记录的状态为已归档和归档日期,一并修改档案记录的状态为在库,判断卷内目录和每个卷内目录对应的附件列表是否为空,如果为空不能归档 |
| 239 | * | 241 | * |
| 240 | * @param bsmModify 补录标识码 | 242 | * @param bsmModify 补录标识码 |
| 241 | * @param bsmArchive 档案标识码 | 243 | * @param bsmArchive 档案标识码 |
| ... | @@ -244,6 +246,27 @@ public class DgArchivesReplenishServiceImpl extends ServiceImpl<DgArchivesReplen | ... | @@ -244,6 +246,27 @@ public class DgArchivesReplenishServiceImpl extends ServiceImpl<DgArchivesReplen |
| 244 | @Override | 246 | @Override |
| 245 | @Transactional(rollbackFor = Exception.class) | 247 | @Transactional(rollbackFor = Exception.class) |
| 246 | public boolean doReplenishArchive(String bsmModify,String bsmArchive) { | 248 | public boolean doReplenishArchive(String bsmModify,String bsmArchive) { |
| 249 | |||
| 250 | //判断卷内目录和附件是否有数据 | ||
| 251 | QueryWrapper<DgArchivesCatalogDO> catalogWrapper = new QueryWrapper<>(); | ||
| 252 | QueryWrapper<DgFileDO> fileWrapper = new QueryWrapper<>(); | ||
| 253 | catalogWrapper.lambda().eq(DgArchivesCatalogDO::getBsmArchives, bsmArchive); | ||
| 254 | //目录集合 | ||
| 255 | List<DgArchivesCatalogDO> catalogDOList = dgArchivesCatalogService.list(catalogWrapper); | ||
| 256 | //获取附件集合 | ||
| 257 | List<String> bsmCatalogs = catalogDOList.stream().map(DgArchivesCatalogDO::getBsmCatalog).collect(Collectors.toList()); | ||
| 258 | |||
| 259 | if (CollUtil.isEmpty(catalogDOList)) { | ||
| 260 | return false; | ||
| 261 | } | ||
| 262 | for (String bsmCatalog : bsmCatalogs) { | ||
| 263 | fileWrapper.lambda().eq(DgFileDO::getBsmCatalog, bsmCatalog); | ||
| 264 | List<DgFileDO> fileDOList = dgFileService.list(fileWrapper); | ||
| 265 | if (CollUtil.isEmpty(fileDOList)) { | ||
| 266 | return false; | ||
| 267 | } | ||
| 268 | } | ||
| 269 | |||
| 247 | //更新补录表归档信息 | 270 | //更新补录表归档信息 |
| 248 | UpdateWrapper<DgArchivesReplenishDO> replenishUpdateWrapper = new UpdateWrapper<>(); | 271 | UpdateWrapper<DgArchivesReplenishDO> replenishUpdateWrapper = new UpdateWrapper<>(); |
| 249 | DgArchivesReplenishDO replenishDO = new DgArchivesReplenishDO(); | 272 | DgArchivesReplenishDO replenishDO = new DgArchivesReplenishDO(); | ... | ... |
-
Please register or sign in to post a comment