From 2a950f60580fb98fa1ffbe5b1d2236999ef3b7aa Mon Sep 17 00:00:00 2001 From: psh Date: Fri, 19 Apr 2024 13:29:31 +0800 Subject: [PATCH] fix --- .../sch/task_manage/task/tasks/KJRKTask.java | 19 ++++------------- .../task_manage/task/tasks/SSXBKJTask.java | 21 +++++-------------- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java index 856d246..29acfe2 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java @@ -3,6 +3,7 @@ package org.nl.wms.sch.task_manage.task.tasks; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; +import com.alibaba.druid.util.StringUtils; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.extern.slf4j.Slf4j; @@ -108,10 +109,10 @@ public class KJRKTask extends AbstractTask { * @return */ private SchBasePoint findNextPoint() { - String regionCode = "YL"; + String regionCode = "KJHC"; List schBasePointList = pointMapper.findPointByRegion(regionCode, "0"); for (SchBasePoint schBasePoint : schBasePointList) { - if ("2".equals(schBasePoint.getPoint_status()) + if (StringUtils.isEmpty(schBasePoint.getIng_task_code()) && schBasePoint.getVehicle_qty() ==0) { log.info("原材料入库找到当前符合条件的点位{}", schBasePoint.getPoint_code()); return schBasePoint; @@ -135,19 +136,8 @@ public class KJRKTask extends AbstractTask { JSONObject extGroupData = ObjectUtil.isNotEmpty(taskObj.getExt_group_data()) ? JSONObject.parseObject(taskObj.getExt_group_data()) : null; - // 载具编码:没有就创建一个 - String vehicle_code = ObjectUtil.isNotEmpty(taskObj.getVehicle_code()) - ? taskObj.getVehicle_code() - : IdUtil.getSnowflake(1, 1).nextIdStr(); - PdmBdWorkorder workorderCode = null; - if (extGroupData != null) { - workorderCode = ObjectUtil.isNotEmpty(extGroupData.getString("workorder_code")) - ? workorderService.getOne(new LambdaQueryWrapper() - .eq(PdmBdWorkorder::getWorkorder_code, extGroupData.getString("workorder_code"))) - : null; - } String startPoint = taskObj.getPoint_code1(); // 获取起点 - String endPoint = ObjectUtil.isNotEmpty(taskObj.getPoint_code2())?taskObj.getPoint_code2().substring(0,taskObj.getPoint_code2().length()-2):"0"; // 获取终点 + String endPoint = taskObj.getPoint_code2(); // 获取终点 SchBasePoint startPointObj = pointService.getById(startPoint); SchBasePoint endPointObj = pointService.getById(endPoint); // 根据传来的类型去对任务进行操作 @@ -162,7 +152,6 @@ public class KJRKTask extends AbstractTask { } // 终点解锁 endPointObj.setIng_task_code(""); - endPointObj.setVehicle_code(ObjectUtil.isEmpty(endPointObj.getVehicle_code()) ? vehicle_code + "," : endPointObj.getVehicle_code() + vehicle_code + ","); endPointObj.setVehicle_qty(1); pointService.update(endPointObj); // 任务完成 diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java index 66eb215..65a2e9f 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java @@ -3,6 +3,7 @@ package org.nl.wms.sch.task_manage.task.tasks; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; +import com.alibaba.druid.util.StringUtils; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.extern.slf4j.Slf4j; @@ -108,10 +109,11 @@ public class SSXBKJTask extends AbstractTask { * @return */ private SchBasePoint findNextPoint() { - String regionCode = "YL"; + String regionCode = "KJHC"; List schBasePointList = pointMapper.findPointByRegion(regionCode, "0"); for (SchBasePoint schBasePoint : schBasePointList) { - if (schBasePoint.getVehicle_qty() ==1) { + if (StringUtils.isEmpty(schBasePoint.getIng_task_code()) + && schBasePoint.getVehicle_qty() ==1) { log.info("原材料入库找到当前符合条件的点位{}", schBasePoint.getPoint_code()); return schBasePoint; } @@ -134,19 +136,8 @@ public class SSXBKJTask extends AbstractTask { JSONObject extGroupData = ObjectUtil.isNotEmpty(taskObj.getExt_group_data()) ? JSONObject.parseObject(taskObj.getExt_group_data()) : null; - // 载具编码:没有就创建一个 - String vehicle_code = ObjectUtil.isNotEmpty(taskObj.getVehicle_code()) - ? taskObj.getVehicle_code() - : IdUtil.getSnowflake(1, 1).nextIdStr(); - PdmBdWorkorder workorderCode = null; - if (extGroupData != null) { - workorderCode = ObjectUtil.isNotEmpty(extGroupData.getString("workorder_code")) - ? workorderService.getOne(new LambdaQueryWrapper() - .eq(PdmBdWorkorder::getWorkorder_code, extGroupData.getString("workorder_code"))) - : null; - } String startPoint = taskObj.getPoint_code1(); // 获取起点 - String endPoint = ObjectUtil.isNotEmpty(taskObj.getPoint_code2())?taskObj.getPoint_code2().substring(0,taskObj.getPoint_code2().length()-2):"0"; // 获取终点 + String endPoint = taskObj.getPoint_code2(); // 获取终点 SchBasePoint startPointObj = pointService.getById(startPoint); SchBasePoint endPointObj = pointService.getById(endPoint); // 根据传来的类型去对任务进行操作 @@ -161,8 +152,6 @@ public class SSXBKJTask extends AbstractTask { } // 终点解锁 endPointObj.setIng_task_code(""); - endPointObj.setVehicle_code(ObjectUtil.isEmpty(endPointObj.getVehicle_code()) ? vehicle_code + "," : endPointObj.getVehicle_code() + vehicle_code + ","); - endPointObj.setVehicle_qty(1); pointService.update(endPointObj); // 任务完成 taskObj.setTask_status(TaskStatus.FINISHED.getCode());