diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java index 54dfdcc..68e95d3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java @@ -20,6 +20,7 @@ import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.region.domain.Region; import org.nl.acs.region.service.RegionService; +import org.nl.config.MapOf; import org.nl.config.SpringContextHolder; import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; @@ -34,6 +35,7 @@ import java.io.IOException; import java.net.InetSocketAddress; import java.net.Socket; import java.util.Date; +import java.util.Map; import static org.nl.acs.agv.server.impl.NDCAgvServiceImpl.Bytes2HexString; @@ -60,7 +62,10 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { boolean requireSucessRegion = false; boolean requireSucessTake = false; boolean requireSucessPut = false; - + /** + * 两个门必须互锁,其中一个门关闭,才能给另一个门开启信号 + */ + private Map lockDoorMap = MapOf.of("AD4", "AD7", "AD7", "AD4", "AD2", "AD8", "AD8", "AD2"); @Autowired ISysParamService paramService; @@ -240,6 +245,19 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { return; } if (ObjectUtil.isNotEmpty(device)) { + String lockDoor = lockDoorMap.get(device_code); + if (StrUtil.isNotEmpty(lockDoor)) { + Device lockDevice = deviceAppService.findDeviceByCode(lockDoor); + if (ObjectUtil.isNotEmpty(lockDevice)) { + if (lockDevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { + StandardAutodoorDeviceDriver lockStandardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) lockDevice.getDeviceDriver(); + if (lockStandardAutodoorDeviceDriver.getClose() != 1) { + log.info("未下发{}自动门开门信号,因为自动门{}未关到位,所以未反馈NDC信开门信息", device_code, lockDoor); + continue; + } + } + } + } if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); String region_code = (String) device.getExtraValue().get("region");