From 5bb695619eb5e1cef81db62093f34e4808527aed Mon Sep 17 00:00:00 2001 From: liuxy Date: Wed, 19 Jun 2024 14:59:15 +0800 Subject: [PATCH] =?UTF-8?q?rev=EF=BC=9A=E5=8F=91=E8=B4=A7=E5=8C=BA?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../point/dao/mapper/SchBasePointMapper.xml | 4 +- .../util/impl/SendOutManageServiceImpl.java | 49 ++++++++----------- 2 files changed, 23 insertions(+), 30 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/dao/mapper/SchBasePointMapper.xml b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/dao/mapper/SchBasePointMapper.xml index 5457c2ae2..1d2286b20 100644 --- a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/dao/mapper/SchBasePointMapper.xml +++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/dao/mapper/SchBasePointMapper.xml @@ -106,7 +106,7 @@ LEFT JOIN sch_base_point point2 ON point1.row_num = point2.row_num WHERE IFNULL( point2.vehicle_code, '' ) != '' - AND point2.out_order_seq > point1.out_order_seq + AND point1.out_order_seq > point2.out_order_seq AND point1.point_code= #{point_code} @@ -125,7 +125,7 @@ LEFT JOIN sch_base_point point2 ON point1.row_num = point2.row_num WHERE IFNULL( point2.vehicle_code, '' ) = '' - AND point2.out_order_seq > point1.out_order_seq + AND point1.out_order_seq > point2.out_order_seq AND point1.point_code= #{point_code} diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/storage_manage/ios/service/iostorInv/util/impl/SendOutManageServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/b_lms/storage_manage/ios/service/iostorInv/util/impl/SendOutManageServiceImpl.java index 99e8645dc..511e36ddc 100644 --- a/lms/nladmin-system/src/main/java/org/nl/b_lms/storage_manage/ios/service/iostorInv/util/impl/SendOutManageServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/storage_manage/ios/service/iostorInv/util/impl/SendOutManageServiceImpl.java @@ -61,7 +61,6 @@ public class SendOutManageServiceImpl implements SendOutManageService { * 1)有相同订单号有空位的:相同订单号的放在一排 * 2)没有相同订单号的:新开一排 * 3)有相同订单号的但是没有空位:新开一排 - * 2.删除载具对应木箱记录 */ CutConveyorTask cutConveyorTask = new CutConveyorTask(); @@ -72,16 +71,14 @@ public class SendOutManageServiceImpl implements SendOutManageService { .eq(SchBasePoint::getIs_used, IOSEnum.IS_NOTANDYES.code("是")) .eq(SchBasePoint::getIs_delete, IOSEnum.IS_NOTANDYES.code("否")) ); - // 1.查询此木箱号的子卷包装关系 - if(StringUtils.isEmpty(whereJson.getString("vehicle_code"))){ - throw new BadRequestException("木箱号不能为空!"); - } + //木箱号可能用逗号隔开 String vehicleCode = Arrays.asList(whereJson.getString("vehicle_code").split(",")).get(0); JSONObject jsonSub = subTab.query("package_box_sn = '" + vehicleCode + "'").uniqueResult(0); if (ObjectUtil.isEmpty(jsonSub)) { throw new BadRequestException("未查询到该木箱对应的包装关系!"); } + // 2.找相同订单号的所有排 jsonSub.put("region_id", RegionTypeEnum.TWO_FH01.getId()); List pointLikeOrder = schBasePointMapper.queryLikeOrderRow(jsonSub); @@ -99,7 +96,7 @@ public class SendOutManageServiceImpl implements SendOutManageService { ObjectUtil.isEmpty(row.getVehicle_code()) && row.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定")) ) - .sorted(Comparator.comparing(SchBasePoint::getOut_order_seq)) + .sorted(Comparator.comparing(SchBasePoint::getIn_order_seq)) .collect(Collectors.toList()); joArr.addAll(rowPointList); @@ -122,19 +119,17 @@ public class SendOutManageServiceImpl implements SendOutManageService { ObjectUtil.isEmpty(row.getVehicle_code()) && row.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定")) ) - .sorted(Comparator.comparing(SchBasePoint::getOut_order_seq)) + .sorted(Comparator.comparing(SchBasePoint::getIn_order_seq)) .collect(Collectors.toList()); - if (rowPointList.size() == 4) { - JSONObject jsonNewRow = JSONObject.parseObject(JSON.toJSONString(rowPointList.get(0))); + JSONObject jsonNewRow = JSONObject.parseObject(JSON.toJSONString(rowPointList.get(0))); - if (cutConveyorTask.isSingleTask(jsonNewRow.getString("point_code"))) { - continue; - } - - point_code = jsonNewRow.getString("point_code"); - break; + if (cutConveyorTask.isSingleTask(jsonNewRow.getString("point_code"))) { + continue; } + + point_code = jsonNewRow.getString("point_code"); + break; } } else { // 校验此货位是否被堵住:1.如果被堵住则判断下一个是否被堵住 2.如果全部被堵住则新开一排 @@ -178,19 +173,17 @@ public class SendOutManageServiceImpl implements SendOutManageService { ObjectUtil.isEmpty(row.getVehicle_code()) && row.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定")) ) - .sorted(Comparator.comparing(SchBasePoint::getOut_order_seq)) + .sorted(Comparator.comparing(SchBasePoint::getIn_order_seq)) .collect(Collectors.toList()); - if (rowPointList.size() == 4) { - JSONObject jsonNewRow = JSONObject.parseObject(JSON.toJSONString(rowPointList.get(0))); + JSONObject jsonNewRow = JSONObject.parseObject(JSON.toJSONString(rowPointList.get(0))); - if (cutConveyorTask.isSingleTask(jsonNewRow.getString("point_code"))) { - continue; - } - - point_code = jsonNewRow.getString("point_code"); - break; + if (cutConveyorTask.isSingleTask(jsonNewRow.getString("point_code"))) { + continue; } + + point_code = jsonNewRow.getString("point_code"); + break; } } @@ -200,8 +193,8 @@ public class SendOutManageServiceImpl implements SendOutManageService { //创建任务 JSONObject task_jo = new JSONObject(); task_jo.put("point_code1", whereJson.getString("device_code")); - task_jo.put("point_code2", "CK2023"); - task_jo.put("vehicle_code", whereJson.getString("vehicle_code")); + task_jo.put("point_code2", point_code); + task_jo.put("vehicle_code", vehicleCode); task_jo.put("task_type", "010708"); TwoSendOutTask taskBean = new TwoSendOutTask(); taskBean.createTask(task_jo); @@ -209,9 +202,9 @@ public class SendOutManageServiceImpl implements SendOutManageService { // 锁住点位 ischBasePointService.update( new UpdateWrapper().lambda() - .eq(SchBasePoint::getPoint_code, "CK2023") + .eq(SchBasePoint::getPoint_code, point_code) .set(SchBasePoint::getLock_type, IOSEnum.LOCK_TYPE.code("其它")) - .set(SchBasePoint::getVehicle_code, whereJson.getString("vehicle_code")) + .set(SchBasePoint::getVehicle_code, vehicleCode) ); // 删除载具对应木箱记录