| | |
| | | import com.ruoyi.utils.websocket.util.WebSocketUtils; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | |
| | | @Resource |
| | | private SYClient sYClient; |
| | | |
| | | @Value("${minio.endpoint}") |
| | | private String minioEndpoint; |
| | | |
| | | private Map<String,Thread> threadMap = new HashMap(); |
| | | |
| | |
| | | //for(Map<String,Object> sycar : onlineSYCarPositionList){ |
| | | for(Map<String,Object> sycar : onlineSYCarPositionNearList){ |
| | | Map<String,Object> map = ardSyCarMapper.getArdSyCarAndDeptByCarId((String)sycar.get("carId")); |
| | | String carModel = this.minioEndpoint + "/" + (String) map.get("carModel"); |
| | | map.put("carModel",carModel); |
| | | sycar.putAll(map); |
| | | } |
| | | //筛选离线 |
| | | List<Map<String,Object>> offlineSYCarPositionList = SYCarPositionList.stream().filter(map -> ((String)map.get("stateCn")).startsWith("离线")).collect(Collectors.toList()); |
| | | for(Map<String,Object> sycar : offlineSYCarPositionList){ |
| | | Map<String,Object> map = ardSyCarMapper.getArdSyCarAndDeptByCarId((String)sycar.get("carId")); |
| | | String carModel = this.minioEndpoint + "/" + (String) map.get("carModel"); |
| | | map.put("carModel",carModel); |
| | | sycar.putAll(map); |
| | | } |
| | | Map<String,List<Map<String,Object>>> carMap = new HashMap(); |
| | |
| | | return mapResault; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<Map<String, Object>>> getSendPositionALL(String soilderId) { |
| | | Map<String, List<Map<String, Object>>> result = new HashMap(); |
| | | List<Map<String,Object>> ardAppApplicationList = ardAppApplicationMapper.selectArdAppApplicationBySoilderIdALL(soilderId); |
| | | Date date = new Date(); |
| | | //查看指挥端位置申请 |
| | | List<Map<String, Object>> resultCommanderPosition = new ArrayList(); |
| | | //查看车辆位置申请 |
| | | List<Map<String, Object>> resultSYCarsPosition = new ArrayList(); |
| | | for(Map<String, Object> map : ardAppApplicationList){ |
| | | if(((String)map.get("begin")).equals("")){ |
| | | map.put("time",""); |
| | | if(((String)map.get("applicationType")).equals("Commander")){ |
| | | resultCommanderPosition.add(map); |
| | | }else if(((String)map.get("applicationType")).equals("SYCar")){ |
| | | resultSYCarsPosition.add(map); |
| | | } |
| | | }else{ |
| | | Long interval = date.getTime() - Long.parseLong((String)map.get("begin")); |
| | | interval = 24 * 60 * 60 * 1000 - interval; |
| | | Long hour = interval / (60 * 60 * 1000); |
| | | Long min = (interval - hour * 60 * 60 * 1000) / (60 * 1000); |
| | | Long second = (interval - hour * 60 * 60 * 1000 - min * 60 * 1000) / 1000; |
| | | map.put("time",hour + "时" + min + "分" + second + "秒"); |
| | | if(((String)map.get("applicationType")).equals("Commander")){ |
| | | resultCommanderPosition.add(map); |
| | | }else if(((String)map.get("applicationType")).equals("SYCar")){ |
| | | resultSYCarsPosition.add(map); |
| | | } |
| | | } |
| | | } |
| | | result.put("commander",resultCommanderPosition); |
| | | result.put("SYCars",resultSYCarsPosition); |
| | | return result; |
| | | } |
| | | |
| | | public List<Long> getOwnAndChildrenDeptIdList(List<Long> deptIdList,List<Long> deptIdListr){ |
| | | deptIdListr.addAll(deptIdList); |
| | | List<Long> result = sysDeptMapper.getChildrenDeptIdList(deptIdList); |