From 13337ce8ed144c11dd004c97c28f5b86f95543d2 Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期六, 19 八月 2023 11:53:51 +0800
Subject: [PATCH] 巡检日历
---
ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java | 51 +++++++++++++++++++++++----------------------------
1 files changed, 23 insertions(+), 28 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java b/ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java
index c3f102a..c594b93 100644
--- a/ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java
+++ b/ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java
@@ -1,28 +1,19 @@
package com.ruoyi.app.position.controller;
-import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.app.position.domain.ArdAppPosition;
import com.ruoyi.app.position.service.IArdAppPositionService;
-import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.domain.entity.SysUser;
-import com.ruoyi.common.core.domain.model.LoginUser;
-import com.ruoyi.common.core.redis.RedisCache;
-import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.device.hiksdk.util.minio.MinioUtils;
+import com.ruoyi.storage.minio.utils.MinioUtils;
import com.ruoyi.rongcloud.service.RongCloudService;
-import com.ruoyi.system.domain.SysUserOnline;
-import com.ruoyi.system.service.ISysRoleService;
-import com.ruoyi.system.service.ISysUserOnlineService;
import com.ruoyi.system.service.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@@ -55,8 +46,7 @@
private IArdAppPositionService ardAppPositionService;
@Autowired
private ISysUserService sysUserService;
- @Autowired
- private RongCloudService rongCloudService;
+
/**
* 鏌ヨapp浣嶇疆鍒楄〃
@@ -139,18 +129,7 @@
List<SysUser> list = sysUserService.selectUserList(user);
return AjaxResult.success(list);
}
- /**
- * 鑾峰彇鎵�鏈塧pp鐢ㄦ埛
- */
- @ApiOperation("鑾峰彇鎵�鏈塧pp鐢ㄦ埛")
- @GetMapping("/getAppUserlist")
- public AjaxResult getAppUserlist(Long deptId)
- {
- SysUser user=new SysUser();
- user.setDeptId(deptId);
- List<SysUser> list = sysUserService.selectAppUserList(user);
- return AjaxResult.success(list);
- }
+
/**
* 鑾峰彇鎵�鏈塧pp鐢ㄦ埛
@@ -161,20 +140,36 @@
{
SysUser user=new SysUser();
user.setDeptId(deptId);
- List<SysUser> list = sysUserService.selectAppUserList(user);
+ List<SysUser> list = sysUserService.selectAllAppUserList(user);
List<SysUser> onLineList=new ArrayList<>();
List<SysUser> offLineList=new ArrayList<>();
for(SysUser sysUser:list)
{
- Boolean online = rongCloudService.checkOnline(sysUser.getUserId());
- if(online)
+ ArdAppPosition ardAppPosition = ardAppPositionService.selectLastArdAppPositionByUserId(sysUser.getUserId());
+ if(ardAppPosition!=null) {
+ Map<String, Object> params =new HashMap<>();
+ params.put("longitude", ardAppPosition.getLongitude());
+ params.put("latitude", ardAppPosition.getLatitude());
+ params.put("altitude", ardAppPosition.getAltitude());
+ params.put("bearing", ardAppPosition.getBearing());
+ sysUser.setParams(params);
+ }
+ if(StringUtils.isNotNull(sysUser.getAppOnlineState()))
{
- onLineList.add(sysUser);
+ if(sysUser.getAppOnlineState().equals("1"))
+ {
+ onLineList.add(sysUser);
+ }
+ else
+ {
+ offLineList.add(sysUser);
+ }
}
else
{
offLineList.add(sysUser);
}
+
}
Map<String,Object> onlineMap=new HashMap<>();
onlineMap.put("children",onLineList);
--
Gitblit v1.9.3