Browse Source

压制送料先去入窑口

master
李永德 2 years ago
parent
commit
1a7d7fe0e2
  1. 21
      lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/YzjSendMaterialTask.java
  2. 24
      lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/wql/QSCH_yzSendMaterial_01.wql
  3. 20
      lms/nladmin-system/src/main/java/org/nl/wms/util/MapOf.java

21
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.manage.*;
import org.nl.wms.sch.tasks.AcsTaskDto; import org.nl.wms.sch.tasks.AcsTaskDto;
import org.nl.wms.util.IdUtil; import org.nl.wms.util.IdUtil;
import org.nl.wms.util.MapOf;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -239,8 +240,26 @@ public class YzjSendMaterialTask extends AbstractAcsTask {
for (int i = 0; i < taskArr.size(); i++) { for (int i = 0; i < taskArr.size(); i++) {
JSONObject taskObj = taskArr.getJSONObject(i); JSONObject taskObj = taskArr.getJSONObject(i);
String vehicle_type = taskObj.getString("vehicle_type"); 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(); JSONObject param1 = new JSONObject();
param1.put("flag", "1"); param1.put("flag", "2");
param1.put("region_code", "RYZCQ"); param1.put("region_code", "RYZCQ");
param1.put("vehicle_type", "%" + vehicle_type + "%"); param1.put("vehicle_type", "%" + vehicle_type + "%");
//1、查找入窑暂存货架的空位 //1、查找入窑暂存货架的空位

24
lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/wql/QSCH_yzSendMaterial_01.wql

@ -15,6 +15,7 @@
################################################# #################################################
输入.flag TYPEAS s_string 输入.flag TYPEAS s_string
输入.region_code TYPEAS s_string 输入.region_code TYPEAS s_string
输入.point_code TYPEAS s_string
输入.material_id TYPEAS s_string 输入.material_id TYPEAS s_string
输入.vehicle_type TYPEAS s_string 输入.vehicle_type TYPEAS s_string
@ -40,12 +41,27 @@
########################################## ##########################################
# 3、业务主过程 # # 3、业务主过程 #
########################################## ##########################################
IF 输入.flag = "1" IF 输入.flag = "1"
QUERY QUERY
SELECT SELECT
p.point_id, p.*
p.point_code, FROM
p.point_name 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 FROM
SCH_BASE_Point p SCH_BASE_Point p
WHERE WHERE

20
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 <K> 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;
}
}
Loading…
Cancel
Save