From 2c642ec8bbbbf6922fd79caf2b56213e1e934985 Mon Sep 17 00:00:00 2001 From: pangshenghao Date: Thu, 10 Aug 2023 16:04:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=A6=E5=8D=97=E6=96=B0=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=88=E6=89=8B=E6=8C=81=E3=80=81=E9=A9=B1?= =?UTF-8?q?=E5=8A=A8=E5=90=8C=E6=AD=A5=E4=BA=A7=E5=93=81=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- acs/hd/nladmin-system/pom.xml | 16 +- .../standard_autodoor/ItemProtocol.java | 2 +- .../standard_autodoor_smart/ItemProtocol.java | 2 +- .../ItemProtocol.java | 2 +- .../ItemProtocol.java | 2 +- .../ItemProtocol.java | 2 +- .../ItemProtocol.java | 2 +- .../ItemProtocol.java | 43 +- .../StandardInspectSiteSmartDeviceDriver.java | 33 +- .../nl/hand/service/impl/PadServiceImpl.java | 2 - .../auto/run/NDCSocketConnectionAutoRun.java | 467 ++++++++++-------- .../main/resources/config/application-dev.yml | 4 +- acs/qd/.env.development | 2 +- acs/qd/src/layout/components/Sidebar/Logo.vue | 2 +- acs/qd/src/views/login.vue | 2 +- acs/qd/vue.config.js | 2 +- .../security/security/TokenFilter.java | 2 +- .../acs/service/impl/AcsToWmsServiceImpl.java | 15 + .../service/impl/EmptyAndQtyServiceImpl.java | 150 +++--- .../rest/SendMaterialController.java | 11 +- .../service/SendMaterialService.java | 8 +- .../service/impl/SendMaterialServiceImpl.java | 98 ++-- .../sendmaterial/wql/PDA_SENDMATERIAL_01.wql | 29 ++ .../nl/wms/sch/service/dto/VehicleDto.java | 49 ++ lms/qd/.env.development | 4 +- lms/qd/src/layout/components/Sidebar/Logo.vue | 2 +- 26 files changed, 576 insertions(+), 377 deletions(-) create mode 100644 lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/dto/VehicleDto.java diff --git a/acs/hd/nladmin-system/pom.xml b/acs/hd/nladmin-system/pom.xml index ba51eb0..23e200a 100644 --- a/acs/hd/nladmin-system/pom.xml +++ b/acs/hd/nladmin-system/pom.xml @@ -20,11 +20,11 @@ - - org.bouncycastle - bcprov-jdk15on - 1.50 - + + + + + net.logstash.logback @@ -56,6 +56,12 @@ org.openscada.utgard org.openscada.opc.lib 1.5.0 + + + bcprov-jdk15on + org.bouncycastle + + com.squareup.okhttp3 diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/ItemProtocol.java index bd81d1b..66edb6e 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/ItemProtocol.java @@ -45,7 +45,7 @@ public class ItemProtocol { public int getOpcIntegerValue(String protocol) { Integer value = this.driver.getIntegeregerValue(protocol); if (value == null) { - log.error("读取错误!"); +// log.error("读取错误!"); } else { return value; } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor_smart/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor_smart/ItemProtocol.java index 39a278f..35cbca3 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor_smart/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor_smart/ItemProtocol.java @@ -45,7 +45,7 @@ public class ItemProtocol { public int getOpcIntegerValue(String protocol) { Integer value = this.driver.getIntegeregerValue(protocol); if (value == null) { - log.error("读取错误!"); +// log.error("读取错误!"); } else { return value; } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/ItemProtocol.java index 7d368cf..dc3a40b 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/ItemProtocol.java @@ -84,7 +84,7 @@ public class ItemProtocol { public int getOpcIntegerValue(String protocol) { Integer value = this.driver.getIntegeregerValue(protocol); if (value == null) { - log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); +// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); setIsonline(false); } else { setIsonline(true); diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_plcscanner/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_plcscanner/ItemProtocol.java index ca6f68e..04743a9 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_plcscanner/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_plcscanner/ItemProtocol.java @@ -101,7 +101,7 @@ public class ItemProtocol { public int getOpcIntegerValue(String protocol) { Integer value = this.driver.getIntegeregerValue(protocol); if (value == null) { - log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); +// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); setIsonline(false); } else { setIsonline(true); diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_scanner/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_scanner/ItemProtocol.java index dae1985..3ac4777 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_scanner/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_scanner/ItemProtocol.java @@ -96,7 +96,7 @@ public class ItemProtocol { public int getOpcIntegerValue(String protocol) { Integer value = this.driver.getIntegeregerValue(protocol); if (value == null) { - log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); +// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); setIsonline(false); } else { setIsonline(true); diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_monitor/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_monitor/ItemProtocol.java index c6f74ef..90c640e 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_monitor/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_monitor/ItemProtocol.java @@ -79,7 +79,7 @@ public class ItemProtocol { public int getOpcIntegerValue(String protocol) { Integer value = this.driver.getIntegeregerValue(protocol); if (value == null) { - log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); +// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); setIsonline(false); } else { setIsonline(true); diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java index 782bb3c..851339c 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java @@ -22,6 +22,10 @@ public class ItemProtocol { public static String item_to_target = "to_target"; public static String item_to_task = "to_task"; public static String item_weight = "weight"; + public static String item_product_code = "product_code"; + public static String item_batch_code = "batch_code"; + public static String item_product_specifications = "product_specifications"; + public static String item_time = "time"; private StandardInspectSiteSmartDeviceDriver driver; @@ -53,6 +57,27 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_task); } + public String getWeight() { + return this.getOpcStringValue(item_weight); + } + + public String getProductCode() { + return this.getOpcStringValue(item_product_code); + } + + public String getBatchCode() { + return this.getOpcStringValue(item_batch_code); + } + + public String getProductSpecifications() { + return this.getOpcStringValue(item_product_specifications); + } + + public String getTime() { + return this.getOpcStringValue(item_time); + } + + public int getToCommand() { return this.getOpcIntegerValue(item_to_command); } @@ -75,7 +100,7 @@ public class ItemProtocol { public int getOpcIntegerValue(String protocol) { Integer value = this.driver.getIntegerValue(protocol); if (value == null) { - log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); +// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); setIsonline(false); } else { setIsonline(true); @@ -85,6 +110,17 @@ public class ItemProtocol { } + public String getOpcStringValue(String protocol) { + String value = this.driver.getStringValue(protocol); + if (value == null) { + //throw new BusinessException("{} : {}", new Object[]{protocol, DeviceErrorProtocol.getMessage(10000)}); + + } else { + return value; + } + return "0"; + } + public static List getReadableItemDtos() { ArrayList list = new ArrayList(); list.add(new ItemDto(item_heartbeat, "心跳", "VW0")); @@ -93,6 +129,11 @@ public class ItemProtocol { list.add(new ItemDto(item_action, "动作信号", "VW8")); list.add(new ItemDto(item_error, "报警信号", "VW12")); list.add(new ItemDto(item_task, "任务号", "VD14")); + list.add(new ItemDto(item_product_code, "产品名称", "VW18")); + list.add(new ItemDto(item_batch_code, "批次号", "VW20", Boolean.valueOf(true))); + list.add(new ItemDto(item_product_specifications, "产品规格", "VW40")); + list.add(new ItemDto(item_weight, "重量", "VW50")); + list.add(new ItemDto(item_time, "时间", "VW60")); return list; } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java index f659d2e..87f788e 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java @@ -130,9 +130,6 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive // 工序 private String process; - // 重量 - private String weight; - // 质量状态 private String qc_status; @@ -146,6 +143,26 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive Boolean islock = false; + // 重量 + private String weight; + private String last_weight; + + // 产品名称 + private String product_code; + private String last_product_code; + + // 批次号 + private String batch_code; + private String last_batch_code; + + // 产品规格 + private String product_specifications; + private String last_product_specifications; + + // 时间 + private String time; + private String last_time; + @Override public Device getDevice() { return this.device; @@ -162,6 +179,11 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive move = this.itemProtocol.getMove(); task = this.itemProtocol.getTask(); hasGoods = this.itemProtocol.getMove(); + weight = this.itemProtocol.getWeight(); + product_code = this.itemProtocol.getProductCode(); + batch_code = this.itemProtocol.getBatchCode(); + product_specifications = this.itemProtocol.getProductSpecifications(); + time = this.itemProtocol.getTime(); if (mode != last_mode) { if (mode == 5) { @@ -337,6 +359,11 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive last_error = error; last_move = move; last_task = task; + last_weight = weight; + last_product_code = product_code; + last_product_specifications = product_specifications; + last_batch_code = batch_code; + last_time = time; } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/hand/service/impl/PadServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/hand/service/impl/PadServiceImpl.java index 3391973..f043728 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/hand/service/impl/PadServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/hand/service/impl/PadServiceImpl.java @@ -91,7 +91,6 @@ public class PadServiceImpl implements PadService { 3 强制完成*/ if (type.equals("1")) { //调用agv删除任务的接口 - agvService = SpringContextHolder.getBean("agvServiceImpl"); try { agvService.deleteAgvInstToNDC(instwo.toJavaObject(Instruction.class)); instructionService.cancel(inst_uuid); @@ -105,7 +104,6 @@ public class PadServiceImpl implements PadService { } if (type.equals("2")) { Instruction instdto = (Instruction) JSONObject.toJavaObject(instwo, Instruction.class); - AgvService agvserver = SpringContextHolder.getBean("agvServiceImpl"); try { if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) { diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java b/acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java index f62734d..5c0fbb3 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java @@ -14,6 +14,7 @@ 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_emptypallet_site.StandardEmptyPalletSiteDeviceDriver; import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.standard_inspect_site_smart200.StandardInspectSiteSmartDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.standard_storage.StandardStorageDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; @@ -156,6 +157,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { StandardStorageDeviceDriver standardStorageDeviceDriver; StandardAutodoorDeviceDriver standardAutodoorDeviceDriver; StandardEmptyPalletSiteDeviceDriver standardEmptyPalletSiteDeviceDriver; + StandardInspectSiteSmartDeviceDriver standardInspectSiteSmartDeviceDriver; int type = Integer.parseInt(acsConfigService.findConfigFromCache().get(AcsConfig.BUSINESSTYPE)); try { @@ -180,7 +182,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { // 到达取货点请求取货 else if (phase == 0x03) { if (ObjectUtil.isEmpty(inst)) { - logServer.deviceExecuteLog("未找到指令号对应的指令:", "","",String.valueOf(ikey)); + logServer.deviceExecuteLog("未找到指令号对应的指令:", "", "", String.valueOf(ikey)); break; } //检测站点 @@ -194,7 +196,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { data = AgvService.sendAgvOneModeInst(phase, index, 0); flag = true; } else { - logServer.deviceExecuteLog(device_code,"","", "AGV请求取货设备{}无货,无法反馈"); + logServer.deviceExecuteLog(device_code, "", "", "AGV请求取货设备{}无货,无法反馈"); } } //普通站点 @@ -212,49 +214,80 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { data = AgvService.sendAgvOneModeInst(phase, index, 0); flag = true; } else { - logServer.deviceExecuteLog(device_code,"","","AGV请求取货设备{}无货,无法反馈"); + logServer.deviceExecuteLog(device_code, "", "", "AGV请求取货设备{}无货,无法反馈"); } } } - // 检验取放货条件 - JSONObject agv_check = device_extra_table - .query("is_delete = '0' AND extra_code = 'agv_check' AND device_code = '" + device.getDevice_code() + "'") - .uniqueResult(0); - if (ObjectUtil.isNotEmpty(agv_check) && "true".equals(agv_check.getString("extra_value"))) { - JSONObject agv_check_status = device_extra_table - .query("is_delete = '0' AND extra_code = 'agv_check_status' AND device_code = '" + device.getDevice_code() + "'") - .uniqueResult(0); - if (ObjectUtil.isNotEmpty(agv_check_status) && "2".equals(agv_check_status.getString("extra_value"))) { + //检测站点smart200 + if (device.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) { + standardInspectSiteSmartDeviceDriver = (StandardInspectSiteSmartDeviceDriver) device.getDeviceDriver(); + if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.IGNOREHASGOODS), "1")) { inst.setExecute_status("1"); instructionService.update(inst); data = AgvService.sendAgvOneModeInst(phase, index, 0); flag = true; - agv_check_status.put("extra_value", "0"); - device_extra_table.update(agv_check_status); } else { - logServer.deviceExecuteLog(device_code,"","","AGV请求取货设备{}未放盖确认,无法反馈"); + if (device.getHas_goods() != 0) { + inst.setExecute_status("1"); + instructionService.update(inst); + data = AgvService.sendAgvOneModeInst(phase, index, 0); + flag = true; + } else { + logServer.deviceExecuteLog(device_code, "", "", "AGV请求取货设备{}无货,无法反馈"); + } } + + //如果是混料区则上送LMS当前点位的字段,同步到st_ivt_structivt仓位库存表 + JSONObject jsonObject = new JSONObject(); + jsonObject.put("device_code", device_code); + jsonObject.put("weight", standardInspectSiteSmartDeviceDriver.getWeight()); + jsonObject.put("product_code", standardInspectSiteSmartDeviceDriver.getProduct_code()); + jsonObject.put("batch_code", standardInspectSiteSmartDeviceDriver.getBatch_code()); + jsonObject.put("product_specifications", standardInspectSiteSmartDeviceDriver.getProduct_specifications()); + jsonObject.put("time", standardInspectSiteSmartDeviceDriver.getTime()); + jsonObject.put("type","9"); + acsToWmsService.lnshApplyTaskToWms(jsonObject); + } + + // 检验取放货条件 + JSONObject agv_check = device_extra_table + .query("is_delete = '0' AND extra_code = 'agv_check' AND device_code = '" + device.getDevice_code() + "'") + .uniqueResult(0); + if (ObjectUtil.isNotEmpty(agv_check) && "true".equals(agv_check.getString("extra_value"))) { + JSONObject agv_check_status = device_extra_table + .query("is_delete = '0' AND extra_code = 'agv_check_status' AND device_code = '" + device.getDevice_code() + "'") + .uniqueResult(0); + if (ObjectUtil.isNotEmpty(agv_check_status) && "2".equals(agv_check_status.getString("extra_value"))) { + inst.setExecute_status("1"); + instructionService.update(inst); + data = AgvService.sendAgvOneModeInst(phase, index, 0); + flag = true; + agv_check_status.put("extra_value", "0"); + device_extra_table.update(agv_check_status); + } else { + logServer.deviceExecuteLog(device_code, "", "", "AGV请求取货设备{}未放盖确认,无法反馈"); } } - // 取货完成请求离开 + } + // 取货完成请求离开 else if (phase == 0x05) { - if (ObjectUtil.isEmpty(inst)) { - logServer.deviceExecuteLog("未找到指令号对应的指令:", "","",String.valueOf(ikey)); - break; - } - if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - standardInspectSiteDeviceDriver.writing(3); - if (standardInspectSiteDeviceDriver.getMode() != 0 - && standardInspectSiteDeviceDriver.getMove() == 0) { - inst.setExecute_status("5"); - instructionService.update(inst); - data = AgvService.sendAgvOneModeInst(phase, index, 0); - flag = true; - } else { - logServer.deviceExecuteLog(device_code,"","","AGV取货完成请求离开设备{}有货,无法反馈"); - } + if (ObjectUtil.isEmpty(inst)) { + logServer.deviceExecuteLog("未找到指令号对应的指令:", "", "", String.valueOf(ikey)); + break; + } + if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); + standardInspectSiteDeviceDriver.writing(3); + if (standardInspectSiteDeviceDriver.getMode() != 0 + && standardInspectSiteDeviceDriver.getMove() == 0) { + inst.setExecute_status("5"); + instructionService.update(inst); + data = AgvService.sendAgvOneModeInst(phase, index, 0); + flag = true; + } else { + logServer.deviceExecuteLog(device_code, "", "", "AGV取货完成请求离开设备{}有货,无法反馈"); } + } // if(!inst.getTask_code().startsWith("-")) { // //反馈wms系统动作完成 @@ -269,64 +302,65 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { // acsToWmsService.feedbackActionStatusToWms(feedja); // } + } + //请求放货 + else if (phase == 0x07) { + if (ObjectUtil.isEmpty(inst)) { + logServer.deviceExecuteLog("未找到指令号对应的指令:", "", "", String.valueOf(ikey)); + break; } - //请求放货 - else if (phase == 0x07) { - if (ObjectUtil.isEmpty(inst)) { - logServer.deviceExecuteLog("未找到指令号对应的指令:", "","",String.valueOf(ikey)); - break; - } - if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - standardInspectSiteDeviceDriver.writing(4); - if (standardInspectSiteDeviceDriver.getMode() != 0 - && standardInspectSiteDeviceDriver.getMove() == 0) { inst.setExecute_status("3"); - instructionService.update(inst); - data = AgvService.sendAgvOneModeInst(phase, index, 0); - flag = true; - } else { - logServer.deviceExecuteLog(device_code,"","","AGV请求放货设备{}有货,无法反馈"); - } + if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); + standardInspectSiteDeviceDriver.writing(4); + if (standardInspectSiteDeviceDriver.getMode() != 0 + && standardInspectSiteDeviceDriver.getMove() == 0) { + inst.setExecute_status("3"); + instructionService.update(inst); + data = AgvService.sendAgvOneModeInst(phase, index, 0); + flag = true; + } else { + logServer.deviceExecuteLog(device_code, "", "", "AGV请求放货设备{}有货,无法反馈"); } - // 检验取放货条件 - JSONObject agv_check = device_extra_table - .query("is_delete = '0' AND extra_code = 'agv_check' AND device_code = '" + device.getDevice_code() + "'") + } + // 检验取放货条件 + JSONObject agv_check = device_extra_table + .query("is_delete = '0' AND extra_code = 'agv_check' AND device_code = '" + device.getDevice_code() + "'") + .uniqueResult(0); + if (ObjectUtil.isNotEmpty(agv_check) && "true".equals(agv_check.getString("extra_value"))) { + JSONObject agv_check_status = device_extra_table + .query("is_delete = '0' AND extra_code = 'agv_check_status' AND device_code = '" + device.getDevice_code() + "'") .uniqueResult(0); - if (ObjectUtil.isNotEmpty(agv_check) && "true".equals(agv_check.getString("extra_value"))) { - JSONObject agv_check_status = device_extra_table - .query("is_delete = '0' AND extra_code = 'agv_check_status' AND device_code = '" + device.getDevice_code() + "'") - .uniqueResult(0); - if (ObjectUtil.isNotEmpty(agv_check_status) && "1".equals(agv_check_status.getString("extra_value"))) { - inst.setExecute_status("1"); - instructionService.update(inst); - data = AgvService.sendAgvOneModeInst(phase, index, 0); - flag = true; - agv_check_status.put("extra_value", "0"); - device_extra_table.update(agv_check_status); - } else { - logServer.deviceExecuteLog(device_code,"","","AGV请求取货设备{}未取盖确认,无法反馈"); - } + if (ObjectUtil.isNotEmpty(agv_check_status) && "1".equals(agv_check_status.getString("extra_value"))) { + inst.setExecute_status("1"); + instructionService.update(inst); + data = AgvService.sendAgvOneModeInst(phase, index, 0); + flag = true; + agv_check_status.put("extra_value", "0"); + device_extra_table.update(agv_check_status); + } else { + logServer.deviceExecuteLog(device_code, "", "", "AGV请求取货设备{}未取盖确认,无法反馈"); } } - // 放货完成请求离开 - else if (phase == 0x09) { - if (ObjectUtil.isEmpty(inst)) { - logServer.deviceExecuteLog("未找到指令号对应的指令:", "","",String.valueOf(ikey)); - break; - } - if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - standardInspectSiteDeviceDriver.writing(5); - if (standardInspectSiteDeviceDriver.getMode() != 0 - && standardInspectSiteDeviceDriver.getMove() != 0) { - inst.setExecute_status("6"); - instructionService.update(inst); - data = AgvService.sendAgvOneModeInst(phase, index, 0); - flag = true; - } else { - logServer.deviceExecuteLog(device_code,"","","AGV放货完成请求离开设备{}无货,无法反馈"); - } + } + // 放货完成请求离开 + else if (phase == 0x09) { + if (ObjectUtil.isEmpty(inst)) { + logServer.deviceExecuteLog("未找到指令号对应的指令:", "", "", String.valueOf(ikey)); + break; + } + if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); + standardInspectSiteDeviceDriver.writing(5); + if (standardInspectSiteDeviceDriver.getMode() != 0 + && standardInspectSiteDeviceDriver.getMove() != 0) { + inst.setExecute_status("6"); + instructionService.update(inst); + data = AgvService.sendAgvOneModeInst(phase, index, 0); + flag = true; + } else { + logServer.deviceExecuteLog(device_code, "", "", "AGV放货完成请求离开设备{}无货,无法反馈"); } + } // if(!inst.getTask_code().startsWith("-")){ // //反馈wms系统动作完成 @@ -342,162 +376,167 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { // acsToWmsService.feedbackActionStatusToWms(feedja); // } + } + //任务完毕 + //(无车id及状态) + else if (phase == 0x0A) { + if (!ObjectUtil.isEmpty(inst)) { + inst.setInstruction_status("2"); + instructionService.finish(inst); } - //任务完毕 - //(无车id及状态) - else if (phase == 0x0A) { - if (!ObjectUtil.isEmpty(inst)) { - inst.setInstruction_status("2"); - instructionService.finish(inst); - } - data = AgvService.sendAgvOneModeInst(phase, index, 0); - } - //请求删除任务 - else if (phase == 0x30) { - flag = true; - if (!ObjectUtil.isEmpty(inst)) { - data = AgvService.sendAgvOneModeInst(0x8F, index, 0); - } else { - log.info("未找到对应的指令无法删除"); - break; - } + data = AgvService.sendAgvOneModeInst(phase, index, 0); + } + //请求删除任务 + else if (phase == 0x30) { + flag = true; + if (!ObjectUtil.isEmpty(inst)) { + data = AgvService.sendAgvOneModeInst(0x8F, index, 0); + } else { + log.info("未找到对应的指令无法删除"); + break; } - //任务删除确认 - //(需要WCS反馈) - else if (phase == 0xFF) { - flag = true; - if (!ObjectUtil.isEmpty(inst)) { - instructionService.cancel(inst.getInstruction_id()); - } - data = AgvService.sendAgvOneModeInst(phase, index, 0); + } + //任务删除确认 + //(需要WCS反馈) + else if (phase == 0xFF) { + flag = true; + if (!ObjectUtil.isEmpty(inst)) { + instructionService.cancel(inst.getInstruction_id()); } - //进入区域 - else if (phase == 0x50) { - //开门 - if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { - standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); + data = AgvService.sendAgvOneModeInst(phase, index, 0); + } + //进入区域 + else if (phase == 0x50) { + //开门 + if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { + standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); + standardAutodoorDeviceDriver.OpenOrClose("1"); + standardAutodoorDeviceDriver.writeing(1); + if (standardAutodoorDeviceDriver.getAction() == 1) { standardAutodoorDeviceDriver.OpenOrClose("1"); - standardAutodoorDeviceDriver.writeing(1); - if (standardAutodoorDeviceDriver.getAction() == 1) { - standardAutodoorDeviceDriver.OpenOrClose("1"); - data = AgvService.sendAgvOneModeInst(phase, index, 0); - } + data = AgvService.sendAgvOneModeInst(phase, index, 0); } } - //离开区域 - else if (phase == 0x51) { - //关门 - if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { - standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); - standardAutodoorDeviceDriver.OpenOrClose("2"); - standardAutodoorDeviceDriver.writeing(2); - if (standardAutodoorDeviceDriver.getAction() == 2) { - data = AgvService.sendAgvOneModeInst(phase, index, 0); - } + } + //离开区域 + else if (phase == 0x51) { + //关门 + if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { + standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); + standardAutodoorDeviceDriver.OpenOrClose("2"); + standardAutodoorDeviceDriver.writeing(2); + if (standardAutodoorDeviceDriver.getAction() == 2) { + data = AgvService.sendAgvOneModeInst(phase, index, 0); } - } else if (phase == 0x64) { - data = AgvService.sendAgvOneModeInst(phase, index, 0); } - //上报异常 - else if (phase == 0x67) { - AgvDto dto = null; - Map map = AgvService.findAllAgvFromCache(); - if (map.containsKey(String.valueOf(carno))) { - dto = map.get(String.valueOf(carno)); - } else { - dto = new AgvDto(); - } - dto.setName(String.valueOf(carno)); - if (arr[18] * 256 + arr[19] == 0) { - dto.setState("IDLE"); - acsToWmsService.feedbackAgvStatus(String.valueOf(carno), "0", ""); - } else { - StringBuffer errbs = new StringBuffer(); - for (int i = 0; i < ERROR.length; i++) { - if (((arr[18] * 256 + arr[19]) & (1 << i)) > 0) - errbs.append("," + ERROR[i]); - //反馈故障 - } - dto.setState("ERROR"); - acsToWmsService.feedbackAgvStatus(String.valueOf(carno), "1", "error"); - } + } else if (phase == 0x64) { + data = AgvService.sendAgvOneModeInst(phase, index, 0); + } + //上报异常 + else if (phase == 0x67) { + AgvDto dto = null; + Map map = AgvService.findAllAgvFromCache(); + if (map.containsKey(String.valueOf(carno))) { + dto = map.get(String.valueOf(carno)); + } else { + dto = new AgvDto(); } - //X坐标 - else if (phase == 0x70) { - AgvDto dto = null; - Map map = AgvService.findAllAgvFromCache(); - carno = arr[18] * 256 + arr[19]; - if (map.containsKey(String.valueOf(carno))) { - dto = map.get(String.valueOf(carno)); - } else { - dto = new AgvDto(); + dto.setName(String.valueOf(carno)); + if (arr[18] * 256 + arr[19] == 0) { + dto.setState("IDLE"); + acsToWmsService.feedbackAgvStatus(String.valueOf(carno), "0", ""); + } else { + StringBuffer errbs = new StringBuffer(); + for (int i = 0; i < ERROR.length; i++) { + if (((arr[18] * 256 + arr[19]) & (1 << i)) > 0) + errbs.append("," + ERROR[i]); + //反馈故障 } - dto.setName(String.valueOf(carno)); - dto.setPositionX(String.valueOf(ikey)); + dto.setState("ERROR"); + acsToWmsService.feedbackAgvStatus(String.valueOf(carno), "1", "error"); } - //Y坐标 - else if (phase == 0x71) { - AgvDto dto = null; - Map map = AgvService.findAllAgvFromCache(); - carno = arr[18] * 256 + arr[19]; - if (map.containsKey(String.valueOf(carno))) { - dto = map.get(String.valueOf(carno)); - } else { - dto = new AgvDto(); - } - dto.setName(String.valueOf(carno)); - dto.setPositionY(String.valueOf(ikey)); + } + //X坐标 + else if (phase == 0x70) { + AgvDto dto = null; + Map map = AgvService.findAllAgvFromCache(); + carno = arr[18] * 256 + arr[19]; + if (map.containsKey(String.valueOf(carno))) { + dto = map.get(String.valueOf(carno)); + } else { + dto = new AgvDto(); } - //角度 - else if (phase == 0x72) { - AgvDto dto = null; - Map map = AgvService.findAllAgvFromCache(); - carno = arr[18] * 256 + arr[19]; - if (map.containsKey(String.valueOf(carno))) { - dto = map.get(String.valueOf(carno)); - } else { - dto = new AgvDto(); - } - dto.setName(String.valueOf(carno)); - dto.setPositionAngle(String.valueOf(ikey)); + dto.setName(String.valueOf(carno)); + dto.setPositionX(String.valueOf(ikey)); + } + //Y坐标 + else if (phase == 0x71) { + AgvDto dto = null; + Map map = AgvService.findAllAgvFromCache(); + carno = arr[18] * 256 + arr[19]; + if (map.containsKey(String.valueOf(carno))) { + dto = map.get(String.valueOf(carno)); + } else { + dto = new AgvDto(); } - //电量 - else if (phase == 0x73) { - AgvDto dto = null; - Map map = AgvService.findAllAgvFromCache(); - carno = arr[18] * 256 + arr[19]; - if (map.containsKey(String.valueOf(carno))) { - dto = map.get(String.valueOf(carno)); - } else { - dto = new AgvDto(); - } - dto.setName(String.valueOf(carno)); - dto.setEnergyLevel(String.valueOf(ikey)); + dto.setName(String.valueOf(carno)); + dto.setPositionY(String.valueOf(ikey)); + } + //角度 + else if (phase == 0x72) { + AgvDto dto = null; + Map map = AgvService.findAllAgvFromCache(); + carno = arr[18] * 256 + arr[19]; + if (map.containsKey(String.valueOf(carno))) { + dto = map.get(String.valueOf(carno)); + } else { + dto = new AgvDto(); } - if (!ObjectUtil.isEmpty(data)) { - write(data); + dto.setName(String.valueOf(carno)); + dto.setPositionAngle(String.valueOf(ikey)); + } + //电量 + else if (phase == 0x73) { + AgvDto dto = null; + Map map = AgvService.findAllAgvFromCache(); + carno = arr[18] * 256 + arr[19]; + if (map.containsKey(String.valueOf(carno))) { + dto = map.get(String.valueOf(carno)); + } else { + dto = new AgvDto(); } - } catch (Exception e) { - System.out.println(e); - log.info(e.toString()); - log.info(e.getMessage()); - e.printStackTrace(); + dto.setName(String.valueOf(carno)); + dto.setEnergyLevel(String.valueOf(ikey)); + } + if (!ObjectUtil.isEmpty(data)) { + write(data); } - } else { - System.out.println("agv上报不是0073类型动作,不处理"); + } catch(Exception e){ + System.out.println(e); + log.info(e.toString()); + log.info(e.getMessage()); + e.printStackTrace(); } + } else{ + System.out.println("agv上报不是0073类型动作,不处理"); } + } - } catch (Exception e) { + } catch( + Exception e) + { - } finally { + } finally + + { - } } +} + @Override public void stop() { diff --git a/acs/hd/nladmin-system/src/main/resources/config/application-dev.yml b/acs/hd/nladmin-system/src/main/resources/config/application-dev.yml index fdbfdd9..64dd11f 100644 --- a/acs/hd/nladmin-system/src/main/resources/config/application-dev.yml +++ b/acs/hd/nladmin-system/src/main/resources/config/application-dev.yml @@ -8,11 +8,11 @@ spring: druid: db-type: com.alibaba.druid.pool.DruidDataSource driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy - url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:xugong_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true + url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:jianan_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:rljn_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true username: ${DB_USER:root} # password: ${DB_PWD:P@ssw0rd} - password: ${DB_PWD:Root.123456} + password: ${DB_PWD:123456} # password: ${DB_PWD:123456} # 初始连接数 initial-size: 5 diff --git a/acs/qd/.env.development b/acs/qd/.env.development index d3d2806..42ce1c5 100644 --- a/acs/qd/.env.development +++ b/acs/qd/.env.development @@ -1,7 +1,7 @@ ENV = 'development' # 接口地址 -VUE_APP_BASE_API = 'http://192.168.81.140:8010' +VUE_APP_BASE_API = 'http://127.0.0.1:8010' VUE_APP_WS_API = 'ws://127.0.0.1:8010' # 是否启用 babel-plugin-dynamic-import-node插件 diff --git a/acs/qd/src/layout/components/Sidebar/Logo.vue b/acs/qd/src/layout/components/Sidebar/Logo.vue index 8d2739c..53e8dd2 100644 --- a/acs/qd/src/layout/components/Sidebar/Logo.vue +++ b/acs/qd/src/layout/components/Sidebar/Logo.vue @@ -25,7 +25,7 @@ export default { }, data() { return { - title: '诺力ACS系统', + title: '迦南ACS系统', logo: Logo } } diff --git a/acs/qd/src/views/login.vue b/acs/qd/src/views/login.vue index e4f3a84..d11d6d4 100644 --- a/acs/qd/src/views/login.vue +++ b/acs/qd/src/views/login.vue @@ -2,7 +2,7 @@