From 628be284f56a72bc6b7727bf4eb357bfdc6496a5 Mon Sep 17 00:00:00 2001 From: zhangzhiqiang Date: Wed, 16 Nov 2022 16:17:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=8E=8B=E5=88=B6=E6=9C=BA=E5=8F=AB?= =?UTF-8?q?=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sch/tasks/callMaterial/YzjCallMaterialTask.java | 13 ++++++++++--- .../callMaterial/wql/QSCH_yzjCallMaterial_01.wql | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callMaterial/YzjCallMaterialTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callMaterial/YzjCallMaterialTask.java index a939bce..2ed1f5c 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callMaterial/YzjCallMaterialTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callMaterial/YzjCallMaterialTask.java @@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.utils.SecurityUtils; import org.nl.modules.system.util.CodeUtil; @@ -20,8 +21,9 @@ import org.nl.wms.sch.tasks.AcsTaskDto; import org.nl.wms.util.IdUtil; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.List; +import java.util.*; +import java.util.function.BiConsumer; +import java.util.function.Predicate; /** * @author: lyd @@ -33,6 +35,8 @@ import java.util.List; @Slf4j public class YzjCallMaterialTask extends AbstractAcsTask { private final String THIS_CLASS = YzjCallMaterialTask.class.getName(); + //start point,[endpoint1,endpoin2] + public static Map YZJ_OLD_POINT = new HashMap<>(); /** * 添加任务进行下发 * @@ -175,7 +179,10 @@ public class YzjCallMaterialTask extends AbstractAcsTask { String device_code = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0).getString("device_code"); JSONObject workOrderObj = workOrderTab.query("device_code = '" + device_code + "' and order_status = '3' and is_delete ='0'").uniqueResult(0); if (ObjectUtil.isEmpty(workOrderObj)) throw new BadRequestException("该设备当前未生产或者已删除"); - + String oldMatSendPoint = YZJ_OLD_POINT.get(point_code2);//旧料盅终点 + if (StringUtils.isNotEmpty(oldMatSendPoint)){ + point_code2=oldMatSendPoint; + } SchTaskDto dto = SchTaskDto.builder() .task_id(IdUtil.getLongId()) .task_code(CodeUtil.getNewCode("TASK_CODE")) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callMaterial/wql/QSCH_yzjCallMaterial_01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callMaterial/wql/QSCH_yzjCallMaterial_01.wql index 685eb23..5015f7e 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callMaterial/wql/QSCH_yzjCallMaterial_01.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callMaterial/wql/QSCH_yzjCallMaterial_01.wql @@ -53,6 +53,8 @@ SCH_BASE_Point p WHERE p.is_used = '1' + AND standing_time is not null + AND now()> DATE_ADD(standing_time,INTERVAL s_datetime MINUTE) AND is_delete = '0' AND lock_type='1' AND point_status = '3'