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 f5958c1..2c659e4 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,7 +6,11 @@ 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.config.SpringContextHolder; +import org.nl.system.service.param.dao.Param; +import org.nl.system.service.param.impl.SysParamServiceImpl; import org.nl.wms.ext.service.dto.to.BaseResponse; +import org.nl.wms.ext.service.dto.to.wms.AcsResponse; 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; @@ -180,15 +184,24 @@ public abstract class AbstractTask { 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+"]异常,无原材料入库单据信息!"); + SysParamServiceImpl sysParamService = SpringContextHolder.getBean(SysParamServiceImpl.class); + //判断是否回传mes + Param isConnectAcs = sysParamService.findByCode(GeneralDefinition.IS_RETURN_MES); + if (ObjectUtil.isEmpty(isConnectAcs)) { + Assert.notNull(taskConfig, "找不到配置文件,请确认系统参数[is_return_mes]配置是否存在!"); + } + String isReturn = isConnectAcs.getValue(); + if("1".equals(isReturn)){ + //输送线入库任务,校验入库单是否存在载具号 + 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{ //判断该申请点位是否存在起点或终点的未完成任务 diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/GeneralDefinition.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/GeneralDefinition.java index 5c72138..e53dc59 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/GeneralDefinition.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/GeneralDefinition.java @@ -67,6 +67,8 @@ public class GeneralDefinition { // 参数名称 /** 是否连接 */ public static final String IS_CONNECT_ACS = "is_connect_acs"; + /** 是否连接 */ + public static final String IS_RETURN_MES = "is_return_mes"; /** ACS路径 */ public static final String ACS_URL = "acs_url"; /** 是否连接 */ diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java index f943493..2c03186 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java @@ -9,6 +9,8 @@ import cn.hutool.http.HttpRequest; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import lombok.extern.slf4j.Slf4j; import org.nl.common.exception.BadRequestException; import org.nl.wms.ext.service.dto.to.BaseResponse; @@ -35,6 +37,7 @@ import org.nl.wms.sch.task_manage.enums.GroupStatusEnum; import org.nl.wms.sch.task_manage.task.TaskType; 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.sch.workorder.service.dao.Workorder; import org.nl.wms.util.PointUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; @@ -293,6 +296,12 @@ public class YCLRKTask extends AbstractTask { .body(JSON.toJSONString(qpmes062Request)) .execute().body(); log.info("QPMES062服务调用成功,反馈{}",resultMsg); + //更新接口表 + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.eq("PalletSN",taskObj.getVehicle_code2()); + updateWrapper.eq("group_bind_material_status",GroupBindMaterialStatusEnum.BOUND.getValue()); + updateWrapper.set("group_bind_material_status",GroupBindMaterialStatusEnum.UNBOUND.getValue()); + materialMapper.update(null,updateWrapper); }else{ log.error("当前子托盘:"+taskObj.getVehicle_code2()+"不存在未解绑的物料信息,请确认!"); }