物资详细
This commit is contained in:
parent
fcb9ebe8db
commit
3733479772
|
@ -97,16 +97,14 @@ namespace WebAPI.Controllers
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
responeData.data = (
|
responeData.data = (
|
||||||
from cl in Funs.DB.Cl_w_comp
|
from bm in Funs.DB.CL_B_Material
|
||||||
join bm in Funs.DB.CL_B_Material on cl.MaterialID equals bm.MaterialID
|
where bm.SystemCode == code && bm.ProjectId == ProjectId
|
||||||
join bi in Funs.DB.Cl_b_Installation on cl.InstallationId equals bi.InstallationId
|
|
||||||
where cl.ProjectId == ProjectId
|
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
ProjectId = cl.ProjectId, // 项目ID
|
ProjectId = bm.ProjectId, // 项目ID
|
||||||
InstallationId = cl.InstallationId, // 专业ID
|
InstallationId = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).InstallationId, // 专业ID
|
||||||
Installationname = bi.InstallationName, // 专业名称
|
Installationname = Funs.DB.Cl_b_Installation.FirstOrDefault(x => x.InstallationId == Funs.DB.Cl_w_comp.FirstOrDefault(y => y.MaterialID == bm.MaterialID).InstallationId).InstallationName, // 专业名称
|
||||||
ghfs = cl.Ghfs, // 采购方类别
|
ghfs = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).Ghfs, // 采购方类别
|
||||||
MaterialID = bm.MaterialID, // 物资ID
|
MaterialID = bm.MaterialID, // 物资ID
|
||||||
MaterialName = bm.MaterialName, // 物资名称
|
MaterialName = bm.MaterialName, // 物资名称
|
||||||
Specificationtype = bm.Specificationtype, // 规格
|
Specificationtype = bm.Specificationtype, // 规格
|
||||||
|
@ -115,12 +113,12 @@ namespace WebAPI.Controllers
|
||||||
MaterialQuality = bm.MaterialQuality,
|
MaterialQuality = bm.MaterialQuality,
|
||||||
Unit = bm.Unit, // 单位
|
Unit = bm.Unit, // 单位
|
||||||
SystemCode = bm.SystemCode, // 编号
|
SystemCode = bm.SystemCode, // 编号
|
||||||
AreaCode = cl.TAreaMaterialMID, // 工区
|
AreaCode = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).TAreaMaterialMID, // 工区
|
||||||
jh_quantity = cl.Pquantity, // 计划量
|
jh_quantity = Funs.DB.Cl_w_comp.Where(c => c.MaterialID == bm.MaterialID).Sum(c => c.Pquantity), // 计划量
|
||||||
ck_quantity = cl.Pquantity - cl.OQuantity, // 最大允许出库量
|
ck_quantity = Funs.DB.Cl_w_comp.Where(c => c.MaterialID == bm.MaterialID).Sum(c => c.Pquantity) - Funs.DB.Cl_w_comp.Where(x => x.MaterialID == bm.MaterialID).Sum(c => c.OQuantity), // 最大允许出库量
|
||||||
kc_quantity = cl.SQuantity - cl.OQuantity + cl.RQuantity - cl.HQuantity // 库存量
|
kc_quantity = Funs.DB.Cl_w_comp.Where(x => x.MaterialID == bm.MaterialID).Sum(c => c.SQuantity) - Funs.DB.Cl_w_comp.Where(x => x.MaterialID == bm.MaterialID).Sum(c => c.OQuantity) + Funs.DB.Cl_w_comp.Where(x => x.MaterialID == bm.MaterialID).Sum(c => c.RQuantity) - Funs.DB.Cl_w_comp.Where(x => x.MaterialID == bm.MaterialID).Sum(c => c.HQuantity) // 库存量
|
||||||
}
|
}
|
||||||
).FirstOrDefault(x=>x.SystemCode == code);
|
).FirstOrDefault(x => x.SystemCode == code);
|
||||||
}
|
}
|
||||||
catch ( System.Exception ex)
|
catch ( System.Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -154,9 +152,9 @@ namespace WebAPI.Controllers
|
||||||
Unit = bm.Unit, // 单位
|
Unit = bm.Unit, // 单位
|
||||||
SystemCode = bm.SystemCode, // 编号
|
SystemCode = bm.SystemCode, // 编号
|
||||||
AreaCode = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).TAreaMaterialMID, // 工区
|
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, // 计划量
|
jh_quantity = Funs.DB.Cl_w_comp.Where(c => c.MaterialID == bm.MaterialID).Sum(c => c.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, // 最大允许出库量
|
ck_quantity = Funs.DB.Cl_w_comp.Where(c => c.MaterialID == bm.MaterialID).Sum(c=>c.Pquantity) - Funs.DB.Cl_w_comp.Where(x => x.MaterialID == bm.MaterialID).Sum(c=>c.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 // 库存量
|
kc_quantity = Funs.DB.Cl_w_comp.Where(x => x.MaterialID == bm.MaterialID).Sum(c=>c.SQuantity) - Funs.DB.Cl_w_comp.Where(x => x.MaterialID == bm.MaterialID).Sum(c=>c.OQuantity) + Funs.DB.Cl_w_comp.Where(x => x.MaterialID == bm.MaterialID).Sum(c=>c.RQuantity) - Funs.DB.Cl_w_comp.Where(x => x.MaterialID == bm.MaterialID).Sum(c=>c.HQuantity) // 库存量
|
||||||
}
|
}
|
||||||
).ToList();
|
).ToList();
|
||||||
responeData.data = list;
|
responeData.data = list;
|
||||||
|
|
Loading…
Reference in New Issue