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

*)修改车库门控制

parent a0c3110f
package com.yeejoin.amos.boot.module.common.api.feign; package com.yeejoin.amos.boot.module.common.api.feign;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
/** /**
* *
* <pre> * <pre>
...@@ -29,6 +29,21 @@ public interface JcsControlServerClient { ...@@ -29,6 +29,21 @@ public interface JcsControlServerClient {
*/ */
@GetMapping(value = "/v1/wksendbell/{codestr}/{type}") @GetMapping(value = "/v1/wksendbell/{codestr}/{type}")
FeignClientResult<String> sendBellAction(@PathVariable("codestr") String areasStr, @PathVariable("type") String type); FeignClientResult<String> sendBellAction(@PathVariable("codestr") String areasStr, @PathVariable("type") String type);
/**
*
* <pre>
* 打开/关闭消防警铃(自动关闭时间单位为:秒)
* </pre>
*
* @param areasStr
* @param type
* @param closttime
* @return
*/
@GetMapping(value = "/v1/wksendbell/{codestr}/{type}/{closttime}")
FeignClientResult<String> sendBellActionWithTime(@PathVariable("codestr") String areasStr,
@PathVariable("type") String type,@PathVariable("closttime") long closttime);
/** /**
* *
...@@ -89,5 +104,6 @@ public interface JcsControlServerClient { ...@@ -89,5 +104,6 @@ public interface JcsControlServerClient {
@GetMapping(value = "/v1/controlequip/kndwrite/{ip}/{port}/{num}/{result}") @GetMapping(value = "/v1/controlequip/kndwrite/{ip}/{port}/{num}/{result}")
FeignClientResult<String> writeStateAction(@PathVariable("ip") String ip,@PathVariable("port") int port, FeignClientResult<String> writeStateAction(@PathVariable("ip") String ip,@PathVariable("port") int port,
@PathVariable("num") int whichone, @PathVariable("result") String stateStr); @PathVariable("num") int whichone, @PathVariable("result") String stateStr);
} }
...@@ -628,7 +628,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -628,7 +628,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
*/ */
List<ControllerDto> controllerDtoList = controllerService.queryAllForList(); List<ControllerDto> controllerDtoList = controllerService.queryAllForList();
StringBuilder bellNumSb = new StringBuilder(); StringBuilder bellNumSb = new StringBuilder();
StringBuilder broadcastNumSb = new StringBuilder(); // StringBuilder broadcastNumSb = new StringBuilder();
for (ControllerDto controllerDto : controllerDtoList) { for (ControllerDto controllerDto : controllerDtoList) {
// 消防警铃 // 消防警铃
if (controllerDto.getType().equals(ControllerTypeEnum.BELL.getCode())) { if (controllerDto.getType().equals(ControllerTypeEnum.BELL.getCode())) {
...@@ -640,14 +640,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -640,14 +640,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
} }
} }
// 广播 // 广播
if (controllerDto.getType().equals(ControllerTypeEnum.BROADCAST.getCode())) { // if (controllerDto.getType().equals(ControllerTypeEnum.BROADCAST.getCode())) {
List<String> broadcastList = controllerEquipMap.get(controllerDto.getSequenceNbr()); // List<String> broadcastList = controllerEquipMap.get(controllerDto.getSequenceNbr());
if (!ValidationUtil.isEmpty(broadcastList)) { // if (!ValidationUtil.isEmpty(broadcastList)) {
for (String num : broadcastList) { // for (String num : broadcastList) {
broadcastNumSb.append(num).append(","); // broadcastNumSb.append(num).append(",");
} // }
} // }
} // }
} }
/** /**
* 打开消防警铃 * 打开消防警铃
...@@ -655,16 +655,21 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -655,16 +655,21 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
if (!ValidationUtil.isEmpty(bellNumSb.toString())) { if (!ValidationUtil.isEmpty(bellNumSb.toString())) {
String bellNum = bellNumSb.toString(); String bellNum = bellNumSb.toString();
bellNum = bellNum.substring(0, bellNum.length() - 1); bellNum = bellNum.substring(0, bellNum.length() - 1);
jcsControlServerClient.sendBellAction(bellNum, "1"); String[] bellNums = bellNum.split(",");
for (int i = 0; i < bellNums.length; i++)
{
//打开15s后自动关闭
jcsControlServerClient.sendBellActionWithTime(bellNums[i], "1", 15);
}
} }
/** /**
* 播放广播 * 播放广播
*/ */
if (!ValidationUtil.isEmpty(broadcastNumSb.toString())) { // if (!ValidationUtil.isEmpty(broadcastNumSb.toString())) {
String broadcastNum = broadcastNumSb.toString(); // String broadcastNum = broadcastNumSb.toString();
broadcastNum = broadcastNum.substring(0, broadcastNum.length() - 1); // broadcastNum = broadcastNum.substring(0, broadcastNum.length() - 1);
jcsControlServerClient.sendFileAction(broadcastNum, "1490075199246.mp3"); // jcsControlServerClient.sendFileAction(broadcastNum, "1490075199246.mp3");
} // }
/** /**
* 打开北站车库门 * 打开北站车库门
*/ */
......
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