Commit bddb2076 authored by 郭武斌's avatar 郭武斌

*)修改警铃车库门一键控制

parent 2454630f
......@@ -11,6 +11,8 @@ import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -77,6 +79,9 @@ import com.yeejoin.amos.component.rule.config.RuleConfig;
public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCalled, AlertCalledMapper>
implements IAlertCalledService {
private final Logger logger = LogManager.getLogger(AlertCalledServiceImpl.class);
@Autowired
RedisUtils redisUtils;
@Autowired
......@@ -608,8 +613,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return alertCalledMapper.getTodayAlertCalled();
}
@Transactional(rollbackFor = RuntimeException.class)
public Boolean controlEquip() throws Exception {
public Boolean controlEquip() {
/**
* 获取控制器设备
*/
......@@ -659,7 +663,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
for (int i = 0; i < bellNums.length; i++)
{
//打开15s后自动关闭
jcsControlServerClient.sendBellActionWithTime(bellNums[i], "1", 15);
try
{
jcsControlServerClient.sendBellActionWithTime(bellNums[i], "1", 15);
}
catch (Exception e)
{
logger.info("打开警铃【"+bellNums[i]+"】异常!");
}
}
}
/**
......@@ -677,9 +688,23 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
if (!ValidationUtil.isEmpty(northDoor)) {
ControllerDto controllerDto = northDoor.get(0);
// 打开北站车库门
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1,1,1,1");
try
{
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1,1,1,1");
}
catch (Exception e)
{
logger.info("打开北站车库门【"+controllerDto.getIp()+"】异常!");
}
// 打开北站车库门弱电警铃
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 107, "1");
try
{
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 107, "1");
}
catch (Exception e)
{
logger.info("打开北站弱电警铃【"+controllerDto.getIp()+"】异常!");
}
}
/**
* 打开南站车库门
......@@ -688,9 +713,23 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
if (!ValidationUtil.isEmpty(southDoor)) {
ControllerDto controllerDto = southDoor.get(0);
// 打开南站车库门
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1");
try
{
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1");
}
catch (Exception e)
{
logger.info("打开南站车库门【"+controllerDto.getIp()+"】异常!");
}
// 打开南站车库门弱电警铃
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 107, "1");
try
{
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 107, "1");
}
catch (Exception e)
{
logger.info("打开南站弱电警铃【"+controllerDto.getIp()+"】异常!");
}
}
return true;
......
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