Commit 30d0470a authored by Tong Li's avatar Tong Li

物料

parent 76572cbe
package com.aps.entity.basic;
import com.aps.entity.Stock;
import lombok.Data;
import java.math.BigDecimal;
......@@ -31,6 +32,8 @@ public class Material {
*/
private double CurrentStock;
List<Stock> materialStocks=new ArrayList<>();
/**
* 在途物料(预计到货)
*/
......
......@@ -1187,11 +1187,21 @@ private GlobalParam InitGlobalParam()
material.setMaterialTypeName(m.getMaterialTypeName());
material.setCkeckLeadTime(m.getInspectDuration());
material.setPurchaseLeadTime(m.getPurchaseDuration());
double stock = Stocklist.stream()
.filter(t -> t.getMaterialId().equals(m.getId()))
.mapToDouble(Stock::getTotal)
.sum();
material.setCurrentStock(stock);
List<Stock> materialStocks= Stocklist.stream()
.filter(t -> t.getMaterialId().equals(m.getId()))
.collect(Collectors.toList());
if(materialStocks!=null&&materialStocks.size()>0)
{
double stock = materialStocks.stream()
.filter(t -> t.getMaterialId().equals(m.getId()))
.mapToDouble(Stock::getTotal)
.sum();
material.setCurrentStock(stock);
material.setMaterialStocks(materialStocks);
}
List<MaterialSupply> materialSupplys = new ArrayList<>();
if(m.getMaterialTypeName()==null)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment