|
@@ -2050,7 +2050,7 @@ namespace OASystem.API.Controllers
|
|
|
/// <param name="date"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet]
|
|
|
- public IActionResult GetPerformanceList(int userid,string date)
|
|
|
+ public IActionResult GetPerformanceList(int userid,string date, int loginUser)
|
|
|
{
|
|
|
var jw = JsonView(false);
|
|
|
|
|
@@ -2142,7 +2142,11 @@ OPTION (MAXRECURSION 0); -- 允许无限递归 ";
|
|
|
var rootNodeList = List.Where(x => x.ParentId == 0);
|
|
|
var rootResult = rootNodeList.Select(x => BuildSubTree(x, List));
|
|
|
|
|
|
- jw.Data = rootResult;
|
|
|
+ jw.Data = new
|
|
|
+ {
|
|
|
+ Root = rootResult,
|
|
|
+ IsLeader = IsLeader(userid,loginUser)
|
|
|
+ };
|
|
|
jw.Code = 200;
|
|
|
jw.Msg = "成功";
|
|
|
|
|
@@ -2360,6 +2364,16 @@ OPTION (MAXRECURSION 0); -- 允许无限递归 ";
|
|
|
.And(x => ids.Contains(x.AssessmentContentSettingId))
|
|
|
.And(x => x.HigherUpConfig == 0)
|
|
|
.ToExpression();
|
|
|
+
|
|
|
+ if (IsLeader(dto.AssessmenUserId, dto.CreateUserId))
|
|
|
+ {
|
|
|
+ expressionWhere = Expressionable
|
|
|
+ .Create<Per_AssessmentScore>()
|
|
|
+ .And(x => x.YearMonth.Year == yearMonth_Dt.Year && x.YearMonth.Month == yearMonth_Dt.Month)
|
|
|
+ .And(x => ids.Contains(x.AssessmentContentSettingId))
|
|
|
+ .ToExpression();
|
|
|
+ }
|
|
|
+
|
|
|
_sqlSugar.BeginTran();
|
|
|
_sqlSugar.Updateable<Per_AssessmentScore>()
|
|
|
.Where(expressionWhere)
|
|
@@ -2471,6 +2485,21 @@ OPTION (MAXRECURSION 0); -- 允许无限递归 ";
|
|
|
return Ok(jw);
|
|
|
}
|
|
|
|
|
|
+ private bool IsLeader(int userId, int higherUserId)
|
|
|
+ {
|
|
|
+ Dictionary <int,List<int>> keyValues = new Dictionary<int, List<int>>()
|
|
|
+ {
|
|
|
+ { 5 , new List<int>{ 258 , 235, 234, 233, 208 } }
|
|
|
+ };
|
|
|
+
|
|
|
+ if (keyValues.ContainsKey(userId))
|
|
|
+ {
|
|
|
+ return keyValues[userId].Contains(higherUserId);
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 企微Api测试
|