|
|
@ -781,10 +781,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} |
|
|
|
|
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
//通道1
|
|
|
|
Region region = regionService.findByCode("1"); |
|
|
|
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("wait")) |
|
|
|
&& StrUtil.equals("true", device.getExtraValue().get("wait").toString()) ) { |
|
|
|
if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) { |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); |
|
|
|
LuceneLogDto logDto = LuceneLogDto.builder() |
|
|
@ -793,41 +791,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
.build(); |
|
|
|
logDto.setLog_level(4); |
|
|
|
luceneExecuteLogService.deviceExecuteLog(logDto); |
|
|
|
if (standardOrdinarySiteDeviceDriver.getOpenCount() == 0) { |
|
|
|
region.setIs_charge("1"); |
|
|
|
region.setHas_agv("0"); |
|
|
|
regionService.updateById(region); |
|
|
|
standardOrdinarySiteDeviceDriver.setOpenCount(standardOrdinarySiteDeviceDriver.getOpenCount() + 1); |
|
|
|
|
|
|
|
} |
|
|
|
if (standardOrdinarySiteDeviceDriver.getOpenCount() == 1) { |
|
|
|
region.setIs_charge("0"); |
|
|
|
region.setHas_agv("1"); |
|
|
|
regionService.updateById(region); |
|
|
|
standardOrdinarySiteDeviceDriver.setOpenCount(0); |
|
|
|
} |
|
|
|
}else { |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); |
|
|
|
LuceneLogDto logDto = LuceneLogDto.builder() |
|
|
|
.device_code(this.getDeviceCode()) |
|
|
|
.content(region.getRegion_name()+"被管制!") |
|
|
|
.build(); |
|
|
|
logDto.setLog_level(4); |
|
|
|
luceneExecuteLogService.deviceExecuteLog(logDto); |
|
|
|
} |
|
|
|
} else { |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); |
|
|
|
LuceneLogDto logDto = LuceneLogDto.builder() |
|
|
|
.device_code(this.getDeviceCode()) |
|
|
|
.content("agvphase:" + phase + "反馈:" + data) |
|
|
|
.build(); |
|
|
|
logDto.setLog_level(4); |
|
|
|
luceneExecuteLogService.deviceExecuteLog(logDto); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else if (phase == 0x4E) { |
|
|
|
} else if (phase == 0x4E) { |
|
|
|
if (agvaddr == 0) { |
|
|
|
agvaddr = agvaddr_copy; |
|
|
|
} |
|
|
@ -866,11 +835,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} |
|
|
|
|
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
Region region = regionService.findByCode("1"); |
|
|
|
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("reqWms")) |
|
|
|
&& StrUtil.equals("true", device.getExtraValue().get("reqWms").toString())) { |
|
|
|
if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) { |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); |
|
|
|
LuceneLogDto logDto = LuceneLogDto.builder() |
|
|
|
.device_code(this.getDeviceCode()) |
|
|
@ -878,36 +843,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
.build(); |
|
|
|
logDto.setLog_level(4); |
|
|
|
luceneExecuteLogService.deviceExecuteLog(logDto); |
|
|
|
|
|
|
|
if (standardOrdinarySiteDeviceDriver.getCloseCount() == 0) { |
|
|
|
region.setIs_charge("0"); |
|
|
|
region.setHas_agv("1"); |
|
|
|
regionService.updateById(region); |
|
|
|
standardOrdinarySiteDeviceDriver.setOpenCount(standardOrdinarySiteDeviceDriver.getOpenCount() + 1); |
|
|
|
} |
|
|
|
if (standardOrdinarySiteDeviceDriver.getCloseCount() == 1) { |
|
|
|
region.setIs_charge("1"); |
|
|
|
region.setHas_agv("0"); |
|
|
|
regionService.updateById(region); |
|
|
|
standardOrdinarySiteDeviceDriver.setCloseCount(0); |
|
|
|
} |
|
|
|
}else { |
|
|
|
LuceneLogDto logDto = LuceneLogDto.builder() |
|
|
|
.device_code(this.getDeviceCode()) |
|
|
|
.content(region.getRegion_name()+"被管制!") |
|
|
|
.build(); |
|
|
|
logDto.setLog_level(4); |
|
|
|
luceneExecuteLogService.deviceExecuteLog(logDto); |
|
|
|
} |
|
|
|
} else { |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); |
|
|
|
LuceneLogDto logDto = LuceneLogDto.builder() |
|
|
|
.device_code(this.getDeviceCode()) |
|
|
|
.content("agvphase:" + phase + "反馈:" + data) |
|
|
|
.build(); |
|
|
|
logDto.setLog_level(4); |
|
|
|
luceneExecuteLogService.deviceExecuteLog(logDto); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -1054,22 +992,83 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
last_status = status; |
|
|
|
} //进入区域(phase值)
|
|
|
|
else if (phase == 0x50) { |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
Region region = regionService.findByCode("1"); |
|
|
|
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("open")) |
|
|
|
&& StrUtil.equals("true", device.getExtraValue().get("open").toString())) { |
|
|
|
if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) { |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); |
|
|
|
LuceneLogDto logDto = LuceneLogDto.builder() |
|
|
|
.device_code(device_code) |
|
|
|
.content("agvphase:" + phase + "自动门开门") |
|
|
|
.device_code(this.getDeviceCode()) |
|
|
|
.content("agvphase:" + phase + "反馈:" + data) |
|
|
|
.build(); |
|
|
|
logDto.setLog_level(4); |
|
|
|
luceneExecuteLogService.deviceExecuteLog(logDto); |
|
|
|
if (standardOrdinarySiteDeviceDriver.getOpenCount() == 0) { |
|
|
|
region.setIs_charge("1"); |
|
|
|
region.setHas_agv("1"); |
|
|
|
regionService.updateById(region); |
|
|
|
standardOrdinarySiteDeviceDriver.setOpenCount(standardOrdinarySiteDeviceDriver.getOpenCount() + 1); |
|
|
|
|
|
|
|
} |
|
|
|
if (standardOrdinarySiteDeviceDriver.getOpenCount() == 1) { |
|
|
|
region.setIs_charge("0"); |
|
|
|
region.setHas_agv("0"); |
|
|
|
regionService.updateById(region); |
|
|
|
standardOrdinarySiteDeviceDriver.setOpenCount(0); |
|
|
|
} |
|
|
|
} else { |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); |
|
|
|
LuceneLogDto logDto2 = LuceneLogDto.builder() |
|
|
|
.device_code(this.getDeviceCode()) |
|
|
|
.content(region.getRegion_name() + "被管制!") |
|
|
|
.build(); |
|
|
|
logDto2.setLog_level(4); |
|
|
|
luceneExecuteLogService.deviceExecuteLog(logDto2); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//离开区域(phase值)
|
|
|
|
else if (phase == 0x51) { |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
Region region = regionService.findByCode("1"); |
|
|
|
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("close")) |
|
|
|
&& StrUtil.equals("true", device.getExtraValue().get("close").toString())) { |
|
|
|
if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) { |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); |
|
|
|
LuceneLogDto logDto = LuceneLogDto.builder() |
|
|
|
.device_code(device_code) |
|
|
|
.content("agvphase:" + phase + "自动门关门") |
|
|
|
.device_code(this.getDeviceCode()) |
|
|
|
.content("agvphase:" + phase + "反馈:" + data) |
|
|
|
.build(); |
|
|
|
logDto.setLog_level(4); |
|
|
|
luceneExecuteLogService.deviceExecuteLog(logDto); |
|
|
|
|
|
|
|
if (standardOrdinarySiteDeviceDriver.getCloseCount() == 0) { |
|
|
|
region.setIs_charge("0"); |
|
|
|
region.setHas_agv("0"); |
|
|
|
regionService.updateById(region); |
|
|
|
standardOrdinarySiteDeviceDriver.setOpenCount(standardOrdinarySiteDeviceDriver.getOpenCount() + 1); |
|
|
|
} |
|
|
|
if (standardOrdinarySiteDeviceDriver.getCloseCount() == 1) { |
|
|
|
region.setIs_charge("1"); |
|
|
|
region.setHas_agv("1"); |
|
|
|
regionService.updateById(region); |
|
|
|
standardOrdinarySiteDeviceDriver.setCloseCount(0); |
|
|
|
} |
|
|
|
} else { |
|
|
|
LuceneLogDto logDto = LuceneLogDto.builder() |
|
|
|
.device_code(this.getDeviceCode()) |
|
|
|
.content(region.getRegion_name() + "被管制!") |
|
|
|
.build(); |
|
|
|
logDto.setLog_level(4); |
|
|
|
luceneExecuteLogService.deviceExecuteLog(logDto); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//上报异常信息
|
|
|
|
//(不需要WCS反馈)
|
|
|
|
else if (phase == 0x67) { |
|
|
|