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

View File

@@ -165,6 +165,23 @@
</div>
</el-dialog>
<!--弹窗设置设备与图标绑定与角度-->
<el-dialog title="设备设置" :visible.sync="dialogFormVisible4" width="35%">
<el-form :model="form" size="small">
<el-form-item label="设备编号" prop="device_code" label-width="80px">
<el-input v-model="form.device_code" :disabled="true" />
</el-form-item>
<el-form-item label="条码" label-width="80px">
<el-input v-model="form.barcode" :disabled="false" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible4 = false"> </el-button>
<el-button type="primary" @click="setContainer"> </el-button>
</div>
</el-dialog>
<el-dialog title="设备设置" :visible.sync="dialogFormVisible2" width="35%">
<el-form :model="form" size="small">
<el-form-item label="设备编号" prop="device_code" label-width="80px">
@@ -228,6 +245,7 @@ export default {
dialogFormVisible1: false,
dialogFormVisible2: false,
dialogFormVisible3: false,
dialogFormVisible4: false,
arr2: [],
currentItem: '',
stageSelectList: [],
@@ -253,6 +271,7 @@ export default {
},
methods: {
clickDevice(item) {
debugger
const index = item.index
const clickObj = this.arr2[index]
if (!clickObj.img2 || clickObj.img2 === '1' || !item.data) {
@@ -274,12 +293,17 @@ export default {
if (clickObj.data.device_type === 'agv') {
this.dialogFormVisible3 = true
}
if (clickObj.data.driver_code === 'standard_conveyor_control') {
this.dialogFormVisible4 = true
}
if (clickObj.data.driver_code === 'standard_emptypallet_site') {
this.dialogFormVisible1 = true
}
this.form.angle = clickObj.angle
this.form.index = clickObj.index
this.form.device_code = clickObj.device_code
this.form.driver_code = clickObj.driver_code
this.form.hasGoodStatus = clickObj.data.hasGoods
this.form.barcode = clickObj.data.container
this.form.suspended = clickObj.data.suspended
@@ -451,6 +475,16 @@ export default {
console.log(err.response.data.message)
})
},
setContainer() {
deviceCrud.saveBarcode(this.form).then(res => {
this.notify('操作成功', 'success')
this.dialogFormVisible4 = false
this.initArr2()
}).catch(err => {
this.dialogFormVisible4 = false
console.log(err.response.data.message)
})
},
initArr2() {
actorCrud.queryStageActor('SHDP').then(data => {
if (data.detail.length > 0) {