| | |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.sy.domain.ArdAccessFence; |
| | | import com.ruoyi.utils.gis.GisUtil; |
| | | import com.ruoyi.utils.gis.Point; |
| | | import com.ruoyi.scheduling.domian.SchedulingParam; |
| | |
| | | } |
| | | |
| | | @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 |
| | | public Map<String, Object> getCarPicture(String carId, String syURL, String sessionId) { |
| | | return sYClient.getCarPicture(syURL, carId, sessionId); |
| | | } |
| | | |
| | | @Override |
| | | public String getSessionId(String syURL,ArdSyUser ardSyUser) { |
| | | String username31 = ardSyUser.getUserId(); |
| | | String password31 = ardSyUser.getPassword(); |
| | | String passwordMd5 = DigestUtils.md5Hex(password31); |
| | | System.out.println(passwordMd5); |
| | | Map<String, Object> result1 = sYClient.logIn(syURL, passwordMd5, username31); |
| | | return (String) result1.get("sessionId"); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> sendCmd(String userId,String syURL, String sessionId, String carId, List<String> channelList) throws UnsupportedEncodingException { |
| | | // for (int i = 0; i < channelList.size(); i++) { |
| | | Map<String,String> params = new HashMap(); |
| | | params.put("channel", channelList.get(1));//选择通道1 |
| | | params.put("interval", "0");//每隔0s照一次 |
| | | params.put("photoNum", "1");//照1张 |
| | | params.put("action", "0");//上传模式 |
| | | String paramsStr = com.alibaba.fastjson2.JSON.toJSONString(params); |
| | | paramsStr = URLEncoder.encode(paramsStr,"UTF-8"); |
| | | 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"); |
| | | String endTime = sdf.format(new Date()); |
| | | System.out.println("开始时间:"+startTime+" 结束时间:"+endTime); |
| | | return sYClient.getPhoto(syURL,carId,startTime,endTime,sessionId); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getVideo(String syURL,String carId,ArdSyUser ardSyUser) { |
| | | //31用户名密码 |
| | | String username = ardSyUser.getUserId(); |
| | | String password31 = ardSyUser.getPassword(); |
| | | String password = DigestUtils.md5Hex(password31); |
| | | // Map<String, Object> result1 = sYClient.logIn(syURL, passwordMd5, username31); |
| | | return sYClient.getVideo(syURL,username,password,"黑E12401",1); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Results chaseCarByCarId(String usersId, String carId, String cycle) { |
| | |
| | | } |
| | | return filteredList; |
| | | } |
| | | |
| | | @Override |
| | | public List<ArdSyCar> all() { |
| | | QueryWrapper<ArdSyCar> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.ne("reserved_1",""); |
| | | return ardSyCarMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | } |