Kaynağa Gözat

提交设备上传图片相关,根据租户分开

yf_zn 11 ay önce
ebeveyn
işleme
79997f8120

+ 3 - 5
src/main/java/com/yunfeiyun/agmp/iots/device/serviceImp/IHikVisionEzvizDeviceImpl.java

@@ -42,9 +42,7 @@ import java.util.stream.Collectors;
 @Slf4j
 @Component(value = ServiceNameConst.SERVICE_EZVIZ_MINITOR)
 public class IHikVisionEzvizDeviceImpl extends HttpDeviceAbstractImpl implements IHikVisionEzvizDevice {
-    
-    @Resource
-    private RedisCacheManager redisCacheManager;
+
     @Resource
     private IIotCmdlogService iotCmdlogService;
     @Resource
@@ -117,7 +115,7 @@ public class IHikVisionEzvizDeviceImpl extends HttpDeviceAbstractImpl implements
                 iotMonitorCapture.setDevBid(iotDevice.getDevBid());
                 iotMonitorCapture.setPicBid(iotMonitorCapture.getUUId());
                 iotMonitorCapture.setPicCreatedDate(DateUtils.dateTimeNow());
-                iotMonitorCapture.setPicUrl(resManager.saveMonitorHttpsImg(picUrl, ResConstants.BizType.EZVIZ_CAPTURE,devCode + "/" + new Date().getTime() + "-" + UUID.fastUUID(),"jpg"));
+                iotMonitorCapture.setPicUrl(resManager.saveMonitorHttpsImg(picUrl, ResConstants.BizType.EZVIZ_CAPTURE,devCode + "/" + new Date().getTime() + "-" + UUID.fastUUID(),"jpg",iotDevice.getTid()));
                 iotMonitorCapture.setTid(iotDevice.getTid());
                 mongoService.saveOne(iotMonitorCapture);
             }
@@ -202,7 +200,7 @@ public class IHikVisionEzvizDeviceImpl extends HttpDeviceAbstractImpl implements
             log.error("同步海康设备数据失败",e);
         }
     }
-    
+
     public EzvizHttpClient ezvizHttpClient(IotDevice iotDevice){
         return (EzvizHttpClient) httpManager.getHttpClientByDevice(iotDevice);
     }

+ 1 - 1
src/main/java/com/yunfeiyun/agmp/iots/device/serviceImp/IotBigDataMonitorDeviceImpl.java

@@ -39,7 +39,7 @@ public class IotBigDataMonitorDeviceImpl extends DeviceAbstractImpl implements D
             iotMonitorCapture.setDevBid(iotDevice.getDevBid());
             iotMonitorCapture.setPicBid(iotMonitorCapture.getUUId());
             iotMonitorCapture.setPicCreatedDate(DateUtils.dateTimeNow());
-            iotMonitorCapture.setPicUrl(resManager.saveMonitorHttpsImg(picUrl, ResConstants.BizType.EZVIZ_CAPTURE,iotMonitorCapture.getPicBid(),"jpg"));
+            iotMonitorCapture.setPicUrl(resManager.saveMonitorHttpsImg(picUrl, ResConstants.BizType.EZVIZ_CAPTURE,iotMonitorCapture.getPicBid(),"jpg",iotDevice.getTid()));
             iotMonitorCapture.setTid(iotDevice.getTid());
             mongoService.saveOne(iotMonitorCapture);
         }

+ 0 - 28
src/main/java/com/yunfeiyun/agmp/iots/device/serviceImp/IotBzyImgService.java

