From 1a7d7fe0e2ec8e24b2336a0d9f6493a2c1a32a17 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Tue, 13 Dec 2022 10:34:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=8B=E5=88=B6=E9=80=81=E6=96=99=E5=85=88?= =?UTF-8?q?=E5=8E=BB=E5=85=A5=E7=AA=91=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sendMaterial/YzjSendMaterialTask.java | 21 +++++++++++++- .../wql/QSCH_yzSendMaterial_01.wql | 28 +++++++++++++++---- .../src/main/java/org/nl/wms/util/MapOf.java | 20 +++++++++++++ 3 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/util/MapOf.java diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/YzjSendMaterialTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/YzjSendMaterialTask.java index 214b3b7..4080aea 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/YzjSendMaterialTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/YzjSendMaterialTask.java @@ -17,6 +17,7 @@ import org.nl.wms.sch.SchTaskDto; import org.nl.wms.sch.manage.*; import org.nl.wms.sch.tasks.AcsTaskDto; import org.nl.wms.util.IdUtil; +import org.nl.wms.util.MapOf; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -239,8 +240,26 @@ public class YzjSendMaterialTask extends AbstractAcsTask { for (int i = 0; i < taskArr.size(); i++) { JSONObject taskObj = taskArr.getJSONObject(i); String vehicle_type = taskObj.getString("vehicle_type"); + // 优先判断窑口是否空位 + JSONObject rywPoint = WQL.getWO("QSCH_yzSendMaterial_01").addParamMap(MapOf.of("flag", "1", + "point_code", "RYW")).process().uniqueResult(0); + if (ObjectUtil.isNotEmpty(rywPoint)) { + // 找到去入窑口 + taskObj.put("update_time", DateUtil.now()); + taskObj.put("remark", ""); + taskObj.put("point_code2", rywPoint.getString("point_code")); + taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode()); + taskTab.update(taskObj); + + //锁住终点 + rywPoint.put("task_id", taskObj.getString("task_id")); + rywPoint.put("lock_type", PointEnum.LOCK_TYPE_TRUE.getCode()); + pointTab.update(rywPoint); + continue; + } + // 否则就去货架查找 JSONObject param1 = new JSONObject(); - param1.put("flag", "1"); + param1.put("flag", "2"); param1.put("region_code", "RYZCQ"); param1.put("vehicle_type", "%" + vehicle_type + "%"); //1、查找入窑暂存货架的空位 diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/wql/QSCH_yzSendMaterial_01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/wql/QSCH_yzSendMaterial_01.wql index 5bfd567..ec10333 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/wql/QSCH_yzSendMaterial_01.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/wql/QSCH_yzSendMaterial_01.wql @@ -14,8 +14,9 @@ ## 表字段对应输入参数 ################################################# 输入.flag TYPEAS s_string - 输入.region_code TYPEAS s_string - 输入.material_id TYPEAS s_string + 输入.region_code TYPEAS s_string + 输入.point_code TYPEAS s_string + 输入.material_id TYPEAS s_string 输入.vehicle_type TYPEAS s_string @@ -40,12 +41,27 @@ ########################################## # 3、业务主过程 # ########################################## -IF 输入.flag = "1" + IF 输入.flag = "1" QUERY SELECT - p.point_id, - p.point_code, - p.point_name + p.* + FROM + SCH_BASE_Point p + WHERE + lock_type = '1' + AND is_used = '1' + AND is_delete = '0' + AND point_status = '1' + OPTION 输入.point_code <> "" + p.point_code = 输入.point_code + ENDOPTION + ENDSELECT + ENDQUERY + ENDIF + IF 输入.flag = "2" + QUERY + SELECT + p.* FROM SCH_BASE_Point p WHERE diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/util/MapOf.java b/lms/nladmin-system/src/main/java/org/nl/wms/util/MapOf.java new file mode 100644 index 0000000..9cf6223 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/util/MapOf.java @@ -0,0 +1,20 @@ +package org.nl.wms.util; + + +import java.io.Serializable; +import java.util.HashMap; + +/* + * @author ZZQ + * @Date 2022/11/29 2:55 下午 + */ +public class MapOf implements Serializable { + + public static HashMap of(K... key){ + HashMap map = new HashMap<>(); + for (int i = 0; i < (key.length & ~1); i=i+2) { + map.put(key[i],key[i+1]); + } + return map; + } +}