Commit 63248a44 authored by liudong1993's avatar liudong1993

OKR权限调整

parent 00ebecb4
......@@ -1355,6 +1355,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
foreach (var qitem in item.KeyResultList)
{
qitem.IsLock = 2;
......@@ -1400,6 +1411,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (qitem.IsDefaultPermission == 2)
{
qitem.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
qitem.IsNotLook = 1;
}
}
}
}
}
foreach (var item in xdqlist)
......@@ -1448,6 +1470,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
foreach (var qitem in item.KeyResultList)
{
qitem.IsLock = 2;
......@@ -1493,6 +1526,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (qitem.IsDefaultPermission == 2)
{
qitem.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
qitem.IsNotLook = 1;
}
}
}
}
}
foreach (var item in list)
......@@ -1664,6 +1708,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
List<int> MyUnderlingList = GetMyUnderlingUserIdList(userInfo);
if (!MyUnderlingList.Contains(userId))
{
var pplist = oKR_PeriodPermissionRepository.GetList(new Model.Entity.OKR.RB_OKR_PeriodPermission() { Group_Id = userInfo.Group_Id, PeriodId = PeriodId, CreateBy = userId });
//查询是否有权限
var zpList = oKR_PermissionRepository.GetList(new RB_OKR_Permission_ViewModel() { Group_Id = userInfo.Group_Id, PermissionType = 1, TargetId = PeriodId, CreateBy = userId });
if (zpList.Any())
......@@ -1698,7 +1743,6 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
};
}
}
var pplist = oKR_PeriodPermissionRepository.GetList(new Model.Entity.OKR.RB_OKR_PeriodPermission() { Group_Id = userInfo.Group_Id, PeriodId = PeriodId, CreateBy = userId });
if (LookList.Any() && pplist.Any())
{
if (LookList.Where(x => x.Type == Common.Enum.OKR.PermissionTypeEnum.Employee && x.SourceId == userInfo.Id).Any()
......@@ -1717,6 +1761,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (pplist.Any())
{
return new
{
Status = 2,
Msg = "没有权限查询"
};
}
}
}
var list = oKR_ObjectiveRepository.GetList(new RB_OKR_Objective_ViewModel() { Group_Id = userInfo.Group_Id, PeriodId = PeriodId, CreateBy = userId, Status = 2 });
if (list.Any())
......@@ -1800,6 +1855,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
foreach (var qitem in item.KeyResultList)
{
qitem.IsLock = 2;
......@@ -1845,6 +1911,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (qitem.IsDefaultPermission == 2)
{
qitem.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
qitem.IsNotLook = 1;
}
}
}
}
}
foreach (var item in xdqlist)
......@@ -1893,6 +1970,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
foreach (var qitem in item.KeyResultList)
{
qitem.IsLock = 2;
......@@ -1938,6 +2026,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (qitem.IsDefaultPermission == 2)
{
qitem.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
qitem.IsNotLook = 1;
}
}
}
}
}
foreach (var item in list)
......@@ -1986,6 +2085,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
foreach (var qitem in item.KeyResultList)
{
qitem.IsLock = 2;
......@@ -2031,6 +2141,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (qitem.IsDefaultPermission == 2)
{
qitem.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
qitem.IsNotLook = 1;
}
}
}
}
if (item.IsDefaultState == 1 && item.KeyResultList.Any())
{
......@@ -2183,6 +2304,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
List<int> MyUnderlingList = GetMyUnderlingUserIdList(userInfo);
if (!MyUnderlingList.Contains(userId))
{
var pplist = oKR_PeriodPermissionRepository.GetList(new Model.Entity.OKR.RB_OKR_PeriodPermission() { Group_Id = userInfo.Group_Id, PeriodId = PeriodId, CreateBy = userId });
//查询是否有权限
var zpList = oKR_PermissionRepository.GetList(new RB_OKR_Permission_ViewModel() { Group_Id = userInfo.Group_Id, PermissionType = 1, TargetId = PeriodId, CreateBy = userId });
if (zpList.Any())
......@@ -2217,7 +2339,6 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
};
}
}
var pplist = oKR_PeriodPermissionRepository.GetList(new Model.Entity.OKR.RB_OKR_PeriodPermission() { Group_Id = userInfo.Group_Id, PeriodId = PeriodId, CreateBy = userId });
if (LookList.Any() && pplist.Any())
{
if (LookList.Where(x => x.Type == Common.Enum.OKR.PermissionTypeEnum.Employee && x.SourceId == userInfo.Id).Any()
......@@ -2236,6 +2357,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (pplist.Any())
{
return new
{
Status = 2,
Msg = "没有权限查询"
};
}
}
}
var list = oKR_ObjectiveRepository.GetList(new RB_OKR_Objective_ViewModel() { Group_Id = userInfo.Group_Id, Id = objectiveId, PeriodId = PeriodId, CreateBy = userId, Status = 2 });
if (list.Any())
......@@ -2319,6 +2451,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
foreach (var qitem in item.KeyResultList)
{
qitem.IsLock = 2;
......@@ -2364,6 +2507,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (qitem.IsDefaultPermission == 2)
{
qitem.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
qitem.IsNotLook = 1;
}
}
}
}
}
foreach (var item in xdqlist)
......@@ -2412,6 +2566,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
foreach (var qitem in item.KeyResultList)
{
qitem.IsLock = 2;
......@@ -2457,6 +2622,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (qitem.IsDefaultPermission == 2)
{
qitem.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
qitem.IsNotLook = 1;
}
}
}
}
}
foreach (var item in list)
......@@ -2505,6 +2681,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
foreach (var qitem in item.KeyResultList)
{
qitem.IsLock = 2;
......@@ -2550,6 +2737,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (qitem.IsDefaultPermission == 2)
{
qitem.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
qitem.IsNotLook = 1;
}
}
}
}
if (item.IsDefaultState == 1 && item.KeyResultList.Any())
{
......@@ -2925,6 +3123,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
List<int> MyUnderlingList = GetMyUnderlingUserIdList(userInfo);
if (!MyUnderlingList.Contains(userId))
{
var pplist = oKR_PeriodPermissionRepository.GetList(new Model.Entity.OKR.RB_OKR_PeriodPermission() { Group_Id = userInfo.Group_Id, PeriodId = periodId, CreateBy = userId });
//查询是否有权限
var zpList = oKR_PermissionRepository.GetList(new RB_OKR_Permission_ViewModel() { Group_Id = userInfo.Group_Id, PermissionType = 1, TargetId = periodId, CreateBy = userId });
if (zpList.Any())
......@@ -2959,7 +3158,6 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
};
}
}
var pplist = oKR_PeriodPermissionRepository.GetList(new Model.Entity.OKR.RB_OKR_PeriodPermission() { Group_Id = userInfo.Group_Id, PeriodId = periodId, CreateBy = userId });
if (LookList.Any() && pplist.Any())
{
if (LookList.Where(x => x.Type == Common.Enum.OKR.PermissionTypeEnum.Employee && x.SourceId == userInfo.Id).Any()
......@@ -2978,6 +3176,15 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else {
if (pplist.Any()) {
return new
{
Status = 2,
Msg = "没有权限查询"
};
}
}
}
var list = oKR_ObjectiveRepository.GetList(new RB_OKR_Objective_ViewModel() { Group_Id = userInfo.Group_Id, PeriodId = periodId, CreateBy = userId, Status = 2 });
if (list.Any())
......@@ -3043,6 +3250,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
foreach (var qitem in item.KeyResultList)
{
qitem.IsLock = 2;
......@@ -3088,6 +3306,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (qitem.IsDefaultPermission == 2)
{
qitem.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
qitem.IsNotLook = 1;
}
}
}
}
if (item.IsDefaultState == 1 && item.KeyResultList.Any())
{
......@@ -3223,6 +3452,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
foreach (var qitem in item.KeyResultList)
{
qitem.IsLock = 2;
......@@ -3268,6 +3508,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (qitem.IsDefaultPermission == 2)
{
qitem.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
qitem.IsNotLook = 1;
}
}
}
}
}
foreach (var item in xdqlist)
......@@ -3316,6 +3567,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
foreach (var qitem in item.KeyResultList)
{
qitem.IsLock = 2;
......@@ -3361,6 +3623,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (qitem.IsDefaultPermission == 2)
{
qitem.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
qitem.IsNotLook = 1;
}
}
}
}
}
foreach (var item in list)
......@@ -4874,7 +5147,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
var postList = new List<Model.ViewModel.User.RB_Post_ViewModel>();
if (!string.IsNullOrEmpty(gids))
{
postRepository.GetPostListRepository(new Model.ViewModel.User.RB_Post_ViewModel() { QPostIds = gids });
postList = postRepository.GetPostListRepository(new Model.ViewModel.User.RB_Post_ViewModel() { QPostIds = gids });
}
foreach (var item in list)
......@@ -6231,6 +6504,8 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
foreach (var UserId in DQUserId)
{
int IsLook = 2;
if (zpList.Where(x => x.CreateBy == UserId).Any())
{
var NotLookList = zpList.Where(x => x.CreateBy == UserId && x.State == 2).ToList();
var LookList = zpList.Where(x => x.CreateBy == UserId && x.State == 1).ToList();
if (NotLookList.Any())
......@@ -6262,6 +6537,12 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
IsLook = 1;
}
}
}
else {
if (pplist.Where(x => x.CreateBy == UserId).Any()) {
IsLook = 1;
}
}
UserLookList.Add(new RB_OKR_Objective_ViewModel()
{
CreateBy = UserId,
......@@ -6329,6 +6610,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
}
foreach (var item in xdqlist)
{
......@@ -6389,6 +6681,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
}
foreach (var item in list)
......@@ -6500,6 +6803,8 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
foreach (var UserId in DQUserId)
{
int IsLook = 2;
if (zpList.Where(x => x.CreateBy == UserId).Any())
{
var NotLookList = zpList.Where(x => x.CreateBy == UserId && x.State == 2).ToList();
var LookList = zpList.Where(x => x.CreateBy == UserId && x.State == 1).ToList();
if (NotLookList.Any())
......@@ -6531,6 +6836,12 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
IsLook = 1;
}
}
}
else {
if (pplist.Where(x => x.CreateBy == UserId).Any()) {
IsLook = 1;
}
}
UserLookList.Add(new RB_OKR_Objective_ViewModel()
{
CreateBy = UserId,
......@@ -6598,6 +6909,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
}
return sdqlist.Select(y => new
......@@ -6659,6 +6981,8 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
foreach (var UserId in DQUserId)
{
int IsLook = 2;
if (zpList.Where(x => x.CreateBy == UserId).Any())
{
var NotLookList = zpList.Where(x => x.CreateBy == UserId && x.State == 2).ToList();
var LookList = zpList.Where(x => x.CreateBy == UserId && x.State == 1).ToList();
if (NotLookList.Any())
......@@ -6690,6 +7014,12 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
IsLook = 1;
}
}
}
else {
if (pplist.Where(x => x.CreateBy == UserId).Any()) {
IsLook = 1;
}
}
UserLookList.Add(new RB_OKR_Objective_ViewModel()
{
CreateBy = UserId,
......@@ -6757,6 +7087,17 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
}
}
else
{
if (item.IsDefaultPermission == 2)
{
item.IsLock = 1;
if (!MyUnderlingList.Contains(item.CreateBy))
{
item.IsNotLook = 1;
}
}
}
}
return xdqlist.Select(y => new
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment