|
@@ -85,11 +85,14 @@ public class LabExitPointRelayServiceImpl implements ILabExitPointRelayService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
boolean flag = true;
|
|
boolean flag = true;
|
|
|
- for(LabExitLineJoinPointVO pointVO:lightPointSet){
|
|
|
|
|
- if(pointVO!=null && pointVO.getKey().equals(relay.getPointName())){
|
|
|
|
|
- flag = false;
|
|
|
|
|
|
|
+ if(lightPointSet!=null && lightPointSet.size()>0){
|
|
|
|
|
+ for(LabExitLineJoinPointVO pointVO:lightPointSet){
|
|
|
|
|
+ if(pointVO!=null && pointVO.getKey().equals(relay.getPointName())){
|
|
|
|
|
+ flag = false;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
if(flag){
|
|
if(flag){
|
|
|
LabExitLineJoinPointVO lineJoinPointVO = new LabExitLineJoinPointVO();
|
|
LabExitLineJoinPointVO lineJoinPointVO = new LabExitLineJoinPointVO();
|
|
|
lineJoinPointVO.setKey(relay.getPointName());
|
|
lineJoinPointVO.setKey(relay.getPointName());
|
|
@@ -115,9 +118,11 @@ public class LabExitPointRelayServiceImpl implements ILabExitPointRelayService {
|
|
|
|
|
|
|
|
Map <String, Object> relayListMap = new HashMap <>();
|
|
Map <String, Object> relayListMap = new HashMap <>();
|
|
|
Set <LabExitLineJoinPointVO> lightPointSet = new HashSet <>();
|
|
Set <LabExitLineJoinPointVO> lightPointSet = new HashSet <>();
|
|
|
|
|
+ Set <LabExitLineJoinPointVO> newLightPointSet = new HashSet <>();
|
|
|
if(redisService.getCacheObject("exitLineBy"+labExitPointRelay.getBuildId()+""+labExitPointRelay.getFloorId())!=null){
|
|
if(redisService.getCacheObject("exitLineBy"+labExitPointRelay.getBuildId()+""+labExitPointRelay.getFloorId())!=null){
|
|
|
relayListMap = redisService.getCacheObject("exitLineBy"+labExitPointRelay.getBuildId()+""+labExitPointRelay.getFloorId());
|
|
relayListMap = redisService.getCacheObject("exitLineBy"+labExitPointRelay.getBuildId()+""+labExitPointRelay.getFloorId());
|
|
|
lightPointSet = (Set <LabExitLineJoinPointVO>) relayListMap.get("lightPointSet");
|
|
lightPointSet = (Set <LabExitLineJoinPointVO>) relayListMap.get("lightPointSet");
|
|
|
|
|
+ newLightPointSet.addAll(lightPointSet) ;
|
|
|
}
|
|
}
|
|
|
//todo 开启继电器开关
|
|
//todo 开启继电器开关
|
|
|
for(LabExitPointRelay relay : labExitPointRelays) {
|
|
for(LabExitPointRelay relay : labExitPointRelays) {
|
|
@@ -131,16 +136,19 @@ public class LabExitPointRelayServiceImpl implements ILabExitPointRelayService {
|
|
|
socketService.sendMqttCommand(relay.getRelayCode(), Symbol.command.close, relay.getRelayBit() + "");
|
|
socketService.sendMqttCommand(relay.getRelayCode(), Symbol.command.close, relay.getRelayBit() + "");
|
|
|
Thread.sleep(timeWaitConfigUtils.getWaitTime());
|
|
Thread.sleep(timeWaitConfigUtils.getWaitTime());
|
|
|
}
|
|
}
|
|
|
- for(LabExitLineJoinPointVO pointVO:lightPointSet){
|
|
|
|
|
- if(pointVO!=null && pointVO.getKey().equals(relay.getPointName())){
|
|
|
|
|
- lightPointSet.remove(pointVO);
|
|
|
|
|
|
|
+ if(lightPointSet!=null && lightPointSet.size()>0){
|
|
|
|
|
+ for(LabExitLineJoinPointVO pointVO:lightPointSet){
|
|
|
|
|
+ if(pointVO!=null && pointVO.getKey().equals(relay.getPointName())){
|
|
|
|
|
+ newLightPointSet.remove(pointVO);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- relayListMap.put("lightPointSet",lightPointSet);
|
|
|
|
|
|
|
+ relayListMap.put("lightPointSet",newLightPointSet);
|
|
|
redisService.setCacheObject("exitLineBy"+labExitPointRelay.getBuildId()+""+labExitPointRelay.getFloorId(), relayListMap, 3L, TimeUnit.HOURS);
|
|
redisService.setCacheObject("exitLineBy"+labExitPointRelay.getBuildId()+""+labExitPointRelay.getFloorId(), relayListMap, 3L, TimeUnit.HOURS);
|
|
|
//todo 发送前端消息
|
|
//todo 发送前端消息
|
|
|
messageSendService.exitLineToFloor(labExitPointRelay.getFloorId());
|
|
messageSendService.exitLineToFloor(labExitPointRelay.getFloorId());
|