From ae7f04be9321ddbe17c46fae8ab05d34e7493f9f Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期三, 19 二月 2025 13:40:06 +0800 Subject: [PATCH] 管理后台bug修改 --- medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwProtectionEquipmentServiceImpl.java | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwProtectionEquipmentServiceImpl.java b/medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwProtectionEquipmentServiceImpl.java index 8b46c63..1d80e97 100644 --- a/medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwProtectionEquipmentServiceImpl.java +++ b/medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwProtectionEquipmentServiceImpl.java @@ -7,6 +7,7 @@ import com.sinata.common.exception.ServiceException; import com.sinata.common.utils.BeanUtils; import com.sinata.common.utils.CollUtils; +import com.sinata.common.utils.StringUtils; import com.sinata.system.domain.MwAttachment; import com.sinata.system.domain.MwProtectionEquipment; import com.sinata.system.domain.MwProtectionEquipmentRecord; @@ -55,7 +56,10 @@ */ @Override public PageDTO<MwProtectionEquipmentVO> pageList(MwProtectionEquipmentQuery query) { - String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId()); + String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId()); + if (StringUtils.isBlank(treeCode)) { + return PageDTO.empty(0L, 0L); + } Page<MwProtectionEquipmentVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode); return PageDTO.of(page); } @@ -69,9 +73,11 @@ @Override public MwProtectionEquipmentVO detail(Long id) { MwProtectionEquipmentVO mwProtectionEquipmentVO = BeanUtils.copyBean(this.getById(id), MwProtectionEquipmentVO.class); - //查询附件列表 - List<MwAttachment> list = mwAttachmentService.lambdaQuery().eq(MwAttachment::getType, AttachmentTypeEnum.PROTECTION_EQUIPMENT.getCode()).eq(MwAttachment::getTargetId, id).list(); - mwProtectionEquipmentVO.setAttachmentList(BeanUtils.copyToList(list, MwAttachmentVO.class)); + if (Objects.nonNull(mwProtectionEquipmentVO)) { + //查询附件列表 + List<MwAttachment> list = mwAttachmentService.lambdaQuery().eq(MwAttachment::getType, AttachmentTypeEnum.PROTECTION_EQUIPMENT.getCode()).eq(MwAttachment::getTargetId, id).list(); + mwProtectionEquipmentVO.setAttachmentList(BeanUtils.copyToList(list, MwAttachmentVO.class)); + } return mwProtectionEquipmentVO; } @@ -172,4 +178,13 @@ return PageDTO.of(page); } + /** + * 防护器具列表 + * + * @return + */ + @Override + public List<MwProtectionEquipmentVO> queryList() { + return baseMapper.queryList(); + } } -- Gitblit v1.7.1