班前会日期 物质管理过滤
This commit is contained in:
@@ -137,31 +137,28 @@ namespace WebAPI.Controllers
|
||||
Model.ResponeData responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var list = (
|
||||
from cl in Funs.DB.Cl_w_comp
|
||||
join bm in Funs.DB.CL_B_Material on cl.MaterialID equals bm.MaterialID
|
||||
join bi in Funs.DB.Cl_b_Installation on cl.InstallationId equals bi.InstallationId
|
||||
where cl.ProjectId == ProjectId && cl.InstallationId == InstallationId && cl.Ghfs == ghfs && cl.TAreaMaterialMID == area
|
||||
select new
|
||||
{
|
||||
ProjectId = cl.ProjectId, // 项目ID
|
||||
InstallationId = cl.InstallationId, // 专业ID
|
||||
Installationname = bi.InstallationName, // 专业名称
|
||||
ghfs = cl.Ghfs, // 采购方类别
|
||||
MaterialID = bm.MaterialID, // 物资ID
|
||||
MaterialName = bm.MaterialName, // 物资名称
|
||||
Specificationtype = bm.Specificationtype, // 规格
|
||||
TechnicalConditions = bm.TechnicalConditions,
|
||||
StandardSpecification = bm.StandardSpecification,
|
||||
MaterialQuality = bm.MaterialQuality,
|
||||
Unit = bm.Unit, // 单位
|
||||
SystemCode = bm.SystemCode, // 编号
|
||||
AreaCode = cl.TAreaMaterialMID, // 工区
|
||||
jh_quantity = cl.Pquantity, // 计划量
|
||||
ck_quantity = cl.Pquantity - cl.OQuantity, // 最大允许出库量
|
||||
kc_quantity = cl.SQuantity - cl.OQuantity + cl.RQuantity - cl.HQuantity // 库存量
|
||||
}
|
||||
).ToList();
|
||||
var list = (from bm in Funs.DB.CL_B_Material
|
||||
where bm.ProjectId == ProjectId
|
||||
select new
|
||||
{
|
||||
ProjectId = bm.ProjectId, // 项目ID
|
||||
InstallationId = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).InstallationId, // 专业ID
|
||||
Installationname = Funs.DB.Cl_b_Installation.FirstOrDefault(x => x.InstallationId == InstallationId).InstallationName, // 专业名称
|
||||
ghfs = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).Ghfs, // 采购方类别
|
||||
MaterialID = bm.MaterialID, // 物资ID
|
||||
MaterialName = bm.MaterialName, // 物资名称
|
||||
Specificationtype = bm.Specificationtype, // 规格
|
||||
TechnicalConditions = bm.TechnicalConditions,
|
||||
StandardSpecification = bm.StandardSpecification,
|
||||
MaterialQuality = bm.MaterialQuality,
|
||||
Unit = bm.Unit, // 单位
|
||||
SystemCode = bm.SystemCode, // 编号
|
||||
AreaCode = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).TAreaMaterialMID, // 工区
|
||||
jh_quantity = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).Pquantity, // 计划量
|
||||
ck_quantity = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).Pquantity - Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).OQuantity, // 最大允许出库量
|
||||
kc_quantity = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).SQuantity - Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).OQuantity + Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).RQuantity - Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).HQuantity // 库存量
|
||||
}
|
||||
).ToList();
|
||||
responeData.data = list;
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user