From 1c6f8a3e972163c91c3743b703c9683c666b1896 Mon Sep 17 00:00:00 2001 From: yanps Date: Mon, 21 Oct 2024 10:59:21 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acs/service/impl/AcsToWmsServiceImpl.java | 4 +- .../ext/fab/service/impl/FabServiceImpl.java | 5 +- .../service/impl/HandheldServiceImpl.java | 19 ++++--- ...chBaseVehiclematerialgroupServiceImpl.java | 1 - .../service/dao/mapper/SchBasePointMapper.xml | 6 +- .../service/impl/SchBasePointServiceImpl.java | 36 ++++++------ .../task/tasks/connector/CNTTask.java | 55 ++++++++---------- .../task/tasks/connector/FTGTask.java | 46 +++++++-------- .../task/tasks/handheld/AtTask.java | 40 ++++++------- .../task/tasks/handheld/BlankingTask.java | 38 ++++++------- .../task/tasks/handheld/CallEmptyTask.java | 37 ++++++------ .../task/tasks/handheld/EmptyCageTask.java | 16 ++++++ .../task/tasks/handheld/MtTask.java | 38 ++++++------- .../task/tasks/handheld/RackTask.java | 39 ++++++------- .../task/tasks/handheld/ToStoreHouseTask.java | 45 +++++++-------- .../tasks/pcoperation/PcOperationCMTask.java | 34 ++++++----- .../tasks/pcoperation/PcOperationCNTask.java | 47 ++++++++-------- .../tasks/pcoperation/PcOperationSMTTask.java | 40 +++++++------ .../tasks/pcoperation/PcOperationSNTTask.java | 50 ++++++++--------- .../tasks/pcoperation/ProcessingSMTTask.java | 34 +++++------ .../task/tasks/sorting/SortingCMTTask.java | 56 +++++++++---------- .../task/tasks/sorting/SortingCNTTask.java | 49 ++++++++-------- .../task/tasks/sorting/SortingSMTTask.java | 42 ++++++-------- .../task/tasks/sorting/SortingSNTTask.java | 47 ++++++++-------- .../task/tasks/sorting/SortingTwoCNTTask.java | 52 ++++++----------- 25 files changed, 422 insertions(+), 454 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index 80f8d3b..60dd8d9 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -443,7 +443,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { if (CollectionUtils.isEmpty(list)) { MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getOne(new QueryWrapper().eq("vehicle_code", vehicle_code)); AbstractTask connectorTask = taskFactory.getTask("FTGTask"); - // 准备参数:设备编码 JSONObject param = new JSONObject(); param.put("device_code", schBaseTask.getPoint_code1()); param.put("config_code", "FTGTask"); @@ -458,7 +457,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { json.put("status", status); json.put("device_code", schBaseTask.getPoint_code1()); json.put("task_code", schBaseTask.getTask_code()); - AcsResponse acsResponse = connectorService.feedAgvTaskStatus(json); + //AcsResponse acsResponse = connectorService.feedAgvTaskStatus(json); } if ("2".equals(is_connector)) { JSONObject json = new JSONObject(); @@ -627,5 +626,4 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } - } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java index 3d374d9..f4f63b7 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java @@ -93,9 +93,10 @@ public class FabServiceImpl { pcOperationCMTask.apply(param); iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) .eq(SchBasePoint::getPoint_code, callMaterVo.getDevice_code()) - .eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) - .set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue()) .set(SchBasePoint::getIs_lock, true)); + iSchBaseVehiclematerialgroupService.update(Wrappers.lambdaUpdate(SchBaseVehiclematerialgroup.class) + .eq(SchBaseVehiclematerialgroup::getVehicle_code, callMaterVo.getVehicle_code()) + .set(SchBaseVehiclematerialgroup::getIs_delete, true)); break; case "cnt": Assert.noNullElements(new Object[]{form.getString("device_code"), form.getString("vehicle_type")}, "参数不能为空!"); 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 e28b1d7..b890e76 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 @@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import nl.basjes.shaded.org.springframework.util.Assert; import org.nl.common.enums.GoodsEnum; +import org.nl.common.enums.VehicleEnum; import org.nl.common.enums.VehicleTypeEnum; import org.nl.common.enums.region.RegionEnum; import org.nl.common.exception.BadRequestException; @@ -106,10 +107,11 @@ public class HandheldServiceImpl implements HandheldService { * @param param */ private void applyDeliveryRacks(String vehicle, String device_code, JSONObject param) { - MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(vehicle); - if (ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具不存在!"); SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(device_code); if (ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("设备点位不存在!"); + MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(vehicle); + if (ObjectUtil.isEmpty(mdBaseVehicle)) + throw new BadRequestException("载具不存在或载具号与点位不匹配!"); AbstractTask connectorTask = taskFactory.getTask("RACKTask"); // 准备参数:设备编码 JSONObject jo = new JSONObject(); @@ -120,6 +122,7 @@ public class HandheldServiceImpl implements HandheldService { jo.put("vehicle_type", mdBaseVehicle.getVehicle_type()); jo.put("ext_data", param); connectorTask.apply(jo); + } /** @@ -284,6 +287,7 @@ public class HandheldServiceImpl implements HandheldService { */ private void connectorBlanking(JSONObject param, String region_code, String device_code, String vehicle_code, AbstractTask connectorTask) { JSONObject jo = new JSONObject(); + param.put("region_code", region_code); jo.put("device_code", device_code); jo.put("config_code", "ProcessingSMTTask"); jo.put("create_mode", GeneralDefinition.AUTO_CREATION); @@ -309,6 +313,7 @@ public class HandheldServiceImpl implements HandheldService { * @param connectorTask */ private void goShelves(SchBasePoint schBasePoint, JSONObject param, String region_code, String device_code, String vehicle_code, AbstractTask connectorTask) { + //TODO:是否需要加上是否有无货校验 Assert.noNullElements(param.getJSONArray("material"), "参数不能为空!"); JSONArray materials = param.getJSONArray("material"); if (materials.size() < 1) { @@ -362,9 +367,7 @@ public class HandheldServiceImpl implements HandheldService { jo.put("ext_data", param); iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) .eq(SchBasePoint::getPoint_code, device_code) - .set(SchBasePoint::getIs_lock, true) - .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) - .set(SchBasePoint::getVehicle_code, null)); + .set(SchBasePoint::getIs_lock, true)); connectorTask.apply(jo); iSchBaseVehiclematerialgroupService.remove(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class) .eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicle_code)); @@ -408,6 +411,9 @@ public class HandheldServiceImpl implements HandheldService { if (materials.size() < 1) { throw new BadRequestException("物料下料数量不能为空!"); } + MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(vehicle_code); + if(mdBaseVehicle.getVehicle_type().equals(VehicleTypeEnum.TRAY.getVehicleCode())) throw new BadRequestException("钢托盘不能存放加工区!"); + param.put("region_code", region_code); jo.put("device_code", device_code); jo.put("config_code", "ProcessingSMTTask"); jo.put("create_mode", GeneralDefinition.AUTO_CREATION); @@ -506,8 +512,7 @@ public class HandheldServiceImpl implements HandheldService { connectorTask.apply(jo); iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) .eq(SchBasePoint::getPoint_code, device_code) - .set(SchBasePoint::getIs_lock, true) - .set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue())); + .set(SchBasePoint::getIs_lock, true)); } @Override diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java index 53cee77..a254187 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java @@ -201,7 +201,6 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl and sch_base_point.can_vehicle_type = #{vehicle_type} @@ -59,8 +60,9 @@ 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 e7fdb8b..8ed6047 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 @@ -265,9 +265,8 @@ public class SchBasePointServiceImpl extends ServiceImpl 0) { SchBasePoint schBasePoint = schBasePoints.get(0); schBasePoint.setIs_lock(true); - update(Wrappers.lambdaUpdate(SchBasePoint.class) - .eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code()) - .set(SchBasePoint::getIs_lock, true)); + PointUtils.setUpdateByAcs(schBasePoint); + pointMapper.updateById(schBasePoint); return schBasePoint; } SchBasePoint schBasePoint1 = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getRegion_code, region_code)).get(0); @@ -284,9 +283,8 @@ public class SchBasePointServiceImpl extends ServiceImpl Math.abs(schBasePoint1.getRegion_seq() - schBasePoint.getRegion_seq()))); SchBasePoint schBasePoint = schBasePoints1.get(0); schBasePoint.setIs_lock(true); - update(Wrappers.lambdaUpdate(SchBasePoint.class) - .eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code()) - .set(SchBasePoint::getIs_lock, true)); + PointUtils.setUpdateByAcs(schBasePoint); + pointMapper.updateById(schBasePoint); return schBasePoint; } return null; @@ -396,8 +394,8 @@ public class SchBasePointServiceImpl extends ServiceImpl 0) { - return schBasePoints.get(0); + SchBasePoint schBasePoint = schBasePoints.get(0); + schBasePoint.setIs_lock(true); + PointUtils.setUpdateByAcs(schBasePoint); + updateById(schBasePoint); + return schBasePoint; } schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class) .eq(SchBasePoint::getIs_lock, false) @@ -462,6 +464,9 @@ public class SchBasePointServiceImpl extends ServiceImpl 0) { SchBasePoint schBasePoint = schBasePoints.get(0); schBasePoint.setIs_lock(true); - update(Wrappers.lambdaUpdate(SchBasePoint.class) - .eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code()) - .set(SchBasePoint::getIs_lock, true)); + PointUtils.setUpdateByAcs(schBasePoint); + updateById(schBasePoint); return schBasePoint; } return null; @@ -612,9 +616,9 @@ public class SchBasePointServiceImpl extends ServiceImpl() - .set("is_lock", true) - .eq("point_code", schBasePoint.getPoint_code())); + schBasePoint.setIs_lock(true); + PointUtils.setUpdateByAcs(schBasePoint); + pointMapper.updateById(schBasePoint); return schBasePoint; } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/CNTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/CNTTask.java index cfe5596..fce5b0b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/CNTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/CNTTask.java @@ -68,9 +68,7 @@ public class CNTTask extends AbstractTask { SchBasePoint schBasePoint = null; if (TaskType.CARRY_TASK.getValue().equals(task.getTask_type())) { schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code(), "1"); - }/* else if (TaskType.REASSIGN_TASK.getValue().equals(task.getTask_type())) { - schBasePoint = schBasePointService.selectByReassign(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code()); - }*/ + } if (ObjectUtil.isEmpty(schBasePoint)) { task.setRemark("未找到所需点位!"); taskService.updateById(task); @@ -89,11 +87,6 @@ public class CNTTask extends AbstractTask { task.setAcs_trace_id("4"); } taskService.updateById(task); - - schBasePoint.setIng_task_code(task.getTask_code()); - schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue()); - PointUtils.setUpdateByAcs(schBasePoint); - pointService.updateById(schBasePoint); } } @@ -123,6 +116,18 @@ public class CNTTask extends AbstractTask { public void cancel(String task_code) { //TODO:取消任务的时候将int_task_code的清除 SchBaseTask taskObj = taskService.getByCode(task_code); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); + } + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); + } if (ObjectUtil.isEmpty(taskObj)) { throw new BadRequestException("该任务不存在"); } @@ -140,16 +145,18 @@ public class CNTTask extends AbstractTask { SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false)); + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); + String endPoint = taskObj.getPoint_code2(); + SchBasePoint schBasePoint2 = pointService.selectByPointCode(endPoint); if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) - .set(SchBasePoint::getIs_lock, false)); + schBasePoint2.setIs_lock(false); + schBasePoint2.setPoint_status(GoodsEnum.IN_STOCK.getValue()); + schBasePoint2.setVehicle_code(taskObj.getVehicle_code()); + PointUtils.setUpdateByAcs(schBasePoint2); + schBasePointService.updateById(schBasePoint2); } // 任务完成 taskObj.setTask_status(TaskStatus.FINISHED.getCode()); @@ -160,22 +167,6 @@ public class CNTTask extends AbstractTask { } public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { - // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false)); - } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) - .set(SchBasePoint::getIs_lock, false)); - } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); taskObj.setTask_status(TaskStatus.CANCELED.getCode()); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/FTGTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/FTGTask.java index 9ef45e0..80d0d9c 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/FTGTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/FTGTask.java @@ -60,7 +60,7 @@ public class FTGTask extends AbstractTask { List tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY); for (SchBaseTask task : tasks) { // 查找空载具点位 - SchBasePoint schBasePoint = schBasePointService.selectEmpVehicleByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(),task.getVehicle_type()); + SchBasePoint schBasePoint = schBasePointService.selectEmpVehicleByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_type()); if (ObjectUtil.isEmpty(schBasePoint)) { task.setRemark("未找到所需点位!"); taskService.updateById(task); @@ -78,13 +78,9 @@ public class FTGTask extends AbstractTask { task.setTask_status(TaskStatus.CREATED.getCode()); TaskUtils.setUpdateByAcs(task); taskService.updateById(task); - - schBasePoint.setIs_lock(true); - schBasePoint.setPoint_status(GoodsEnum.OUT_OF_STOCK.getValue()); - PointUtils.setUpdateByAcs(schBasePoint); - pointService.updateById(schBasePoint); } } + private static Integer getNumericSuffix(String filename) { // 提取数字后缀 String suffix = filename.replaceAll(".*?(\\d+)$", "$1"); @@ -126,17 +122,18 @@ public class FTGTask extends AbstractTask { // 获取参数 String startPoint = taskObj.getPoint_code1(); SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false).set(SchBasePoint::getVehicle_code, null)); + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) + .set(SchBasePoint::getIs_lock, false) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) + .set(SchBasePoint::getVehicle_code, null)); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); + String endPoint = taskObj.getPoint_code2(); + SchBasePoint schBasePoint2 = pointService.selectByPointCode(endPoint); if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, endPoint) .set(SchBasePoint::getIs_lock, false)); } // 任务完成 @@ -148,20 +145,19 @@ public class FTGTask extends AbstractTask { } public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { - // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.updateById(schBasePoint); + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.updateById(schBasePoint2); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } + // 获取参数 taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); taskObj.setTask_status(TaskStatus.CANCELED.getCode()); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/AtTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/AtTask.java index 4dcb0f2..c935240 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/AtTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/AtTask.java @@ -80,13 +80,6 @@ public class AtTask extends AbstractTask { .set("task_status", TaskStatus.CREATED.getCode()) .set("point_code2", schBasePoint.getPoint_code()) .eq("task_id", task.getTask_id())); - - //更新点位信息 - schBasePoint.setIng_task_code(task.getTask_code()); - schBasePoint.setIs_lock(true); - schBasePoint.setPoint_status(GoodsEnum.EMPTY_PALLETS.getValue()); - PointUtils.setUpdateByAcs(schBasePoint); - pointService.updateById(schBasePoint); } } @@ -126,18 +119,20 @@ public class AtTask extends AbstractTask { SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) .set(SchBasePoint::getIs_lock, false) - .set(SchBasePoint::getVehicle_code, null)); + .set(SchBasePoint::getVehicle_code, null) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())); } String point_code2 = taskObj.getPoint_code2(); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, point_code2) .set(SchBasePoint::getIs_lock, false) - .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())); + .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code()) + .set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue())); } // 任务完成 taskObj.setTask_status(TaskStatus.FINISHED.getCode()); @@ -149,18 +144,17 @@ public class AtTask extends AbstractTask { public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.updateById(schBasePoint); + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.updateById(schBasePoint2); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); 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 92911f0..4e70199 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 @@ -89,9 +89,6 @@ public class BlankingTask extends AbstractTask { taskService.updateById(task); - schBasePoint.setVehicle_code(task.getVehicle_code()); - schBasePoint.setIng_task_code(task.getTask_code()); - schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue()); schBasePoint.setIs_lock(true); PointUtils.setUpdateByAcs(schBasePoint); pointService.updateById(schBasePoint); @@ -135,14 +132,20 @@ public class BlankingTask extends AbstractTask { // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false)); + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) + .set(SchBasePoint::getIs_lock, false) + .set(SchBasePoint::getVehicle_code, null) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())); } String point_code2 = taskObj.getPoint_code2(); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); if (ObjectUtil.isNotEmpty(schBasePoint2)) { PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, point_code2) + .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code()) + .set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue()) .set(SchBasePoint::getIs_lock, false)); } // 任务完成 @@ -155,20 +158,17 @@ public class BlankingTask extends AbstractTask { public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false)); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) - .set(SchBasePoint::getIs_lock, false)); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/CallEmptyTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/CallEmptyTask.java index bdcadf3..7331dca 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/CallEmptyTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/CallEmptyTask.java @@ -80,10 +80,6 @@ public class CallEmptyTask extends AbstractTask { TaskUtils.setUpdateByAcs(task); taskService.updateById(task); - - schBasePoint.setVehicle_code(task.getVehicle_code()); - schBasePoint.setIng_task_code(task.getTask_code()); - schBasePoint.setPoint_status(GoodsEnum.EMPTY_PALLETS.getValue()); schBasePoint.setIs_lock(true); PointUtils.setUpdateByAcs(schBasePoint); pointService.updateById(schBasePoint); @@ -127,14 +123,20 @@ public class CallEmptyTask extends AbstractTask { // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) + .set(SchBasePoint::getVehicle_code, null) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) .set(SchBasePoint::getIs_lock, false)); } String point_code2 = taskObj.getPoint_code2(); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); if (ObjectUtil.isNotEmpty(schBasePoint2)) { PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, point_code2) + .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code()) + .set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue()) .set(SchBasePoint::getIs_lock, false)); } // 任务完成 @@ -147,20 +149,17 @@ public class CallEmptyTask extends AbstractTask { public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false)); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) - .set(SchBasePoint::getIs_lock, false)); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); 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 271451b..80c4e8e 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 @@ -142,6 +142,22 @@ public class EmptyCageTask extends AbstractTask { public void cancel(String task_code) { //TODO:取消任务的时候将int_task_code的清除 SchBaseTask taskObj = taskService.getByCode(task_code); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setVehicle_code(null); + schBasePoint1.setPoint_status(GoodsEnum.OUT_OF_STOCK.getValue()); + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); + } + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setVehicle_code(taskObj.getVehicle_code()); + schBasePoint.setPoint_status(GoodsEnum.EMPTY_PALLETS.getValue()); + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); + } if (ObjectUtil.isEmpty(taskObj)) { throw new BadRequestException("该任务不存在"); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/MtTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/MtTask.java index a3b8aec..fb129aa 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/MtTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/MtTask.java @@ -58,7 +58,7 @@ public class MtTask extends AbstractTask { for (SchBaseTask task : tasks) { String vehicle_type = task.getVehicle_type(); SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.NBJG.getRegion_code(), - GoodsEnum.OUT_OF_STOCK.getValue(),null, 2); + GoodsEnum.OUT_OF_STOCK.getValue(), null, 2); if (ObjectUtil.isEmpty(schBasePoint)) { task.setRemark("未找到所需点位!"); taskService.updateById(task); @@ -75,9 +75,6 @@ public class MtTask extends AbstractTask { TaskUtils.setUpdateByAcs(task); taskService.updateById(task); - - schBasePoint.setVehicles(task.getVehicle_code()); - schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue()); schBasePoint.setIs_lock(true); PointUtils.setUpdateByAcs(schBasePoint); pointService.updateById(schBasePoint); @@ -121,14 +118,20 @@ public class MtTask extends AbstractTask { // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) + .set(SchBasePoint::getVehicle_code, null) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) .set(SchBasePoint::getIs_lock, false)); } String point_code2 = taskObj.getPoint_code2(); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); if (ObjectUtil.isNotEmpty(schBasePoint2)) { PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, point_code2) + .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code()) + .set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue()) .set(SchBasePoint::getIs_lock, false)); } // 任务完成 @@ -141,20 +144,17 @@ public class MtTask extends AbstractTask { public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false)); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) - .set(SchBasePoint::getIs_lock, false)); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/RackTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/RackTask.java index 670aaa9..fba0f66 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/RackTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/RackTask.java @@ -64,11 +64,11 @@ public class RackTask extends AbstractTask { String vehicle_type = task.getVehicle_type(); String regionCode = RegionEnum.ZDZWQ.getRegion_code(); - if(StrUtil.isNotBlank(vehicle_type) && VehicleTypeEnum.TRAY.getVehicleCode().equals(vehicle_type)){ + if (StrUtil.isNotBlank(vehicle_type) && VehicleTypeEnum.TRAY.getVehicleCode().equals(vehicle_type)) { regionCode = RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(); } SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(regionCode, - GoodsEnum.OUT_OF_STOCK.getValue(),vehicle_type, 1); + GoodsEnum.OUT_OF_STOCK.getValue(), vehicle_type, 1); if (ObjectUtil.isEmpty(schBasePoint)) { task.setRemark("未找到所需点位!"); taskService.updateById(task); @@ -86,8 +86,6 @@ public class RackTask extends AbstractTask { taskService.updateById(task); - schBasePoint.setVehicles(task.getVehicle_code()); - schBasePoint.setPoint_status(GoodsEnum.EMPTY_PALLETS.getValue()); schBasePoint.setIs_lock(true); PointUtils.setUpdateByAcs(schBasePoint); pointService.updateById(schBasePoint); @@ -131,14 +129,20 @@ public class RackTask extends AbstractTask { // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) + .set(SchBasePoint::getVehicle_code, null) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) .set(SchBasePoint::getIs_lock, false)); } String point_code2 = taskObj.getPoint_code2(); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); if (ObjectUtil.isNotEmpty(schBasePoint2)) { PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, point_code2) + .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code()) + .set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue()) .set(SchBasePoint::getIs_lock, false)); } // 任务完成 @@ -151,20 +155,17 @@ public class RackTask extends AbstractTask { public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false)); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) - .set(SchBasePoint::getIs_lock, false)); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); 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 0066d92..9bb09fb 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 @@ -60,7 +60,7 @@ public class ToStoreHouseTask extends AbstractTask { SchBasePoint schBasePoint = null; if (task.getVehicle_type().equals(VehicleTypeEnum.FRAME_R02.getVehicleCode()) || task.getVehicle_type().equals(VehicleTypeEnum.FRAME_R01.getVehicleCode())) { schBasePoint = schBasePointService.selectByEmptyCage(RegionEnum.DDLK.getRegion_code(), - task.getVehicle_type(),GoodsEnum.EMPTY_PALLETS.getValue(),true,task); + task.getVehicle_type(), GoodsEnum.EMPTY_PALLETS.getValue(), true, task); } else { schBasePoint = schBasePointService.selectByVehicleQty(task.getVehicle_type()); } @@ -79,14 +79,6 @@ public class ToStoreHouseTask extends AbstractTask { task.setRemark(""); task.setTask_status(TaskStatus.CREATED.getCode()); taskService.updateById(task); - - - /*schBasePoint.setVehicle_code(task.getVehicle_code()); - schBasePoint.setIng_task_code(task.getTask_code());*/ - schBasePoint.setPoint_status(GoodsEnum.OUT_OF_STOCK.getValue()); - schBasePoint.setIs_lock(true); - PointUtils.setUpdateByAcs(schBasePoint); - pointService.updateById(schBasePoint); } } @@ -127,17 +119,21 @@ public class ToStoreHouseTask extends AbstractTask { // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) .set(SchBasePoint::getIs_lock, false) - .set(SchBasePoint::getVehicle_code,null)); + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) + .set(SchBasePoint::getVehicle_code, null)); } String point_code2 = taskObj.getPoint_code2(); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); if (ObjectUtil.isNotEmpty(schBasePoint2)) { PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, point_code2) .set(SchBasePoint::getIs_lock, false) - .set(SchBasePoint::getVehicle_code,taskObj.getVehicle_code())); + .set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue()) + .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())); } // 任务完成 taskObj.setTask_status(TaskStatus.FINISHED.getCode()); @@ -149,20 +145,17 @@ public class ToStoreHouseTask extends AbstractTask { public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false)); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) - .set(SchBasePoint::getIs_lock, false)); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCMTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCMTask.java index 860ea9f..a533f8a 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCMTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCMTask.java @@ -78,9 +78,7 @@ public class PcOperationCMTask extends AbstractTask { .set("remark", null) .eq("task_id", task.getTask_id())); pointService.update(new UpdateWrapper() - .set("ing_task_code", task.getTask_code()) .set("is_lock", true) - .set("point_status", GoodsEnum.OUT_OF_STOCK.getValue()) .eq("point_code", structPoint.getPoint_code())); } } @@ -121,14 +119,15 @@ public class PcOperationCMTask extends AbstractTask { SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false).set(SchBasePoint::getVehicle_code, null)); + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .set(SchBasePoint::getVehicle_code, null) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) + .set(SchBasePoint::getIs_lock, false) + .eq(SchBasePoint::getPoint_code, startPoint)); } String point_code2 = taskObj.getPoint_code2(); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) .eq(SchBasePoint::getPoint_code, point_code2) .set(SchBasePoint::getIs_lock, false) @@ -144,20 +143,19 @@ public class PcOperationCMTask extends AbstractTask { } public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { - // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.updateById(schBasePoint); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.updateById(schBasePoint2); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } + // 获取参数 taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); taskObj.setTask_status(TaskStatus.CANCELED.getCode()); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCNTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCNTask.java index dedf7bc..5a82660 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCNTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCNTask.java @@ -62,7 +62,6 @@ public class PcOperationCNTask extends AbstractTask { TaskUtils.setUpdateByAcs(task); // 找起点 CallEmpVo callMaterVo = JSONObject.parseObject(task.getRequest_param(), CallEmpVo.class); - SchBasePoint basePoint = schBasePointService.selectByEmptyCage(RegionEnum.DDLK.getRegion_code(), callMaterVo.getVehicle_type(),GoodsEnum.EMPTY_PALLETS.getValue(),false,task); if (basePoint==null){ @@ -72,12 +71,8 @@ public class PcOperationCNTask extends AbstractTask { } taskService.update(new UpdateWrapper() .set("task_status",TaskStatus.CREATED.getCode()) - .set("point_code1",basePoint.getPoint_code()).eq("task_id",task.getTask_id())); - pointService.update(new UpdateWrapper() - .set("ing_task_code",task.getTask_code()) - .set("is_lock",true) - .set("point_status", GoodsEnum.OUT_OF_STOCK.getValue()) - .eq("point_code",basePoint.getPoint_code())); + .set("point_code1",basePoint.getPoint_code()) + .eq("task_id",task.getTask_id())); } } @@ -117,15 +112,20 @@ public class PcOperationCNTask extends AbstractTask { SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false).set(SchBasePoint::getVehicle_code,null)); + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) + .set(SchBasePoint::getIs_lock, false) + .set(SchBasePoint::getVehicle_code,null) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) + ); } String point_code2 = taskObj.getPoint_code2(); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, point_code2) + .set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue()) + .set(SchBasePoint::getVehicle_code,taskObj.getVehicle_code()) .set(SchBasePoint::getIs_lock, false)); } // 任务完成 @@ -137,20 +137,19 @@ public class PcOperationCNTask extends AbstractTask { } public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { - // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.updateById(schBasePoint); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.updateById(schBasePoint2); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } + // 获取参数 taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); taskObj.setTask_status(TaskStatus.CANCELED.getCode()); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSMTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSMTTask.java index 2deccef..3af7c4c 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSMTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSMTTask.java @@ -122,13 +122,6 @@ public class PcOperationSMTTask extends AbstractTask { task.setTask_status(TaskStatus.CREATED.getCode()); TaskUtils.setUpdateByAcs(task); taskService.updateById(task); - - //更新点位 - schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue()); - schBasePoint.setIng_task_code(task.getTask_code()); - schBasePoint.setIs_lock(true); - PointUtils.setUpdateByAcs(schBasePoint); - pointService.updateById(schBasePoint); } } @@ -169,14 +162,20 @@ public class PcOperationSMTTask extends AbstractTask { // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false)); + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) + .set(SchBasePoint::getIs_lock, false) + .set(SchBasePoint::getVehicle_code, null) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())); } String point_code2 = taskObj.getPoint_code2(); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); if (ObjectUtil.isNotEmpty(schBasePoint2)) { PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, point_code2) + .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code()) + .set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue()) .set(SchBasePoint::getIs_lock, false)); } // 任务完成 @@ -189,18 +188,17 @@ public class PcOperationSMTTask extends AbstractTask { public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.updateById(schBasePoint); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.updateById(schBasePoint2); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSNTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSNTTask.java index c77179a..a8e0265 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSNTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSNTTask.java @@ -68,7 +68,7 @@ public class PcOperationSNTTask extends AbstractTask { SendVehicleVo sendVehicleVo = JSONObject.parseObject(task.getRequest_param(), SendVehicleVo.class); //查询地面点位的载具编码 // 根据对接位查找对应的载具类型 - SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(sendVehicleVo.getRegion_code(),task.getVehicle_code(),"0"); + SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(sendVehicleVo.getRegion_code(), task.getVehicle_code(), "0"); if (ObjectUtil.isEmpty(schBasePoint)) { task.setRemark("未找到所需点位!"); taskService.updateById(task); @@ -79,18 +79,11 @@ public class PcOperationSNTTask extends AbstractTask { } //删除组盘信息 schBaseVehiclematerialgroupService.remove(new QueryWrapper() - .eq("vehicle_code",schBasePoint.getVehicle_code())); + .eq("vehicle_code", schBasePoint.getVehicle_code())); taskService.update(new UpdateWrapper() - .set("task_status",TaskStatus.CREATED.getCode()) - .set("point_code2",schBasePoint.getPoint_code()) - .eq("task_id",task.getTask_id())); - - //更新点位信息 - schBasePoint.setIng_task_code(task.getTask_code()); - schBasePoint.setIs_lock(true); - schBasePoint.setPoint_status(GoodsEnum.EMPTY_PALLETS.getValue()); - PointUtils.setUpdateByAcs(schBasePoint); - pointService.updateById(schBasePoint); + .set("task_status", TaskStatus.CREATED.getCode()) + .set("point_code2", schBasePoint.getPoint_code()) + .eq("task_id", task.getTask_id())); } } @@ -131,17 +124,21 @@ public class PcOperationSNTTask extends AbstractTask { // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) .set(SchBasePoint::getIs_lock, false) - .set(SchBasePoint::getVehicle_code,null)); + .set(SchBasePoint::getVehicle_code, null) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())); } String point_code2 = taskObj.getPoint_code2(); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); if (ObjectUtil.isNotEmpty(schBasePoint2)) { PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, point_code2) .set(SchBasePoint::getIs_lock, false) - .set(SchBasePoint::getVehicle_code,taskObj.getVehicle_code())); + .set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue()) + .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())); } // 任务完成 taskObj.setTask_status(TaskStatus.FINISHED.getCode()); @@ -153,18 +150,17 @@ public class PcOperationSNTTask extends AbstractTask { public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.updateById(schBasePoint); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.updateById(schBasePoint2); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/ProcessingSMTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/ProcessingSMTTask.java index 565ebee..53bf846 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/ProcessingSMTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/ProcessingSMTTask.java @@ -92,9 +92,6 @@ public class ProcessingSMTTask extends AbstractTask { taskService.updateById(task); //更新点位 - schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue()); - schBasePoint.setVehicle_code(task.getVehicle_code()); - schBasePoint.setIng_task_code(task.getTask_code()); schBasePoint.setIs_lock(true); PointUtils.setUpdateByAcs(schBasePoint); pointService.updateById(schBasePoint); @@ -138,14 +135,20 @@ public class ProcessingSMTTask extends AbstractTask { // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) + .set(SchBasePoint::getVehicle_code, null) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) .set(SchBasePoint::getIs_lock, false)); } String point_code2 = taskObj.getPoint_code2(); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); if (ObjectUtil.isNotEmpty(schBasePoint2)) { PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, point_code2) + .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code()) + .set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue()) .set(SchBasePoint::getIs_lock, false)); } // 任务完成 @@ -158,18 +161,17 @@ public class ProcessingSMTTask extends AbstractTask { public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.updateById(schBasePoint); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.updateById(schBasePoint2); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCMTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCMTTask.java index 7dc8267..1f44499 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCMTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCMTTask.java @@ -80,11 +80,11 @@ public class SortingCMTTask extends AbstractTask { //载具托盘号 String vehicle_code = jsonObject.getString("vehicle_code"); MdBaseVehicle vehicle_code1 = iMdBaseVehicleService.getOne(new QueryWrapper().eq("vehicle_code", vehicle_code)); - if(ObjectUtil.isEmpty(vehicle_code1)) throw new BadRequestException("载具不存在"); + if (ObjectUtil.isEmpty(vehicle_code1)) throw new BadRequestException("载具不存在"); SchBasePoint structPoint = schBasePointService.getOne(new QueryWrapper() .eq("vehicle_code", vehicle_code) - .eq("point_status","2") - .eq("is_lock",false)); + .eq("point_status", "2") + .eq("is_lock", false)); if (ObjectUtil.isEmpty(structPoint)) { task.setRemark("未找到所需点位!"); taskService.updateById(task); @@ -94,14 +94,13 @@ public class SortingCMTTask extends AbstractTask { continue; } taskService.update(new UpdateWrapper() - .set("task_status",TaskStatus.CREATED.getCode()) - .set("point_code1",structPoint.getPoint_code()) - .eq("task_id",task.getTask_id())); + .set("task_status", TaskStatus.CREATED.getCode()) + .set("point_code1", structPoint.getPoint_code()) + .set("remark", null) + .eq("task_id", task.getTask_id())); pointService.update(new UpdateWrapper() - .set("ing_task_code",task.getTask_code()) - .set("is_lock",true) - .set("point_status", GoodsEnum.OUT_OF_STOCK.getValue()) - .eq("point_code",structPoint.getPoint_code())); + .set("is_lock", true) + .eq("point_code", structPoint.getPoint_code())); } } @@ -141,15 +140,17 @@ public class SortingCMTTask extends AbstractTask { SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false).set(SchBasePoint::getVehicle_code,null)); + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) + .set(SchBasePoint::getIs_lock, false) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) + .set(SchBasePoint::getVehicle_code, null)); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); + String endPoint = taskObj.getPoint_code2(); + SchBasePoint schBasePoint2 = pointService.selectByPointCode(endPoint); if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, endPoint) .set(SchBasePoint::getIs_lock, false)); } // 任务完成 @@ -162,18 +163,17 @@ public class SortingCMTTask extends AbstractTask { public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.updateById(schBasePoint); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.updateById(schBasePoint2); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCNTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCNTTask.java index 8ac7ddd..cd620af 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCNTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCNTTask.java @@ -60,19 +60,17 @@ public class SortingCNTTask extends AbstractTask { TaskUtils.setUpdateByAcs(task); // 找起点 SchBasePoint basePoint = schBasePointService.selectEmpVehicleByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_type()); - if (basePoint==null){ + if (basePoint == null) { task.setRemark("未找到所需点位!"); taskService.updateById(task); continue; } taskService.update(new UpdateWrapper() - .set("task_status",TaskStatus.CREATED.getCode()) - .set("point_code1",basePoint.getPoint_code()).eq("task_id",task.getTask_id())); - pointService.update(new UpdateWrapper() - .set("ing_task_code",task.getTask_code()) - .set("is_lock",true) - .set("point_status", GoodsEnum.OUT_OF_STOCK.getValue()) - .eq("point_code",basePoint.getPoint_code())); + .set("task_status", TaskStatus.CREATED.getCode()) + .set("point_code1", basePoint.getPoint_code()) + .set("vehicle_code", basePoint.getVehicle_code()) + .set("remark", null) + .eq("task_id", task.getTask_id())); } } @@ -113,14 +111,18 @@ public class SortingCNTTask extends AbstractTask { // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false).set(SchBasePoint::getVehicle_code,null)); + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) + .set(SchBasePoint::getIs_lock, false) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) + .set(SchBasePoint::getVehicle_code, null)); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); + String endPoint = taskObj.getPoint_code2(); + SchBasePoint schBasePoint2 = pointService.selectByPointCode(endPoint); if (ObjectUtil.isNotEmpty(schBasePoint2)) { PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, endPoint) .set(SchBasePoint::getIs_lock, false)); } // 任务完成 @@ -133,18 +135,17 @@ public class SortingCNTTask extends AbstractTask { public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.updateById(schBasePoint); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.updateById(schBasePoint2); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); 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 9b9a4fb..527382e 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 @@ -72,8 +72,6 @@ public class SortingSMTTask extends AbstractTask { // 获取任务 List tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY); // 配置信息 - /*SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper() - .eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE));*/ tasks = tasks.stream().sorted(Comparator.comparing(SchBaseTask::getAcs_trace_id, Comparator.nullsLast(Comparator.naturalOrder())).reversed()).collect(Collectors.toList()); for (SchBaseTask task : tasks) { TaskUtils.setUpdateByAcs(task); @@ -132,12 +130,6 @@ public class SortingSMTTask extends AbstractTask { task.setRemark(""); task.setTask_status(TaskStatus.CREATED.getCode()); taskService.updateById(task); - - //更新点位 - schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue()); - schBasePoint.setIng_task_code(task.getTask_code()); - PointUtils.setUpdateByAcs(schBasePoint); - pointService.updateById(schBasePoint); } } @@ -200,16 +192,19 @@ public class SortingSMTTask extends AbstractTask { SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) .set(SchBasePoint::getIs_lock, false)); } String point_code2 = taskObj.getPoint_code2(); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) - .set(SchBasePoint::getIs_lock, false)); + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, point_code2) + .set(SchBasePoint::getIs_lock, false) + .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code()) + .set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue()) + ); } // 任务完成 taskObj.setTask_status(TaskStatus.FINISHED.getCode()); @@ -221,18 +216,17 @@ public class SortingSMTTask extends AbstractTask { public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.updateById(schBasePoint); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.updateById(schBasePoint2); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSNTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSNTTask.java index 4c2556b..7d4d2cd 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSNTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSNTTask.java @@ -69,8 +69,8 @@ public class SortingSNTTask extends AbstractTask { String requestParam = task.getRequest_param(); JSONObject jsonObject = JSONObject.parseObject(requestParam); // 根据对接位查找对应的载具类型 - SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(),task.getVehicle_code(),"0"); - if(ObjectUtil.isEmpty(schBasePoint)) continue; + SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code(), "0"); + if (ObjectUtil.isEmpty(schBasePoint)) continue; jsonObject.put("vehicle_type", schBasePoint.getCan_vehicle_type()); if (ObjectUtil.isEmpty(schBasePoint)) { task.setRemark("未找到所需点位!"); @@ -82,17 +82,11 @@ public class SortingSNTTask extends AbstractTask { } //删除组盘信息 schBaseVehiclematerialgroupService.remove(new QueryWrapper() - .eq("vehicle_code",schBasePoint.getVehicle_code())); + .eq("vehicle_code", schBasePoint.getVehicle_code())); taskService.update(new UpdateWrapper() - .set("task_status",TaskStatus.CREATED.getCode()) - .set("point_code2",schBasePoint.getPoint_code()) - .eq("task_id",task.getTask_id())); - - //更新点位信息 - schBasePoint.setIng_task_code(task.getTask_code()); - schBasePoint.setPoint_status(GoodsEnum.EMPTY_PALLETS.getValue()); - PointUtils.setUpdateByAcs(schBasePoint); - pointService.updateById(schBasePoint); + .set("task_status", TaskStatus.CREATED.getCode()) + .set("point_code2", schBasePoint.getPoint_code()) + .eq("task_id", task.getTask_id())); } } @@ -133,14 +127,18 @@ public class SortingSNTTask extends AbstractTask { // 起点清空 if (ObjectUtil.isNotEmpty(schBasePoint)) { PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, startPoint) .set(SchBasePoint::getIs_lock, false)); } String point_code2 = taskObj.getPoint_code2(); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); if (ObjectUtil.isNotEmpty(schBasePoint2)) { PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) + pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, point_code2) + .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code()) + .set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue()) .set(SchBasePoint::getIs_lock, false)); } // 任务完成 @@ -153,18 +151,17 @@ public class SortingSNTTask extends AbstractTask { public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.updateById(schBasePoint); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.updateById(schBasePoint2); + SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint)) { + schBasePoint.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint); + schBasePointService.updateById(schBasePoint); } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingTwoCNTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingTwoCNTTask.java index 2c7f261..f315317 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingTwoCNTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingTwoCNTTask.java @@ -63,8 +63,8 @@ public class SortingTwoCNTTask extends AbstractTask { for (SchBaseTask task : tasks) { // 找起点 SchBasePoint basePoint = schBasePointService.selectByEmptyCage(RegionEnum.DDLK.getRegion_code(), - VehicleTypeEnum.FRAME_R02.getVehicleCode(),GoodsEnum.EMPTY_PALLETS.getValue(),true,task); - if (basePoint==null){ + VehicleTypeEnum.FRAME_R02.getVehicleCode(), GoodsEnum.EMPTY_PALLETS.getValue(), true, task); + if (basePoint == null) { task.setRemark("未找到所需点位!"); taskService.updateById(task); continue; @@ -75,14 +75,10 @@ public class SortingTwoCNTTask extends AbstractTask { task.setVehicle_code(basePoint.getVehicle_code()); task.setRemark(" "); taskService.update(task); - schBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) - .eq(SchBasePoint::getPoint_code,basePoint.getPoint_code()) - .set(SchBasePoint::getIs_lock,true) - .set(SchBasePoint::getPoint_status,GoodsEnum.OUT_OF_STOCK.getValue())); } } - private Long getTime(String dateString){ + private Long getTime(String dateString) { String pattern = "yyyy-MM-dd HH:mm:ss"; java.util.Date date = DateUtil.parse(dateString, pattern); long timestamp = date.getTime(); @@ -136,20 +132,15 @@ public class SortingTwoCNTTask extends AbstractTask { public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) - .set(SchBasePoint::getIs_lock, false).set(SchBasePoint::getVehicle_code,null)); - } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) - .set(SchBasePoint::getIs_lock, false)); + String point_code1 = taskObj.getPoint_code1(); + SchBasePoint schBasePoint1 = pointService.selectByPointCode(point_code1); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) + .eq(SchBasePoint::getPoint_code, point_code1) + .set(SchBasePoint::getVehicle_code, null) + .set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) + .set(SchBasePoint::getIs_lock, false) + .set(SchBasePoint::getUpdate_time, DateUtil.now())); } // 任务完成 taskObj.setTask_status(TaskStatus.FINISHED.getCode()); @@ -160,20 +151,13 @@ public class SortingTwoCNTTask extends AbstractTask { } public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { - // 获取参数 - String startPoint = taskObj.getPoint_code1(); - SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); - // 起点清空 - if (ObjectUtil.isNotEmpty(schBasePoint)) { - PointUtils.updateByIngTaskCode(schBasePoint); - pointService.updateById(schBasePoint); - } - String point_code2 = taskObj.getPoint_code2(); - SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); - if (ObjectUtil.isNotEmpty(schBasePoint2)) { - PointUtils.updateByIngTaskCode(schBasePoint2); - pointService.updateById(schBasePoint2); + SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); + if (ObjectUtil.isNotEmpty(schBasePoint1)) { + schBasePoint1.setIs_lock(false); + PointUtils.setUpdateByAcs(schBasePoint1); + schBasePointService.updateById(schBasePoint1); } + // 获取参数 taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); taskObj.setTask_status(TaskStatus.CANCELED.getCode());