| | |
| | | package com.ruoyi.app.position.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.ruoyi.alarm.wall.domain.ArdAlarmWall; |
| | | import com.ruoyi.alarm.wall.mapper.ArdAlarmWallMapper; |
| | | import com.ruoyi.alarm.wall.service.IArdAlarmWallService; |
| | |
| | | import com.ruoyi.utils.gis.GisUtil; |
| | | import com.ruoyi.utils.gis.Point; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.autoconfigure.data.redis.RedisProperties; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | result.put("commander",commanderList); |
| | | try{ |
| | | List<String> onLinePCIdList = new ArrayList(); |
| | | onLinePCIdList.addAll(ONLINE_USER_SESSIONS.keySet()); |
| | | //onLinePCIdList.addAll(ONLINE_USER_SESSIONS.keySet()); |
| | | for(String id : ONLINE_USER_SESSIONS.keySet()){ |
| | | onLinePCIdList.add(id.split("_")[0]); |
| | | } |
| | | List<SysUser> pcList = sysUserMapper.getOnlinePC(usersId,onLinePCIdList); |
| | | result.put("pc",pcList); |
| | | }catch(Exception e){ |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String,Object>> getOnlineCommanderPosition(String soilderId) { |
| | | List<Map<String,Object>> result = ardAppPositionMapper.getOnlineCommanderPosition(soilderId); |
| | | return result; |
| | | } |
| | | |
| | | /*@Override |
| | | public void sendCheckCommandersPosition(String usersId,Map<String, Object> para) { |
| | | String reason = (String) para.get("reason"); |
| | | List<String> usersIdList = (List<String>) para.get("usersIdList"); |
| | | for(String commanderId : usersIdList){ |
| | | //设置key为checkCommanderPosition_指挥端主键_单兵端主键 |
| | | String key = "checkCommanderPosition_" + commanderId + "_" + usersId; |
| | | Map<String,Object> value = new HashMap(); |
| | | value.put("reason",reason); |
| | | value.put("state","0"); |
| | | value.put("begin",""); |
| | | value.put("commanderId",commanderId); |
| | | value.put("soilderId",usersId); |
| | | redisCache.setCacheObject(key, JSON.toJSONString(value)); |
| | | } |
| | | }*/ |
| | | |
| | | /*@Override |
| | | public void sendCheckSYCarsPosition(String usersId, Map<String, Object> para) { |
| | | String reason = (String) para.get("reason"); |
| | | List<String> usersIdList = (List<String>) para.get("usersIdList"); |
| | | for(String commanderId : usersIdList){ |
| | | //设置key为checkSYCarsPosition_指挥端主键/PC端主键_单兵端主键 |
| | | String key = "checkSYCarsPosition_" + commanderId + "_" + usersId; |
| | | Map<String,Object> value = new HashMap(); |
| | | value.put("reason",reason); |
| | | value.put("state","0"); |
| | | value.put("begin",""); |
| | | value.put("commanderId",commanderId); |
| | | value.put("soilderId",usersId); |
| | | redisCache.setCacheObject(key, JSON.toJSONString(value)); |
| | | } |
| | | }*/ |
| | | |
| | | /*@Override |
| | | public List<Map<String, Object>> getCheckCommandersPosition(String usersId) { |
| | | String key = "checkCommanderPosition_" + usersId + "_"; |
| | | List<Object> keyValueList = redisCache.getListKey(key); |
| | | List<Map<String, Object>> result = new ArrayList(); |
| | | for(Object o : keyValueList){ |
| | | Map<String,Object> map = JSON.parseObject((String) o); |
| | | if(((String)map.get("state")).equals("0")){//state为0就是未审批 |
| | | SysUser sysUser = sysUserMapper.selectUserById((String) map.get("soilderId")); |
| | | map.put("userName",sysUser.getUserName()); |
| | | result.add(map); |
| | | } |
| | | } |
| | | return result; |
| | | }*/ |
| | | |
| | | /*@Override |
| | | public List<Map<String, Object>> getCheckSYCarsPosition(String usersId) { |
| | | String key = "checkSYCarsPosition_" + usersId + "_"; |
| | | List<Object> keyValueList = redisCache.getListKey(key); |
| | | List<Map<String, Object>> result = new ArrayList(); |
| | | for(Object o : keyValueList){ |
| | | Map<String,Object> map = JSON.parseObject((String) o); |
| | | if(((String)map.get("state")).equals("0")){//state为0就是未审批 |
| | | SysUser sysUser = sysUserMapper.selectUserById((String) map.get("soilderId")); |
| | | map.put("userName",sysUser.getUserName()); |
| | | result.add(map); |
| | | } |
| | | } |
| | | return result; |
| | | }*/ |
| | | |
| | | /*@Override |
| | | public Map<String, List<Map<String, Object>>> getCheckPosition(String usersId) { |
| | | Map<String, List<Map<String, Object>>> result = new HashMap(); |
| | | //查看指挥端位置申请 |
| | | String keyCommanderPosition = "checkCommanderPosition_" + usersId + "_"; |
| | | List<Object> keyValueCommanderPositionList = redisCache.getListKey(keyCommanderPosition); |
| | | List<Map<String, Object>> resultCommanderPosition = new ArrayList(); |
| | | for(Object o : keyValueCommanderPositionList){ |
| | | Map<String,Object> map = JSON.parseObject((String) o); |
| | | if(((String)map.get("state")).equals("0")){//state为0就是未审批 |
| | | SysUser sysUser = sysUserMapper.selectUserById((String) map.get("soilderId")); |
| | | map.put("userName",sysUser.getUserName()); |
| | | if(sysUser.getNickName() != null){ |
| | | map.put("nickName",sysUser.getNickName()); |
| | | }else{ |
| | | map.put("nickName",sysUser.getNickName()); |
| | | } |
| | | resultCommanderPosition.add(map); |
| | | } |
| | | } |
| | | //查看车辆位置申请 |
| | | String keySYCarsPosition = "checkSYCarsPosition_" + usersId + "_"; |
| | | List<Object> keyValueSYCarsPositionList = redisCache.getListKey(keySYCarsPosition); |
| | | List<Map<String, Object>> resultSYCarsPosition = new ArrayList(); |
| | | for(Object o : keyValueSYCarsPositionList){ |
| | | Map<String,Object> map = JSON.parseObject((String) o); |
| | | if(((String)map.get("state")).equals("0")){//state为0就是未审批 |
| | | SysUser sysUser = sysUserMapper.selectUserById((String) map.get("soilderId")); |
| | | map.put("userName",sysUser.getUserName()); |
| | | if(sysUser.getNickName() != null){ |
| | | map.put("nickName",sysUser.getNickName()); |
| | | }else{ |
| | | map.put("nickName",sysUser.getNickName()); |
| | | } |
| | | resultSYCarsPosition.add(map); |
| | | } |
| | | } |
| | | result.put("commander",resultCommanderPosition); |
| | | result.put("SYCars",resultSYCarsPosition); |
| | | return result; |
| | | }*/ |
| | | } |