From c19ad4d4e9eda09438e7b74860fbb4eb099796a3 Mon Sep 17 00:00:00 2001 From: loujf Date: Thu, 21 Jul 2022 12:25:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DeviceServiceImpl.java | 6 ++++ .../StandardCoveyorControlDeviceDriver.java | 17 ++++++++++ .../service/impl/InstructionServiceImpl.java | 2 +- .../service/impl/StageActorServiceImpl.java | 3 ++ acs/qd/src/views/acs/monitor/device/index.vue | 34 +++++++++++++++++++ 5 files changed, 61 insertions(+), 1 deletion(-) diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index a665105..f0fd919 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -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 diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java index 7d7ca1b..58de802 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java @@ -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 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 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 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 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 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 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); diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 5a82d7d..a8f2c8e 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -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 routeLineDtoList = routeLineService.getShortPathLines(instdto.getStart_device_code(), instdto.getNext_device_code(), instdto.getRoute_plan_code()); diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java index bc4c435..899bc61 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java @@ -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()); diff --git a/acs/qd/src/views/acs/monitor/device/index.vue b/acs/qd/src/views/acs/monitor/device/index.vue index 659bcf1..8c42ce3 100644 --- a/acs/qd/src/views/acs/monitor/device/index.vue +++ b/acs/qd/src/views/acs/monitor/device/index.vue @@ -165,6 +165,23 @@ + + + + + + + + + + + + + + @@ -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) {