优化
This commit is contained in:
@ -279,12 +279,12 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB
|
|||||||
.eq(BusMaterialbatchdemandplan::getSuppliespriceId, suppliespriceId)
|
.eq(BusMaterialbatchdemandplan::getSuppliespriceId, suppliespriceId)
|
||||||
.ne(mrpBaseId!=null,BusMaterialbatchdemandplan::getMrpBaseId, mrpBaseId)// 排除当前批次
|
.ne(mrpBaseId!=null,BusMaterialbatchdemandplan::getMrpBaseId, mrpBaseId)// 排除当前批次
|
||||||
);
|
);
|
||||||
if(CollectionUtil.isEmpty(existingList)){
|
BigDecimal reduce = BigDecimal.ZERO;
|
||||||
return BigDecimal.ZERO;
|
if(CollectionUtil.isNotEmpty(existingList)){
|
||||||
|
reduce = existingList.stream()
|
||||||
|
.map(BusMaterialbatchdemandplan::getDemandQuantity)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
BigDecimal reduce = existingList.stream()
|
|
||||||
.map(BusMaterialbatchdemandplan::getDemandQuantity)
|
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
||||||
|
|
||||||
return byId.getQuantity().subtract(reduce);
|
return byId.getQuantity().subtract(reduce);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user