diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs index c939e7da..1279ce90 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs @@ -448,6 +448,23 @@ namespace Tnb.ProductionMgr //模具部门的人 List moldUserIds = await _db.Queryable().Where(x=>x.ObjectId=="35792898276629").Select(x=>x.UserId).ToListAsync(); + //是否 注塑领班 车间主任 注塑主管 车间统计员 计划专员 岗位 + bool isPosition = false; + List positionIds = await _db.Queryable().Where(x=>x.ObjectType=="Position" && x.UserId==userId).Select(x=>x.ObjectId).ToListAsync(); + List position = new List() { "36384895704085", "33530523354645", "36384903950101", "36384884923925", "36384877722901" }; + if (positionIds != null && !positionIds.IsEmpty()) + { + foreach (var item in positionIds) + { + if (position.Contains(item)) + { + isPosition = true; + break; + } + + } + } + SqlSugarPagedList result = await _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) .LeftJoin((a, b, c) => a.process_id == c.id) @@ -471,6 +488,7 @@ namespace Tnb.ProductionMgr .WhereIF(status == "3" && end_time != null, a => a.act_end_date <= end_time) .WhereIF(!_userManager.IsAdministrator,(a, b, c, d, e, f, g, h, j, k, l)=>(d.ManagerId==userId) || (j.mo_type==DictConst.PrdMoTypeBZ && !SqlFunc.IsNullOrEmpty(userWorklineId) && a.workline_id==userWorklineId) + || (j.mo_type==DictConst.PrdMoTypeZS && isPosition) || (a.schedule_type==1 && a.mo_task_status==DictConst.ToBeStartedEnCode && moldUserIds.Contains(userId)) || (a.scheduling_class_type=="1" && twoDayFlag && a.dayshift_worker_id==userId) || (a.scheduling_class_type=="1" && twoNightFlag && a.nightshift_worker_id==userId)