From 5664389114fcfca86b5a73afbc68e7738974a2bc Mon Sep 17 00:00:00 2001 From: psh Date: Tue, 16 Apr 2024 15:48:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8E=8B=E6=9C=BA=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=88=A4=E6=96=AD=E5=AF=B9=E6=8E=A5=E4=BD=8D?= =?UTF-8?q?=E8=B4=A7=E7=89=A9=E6=98=AF=E5=90=A6=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lnsh_station/LnshStationDeviceDriver.java | 21 ++++++++++++++++++- .../main/resources/config/application-dev.yml | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java index 403557b..8b2f32a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java @@ -18,9 +18,13 @@ import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; +import org.nl.acs.log.LokiLog; +import org.nl.acs.log.LokiLogType; import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; +import org.nl.acs.opc.DeviceAppService; +import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; import org.nl.modules.system.service.ParamService; @@ -121,6 +125,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements @Override + @LokiLog(type = LokiLogType.AGV) public void execute() { String message = null; try { @@ -216,7 +221,21 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements //叫料 if (ObjectUtil.isNotEmpty(ignore_pickup_check) && "true".equals(ignore_pickup_check.toString())) { if (!requireSucess) { - callMaterial(); + if(this.device_code.endsWith("SL01")){ + String devicecode="BLJ0"+this.device_code.charAt(3); + DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); + Device nextDevice = appService.findDeviceByCode(devicecode); + if (nextDevice.getDeviceDriver() instanceof LnshStationDeviceDriver) { + LnshStationDeviceDriver driver = (LnshStationDeviceDriver) nextDevice.getDeviceDriver(); + if(driver.getAction()==1){ + log.info("当前压机"+this.device_code+"对应对接位"+driver.device_code+"有货,暂不生成任务"); + }else{ + callMaterial(); + } + } + }else { + callMaterial(); + } } } else { if (!requireSucess && this.move == 0) { diff --git a/lms/nladmin-system/src/main/resources/config/application-dev.yml b/lms/nladmin-system/src/main/resources/config/application-dev.yml index d8b8de5..b56a5f4 100644 --- a/lms/nladmin-system/src/main/resources/config/application-dev.yml +++ b/lms/nladmin-system/src/main/resources/config/application-dev.yml @@ -8,7 +8,7 @@ spring: driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:yksh_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useOldAliasMetadataBehavior=true username: ${DB_USER:root} - password: ${DB_PWD:12356} + password: ${DB_PWD:123456} # 初始连接数 initial-size: 5 # 最小连接数 From 67a339f3cc89d6e8418c8de4eca45bee769eb78c Mon Sep 17 00:00:00 2001 From: psh Date: Tue, 16 Apr 2024 17:28:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8E=8B=E6=9C=BA=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=88=A4=E6=96=AD=E5=AF=B9=E6=8E=A5=E4=BD=8D?= =?UTF-8?q?=E8=B4=A7=E7=89=A9=E6=98=AF=E5=90=A6=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lnsh/lnsh_station/LnshStationDeviceDriver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java index 8b2f32a..bdb41a4 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java @@ -225,9 +225,9 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements String devicecode="BLJ0"+this.device_code.charAt(3); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); Device nextDevice = appService.findDeviceByCode(devicecode); - if (nextDevice.getDeviceDriver() instanceof LnshStationDeviceDriver) { + if (nextDevice!=null && nextDevice.getDeviceDriver() instanceof LnshStationDeviceDriver) { LnshStationDeviceDriver driver = (LnshStationDeviceDriver) nextDevice.getDeviceDriver(); - if(driver.getAction()==1){ + if(driver.getMove()==1){ log.info("当前压机"+this.device_code+"对应对接位"+driver.device_code+"有货,暂不生成任务"); }else{ callMaterial(); From 60571a21b7dd08ebbc0aecd5756daddf9da0ed50 Mon Sep 17 00:00:00 2001 From: psh Date: Tue, 23 Apr 2024 09:11:41 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8E=8B=E6=9C=BA=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8F=8A=E8=AF=B7=E6=B1=82=E6=94=BE=E8=B4=A7?= =?UTF-8?q?=E6=97=B6=E5=88=A4=E6=96=AD=E5=AF=B9=E6=8E=A5=E4=BD=8D=E8=B4=A7?= =?UTF-8?q?=E7=89=A9=E6=98=AF=E5=90=A6=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lnsh_station/LnshStationDeviceDriver.java | 9 ++++--- .../auto/run/NDCSocketConnectionAutoRun.java | 24 ++++++++++++++++++- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java index bdb41a4..3191abb 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java @@ -13,6 +13,7 @@ import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; @@ -222,13 +223,15 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if (ObjectUtil.isNotEmpty(ignore_pickup_check) && "true".equals(ignore_pickup_check.toString())) { if (!requireSucess) { if(this.device_code.endsWith("SL01")){ + String devicecode="BLJ0"+this.device_code.charAt(3); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); Device nextDevice = appService.findDeviceByCode(devicecode); - if (nextDevice!=null && nextDevice.getDeviceDriver() instanceof LnshStationDeviceDriver) { - LnshStationDeviceDriver driver = (LnshStationDeviceDriver) nextDevice.getDeviceDriver(); + log.info("当前压机"+this.device_code+"申请叫料,开始判断"+devicecode+"是否有货"); + if (nextDevice!=null && nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + StandardInspectSiteDeviceDriver driver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver(); if(driver.getMove()==1){ - log.info("当前压机"+this.device_code+"对应对接位"+driver.device_code+"有货,暂不生成任务"); + log.info("当前压机"+this.device_code+"对应对接位"+driver.getDevice_code()+"有货,暂不生成任务"); }else{ callMaterial(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java b/acs/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java index df632c2..636ded3 100644 --- a/acs/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java +++ b/acs/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java @@ -26,6 +26,7 @@ import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; +import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.modules.system.service.ParamService; import org.nl.modules.system.service.impl.ParamServiceImpl; import org.nl.modules.wql.util.SpringContextHolder; @@ -588,7 +589,28 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { lnshStationDeviceDriver = (LnshStationDeviceDriver) device.getDeviceDriver(); lnshStationDeviceDriver.writing(13); Object ignore_pickup_check = lnshStationDeviceDriver.getExtraValue().get("ignore_pickup_check"); - if (ObjectUtil.isNotEmpty(ignore_pickup_check) && "true".equals(ignore_pickup_check.toString())) { + //上料位判断对应的对接位光电是否有货 + if(device.getDevice_code().endsWith("SL01")){ + String devicecode="BLJ0"+device.getDevice_code().charAt(3); + DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); + Device nextDevice = appService.findDeviceByCode(devicecode); + log.info("当前压机"+device.getDevice_code()+"申请放料,开始判断"+devicecode+"是否有货"); + if (nextDevice!=null && nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + StandardInspectSiteDeviceDriver driver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver(); + if(driver.getMove()==1){ + String message = "当前压机"+device.getDevice_code()+"对应对接位"+driver.getDevice_code()+"有货,暂不允许放货"; + log.info(message); + lnshStationDeviceDriver.setMessage(message); + }else{ + inst.setExecute_status("3"); + instructionService.update(inst); + lnshStationDeviceDriver.writing(3, Integer.parseInt(inst.getInstruction_code())); + data = ndcAGVService.sendAgvOneModeInst(phase, index, 0); + lnshStationDeviceDriver.setMessage(""); + flag = true; + } + } + } else if (ObjectUtil.isNotEmpty(ignore_pickup_check) && "true".equals(ignore_pickup_check.toString())) { if (lnshStationDeviceDriver.getMode() != 0 && (lnshStationDeviceDriver.getAction() == 2 || lnshStationDeviceDriver.getAction() == 3) && (lnshStationDeviceDriver.getIo_action() == 1 || lnshStationDeviceDriver.getIo_action() == 3)) {