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

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

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