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; + } +}