|
@@ -273,6 +273,7 @@ public class FireDeviceController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping(value = "/outfireapp")
|
|
@GetMapping(value = "/outfireapp")
|
|
|
public ResultData outFire(Long subjectId,String deviceCode) throws InterruptedException {
|
|
public ResultData outFire(Long subjectId,String deviceCode) throws InterruptedException {
|
|
|
|
|
+ Long fireTimeVal=fireTime;
|
|
|
logger.info("=========小程序端开始一键灭火=======");
|
|
logger.info("=========小程序端开始一键灭火=======");
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
//设备是否在线
|
|
//设备是否在线
|
|
@@ -292,13 +293,13 @@ public class FireDeviceController extends BaseController {
|
|
|
vo.setSubjectId(subjectId);
|
|
vo.setSubjectId(subjectId);
|
|
|
List<HardwareFireDeviceVO> list = fireDeviceService.selectHardwareFireDeviceList(vo);
|
|
List<HardwareFireDeviceVO> list = fireDeviceService.selectHardwareFireDeviceList(vo);
|
|
|
if(list.get(0).getDeviceCountDown()!=null){
|
|
if(list.get(0).getDeviceCountDown()!=null){
|
|
|
- fireTime= fireTime+list.get(0).getDeviceCountDown();
|
|
|
|
|
|
|
+ fireTimeVal= fireTimeVal+list.get(0).getDeviceCountDown();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//int waitTime = 5;//倒计时等待时间(秒)
|
|
//int waitTime = 5;//倒计时等待时间(秒)
|
|
|
map.put("online", online);
|
|
map.put("online", online);
|
|
|
map.put("waitTime", countDown);
|
|
map.put("waitTime", countDown);
|
|
|
- map.put("direTime", fireTime);
|
|
|
|
|
|
|
+ map.put("direTime", fireTimeVal);
|
|
|
new Thread(()->startTT(subjectId,deviceCode,countDown)).start();
|
|
new Thread(()->startTT(subjectId,deviceCode,countDown)).start();
|
|
|
return ResultData.success(map);
|
|
return ResultData.success(map);
|
|
|
}
|
|
}
|
|
@@ -334,6 +335,7 @@ public class FireDeviceController extends BaseController {
|
|
|
@GetMapping(value = "/outfirepc")
|
|
@GetMapping(value = "/outfirepc")
|
|
|
public ResultData outFirePc(Long subjectId,String deviceCode) {
|
|
public ResultData outFirePc(Long subjectId,String deviceCode) {
|
|
|
logger.info("=========PC端开始一键灭火=======");
|
|
logger.info("=========PC端开始一键灭火=======");
|
|
|
|
|
+ Long fireTimeVal=fireTime;
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
//设备是否在线
|
|
//设备是否在线
|
|
|
boolean online=false;
|
|
boolean online=false;
|
|
@@ -351,14 +353,15 @@ public class FireDeviceController extends BaseController {
|
|
|
HardwareFireDeviceVO vo = new HardwareFireDeviceVO();
|
|
HardwareFireDeviceVO vo = new HardwareFireDeviceVO();
|
|
|
vo.setSubjectId(subjectId);
|
|
vo.setSubjectId(subjectId);
|
|
|
List<HardwareFireDeviceVO> list = fireDeviceService.selectHardwareFireDeviceList(vo);
|
|
List<HardwareFireDeviceVO> list = fireDeviceService.selectHardwareFireDeviceList(vo);
|
|
|
|
|
+ logger.info("灭火固定时间fireTime:"+fireTime+" ,数据库配置时间:"+list.get(0).getDeviceCountDown());
|
|
|
if(list.get(0).getDeviceCountDown()!=null){
|
|
if(list.get(0).getDeviceCountDown()!=null){
|
|
|
- fireTime= fireTime+list.get(0).getDeviceCountDown();
|
|
|
|
|
|
|
+ fireTimeVal= fireTimeVal+list.get(0).getDeviceCountDown();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//int waitTime = 5;//倒计时等待时间(秒)
|
|
//int waitTime = 5;//倒计时等待时间(秒)
|
|
|
map.put("online", online);
|
|
map.put("online", online);
|
|
|
map.put("waitTime", countDown);
|
|
map.put("waitTime", countDown);
|
|
|
- map.put("direTime", fireTime);
|
|
|
|
|
|
|
+ map.put("direTime", fireTimeVal);
|
|
|
new Thread(()->startTT(subjectId,deviceCode,countDown)).start();
|
|
new Thread(()->startTT(subjectId,deviceCode,countDown)).start();
|
|
|
return ResultData.success(map);
|
|
return ResultData.success(map);
|
|
|
}
|
|
}
|
|
@@ -519,7 +522,7 @@ public class FireDeviceController extends BaseController {
|
|
|
logger.info("关闭继电器,执行结果:" + o);
|
|
logger.info("关闭继电器,执行结果:" + o);
|
|
|
}
|
|
}
|
|
|
map.put("msg", msg);
|
|
map.put("msg", msg);
|
|
|
- map.put("flg", true);
|
|
|
|
|
|
|
+ map.put("flg", flg);
|
|
|
return map;
|
|
return map;
|
|
|
}
|
|
}
|
|
|
|
|
|