|
@@ -379,7 +379,8 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
safeUserId = subInfo.get("safeUserId")==null?"":String.valueOf(subInfo.get("safeUserId"));
|
|
safeUserId = subInfo.get("safeUserId")==null?"":String.valueOf(subInfo.get("safeUserId"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- String terminalNum = null;
|
|
|
|
|
|
|
+ String terminalNum;
|
|
|
|
|
+ HxpAlarmRecord hxpAlarmRecord;
|
|
|
Integer dealTime = 0;
|
|
Integer dealTime = 0;
|
|
|
List<Map<String, Object>> terminalList = hxpSmartTerminalMapper.selectTerminalBySubId(8, hxpStock.getSubId());
|
|
List<Map<String, Object>> terminalList = hxpSmartTerminalMapper.selectTerminalBySubId(8, hxpStock.getSubId());
|
|
|
if(CollectionUtils.isEmpty(terminalList)){
|
|
if(CollectionUtils.isEmpty(terminalList)){
|
|
@@ -391,20 +392,8 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
// 执行声光报警器动作触发
|
|
// 执行声光报警器动作触发
|
|
|
remoteLaboratoryService.controlByInside(Long.parseLong(smartTerminal.get("id")+"") , "01");
|
|
remoteLaboratoryService.controlByInside(Long.parseLong(smartTerminal.get("id")+"") , "01");
|
|
|
isAlarm = true;
|
|
isAlarm = true;
|
|
|
- // 控制响铃时长
|
|
|
|
|
- if(smartTerminal.get("ringTime") != null){
|
|
|
|
|
- ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
|
|
|
|
|
- executorService.schedule(new Runnable() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void run() {
|
|
|
|
|
- remoteLaboratoryService.controlByInside(Long.parseLong(smartTerminal.get("id")+"") , "00");
|
|
|
|
|
- }
|
|
|
|
|
- }, Long.parseLong(smartTerminal.get("ringTime") + ""), TimeUnit.SECONDS);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- HxpAlarmRecord hxpAlarmRecord;
|
|
|
|
|
- if(isAlarm){
|
|
|
|
|
|
|
+
|
|
|
// 默认一个实验室只触发一个报警器
|
|
// 默认一个实验室只触发一个报警器
|
|
|
hxpAlarmRecord = new HxpAlarmRecord();
|
|
hxpAlarmRecord = new HxpAlarmRecord();
|
|
|
hxpAlarmRecord.setAlarmContent("未领用即携带化学品离开实验室【"+subName+"】," + "化学品("+hxpStock.getChemicalName()+"), 请尽快确认!");
|
|
hxpAlarmRecord.setAlarmContent("未领用即携带化学品离开实验室【"+subName+"】," + "化学品("+hxpStock.getChemicalName()+"), 请尽快确认!");
|
|
@@ -418,8 +407,29 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
// TODO 请在此处新增图片路径字段并使用 fileR 中的返回值url作为图片路径以供前端调用,具体实现方式可参考 com.zd.bottle.service.impl.AlarmRecordServiceImpl.remoteAdd#155 行代码,默认配置为空,具体配置可参考zd-bottle-dev.yml#113行到115行
|
|
// TODO 请在此处新增图片路径字段并使用 fileR 中的返回值url作为图片路径以供前端调用,具体实现方式可参考 com.zd.bottle.service.impl.AlarmRecordServiceImpl.remoteAdd#155 行代码,默认配置为空,具体配置可参考zd-bottle-dev.yml#113行到115行
|
|
|
|
|
|
|
|
hxpAlarmRecordMapper.insertHxpAlarmRecord(hxpAlarmRecord);
|
|
hxpAlarmRecordMapper.insertHxpAlarmRecord(hxpAlarmRecord);
|
|
|
|
|
+
|
|
|
|
|
+ Long recordId = hxpAlarmRecord.getId();
|
|
|
|
|
+ // 控制响铃时长
|
|
|
|
|
+ if(smartTerminal.get("ringTime") != null){
|
|
|
|
|
+ ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
|
|
|
|
|
+ executorService.schedule(new Runnable() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void run() {
|
|
|
|
|
+ // 自动处理声光报警状态
|
|
|
|
|
+ HxpAlarmRecord hxpAlarmRecord1 = new HxpAlarmRecord();
|
|
|
|
|
+ hxpAlarmRecord1.setId(recordId);
|
|
|
|
|
+ hxpAlarmRecord1.setHandlingStatus(2);
|
|
|
|
|
+ hxpAlarmRecord1.setHandlingTime(DateUtils.getNowDate());
|
|
|
|
|
+ hxpAlarmRecord1.setHandlingUserId(-2L);
|
|
|
|
|
+ hxpAlarmRecordMapper.updateHxpAlarmRecord(hxpAlarmRecord1);
|
|
|
|
|
+
|
|
|
|
|
+ remoteLaboratoryService.controlByInside(Long.parseLong(smartTerminal.get("id")+"") , "00");
|
|
|
|
|
+ }
|
|
|
|
|
+ }, Long.parseLong(smartTerminal.get("ringTime") + ""), TimeUnit.SECONDS);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
// 报警通知演示临时通知给实验室管理员 phones
|
|
// 报警通知演示临时通知给实验室管理员 phones
|
|
|
Long recordId = sendPhoneAlarm(hxpStock.getId(),hxpStock.getSubId(), subName, hxpStock.getChemicalName(), subInfo.get("phones") + "");
|
|
Long recordId = sendPhoneAlarm(hxpStock.getId(),hxpStock.getSubId(), subName, hxpStock.getChemicalName(), subInfo.get("phones") + "");
|
|
|
|
|
|