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

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

parent 8b77de02
......@@ -303,51 +303,46 @@ public class TDetectorReportController extends BaseController
return AjaxResult.success();
}
@ApiOperation(value = "泽宏报警器更新数据推送接口")
@PostMapping("/reportZHDeviceStatus")
public AjaxResult reportZHDeviceStatus(@RequestBody List<TDetectorInfoDTO> tDetectorInfoDTOList){
log.info(tDetectorInfoDTOList.toString());
List<TDetectorInfo> list = new ArrayList<>();
try {
for(TDetectorInfoDTO dto : tDetectorInfoDTOList){
TDetectorInfo tDetectorInfo = new TDetectorInfo();
tDetectorInfo.setDetectorCode(dto.getDeviceCode());
// 1探测器
if(!StringUtils.isEmpty(dto.getDeviceType()) && dto.getDeviceType().equals("1")) {
if (!StringUtils.isEmpty(dto.getDeviceStatus()) && dto.getDeviceStatus().equals("1")) {
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")){
// @ApiOperation(value = "泽宏报警器更新数据推送接口")
// @PostMapping("/reportZHDeviceStatus")
// public AjaxResult reportZHDeviceStatus(@RequestBody List<TDetectorInfoDTO> tDetectorInfoDTOList){
//
// log.info(tDetectorInfoDTOList.toString());
//
// List<TDetectorInfo> list = new ArrayList<>();
//
// try {
// for(TDetectorInfoDTO dto : tDetectorInfoDTOList){
// TDetectorInfo tDetectorInfo = new TDetectorInfo();
// tDetectorInfo.setDetectorCode(dto.getDeviceCode());
//
// // 1探测器
// if(!StringUtils.isEmpty(dto.getDeviceType()) && dto.getDeviceType().equals("1")) {
// if (!StringUtils.isEmpty(dto.getDeviceStatus()) && dto.getDeviceStatus().equals("1")) {
// 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());
// }
//
// list.add(tDetectorInfo);
// }
//
// tDetectorInfoService.updateBatch(list);
// } catch (Exception e) {
// e.printStackTrace();
// log.error("【泽宏设备状态】操作出错,error={}",e.getMessage());
// throw new IOCException(ResultEnum.OPERATION_FAIL);
// }
//
// return AjaxResult.success();
// }
list.add(tDetectorInfo);
}
tDetectorInfoService.updateBatch(list);
} catch (Exception e) {
e.printStackTrace();
log.error("【泽宏设备状态】操作出错,error={}",e.getMessage());
throw new IOCException(ResultEnum.OPERATION_FAIL);
}
return AjaxResult.success();
}
@ApiOperation(value = "泽宏设备预警数据推送接口")
@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