Jelajahi Sumber

分配责任人

lipenghui 2 bulan lalu
induk
melakukan
8ab748db0a

+ 2 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/message/PmsMessage.java

@@ -78,11 +78,11 @@ public class PmsMessage {
                 ZonedDateTime zonedDateTime = fillDO.getCreateTime().atZone(zoneId);
                 Instant instant = zonedDateTime.toInstant();
                 long timestamp = instant.toEpochMilli();
-                url="https://iot.deepoil.cc/dingding?deptId="+fillDO.getDeptId()+"&userId="+userId
+                url="http://localhost/dingding?deptId="+fillDO.getDeptId()+"&userId="+userId
                         +"&createTime="+timestamp+"&id="
                         +businessId+"&orderStatus="+fillDO.getOrderStatus()+"&type="+businessType+"&userName="+fillDO.getUserName()+"&orderName="+fillDO.getOrderName();
             }else{
-                url="https://iot.deepoil.cc/dingding?id="+businessId+"&type="+businessType+"&userId="+userId;
+                url="http://localhost/dingding?id="+businessId+"&type="+businessType+"&userId="+userId;
             }
 
             dingtalkSendApi.send(mobile, msg,"link", url);

+ 16 - 14
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java

@@ -41,20 +41,22 @@ public class AdminUserApiImpl implements AdminUserApi {
 
     @Override
     public List<AdminUserRespDTO> getUserListBySubordinate(Long id) {
-        // 1.1 获取用户负责的部门
-        List<DeptDO> depts = deptService.getDeptListByLeaderUserId(id);
-        if (CollUtil.isEmpty(depts)) {
-            return Collections.emptyList();
-        }
-        // 1.2 获取所有子部门
-        Set<Long> deptIds = convertSet(depts, DeptDO::getId);
-        List<DeptDO> childDeptList = deptService.getChildDeptList(deptIds);
-        if (CollUtil.isNotEmpty(childDeptList)) {
-            deptIds.addAll(convertSet(childDeptList, DeptDO::getId));
-        }
-
-        // 2. 获取部门对应的用户信息
-        List<AdminUserDO> users = userService.getUserListByDeptIds(deptIds);
+//        // 1.1 获取用户负责的部门
+//        List<DeptDO> depts = deptService.getDeptListByLeaderUserId(id);
+//        if (CollUtil.isEmpty(depts)) {
+//            return Collections.emptyList();
+//        }
+//        // 1.2 获取所有子部门
+//        Set<Long> deptIds = convertSet(depts, DeptDO::getId);
+//        List<DeptDO> childDeptList = deptService.getChildDeptList(deptIds);
+//        if (CollUtil.isNotEmpty(childDeptList)) {
+//            deptIds.addAll(convertSet(childDeptList, DeptDO::getId));
+//        }
+//
+//        // 2. 获取部门对应的用户信息
+        AdminUserDO user = userService.getUser(id);
+        Set<Long> childDeptIdListFromCache = deptService.getChildDeptIdListFromCache(user.getDeptId());
+        List<AdminUserDO> users = userService.getUserListByDeptIds(childDeptIdListFromCache);
         users.removeIf(item -> ObjUtil.equal(item.getId(), id)); // 排除自己
         return BeanUtils.toBean(users, AdminUserRespDTO.class);
     }