From 372b44cb668206bc9929c48d06890b757ab06aa1 Mon Sep 17 00:00:00 2001 From: panshuling321 Date: Tue, 21 Jun 2022 16:39:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=B7=A5=E5=8D=95=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=9A=84=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WorkUserServiceImpl.java | 17 ++++++++++++++--- .../resources/mapper/XhpcWorkDeptMapper.xml | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/WorkUserServiceImpl.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/WorkUserServiceImpl.java index 660586a6..0866d225 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/WorkUserServiceImpl.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/WorkUserServiceImpl.java @@ -17,7 +17,11 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; @@ -58,8 +62,15 @@ public class WorkUserServiceImpl implements WorkUserService { public List> getDeptAndUserByMap(Map params){ List> deptDomains = deptMapper.selectMapListByParams(params); for(Map deptMap: deptDomains){ - List> users = workUserMapper.selectMapListByDeptId(deptMap.get("id").toString()); - deptMap.put("users", users); + String deptId = deptMap.get("id") + ""; + if(StringUtils.isNotEmpty(deptId)){ + deptId = deptId.replaceAll("d_", ""); + } + + List> users = workUserMapper.selectMapListByDeptId(deptId); + if(users.size() > 0){ + deptMap.put("users", users); + } } return deptDomains; } diff --git a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcWorkDeptMapper.xml b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcWorkDeptMapper.xml index 2c98c1d5..914c2b63 100644 --- a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcWorkDeptMapper.xml +++ b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcWorkDeptMapper.xml @@ -49,7 +49,7 @@