1. 看板逻辑修改
This commit is contained in:
parent
e49d205deb
commit
5e095d8f74
|
|
@ -616,10 +616,14 @@ public class KateWorkQueryController {
|
||||||
}
|
}
|
||||||
// 计算需要多少个看板
|
// 计算需要多少个看板
|
||||||
BigDecimal needKanbanQuantity = targetNum.subtract(remainNum).divide(pullGoods.getQuantityPerKanban(), 0, RoundingMode.CEILING);
|
BigDecimal needKanbanQuantity = targetNum.subtract(remainNum).divide(pullGoods.getQuantityPerKanban(), 0, RoundingMode.CEILING);
|
||||||
if (remainNum.add(needKanbanQuantity.multiply(pullGoods.getQuantityPerKanban())).compareTo(maxNum) > 0) {
|
while (remainNum.add(needKanbanQuantity.multiply(pullGoods.getQuantityPerKanban())).compareTo(maxNum) > 0) {
|
||||||
// 超过最大容量
|
// 超过最大容量
|
||||||
needKanbanQuantity = needKanbanQuantity.subtract(BigDecimal.ONE);
|
needKanbanQuantity = needKanbanQuantity.subtract(BigDecimal.ONE);
|
||||||
}
|
}
|
||||||
|
if (needKanbanQuantity.compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
|
// 不要补看板
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// 看板表中当前物料的所有看板
|
// 看板表中当前物料的所有看板
|
||||||
List<Kanban> kanbanList = kanbanService.list(new LambdaQueryWrapper<Kanban>()
|
List<Kanban> kanbanList = kanbanService.list(new LambdaQueryWrapper<Kanban>()
|
||||||
.eq(Kanban::getGoodsId, pullGoods.getGoodsId())
|
.eq(Kanban::getGoodsId, pullGoods.getGoodsId())
|
||||||
|
|
@ -643,8 +647,10 @@ public class KateWorkQueryController {
|
||||||
needKanbanQuantity = needKanbanQuantity.subtract(BigDecimal.ONE);
|
needKanbanQuantity = needKanbanQuantity.subtract(BigDecimal.ONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!dealKanbanList.isEmpty()) {
|
||||||
// 更新看板表
|
// 更新看板表
|
||||||
kanbanService.updateBatchById(dealKanbanList);
|
kanbanService.updateBatchById(dealKanbanList);
|
||||||
|
}
|
||||||
|
|
||||||
logger.info("生成CLC看板需求成功。");
|
logger.info("生成CLC看板需求成功。");
|
||||||
response.setCode(ResponseCode.OK.getCode());
|
response.setCode(ResponseCode.OK.getCode());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user