This commit is contained in:
高飞 2025-07-25 18:17:20 +08:00
parent 63eb85a30f
commit 74312cd9d3
5 changed files with 55 additions and 13 deletions

View File

@ -165,7 +165,7 @@ namespace BLL.API
if (!string.IsNullOrEmpty(unitStoreId)) if (!string.IsNullOrEmpty(unitStoreId))
{ {
q = (from x in db.Weld_WeldInfo q = (from x in db.Weld_WeldInfo
where (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == x.WeldId select y.Amount ?? 0).Sum() - (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == x.WeldId select y.UsingAmount ?? 0).Sum() > 0 && (x.IsLock == null || x.IsLock == false) where (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == x.WeldId select y.Amount ?? 0).Sum() > 0 && (x.IsLock == null || x.IsLock == false)
orderby x.WeldCode orderby x.WeldCode
select x).ToList(); select x).ToList();
} }

View File

@ -54,7 +54,8 @@ namespace FineUIPro.Web.WeldMat.UsingPlan
FROM dbo.Weld_WeldInfo weld FROM dbo.Weld_WeldInfo weld
LEFT JOIN Weld_WeldType AS weldType ON weldType.WeldTypeId =weld.WeldTypeId LEFT JOIN Weld_WeldType AS weldType ON weldType.WeldTypeId =weld.WeldTypeId
WHERE 1 = 1 and (weld.IsLock is null or weld.IsLock=0) WHERE 1 = 1 and (weld.IsLock is null or weld.IsLock=0)
and (select (SUM(ISNULL(stockIn.Amount,0))-SUM(ISNULL(stockIn.UsingAmount,0))) from Weld_StockIn stockIn where UnitStoreId=@UnitStoreId and WeldId=weld.WeldId)>0"; and (select SUM(ISNULL(stockIn.Amount,0)) from Weld_StockIn stockIn where UnitStoreId=@UnitStoreId and WeldId=weld.WeldId)>0";
//and (select (SUM(ISNULL(stockIn.Amount,0))-SUM(ISNULL(stockIn.UsingAmount,0))) from Weld_StockIn stockIn where UnitStoreId=@UnitStoreId and WeldId=weld.WeldId)>0";
List<SqlParameter> listStr = new List<SqlParameter>(); List<SqlParameter> listStr = new List<SqlParameter>();
//listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); //listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
listStr.Add(new SqlParameter("@UnitStoreId", Request.Params["unitStoreId"])); listStr.Add(new SqlParameter("@UnitStoreId", Request.Params["unitStoreId"]));
@ -158,7 +159,17 @@ and (select (SUM(ISNULL(stockIn.Amount,0))-SUM(ISNULL(stockIn.UsingAmount,0))) f
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{ {
string itemsString = this.Grid1.SelectedRowID; string itemsString = this.Grid1.SelectedRowID;
Model.SGGLDB db = Funs.DB;
string unitStoreId = Request.Params["unitStoreId"];
var q = from x in db.Weld_WeldInfo
where (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == itemsString select y.Amount ?? 0).Sum() - (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == itemsString select y.UsingAmount ?? 0).Sum() + (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == itemsString select y.RecycleAmount ?? 0).Sum() > 0 && (x.IsLock == null || x.IsLock == false)
orderby x.WeldCode
select x;
if (q.Count() == 0)
{
Alert.ShowInTop("所选焊材无库存,请联系仓库保管员!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(itemsString) PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(itemsString)
+ ActiveWindow.GetHidePostBackReference()); + ActiveWindow.GetHidePostBackReference());
} }
@ -179,13 +190,13 @@ and (select (SUM(ISNULL(stockIn.Amount,0))-SUM(ISNULL(stockIn.UsingAmount,0))) f
if (WeldId != null) if (WeldId != null)
{ {
var usingMat = from x in Funs.DB.Weld_UsingMat where x.ProjectId == this.ProjectId && x.WeldId == WeldId.ToString() select x; var usingMat = from x in Funs.DB.Weld_UsingMat where x.ProjectId == this.ProjectId && x.WeldId == WeldId.ToString() select x;
if (usingMat.Count()>0) if (usingMat.Count() > 0)
{ {
sumUsingAmount = usingMat.Sum(e => e.Amount); sumUsingAmount = usingMat.Sum(e => e.Amount);
} }
var recycleMat = from x in Funs.DB.Weld_RecycleMat where x.ProjectId == this.ProjectId && x.WeldId == WeldId.ToString() select x; var recycleMat = from x in Funs.DB.Weld_RecycleMat where x.ProjectId == this.ProjectId && x.WeldId == WeldId.ToString() select x;
if (recycleMat.Count()>0) if (recycleMat.Count() > 0)
{ {
sumRecycleAmount = recycleMat.Sum(e => e.RecycleAmount); sumRecycleAmount = recycleMat.Sum(e => e.RecycleAmount);
} }

View File

@ -211,7 +211,7 @@ namespace FineUIPro.Web.WeldMat.UsingPlan
{ {
Model.SGGLDB db = Funs.DB; Model.SGGLDB db = Funs.DB;
var q = from x in db.Weld_WeldInfo var q = from x in db.Weld_WeldInfo
where (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == usingPlan.WeldId select y.Amount ?? 0).Sum() - (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == usingPlan.WeldId select y.UsingAmount ?? 0).Sum() > 0 && (x.IsLock == null || x.IsLock == false) where (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == usingPlan.WeldId select y.Amount ?? 0).Sum() - (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == usingPlan.WeldId select y.UsingAmount ?? 0).Sum() + (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == usingPlan.WeldId select y.RecycleAmount ?? 0).Sum() > 0 && (x.IsLock == null || x.IsLock == false)
orderby x.WeldCode orderby x.WeldCode
select x; select x;
if (q.Count() == 0) if (q.Count() == 0)

View File

@ -84,6 +84,37 @@ namespace WebAPI.Controllers
return respone; return respone;
} }
[HttpGet]
public Model.ResponeData isHaveWeld(string welderId, string unitStoreId)
{
Model.ResponeData respone = new ResponeData();
try
{
Model.SGGLDB db = BLL.Funs.DB;
var q = from x in db.Weld_WeldInfo
where (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == welderId select y.Amount ?? 0).Sum() - (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == welderId select y.UsingAmount ?? 0).Sum() + (from y in db.Weld_StockIn where y.UnitStoreId == unitStoreId && y.WeldId == welderId select y.RecycleAmount ?? 0).Sum() > 0 && (x.IsLock == null || x.IsLock == false)
orderby x.WeldCode
select x;
if (q.Count() == 0)
{
respone.code = 0;
respone.message = "所选焊材无库存,请联系仓库保管员!";
return respone;
}
else
{
respone.code = 1;
return respone;
}
}
catch (Exception e)
{
respone.code = 0;
respone.message = e.Message;
}
return respone;
}
[HttpPost] [HttpPost]
public Model.ResponeData addUsingPlan([FromBody] UsingPlanItem usingPlan) public Model.ResponeData addUsingPlan([FromBody] UsingPlanItem usingPlan)
{ {

View File

@ -79,13 +79,13 @@
<publishTime>09/10/2013 16:29:20</publishTime> <publishTime>09/10/2013 16:29:20</publishTime>
</File> </File>
<File Include="bin/BLL.dll"> <File Include="bin/BLL.dll">
<publishTime>07/24/2025 16:36:52</publishTime> <publishTime>07/25/2025 08:51:11</publishTime>
</File> </File>
<File Include="bin/BLL.dll.config"> <File Include="bin/BLL.dll.config">
<publishTime>07/03/2024 11:01:05</publishTime> <publishTime>07/03/2024 11:01:05</publishTime>
</File> </File>
<File Include="bin/BLL.pdb"> <File Include="bin/BLL.pdb">
<publishTime>07/24/2025 16:36:52</publishTime> <publishTime>07/25/2025 08:51:11</publishTime>
</File> </File>
<File Include="bin/BouncyCastle.Crypto.dll"> <File Include="bin/BouncyCastle.Crypto.dll">
<publishTime>12/17/2020 21:32:28</publishTime> <publishTime>12/17/2020 21:32:28</publishTime>
@ -115,10 +115,10 @@
<publishTime>07/25/2012 11:48:56</publishTime> <publishTime>07/25/2012 11:48:56</publishTime>
</File> </File>
<File Include="bin/Model.dll"> <File Include="bin/Model.dll">
<publishTime>07/24/2025 16:36:51</publishTime> <publishTime>07/25/2025 08:51:10</publishTime>
</File> </File>
<File Include="bin/Model.pdb"> <File Include="bin/Model.pdb">
<publishTime>07/24/2025 16:36:51</publishTime> <publishTime>07/25/2025 08:51:10</publishTime>
</File> </File>
<File Include="bin/Newtonsoft.Json.dll"> <File Include="bin/Newtonsoft.Json.dll">
<publishTime>02/18/2018 09:44:54</publishTime> <publishTime>02/18/2018 09:44:54</publishTime>
@ -316,10 +316,10 @@
<publishTime>02/01/2018 12:20:56</publishTime> <publishTime>02/01/2018 12:20:56</publishTime>
</File> </File>
<File Include="bin/WebAPI.dll"> <File Include="bin/WebAPI.dll">
<publishTime>07/24/2025 16:36:53</publishTime> <publishTime>07/25/2025 08:51:12</publishTime>
</File> </File>
<File Include="bin/WebAPI.pdb"> <File Include="bin/WebAPI.pdb">
<publishTime>07/24/2025 16:36:53</publishTime> <publishTime>07/25/2025 08:51:12</publishTime>
</File> </File>
<File Include="bin/WebGrease.dll"> <File Include="bin/WebGrease.dll">
<publishTime>01/23/2014 13:57:34</publishTime> <publishTime>01/23/2014 13:57:34</publishTime>
@ -445,7 +445,7 @@
<publishTime>07/03/2024 11:01:07</publishTime> <publishTime>07/03/2024 11:01:07</publishTime>
</File> </File>
<File Include="Web.config"> <File Include="Web.config">
<publishTime>07/24/2025 16:37:05</publishTime> <publishTime>07/25/2025 08:51:20</publishTime>
</File> </File>
</ItemGroup> </ItemGroup>
</Project> </Project>