压机申请任务及请求放货时判断对接位货物是否为空

This commit is contained in:
psh
2024-04-23 09:11:41 +08:00
parent 67a339f3cc
commit 60571a21b7
2 changed files with 29 additions and 4 deletions

View File

@@ -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();
}

View File

@@ -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)) {