From 38291f340055bad6a7c56c14a4b268ce6e39f115 Mon Sep 17 00:00:00 2001 From: nyoung <12190070+nyoungo@user.noreply.gitee.com> Date: Sat, 21 Sep 2024 17:36:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E9=83=A8=E9=97=A8=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/rescue/domain/RescueInfo.java | 3 +++ .../module/rescue/mapper/RescueInfoMapper.java | 2 +- .../rescue/service/impl/RescueInfoServiceImpl.java | 14 ++++++++++++++ .../resources/mapper/rescue/RescueInfoMapper.xml | 10 ++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueInfo.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueInfo.java index 7d0ccdba..1e29b112 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueInfo.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueInfo.java @@ -187,4 +187,7 @@ public class RescueInfo extends TenantBaseDO @TableField(exist = false) private List roadIds; + + @TableField(exist = false) + private List deptList; } diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueInfoMapper.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueInfoMapper.java index 552b048c..659fdea3 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueInfoMapper.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueInfoMapper.java @@ -55,7 +55,7 @@ public interface RescueInfoMapper extends BaseMapper void dealOverTimeRescue(); List getOverTimeRescue(); Map getRescueStatistics(RescueInfo rescueInfo); - Map getRescueStatisticsByAdmin(RescueInfo rescueInfo); + Map getRescueStatisticsByAdmin(@Param("map") RescueInfo rescueInfo); void deleteOtherInfo1(@Param("rescueId") Long rescueId); void deleteOtherInfo2(@Param("rescueId") Long rescueId); diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueInfoServiceImpl.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueInfoServiceImpl.java index 4c033d43..1505f7fc 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueInfoServiceImpl.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueInfoServiceImpl.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.rescue.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; @@ -234,8 +235,15 @@ public class RescueInfoServiceImpl extends ServiceImpl selectRescueInfoListByAdmin(RescueInfo rescueInfo, Page page) { LoginUser user = getLoginUser(); + AdminUserRespDTO adminUser = userService.getUser(user.getId()); + List childDeptList = deptService.getChildDeptList(adminUser.getDeptId()); + List deptList = childDeptList.stream().map(DeptRespDTO::getId).collect(Collectors.toList()); + deptList.add(adminUser.getDeptId()); + rescueInfo.setDeptList(deptList); + IPage rescueInfos = baseMapper.selectRescueInfoList(rescueInfo, page); + for (RescueInfo info : rescueInfos.getRecords()) { String dljy_type = dictDataService.getDictDataLabel("dljy_type", info.getRescueType()); info.setRescueTypeStr(dljy_type); @@ -821,6 +829,12 @@ public class RescueInfoServiceImpl extends ServiceImpl getRescueStatisticsByAdmin(RescueInfo rescueInfo) { + LoginUser user = getLoginUser(); + AdminUserRespDTO adminUser = userService.getUser(user.getId()); + List childDeptList = deptService.getChildDeptList(adminUser.getDeptId()); + List deptList = childDeptList.stream().map(DeptRespDTO::getId).collect(Collectors.toList()); + deptList.add(adminUser.getDeptId()); + rescueInfo.setDeptList(deptList); Map res = baseMapper.getRescueStatisticsByAdmin(rescueInfo); return res; diff --git a/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml b/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml index 1a0642d8..c6e2d7be 100644 --- a/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml +++ b/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml @@ -48,6 +48,11 @@ and ri.license_num like concat('%', #{map.licenseNum}, '%') + + and ri.dept_id in + #{item} + + order by ri.create_time desc @@ -341,6 +346,11 @@ FROM rescue_info ri left join rescue_order_info roi on roi.rescue_info_id = ri.id where 1 = 1 + + and ri.dept_id in + #{item} + + DELETE