From 8ab1445ef4272160274d279fb0afb138bb4c0f84 Mon Sep 17 00:00:00 2001 From: loujf Date: Wed, 2 Nov 2022 21:16:25 +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 --- ...hPackagePalletManipulatorDeviceDriver.java | 1 - .../lnsh/lnsh_rgv/ItemProtocol.java | 6 +++ .../lnsh_station/LnshStationDeviceDriver.java | 4 +- acs/qd/src/views/acs/monitor/device/index.vue | 3 ++ .../acs/service/impl/AcsToWmsServiceImpl.java | 52 +++++++++++++++++++ 5 files changed, 63 insertions(+), 3 deletions(-) diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java index fffaef4..0fb35fa 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java @@ -1164,7 +1164,6 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD } else { this.instruction_require_time = date; JSONObject json = new JSONObject(); - this.instruction_require_time = date; String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code"); String demosub = linkobj.substring(1,linkobj.length()-1); String demoArray[] = demosub.split(","); diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/ItemProtocol.java index 9ef77ec..4f597a5 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/ItemProtocol.java @@ -40,6 +40,7 @@ public class ItemProtocol { public static String item_to_task2 = "to_task2"; public static String item_to_onset2 = "to_onset2"; public static String item_to_target2 = "to_target2"; + public static String item_to_container_type = "to_container_type"; private LnshRGVDeviceDriver driver; @@ -159,6 +160,10 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_to_task2); } + public int getTo_container_type() { + return this.getOpcIntegerValue(item_to_container_type); + } + //是否有货 public int hasGoods(int move) { return move; @@ -224,6 +229,7 @@ public class ItemProtocol { list.add(new ItemDto(item_to_onset2, "下发起始站", "DB51.W12")); list.add(new ItemDto(item_to_target2, "下发目标站", "DB51.W14")); list.add(new ItemDto(item_to_task2, "下发任务号2", "DB51.D16")); + list.add(new ItemDto(item_to_container_type, "下发托盘类型", "DB51.W20")); return list; } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java index d783c20..6616c7b 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java @@ -567,7 +567,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements json.put("type","2"); json.put("is_full","1"); - HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); + HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); if (ObjectUtil.isNotEmpty(result)) { JSONObject jsonObject = JSONObject.parseObject(result.body()); if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) { @@ -626,7 +626,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements json.put("type",type); // json.put("material",material); json.put("vehicle_code",this.autoGenericCode(String.valueOf(barcode))); -// json.put("is_full","1"); + json.put("is_full","1"); HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); if (ObjectUtil.isNotEmpty(result)) { JSONObject jsonObject = JSONObject.parseObject(result.body()); diff --git a/acs/qd/src/views/acs/monitor/device/index.vue b/acs/qd/src/views/acs/monitor/device/index.vue index a808438..2d0c9e9 100644 --- a/acs/qd/src/views/acs/monitor/device/index.vue +++ b/acs/qd/src/views/acs/monitor/device/index.vue @@ -423,6 +423,9 @@ export default { } else if (val === 'walk_y') { const obj = { name: '行走列', value: data[val] } arr.push(obj) + } else if (val === 'task') { + const obj = { name: '任务号', value: data[val] } + arr.push(obj) } else if (val === 'task1') { const obj = { name: '前工位任务号', value: data[val] } arr.push(obj) diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index d6ef0ca..e2f2dce 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -72,6 +72,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { throw new BadRequestException("类型不能为空!"); } WQLObject pointTable = WQLObject.getWQLObject("sch_base_point"); + WQLObject structivtTable = WQLObject.getWQLObject("st_ivt_structivt"); switch (type) { //送料入库 case "1": @@ -142,11 +143,62 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String vehicle_code = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("vehicle_code"); jsonObject.put("vehicle_code", vehicle_code); toPackIngTask.createTask((JSONObject) JSON.toJSON(jsonObject)); + + //生成到包装位的任务时,下发托盘类型给RGV + JSONObject vehicleObj = WQLObject.getWQLObject("st_buss_vehiclegroup").query("vehicle_code='" + vehicle_code + "'", "create_time desc").uniqueResult(0); + String material_id1 = vehicleObj.getString("material_id"); + JSONObject materiralObj1 = WQLObject.getWQLObject("md_me_material").query("material_id = '" + material_id1 + "'").uniqueResult(0); + String vehicle_type = materiralObj1.getString("vehicle_type"); + if (vehicle_type.equals("03")) { + vehicle_type = "1"; + } else if (vehicle_type.equals("04")) { + vehicle_type = "2"; + } else if (vehicle_type.equals("05")) { + vehicle_type = "3"; + } else if (vehicle_type.equals("06")) { + vehicle_type = "4"; + } else if (vehicle_type.equals("07")) { + vehicle_type = "5"; + } + JSONObject jsonObject1 = new JSONObject(); + JSONArray array = new JSONArray(); + jsonObject1.put("device_code","RGV2"); + jsonObject1.put("code","to_container_type"); + jsonObject1.put("value",vehicle_type); + array.add(jsonObject1); + try { + wmsToAcsServiceImpl.action(array); + } catch (Exception e) { + e.printStackTrace(); + } break; } //假如是半托缓存的几个位置,强制去包装 if (StrUtil.equals(area_type, AreaEnum.MTPQ.getCode())) { fmjToPackIngTask.createTask((JSONObject) JSON.toJSON(jsonObject)); + //生成到包装位的任务时,下发托盘类型给RGV + String point_id = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("point_id"); + material_id = structivtTable.query("point_id ='" + point_id + "'").uniqueResult(0).getString("material_id"); + JSONObject materiralObj1 = WQLObject.getWQLObject("md_me_material").query("material_id = '" + material_id + "'").uniqueResult(0); + String vehicle_type = materiralObj1.getString("vehicle_type"); + if (vehicle_type.equals("03")) { + vehicle_type = "1"; + } else if (vehicle_type.equals("04")) { + vehicle_type = "2"; + } else if (vehicle_type.equals("05")) { + vehicle_type = "3"; + } else if (vehicle_type.equals("06")) { + vehicle_type = "4"; + } else if (vehicle_type.equals("07")) { + vehicle_type = "5"; + } + JSONObject jsonObject1 = new JSONObject(); + JSONArray array = new JSONArray(); + jsonObject1.put("device_code","RGV2"); + jsonObject1.put("code","to_container_type"); + jsonObject1.put("value",vehicle_type); + array.add(jsonObject1); + wmsToAcsServiceImpl.action(array); } //假如是分拣机械手的下料位置,则需要将点位上的托盘号写入 if (StrUtil.equals(area_type, AreaEnum.FJQY.getCode())) {