|
|
@@ -10,9 +10,11 @@ import com.yunfeiyun.agmp.common.utils.DateUtils;
|
|
|
import com.yunfeiyun.agmp.common.utils.JSONUtils;
|
|
|
import com.yunfeiyun.agmp.common.utils.SecurityUtils;
|
|
|
import com.yunfeiyun.agmp.common.utils.StringUtils;
|
|
|
+import com.yunfeiyun.agmp.iot.common.constant.mq.IotActionEnums;
|
|
|
import com.yunfeiyun.agmp.iot.common.domain.*;
|
|
|
import com.yunfeiyun.agmp.iot.common.domain.reqvo.IotCbdrecogAgainReqVo;
|
|
|
import com.yunfeiyun.agmp.iot.common.domain.reqvo.IotCbdrecogReqVo;
|
|
|
+import com.yunfeiyun.agmp.iot.common.enums.EnumCbdRecogType;
|
|
|
import com.yunfeiyun.agmp.iot.common.exception.IotBizException;
|
|
|
import com.yunfeiyun.agmp.iot.common.service.IotWeatherService;
|
|
|
import com.yunfeiyun.agmp.iot.common.service.MongoService;
|
|
|
@@ -446,44 +448,33 @@ public class IotCbdrecogServiceImpl implements IIotCbdrecogService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param reqVo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
- public IotCbdrecogResVo againRecog(IotCbdrecogAgainReqVo reqVo) {
|
|
|
- return null;
|
|
|
+ public void againRecog(IotCbdrecogAgainReqVo reqVo) {
|
|
|
+ String cbdrecogType = reqVo.getCbdrecogType();
|
|
|
+ String cbdimgBid = reqVo.getCbdimgBid();
|
|
|
+ String devBid = reqVo.getDevBid();
|
|
|
+
|
|
|
+ if (EnumCbdRecogType.findEnumByCode(cbdrecogType) == null) {
|
|
|
+ throw new IotBizException(ErrorCode.FAILURE.getCode(), "识别类型错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ IotDevice iotDevice = iotDeviceService.selectIotDeviceByDevBid(devBid);
|
|
|
+ if (iotDevice == null) {
|
|
|
+ throw new IotBizException(ErrorCode.FAILURE.getCode(), "设备不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("cbdimgBid", cbdimgBid);
|
|
|
+ IotCbdimg iotCbdimg = (IotCbdimg) mongoService.findOne(IotCbdimg.class, map, null, null);
|
|
|
+ if (iotCbdimg == null) {
|
|
|
+ throw new IotBizException(ErrorCode.FAILURE.getCode(), "图片不存在");
|
|
|
+ }
|
|
|
+ iotsMqProviderService.sendBaseDataToIots(IotActionEnums.DEVICE_CBD_AGAIN_RECORD,reqVo,"测报灯重新识别");
|
|
|
}
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * @param reqVo
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @Override
|
|
|
-// public IotCbdrecogResVo againRecog(IotCbdrecogAgainReqVo reqVo) {
|
|
|
-// String cbdrecogType = reqVo.getCbdrecogType();
|
|
|
-// String cbdimgBid = reqVo.getCbdimgBid();
|
|
|
-// String devBid = reqVo.getDevBid();
|
|
|
-//
|
|
|
-// if (EnumCbdRecogType.findEnumByCode(cbdrecogType) == null) {
|
|
|
-// throw new IotBizException(ErrorCode.FAILURE.getCode(), "识别类型错误");
|
|
|
-// }
|
|
|
-//
|
|
|
-// IotDevice iotDevice = iotDeviceService.selectIotDeviceByDevBid(devBid);
|
|
|
-// if (iotDevice == null) {
|
|
|
-// throw new IotBizException(ErrorCode.FAILURE.getCode(), "设备不存在");
|
|
|
-// }
|
|
|
-//
|
|
|
-// Map<String, Object> map = new HashMap<>();
|
|
|
-// map.put("cbdimgBid", cbdimgBid);
|
|
|
-// IotCbdimg iotCbdimg = (IotCbdimg) mongoService.findOne(IotCbdimg.class, map, null, null);
|
|
|
-// if (iotCbdimg == null) {
|
|
|
-// throw new IotBizException(ErrorCode.FAILURE.getCode(), "图片不存在");
|
|
|
-// }
|
|
|
-// iotsMqProviderService.sendBaseDataToIots(IotActionEnums.DEVICE_CBD_AGAIN_RECORD,reqVo,"测报灯重新识别");
|
|
|
-// //Object recogResult = iotmMqService.sendMsgAndReceive("againRecog", IotMqConstant.CBD_IMAGE_AGAIN_RECOGE, reqVo);
|
|
|
-// IotCbdrecogReqVo iotCbdrecogReqVo = new IotCbdrecogReqVo();
|
|
|
-// iotCbdrecogReqVo.setCbdimgBid(reqVo.getCbdimgBid());
|
|
|
-// iotCbdrecogReqVo.setCbdrecogMarktype("1");
|
|
|
-// iotCbdrecogReqVo.setCbdrecogType(reqVo.getCbdrecogType());
|
|
|
-// return info(iotCbdrecogReqVo);
|
|
|
-// }
|
|
|
|
|
|
public String getPestRecogImgOssUrl(String base64, String imgId) {
|
|
|
if (base64.contains(",")) {
|