南昌市物联网技防平台-后台
tangzy
2021-03-22 439480489111ecb1863e2ad0ceb2ff18150366ef
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/parcel/service/impl/ParcelServiceImpl.java
@@ -31,6 +31,9 @@
   @Value("${PARCEL_URL}")
   private String PARCEL_URL;
   @Value("${PARCEL_PICTURE_URL}")
   private String PARCEL_PICTURE_URL;
   /**
@@ -255,22 +258,43 @@
            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;
   }
}