This commit is contained in:
loujf
2022-07-21 12:25:54 +08:00
parent dcd8df0180
commit c19ad4d4e9
5 changed files with 61 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ import org.nl.acs.device_driver.electric_fence.ElectricFenceDeviceDriver;
import org.nl.acs.device_driver.jmagv.JMAgvDeviceDriver;
import org.nl.acs.device_driver.special_ordinary_site.SpecialOrdinarySiteDeviceDriver;
import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver;
import org.nl.acs.device_driver.standard_conveyor_control.StandardCoveyorControlDeviceDriver;
import org.nl.acs.device_driver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver;
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
@@ -1473,6 +1474,11 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
standardScannerDeviceDriver = (StandardScannerDeviceDriver) device.getDeviceDriver();
standardScannerDeviceDriver.writeBarcode(barcode);
}
StandardCoveyorControlDeviceDriver standardCoveyorControlDeviceDriver;
if (device.getDeviceDriver() instanceof StandardCoveyorControlDeviceDriver) {
standardCoveyorControlDeviceDriver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver();
standardCoveyorControlDeviceDriver.setContainer(barcode);
}
}
@Override

View File

@@ -23,6 +23,8 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.log.service.impl.LogServerImpl;
import org.nl.acs.opc.*;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.route.service.dto.RouteLineDto;
@@ -61,6 +63,9 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
@Autowired
AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class);
@Autowired
LogServer logServer = SpringContextHolder.getBean(LogServerImpl.class);
String container = "";
String container_type_desc;
String last_container_type_desc;
@@ -629,6 +634,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
//查询此终点的指令数量
List<Instruction> byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code);
if (byNextDeviceCode.size() >= list.size()) {
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
return true;
}
@@ -644,6 +650,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
}
//如果当前关联的设备中都有货的话,就返回
if (count != 0 && count >= list.size()) {
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
return true;
}
instructionService.create(instdto);
@@ -693,6 +700,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
//查询此终点的指令数量
List<Instruction> byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code);
if (byNextDeviceCode.size() >= list.size()) {
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
return true;
}
@@ -708,6 +716,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
}
//如果当前关联的设备中都有货的话,就返回
if (count != 0 && count >= list.size()) {
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
return true;
}
instructionService.create(instdto);
@@ -747,6 +756,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
//查询此终点的指令数量
List<Instruction> byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code);
if (byNextDeviceCode.size() >= list.size()) {
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
return true;
}
@@ -762,6 +772,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
}
//如果当前关联的设备中都有货的话,就返回
if (count != 0 && count >= list.size()) {
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
return true;
}
instructionService.create(instdto);
@@ -999,6 +1010,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
//查询此终点的指令数量
List<Instruction> byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code);
if (byNextDeviceCode.size() >= list.size()) {
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
return true;
}
@@ -1014,6 +1026,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
}
//如果当前关联的设备中都有货的话,就返回
if (count != 0 && count >= list.size()) {
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
return true;
}
@@ -1064,6 +1077,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
//查询此终点的指令数量
List<Instruction> byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code);
if (byNextDeviceCode.size() >= list.size()) {
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
return true;
}
@@ -1079,6 +1093,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
}
//如果当前关联的设备中都有货的话,就返回
if (count != 0 && count >= list.size()) {
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
return true;
}
instructionService.create(instdto);
@@ -1119,6 +1134,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
//查询此终点的指令数量
List<Instruction> byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code);
if (byNextDeviceCode.size() >= list.size()) {
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
return true;
}
@@ -1134,6 +1150,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
}
//如果当前关联的设备中都有货的话,就返回
if (count != 0 && count >= list.size()) {
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
return true;
}
instructionService.create(instdto);

View File

@@ -1298,7 +1298,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
instdto.setPriority(acsTask.getPriority());
instdto.setInstruction_status("0");
instdto.setExecute_device_code(dto.getNext_device_code());
logServer.log(instdto.getTask_code(),"finishAndCreateNextInst","",JSONObject.fromObject(dto).toString(),"","",now,instdto.getCarno());
// logServer.log(instdto.getTask_code(),"finishAndCreateNextInst","",JSONObject.fromObject(dto).toString(),"","",now,instdto.getCarno());
String type = "";
List<RouteLineDto> routeLineDtoList = routeLineService.getShortPathLines(instdto.getStart_device_code(), instdto.getNext_device_code(), instdto.getRoute_plan_code());

View File

@@ -355,6 +355,9 @@ public class StageActorServiceImpl implements StageActorService {
obj.put("device_name", standardCoveyorControlDeviceDriver.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("is_click", true);
jo.put("container", standardCoveyorControlDeviceDriver.getContainer());
jo.put("driver_code", "standard_conveyor_control");
jo.put("hasGoods", standardCoveyorControlDeviceDriver.getHasGoods());
jo.put("isOnline", standardCoveyorControlDeviceDriver.getIsonline());
jo.put("error", standardCoveyorControlDeviceDriver.getError());