| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.util.videoGateway.model.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | |
| | | log.error("token失效,重新登录"); |
| | | if(num == 3){ |
| | | log.error("token失效,请联系管理员"); |
| | | return null; |
| | | throw new RuntimeException("token失效,请联系管理员"); |
| | | } |
| | | num++; |
| | | accountLogin = null; |
| | |
| | | Integer code = result.getInteger("code"); |
| | | if(0 != code){ |
| | | log.error(result.getString("msg")); |
| | | return null; |
| | | throw new RuntimeException("【2018年协议发送拍摄指令接口】失败:" + execute.body()); |
| | | } |
| | | //返回文件ID |
| | | return result.getString("data"); |
| | | String data = result.getString("data"); |
| | | if(ToolUtil.isEmpty(data)){ |
| | | if(num == 12){ |
| | | log.error(result.getString("msg")); |
| | | throw new RuntimeException("【2018年协议发送拍摄指令接口】12次(1分钟)失败:" + execute.body()); |
| | | } |
| | | num++; |
| | | try { |
| | | Thread.sleep(5000); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return cameraShot2018(terminalId, channelId, num); |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | |
| | |
| | | log.error("token失效,重新登录"); |
| | | if(num == 3){ |
| | | log.error("token失效,请联系管理员"); |
| | | return null; |
| | | throw new RuntimeException("token失效,请联系管理员"); |
| | | } |
| | | num++; |
| | | accountLogin = null; |
| | |
| | | Integer code = result.getInteger("code"); |
| | | if(0 != code){ |
| | | log.error(result.getString("msg")); |
| | | return null; |
| | | throw new RuntimeException("【2023年协议发送拍摄指令接口】失败:" + execute.body()); |
| | | } |
| | | //返回文件ID |
| | | return result.getString("data"); |
| | | String data = result.getString("data"); |
| | | if(ToolUtil.isEmpty(data)){ |
| | | if(num == 12){ |
| | | log.error(result.getString("msg")); |
| | | throw new RuntimeException("【2023年协议发送拍摄指令接口】12次(1分钟)失败:" + execute.body()); |
| | | } |
| | | num++; |
| | | try { |
| | | Thread.sleep(5000); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return cameraShot2023(vehicleId, vehicleType, terminalId, channelId, num); |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | |
| | |
| | | log.error("token失效,重新登录"); |
| | | if(num == 3){ |
| | | log.error("token失效,请联系管理员"); |
| | | return null; |
| | | throw new RuntimeException("token失效,请联系管理员"); |
| | | } |
| | | num++; |
| | | accountLogin = null; |
| | |
| | | Integer code = result.getInteger("code"); |
| | | if(0 != code){ |
| | | log.error(result.getString("msg")); |
| | | return null; |
| | | throw new RuntimeException("【2018年协议车辆获取拍摄图片】失败:" + execute.body()); |
| | | } |
| | | //图片地址 |
| | | String data = result.getString("data"); |
| | | if(null == data){ |
| | | return null; |
| | | if(ToolUtil.isEmpty(data)){ |
| | | if(num == 12){ |
| | | log.error(result.getString("msg")); |
| | | throw new RuntimeException("【2018年协议车辆获取拍摄图片】12次(1分钟)失败:" + execute.body()); |
| | | } |
| | | num++; |
| | | try { |
| | | Thread.sleep(5000); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return getCameraShotByFileId2018(terminalId, fileId, num); |
| | | } |
| | | data = data.replaceAll(";", ""); |
| | | return "https://zhyn-pic.cg.gz.gov.cn" + data; |
| | |
| | | log.error("token失效,重新登录"); |
| | | if(num == 3){ |
| | | log.error("token失效,请联系管理员"); |
| | | return null; |
| | | throw new RuntimeException("token失效,请联系管理员"); |
| | | } |
| | | num++; |
| | | accountLogin = null; |
| | |
| | | Integer code = result.getInteger("code"); |
| | | if(0 != code){ |
| | | log.error(result.getString("msg")); |
| | | return null; |
| | | throw new RuntimeException("【2023年协议车辆获取拍摄图片】失败:" + execute.body()); |
| | | } |
| | | //图片地址 |
| | | String data = result.getString("data"); |
| | | if(null == data){ |
| | | return null; |
| | | if(ToolUtil.isEmpty(data)){ |
| | | if(num == 12){ |
| | | log.error(result.getString("msg")); |
| | | throw new RuntimeException("【2023年协议车辆获取拍摄图片】12次(1分钟)失败:" + execute.body()); |
| | | } |
| | | num++; |
| | | try { |
| | | Thread.sleep(5000); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return getCameraShotByFileId2023(fileId, num); |
| | | } |
| | | data = data.replaceAll(";", ""); |
| | | return "https://zhyn-pic.cg.gz.gov.cn" + data; |