From 71542a84d8461b3ae216ee35fda214752a94d350 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期一, 23 十二月 2024 19:08:51 +0800
Subject: [PATCH] 执法监管、审核管理、职工管理、协议内容管理接口

---
 medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwProtectionEquipmentServiceImpl.java |   10 ++++++----
 1 files changed, 6 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..828b14d 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
@@ -55,7 +55,7 @@
      */
     @Override
     public PageDTO<MwProtectionEquipmentVO> pageList(MwProtectionEquipmentQuery query) {
-        String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId());
+        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
         Page<MwProtectionEquipmentVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode);
         return PageDTO.of(page);
     }
@@ -69,9 +69,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;
     }
 

--
Gitblit v1.7.1