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()); + } + } }