bug修复

This commit is contained in:
18792927508
2024-02-26 13:58:05 +08:00
parent da4a49956c
commit 86b8305dc2
4 changed files with 93 additions and 38 deletions
@@ -427,11 +427,20 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
Long id = templateManage.getId();
templateManage.setUpdateBy(getUsername());
int i = templateManageMapper.updateTemplateManage(templateManage);
// 先删除附件
if (CollectionUtil.isNotEmpty(templateManage.getAnnexIds())) {
templateManageMapper.deleteTemplateManageFileById(id, templateManage.getAnnexIds());
// 修改附件表
templateManageMapper.updateFileByIds(templateManage);
// 根据附件id查询附件类型
List<TemplateManage> templateManages = templateManageMapper.selectTemplateListByIds(templateManage.getAnnexIds());
if(CollectionUtil.isNotEmpty(templateManages)) {
List<Integer> types = templateManages.stream().map(TemplateManage::getTemType).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(types)) {
// 根据模板id和类型删除附件
templateManageMapper.deleteTemplateManageFileByIdAndType(id, types);
// 修改附件表
templateManageMapper.updateFileByIds(templateManage);
}
}
}
if (i > 0) {