@@ -43,23 +43,7 @@ public class IotBzyImgService {
      * @return
      */
     public void insertIotBzyimg(IotDevice iotDevice, JSONObject jsonObject, String devUpdateddate) {
-        long cbdimgPestnum;
-
         String cbdimgAddr = this.getJsonData("Image", jsonObject);
-        //String cbdrecogResult = this.getJsonData("Result", jsonObject);
-        //String cbdrecogAddr = this.getJsonData("Result_image", jsonObject);
-        //String cbdimgPestnumStr = this.getJsonData("Result_c", jsonObject);
-        //String cbdrecogMachinemark = this.getJsonData("Result_code", jsonObject);
-
-     /*   try {
-            cbdimgPestnum = Long.parseLong(cbdimgPestnumStr.split(",")[1]);
-        } catch (Exception e) {
-            cbdimgPestnum = 0L;
-        }*/
-
-    /*    IotBzyPestRecogService.PestRecogResult pestRecogResult = iotBzyPestRecogService.getIotPestrecogResult(
-                iotDevice, cbdrecogResult);*/
-
         // 保存 测报灯基础图片信息
         IotBzyimg iotBzyimg = new IotBzyimg();
         iotBzyimg.setBzyimgBid(iotBzyimg.getUUId());
@@ -71,19 +55,7 @@ public class IotBzyImgService {
         iotBzyimg.setBzyimgDelstatus("0");
 
         mongoService.saveOne(iotBzyimg);
-
-        //String recogBid = iotBzyimg.getUUId();
-
-        // 保存 测报灯图片识别信息
-        /*IotBzyrecog iotBzyrecog = iotBzyRecogService.saveIotBzyRecog(recogBid, iotBzyimg, iotDevice, cbdrecogAddr,
-                cbdrecogResult, null);*/
-
-        // 保存 虫情识别信息
-        //iotBzyPestRecogService.savePestRecog(pestRecogResult, iotDevice, iotBzyrecog);
     }
 
-    public String getBzyPestRecogImgOssUrl(String originalImgOssUrl, String imgId, List<JSONObject> points) {
-        return BzyInsectIdentifyUtil.identifyAndUpload(originalImgOssUrl, ResConstants.BizType.CBD_RECOGNITION_MARKERS_AI, imgId, points, iotPestService.selectIotPestMapAll());
-    }
 }
 

+ 3 - 3
src/main/java/com/yunfeiyun/agmp/iots/device/serviceImp/IotCbdImgService.java

@@ -86,7 +86,7 @@ public class IotCbdImgService {
             for(Object o: JSONArray.parseArray(cbdrecogMachinemark)){
                 points.add((JSONObject) o);
             }
-            cbdrecogAddr = getPestRecogImgOssUrl(iotCbdimg.getCbdimgAddr(), recogBid, points);
+            cbdrecogAddr = getPestRecogImgOssUrl(iotCbdimg.getCbdimgAddr(), recogBid, points,iotDevice.getTid());
         }
 
         // 生成测报灯图片识别信息
@@ -189,8 +189,8 @@ public class IotCbdImgService {
         return iotCbdimg;
     }
 
-    public String getPestRecogImgOssUrl(String originalImgOssUrl, String imgId, List<JSONObject> points){
-        return CbdInsectIdentifyUtil.identifyAndUpload(originalImgOssUrl, ResConstants.BizType.CBD_RECOGNITION_MARKERS_AI,imgId,points,iotPestService.selectIotPestMapAll());
+    public String getPestRecogImgOssUrl(String originalImgOssUrl, String imgId, List<JSONObject> points,String tid){
+        return CbdInsectIdentifyUtil.identifyAndUpload(originalImgOssUrl, ResConstants.BizType.CBD_RECOGNITION_MARKERS_AI,imgId,points,iotPestService.selectIotPestMapAll(),tid);
     }
 
     private JSONObject getRecogeResult(String cbdimgBid, String cbdrecogType) throws Exception{

+ 2 - 2
src/main/java/com/yunfeiyun/agmp/iots/device/serviceImp/YunRuiMonitorService.java

@@ -113,7 +113,7 @@ public class YunRuiMonitorService extends HttpDeviceAbstractImpl implements IYun
             iotMonitorCapture.setPicModifieddate(DateUtils.dateTimeNow());
             iotMonitorCapture.setDevCode(iotDevice.getDevCode());
             //此处的图片可能还没有返回过来,需要重试获取
-            String saveUrl = resManager.saveMonitorHttpsImg(url, ResConstants.BizType.DAHUA_YUNRUI_MONITOR_CAPTURE, iotDevice.getDevCode() + "/" + System.currentTimeMillis() + "-" + UUID.fastUUID(), "jpg");
+            String saveUrl = resManager.saveMonitorHttpsImg(url, ResConstants.BizType.DAHUA_YUNRUI_MONITOR_CAPTURE, iotDevice.getDevCode() + "/" + System.currentTimeMillis() + "-" + UUID.fastUUID(), "jpg",iotDevice.getTid());
             if (!StringUtils.isEmpty(saveUrl)) {
                 iotMonitorCapture.setPicUrl(saveUrl);
                 iotMonitorCapture.setSaveStatus("1");
@@ -140,7 +140,7 @@ public class YunRuiMonitorService extends HttpDeviceAbstractImpl implements IYun
     public void retrySaveOssPicFromGet(IotMonitorCapture iotMonitorCapture) {
         //重试次数+1
         iotMonitorCapture.setRetrySize(iotMonitorCapture.getRetrySize() + 1);
-        String saveUrl = resManager.saveMonitorHttpsImg(iotMonitorCapture.getTempUrl(), ResConstants.BizType.DAHUA_YUNRUI_MONITOR_CAPTURE, iotMonitorCapture.getDevCode() + "/" + System.currentTimeMillis() + "-" + UUID.fastUUID(), "jpg");
+        String saveUrl = resManager.saveMonitorHttpsImg(iotMonitorCapture.getTempUrl(), ResConstants.BizType.DAHUA_YUNRUI_MONITOR_CAPTURE, iotMonitorCapture.getDevCode() + "/" + System.currentTimeMillis() + "-" + UUID.fastUUID(), "jpg",iotMonitorCapture.getTid());
         if (!StringUtils.isEmpty(saveUrl)) {
             Map param = new HashMap<>();
             param.put("id", iotMonitorCapture.getPicBid());