From a01d3821b4756d32275828d30e3b2f011ae07ff0 Mon Sep 17 00:00:00 2001 From: "DESKTOP-5DIJMF9\\admin" <2388969634@qq.com> Date: Tue, 3 Sep 2024 19:21:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dacs=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E6=97=B6=EF=BC=8C=E4=BA=8C=E7=BB=B4=E7=A0=81?= =?UTF-8?q?=E4=B9=B1=E7=A0=81=E6=88=96=E8=80=85=E5=A4=9A=E6=89=AB=E8=BD=BD?= =?UTF-8?q?=E5=85=B7=E5=AF=BC=E8=87=B4=E4=BB=BB=E5=8A=A1=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=EF=BC=8C=E5=BC=82=E5=B8=B8=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=8B=92?= =?UTF-8?q?=E7=BB=9D=E7=94=B3=E8=AF=B7=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ext/service/impl/AcsToWmsServiceImpl.java | 37 ++++++------------- .../wms/pda/service/impl/PdaServiceImpl.java | 9 ----- .../nl/wms/sch/task_manage/AbstractTask.java | 27 ++++++++------ .../src/views/wms/ycl/outdetail/index.vue | 2 +- 4 files changed, 29 insertions(+), 46 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java index c986f79..e413104 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java @@ -1,9 +1,7 @@ package org.nl.wms.ext.service.impl; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; +import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpStatus; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -12,46 +10,30 @@ import lombok.extern.slf4j.Slf4j; import org.nl.common.exception.BadRequestException; import org.nl.common.utils.RedisUtils; import org.nl.common.utils.SecurityUtils; -import org.nl.system.service.logicflow.dao.Stage; import org.nl.system.service.notice.ISysNoticeService; -import org.nl.system.service.param.ISysParamService; -import org.nl.wms.database.material.service.IMdBaseMaterialService; -import org.nl.wms.database.material.service.dao.MdBaseMaterial; import org.nl.wms.ext.service.AcsToWmsService; import org.nl.wms.ext.service.dto.to.BaseResponse; -import org.nl.wms.ext.service.dto.to.wms.FeedBackTaskStatusRequest; -import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; -import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; +import org.nl.wms.sch.material.service.dao.Material; +import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.dao.SchBasePoint; -import org.nl.wms.sch.point.service.impl.SchBasePointServiceImpl; import org.nl.wms.sch.task.service.ISchBaseTaskService; import org.nl.wms.sch.task.service.dao.SchBaseTask; import org.nl.wms.sch.task_manage.AbstractTask; import org.nl.wms.sch.task_manage.GeneralDefinition; import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum; -import org.nl.wms.sch.task_manage.enums.PointStatusEnum; -import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum; import org.nl.wms.sch.task_manage.task.TaskFactory; import org.nl.wms.sch.task_manage.task.core.TaskStatus; -import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper; -import org.nl.wms.util.PointUtils; -import org.nl.wms.util.TaskUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - import javax.annotation.PostConstruct; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; /** * @Author: lyd @@ -71,15 +53,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Autowired private ISchBasePointService pointService; @Autowired - private ISchBaseVehiclematerialgroupService vehiclematerialgroupService; - @Autowired private TaskFactory taskFactory; @Autowired private ISysNoticeService noticeService; @Autowired - private PointMapper pointMapper; - @Autowired private RedisUtils redisUtils; + @Autowired + private MaterialMapper materialMapper; // 初始化反射方法 @PostConstruct @@ -152,6 +132,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String device_code = param.getString("device_code"); //设置任务类型 param.put("config_code",requestMethodCode); + //统一托盘码字段 + if(ObjectUtil.isNotEmpty(param.getString("sub_tray"))){ + param.put("vehicle_code2",param.getString("sub_tray")); + } + if(ObjectUtil.isNotEmpty(param.getString("mother_tray"))){ + param.put("vehicle_code",param.getString("mother_tray")); + } AbstractTask task = taskFactory.getTask(requestMethodCode); if(ObjectUtil.isEmpty(requestMethodCode)){ throw new BadRequestException("任务类型不能为空!requestMethodCode:"+requestMethodName+",device_code:"+device_code); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java index ffba98f..7b60e3a 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java @@ -6,8 +6,6 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import lombok.extern.slf4j.Slf4j; -import org.nl.common.exception.BadRequestException; -import org.nl.wms.database.material.service.IMdBaseMaterialService; import org.nl.wms.ext.service.AcsToWmsService; import org.nl.wms.ext.service.dto.to.BaseResponse; import org.nl.wms.pda.service.PdaService; @@ -19,14 +17,12 @@ import org.nl.wms.sch.material.service.dao.Material; import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; 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; import org.nl.wms.sch.task_manage.GeneralDefinition; import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; - import java.util.List; /** @@ -43,18 +39,13 @@ public class PdaServiceImpl implements PdaService { @Autowired private ISchBasePointService pointService; @Autowired - private IMdBaseMaterialService materialService; - @Autowired private ISchBaseVehiclematerialgroupService vehiclematerialgroupService; @Autowired - private ISchBaseTaskService taskService; - @Autowired private AcsToWmsService acsToWmsService; @Autowired private PointMapper pointMapper; @Autowired private MaterialMapper materialMapper; - @Override public PdaResponseVo dwzt(JSONObject param) { return PdaResponseVo.pdaResultOk("回温状态查询成功"); 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 5f81184..f5958c1 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 @@ -7,12 +7,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.nl.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; import org.nl.wms.ext.service.dto.to.BaseResponse; +import org.nl.wms.sch.material.service.dao.Material; +import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; 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; 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.GroupBindMaterialStatusEnum; import org.nl.wms.sch.task_manage.enums.TaskDirectionEnum; import org.nl.wms.sch.task_manage.task.AcsUtil; import org.nl.wms.sch.task_manage.task.core.TaskStatus; @@ -43,7 +46,8 @@ public abstract class AbstractTask { private IWorkorderService workorderService; @Autowired private WorkorderMapper workorderMapper; - + @Autowired + private MaterialMapper materialMapper; /** * 任务创建 * 根据配置生成任务,如并发控制等 @@ -169,14 +173,23 @@ public abstract class AbstractTask { String apply_point_code = param.getString("device_code"); // 请求点 String next_point = param.getString("next_point"); // 目的点 String config_code = param.getString("config_code"); - String sub_tray = param.getString("sub_tray"); + String sub_tray = param.getString("vehicle_code2");//子托盘 // 1、校验数据 SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper() .eq(SchBaseTaskconfig::getConfig_code, config_code)); Assert.notNull(taskConfig, "找不到配置文件,请确认[" + config_code + "]配置是否存在!"); //输送线相关任务不做处理 if(apply_point_code.startsWith("SSX")){ - //放行 + //输送线入库任务,校验入库单是否存在载具号 + if("YCLRKTask".equals(config_code)){ + //组盘表需要关联外部mes晶棒数据,一对多 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(Material::getPalletSN,sub_tray); + wrapper.eq(Material::getGroup_bind_material_status, GroupBindMaterialStatusEnum.BOUND.getValue()); + Integer list_size = materialMapper.selectCount(wrapper); + Assert.isFalse(list_size<=0, + "该任务申请子托盘["+sub_tray+"]异常,无原材料入库单据信息!"); + } }else{ //判断该申请点位是否存在起点或终点的未完成任务 List apply_point_lists = taskService.findUnFinishTasksByPoint_code2("",apply_point_code); @@ -190,14 +203,6 @@ public abstract class AbstractTask { Assert.isFalse(apply_sub_tray_lists.size()>0, "该任务申请子托盘["+sub_tray+"]已存在未完成的任务,无法申请任务!"); } - //子托盘非空 - String vehicle_code2 = param.getString("vehicle_code2"); - if(ObjectUtil.isNotEmpty(vehicle_code2)) { - //判断该子托盘是否存在未完成任务 - List apply_vehicle_code2_lists = taskService.findUnFinishTasksBySub_tray("",vehicle_code2); - Assert.isFalse(apply_vehicle_code2_lists.size()>0, - "该任务申请子托盘["+vehicle_code2+"]已存在未完成的任务,无法申请任务!"); - } // 最大可创建任务数 Integer tcmn = taskConfig.getTask_create_max_num(); // 获取申请的任务 diff --git a/lms/nladmin-ui/src/views/wms/ycl/outdetail/index.vue b/lms/nladmin-ui/src/views/wms/ycl/outdetail/index.vue index 56c790c..3dbb8b2 100644 --- a/lms/nladmin-ui/src/views/wms/ycl/outdetail/index.vue +++ b/lms/nladmin-ui/src/views/wms/ycl/outdetail/index.vue @@ -185,7 +185,7 @@ export default { return CRUD({ title: '晶棒库出库库存明细', url: 'api/report/yl/outdetail', - idField: 'group_id', + idField: 'pointCode', sort: 'pointCode,desc', optShow: { add: false,