| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, Object> allListByUser(ArdSyUser ardSyUser, String syURL, String usersId) { |
| | | public Map<String, Object> allListByUser(ArdSyUser ardSyUser, String syURL, String usersId, List<Long> deptList) { |
| | | Map<String, Object> result0 = new HashMap(); |
| | | //判断关联表是否有数据 |
| | | if (ardSyUser != null) { |
| | |
| | | map.put("list", new ArrayList()); |
| | | return map; |
| | | } |
| | | QueryWrapper<ArdSyCar> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.in("dept_id", deptList); |
| | | List<ArdSyCar> carListTable = ardSyCarMapper.selectList(queryWrapper); |
| | | int online = 0; |
| | | for (Map<String, Object> map : (List<Map<String, Object>>) result0.get("list")) { |
| | | Map<String, Object> resultMap = sYClient.getTeamCarList(syURL, (String) map.get("teamId"), result.get("sessionId")); |
| | | List<Map<String, Object>> carList = (List<Map<String, Object>>) resultMap.get("carList"); |
| | | if(carList.size()>0){ |
| | | for (int i = 0; i < carList.size(); i++) { |
| | | String carId = (String) carList.get(i).get("carId"); |
| | | Boolean isCar = false; |
| | | for (int j = 0; j < carListTable.size(); j++) { |
| | | ArdSyCar ardSyCar = carListTable.get(j); |
| | | if (carId.equals(ardSyCar.getCarId())) { |
| | | isCar = true; |
| | | break; |
| | | } |
| | | } |
| | | if(!isCar){ |
| | | carList.remove(carList.get(i)); |
| | | } |
| | | } |
| | | } |
| | | for (Map<String, Object> m : carList) { |
| | | if (((String) m.get("stateCn")).contains("在线")) { |
| | | online = online + 1; |
| | |
| | | continue; |
| | | } |
| | | } |
| | | for (Map<String, Object> m : (List<Map<String, Object>>) result0.get("list")) { |
| | | if (((String) m.get("teamId")).equals(((String) map.get("teamId")))) { |
| | | map.put("count", Integer.parseInt((String) m.get("carNum"))); |
| | | } |
| | | } |
| | | // for (Map<String, Object> m : (List<Map<String, Object>>) result0.get("list")) { |
| | | // if (((String) m.get("teamId")).equals(((String) map.get("teamId")))) { |
| | | // map.put("count", Integer.parseInt((String) m.get("carNum"))); |
| | | // } |
| | | // } |
| | | map.put("count", carList.size()); |
| | | map.put("online", online); |
| | | online = 0; |
| | | } |
| | |
| | | queryWrapper.in("dept_id", deptList); |
| | | List<ArdSyCar> carList = ardSyCarMapper.selectList(queryWrapper); |
| | | //对比把匹配到的数据添加到list中 |
| | | for (Map<String, String> m : list) { |
| | | String carId = m.get("carId"); |
| | | for (int i = 0; i < carList.size(); i++) { |
| | | ArdSyCar ardSyCar = carList.get(i); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | String carId = list.get(i).get("carId"); |
| | | Boolean isCar = false; |
| | | for (int j = 0; j < carList.size(); j++) { |
| | | ArdSyCar ardSyCar = carList.get(j); |
| | | if (carId.equals(ardSyCar.getCarId())) { |
| | | /*String url = ""; |
| | | if (ardSyCar.getCarPicture() != null) { |
| | |
| | | url = ardSyCar.getCarPicture().split("sycar")[0]; |
| | | } |
| | | }*/ |
| | | m.put("carModel", this.minioEndpoint + "/" + ardSyCar.getCarModel());//zns |
| | | list.get(i).put("carModel", this.minioEndpoint + "/" + ardSyCar.getCarModel());//zns |
| | | //m.put("carModel",ardSyCar.getCarModel()); |
| | | m.put("carTypeArd", ardSyCar.getCarType()); |
| | | m.put("carBrand", ardSyCar.getCarBrand()); |
| | | m.put("carPicture", ardSyCar.getCarPicture()); |
| | | list.get(i).put("carTypeArd", ardSyCar.getCarType()); |
| | | list.get(i).put("carBrand", ardSyCar.getCarBrand()); |
| | | list.get(i).put("carPicture", ardSyCar.getCarPicture()); |
| | | isCar = true; |
| | | break; |
| | | } |
| | | } |
| | | if(!isCar){ |
| | | list.remove(list.get(i)); |
| | | } |
| | | } |
| | | return list; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Results getCarGPSBycarId(String usersId, String carId, String syURL, ArdSyUser ardSyUser) { |
| | | Map<String, String> result = logInMap.get(Integer.parseInt(usersId)); |
| | | public Map<String, Object> getCarGPSBycarId(String usersId, String carId, String syURL, ArdSyUser ardSyUser) { |
| | | // Map<String, String> result = logInMap.get(Integer.parseInt(usersId)); |
| | | //31用户名密码 |
| | | String username31 = ardSyUser.getUserId(); |
| | | String password31 = ardSyUser.getPassword(); |
| | | String passwordMd5 = DigestUtils.md5Hex(password31); |
| | | Map<String, Object> result1 = sYClient.logIn(syURL, passwordMd5, username31); |
| | | result = new HashMap(); |
| | | Map<String, String> result = new HashMap(); |
| | | result.put("userId", username31); |
| | | result.put("sessionId", (String) result1.get("sessionId")); |
| | | Map<String, Object> result0 = new HashMap(); |
| | | result0 = sYClient.getCarNearPositionByCarId(syURL, carId, result.get("userId"), result.get("sessionId")); |
| | | return Results.succeed(result0); |
| | | return sYClient.getCarNearPositionByCarId(syURL, carId, result.get("userId"), result.get("sessionId")); |
| | | } |
| | | |
| | | @Override |
| | |
| | | params.put("action", "0");//上传模式 |
| | | String paramsStr = com.alibaba.fastjson2.JSON.toJSONString(params); |
| | | paramsStr = URLEncoder.encode(paramsStr,"UTF-8"); |
| | | System.out.println(paramsStr); |
| | | System.out.println("拍照参数:"+paramsStr); |
| | | return sYClient.sendCmd(syURL,userId,carId,301,"MediaTake",paramsStr,sessionId); |
| | | // } |
| | | // return sendCmdMap; |
| | |
| | | @Override |
| | | public Map<String, Object> getPhoto(String syURL, String carId, String sessionId,String startTime) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | return sYClient.getPhoto(syURL,carId,startTime,sdf.format(new Date()),sessionId); |
| | | String endTime = sdf.format(new Date()); |
| | | System.out.println("开始时间:"+startTime+" 结束时间:"+endTime); |
| | | return sYClient.getPhoto(syURL,carId,startTime,endTime,sessionId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return ardSyCarMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getAlarmHPfmCountDetail(String sessionId, String usersId, String carId, String startTime, String endTime, String syURL) { |
| | | // System.out.println("sessionId------"+sessionId+",usersId-----"+usersId+",carId-----"+carId+",startTime----"+startTime+",endTime----"+endTime+",syURL----"+syURL); |
| | | return sYClient.getAlarmHPfmCountDetail(syURL,carId,sessionId,startTime,endTime); |
| | | } |
| | | |
| | | } |