From 7ba504dfea34a0b7c33342cd7de0d132ed098b6f Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Tue, 18 Aug 2026 16:46:56 +0800 Subject: [PATCH] 1 --- HJGL_DS/BLL/API/APIWeldServices.cs | 114 +++++++++++++++++- .../FineUIPro.Web/FineUIPro.Web.csproj.user | 2 +- HJGL_DS/FineUIPro.Web/Web.config | 2 +- HJGL_DS/WebAPI/Controllers/WeldController.cs | 33 +++++ HJGL_DS/WebAPI/WebAPI.csproj.user | 2 +- 5 files changed, 148 insertions(+), 5 deletions(-) diff --git a/HJGL_DS/BLL/API/APIWeldServices.cs b/HJGL_DS/BLL/API/APIWeldServices.cs index 517035e..3966e92 100644 --- a/HJGL_DS/BLL/API/APIWeldServices.cs +++ b/HJGL_DS/BLL/API/APIWeldServices.cs @@ -217,8 +217,6 @@ namespace BLL.API Model.ResponeData respone = new ResponeData(); using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { - - Weld_UsingPlan usingPlan = (from x in db.Weld_UsingPlan where x.UsingPlanId == usingPlanId select x).FirstOrDefault(); UsingPlanItem planItem = new UsingPlanItem(); @@ -415,6 +413,118 @@ namespace BLL.API return respone; } + public static Model.ResponeData getUsingPlanByUnitStoreCodeAndWelderCode(string unitStoreId, string wED_ID) + { + Model.ResponeData respone = new ResponeData(); + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var usingPlans = from x in db.Weld_UsingPlan + where x.UnitStoreId == unitStoreId && x.UsingManOne == wED_ID + && (x.IsCancel==false || x.IsCancel==null) + select x; + if (usingPlans.Count() > 0) + { + List items = new List(); + foreach (var usingPlan in usingPlans) + { + UsingPlanItem planItem = new UsingPlanItem(); + planItem.UsingPlanId = usingPlan.UsingPlanId; + planItem.WeldId = usingPlan.WeldId; + planItem.ProjectId = usingPlan.ProjectId; + planItem.UsePosition = usingPlan.UsePosition; + planItem.Amount = usingPlan.Amount; + planItem.UsingManOne = usingPlan.UsingManOne; + planItem.UsingManTwo = usingPlan.UsingManTwo; + if (usingPlan.InPutDate != null) + { + planItem.InPutDate = string.Format("{0:yyyy-MM-dd}", usingPlan.InPutDate); + } + if (usingPlan.CancelDate != null) + { + planItem.CancelDate = string.Format("{0:yyyy-MM-dd}", usingPlan.CancelDate); + } + planItem.IsCancel = usingPlan.IsCancel; + planItem.FinishMan = usingPlan.FinishMan; + planItem.OrderTime = usingPlan.OrderTime; + if (usingPlan.OrderDate != null) + { + planItem.OrderDate = string.Format("{0:yyyy-MM-dd}", usingPlan.OrderDate); + } + planItem.CancelResult = usingPlan.CancelResult; + planItem.IsSubmit = usingPlan.IsSubmit; + planItem.UsingUnit = usingPlan.UsingUnit; + planItem.IsNeedConfirm = usingPlan.IsNeedConfirm; + planItem.InPutMan = usingPlan.InPutMan; + planItem.IsSteelStru = usingPlan.IsSteelStru; + planItem.TeamGroupName = usingPlan.TeamGroupId; + var teamGroup = db.Base_TeamGroup.FirstOrDefault(x => x.TeamGroupName == usingPlan.TeamGroupId); + if (teamGroup != null) + { + planItem.TeamGroupId = teamGroup.TeamGroupId; + } + planItem.STE_ID = usingPlan.STE_ID; + planItem.IsFinish = usingPlan.IsFinish; + planItem.STE_Name = usingPlan.STE_Name; + planItem.UnitStoreId = usingPlan.UnitStoreId; + planItem.UnitStoreName = BLL.UnitStoreService.GetUnitStoreNameById(usingPlan.UnitStoreId); + if (!string.IsNullOrEmpty(planItem.ProjectId)) + { + var project = db.Base_Project.Where(x => x.ProjectId == planItem.ProjectId).FirstOrDefault(); + if (project != null) + { + planItem.ProjectName = project.ProjectName; + planItem.ProjectCode = project.ProjectCode; + } + } + if (!string.IsNullOrEmpty(planItem.WeldId)) + { + var weldInfo = db.Weld_WeldInfo.Where(x => x.WeldId == planItem.WeldId).FirstOrDefault(); + if (weldInfo != null) + { + planItem.WeldName = weldInfo.WeldName; + planItem.WeldSpec = weldInfo.WeldSpec; + planItem.WeldCode = weldInfo.WeldCode; + } + if (weldInfo != null && !string.IsNullOrEmpty(weldInfo.WeldTypeId)) + { + var weldType = db.Weld_WeldType.Where(x => x.WeldTypeId == weldInfo.WeldTypeId).FirstOrDefault(); + + if (weldType != null) + { + + } + } + } + + if (!string.IsNullOrEmpty(planItem.UsingManOne)) + { + planItem.UsingManOneName = db.HJGL_BS_Welder.Where(x => x.WED_ID == planItem.UsingManOne).Select(x => x.WED_Name).FirstOrDefault(); + } + if (!string.IsNullOrEmpty(planItem.UsingManTwo)) + { + planItem.UsingManTwoName = db.HJGL_BS_Welder.Where(x => x.WED_ID == planItem.UsingManTwo).Select(x => x.WED_Name).FirstOrDefault(); + } + if (!string.IsNullOrEmpty(planItem.UsingUnit)) + { + planItem.UsingUnitName = db.Base_Unit.Where(x => x.UnitId == planItem.UsingUnit).Select(x => x.UnitName).FirstOrDefault(); + } + if (!string.IsNullOrEmpty(planItem.InPutMan)) + { + planItem.InPutManName = db.Sys_User.Where(x => x.UserId == planItem.InPutMan).Select(x => x.UserName).FirstOrDefault(); + } + items.Add(planItem); + } + respone.data = items; + } + else + { + respone.code = 0; + respone.message = "对应焊工无领料计划!"; + } + } + return respone; + } + public static Model.ResponeData welderQueIsPass(string welderId, string steelType, bool isSteelStru) { Model.ResponeData respone = new ResponeData(); diff --git a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user index 80f7761..abef49a 100644 --- a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -2,7 +2,7 @@ true - Release|Any CPU + Debug|Any CPU diff --git a/HJGL_DS/FineUIPro.Web/Web.config b/HJGL_DS/FineUIPro.Web/Web.config index 3c98f31..070a5f8 100644 --- a/HJGL_DS/FineUIPro.Web/Web.config +++ b/HJGL_DS/FineUIPro.Web/Web.config @@ -11,7 +11,7 @@ - + diff --git a/HJGL_DS/WebAPI/Controllers/WeldController.cs b/HJGL_DS/WebAPI/Controllers/WeldController.cs index 80d2046..6148264 100644 --- a/HJGL_DS/WebAPI/Controllers/WeldController.cs +++ b/HJGL_DS/WebAPI/Controllers/WeldController.cs @@ -320,5 +320,38 @@ namespace WebAPI.Controllers } return respone; } + + [HttpGet] + public Model.ResponeData getUsingPlanByUnitStoreCodeAndWelderCode(string unitStoreCode, string welderCode) + { + Model.ResponeData respone = new ResponeData(); + try + { + using (Model.SGGLDB db = new Model.SGGLDB(BLL.Funs.ConnString)) + { + var unitStore = db.Weld_UnitStore.FirstOrDefault(x => x.UnitStoreCode == unitStoreCode); + var welder = db.HJGL_BS_Welder.FirstOrDefault(x => x.WED_Code == welderCode); + if (unitStore == null) + { + respone.code = 0; + respone.message = "对应编码的仓库不存在!"; + return respone; + } + if (welder == null) + { + respone.code = 0; + respone.message = "对应焊工号的焊工不存在!"; + return respone; + } + return APIWeldServices.getUsingPlanByUnitStoreCodeAndWelderCode(unitStore.UnitStoreId, welder.WED_ID); + } + } + catch (Exception e) + { + respone.code = 0; + respone.message = e.Message; + } + return respone; + } } } \ No newline at end of file diff --git a/HJGL_DS/WebAPI/WebAPI.csproj.user b/HJGL_DS/WebAPI/WebAPI.csproj.user index 28be9c4..a48b337 100644 --- a/HJGL_DS/WebAPI/WebAPI.csproj.user +++ b/HJGL_DS/WebAPI/WebAPI.csproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU FolderProfile true