diff --git a/DataBase/版本日志/HJGLDB_DS_2025-07-21_gf.sql b/DataBase/版本日志/HJGLDB_DS_2025-07-21_gf.sql new file mode 100644 index 0000000..361860e --- /dev/null +++ b/DataBase/版本日志/HJGLDB_DS_2025-07-21_gf.sql @@ -0,0 +1,2 @@ +alter table [dbo].[Weld_UsingPlan] add UnitStoreId nvarchar(50) null +GO \ No newline at end of file diff --git a/HJGL_DS/BLL/API/APIBaseServices.cs b/HJGL_DS/BLL/API/APIBaseServices.cs index 55cbd05..e7658df 100644 --- a/HJGL_DS/BLL/API/APIBaseServices.cs +++ b/HJGL_DS/BLL/API/APIBaseServices.cs @@ -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 res = new List(); + 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(); diff --git a/HJGL_DS/BLL/API/APIWeldServices.cs b/HJGL_DS/BLL/API/APIWeldServices.cs index 3995cc7..b4fd91b 100644 --- a/HJGL_DS/BLL/API/APIWeldServices.cs +++ b/HJGL_DS/BLL/API/APIWeldServices.cs @@ -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; diff --git a/HJGL_DS/BLL/WeldMat/BaseInfo/UnitStoreService.cs b/HJGL_DS/BLL/WeldMat/BaseInfo/UnitStoreService.cs index 6742ab9..1dd926f 100644 --- a/HJGL_DS/BLL/WeldMat/BaseInfo/UnitStoreService.cs +++ b/HJGL_DS/BLL/WeldMat/BaseInfo/UnitStoreService.cs @@ -113,5 +113,25 @@ namespace BLL Funs.FineUIPleaseSelect(dropName); } } + + /// + /// 根据主键获取单位仓库 + /// + /// + /// + 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; + } } } diff --git a/HJGL_DS/BLL/WeldMat/UsingPlan/UsingPlanService.cs b/HJGL_DS/BLL/WeldMat/UsingPlan/UsingPlanService.cs index d01c740..c3416d1 100644 --- a/HJGL_DS/BLL/WeldMat/UsingPlan/UsingPlanService.cs +++ b/HJGL_DS/BLL/WeldMat/UsingPlan/UsingPlanService.cs @@ -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(); } diff --git a/HJGL_DS/FineUIPro.Web/File/Excel/领料计划导入模板.xlsx b/HJGL_DS/FineUIPro.Web/File/Excel/领料计划导入模板.xlsx index e939717..9ac870f 100644 Binary files a/HJGL_DS/FineUIPro.Web/File/Excel/领料计划导入模板.xlsx and b/HJGL_DS/FineUIPro.Web/File/Excel/领料计划导入模板.xlsx differ diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/ShowPlanWeld.aspx.cs b/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/ShowPlanWeld.aspx.cs index b2f11c7..f4b7cc1 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/ShowPlanWeld.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/ShowPlanWeld.aspx.cs @@ -53,9 +53,11 @@ namespace FineUIPro.Web.WeldMat.UsingPlan WeldType.WeldTypeName,WeldType.WeldUnit FROM dbo.Weld_WeldInfo weld LEFT JOIN Weld_WeldType AS weldType ON weldType.WeldTypeId =weld.WeldTypeId - WHERE 1 = 1 "; + WHERE 1 = 1 +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 listStr = new List(); //listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); + listStr.Add(new SqlParameter("@UnitStoreId", Request.Params["unitStoreId"])); if (drpWeldType.SelectedValue != BLL.Const._Null) { strSql += " AND weld.WeldTypeId = @WeldTypeId"; diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/UsingPlan.aspx b/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/UsingPlan.aspx index 966bfce..e5295ab 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/UsingPlan.aspx +++ b/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/UsingPlan.aspx @@ -173,7 +173,7 @@