分配员工改成多选

This commit is contained in:
2024-06-19 16:29:44 +08:00
parent 7c3e39e104
commit fe8aee0bda
3 changed files with 7 additions and 3 deletions

View File

@@ -12,5 +12,6 @@ namespace Tnb.ProductionMgr.Entities.Dto
public int? scheduled_qty { get; set; } public int? scheduled_qty { get; set; }
public string create_time { get; set; } public string create_time { get; set; }
public string workstation_id { get; set; } public string workstation_id { get; set; }
public string worker_id { get; set; }
} }
} }

View File

@@ -105,10 +105,11 @@ namespace Tnb.ProductionMgr
.LeftJoin<PrdMo>((a, b, c, d, e, f) => a.mo_id == f.id) .LeftJoin<PrdMo>((a, b, c, d, e, f) => a.mo_id == f.id)
.LeftJoin<EqpEquipment>((a, b, c, d, e, f, g) => g.id == a.eqp_id) .LeftJoin<EqpEquipment>((a, b, c, d, e, f, g) => g.id == a.eqp_id)
.LeftJoin<OrganizeEntity>((a, b, c, d, e, f, g,h)=>a.workstation_id==h.Id) .LeftJoin<OrganizeEntity>((a, b, c, d, e, f, g,h)=>a.workstation_id==h.Id)
.LeftJoin<UserEntity>((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(moTaskCode), (a, b, c, d) => a.mo_task_code.Contains(moTaskCode))
.WhereIF(!string.IsNullOrEmpty(moTaskStatus), (a, b, c, d) => a.mo_task_status == moTaskStatus) .WhereIF(!string.IsNullOrEmpty(moTaskStatus), (a, b, c, d) => a.mo_task_status == moTaskStatus)
.Where((a, b, c, d, e, f) => a.schedule_type == 1) .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, id = a.id,
mo_task_code = a.mo_task_code, mo_task_code = a.mo_task_code,
@@ -117,6 +118,7 @@ namespace Tnb.ProductionMgr
eqp_id = g.code + "/" + g.name, eqp_id = g.code + "/" + g.name,
mo_task_status = d.FullName, mo_task_status = d.FullName,
workstation_id = h.FullName, workstation_id = h.FullName,
worker_id = i.RealName,
plan_qty = f.plan_qty, plan_qty = f.plan_qty,
scheduled_qty = a.scheduled_qty, scheduled_qty = a.scheduled_qty,
create_time = a.create_time == null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS), create_time = a.create_time == null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS),

View File

@@ -3354,11 +3354,12 @@ namespace Tnb.ProductionMgr
[HttpPost] [HttpPost]
public async Task<string> BindUser(Dictionary<String,String> input) public async Task<string> BindUser(Dictionary<String,String> input)
{ {
string id = input.GetOrDefault("id"); string ids = input.GetOrDefault("ids");
string[] idList = ids.Split(",");
string workerId = input.GetOrDefault("worker_id"); string workerId = input.GetOrDefault("worker_id");
int row = await _db.Updateable<PrdMoTask>() int row = await _db.Updateable<PrdMoTask>()
.SetColumns(x => x.worker_id == workerId) .SetColumns(x => x.worker_id == workerId)
.Where(x => x.id == id) .Where(x => idList.Contains(x.id))
.ExecuteCommandAsync(); .ExecuteCommandAsync();
return row>0 ? "分配成功" : "分配失败"; return row>0 ? "分配成功" : "分配失败";
} }