| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getCarPicture(String carId, String syURL, ArdSyUser ardSyUser) { |
| | | //31用户名密码 |
| | | String username31 = ardSyUser.getUserId(); |
| | | String password31 = ardSyUser.getPassword(); |
| | | String passwordMd5 = DigestUtils.md5Hex(password31); |
| | | Map<String, Object> result1 = sYClient.logIn(syURL, passwordMd5, username31); |
| | | Map<String, Object> result0 = new HashMap(); |
| | | result0 = sYClient.getCarPicture(syURL, carId, (String) result1.get("sessionId")); |
| | | return result0; |
| | | public Map<String, Object> getCarPicture(String carId, String syURL, String sessionId) { |
| | | return sYClient.getCarPicture(syURL, carId, sessionId); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> sendCmd(String syURL, ArdSyUser ardSyUser, String carId, List<String> channelList) throws UnsupportedEncodingException { |
| | | //31用户名密码 |
| | | String userId = ardSyUser.getUserId(); |
| | | public String getSessionId(String syURL,ArdSyUser ardSyUser) { |
| | | String username31 = ardSyUser.getUserId(); |
| | | String password31 = ardSyUser.getPassword(); |
| | | String password = DigestUtils.md5Hex(password31); |
| | | Map<String, Object> result1 = sYClient.logIn(syURL, password, userId); |
| | | Map<String, Object> sendCmdMap = new HashMap(); |
| | | 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 |
| | |
| | | String paramsStr = com.alibaba.fastjson2.JSON.toJSONString(params); |
| | | paramsStr = URLEncoder.encode(paramsStr,"UTF-8"); |
| | | System.out.println(paramsStr); |
| | | sendCmdMap = sYClient.sendCmd(syURL,userId,carId,301,"MediaTake",paramsStr,(String) result1.get("sessionId")); |
| | | return sYClient.sendCmd(syURL,userId,carId,301,"MediaTake",paramsStr,sessionId); |
| | | // } |
| | | return sendCmdMap; |
| | | // return sendCmdMap; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getPhoto(String syURL, String carId, ArdSyUser ardSyUser,String startTime) { |
| | | public Map<String, Object> getPhoto(String syURL, String carId, String sessionId,String startTime) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | //31用户名密码 |
| | | String username31 = ardSyUser.getUserId(); |
| | | String password31 = ardSyUser.getPassword(); |
| | | String passwordMd5 = DigestUtils.md5Hex(password31); |
| | | // System.out.println(username31+"----------"+passwordMd5); |
| | | Map<String, Object> result1 = sYClient.logIn(syURL, passwordMd5, username31); |
| | | Map<String, Object> photoMap = new HashMap(); |
| | | photoMap = sYClient.getPhoto(syURL,carId,startTime,sdf.format(new Date()),(String) result1.get("sessionId")); |
| | | return photoMap; |
| | | return sYClient.getPhoto(syURL,carId,startTime,sdf.format(new Date()),sessionId); |
| | | } |
| | | |
| | | @Override |