From dd235191a94f8e9daab4a770d6c11071d39cd5d9 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Sat, 21 Oct 2023 16:45:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=8C=E5=B1=82=E8=BE=93=E9=80=81?= =?UTF-8?q?=E7=BA=BF=E6=90=AC=E8=BF=90=E8=A7=84=E5=88=99=E3=80=81=E7=82=B9?= =?UTF-8?q?=E4=BD=8D=E5=A4=8D=E4=BD=8D=E9=97=AE=E9=A2=98=E3=80=81=E5=88=86?= =?UTF-8?q?=E6=8B=A3=E5=8C=85=E8=A3=85=E4=B8=8B=E5=8F=91=E8=A6=86=E8=86=9C?= =?UTF-8?q?=E6=9C=BA=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/config/lucene/LogMessageConstant.java | 1 - .../task_manage/task/tasks/fj/FJQKTask.java | 1 + .../task_manage/task/tasks/yao/GZYQLTask.java | 13 ++++++++---- .../task_manage/task/tasks/yz/YZSLTask.java | 10 ++++++++-- .../main/java/org/nl/wms/util/PointUtils.java | 20 +++++++++++++------ .../src/main/resources/config/application.yml | 2 +- 6 files changed, 33 insertions(+), 14 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java index e1a03e7..14ddcca 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java @@ -40,7 +40,6 @@ public class LogMessageConstant { public final static String COLOR_RESET = "\u001B[0m"; /** 背景颜色:黄色 */ public final static String BACKGROUND_YELLOW = "\u001B[43m"; - /** 索引路径 */ public final static String INDEX_DIR = "E:\\lucene\\index"; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java index 536504e..7769918 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java @@ -102,6 +102,7 @@ public class FJQKTask extends AbstractTask { // todo: 未确认是否放在1还是2,目前规定四点任务空盘的载具编码是2 task.setRemark(""); task.setGroup_id(point.getGroup_id()); + task.setResponse_param(param.toJSONString()); taskService.updateById(task); // 父点位锁住 diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java index 02b22a8..4e112b7 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java @@ -132,7 +132,7 @@ public class GZYQLTask extends AbstractTask { */ private SchBasePoint findStartPoint(List startRegionStr, JSONObject jsonObject) { // 无需工单 - // 默认认为缓存线有东西 + // 如果一个有货一个没货,但是载具数量又是5的时候,就要不需要检测不能为5 LambdaQueryWrapper lam = new LambdaQueryWrapper<>(); lam.in(SchBasePoint::getRegion_code, startRegionStr) .eq(SchBasePoint::getPoint_type, GeneralDefinition.EXIT) // 点位类型是缓存输送线出口 @@ -140,9 +140,14 @@ public class GZYQLTask extends AbstractTask { .or() .eq(SchBasePoint::getIng_task_code, "")) .eq(SchBasePoint::getPoint_status, PointStatusEnum.EMPTY_VEHICLE.getCode()) - .eq(SchBasePoint::getIs_used, true) - .ne(SchBasePoint::getVehicle_qty, 5) - .orderByDesc(SchBasePoint::getVehicle_qty); // 每次都将载具数量+1,每次拿最大的 + .eq(SchBasePoint::getIs_used, true); + List list = pointService.list(lam); + boolean doDetection = true; // 如果只有一条符合的数据就不需要检验不符合5个托 + if (list.size() == 1) { + doDetection = false; + } + // 默认认为缓存线有东西 + lam.ne(doDetection, SchBasePoint::getVehicle_qty, 5).orderByDesc(SchBasePoint::getVehicle_qty); // 每次都将载具数量+1,每次拿最大的 List schBasePoints = pointService.list(lam); return ObjectUtil.isNotEmpty(schBasePoints) ? schBasePoints.get(0) : null; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java index c38be0c..d15e170 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java @@ -186,8 +186,14 @@ public class YZSLTask extends AbstractTask { .and(la -> la.isNull(SchBasePoint::getIng_task_code) // 当前执行的任务为空或者NULL,有数据表示锁住 .or() .eq(SchBasePoint::getIng_task_code, "")) - .eq(SchBasePoint::getIs_used, true) - .ne(SchBasePoint::getVehicle_qty, 5) // 载具数量不能等于5 + .eq(SchBasePoint::getIs_used, true); + // 如果一个有货一个没货,但是载具数量又是5的时候,就要不需要检测不能为5 + List list = pointService.list(lam); + boolean doDetection = true; // 如果只有一条符合的数据就不需要检验不符合5个托 + if (list.size() == 1) { + doDetection = false; + } + lam.ne(doDetection, SchBasePoint::getVehicle_qty, 5) // 载具数量不能等于5 .orderByDesc(SchBasePoint::getVehicle_qty); List schBasePoints = pointService.list(lam); return ObjectUtil.isNotEmpty(schBasePoints) ? schBasePoints.get(0) : null; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/PointUtils.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/PointUtils.java index b722dad..24dd769 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/PointUtils.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/PointUtils.java @@ -21,14 +21,15 @@ public class PointUtils { /** * 获取状态名或者类型名 + * * @param explain * @param label * @return */ public static String getStatusOrTypeName(String explain, String label) { JSONObject statusArr = new JSONObject(); - String[] split = explain.split(","); - for ( int j = 0; j < split.length; j++) { + String[] split = explain.split(","); + for (int j = 0; j < split.length; j++) { String[] status = split[j].split("-"); statusArr.put(status[0], status[1]); } @@ -38,6 +39,7 @@ public class PointUtils { /** * 清空点位 + * * @param point */ public static void clearPoint(SchBasePoint point) { @@ -57,6 +59,7 @@ public class PointUtils { /** * 清空点位 * 双层输送线特殊功能:上五下五 + * * @param point */ public static void clearPointAndRetainNum(SchBasePoint point) { @@ -67,11 +70,10 @@ public class PointUtils { // 获取父点位 String parentPointCode = point.getParent_point_code(); SchBasePoint basePoint = pointService.getById(parentPointCode); - point.setPoint_status(PointStatusEnum.EMPTY_POINT.getCode()); point.setVehicle_type(""); point.setVehicle_code(""); point.setIng_task_code(""); - point.setVehicle_qty(point.getVehicle_qty() + 1); + point.setVehicle_qty(point.getVehicle_qty() == 5 ? point.getVehicle_qty() : point.getVehicle_qty() + 1); if (basePoint.getVehicle_qty() == 5) { // 等到新的点执行第一托的时候,才判断另一个点满足5个托盘的时候就清空 basePoint.setVehicle_qty(0); basePoint.setUpdate_time(DateUtil.now()); @@ -81,18 +83,24 @@ public class PointUtils { pointService.updateById(point); } - /** 点位修改更新信息 **/ + /** + * 点位修改更新信息 + **/ public static void setUpdateByAcs(SchBasePoint pointObj) { pointObj.setUpdate_id(GeneralDefinition.ACS_ID); pointObj.setUpdate_name(GeneralDefinition.ACS_NAME); pointObj.setUpdate_time(DateUtil.now()); } - /** 点位修改更新信息 **/ + + /** + * 点位修改更新信息 + **/ public static void setUpdateByPC(SchBasePoint pointObj) { pointObj.setUpdate_id(SecurityUtils.getCurrentUserId()); pointObj.setUpdate_name(SecurityUtils.getCurrentNickName()); pointObj.setUpdate_time(DateUtil.now()); } + public static void setUpdateByType(SchBasePoint pointObj, TaskFinishedTypeEnum taskFinishedType) { if (taskFinishedType.equals(TaskFinishedTypeEnum.AUTO_ACS)) { setUpdateByAcs(pointObj); diff --git a/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml b/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml index bbaafa7..b559a01 100644 --- a/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml +++ b/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml @@ -42,7 +42,7 @@ spring: freemarker: check-template-location: false profiles: - active: dev + active: prod jackson: time-zone: GMT+8 data: