From 9fe2145428bd4016e6bfbee2dcd3a8db71cc42cd Mon Sep 17 00:00:00 2001 From: liyuqi Date: Fri, 16 May 2025 15:14:00 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E5=BA=93=E4=BD=8D?= =?UTF-8?q?=E8=B0=83=E5=BA=A6=E7=9A=84=E8=BE=93=E5=85=A5,=20105=E5=92=8C10?= =?UTF-8?q?7=E5=B0=BA=E5=AF=B8=E5=AF=B9=E8=B0=83=202.=20=E9=80=82=E9=85=8D?= =?UTF-8?q?=E5=BA=93=E4=BD=8D=E4=BD=BF=E7=94=A8=E7=8E=87=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?,=20=E4=BA=A4=E6=8D=A21=E5=BA=93=E5=92=8C3=E5=BA=93=203.=20?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=BC,=20=E8=BF=94=E5=9B=9E=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E7=BB=88=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/wms/WmsLocationNumEnums.java | 4 +-- .../serviceImpl/WcsControllerServiceImpl.java | 4 +-- .../YcwmsControllerServiceImpl.java | 29 +++++++++++++++---- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/wms_serve_nantong_yachi/src/main/java/com/wms_main/constant/enums/wms/WmsLocationNumEnums.java b/wms_serve_nantong_yachi/src/main/java/com/wms_main/constant/enums/wms/WmsLocationNumEnums.java index d085ce9..9710075 100644 --- a/wms_serve_nantong_yachi/src/main/java/com/wms_main/constant/enums/wms/WmsLocationNumEnums.java +++ b/wms_serve_nantong_yachi/src/main/java/com/wms_main/constant/enums/wms/WmsLocationNumEnums.java @@ -6,9 +6,9 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum WmsLocationNumEnums { - LOCATION_NUM_1(525, "1号库"), + LOCATION_NUM_1(540, "1号库"), LOCATION_NUM_2(316, "2号库"), - LOCATION_NUM_3(540, "3号库"); + LOCATION_NUM_3(525, "3号库"); private final Integer code; private final String desc; diff --git a/wms_serve_nantong_yachi/src/main/java/com/wms_main/service/controller/serviceImpl/WcsControllerServiceImpl.java b/wms_serve_nantong_yachi/src/main/java/com/wms_main/service/controller/serviceImpl/WcsControllerServiceImpl.java index f1aa5d9..6db78df 100644 --- a/wms_serve_nantong_yachi/src/main/java/com/wms_main/service/controller/serviceImpl/WcsControllerServiceImpl.java +++ b/wms_serve_nantong_yachi/src/main/java/com/wms_main/service/controller/serviceImpl/WcsControllerServiceImpl.java @@ -49,7 +49,7 @@ public class WcsControllerServiceImpl implements IWcsControllerService { // 一号堆垛机,全部存空托盘 if(point.equals("105") || point.equals("106") || point.equals("107")) { // 选一个库位 - TAppLocation targetLocation = stackerTaskService.getEmptyLocation(1, point.equals("107") ? WmsLocationTypeEnums.TYPE_600 : WmsLocationTypeEnums.TYPE_500); + TAppLocation targetLocation = stackerTaskService.getEmptyLocation(1, point.equals("105") ? WmsLocationTypeEnums.TYPE_600 : WmsLocationTypeEnums.TYPE_500); if(targetLocation == null) { return WcsApiResponse.error("没有空闲库位,请稍后再试", null); } @@ -76,7 +76,7 @@ public class WcsControllerServiceImpl implements IWcsControllerService { orderIn.setBatch("0"); orderIn.setGoodsType("0"); orderIn.setSpecification("empty"); - orderIn.setQuantity(1.0); + orderIn.setQuantity(4.0); orderIn.setGoodsDesc(""); orderIn.setXsfbillno(""); orderIn.setXsfseq(0); diff --git a/wms_serve_nantong_yachi/src/main/java/com/wms_main/service/controller/serviceImpl/YcwmsControllerServiceImpl.java b/wms_serve_nantong_yachi/src/main/java/com/wms_main/service/controller/serviceImpl/YcwmsControllerServiceImpl.java index 1db72b0..efcb237 100644 --- a/wms_serve_nantong_yachi/src/main/java/com/wms_main/service/controller/serviceImpl/YcwmsControllerServiceImpl.java +++ b/wms_serve_nantong_yachi/src/main/java/com/wms_main/service/controller/serviceImpl/YcwmsControllerServiceImpl.java @@ -161,7 +161,7 @@ public class YcwmsControllerServiceImpl implements IYcwmsControllerService { if(!appOrderOutService.save(orderOut)) { return YcwmsResponse.error("出库单保存失败,请稍后再试", null); } - return YcwmsResponse.success(); + return YcwmsResponse.success(getLocByGoodsId(request.getGoodsId())); } @Override @@ -224,7 +224,7 @@ public class YcwmsControllerServiceImpl implements IYcwmsControllerService { if (equipmentId == null || equipmentId.isEmpty()) { return YcwmsResponse.error("参数错误", null); } - if (equipmentId.equals("1")) { + if (equipmentId.equals("3")) { Integer queryId = Integer.parseInt(equipmentId); Long locationNum500 = appLocationService.count( new LambdaQueryWrapper() @@ -239,7 +239,7 @@ public class YcwmsControllerServiceImpl implements IYcwmsControllerService { .eq(TAppLocation::getIsOccupy, WmsLocationOccupyStatusEnums.OCCUPY.getCode()) ); Long locationNum = locationNum500 + locationNum600; - Double percent = Double.parseDouble(locationNum.toString()) / WmsLocationNumEnums.LOCATION_NUM_1.getCode(); + Double percent = Double.parseDouble(locationNum.toString()) / WmsLocationNumEnums.LOCATION_NUM_3.getCode(); return YcwmsResponse.success(percent); } else if (equipmentId.equals("2")) { Integer queryId = Integer.parseInt(equipmentId); @@ -251,7 +251,7 @@ public class YcwmsControllerServiceImpl implements IYcwmsControllerService { ); Double percent = Double.parseDouble(locationNum.toString()) / WmsLocationNumEnums.LOCATION_NUM_2.getCode(); return YcwmsResponse.success(percent); - } else if (equipmentId.equals("3")) { + } else if (equipmentId.equals("1")) { Integer queryId = Integer.parseInt(equipmentId); Long locationNum = appLocationService.count( new LambdaQueryWrapper() @@ -259,9 +259,28 @@ public class YcwmsControllerServiceImpl implements IYcwmsControllerService { .eq(TAppLocation::getLocationType, WmsLocationTypeEnums.TYPE_PRODUCT.getCode()) .eq(TAppLocation::getIsOccupy, WmsLocationOccupyStatusEnums.OCCUPY.getCode()) ); - Double percent = Double.parseDouble(locationNum.toString()) / WmsLocationNumEnums.LOCATION_NUM_3.getCode(); + Double percent = Double.parseDouble(locationNum.toString()) / WmsLocationNumEnums.LOCATION_NUM_1.getCode(); return YcwmsResponse.success(percent); } return YcwmsResponse.error("equipmentId无效", null); } + + private String getLocByGoodsId(String goodsId) { + if (goodsId.length() < 3) { + return switch (goodsId) { + case "0" -> "LK-3"; + case "1" -> "LK-4"; + case "2" -> "LK-5"; + case "3" -> "LK-6"; + case "4" -> "LK-7"; + default -> ""; + }; + } else { + List stocks = appStockService.list( + new LambdaQueryWrapper() + .eq(TAppStock::getVehicleId, goodsId) + ); + return ConvertUtils.convertDestinationToPoint(stocks.getFirst().getBarCode()); + } + } }