From fe8aee0bdab08050d11d117b42d408cf9b588012 Mon Sep 17 00:00:00 2001 From: zhou keda <1315948824@qq.com> Date: Wed, 19 Jun 2024 16:29:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=85=8D=E5=91=98=E5=B7=A5=E6=94=B9?= =?UTF-8?q?=E6=88=90=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dto/PrdManage/PrdMoTaskIssueListOutput.cs | 1 + ProductionMgr/Tnb.ProductionMgr/PrdMoTaskIssueService.cs | 4 +++- ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskIssueListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskIssueListOutput.cs index 7660b70e..3250ca4e 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskIssueListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskIssueListOutput.cs @@ -12,5 +12,6 @@ namespace Tnb.ProductionMgr.Entities.Dto public int? scheduled_qty { get; set; } public string create_time { get; set; } public string workstation_id { get; set; } + public string worker_id { get; set; } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskIssueService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskIssueService.cs index 5b3f9e23..4987103d 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskIssueService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskIssueService.cs @@ -105,10 +105,11 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b, c, d, e, f) => a.mo_id == f.id) .LeftJoin((a, b, c, d, e, f, g) => g.id == a.eqp_id) .LeftJoin((a, b, c, d, e, f, g,h)=>a.workstation_id==h.Id) + .LeftJoin((a, b, c, d, e, f, g,h,i)=>a.worker_id==i.Id) .WhereIF(!string.IsNullOrEmpty(moTaskCode), (a, b, c, d) => a.mo_task_code.Contains(moTaskCode)) .WhereIF(!string.IsNullOrEmpty(moTaskStatus), (a, b, c, d) => a.mo_task_status == moTaskStatus) .Where((a, b, c, d, e, f) => a.schedule_type == 1) - .Select((a, b, c, d, e, f, g,h) => new PrdMoTaskIssueListOutput + .Select((a, b, c, d, e, f, g,h,i) => new PrdMoTaskIssueListOutput { id = a.id, mo_task_code = a.mo_task_code, @@ -117,6 +118,7 @@ namespace Tnb.ProductionMgr eqp_id = g.code + "/" + g.name, mo_task_status = d.FullName, workstation_id = h.FullName, + worker_id = i.RealName, plan_qty = f.plan_qty, scheduled_qty = a.scheduled_qty, create_time = a.create_time == null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS), diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index 23f77a4f..dc240aea 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -3354,11 +3354,12 @@ namespace Tnb.ProductionMgr [HttpPost] public async Task BindUser(Dictionary input) { - string id = input.GetOrDefault("id"); + string ids = input.GetOrDefault("ids"); + string[] idList = ids.Split(","); string workerId = input.GetOrDefault("worker_id"); int row = await _db.Updateable() .SetColumns(x => x.worker_id == workerId) - .Where(x => x.id == id) + .Where(x => idList.Contains(x.id)) .ExecuteCommandAsync(); return row>0 ? "分配成功" : "分配失败"; }