This commit is contained in:
2025-07-24 15:18:24 +08:00
parent 79a2c9260e
commit c727b5cacf
18 changed files with 187 additions and 18 deletions
+31 -1
View File
@@ -156,12 +156,19 @@ namespace BLL.API
}
return respone;
}
public static Model.ResponeData weldInfoList(string weldName, int page, int pageSize)
public static Model.ResponeData weldInfoList(string weldName, string unitStoreId, int page, int pageSize)
{
Model.ResponeData respone = new ResponeData();
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var q = (from x in db.Weld_WeldInfo orderby x.WeldCode select x).ToList();
if (!string.IsNullOrEmpty(unitStoreId))
{
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
orderby x.WeldCode
select x).ToList();
}
if (!string.IsNullOrEmpty(weldName))
{
q = q.Where(x => x.WeldName.Contains(weldName)).ToList();
@@ -344,6 +351,29 @@ namespace BLL.API
}
return respone;
}
public static Model.ResponeData unitStoreList()
{
Model.ResponeData respone = new ResponeData();
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var q = from x in Funs.DB.Weld_UnitStore
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
orderby y.UnitName, x.UnitStoreCode
select new { x.UnitStoreId, UnitStoreName = (y.UnitName + "(" + x.UnitStoreName + ")"), y.UnitName, x.UnitId };
List<BaseTeamgroupItem> res = new List<BaseTeamgroupItem>();
foreach (var p in q)
{
BaseTeamgroupItem item = new BaseTeamgroupItem();
item.TeamGroupId = p.UnitStoreId;
item.TeamGroupName = p.UnitStoreName;
res.Add(item);
}
respone.data = res;
}
return respone;
}
public static Model.ResponeData bsWelderList(string projectId)
{
Model.ResponeData respone = new ResponeData();
+3 -1
View File
@@ -109,6 +109,7 @@ namespace BLL.API
UsingPlanItem planItem = new UsingPlanItem();
planItem.UsingPlanId = x.UsingPlanId;
planItem.WeldId = x.WeldId;
planItem.UnitStoreId= BLL.UnitStoreService.GetUnitStoreNameById(x.UnitStoreId);
planItem.ProjectId = x.ProjectId;
planItem.UsePosition = x.UsePosition;
planItem.Amount = x.Amount;
@@ -253,7 +254,7 @@ namespace BLL.API
planItem.STE_ID = usingPlan.STE_ID;
planItem.IsFinish = usingPlan.IsFinish;
planItem.STE_Name = usingPlan.STE_Name;
planItem.UnitStoreId = BLL.UnitStoreService.GetUnitStoreNameById(usingPlan.UnitStoreId);
if (!string.IsNullOrEmpty(planItem.ProjectId))
{
@@ -361,6 +362,7 @@ namespace BLL.API
newUsingPlan.WeldId = usingPlan.WeldId;
newUsingPlan.ProjectId = usingPlan.ProjectId;
newUsingPlan.UsePosition = usingPlan.UsePosition;
newUsingPlan.UnitStoreId = usingPlan.UnitStoreId;
newUsingPlan.Amount = usingPlan.Amount;
newUsingPlan.UsingManOne = usingPlan.UsingManOne;
newUsingPlan.UsingManTwo = usingPlan.UsingManTwo;
@@ -113,5 +113,25 @@ namespace BLL
Funs.FineUIPleaseSelect(dropName);
}
}
/// <summary>
/// 根据主键获取单位仓库
/// </summary>
/// <param name="specificationsId"></param>
/// <returns></returns>
public static string GetUnitStoreNameById(string unitStoreId)
{
string name = string.Empty;
var store = from x in Funs.DB.Weld_UnitStore
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.UnitStoreId== unitStoreId
orderby y.UnitName, x.UnitStoreCode
select new { x.UnitStoreId, UnitStoreName = (y.UnitName + "(" + x.UnitStoreName + ")"), y.UnitName, x.UnitId };
if (store.Count() > 0)
{
name = store.First().UnitStoreName;
}
return name;
}
}
}
@@ -49,6 +49,7 @@ namespace BLL
newUsingPlan.InPutMan = usingPlan.InPutMan;
newUsingPlan.IsSteelStru = usingPlan.IsSteelStru;
newUsingPlan.Type = usingPlan.Type;
newUsingPlan.UnitStoreId = usingPlan.UnitStoreId;
db.Weld_UsingPlan.InsertOnSubmit(newUsingPlan);
db.SubmitChanges();
@@ -83,6 +84,7 @@ namespace BLL
newUsingPlan.IsSubmit = usingPlan.IsSubmit;
newUsingPlan.InPutMan = usingPlan.InPutMan;
newUsingPlan.IsSteelStru = usingPlan.IsSteelStru;
newUsingPlan.UnitStoreId = usingPlan.UnitStoreId;
db.SubmitChanges();
}