1. 修复库位调度的输入, 105和107尺寸对调

2. 适配库位使用率接口, 交换1库和3库
3. 出库接口添加返回值, 返回出库终点
This commit is contained in:
李宇奇 2025-05-16 15:14:00 +08:00
parent 49a741ae40
commit 9fe2145428
3 changed files with 28 additions and 9 deletions

View File

@ -6,9 +6,9 @@ import lombok.Getter;
@Getter @Getter
@AllArgsConstructor @AllArgsConstructor
public enum WmsLocationNumEnums { public enum WmsLocationNumEnums {
LOCATION_NUM_1(525, "1号库"), LOCATION_NUM_1(540, "1号库"),
LOCATION_NUM_2(316, "2号库"), LOCATION_NUM_2(316, "2号库"),
LOCATION_NUM_3(540, "3号库"); LOCATION_NUM_3(525, "3号库");
private final Integer code; private final Integer code;
private final String desc; private final String desc;

View File

@ -49,7 +49,7 @@ public class WcsControllerServiceImpl implements IWcsControllerService {
// 一号堆垛机全部存空托盘 // 一号堆垛机全部存空托盘
if(point.equals("105") || point.equals("106") || point.equals("107")) { 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) { if(targetLocation == null) {
return WcsApiResponse.error("没有空闲库位,请稍后再试", null); return WcsApiResponse.error("没有空闲库位,请稍后再试", null);
} }
@ -76,7 +76,7 @@ public class WcsControllerServiceImpl implements IWcsControllerService {
orderIn.setBatch("0"); orderIn.setBatch("0");
orderIn.setGoodsType("0"); orderIn.setGoodsType("0");
orderIn.setSpecification("empty"); orderIn.setSpecification("empty");
orderIn.setQuantity(1.0); orderIn.setQuantity(4.0);
orderIn.setGoodsDesc(""); orderIn.setGoodsDesc("");
orderIn.setXsfbillno(""); orderIn.setXsfbillno("");
orderIn.setXsfseq(0); orderIn.setXsfseq(0);

View File

@ -161,7 +161,7 @@ public class YcwmsControllerServiceImpl implements IYcwmsControllerService {
if(!appOrderOutService.save(orderOut)) { if(!appOrderOutService.save(orderOut)) {
return YcwmsResponse.error("出库单保存失败,请稍后再试", null); return YcwmsResponse.error("出库单保存失败,请稍后再试", null);
} }
return YcwmsResponse.success(); return YcwmsResponse.success(getLocByGoodsId(request.getGoodsId()));
} }
@Override @Override
@ -224,7 +224,7 @@ public class YcwmsControllerServiceImpl implements IYcwmsControllerService {
if (equipmentId == null || equipmentId.isEmpty()) { if (equipmentId == null || equipmentId.isEmpty()) {
return YcwmsResponse.error("参数错误", null); return YcwmsResponse.error("参数错误", null);
} }
if (equipmentId.equals("1")) { if (equipmentId.equals("3")) {
Integer queryId = Integer.parseInt(equipmentId); Integer queryId = Integer.parseInt(equipmentId);
Long locationNum500 = appLocationService.count( Long locationNum500 = appLocationService.count(
new LambdaQueryWrapper<TAppLocation>() new LambdaQueryWrapper<TAppLocation>()
@ -239,7 +239,7 @@ public class YcwmsControllerServiceImpl implements IYcwmsControllerService {
.eq(TAppLocation::getIsOccupy, WmsLocationOccupyStatusEnums.OCCUPY.getCode()) .eq(TAppLocation::getIsOccupy, WmsLocationOccupyStatusEnums.OCCUPY.getCode())
); );
Long locationNum = locationNum500 + locationNum600; 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); return YcwmsResponse.success(percent);
} else if (equipmentId.equals("2")) { } else if (equipmentId.equals("2")) {
Integer queryId = Integer.parseInt(equipmentId); 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(); Double percent = Double.parseDouble(locationNum.toString()) / WmsLocationNumEnums.LOCATION_NUM_2.getCode();
return YcwmsResponse.success(percent); return YcwmsResponse.success(percent);
} else if (equipmentId.equals("3")) { } else if (equipmentId.equals("1")) {
Integer queryId = Integer.parseInt(equipmentId); Integer queryId = Integer.parseInt(equipmentId);
Long locationNum = appLocationService.count( Long locationNum = appLocationService.count(
new LambdaQueryWrapper<TAppLocation>() new LambdaQueryWrapper<TAppLocation>()
@ -259,9 +259,28 @@ public class YcwmsControllerServiceImpl implements IYcwmsControllerService {
.eq(TAppLocation::getLocationType, WmsLocationTypeEnums.TYPE_PRODUCT.getCode()) .eq(TAppLocation::getLocationType, WmsLocationTypeEnums.TYPE_PRODUCT.getCode())
.eq(TAppLocation::getIsOccupy, WmsLocationOccupyStatusEnums.OCCUPY.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.success(percent);
} }
return YcwmsResponse.error("equipmentId无效", null); 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<TAppStock> stocks = appStockService.list(
new LambdaQueryWrapper<TAppStock>()
.eq(TAppStock::getVehicleId, goodsId)
);
return ConvertUtils.convertDestinationToPoint(stocks.getFirst().getBarCode());
}
}
} }