组员任务优惠

Insight
陈伟 2024-11-21 15:03:17 +08:00
parent 4fb579e3b7
commit 10037b4f7a
2 changed files with 17 additions and 10 deletions

View File

@ -30,21 +30,27 @@ public class PersonTaskApp : SqlSugarBaseApp<InsTask, SugarDbContext>
throw new Exception("登录失效");
}
List<string> userIds;
if (string.IsNullOrEmpty(req.UserId))
{
userIds = await Repository.ChangeRepository<SugarRepositiry<SysGroup>>()
.AsQueryable().InnerJoin<SysGroupuser>((a, b) => a.Id == b.GroupId)
.Where(a => a.GroupLeaderId == userId)
.Select((a, b) => b.UserId)
.ToListAsync();
}
else
{
userIds = new List<string>(1) { userId };
}
var userIds = await Repository.ChangeRepository<SugarRepositiry<SysGroup>>()
.AsQueryable().InnerJoin<SysGroupuser>((a, b) => a.Id == b.GroupId)
.Where(a => a.GroupLeaderId == userId)
.Select((a, b) => b.UserId)
.ToListAsync();
userIds.Add(userId);
RefAsync<int> total = 0;
var result = await Repository.AsQueryable()
.RightJoin<InsTaskgroup>((a, b) => a.Id == b.TaskId)
.Where((a, b) => userIds.Contains(b.ReciveUserId))
.WhereIF(!string.IsNullOrEmpty(req.key),(a,b)=>a.TaskName.Contains(req.key))
.OrderBy((a,b)=> b.CreateTime,OrderByType.Desc)
.WhereIF(!string.IsNullOrEmpty(req.key), (a, b) => a.TaskName.Contains(req.key))
.OrderBy((a, b) => b.CreateTime, OrderByType.Desc)
.Select((a, b) => new InsTaskExtend
{
RowNumber = SqlSugar.SqlFunc.RowNumber(b.Id),
@ -84,7 +90,7 @@ public class PersonTaskApp : SqlSugarBaseApp<InsTask, SugarDbContext>
.RightJoin<InsTaskgroup>((a, b) => a.Id == b.TaskId)
.InnerJoin<InsAishp>((a, b, c) => a.ShpId == c.Id)
.Where((a, b) => b.Id == taskGroupId)
.Select((a, b,c) => new InsTaskExtend
.Select((a, b, c) => new InsTaskExtend
{
TaskName = a.TaskName, // 任务名称
GroupName = b.GroupName, // 任务分组包

View File

@ -4,4 +4,5 @@ namespace OpenAuth.App.ServiceApp.Task.Request;
public class PersonTaskQuery : PageReq
{
public string UserId { get; set; }
}