|
|
|
|
@ -204,6 +204,11 @@ public class StGlassCakeOutServiceImpl extends BaseServiceImpl<StGlassCakeOutMap |
|
|
|
|
List<StRealtimeStock> allUsableStockList = stRealtimeStockMapper.selectMaxUsableStockByCakeAttr( |
|
|
|
|
isPrint, powderWeight, materialNo, thickness, goodsCode); |
|
|
|
|
|
|
|
|
|
if (allUsableStockList == null || allUsableStockList.isEmpty()) { |
|
|
|
|
System.out.println("玻璃饼[编码:" + goodsCode + "]库存不足,跳过生成!"); |
|
|
|
|
// 跳过当前这条,继续下一条玻璃饼
|
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
for (StRealtimeStock stock : allUsableStockList) { |
|
|
|
|
double occupy = Optional.ofNullable(stock.getOccupyQuantity()).orElse(0D); |
|
|
|
|
double usableQty = stock.getQuantity() - occupy; |
|
|
|
|
@ -226,6 +231,11 @@ public class StGlassCakeOutServiceImpl extends BaseServiceImpl<StGlassCakeOutMap |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (candidateStockList.isEmpty()) { |
|
|
|
|
System.out.println("玻璃饼[编码:" + goodsCode + "]库存不足,跳过生成!"); |
|
|
|
|
// 跳过当前这条,继续下一条玻璃饼
|
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
// ===================== 走到这里 = 库存足够,开始真正生成预出库 =====================
|
|
|
|
|
double remainingQty = requireQty; |
|
|
|
|
for (StRealtimeStock maxStock : candidateStockList) { |
|
|
|
|
|