| | |
| | | @Value("${PARCEL_URL}") |
| | | private String PARCEL_URL; |
| | | |
| | | @Value("${PARCEL_PICTURE_URL}") |
| | | private String PARCEL_PICTURE_URL; |
| | | |
| | | @Value("${PARCEL_DETAIL_RUL}") |
| | | private String PARCEL_DETAIL_RUL; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | private List<Object> getParcelData(ConditionVo conditionVo, String url, String key, String secret) { |
| | | //1.创建map对象,用于存储请求接口的秘钥 |
| | | Map<String, String> map = new HashMap<>(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | String startDate = null; |
| | | String endDate = null; |
| | | //2.2查询本天的数据 |
| | |
| | | Map<String, Object> objectMap = (Map<String, Object>) object;//取出list里面的值转为map |
| | | //对比时间和objCode,危险品,刀具,枪支等 |
| | | if (time.equals(objectMap.get("dateStr").toString()) ){ |
| | | //枪支 |
| | | if (objectMap.get("objCode").toString().equals("gan")) { |
| | | count += Integer.parseInt(objectMap.get("objCount").toString()); |
| | | } |
| | | //刀具 |
| | | if (objectMap.get("objCode").toString().equals("knife")) { |
| | | count += Integer.parseInt(objectMap.get("objCount").toString()); |
| | | } |
| | | //爆炸物 |
| | | if (objectMap.get("objCode").toString().equals("boomExplosive")) { |
| | | count += Integer.parseInt(objectMap.get("objCount").toString()); |
| | | } |
| | | // //枪支 |
| | | // if (objectMap.get("objCode").toString().equals("gan")) { |
| | | // count += Integer.parseInt(objectMap.get("objCount").toString()); |
| | | // } |
| | | // //刀具 |
| | | // if (objectMap.get("objCode").toString().equals("knife")) { |
| | | // count += Integer.parseInt(objectMap.get("objCount").toString()); |
| | | // } |
| | | // //爆炸物 |
| | | // if (objectMap.get("objCode").toString().equals("boomExplosive")) { |
| | | // count += Integer.parseInt(objectMap.get("objCount").toString()); |
| | | // } |
| | | //3-20 修改不筛选危险品,由第三方筛选好 |
| | | count += Integer.parseInt(objectMap.get("objCount").toString()); |
| | | } |
| | | } |
| | | list.add(count); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取图片地址 |
| | | * @param imgUrl 图片Url |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, String> getParcelPic(String imgUrl) { |
| | | //截取图片imgKey信息 |
| | | String[] imgKeys = imgUrl.split("=", imgUrl.length()); |
| | | String imgKey = imgKeys[1]; |
| | | //封装成map对象 |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("imgKey",imgKey); |
| | | //执行http远程调用 |
| | | String s = HttpClientUtils.doGetHeaderPictureBase64(PARCEL_PICTURE_URL, PARCEL_KEY, PARCEL_SECRET, map); |
| | | map.put("imgBase64",s); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 获取包裹明细分页数据,远程调用api获取数据 |
| | | * @param conditionVo 请求参数对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object getParcelDetailPage(ConditionVo conditionVo) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | if (null!=conditionVo.getStartTime()){ |
| | | map.put("startTime", conditionVo.getStartTime()); |
| | | } |
| | | if (null!=conditionVo.getEndTime()){ |
| | | map.put("endTime", conditionVo.getEndTime()); |
| | | } |
| | | if (null!=conditionVo.getDecisioDiagramResult()){ |
| | | map.put("decisioDiagramResult", conditionVo.getDecisioDiagramResult()); |
| | | } |
| | | if (null!=conditionVo.getCurrentPage()){ |
| | | map.put("currentPage", conditionVo.getCurrentPage()); |
| | | } |
| | | if (null!=conditionVo.getPageSize()){ |
| | | map.put("pageSize", conditionVo.getPageSize()); |
| | | } |
| | | String params = HttpClientUtils.httpPost(PARCEL_DETAIL_RUL, PARCEL_KEY, PARCEL_SECRET, map); |
| | | Map<String, Object> data = (Map<String, Object>) JSONObject.parse(params); |
| | | //4.远程调用数据 |
| | | return JSONObject.parse(data.get("result").toString()); |
| | | } |
| | | } |