From 3eb61381fb61f246fec975a78c5a196927609510 Mon Sep 17 00:00:00 2001 From: yanps Date: Mon, 19 Aug 2024 16:53:40 +0800 Subject: [PATCH] =?UTF-8?q?opt:=20=E6=89=8B=E6=8C=81=E6=93=8D=E4=BD=9C,?= =?UTF-8?q?=E5=8F=96=E7=A9=BA=E7=AC=BC=E6=A1=86=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HandheldController.java | 7 +- .../ext/handheld/service/HandheldService.java | 4 +- .../service/impl/HandheldServiceImpl.java | 40 +++++-- .../dao/SchBaseVehiclematerialgroup.java | 1 + .../point/service/ISchBasePointService.java | 7 ++ .../dao/mapper/SchBasePointMapper.java | 3 + .../service/dao/mapper/SchBasePointMapper.xml | 10 ++ .../service/impl/SchBasePointServiceImpl.java | 105 +++++++++++------- .../task/tasks/handheld/BlankingTask.java | 12 +- .../task/tasks/handheld/EmptyCageTask.java | 29 +++-- .../task/tasks/handheld/ToStoreHouseTask.java | 20 +--- .../task/tasks/sorting/SortingSMTTask.java | 2 + 12 files changed, 153 insertions(+), 87 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/controller/HandheldController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/controller/HandheldController.java index ff9ced8..a3810ac 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/controller/HandheldController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/controller/HandheldController.java @@ -62,14 +62,13 @@ public class HandheldController { @ApiOperation("点位锁定释放") @SaIgnore public ResponseEntity applyPointLock(@RequestBody JSONObject param) { - handheldService.pointLock(param); - return new ResponseEntity<>(HttpStatus.OK); + return new ResponseEntity<>(handheldService.pointLock(param), HttpStatus.OK); } @PostMapping("/sourehouse") - @Log("物料回库") - @ApiOperation("物料回库") + @Log("补空框") + @ApiOperation("补空框") @SaIgnore public ResponseEntity createToStorehouse(@RequestBody JSONObject param) { handheldService.toStorehouse(param); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/HandheldService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/HandheldService.java index b71207e..8e2c56a 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/HandheldService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/HandheldService.java @@ -33,10 +33,10 @@ public interface HandheldService { * 点位锁定 * @param param */ - void pointLock(JSONObject param); + String pointLock(JSONObject param); /** - * 物料回库任务 + * 补空框 * @param param */ void toStorehouse(JSONObject param); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java index 2422b84..70cb01f 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java @@ -9,11 +9,15 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import nl.basjes.shaded.org.springframework.util.Assert; import org.nl.common.exception.BadRequestException; +import org.nl.system.service.notice.ISysNoticeService; import org.nl.wms.ext.handheld.service.HandheldService; +import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; +import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.region.service.ISchBaseRegionService; import org.nl.wms.sch.region.service.dao.SchBaseRegion; +import org.nl.wms.sch.task.service.ISchBaseTaskService; import org.nl.wms.sch.task_manage.AbstractTask; import org.nl.wms.sch.task_manage.GeneralDefinition; import org.nl.wms.sch.task_manage.task.TaskFactory; @@ -30,12 +34,14 @@ public class HandheldServiceImpl implements HandheldService { @Autowired private ISchBasePointService iSchBasePointService; - @Autowired private TaskFactory taskFactory; - @Autowired private ISchBaseRegionService iSchBaseRegionService; + @Autowired + private ISchBaseVehiclematerialgroupService iSchBaseVehiclematerialgroupService; + @Autowired + private ISchBaseTaskService iSchBaseTaskService; @Override @@ -82,12 +88,12 @@ public class HandheldServiceImpl implements HandheldService { @Override public void cageBlankingTask(JSONObject param) { Assert.noNullElements(new Object[]{param.getString("device_code"), param.getString("vehicle_code") - , param.getString("material_id"), param.getString("region_code"), param.getString("has_report")}, "参数不能为空!"); + , param.getString("material_qty"), param.getString("region_code"), param.getString("order_code")}, "参数不能为空!"); String device_code = param.getString("device_code"); String vehicle_code = param.getString("vehicle_code"); - String material_id = param.getString("material_id"); + String material_qty = param.getString("material_qty"); String region_code = param.getString("region_code"); - String has_report = param.getString("has_report"); + String order_code = param.getString("order_id"); SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(device_code); if (ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("设备点位不存在!"); iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) @@ -103,43 +109,53 @@ public class HandheldServiceImpl implements HandheldService { jo.put("region_code", region_code); jo.put("ext_data", param); connectorTask.apply(jo); + iSchBaseVehiclematerialgroupService.remove(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class) + .eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicle_code)); + SchBaseVehiclematerialgroup schBaseVehiclematerialgroup = new SchBaseVehiclematerialgroup(); + schBaseVehiclematerialgroup.setVehicle_code(vehicle_code); + schBaseVehiclematerialgroup.setMaterial_qty(Integer.parseInt(material_qty)); + schBaseVehiclematerialgroup.setOrder_code(order_code); + iSchBaseVehiclematerialgroupService.create(schBaseVehiclematerialgroup); } @Override - public void pointLock(JSONObject param) { + public String pointLock(JSONObject param) { Assert.noNullElements(new Object[]{param.getString("region_code"), param.getString("status")}, "参数不能为空!"); String region_code = param.getString("region_code"); String status = param.getString("status"); SchBaseRegion schBaseRegion = iSchBaseRegionService.getOne(Wrappers.lambdaQuery(SchBaseRegion.class) .eq(SchBaseRegion::getRegion_code, region_code)); if (ObjectUtil.isEmpty(schBaseRegion)) throw new BadRequestException("该区域不存在!"); + List byRegionCode = iSchBasePointService.getByRegionCode(region_code); if (StrUtil.equals(status, "0")) { iSchBasePointService.releasePoint(region_code); } else if (StrUtil.equals(status, "1")) { iSchBasePointService.lockPoint(region_code); } + if(CollUtil.isNotEmpty(byRegionCode) && byRegionCode.size()>0){ + return "当前区域已存在的任务有" + byRegionCode.size() + "个"; + } + return "操作成功"; } @Override public void toStorehouse(JSONObject param) { - Assert.noNullElements(new Object[]{param.getString("device_code"), param.getString("vehicle_code"), param.getString("ext")}, "参数不能为空!"); + Assert.noNullElements(new Object[]{param.getString("device_code"), param.getString("vehicle_type")}, "参数不能为空!"); //点位编码 String device_code = param.getString("device_code"); //载具号 - String vehicle_code = param.getString("vehicle_code"); - String region_code = param.getString("region_code"); + String vehicle_type = param.getString("vehicle_type"); //物料数据 String ext = param.getString("ext"); SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(device_code); if (ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("设备点位不存在!"); - AbstractTask connectorTask = taskFactory.getTask("BLANKINGTask"); + AbstractTask connectorTask = taskFactory.getTask("TOSTOREHOUSETask"); // 准备参数:设备编码 JSONObject jo = new JSONObject(); jo.put("device_code", device_code); jo.put("config_code", "TOSTOREHOUSETask"); jo.put("create_mode", GeneralDefinition.AUTO_CREATION); - jo.put("vehicle_code", vehicle_code); - jo.put("region_code", region_code); + jo.put("vehicle_code", vehicle_type); jo.put("ext_data", param); connectorTask.apply(jo); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java index 0fc62c5..0be4b80 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java index dc1da6c..68d4b42 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java @@ -179,4 +179,11 @@ public interface ISchBasePointService extends IService { * @param region_code */ void lockPoint(String region_code); + + /** + * 根据区域编码查找点位名称 + * @return + */ + List getByRegionCode(String region_code); + } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java index d368b86..a2eef97 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java @@ -23,4 +23,7 @@ public interface SchBasePointMapper extends BaseMapper { SchBasePoint selectByIdLock(String id); List getStructList(@Param("region_code") String region_code, @Param("vehicle_type")String vehicle_type); + + List selectByRegionCode(@Param("region_code") String region_code); + } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml index d6f36fe..e3e3837 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml @@ -42,4 +42,14 @@ AND sch_base_point.region_code = #{region_code} + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java index b8038e3..d1ee1ae 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java @@ -68,6 +68,9 @@ public class SchBasePointServiceImpl extends ServiceImpl queryAll(Map whereJson, PageQuery page) { String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry")) ? whereJson.get("blurry").toString() : null; @@ -240,7 +243,7 @@ public class SchBasePointServiceImpl extends ServiceImpl 0) ? schBasePoints.get(0) : null; @@ -386,49 +389,59 @@ public class SchBasePointServiceImpl extends ServiceImpl schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class) - .eq(SchBasePoint::getIs_lock, false) - .eq(SchBasePoint::getIs_used, true) - .eq(SchBasePoint::getPoint_status, pointStatus) - .eq(SchBasePoint::getCan_vehicle_type, vehicle_type) - .eq(SchBasePoint::getRegion_code, region_code) - .isNotNull(SchBasePoint::getVehicles) - .orderByDesc(SchBasePoint::getIn_order_seq)); - if (CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0) { - SchBasePoint schBasePoint = schBasePoints.get(0); - if (schBasePoints.size() == 1 && isVehicle) { - if (schBasePoint.getVehicle_qty() == 1) { - task.setRemark("没有多余空笼框,待补充!"); - taskService.updateById(task); - // 消息通知 - noticeService.createNotice("没有多余空笼框,待补充!", task.getConfig_code() + task.getTask_code(), - NoticeTypeEnum.WARN.getCode()); - return null; - } + synchronized (this.nameClass){ + List schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class) + .eq(SchBasePoint::getIs_lock, false) + .eq(SchBasePoint::getIs_used, true) + .eq(SchBasePoint::getPoint_status, pointStatus) + .eq(SchBasePoint::getCan_vehicle_type, vehicle_type) + .isNotNull(SchBasePoint::getVehicle_code)); + if(CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0){ + return schBasePoints.get(0); } - Gson gson = new Gson(); - Type setType = new TypeToken>() { - }.getType(); - List msg = gson.fromJson(schBasePoint.getVehicles(), setType); - Integer vehicle_qty = schBasePoint.getVehicle_qty(); - if (vehicle_qty != msg.size()) throw new BadRequestException("载具数量与载具编码数量不一致!"); - String s = msg.get(msg.size() - 1); - schBasePoint.setVehicle_qty(vehicle_qty - 1); - msg.remove(s); - schBasePoint.setVehicles(JSONUtil.toJsonStr(msg)); - /*schBasePoint.setIs_lock(true);*/ - this.updateById(schBasePoint); - if (schBasePoint.getVehicle_qty() == 0) { - update(Wrappers.lambdaUpdate(SchBasePoint.class) - .eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code()) - .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) - .set(SchBasePoint::getVehicles, null)); + schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class) + .eq(SchBasePoint::getIs_lock, false) + .eq(SchBasePoint::getIs_used, true) + .eq(SchBasePoint::getPoint_status, pointStatus) + .eq(SchBasePoint::getCan_vehicle_type, vehicle_type) + .eq(SchBasePoint::getRegion_code, region_code) + .isNotNull(SchBasePoint::getVehicles) + .orderByDesc(SchBasePoint::getIn_order_seq)); + if (CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0) { + SchBasePoint schBasePoint = schBasePoints.get(0); + /*if (schBasePoints.size() == 1 && isVehicle) { + if (schBasePoint.getVehicle_qty() <= 1) { + task.setRemark("没有多余空笼框,待补充!"); + taskService.updateById(task); + // 消息通知 + noticeService.createNotice("没有多余空笼框,待补充!", task.getConfig_code() + task.getTask_code(), + NoticeTypeEnum.WARN.getCode()); + return null; + } + }*/ + Gson gson = new Gson(); + Type setType = new TypeToken>() { + }.getType(); + List msg = gson.fromJson(schBasePoint.getVehicles(), setType); + Integer vehicle_qty = schBasePoint.getVehicle_qty(); + if (vehicle_qty != msg.size()) throw new BadRequestException("载具数量与载具编码数量不一致!"); + String s = msg.get(msg.size() - 1); + schBasePoint.setVehicle_qty(vehicle_qty - 1); + msg.remove(s); + schBasePoint.setVehicles(JSONUtil.toJsonStr(msg)); + this.updateById(schBasePoint); + if (schBasePoint.getVehicle_qty() == 0) { + update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code()) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) + .set(SchBasePoint::getVehicles, null)); + } + SchBasePoint schBasePoint1 = selectByPointCode(schBasePoint.getPoint_code() + "_" + (vehicle_qty - 1)); + schBasePoint1.setVehicle_code(s); + return schBasePoint1; } - SchBasePoint schBasePoint1 = selectByPointCode(schBasePoint.getPoint_code() + "_" + (vehicle_qty - 1)); - schBasePoint1.setVehicle_code(s); - return schBasePoint1; + return null; } - return null; } @Override @@ -441,6 +454,12 @@ public class SchBasePointServiceImpl extends ServiceImpl getByRegionCode(String region_code) { + List list = pointMapper.selectByRegionCode(region_code); + return list; + } + @Override public List getStructList(String region_code, String vehicle_type) { List structList = pointMapper.getStructList(region_code, vehicle_type); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/BlankingTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/BlankingTask.java index c0750c6..92911f0 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/BlankingTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/BlankingTask.java @@ -56,7 +56,7 @@ public class BlankingTask extends AbstractTask { // 配置信息 for (SchBaseTask task : tasks) { MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(task.getVehicle_code()); - if(ObjectUtil.isEmpty(mdBaseVehicle)){ + if (ObjectUtil.isEmpty(mdBaseVehicle)) { task.setRemark("载具号不存在!"); taskService.updateById(task); // 消息通知 @@ -64,8 +64,14 @@ public class BlankingTask extends AbstractTask { NoticeTypeEnum.WARN.getCode()); continue; } - SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(task.getRegion_code(), - GoodsEnum.OUT_OF_STOCK.getValue(),mdBaseVehicle.getVehicle_type(),1); + SchBasePoint schBasePoint = null; + if (ObjectUtil.isEmpty(task.getRegion_code())) { + schBasePoint = schBasePointService.selectByGroundPoint(null, + GoodsEnum.OUT_OF_STOCK.getValue(), mdBaseVehicle.getVehicle_type(), 1); + } else { + schBasePoint = schBasePointService.selectByGroundPoint(task.getRegion_code(), + GoodsEnum.OUT_OF_STOCK.getValue(), mdBaseVehicle.getVehicle_type(), 1); + } if (ObjectUtil.isEmpty(schBasePoint)) { task.setRemark("未找到所需点位!"); taskService.updateById(task); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/EmptyCageTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/EmptyCageTask.java index 5c39a0f..3bce5b9 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/EmptyCageTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/EmptyCageTask.java @@ -1,6 +1,9 @@ package org.nl.wms.sch.task_manage.task.tasks.handheld; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONArray; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.nl.common.enums.GoodsEnum; @@ -56,22 +59,32 @@ public class EmptyCageTask extends AbstractTask { for (SchBaseTask task : tasks) { TaskUtils.setUpdateByAcs(task); // 查询是空料笼还是,空料架 - Integer vehicle_qty = task.getVehicle_qty(); + String vehicle_type = task.getVehicle_type(); + /*String vehicle_code = task.getVehicle_code(); + if(StrUtil.isNotEmpty(vehicle_code)){ + JSONArray json = JSONUtil.parseArray(vehicle_code); + String s = json.get(0, String.class); + + }*/ SchBasePoint schBasePoint = null; - switch (vehicle_qty) { - case 1: + switch (vehicle_type) { + case "S04": + //空料架 + schBasePoint = schBasePointService.selectByGroundPoint(null, GoodsEnum.OUT_OF_STOCK.getValue(), task.getVehicle_type(), 1); + break; + case "S06": //空料架 - /*schBasePoint = schBasePointService.selectByGroundPoint(GoodsEnum.OUT_OF_STOCK.getValue(),task.getVehicle_type(),1);*/ + schBasePoint = schBasePointService.selectByGroundPoint(null, GoodsEnum.OUT_OF_STOCK.getValue(), task.getVehicle_type(), 1); break; - case 2: + case "R01": //RO1空料容 schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.DDLK.getRegion_code(), - GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.FRAME_R01.getVehicleCode(),2); + GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.FRAME_R01.getVehicleCode(), 2); break; - case 4: + case "R02": //RO2空料容 schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.DDLK.getRegion_code(), - GoodsEnum.OUT_OF_STOCK.getValue(),VehicleTypeEnum.FRAME_R02.getVehicleCode(),2); + GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.FRAME_R02.getVehicleCode(), 2); break; default: break; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/ToStoreHouseTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/ToStoreHouseTask.java index 978c3cb..c6e05c8 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/ToStoreHouseTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/ToStoreHouseTask.java @@ -29,7 +29,7 @@ import java.util.List; /** * @author LENOVO - * 物料回库 + * 补空框任务 */ @Component("TOSTOREHOUSETask") public class ToStoreHouseTask extends AbstractTask { @@ -55,18 +55,8 @@ public class ToStoreHouseTask extends AbstractTask { List tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY); // 配置信息 for (SchBaseTask task : tasks) { - TaskUtils.setUpdateByAcs(task); - MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(task.getVehicle_code()); - if(ObjectUtil.isEmpty(mdBaseVehicle)){ - task.setRemark("该载具不存在!"); - taskService.updateById(task); - // 消息通知 - noticeService.createNotice("该载具不存在!", TASK_CONFIG_CODE + task.getTask_code(), - NoticeTypeEnum.WARN.getCode()); - continue; - } - SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(task.getRegion_code(), GoodsEnum.OUT_OF_STOCK.getValue() - ,mdBaseVehicle.getVehicle_type(),1); + SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(null, GoodsEnum.EMPTY_PALLETS.getValue() + ,task.getVehicle_type(),0); if (ObjectUtil.isEmpty(schBasePoint)) { task.setRemark("未找到所需点位!"); taskService.updateById(task); @@ -76,8 +66,8 @@ public class ToStoreHouseTask extends AbstractTask { continue; } // 设置终点并修改创建成功状态 - task.setPoint_code2(schBasePoint.getPoint_code()); - task.setVehicle_type(schBasePoint.getCan_vehicle_type()); + task.setPoint_code1(schBasePoint.getPoint_code()); + task.setVehicle_code(schBasePoint.getVehicle_code()); task.setRemark(""); task.setTask_status(TaskStatus.CREATED.getCode()); taskService.updateById(task); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java index b7ead47..11bf11b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java @@ -78,6 +78,8 @@ public class SortingSMTTask extends AbstractTask { NoticeTypeEnum.WARN.getCode()); continue; } + schBaseVehiclematerialgroupService.remove(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class) + .eq(SchBaseVehiclematerialgroup::getVehicle_code, task.getVehicle_code())); JSONArray pallet_detail = jsonObject.getJSONArray("pallet_detail"); for (Object o : pallet_detail) { JSONObject jO = (JSONObject)JSONObject.toJSON(o);