From c0aaa825fc4a6c33547afba8b9f226865ccad731 Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Mon, 19 Aug 2024 16:33:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=8C=81=E5=8E=9F=E6=9D=90=E6=96=99?= =?UTF-8?q?=E5=87=BA=E5=BA=93=EF=BC=9A=E7=94=B3=E8=AF=B7=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=97=B6=E6=A0=A1=E9=AA=8C=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E8=AF=A5=E8=BD=BD=E5=85=B7=E7=9A=84=E5=B7=A5=E5=8D=95=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E7=82=B9=E4=BD=8D=E4=B8=8A=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E8=BD=BD=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/wms/sch/task_manage/AbstractTask.java | 26 ++++++++++++------- .../workorder/service/IWorkorderService.java | 7 +++++ .../service/impl/WorkorderServiceImpl.java | 19 +++++++++++--- 3 files changed, 39 insertions(+), 13 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java index 930ce45..245de3d 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java @@ -6,11 +6,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.nl.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; -import org.nl.wms.database.material.service.IMdBaseMaterialService; -import org.nl.wms.database.material.service.dao.MdBaseMaterial; import org.nl.wms.ext.service.dto.to.BaseResponse; -import org.nl.wms.pdm.service.IPdmBdWorkorderService; -import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.task.service.ISchBaseTaskService; @@ -18,17 +14,16 @@ import org.nl.wms.sch.task.service.ISchBaseTaskconfigService; import org.nl.wms.sch.task.service.dao.SchBaseTask; import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig; import org.nl.wms.sch.task_manage.enums.TaskDirectionEnum; -import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum; import org.nl.wms.sch.task_manage.task.AcsUtil; import org.nl.wms.sch.task_manage.task.core.TaskStatus; import org.nl.wms.sch.workorder.service.IWorkorderService; +import org.nl.wms.sch.workorder.service.dao.Workorder; +import org.nl.wms.sch.workorder.service.dao.mapper.WorkorderMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * @author ldjun @@ -47,7 +42,7 @@ public abstract class AbstractTask { @Autowired private IWorkorderService workorderService; @Autowired - private IMdBaseMaterialService materialService; + private WorkorderMapper workorderMapper; /** * 任务创建 @@ -191,15 +186,26 @@ public abstract class AbstractTask { // 判断是否校验工单 if (taskConfig.getIs_check_workorder()) { //如果点位上没货 - if(ObjectUtil.isNotEmpty(pointObj.getVehicle_code2())) { + if(ObjectUtil.isEmpty(pointObj)) { + throw new BadRequestException(apply_point_code+"点位信息异常,请检查输入的点位!" ); + } + //如果点位上没货 + if(ObjectUtil.isEmpty(pointObj.getVehicle_code2())) { throw new BadRequestException("点位:" + apply_point_code+ "上无托盘信息!"); } + List works = workorderMapper.selectList(new LambdaQueryWrapper() + .eq(Workorder::getPalletSN, pointObj.getVehicle_code2()) + .le(Workorder::getStatus, 1)); + if(works.size()<=0){ + throw new BadRequestException("点位:" + apply_point_code+ "上托盘:"+pointObj.getVehicle_code2()+"无可出库工单信息!"); + } + //设置载具信息 param.put("vehicle_code2",pointObj.getVehicle_code2()); param.put("vehicle_code",pointObj.getVehicle_code()); //更新对应载具工单状态为已生成任务,不可在工单页面取消 //pdm_bd_workorder_two任务生成时,status改为2 - workorderService.update(pointObj.getVehicle_code2(),"2"); + workorderService.updateByPda(pointObj.getVehicle_code2(),"2",param.getString("mode")); // 校验工单 // 根据对接位的父点位编码(设备)找到工单设备 /*SchBasePoint one = pointService.getOne(new LambdaQueryWrapper() 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 1d29241..05cd9be 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 @@ -33,6 +33,13 @@ public interface IWorkorderService extends IService { */ public void update(String palletSN,String status); + /** + * + * @param palletSN + * @param status + * @param mode + */ + public void updateByPda(String palletSN,String status,String mode); /** * 多选删除 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 f59c7e0..99dccdd 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 @@ -1,6 +1,5 @@ package org.nl.wms.sch.workorder.service.impl; -import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; @@ -12,7 +11,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.extern.slf4j.Slf4j; import org.nl.common.domain.query.PageQuery; -import org.nl.common.utils.SecurityUtils; import org.nl.wms.pda.service.PdaService; import org.nl.wms.pdm.service.dao.PointDetailAdd; import org.nl.wms.sch.report.service.dto.YCLKCDto; @@ -20,7 +18,6 @@ import org.nl.wms.sch.task.service.ISchBaseTaskService; import org.nl.wms.sch.task.service.ISchBaseTaskconfigService; import org.nl.wms.sch.task.service.dao.SchBaseTask; import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig; -import org.nl.wms.sch.task_manage.enums.WorkOrderTwoStatusEnum; import org.nl.wms.sch.workorder.service.IWorkorderService; import org.nl.wms.sch.workorder.service.dao.Workorder; import org.nl.wms.sch.workorder.service.dao.mapper.WorkorderMapper; @@ -73,11 +70,27 @@ public class WorkorderServiceImpl extends ServiceImpl updateWrapper = new UpdateWrapper<>(); updateWrapper.eq("palletSN",palletSN); + //更新大于等于1的记录 updateWrapper.ge("status","1"); updateWrapper.set("status",status); workorderMapper.update(null,updateWrapper); } } + + @Override + public void updateByPda(String palletSN,String status,String mode){ + if(ObjectUtil.isNotEmpty(palletSN)){ + //更新已生成任务后的工单状态 + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.eq("palletSN",palletSN); + //更新小于等于1的记录 + updateWrapper.le("status","1"); + updateWrapper.set("status",status); + updateWrapper.set("mode",mode); + workorderMapper.update(null,updateWrapper); + } + } + @Override public void deleteAll(Set ids) { // 真删除