|
|
|
@ -81,6 +81,9 @@ public class YysMonthlyProductionController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private YysMonthlyProductionService yysMonthlyProductionService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private YysBillMaterialService bomService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ConfigValueUtil configValueUtil;
|
|
|
|
@ -545,14 +548,20 @@ public class YysMonthlyProductionController {
|
|
|
|
|
if(unMPRList.size() == 0) return ActionResult.fail("没有需要生成MRP的月度生产计划");
|
|
|
|
|
// 获取没有生成MRP的月度生产计划
|
|
|
|
|
|
|
|
|
|
Set<Map<String, Object>> collect = unMPRList.stream().map(entity -> {
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("productId", entity.getProductId());
|
|
|
|
|
return map;
|
|
|
|
|
}).collect(Collectors.toSet());
|
|
|
|
|
Set<String> productIds = unMPRList.stream().map(YysMonthlyProductionEntity::getProductId).collect(Collectors.toSet());
|
|
|
|
|
|
|
|
|
|
if(productIds.size()==0){
|
|
|
|
|
return ActionResult.fail("没有需要生成MRP的月度生产计划");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 根据计划生成的物料 获取BOM清单
|
|
|
|
|
List<YysBillMaterialEntity> bomList = bomService.getListByProductIds(new ArrayList<>(productIds));
|
|
|
|
|
|
|
|
|
|
// 获取bom 清单详情
|
|
|
|
|
|
|
|
|
|
// 获取 物料信息
|
|
|
|
|
|
|
|
|
|
// 获取单位信息
|
|
|
|
|
|
|
|
|
|
// 计算一个计划的物料需求量
|
|
|
|
|
|
|
|
|
|