Browse Source

"轨迹查询取消当前部门限制"

yangjunfeng 2 months ago
parent
commit
0d7af1e9ce

+ 7 - 6
hnls-gps/hnls-gps-boot/src/main/java/com/tofly/gpsboot/service/sign/impl/PdasignServiceImpl.java

@@ -4,6 +4,7 @@
  */
 package com.tofly.gpsboot.service.sign.impl;
 
+import cn.hutool.core.collection.CollUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -133,22 +134,22 @@ public class PdasignServiceImpl extends ServiceImpl<PdasignMapper, Pdasign> impl
     @Override
     public PdaSignMonitorVo getUserSignList(String groupId,String time, Long deptId) {
         List<Long> userIdList = null;
-        if (!StringUtils.isEmpty(groupId)) {
+        if (org.apache.commons.lang3.StringUtils.isNotBlank(groupId)) {
             Map<Long, String> groupUserIdNameMap = groupuserService.getGroupUserIdNameMap(Long.valueOf(groupId));
             if (null != groupUserIdNameMap) {
                 userIdList = new ArrayList<>(groupUserIdNameMap.keySet());
             }
         } else {
-            Long departmentId = deptId == null ? SecurityUtils.getUser().getDepartmentId() : deptId;
-            List<User> result = departmentClient.getDeptUserList(departmentId).getResult();
-            if(null!=result&&result.size()>0){
+//            Long departmentId = deptId == null ? SecurityUtils.getUser().getDepartmentId() : deptId;
+//            List<User> result = departmentClient.getDeptUserList(departmentId).getResult();
+            List<User> result = departmentClient.getDeptUserList(deptId).getResult();
+            if(CollUtil.isNotEmpty(result)){
                 userIdList = result.stream().map(User::getId).collect(Collectors.toList());
             }
-
         }
         PdaSignMonitorVo vo = new PdaSignMonitorVo();
         // 获取对应部门id
-        if (null != userIdList && userIdList.size() > 0) {
+        if (CollUtil.isNotEmpty(userIdList)) {
             // 时间不传默认当前天开始/结束时间
             Date staDate = DateTimeUtil.convertLDTToDate(DateTimeUtil.getTodayBeginTime());
             Date endDate = DateTimeUtil.convertLDTToDate(DateTimeUtil.getTodayEndTime());