| | |
| | | } |
| | | }; |
| | | carPositionTimer.scheduleAtFixedRate(carPositionTask,date,3*1000);//å¯ç¨ |
| | | |
| | | //车è¾å®æ¶ä½ç½®çº¿ç¨ |
| | | PushClientImplAlarm pushClientImplAlarm = new PushClientImplAlarm(ip,ardSyUserList.get(0).getUserId(),ardSyUserList.get(0).getPassword()); |
| | | Thread pushClientImplAlarmThread = new Thread(pushClientImplAlarm); |
| | |
| | | return Results.succeed(); |
| | | }else { |
| | | map.put("userId",ardSyUser.getUserId()); |
| | | map.put("password",ardSyUser.getPassword()); |
| | | map.put("passwords",DigestUtils.md5Hex(ardSyUser.getPassword())); |
| | | } |
| | | return Results.succeed(map); |
| | | } |
| | |
| | | ArdSyUser ardSyUser = iArdSyUserService.userById(usersId); |
| | | String carId = map.get("carId"); |
| | | String syURL = sysConfigService.getSYURL(); |
| | | return ardSyCarService.getCarGPSBycarId(usersId,carId,syURL,ardSyUser); |
| | | return Results.succeed(ardSyCarService.getCarGPSBycarId(usersId,carId,syURL,ardSyUser)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('sy:syCar:chaseCarByCarId')") |
| | |
| | | long tenSeconds = 1000L; |
| | | Date beforeTenSeconds = new Date(currentTime.getTime() - tenSeconds); |
| | | String startTime = sdf.format(beforeTenSeconds); |
| | | System.out.println(startTime); |
| | | String usersId = SecurityUtils.getUserId(); |
| | | ArdSyUser ardSyUser = iArdSyUserService.userById(usersId); |
| | | String syURL = sysConfigService.getSYURL(); |
| | | String sessionId = ardSyCarService.getSessionId(syURL,ardSyUser); |
| | | System.out.println(sessionId); |
| | | System.out.println("sessionId:"+sessionId); |
| | | //è·åæåééä¿¡æ¯ |
| | | Map<String, Object> result = ardSyCarService.getCarPicture(carId,syURL,sessionId); |
| | | String vs = ""; |
| | |
| | | //æåééä¿¡æ¯ |
| | | Map<String,Object> map = ((List<Map<String,Object>>)result.get("list")).get(0); |
| | | Map<String, Object> videos = (Map<String, Object>) JSON.parse((String) map.get("videos")); |
| | | System.out.println(videos); |
| | | System.out.println("ééï¼"+videos); |
| | | vs = (String) videos.get("vs"); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error("è¯¥è½¦è¾æ²¡ææåééæ ç
§çæ°æ®ï¼"); |
| | |
| | | } |
| | | //æç
§ |
| | | Map<String,Object> sendCmdMap = ardSyCarService.sendCmd(ardSyUser.getUserId(),syURL,sessionId,carId,channelList); |
| | | System.out.println(sendCmdMap); |
| | | System.out.println("æç
§ï¼"+sendCmdMap); |
| | | //è·åç
§ç |
| | | Map<String,Object> photoMap = ardSyCarService.getPhoto(syURL,carId,sessionId,startTime); |
| | | System.out.println(photoMap); |
| | | System.out.println("è·åç
§çï¼"+photoMap); |
| | | return AjaxResult.success(photoMap); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.sy.domain.ArdSyCarRtu; |
| | | import com.ruoyi.sy.domain.ArdSyUser; |
| | | import com.ruoyi.sy.mapper.ArdAccessFenceMapper; |
| | | import com.ruoyi.sy.param.AddCarParam; |
| | | import com.ruoyi.sy.service.ArdAccessFenceService; |
| | | import com.ruoyi.sy.service.ArdSyCarLockService; |
| | | import com.ruoyi.sy.service.IArdSyCarService; |
| | |
| | | String usersId = SecurityUtils.getUserId(); |
| | | ArdSyUser ardSyUser = iArdSyUserService.userById(usersId); |
| | | String syURL = sysConfigService.getSYURL(); |
| | | Results results = ardSyCarService.getCarGPSBycarId(usersId,carId,syURL,ardSyUser); |
| | | Map<String,Object> map = (Map<String, Object>) results.getData(); |
| | | Map<String,Object> map = ardSyCarService.getCarGPSBycarId(usersId,carId,syURL,ardSyUser); |
| | | List list1 = (List) map.get("list"); |
| | | JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(list1.get(0))); |
| | | String carPlate = (String) jsonObject.get("carPlate"); |
| | |
| | | String usersId = SecurityUtils.getUserId(); |
| | | ArdSyUser ardSyUser = iArdSyUserService.userById(usersId); |
| | | String syURL = sysConfigService.getSYURL(); |
| | | Results results = ardSyCarService.getCarGPSBycarId(usersId,carId,syURL,ardSyUser); |
| | | Map<String,Object> map = (Map<String, Object>) results.getData(); |
| | | Map<String,Object> map = ardSyCarService.getCarGPSBycarId(usersId,carId,syURL,ardSyUser); |
| | | List list1 = (List) map.get("list"); |
| | | JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(list1.get(0))); |
| | | String carPlate = (String) jsonObject.get("carPlate"); |
| | |
| | | @GetMapping("/queryCar") |
| | | @ApiOperation("æ¸
æ·¤æå¨æ·»å è½¦è¾æ¥è¯¢") |
| | | public AjaxResult queryCar(){ |
| | | List<ArdAccessFence> ardAccessFences = ardAccessFenceService.all(); |
| | | String url = sysConfigService.selectConfigByKey("minioIn")+"/"; |
| | | List<ArdAccessFence> ardAccessFences = ardAccessFenceService.all(url); |
| | | List<String> carIdList = new ArrayList<>(); |
| | | for (int i = 0; i < ardAccessFences.size(); i++) { |
| | | String carId = ardAccessFences.get(i).getCarId(); |
| | |
| | | |
| | | @PostMapping("/addCar") |
| | | @ApiOperation("æ¸
æ·¤æå¨æ·»å 车è¾ä¿å") |
| | | public AjaxResult addCar(String carId){ |
| | | List<CarVo> list = ardSyCarLockService.addCarBefore(carId); |
| | | public AjaxResult addCar(@RequestBody AddCarParam addCarParam){ |
| | | List<CarVo> list = ardSyCarLockService.addCarBefore(addCarParam.getCarId()); |
| | | analysis(list); |
| | | if(list.size()>0){ |
| | | return AjaxResult.success(ardAccessFenceService.addCar(list.get(0))); |
| | | String usersId = SecurityUtils.getUserId(); |
| | | ArdSyUser ardSyUser = iArdSyUserService.userById(usersId); |
| | | String syURL = sysConfigService.getSYURL(); |
| | | Map<String, Object> map = ardSyCarService.getCarGPSBycarId(usersId,addCarParam.getCarId(),syURL,ardSyUser); |
| | | List list1 = (List) map.get("list"); |
| | | JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(list1.get(0))); |
| | | String lng = (String) jsonObject.get("lng"); |
| | | String lat = (String) jsonObject.get("lat"); |
| | | return AjaxResult.success(ardAccessFenceService.addCar(list.get(0),addCarParam.getIsAlarm(),lng,lat)); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | |
| | | return AjaxResult.success(ardAccessFenceService.delCar(id)); |
| | | } |
| | | |
| | | @PutMapping("/addCar") |
| | | @PutMapping("/cleanAlarm") |
| | | @ApiOperation("æ¸
空æ¥è¦") |
| | | public AjaxResult updCarAlarm(String id){ |
| | | return AjaxResult.success(ardAccessFenceService.updCarAlarm(id)); |
| | |
| | | for (int i = 0; i < list.size(); i++) { |
| | | CarVo carVo = list.get(i); |
| | | String carId = carVo.getCarId(); |
| | | Results results = ardSyCarService.getCarGPSBycarId(usersId,carId,syURL,ardSyUser); |
| | | Map<String,Object> map = (Map<String, Object>) results.getData(); |
| | | Map<String,Object> map = ardSyCarService.getCarGPSBycarId(usersId,carId,syURL,ardSyUser); |
| | | List list1 = (List) map.get("list"); |
| | | JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(list1.get(0))); |
| | | String carPlate = (String) jsonObject.get("carPlate"); |
| | |
| | | import com.ruoyi.sy.domain.*; |
| | | import com.ruoyi.sy.param.OilWallParam; |
| | | import com.ruoyi.sy.service.*; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private ArdAccessNumService ardAccessNumService; |
| | | |
| | | @Autowired |
| | | private ISysConfigService sysConfigService; |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ·»å çµåå´æ ") |
| | |
| | | @GetMapping("/wallCar") |
| | | @ApiOperation("ææè¿å
¥å´æ ç车è¾") |
| | | public AjaxResult wallCar(){ |
| | | return AjaxResult.success(ardAccessFenceService.all()); |
| | | String url = sysConfigService.selectConfigByKey("minioIn")+"/"; |
| | | return AjaxResult.success(ardAccessFenceService.all(url)); |
| | | } |
| | | |
| | | @GetMapping("/rollTime") |
| | |
| | | private String alarmLat; |
| | | private String carModel; |
| | | private String drct; |
| | | private Integer isAlarm; |
| | | } |
| | |
| | | } |
| | | } |
| | | }else { |
| | | //夿æ¯å¦ä¸ºæå¨æ·»å è½¦è¾ |
| | | if(ardAccessFence.getIsAlarm()==0){ |
| | | ardAccessFence.setLng(lng); |
| | | ardAccessFence.setLat(lat); |
| | | ((ArdAccessFenceServiceImpl)SpringUtils.getBean("ArdAccessFenceServiceImpl")).updAccess(ardAccessFence); |
| | | }else if(ardAccessFence.getIsAlarm() == 1){ |
| | | ardAccessFence.setNowWallName(null); |
| | | //妿å¨è·¯ä¸å¤æåæ æ¯å¦ä¸ä¸æ¬¡ä¸æ · |
| | | if(ardAccessFence.getLng().equals(lng) && ardAccessFence.getLat().equals(lat)){ |
| | | //å¦æåæ ä¸æ ·æ¶é´ç¸å |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date nowTime = sdf.parse(time); |
| | | Date lastTime = sdf.parse(ardAccessFence.getLastTime()); |
| | | Long diff = (nowTime.getTime() - lastTime.getTime())/1000; |
| | | ArdAccessNum list = ((ArdAccessNumServiceImpl) SpringUtils.getBean("ArdAccessNumServiceImpl")).queryNum(); |
| | | if(list==null){ |
| | | int alarm = list.getAlarm(); |
| | | if(diff>=alarm){ |
| | | ardAccessFence.setIsWarning(1); |
| | | ardAccessFence.setAlarmLat(lat); |
| | | ardAccessFence.setAlarmLng(lng); |
| | | ((ArdAccessFenceServiceImpl) SpringUtils.getBean("ArdAccessFenceServiceImpl")).updAccess(ardAccessFence); |
| | | } |
| | | } |
| | | }else { |
| | | //妿ä¸ä¸æ ·æ´æ°åæ |
| | | ardAccessFence.setLat(lat); |
| | | ardAccessFence.setLng(lng); |
| | | ardAccessFence.setLastTime(time); |
| | | ((ArdAccessFenceServiceImpl) SpringUtils.getBean("ArdAccessFenceServiceImpl")).updAccess(ardAccessFence); |
| | | } |
| | | }else { |
| | | //å¦æè½¦è¾ææ°æ®å¤ææ¯å¦æè¿å
¥å´æ IDï¼å¦ææ²¡ææ´æ°æèµå¼ç»çº¬åº¦ï¼å¤ææ¯å¦è¿å
¥å´æ |
| | | if(ardAccessFence.getIntoShipmentId()==null){ |
| | | ardAccessFence.setLng(lng); |
| | |
| | | } |
| | | } |
| | | } |
| | | //æ¸
æ·¤å
¥æ ç»æ------------ |
| | | } |
| | | //æ¸
æ·¤ç»æ------------ |
| | | |
| | | gpsMap.putAll(result); |
| | | String ancestors = (String) gpsMap.get("ancestors");//è·åç¶çº§é¨é¨ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sy.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | */ |
| | | @Data |
| | | public class AddCarParam { |
| | | private String carId; |
| | | private Integer isAlarm; |
| | | } |
| | |
| | | |
| | | int delAccess(String carId); |
| | | |
| | | List<ArdAccessFence> all(); |
| | | List<ArdAccessFence> all(String url); |
| | | |
| | | int delCar(String id); |
| | | |
| | | int updCarAlarm(String id); |
| | | |
| | | int addCar(CarVo carVo); |
| | | int addCar(CarVo carVo,Integer isAlarm,String lng,String lat); |
| | | } |
| | |
| | | |
| | | Results getCarGPSTrack(Map<String,String> map,String syURL, ArdSyUser ardSyUser); |
| | | |
| | | Results getCarGPSBycarId(String usersId, String carId, String syURL, ArdSyUser ardSyUser); |
| | | Map<String, Object> getCarGPSBycarId(String usersId, String carId, String syURL, ArdSyUser ardSyUser); |
| | | |
| | | String getSessionId(String syURL,ArdSyUser ardSyUser); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ArdAccessFence> all() { |
| | | return ardAccessFenceMapper.selectList(null); |
| | | public List<ArdAccessFence> all(String url) { |
| | | List<ArdAccessFence> list = ardAccessFenceMapper.selectList(null); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | ArdAccessFence ardAccessFence = list.get(i); |
| | | ardAccessFence.setCarModel(url+ardAccessFence.getCarModel()); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int addCar(CarVo carVo) { |
| | | public int addCar(CarVo carVo,Integer isAlarm,String lng,String lat) { |
| | | ArdAccessFence ardAccessFence = new ArdAccessFence(); |
| | | ardAccessFence.setId(String.valueOf(UUID.randomUUID())); |
| | | ardAccessFence.setCarId(carVo.getCarId()); |
| | |
| | | ardAccessFence.setDeptName(carVo.getDeptName()); |
| | | ardAccessFence.setCarModel(carVo.getCarModel()); |
| | | ardAccessFence.setIsWarning(0); |
| | | ardAccessFence.setIsAlarm(isAlarm); |
| | | ardAccessFence.setLng(lng); |
| | | ardAccessFence.setLat(lat); |
| | | return ardAccessFenceMapper.insert(ardAccessFence); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Results getCarGPSBycarId(String usersId, String carId, String syURL, ArdSyUser ardSyUser) { |
| | | 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(); |
| | |
| | | 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 |