PDA质检任务数据重复显示bug;载具规格为外协料架-退至二楼暂存仓

This commit is contained in:
2024-11-05 10:26:07 +08:00
parent 1f6bb00f25
commit 1e3d54ba5e
3 changed files with 109 additions and 32 deletions

View File

@@ -115,37 +115,105 @@ namespace Tnb.QcMgr
Expression<Func<QcCheckExecHOut, object>> expression = list.Where(p => p.FullName == "待执行").First().Id == status Expression<Func<QcCheckExecHOut, object>> expression = list.Where(p => p.FullName == "待执行").First().Id == status
? (a => DateTime.Parse(a.tasktime!)) ? (a => DateTime.Parse(a.tasktime!))
: (a => DateTime.Parse(a.exectime!)); : (a => DateTime.Parse(a.exectime!));
SqlSugarPagedList<QcCheckExecHOut> result = await db.Queryable<QcCheckExecH>()
.LeftJoin<BasMaterial>((a, b) => a.materialid == b.id) var result = new SqlSugarPagedList<QcCheckExecHOut>();
.LeftJoin<BasProcess>((a, b, c) => a.processid == c.id) if (_userManager.IsAdministrator)
.LeftJoin<OrganizeEntity>((a, b, c, d) => a.workid == d.Id) {
.LeftJoin<UserEntity>((a, b, c, d, e) => a.execuser == e.Id) result = await db.Queryable<QcCheckExecH>()
.LeftJoin<PrdMoTask>((a,b,c,d,e,f)=>a.mo_task_code==f.mo_task_code) .LeftJoin<BasMaterial>((a, b) => a.materialid == b.id)
.LeftJoin<EqpEquipment>((a,b,c,d,e,f,g)=>f.eqp_id==g.id) .LeftJoin<BasProcess>((a, b, c) => a.processid == c.id)
.LeftJoin<OrganizeEntity>((a,b,c,d,e,f,g,h)=>d.OrganizeIdTree.Contains(h.Id) && h.Category == DictConst.RegionCategoryWorkshopCode) .LeftJoin<OrganizeEntity>((a, b, c, d) => a.workid == d.Id)
.LeftJoin<PositionEntity>((a,b,c,d,e,f,g,h,i)=>h.Id==i.OrganizeId) .LeftJoin<UserEntity>((a, b, c, d, e) => a.execuser == e.Id)
.WhereIF(_userManager.LoginType=="app" && !_userManager.IsAdministrator,(a,b,c,d,e,f,g,h,i)=>i.EnCode==positionCode) .LeftJoin<PrdMoTask>((a, b, c, d, e, f) => a.mo_task_code == f.mo_task_code)
.WhereIF(!string.IsNullOrEmpty(materialid), (a, b, c, d, e) => a.materialid == materialid) .LeftJoin<EqpEquipment>((a, b, c, d, e, f, g) => f.eqp_id == g.id)
.WhereIF(!string.IsNullOrEmpty(checktype), (a, b, c, d, e) => a.checktype == checktype) .WhereIF(!string.IsNullOrEmpty(materialid), (a, b, c, d, e) => a.materialid == materialid)
.WhereIF(!string.IsNullOrEmpty(status), (a, b, c, d, e) => a.status == status) .WhereIF(!string.IsNullOrEmpty(checktype), (a, b, c, d, e) => a.checktype == checktype)
// .Where((a, b, c, d, e) => a.status == list.Where(p => p.FullName == "已完成").First().Id) .WhereIF(!string.IsNullOrEmpty(status), (a, b, c, d, e) => a.status == status)
.Select((a, b, c, d, e,f,g) => new QcCheckExecHOut // .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, id = a.id,
materialid = b.name, bill_code = a.bill_code,
checktype = a.checktype, materialid = b.name,
workid = d.FullName, checktype = a.checktype,
processid = c.process_name, workid = d.FullName,
wareid = a.wareid, processid = c.process_name,
checknum = a.checknum, wareid = a.wareid,
status = a.status, checknum = a.checknum,
result = a.result, status = a.status,
tasktime = a.tasktime ?? "", result = a.result,
exectime = a.exectime ?? "", tasktime = a.tasktime ?? "",
execuser = e.RealName ?? "", exectime = a.exectime ?? "",
equip_name = g.name, execuser = e.RealName ?? "",
}).OrderByDescending(expression).ToPagedListAsync(input.currentPage, input.pageSize); 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) foreach (QcCheckExecHOut? item in result.list)
{ {

View File

@@ -421,6 +421,10 @@ namespace Tnb.WarehouseMgr.Entities.Consts
/// 预任务生成业务类型-盘点出库 /// 预任务生成业务类型-盘点出库
/// </summary> /// </summary>
public const string BIZTYPE_WMSCHECKOUTSTOCK_ID = "27718132310037"; public const string BIZTYPE_WMSCHECKOUTSTOCK_ID = "27718132310037";
/// <summary>
/// 预任务生成业务类型-暂控料出库
/// </summary>
public const string BIZTYPE_TEMPCONTROLOUTSTOCK_ID = "38027183728661";
/// <summary> /// <summary>
/// 成品调拨入库 /// 成品调拨入库
@@ -470,6 +474,11 @@ namespace Tnb.WarehouseMgr.Entities.Consts
/// 载具规格-载运料架 /// 载具规格-载运料架
/// </summary> /// </summary>
public const string CARRY_ZYLJSTD_ID = "34995839046677"; public const string CARRY_ZYLJSTD_ID = "34995839046677";
/// <summary>
/// 载具规格-外协料架
/// </summary>
public const string CARRY_WXLJSTD_ID = "37896162328597";
/// <summary> /// <summary>
/// 打印状态-未打印 /// 打印状态-未打印
/// </summary> /// </summary>

View File

@@ -2386,7 +2386,7 @@ namespace Tnb.WarehouseMgr
} }
// 料架到暂存仓 // 料架到暂存仓
if (wmsCarryH.carrystd_id == "26037267399717") if (wmsCarryH.carrystd_id == "26037267399717" || wmsCarryH.carrystd_id==WmsWareHouseConst.CARRY_WXLJSTD_ID)
{ {
return await RackInstock_到暂存仓(input, wmsCarryH); return await RackInstock_到暂存仓(input, wmsCarryH);
} }