PDA质检任务数据重复显示bug;载具规格为外协料架-退至二楼暂存仓
This commit is contained in:
@@ -115,37 +115,105 @@ namespace Tnb.QcMgr
|
||||
Expression<Func<QcCheckExecHOut, object>> expression = list.Where(p => p.FullName == "待执行").First().Id == status
|
||||
? (a => DateTime.Parse(a.tasktime!))
|
||||
: (a => DateTime.Parse(a.exectime!));
|
||||
SqlSugarPagedList<QcCheckExecHOut> result = await db.Queryable<QcCheckExecH>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.materialid == b.id)
|
||||
.LeftJoin<BasProcess>((a, b, c) => a.processid == c.id)
|
||||
.LeftJoin<OrganizeEntity>((a, b, c, d) => a.workid == d.Id)
|
||||
.LeftJoin<UserEntity>((a, b, c, d, e) => a.execuser == e.Id)
|
||||
.LeftJoin<PrdMoTask>((a,b,c,d,e,f)=>a.mo_task_code==f.mo_task_code)
|
||||
.LeftJoin<EqpEquipment>((a,b,c,d,e,f,g)=>f.eqp_id==g.id)
|
||||
.LeftJoin<OrganizeEntity>((a,b,c,d,e,f,g,h)=>d.OrganizeIdTree.Contains(h.Id) && h.Category == DictConst.RegionCategoryWorkshopCode)
|
||||
.LeftJoin<PositionEntity>((a,b,c,d,e,f,g,h,i)=>h.Id==i.OrganizeId)
|
||||
.WhereIF(_userManager.LoginType=="app" && !_userManager.IsAdministrator,(a,b,c,d,e,f,g,h,i)=>i.EnCode==positionCode)
|
||||
.WhereIF(!string.IsNullOrEmpty(materialid), (a, b, c, d, e) => a.materialid == materialid)
|
||||
.WhereIF(!string.IsNullOrEmpty(checktype), (a, b, c, d, e) => a.checktype == checktype)
|
||||
.WhereIF(!string.IsNullOrEmpty(status), (a, b, c, d, e) => a.status == status)
|
||||
// .Where((a, b, c, d, e) => a.status == list.Where(p => p.FullName == "已完成").First().Id)
|
||||
.Select((a, b, c, d, e,f,g) => new QcCheckExecHOut
|
||||
{
|
||||
id = a.id,
|
||||
bill_code = a.bill_code,
|
||||
materialid = b.name,
|
||||
checktype = a.checktype,
|
||||
workid = d.FullName,
|
||||
processid = c.process_name,
|
||||
wareid = a.wareid,
|
||||
checknum = a.checknum,
|
||||
status = a.status,
|
||||
result = a.result,
|
||||
tasktime = a.tasktime ?? "",
|
||||
exectime = a.exectime ?? "",
|
||||
execuser = e.RealName ?? "",
|
||||
equip_name = g.name,
|
||||
}).OrderByDescending(expression).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
var result = new SqlSugarPagedList<QcCheckExecHOut>();
|
||||
if (_userManager.IsAdministrator)
|
||||
{
|
||||
result = await db.Queryable<QcCheckExecH>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.materialid == b.id)
|
||||
.LeftJoin<BasProcess>((a, b, c) => a.processid == c.id)
|
||||
.LeftJoin<OrganizeEntity>((a, b, c, d) => a.workid == d.Id)
|
||||
.LeftJoin<UserEntity>((a, b, c, d, e) => a.execuser == e.Id)
|
||||
.LeftJoin<PrdMoTask>((a, b, c, d, e, f) => a.mo_task_code == f.mo_task_code)
|
||||
.LeftJoin<EqpEquipment>((a, b, c, d, e, f, g) => f.eqp_id == g.id)
|
||||
.WhereIF(!string.IsNullOrEmpty(materialid), (a, b, c, d, e) => a.materialid == materialid)
|
||||
.WhereIF(!string.IsNullOrEmpty(checktype), (a, b, c, d, e) => a.checktype == checktype)
|
||||
.WhereIF(!string.IsNullOrEmpty(status), (a, b, c, d, e) => a.status == status)
|
||||
// .Where((a, b, c, d, e) => a.status == list.Where(p => p.FullName == "已完成").First().Id)
|
||||
.Select((a, b, c, d, e, f, g) => new QcCheckExecHOut
|
||||
{
|
||||
id = a.id,
|
||||
bill_code = a.bill_code,
|
||||
materialid = b.name,
|
||||
checktype = a.checktype,
|
||||
workid = d.FullName,
|
||||
processid = c.process_name,
|
||||
wareid = a.wareid,
|
||||
checknum = a.checknum,
|
||||
status = a.status,
|
||||
result = a.result,
|
||||
tasktime = a.tasktime ?? "",
|
||||
exectime = a.exectime ?? "",
|
||||
execuser = e.RealName ?? "",
|
||||
equip_name = g.name,
|
||||
}).OrderByDescending(expression).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await db.Queryable<QcCheckExecH>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.materialid == b.id)
|
||||
.LeftJoin<BasProcess>((a, b, c) => a.processid == c.id)
|
||||
.LeftJoin<OrganizeEntity>((a, b, c, d) => a.workid == d.Id)
|
||||
.LeftJoin<UserEntity>((a, b, c, d, e) => a.execuser == e.Id)
|
||||
.LeftJoin<PrdMoTask>((a, b, c, d, e, f) => a.mo_task_code == f.mo_task_code)
|
||||
.LeftJoin<EqpEquipment>((a, b, c, d, e, f, g) => f.eqp_id == g.id)
|
||||
.LeftJoin<OrganizeEntity>((a, b, c, d, e, f, g, h) => d.OrganizeIdTree.Contains(h.Id) && h.Category == DictConst.RegionCategoryWorkshopCode)
|
||||
.LeftJoin<PositionEntity>((a, b, c, d, e, f, g, h, i) => h.Id == i.OrganizeId)
|
||||
.WhereIF(_userManager.LoginType == "app" && !_userManager.IsAdministrator, (a, b, c, d, e, f, g, h, i) => i.EnCode == positionCode)
|
||||
.WhereIF(!string.IsNullOrEmpty(materialid), (a, b, c, d, e) => a.materialid == materialid)
|
||||
.WhereIF(!string.IsNullOrEmpty(checktype), (a, b, c, d, e) => a.checktype == checktype)
|
||||
.WhereIF(!string.IsNullOrEmpty(status), (a, b, c, d, e) => a.status == status)
|
||||
// .Where((a, b, c, d, e) => a.status == list.Where(p => p.FullName == "已完成").First().Id)
|
||||
.Select((a, b, c, d, e, f, g) => new QcCheckExecHOut
|
||||
{
|
||||
id = a.id,
|
||||
bill_code = a.bill_code,
|
||||
materialid = b.name,
|
||||
checktype = a.checktype,
|
||||
workid = d.FullName,
|
||||
processid = c.process_name,
|
||||
wareid = a.wareid,
|
||||
checknum = a.checknum,
|
||||
status = a.status,
|
||||
result = a.result,
|
||||
tasktime = a.tasktime ?? "",
|
||||
exectime = a.exectime ?? "",
|
||||
execuser = e.RealName ?? "",
|
||||
equip_name = g.name,
|
||||
}).OrderByDescending(expression).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
}
|
||||
|
||||
//SqlSugarPagedList<QcCheckExecHOut> result = await db.Queryable<QcCheckExecH>()
|
||||
// .LeftJoin<BasMaterial>((a, b) => a.materialid == b.id)
|
||||
// .LeftJoin<BasProcess>((a, b, c) => a.processid == c.id)
|
||||
// .LeftJoin<OrganizeEntity>((a, b, c, d) => a.workid == d.Id)
|
||||
// .LeftJoin<UserEntity>((a, b, c, d, e) => a.execuser == e.Id)
|
||||
// .LeftJoin<PrdMoTask>((a,b,c,d,e,f)=>a.mo_task_code==f.mo_task_code)
|
||||
// .LeftJoin<EqpEquipment>((a,b,c,d,e,f,g)=>f.eqp_id==g.id)
|
||||
// .LeftJoin<OrganizeEntity>((a,b,c,d,e,f,g,h)=>d.OrganizeIdTree.Contains(h.Id) && h.Category == DictConst.RegionCategoryWorkshopCode)
|
||||
// .LeftJoin<PositionEntity>((a,b,c,d,e,f,g,h,i)=>h.Id==i.OrganizeId)
|
||||
// .WhereIF(_userManager.LoginType=="app" && !_userManager.IsAdministrator,(a,b,c,d,e,f,g,h,i)=>i.EnCode==positionCode)
|
||||
// .WhereIF(!string.IsNullOrEmpty(materialid), (a, b, c, d, e) => a.materialid == materialid)
|
||||
// .WhereIF(!string.IsNullOrEmpty(checktype), (a, b, c, d, e) => a.checktype == checktype)
|
||||
// .WhereIF(!string.IsNullOrEmpty(status), (a, b, c, d, e) => a.status == status)
|
||||
// // .Where((a, b, c, d, e) => a.status == list.Where(p => p.FullName == "已完成").First().Id)
|
||||
// .Select((a, b, c, d, e,f,g) => new QcCheckExecHOut
|
||||
// {
|
||||
// id = a.id,
|
||||
// bill_code = a.bill_code,
|
||||
// materialid = b.name,
|
||||
// checktype = a.checktype,
|
||||
// workid = d.FullName,
|
||||
// processid = c.process_name,
|
||||
// wareid = a.wareid,
|
||||
// checknum = a.checknum,
|
||||
// status = a.status,
|
||||
// result = a.result,
|
||||
// tasktime = a.tasktime ?? "",
|
||||
// exectime = a.exectime ?? "",
|
||||
// execuser = e.RealName ?? "",
|
||||
// equip_name = g.name,
|
||||
// }).OrderByDescending(expression).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
foreach (QcCheckExecHOut? item in result.list)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user