From 291fec7023ed3224af15af0924da4cd1d479458c Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Tue, 20 Aug 2024 10:31:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91=E5=8A=9F=E8=83=BD=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E8=87=AA=E5=8A=A8=E6=8F=90=E4=BA=A4=E5=B9=B6=E4=B8=8B?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sch/task_manage/AutoCommitWorkOrder.java | 37 ++++++++++++++ .../task_manage/AutoCreateWorkOrderTask.java | 4 -- .../workorder/service/IWorkorderService.java | 5 ++ .../service/dao/mapper/WorkorderMapper.java | 2 + .../service/dao/mapper/WorkorderMapper.xml | 48 +++++++++++++++++++ .../service/impl/WorkorderServiceImpl.java | 14 ++++++ lms/nladmin-ui/.env.production | 4 +- 7 files changed, 108 insertions(+), 6 deletions(-) create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoCommitWorkOrder.java diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoCommitWorkOrder.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoCommitWorkOrder.java new file mode 100644 index 0000000..37da5fe --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoCommitWorkOrder.java @@ -0,0 +1,37 @@ + +package org.nl.wms.sch.task_manage; + +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.nl.wms.sch.workorder.service.IWorkorderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + + +@Slf4j +@Component +public class AutoCommitWorkOrder { + + @Autowired + private IWorkorderService workorderService; + + @SneakyThrows + public void run() { + log.info("定时任务AutoCommitWorkOrder开始执行:"); + this.doExecute(); + log.info("定时任务AutoCommitWorkOrder执行结束:"); + } + + + /** + * 根据工单情况自动提交并生成工单出库任务 + */ + private void doExecute() { + //根据工单情况自动提交 + workorderService.batchCommitAndCreateOrder(); + //并生成工单出库任务 + workorderService.batchCreateTask(); + } + +} + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoCreateWorkOrderTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoCreateWorkOrderTask.java index 98e3973..4443264 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoCreateWorkOrderTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoCreateWorkOrderTask.java @@ -1,15 +1,11 @@ package org.nl.wms.sch.task_manage; -import cn.hutool.core.util.ObjectUtil; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; -import org.nl.config.SpringContextHolder; import org.nl.wms.sch.workorder.service.IWorkorderService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.lang.reflect.Method; -import java.util.Set; @Slf4j diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/IWorkorderService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/IWorkorderService.java index 05cd9be..afc3b08 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/IWorkorderService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/IWorkorderService.java @@ -57,4 +57,9 @@ public interface IWorkorderService extends IService { * 批量生成工单出库任务 */ void batchCreateTask(); + + /** + * 批量提交并生成工单出库任务 + */ + void batchCommitAndCreateOrder(); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.java index 9939f39..49427a9 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.java @@ -16,4 +16,6 @@ public interface WorkorderMapper extends BaseMapper { void batchChange(List pointCodes,String mode,String status); List getYlOutDetail(); + + List getYlOutDetailByStatus(); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.xml index 2254139..99c84ca 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.xml @@ -61,4 +61,52 @@ pointCode ORDER BY point_code ASC + + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/impl/WorkorderServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/impl/WorkorderServiceImpl.java index 99dccdd..d1f1fcb 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/impl/WorkorderServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/impl/WorkorderServiceImpl.java @@ -29,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; import java.util.Set; +import java.util.stream.Collectors; @Slf4j @Service @@ -155,4 +156,17 @@ public class WorkorderServiceImpl extends ServiceImpl list = workorderMapper.getYlOutDetailByStatus(); + if(list.size()>0){ + //载具号集合 + List pointCodes = list.stream().map(YCLKCDto::getSubTray).collect(Collectors.toList()); + //更新工单状态和回温模式 + workorderMapper.batchChange(pointCodes,"0","1"); + } + } } diff --git a/lms/nladmin-ui/.env.production b/lms/nladmin-ui/.env.production index 786bd42..943a71f 100644 --- a/lms/nladmin-ui/.env.production +++ b/lms/nladmin-ui/.env.production @@ -2,6 +2,6 @@ ENV = 'production' # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置 # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http -VUE_APP_BASE_API = 'http://47.97.157.227:8010' +VUE_APP_BASE_API = 'http://10.26.138.21:8010' # 如果接口是 http 形式, wss 需要改为 ws -VUE_APP_WS_API = 'ws://47.97.157.227:8010' +VUE_APP_WS_API = 'ws://10.26.138.21:8010'