Commit 4edd8300 authored by 王晓倩's avatar 王晓倩

泽宏云定时推送设备状态接口停用

parent 8b77de02
...@@ -303,51 +303,46 @@ public class TDetectorReportController extends BaseController ...@@ -303,51 +303,46 @@ public class TDetectorReportController extends BaseController
return AjaxResult.success(); return AjaxResult.success();
} }
@ApiOperation(value = "泽宏报警器更新数据推送接口") // @ApiOperation(value = "泽宏报警器更新数据推送接口")
@PostMapping("/reportZHDeviceStatus") // @PostMapping("/reportZHDeviceStatus")
public AjaxResult reportZHDeviceStatus(@RequestBody List<TDetectorInfoDTO> tDetectorInfoDTOList){ // public AjaxResult reportZHDeviceStatus(@RequestBody List<TDetectorInfoDTO> tDetectorInfoDTOList){
//
log.info(tDetectorInfoDTOList.toString()); // log.info(tDetectorInfoDTOList.toString());
//
List<TDetectorInfo> list = new ArrayList<>(); // List<TDetectorInfo> list = new ArrayList<>();
//
try { // try {
for(TDetectorInfoDTO dto : tDetectorInfoDTOList){ // for(TDetectorInfoDTO dto : tDetectorInfoDTOList){
TDetectorInfo tDetectorInfo = new TDetectorInfo(); // TDetectorInfo tDetectorInfo = new TDetectorInfo();
tDetectorInfo.setDetectorCode(dto.getDeviceCode()); // tDetectorInfo.setDetectorCode(dto.getDeviceCode());
//
// 1探测器 // // 1探测器
if(!StringUtils.isEmpty(dto.getDeviceType()) && dto.getDeviceType().equals("1")) { // if(!StringUtils.isEmpty(dto.getDeviceType()) && dto.getDeviceType().equals("1")) {
if (!StringUtils.isEmpty(dto.getDeviceStatus()) && dto.getDeviceStatus().equals("1")) { // if (!StringUtils.isEmpty(dto.getDeviceStatus()) && dto.getDeviceStatus().equals("1")) {
tDetectorInfo.setDetectorStatus("0"); // tDetectorInfo.setDetectorStatus("0");
tDetectorInfo.setAlarmTime(null);
} else if (new ArrayList<String>(Arrays.asList("7", "9")).contains(dto.getDeviceStatus())) {
tDetectorInfo.setDetectorStatus("1");
tDetectorInfo.setAlarmTime(dto.getAlarmTime());
} else {
tDetectorInfo.setDetectorStatus("2");
tDetectorInfo.setAlarmTime(dto.getAlarmTime());
}
tDetectorInfo.setUpdateTime(new Date());
}
// else{
// if(!StringUtils.isEmpty(dto.getDetectorStatus()) && dto.getDetectorStatus().equals("0")){
// tDetectorInfo.setAlarmTime(null); // tDetectorInfo.setAlarmTime(null);
// } else if (new ArrayList<String>(Arrays.asList("7", "9")).contains(dto.getDeviceStatus())) {
// tDetectorInfo.setDetectorStatus("1");
// tDetectorInfo.setAlarmTime(dto.getAlarmTime());
// } else {
// tDetectorInfo.setDetectorStatus("2");
// tDetectorInfo.setAlarmTime(dto.getAlarmTime());
// } // }
// tDetectorInfo.setUpdateTime(new Date());
// } // }
//
list.add(tDetectorInfo); // list.add(tDetectorInfo);
} // }
//
tDetectorInfoService.updateBatch(list); // tDetectorInfoService.updateBatch(list);
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
log.error("【泽宏设备状态】操作出错,error={}",e.getMessage()); // log.error("【泽宏设备状态】操作出错,error={}",e.getMessage());
throw new IOCException(ResultEnum.OPERATION_FAIL); // throw new IOCException(ResultEnum.OPERATION_FAIL);
} // }
//
return AjaxResult.success(); // return AjaxResult.success();
} // }
@ApiOperation(value = "泽宏设备预警数据推送接口") @ApiOperation(value = "泽宏设备预警数据推送接口")
@PostMapping("/reportZHDeviceAlarmData") @PostMapping("/reportZHDeviceAlarmData")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment