|
|
@@ -23,6 +23,7 @@ import com.yunfeiyun.agmp.iots.device.serviceImp.YfQxzDeviceImpl;
|
|
|
import com.yunfeiyun.agmp.iots.service.IIotDeviceService;
|
|
|
import com.yunfeiyun.agmp.iots.service.IIotDevicelasteddataService;
|
|
|
import com.yunfeiyun.agmp.iots.service.IIotYfScddataService;
|
|
|
+import com.yunfeiyun.agmp.iots.service.impl.IotCbdImgService;
|
|
|
import com.yunfeiyun.agmp.iots.warn.service.WarnService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -48,7 +49,6 @@ import java.util.concurrent.CompletableFuture;
|
|
|
public class TestController {
|
|
|
@Autowired
|
|
|
private IIotDeviceService iIotDeviceService;
|
|
|
-
|
|
|
@Resource(name = "threadPoolTaskExecutor")
|
|
|
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
|
|
|
|
|
@@ -732,4 +732,40 @@ public class TestController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IotCbdImgService iotCbdImgService;
|
|
|
+
|
|
|
+ @RequestMapping("/warn/cmd/cbd")
|
|
|
+ public AjaxResult cmdCbdWarn(WarnTestReq req) {
|
|
|
+ JSONObject jsonObject = req.getData();
|
|
|
+ List<IotDevice> oldIotDevice = iIotDeviceService.selectIotDeviceByDevCode(req.getDevCode());
|
|
|
+ for (IotDevice iotDevice : oldIotDevice) {
|
|
|
+ String devtypeBid = "3";
|
|
|
+ //String deviceTypeId = jsonObject.getString("device_type_id");
|
|
|
+ String deviceTypeId = iotDevice.getDevtypeBid();
|
|
|
+ //String devCode = jsonObject.getString("imei");
|
|
|
+ String devCode = req.getDevCode();
|
|
|
+ log.info("【解析测报灯图片数据】:devtypeBid:{},deviceTypeId,{},devCode:{}", devtypeBid, deviceTypeId, devCode);
|
|
|
+ boolean isCbd = true;
|
|
|
+ if (StringUtils.isNotEmpty(deviceTypeId) && !deviceTypeId.equals("3")) {
|
|
|
+ devtypeBid = "xct";
|
|
|
+ isCbd = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!isCbd) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String cbdimgAddr = jsonObject.getString("Image");
|
|
|
+ if (StringUtils.isEmpty(cbdimgAddr)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ // 保存测报灯图片数据到mongodb
|
|
|
+ iotCbdImgService.insertIotCbdimg(iotDevice, jsonObject, DateUtils.dateTimeNow());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|