From a612d56b1f6744e8c2be78accee3fa6f2b402ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E7=8E=AE?= Date: Tue, 25 Apr 2023 09:32:40 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=B6=B2=E5=8E=8B=E6=9C=BA=E4=BC=98?= =?UTF-8?q?=E5=85=88=E7=BA=A7=E6=8F=90=E5=8D=87=EF=BC=8C=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=BB=84=E7=9B=98id=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ext/acs/service/impl/AcsToWmsServiceImpl.java | 12 +++++++++++- .../wms/pdm/service/impl/DeviceServiceImpl.java | 5 ++++- .../wms/sch/task/call/empty/GTKCallEmptyTask.java | 3 ++- .../wms/sch/task/call/empty/HLCallEmptyTask.java | 3 ++- .../wms/sch/task/call/empty/YZCallEmptyTask.java | 15 ++++++++++----- .../task/call/material/FJCallMaterialTask.java | 4 +++- .../task/call/material/SZCallMaterialTask.java | 5 +++-- .../task/call/material/wql/CALL_MATERIAL_TASK.wql | 4 +++- .../wms/sch/task/send/empty/FJSendEmptyTask.java | 4 ++-- .../task/send/material/HLSendMaterialTask.java | 3 ++- .../task/send/material/SZSendMaterialTask.java | 3 ++- .../task/send/material/YZSendMaterialTask.java | 8 +++++++- .../java/org/nl/wms/sch/task/util/TaskUtils.java | 5 +++-- 13 files changed, 54 insertions(+), 20 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index 645c836..c48ee46 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -242,6 +242,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { case YZ: method_param.put("workorder", param.getJSONObject("workorder")); method_param.put("vd", param.getJSONObject("vd")); + JSONObject device = WQLObject + .getWQLObject("pdm_bi_device") + .query("device_code = '" + point.getString("device_code") + "'") + .uniqueResult(0); + method_param.put("device", device); task_code = yzSendMaterialTask.createTask(method_param); break; case SZ: @@ -305,6 +310,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .query("is_delete = '0' AND device_code = '" + device_code + "' AND order_status = '3'") .uniqueResult(0); method_param.put("workorder", work_order); + JSONObject device = WQLObject + .getWQLObject("pdm_bi_device") + .query("device_code = '" + device_code + "'") + .uniqueResult(0); + method_param.put("device", device); task_code = yzCallEmptyTask.createTask(method_param); break; case GTK: @@ -772,7 +782,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String vehicle_code = point.getString("vehicle_code"); JSONObject data = null; - if (!"0000".equals(vehicle_code)) { + if (StrUtil.isNotBlank(vehicle_code) && !"0000".equals(vehicle_code)) { data = WQL .getWO("ACS_TO_WMS") .addParam("flag", "1") diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java index 72ba106..e98afad 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java @@ -18,6 +18,7 @@ import org.nl.modules.common.utils.SecurityUtils; import org.nl.modules.wql.WQL; import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.util.WqlUtil; +import org.nl.wms.basedata.eum.TrueOrFalse; import org.nl.wms.pdm.service.DeviceService; import org.nl.wms.pdm.service.dto.DeviceDto; import org.springframework.data.domain.Pageable; @@ -120,8 +121,10 @@ public class DeviceServiceImpl implements DeviceService { @Override @Transactional(rollbackFor = Exception.class) public void deleteAll(Long[] ids) { + JSONObject device_update = new JSONObject(); + device_update.put("is_delete", TrueOrFalse.TRUE.value()); String s = CommonUtils.idsArrayToInStr(ids); - WQLObject.getWQLObject("pdm_bi_device").delete("device_id IN " + s); + WQLObject.getWQLObject("pdm_bi_device").update(device_update, "device_id IN " + s); } @Override diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/GTKCallEmptyTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/GTKCallEmptyTask.java index f2247b7..32c73cb 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/GTKCallEmptyTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/GTKCallEmptyTask.java @@ -44,9 +44,10 @@ public class GTKCallEmptyTask extends AbstractAcsTask { null, point.getString("point_code"), null, + null, VehicleType.STEEL_TRAY.value(), null, - "1", + 1, GTKCallEmptyTask.class.getName(), form.getString("create_mode"), form.getString("request_param"), diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/HLCallEmptyTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/HLCallEmptyTask.java index a1ba420..1f3655e 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/HLCallEmptyTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/HLCallEmptyTask.java @@ -53,9 +53,10 @@ public class HLCallEmptyTask extends AbstractAcsTask { null, point.getString("point_code"), null, + null, VehicleType.CUP.value(), null, - TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? "99" : "1", + TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 50 : 1, HLCallEmptyTask.class.getName(), form.getString("create_mode"), form.getString("request_param"), diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/YZCallEmptyTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/YZCallEmptyTask.java index 6a9d3c9..4dce321 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/YZCallEmptyTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/YZCallEmptyTask.java @@ -35,14 +35,18 @@ public class YZCallEmptyTask extends AbstractAcsTask { this.cancelTask(task, OperationType.AUTO); } } - + @Override public String createTask(JSONObject form) { JSONObject point = form.getJSONObject("point"); JSONObject work_order = form.getJSONObject("workorder"); - String priority = "1"; + int priority = 1; if (ObjectUtil.isNotEmpty(work_order)) { - priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? "99" : "1"; + priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 50 : 1; + } + JSONObject device = form.getJSONObject("device"); + if (ObjectUtil.isNotEmpty(device) && "4".equals(device.getString("device_model"))) { + ++priority; } JSONObject task = TaskUtils.buildTask( @@ -52,6 +56,7 @@ public class YZCallEmptyTask extends AbstractAcsTask { null, point.getString("point_code"), null, + null, VehicleType.STEEL_TRAY.value(), null, priority, @@ -120,7 +125,7 @@ public class YZCallEmptyTask extends AbstractAcsTask { this.finishTask(task, OperationType.MANUAL); } - + @Override public void cancel(String task_id) { JSONObject task = WQLObject.getWQLObject("sch_base_task").query("task_id = " + task_id).uniqueResult(0); @@ -166,7 +171,7 @@ public class YZCallEmptyTask extends AbstractAcsTask { point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } } - + public void finishTask(JSONObject task, OperationType operation_type) { if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) { task.put("task_status", TaskStatus.FINISHED.value()); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/FJCallMaterialTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/FJCallMaterialTask.java index 68a91f6..fccf4c4 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/FJCallMaterialTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/FJCallMaterialTask.java @@ -47,10 +47,11 @@ public class FJCallMaterialTask extends AbstractAcsTask { TaskStatus.SURE_END.value(), null, point.getString("point_code"), + null, workorder.getString("material_id"), VehicleType.STEEL_TRAY.value(), null, - TrueOrFalse.trueOrFalse(workorder.getString("is_urgent")) ? "99" : "1", + TrueOrFalse.trueOrFalse(workorder.getString("is_urgent")) ? 50 : 1, FJCallMaterialTask.class.getName(), form.getString("create_mode"), form.getString("request_param"), @@ -90,6 +91,7 @@ public class FJCallMaterialTask extends AbstractAcsTask { task.put("task_status", TaskStatus.START_AND_END.value()); task.put("point_code1", point.getString("point_code")); task.put("vehicle_code", TaskUtils.formatVehicleCode(point.getString("vehicle_code"))); + task.put("group_id", point.getString("vd_id")); task.put("remark", ""); TaskUtils.addAutoUpdateColum(task); task_table.update(task); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/SZCallMaterialTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/SZCallMaterialTask.java index 4df493e..e7f2caf 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/SZCallMaterialTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/SZCallMaterialTask.java @@ -1,6 +1,5 @@ package org.nl.wms.sch.task.call.material; -import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -65,9 +64,10 @@ public class SZCallMaterialTask extends AbstractAcsTask { null, point.getString("point_code"), null, + null, VehicleType.STEEL_TRAY.value(), null, - "1", + 1, SZCallMaterialTask.class.getName(), form.getString("create_mode"), form.getString("request_param"), @@ -107,6 +107,7 @@ public class SZCallMaterialTask extends AbstractAcsTask { task.put("point_code1", point.getString("point_code")); task.put("material_id", point.getString("material_id")); task.put("vehicle_code", TaskUtils.formatVehicleCode(point.getString("vehicle_code"))); + task.put("group_id", point.getString("vd_id")); task.put("remark", ""); TaskUtils.addAutoUpdateColum(task); task_table.update(task); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/wql/CALL_MATERIAL_TASK.wql b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/wql/CALL_MATERIAL_TASK.wql index 9e8dbc8..d86435a 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/wql/CALL_MATERIAL_TASK.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/wql/CALL_MATERIAL_TASK.wql @@ -42,6 +42,7 @@ QUERY SELECT point.*, + vd.vd_id, vd.material_id, workorder.is_urgent FROM @@ -82,7 +83,8 @@ IF 输入.flag = "3" QUERY SELECT - point.* + point.*, + vd.vd_id FROM sch_base_point point JOIN st_ivt_vehicle_detail vd ON point.vehicle_type = vd.vehicle_type diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/empty/FJSendEmptyTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/empty/FJSendEmptyTask.java index dbc23cc..84e2522 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/empty/FJSendEmptyTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/empty/FJSendEmptyTask.java @@ -11,7 +11,6 @@ import org.nl.wms.basedata.eum.VehicleType; import org.nl.wms.sch.manage.*; import org.nl.wms.sch.task.util.TaskUtils; import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; /** * @author zhangjiangwei @@ -48,9 +47,10 @@ public class FJSendEmptyTask extends AbstractAcsTask { point.getString("point_code"), null, null, + null, VehicleType.STEEL_TRAY.value(), vehicle_code, - "1", + 1, FJSendEmptyTask.class.getName(), form.getString("create_mode"), form.getString("request_param"), diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/HLSendMaterialTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/HLSendMaterialTask.java index 8adcb81..4dd0e94 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/HLSendMaterialTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/HLSendMaterialTask.java @@ -58,10 +58,11 @@ public class HLSendMaterialTask extends AbstractAcsTask { TaskStatus.SURE_START.value(), point.getString("point_code"), null, + null, work_order.getString("material_id"), VehicleType.CUP.value(), vehicle_code, - TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? "99" : "1", + TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 50 : 1, HLSendMaterialTask.class.getName(), form.getString("create_mode"), form.getString("request_param"), diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/SZSendMaterialTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/SZSendMaterialTask.java index 8f8a909..5aa5be6 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/SZSendMaterialTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/SZSendMaterialTask.java @@ -45,10 +45,11 @@ public class SZSendMaterialTask extends AbstractAcsTask { TaskStatus.SURE_START.value(), point.getString("point_code"), null, + vd.getString("vd_id"), vd.getString("material_id"), vd.getString("vehicle_type"), vd.getString("vehicle_code"), - "1", + 1, SZSendMaterialTask.class.getName(), form.getString("create_mode"), form.getString("request_param"), diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/YZSendMaterialTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/YZSendMaterialTask.java index 92214ea..672a4a9 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/YZSendMaterialTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/YZSendMaterialTask.java @@ -39,6 +39,11 @@ public class YZSendMaterialTask extends AbstractAcsTask { public String createTask(JSONObject form) { JSONObject point = form.getJSONObject("point"); JSONObject work_order = form.getJSONObject("workorder"); + int priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 50 : 1; + JSONObject device = form.getJSONObject("device"); + if (ObjectUtil.isNotEmpty(device) && "4".equals(device.getString("device_model"))) { + ++priority; + } JSONObject vd = form.getJSONObject("vd"); JSONObject task = TaskUtils.buildTask( @@ -47,10 +52,11 @@ public class YZSendMaterialTask extends AbstractAcsTask { TaskStatus.SURE_START.value(), point.getString("point_code"), null, + vd.getString("vd_id"), vd.getString("material_id"), vd.getString("vehicle_type"), vd.getString("vehicle_code"), - TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? "99" : "1", + priority, YZSendMaterialTask.class.getName(), form.getString("create_mode"), form.getString("request_param"), diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/util/TaskUtils.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/util/TaskUtils.java index f4f821f..ea73fdb 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/util/TaskUtils.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/util/TaskUtils.java @@ -53,10 +53,11 @@ public class TaskUtils { String task_status, String point_code1, String point_code2, + String group_id, String material_id, String vehicle_type, String vehicle_code, - String priority, + int priority, String handle_class, String create_mode, String request_param, @@ -74,7 +75,7 @@ public class TaskUtils { task.put("material_id", material_id); task.put("vehicle_type", vehicle_type); task.put("vehicle_code", vehicle_code); - task.put("priority", priority); + task.put("priority", String.valueOf(priority)); task.put("handle_class", handle_class); task.put("create_mode", create_mode); task.put("request_param", request_param);