Commit 785f5bb7 authored by 吴春's avatar 吴春

解决冲突

parents 9b0142f1 63284792
...@@ -345,6 +345,16 @@ namespace Edu.Common ...@@ -345,6 +345,16 @@ namespace Edu.Common
} }
} }
/// <summary>
/// okr关注事项配置
/// </summary>
public static string OKRMatterValue {
get
{
return ReadConfigKey("OKRMatterValue");
}
}
/// <summary> /// <summary>
/// 分区校长岗位编号 /// 分区校长岗位编号
/// </summary> /// </summary>
......
...@@ -13,19 +13,19 @@ namespace Edu.Common.Enum.OKR ...@@ -13,19 +13,19 @@ namespace Edu.Common.Enum.OKR
/// <summary> /// <summary>
/// 未填写OKR /// 未填写OKR
/// </summary> /// </summary>
[EnumField("未填写OKR")] [EnumField("请提醒 Ta 们尽快填写,避免重点工作实施受到影响")]
NotFilled = 1, NotFilled = 1,
/// <summary> /// <summary>
/// 有OKR未更新进度 /// 有OKR未更新进度
/// </summary> /// </summary>
[EnumField("有OKR未更新进度")] [EnumField("请提醒 Ta 及时更新,对 OKR 结果进行复盘")]
NotUpdated = 2, NotUpdated = 2,
/// <summary> /// <summary>
/// 有OKR未打分 /// 有OKR未打分
/// </summary> /// </summary>
[EnumField("有OKR未打分")] [EnumField("请提醒 Ta 及时打分,对 OKR 结果进行复盘")]
NotScore = 3 NotScore = 3
} }
} }
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using Edu.Common.Enum.OKR;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.OKR
{
/// <summary>
/// okr关注事项实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_OKR_Matter
{
/// <summary>
/// id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 周期id
/// </summary>
public int PeriodId { get; set; }
/// <summary>
/// 类型 枚举列表
/// </summary>
public MatterTypeEnum Type { get; set; }
/// <summary>
/// 用户id
/// </summary>
public int UserId { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 集团id
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校id
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
}
}
...@@ -122,5 +122,10 @@ namespace Edu.Model.Entity.OKR ...@@ -122,5 +122,10 @@ namespace Edu.Model.Entity.OKR
/// 是否默认全部可见权限 1是 2否 /// 是否默认全部可见权限 1是 2否
/// </summary> /// </summary>
public int IsDefaultPermission { get; set; } public int IsDefaultPermission { get; set; }
/// <summary>
/// 是否更新过进度状态 1是
/// </summary>
public int IsUpdated { get; set; }
} }
} }
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.OKR
{
/// <summary>
/// okr进度更新记录实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_OKR_UpdateProgress
{
/// <summary>
/// id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 周期id
/// </summary>
public int PeriodId { get; set; }
/// <summary>
/// 用户id
/// </summary>
public int UserId { get; set; }
/// <summary>
/// 最后更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 集团id
/// </summary>
public int Group_Id { get; set; }
}
}
...@@ -102,6 +102,14 @@ namespace Edu.Module.OKR ...@@ -102,6 +102,14 @@ namespace Edu.Module.OKR
/// 周期默认所有人可见权限 /// 周期默认所有人可见权限
/// </summary> /// </summary>
private readonly RB_OKR_PeriodPermissionRepository oKR_PeriodPermissionRepository = new RB_OKR_PeriodPermissionRepository(); private readonly RB_OKR_PeriodPermissionRepository oKR_PeriodPermissionRepository = new RB_OKR_PeriodPermissionRepository();
/// <summary>
/// 关注事项
/// </summary>
private readonly RB_OKR_MatterRepository oKR_MatterRepository = new RB_OKR_MatterRepository();
/// <summary>
/// 用户最后更新进度时间
/// </summary>
private readonly RB_OKR_UpdateProgressRepository oKR_UpdateProgressRepository = new RB_OKR_UpdateProgressRepository();
#region 基础配置 #region 基础配置
...@@ -3285,6 +3293,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -3285,6 +3293,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
dmodel.UpdateBy = userInfo.Id; dmodel.UpdateBy = userInfo.Id;
dmodel.UpdateTime = DateTime.Now; dmodel.UpdateTime = DateTime.Now;
dmodel.IsDefaultPermission = 1; dmodel.IsDefaultPermission = 1;
dmodel.IsUpdated = 2;
int Id = oKR_ObjectiveRepository.Insert(dmodel); int Id = oKR_ObjectiveRepository.Insert(dmodel);
ObjectiveId = Id; ObjectiveId = Id;
...@@ -3753,6 +3762,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -3753,6 +3762,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
if (type == 1) if (type == 1)
{ {
keyValues.Add(nameof(RB_OKR_Objective_ViewModel.IsDefaultState), 1); keyValues.Add(nameof(RB_OKR_Objective_ViewModel.IsDefaultState), 1);
keyValues.Add(nameof(RB_OKR_Objective_ViewModel.IsUpdated), 1);
keyValues.Add(nameof(RB_OKR_Objective_ViewModel.UpdateBy), userInfo.Id); keyValues.Add(nameof(RB_OKR_Objective_ViewModel.UpdateBy), userInfo.Id);
keyValues.Add(nameof(RB_OKR_Objective_ViewModel.UpdateTime), DateTime.Now); keyValues.Add(nameof(RB_OKR_Objective_ViewModel.UpdateTime), DateTime.Now);
LogContent = "修改OKR目标默认风险最高的 Key Result 状态【" + objectiveId + "】"; LogContent = "修改OKR目标默认风险最高的 Key Result 状态【" + objectiveId + "】";
...@@ -3761,6 +3771,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -3761,6 +3771,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
else if (type == 2) else if (type == 2)
{ {
keyValues.Add(nameof(RB_OKR_Objective_ViewModel.IsDefaultState), 2); keyValues.Add(nameof(RB_OKR_Objective_ViewModel.IsDefaultState), 2);
keyValues.Add(nameof(RB_OKR_Objective_ViewModel.IsUpdated), 1);
keyValues.Add(nameof(RB_OKR_Objective_ViewModel.ProgressState), progressState); keyValues.Add(nameof(RB_OKR_Objective_ViewModel.ProgressState), progressState);
keyValues.Add(nameof(RB_OKR_Objective_ViewModel.UpdateBy), userInfo.Id); keyValues.Add(nameof(RB_OKR_Objective_ViewModel.UpdateBy), userInfo.Id);
keyValues.Add(nameof(RB_OKR_Objective_ViewModel.UpdateTime), DateTime.Now); keyValues.Add(nameof(RB_OKR_Objective_ViewModel.UpdateTime), DateTime.Now);
...@@ -3788,6 +3799,10 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -3788,6 +3799,10 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
bool flag = oKR_ObjectiveRepository.Update(keyValues, wheres); bool flag = oKR_ObjectiveRepository.Update(keyValues, wheres);
if (flag) if (flag)
{ {
if (type == 1 || type == 2)
{
Task.Run(() => RecordUpdateProgress(0, objectiveId, userInfo.Group_Id, userInfo.Id));
}
changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog() changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog()
{ {
Id = 0, Id = 0,
...@@ -3857,6 +3872,23 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -3857,6 +3872,23 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
bool flag = oKR_KeyResultRepository.Update(keyValues, wheres); bool flag = oKR_KeyResultRepository.Update(keyValues, wheres);
if (flag) if (flag)
{ {
if (type == 1)
{
var kmodel = oKR_KeyResultRepository.GetEntity(keyResultId);
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_OKR_Objective_ViewModel.IsUpdated),1}
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_OKR_Objective_ViewModel.Id),
FiledValue=kmodel.ObjectiveId,
OperatorEnum=OperatorEnum.Equal
}
};
oKR_ObjectiveRepository.Update(keyValues1, wheres1);
//记录最后更新进度时间
Task.Run(() => RecordUpdateProgress(0, kmodel.ObjectiveId, userInfo.Group_Id, userInfo.Id));
}
changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog() changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog()
{ {
Id = 0, Id = 0,
...@@ -3919,7 +3951,8 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -3919,7 +3951,8 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
var list = oKR_KeyResultRepository.GetList(new RB_OKR_KeyResult_ViewModel() { Group_Id = userInfo.Group_Id, ObjectiveId = model.ObjectiveId }); var list = oKR_KeyResultRepository.GetList(new RB_OKR_KeyResult_ViewModel() { Group_Id = userInfo.Group_Id, ObjectiveId = model.ObjectiveId });
decimal TProgress = list.Sum(x => x.Progress * x.Weight / 100); decimal TProgress = list.Sum(x => x.Progress * x.Weight / 100);
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() { Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_OKR_Objective_ViewModel.Progress),(int)TProgress} { nameof(RB_OKR_Objective_ViewModel.Progress),(int)TProgress},
{ nameof(RB_OKR_Objective_ViewModel.IsUpdated),1}
}; };
List<WhereHelper> wheres1 = new List<WhereHelper>() { List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){ new WhereHelper(){
...@@ -3943,6 +3976,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -3943,6 +3976,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
SourceId = 0 SourceId = 0
}); });
} }
Task.Run(() => RecordUpdateProgress(0, keyResultId, userInfo.Group_Id, userInfo.Id));
return ApiResult.Success("", new return ApiResult.Success("", new
{ {
TProgress = (int)TProgress, TProgress = (int)TProgress,
...@@ -3977,7 +4011,8 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -3977,7 +4011,8 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
var list = oKR_KeyResultRepository.GetList(new RB_OKR_KeyResult_ViewModel() { Group_Id = userInfo.Group_Id, ObjectiveId = model.ObjectiveId }); var list = oKR_KeyResultRepository.GetList(new RB_OKR_KeyResult_ViewModel() { Group_Id = userInfo.Group_Id, ObjectiveId = model.ObjectiveId });
decimal TProgress = list.Sum(x => x.Progress * x.Weight / 100); decimal TProgress = list.Sum(x => x.Progress * x.Weight / 100);
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() { Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_OKR_Objective_ViewModel.Progress),(int)TProgress} { nameof(RB_OKR_Objective_ViewModel.Progress),(int)TProgress},
{ nameof(RB_OKR_Objective_ViewModel.IsUpdated),1}
}; };
List<WhereHelper> wheres1 = new List<WhereHelper>() { List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){ new WhereHelper(){
...@@ -4001,6 +4036,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -4001,6 +4036,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
SourceId = 0 SourceId = 0
}); });
} }
Task.Run(() => RecordUpdateProgress(0, model.ObjectiveId, userInfo.Group_Id, userInfo.Id));
return ApiResult.Success("", new return ApiResult.Success("", new
{ {
TProgress = (int)TProgress, TProgress = (int)TProgress,
...@@ -4015,6 +4051,50 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -4015,6 +4051,50 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
return ApiResult.Failed(); return ApiResult.Failed();
} }
/// <summary>
/// 记录最后更新进度时间
/// </summary>
/// <param name="v"></param>
/// <param name="keyResultId"></param>
/// <param name="group_Id"></param>
/// <param name="id"></param>
private void RecordUpdateProgress(int periodId, int objectiveId, int group_Id, int userId)
{
if (periodId == 0 && objectiveId > 0)
{
var model = oKR_ObjectiveRepository.GetEntity(objectiveId);
periodId = model?.PeriodId ?? 0;
}
if (periodId == 0) { return; }
var list = oKR_UpdateProgressRepository.GetList(new Model.Entity.OKR.RB_OKR_UpdateProgress() { Group_Id = group_Id, PeriodId = periodId, UserId = userId });
if (list.Any())
{
var model = list.FirstOrDefault();
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(Model.Entity.OKR.RB_OKR_UpdateProgress.UpdateTime),DateTime.Now}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(Model.Entity.OKR.RB_OKR_UpdateProgress.Id),
FiledValue=model.Id,
OperatorEnum=OperatorEnum.Equal
}
};
oKR_UpdateProgressRepository.Update(keyValues, wheres);
}
else
{
oKR_UpdateProgressRepository.Insert(new Model.Entity.OKR.RB_OKR_UpdateProgress()
{
Id = 0,
Group_Id = group_Id,
PeriodId = periodId,
UserId = userId,
UpdateTime = DateTime.Now
});
}
}
/// <summary> /// <summary>
/// 设置结果权重 /// 设置结果权重
/// </summary> /// </summary>
...@@ -7267,8 +7347,6 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7267,8 +7347,6 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
int StartV = Group[i]; int StartV = Group[i];
int EndV = -1; int EndV = -1;
ONum = objectiveNumList.Where(x => x.ObjectiveNum >= StartV).Count(); ONum = objectiveNumList.Where(x => x.ObjectiveNum >= StartV).Count();
if (ONum > 0)
{
ObjectiveNum.Add(new ObjectiveNum.Add(new
{ {
Start = StartV, Start = StartV,
...@@ -7276,7 +7354,6 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7276,7 +7354,6 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
Number = ONum Number = ONum
}); });
} }
}
else else
{ {
int StartV = Group[i]; int StartV = Group[i];
...@@ -7289,8 +7366,6 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7289,8 +7366,6 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
ONum = objectiveNumList.Where(x => x.ObjectiveNum >= StartV && x.ObjectiveNum <= EndV).Count(); ONum = objectiveNumList.Where(x => x.ObjectiveNum >= StartV && x.ObjectiveNum <= EndV).Count();
} }
if (ONum > 0)
{
ObjectiveNum.Add(new ObjectiveNum.Add(new
{ {
Start = StartV, Start = StartV,
...@@ -7299,10 +7374,15 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7299,10 +7374,15 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}); });
} }
} }
}
//查询目标状态 //查询目标状态
List<object> ObjectiveState = new List<object>(); List<object> ObjectiveState = new List<object>();
ObjectiveState.Add(new
{
ProgressState = 0,
Name = "未更新",
Number = olist.Where(x => x.IsUpdated != 1).Count()
});
var ProgressStateList = EnumHelper.EnumToList(typeof(Common.Enum.OKR.ProgressStateEnum)); var ProgressStateList = EnumHelper.EnumToList(typeof(Common.Enum.OKR.ProgressStateEnum));
foreach (var item in ProgressStateList) foreach (var item in ProgressStateList)
{ {
...@@ -7310,7 +7390,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7310,7 +7390,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
ProgressState = item.Id, ProgressState = item.Id,
item.Name, item.Name,
Number = olist.Where(x => x.ProgressState == (Common.Enum.OKR.ProgressStateEnum)item.Id).Count() Number = olist.Where(x => x.IsUpdated == 1 && x.ProgressState == (Common.Enum.OKR.ProgressStateEnum)item.Id).Count()
}); });
} }
...@@ -7325,16 +7405,13 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7325,16 +7405,13 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
int StartV = Progress[i]; int StartV = Progress[i];
int EndV = -1; int EndV = -1;
ONum = olist.Where(x => x.Progress >= StartV).Count(); ONum = olist.Where(x => x.Progress >= StartV).Count();
if (ONum > 0)
{
ObjectiveProgress.Add(new ObjectiveProgress.Add(new
{ {
Start = StartV, Start = StartV > 0 ? (StartV - 1) : StartV,
End = EndV, End = EndV,
Number = ONum Number = ONum
}); });
} }
}
else else
{ {
int StartV = Progress[i]; int StartV = Progress[i];
...@@ -7347,17 +7424,14 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7347,17 +7424,14 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
ONum = olist.Where(x => x.Progress >= StartV && x.Progress <= EndV).Count(); ONum = olist.Where(x => x.Progress >= StartV && x.Progress <= EndV).Count();
} }
if (ONum > 0)
{
ObjectiveProgress.Add(new ObjectiveProgress.Add(new
{ {
Start = StartV, Start = StartV > 0 ? (StartV - 1) : StartV,
End = EndV, End = EndV,
Number = ONum Number = ONum
}); });
} }
} }
}
//查询目标分数 //查询目标分数
List<object> ObjectiveScore = new List<object>(); List<object> ObjectiveScore = new List<object>();
...@@ -7370,16 +7444,14 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7370,16 +7444,14 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
decimal StartV = Convert.ToDecimal(Score[i]); decimal StartV = Convert.ToDecimal(Score[i]);
int EndV = -1; int EndV = -1;
ONum = olist.Where(x => x.Score >= StartV).Count(); ONum = olist.Where(x => x.Score >= StartV).Count();
if (ONum > 0) double StartV1 = Convert.ToDouble(StartV > 0 ? (StartV - Convert.ToDecimal(0.01)) : StartV);
{
ObjectiveScore.Add(new ObjectiveScore.Add(new
{ {
Start = StartV, Start = StartV1,
End = EndV, End = EndV,
Number = ONum Number = ONum
}); });
} }
}
else else
{ {
decimal StartV = Convert.ToDecimal(Score[i]); decimal StartV = Convert.ToDecimal(Score[i]);
...@@ -7392,17 +7464,15 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7392,17 +7464,15 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
ONum = olist.Where(x => x.Score >= StartV && x.Score <= EndV).Count(); ONum = olist.Where(x => x.Score >= StartV && x.Score <= EndV).Count();
} }
if (ONum > 0) double StartV1 = Convert.ToDouble(StartV > 0 ? (StartV - Convert.ToDecimal(0.01)) : StartV);
{
ObjectiveScore.Add(new ObjectiveScore.Add(new
{ {
Start = StartV, Start = StartV1,
End = EndV, End = EndV,
Number = ONum Number = ONum
}); });
} }
} }
}
return new return new
{ {
...@@ -7529,7 +7599,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7529,7 +7599,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
x.EmPhoto, x.EmPhoto,
x.DeptName, x.DeptName,
x.PostName, x.PostName,
ObjectiveNumList = new List<int>() { x.ObjectiveNum1, x.ObjectiveNum2, x.ObjectiveNum3 } ObjectiveNumList = new List<int>() { x.ObjectiveNum1, x.ObjectiveNum2, x.ObjectiveNum3, x.ObjectiveNum4 }
}); });
case 3: //进度 case 3: //进度
RList = oKR_ObjectiveRepository.GetObjectiveProgressPageList_V2(pageIndex, pageSize, out count, periodId, orderBy, orderByNum, userIds, userInfo.Group_Id); RList = oKR_ObjectiveRepository.GetObjectiveProgressPageList_V2(pageIndex, pageSize, out count, periodId, orderBy, orderByNum, userIds, userInfo.Group_Id);
...@@ -7633,15 +7703,11 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7633,15 +7703,11 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
rmodel.ObjectiveNum1, rmodel.ObjectiveNum1,
rmodel.ObjectiveNum2, rmodel.ObjectiveNum2,
rmodel.ObjectiveNum3 rmodel.ObjectiveNum3,
rmodel.ObjectiveNum4
}; };
if (type == 1) if (type == 3 || type == 4)
{
ObjectiveNumList.Add(rmodel.ObjectiveNum4);
}
else if (type == 3 || type == 4)
{ {
ObjectiveNumList.Add(rmodel.ObjectiveNum4);
ObjectiveNumList.Add(rmodel.ObjectiveNum5); ObjectiveNumList.Add(rmodel.ObjectiveNum5);
} }
Rlist.Add(new Rlist.Add(new
...@@ -7703,15 +7769,11 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7703,15 +7769,11 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
rmodel.ObjectiveNum1, rmodel.ObjectiveNum1,
rmodel.ObjectiveNum2, rmodel.ObjectiveNum2,
rmodel.ObjectiveNum3 rmodel.ObjectiveNum3,
rmodel.ObjectiveNum4
}; };
if (type == 1) if (type == 3 || type == 4)
{
ObjectiveNumList.Add(rmodel.ObjectiveNum4);
}
else if (type == 3 || type == 4)
{ {
ObjectiveNumList.Add(rmodel.ObjectiveNum4);
ObjectiveNumList.Add(rmodel.ObjectiveNum5); ObjectiveNumList.Add(rmodel.ObjectiveNum5);
} }
Rlist.Add(new Rlist.Add(new
...@@ -7775,15 +7837,11 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7775,15 +7837,11 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
rmodel.ObjectiveNum1, rmodel.ObjectiveNum1,
rmodel.ObjectiveNum2, rmodel.ObjectiveNum2,
rmodel.ObjectiveNum3 rmodel.ObjectiveNum3,
rmodel.ObjectiveNum4
}; };
if (type == 1) if (type == 3 || type == 4)
{
ObjectiveNumList.Add(rmodel.ObjectiveNum4);
}
else if (type == 3 || type == 4)
{ {
ObjectiveNumList.Add(rmodel.ObjectiveNum4);
ObjectiveNumList.Add(rmodel.ObjectiveNum5); ObjectiveNumList.Add(rmodel.ObjectiveNum5);
} }
Rlist.Add(new Rlist.Add(new
...@@ -7850,15 +7908,11 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7850,15 +7908,11 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
rmodel.ObjectiveNum1, rmodel.ObjectiveNum1,
rmodel.ObjectiveNum2, rmodel.ObjectiveNum2,
rmodel.ObjectiveNum3 rmodel.ObjectiveNum3,
rmodel.ObjectiveNum4
}; };
if (type == 1) if (type == 3 || type == 4)
{
ObjectiveNumList.Add(rmodel.ObjectiveNum4);
}
else if (type == 3 || type == 4)
{ {
ObjectiveNumList.Add(rmodel.ObjectiveNum4);
ObjectiveNumList.Add(rmodel.ObjectiveNum5); ObjectiveNumList.Add(rmodel.ObjectiveNum5);
} }
Rlist.Add(new Rlist.Add(new
...@@ -7912,15 +7966,11 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7912,15 +7966,11 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
rmodel.ObjectiveNum1, rmodel.ObjectiveNum1,
rmodel.ObjectiveNum2, rmodel.ObjectiveNum2,
rmodel.ObjectiveNum3 rmodel.ObjectiveNum3,
rmodel.ObjectiveNum4
}; };
if (type == 1) if (type == 3 || type == 4)
{ {
ObjectiveNumList.Add(rmodel.ObjectiveNum4);
}
else if (type == 3 || type == 4)
{
ObjectiveNumList.Add(rmodel.ObjectiveNum4);
ObjectiveNumList.Add(rmodel.ObjectiveNum5); ObjectiveNumList.Add(rmodel.ObjectiveNum5);
} }
Rlist.Add(new Rlist.Add(new
...@@ -7940,6 +7990,170 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7940,6 +7990,170 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
} }
return Rlist; return Rlist;
} }
/// <summary>
/// 获取关注事项统计
/// </summary>
/// <param name="periodId"></param>
/// <param name="departId"></param>
/// <param name="postId"></param>
/// <param name="leaveStatus"></param>
/// <param name="userInfo"></param>
/// <param name="v"></param>
/// <returns></returns>
public object GetOKRMatterList(int periodId, int departId, int postId, int leaveStatus, UserInfo userInfo, bool IsAdmin)
{
List<object> RList = new List<object>();
var pmodel = oKR_PeriodRepository.GetEntity(periodId);
if (pmodel == null) { return RList; }
int SDays = 0, EDays = 0;
if (DateTime.Now > pmodel.StartDate)
{
SDays = (DateTime.Now - pmodel.StartDate).Days;
}
if (DateTime.Now < pmodel.EndDate)
{
EDays = (pmodel.EndDate - DateTime.Now).Days;
}
int Num = 1;
var list = oKR_MatterRepository.GetList(new Model.Entity.OKR.RB_OKR_Matter() { Group_Id = userInfo.Group_Id, PeriodId = periodId, UserId = userInfo.Id });
if (IsAdmin == false)
{
var userIdList = GetMyUnderlingUserIdList(userInfo, departId, postId, leaveStatus);
if (userIdList.Any())
{
userIdList = userIdList.Distinct().ToList();
int TotalNum = userIdList.Count();
string userIds = string.Join(",", userIdList);
string OKRMatterValue = Common.Config.OKRMatterValue;
int SValue = 0, EValue = 0;
if (!string.IsNullOrEmpty(OKRMatterValue))
{
var matterArr = OKRMatterValue.Split(',');
SValue = Convert.ToInt32(matterArr[0]);
EValue = Convert.ToInt32(matterArr[1]);
}
if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.NotFilled).Any() && (SValue == 0 || (SValue > 0 && SDays >= SValue)))
{
//查询未填写
int Number = oKR_ObjectiveRepository.GetNotFilledList(userInfo.Group_Id, periodId, userIds);
RList.Add(new
{
Id = Num,
Days = SDays,
PeopleNum = TotalNum - Number,
Type = Common.Enum.OKR.MatterTypeEnum.NotFilled,
TypeName = Common.Enum.OKR.MatterTypeEnum.NotFilled.ToName()
});
Num++;
}
if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.NotUpdated).Any() && (EValue == 0 || (EValue > 0 && EDays <= EValue)))
{
//查询未更新
int Number = oKR_ObjectiveRepository.GetNotUpdatedList(userInfo.Group_Id, periodId, userIds);
RList.Add(new
{
Id = Num,
Days = EDays,
PeopleNum = Number,
Type = Common.Enum.OKR.MatterTypeEnum.NotUpdated,
TypeName = Common.Enum.OKR.MatterTypeEnum.NotUpdated.ToName()
});
Num++;
}
if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.NotScore).Any() && (EValue == 0 || (EValue > 0 && EDays <= EValue)))
{
//查询未打分
int Number = oKR_ObjectiveRepository.GetNotScoreList(userInfo.Group_Id, periodId, userIds);
RList.Add(new
{
Id = Num,
Days = EDays,
PeopleNum = Number,
Type = Common.Enum.OKR.MatterTypeEnum.NotScore,
TypeName = Common.Enum.OKR.MatterTypeEnum.NotScore.ToName()
});
Num++;
}
}
}
else
{
//管理端 主查询对齐率这些
}
return RList;
}
/// <summary>
/// 设置关注事项忽略
/// </summary>
/// <param name="periodId"></param>
/// <param name="type"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public bool SetOKRMatterIgnore(int periodId, int type, UserInfo userInfo)
{
var list = oKR_MatterRepository.GetList(new Model.Entity.OKR.RB_OKR_Matter() { Group_Id = userInfo.Group_Id, PeriodId = periodId, Type = (Common.Enum.OKR.MatterTypeEnum)type });
if (list.Any())
{
return true;
}
return oKR_MatterRepository.Insert(new Model.Entity.OKR.RB_OKR_Matter()
{
Id = 0,
PeriodId = periodId,
UserId = userInfo.Id,
Type = (Common.Enum.OKR.MatterTypeEnum)type,
Status = 0,
School_Id = userInfo.School_Id,
Group_Id = userInfo.Group_Id,
CreateTime = DateTime.Now
}) > 0;
}
/// <summary>
/// 获取关注事项详情
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="periodId"></param>
/// <param name="type"></param>
/// <param name="departId"></param>
/// <param name="postId"></param>
/// <param name="leaveStatus"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public List<RB_OKR_Objective_ViewModel> GetOKRMatterDetailPageList(int pageIndex, int pageSize, out long count, int periodId, int type, int departId, int postId, int leaveStatus, UserInfo userInfo)
{
count = 0;
List<RB_OKR_Objective_ViewModel> Rlist = new List<RB_OKR_Objective_ViewModel>();
var userIdList = GetMyUnderlingUserIdList(userInfo, departId, postId, leaveStatus);
if (userIdList.Any())
{
userIdList = userIdList.Distinct().ToList();
string userIds = string.Join(",", userIdList);
if (type == (int)Common.Enum.OKR.MatterTypeEnum.NotFilled)
{
//查询未填写
Rlist = oKR_ObjectiveRepository.GetNotFilledPageList(pageIndex, pageSize, out count, userInfo.Group_Id, periodId, userIds);
}
else if (type == (int)Common.Enum.OKR.MatterTypeEnum.NotUpdated)
{
//查询未更新
Rlist = oKR_ObjectiveRepository.GetNotpdatedPageList(pageIndex, pageSize, out count, userInfo.Group_Id, periodId, userIds);
}
if (type == (int)Common.Enum.OKR.MatterTypeEnum.NotScore)
{
//查询未打分
Rlist = oKR_ObjectiveRepository.GetNotScorePageList(pageIndex, pageSize, out count, userInfo.Group_Id, periodId, userIds);
}
}
return Rlist;
}
#endregion #endregion
#region 春姐 统计 #region 春姐 统计
......
using Edu.Common.Enum;
using Edu.Model.Entity.OKR;
using Edu.Model.ViewModel.OKR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.OKR
{
/// <summary>
/// OKR关注事项仓储层
/// </summary>
public class RB_OKR_MatterRepository : BaseRepository<RB_OKR_Matter>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_OKR_Matter> GetList(RB_OKR_Matter demodel)
{
string where = $@" 1=1 and Status =0";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_OKR_Matter.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.PeriodId > 0)
{
where += $@" and {nameof(RB_OKR_Matter.PeriodId)} ={demodel.PeriodId}";
}
if (demodel.UserId > 0)
{
where += $@" and {nameof(RB_OKR_Matter.UserId)} ={demodel.UserId}";
}
if (demodel.Type > 0)
{
where += $@" and {nameof(RB_OKR_Matter.Type)} ={(int)demodel.Type}";
}
string sql = $@" select * from RB_OKR_Matter where {where} order by Id desc";
return Get<RB_OKR_Matter>(sql).ToList();
}
}
}
...@@ -588,9 +588,10 @@ where o.Group_Id ={group_Id} and o.PeriodId ={periodId} AND o.Status =2 and o.Pr ...@@ -588,9 +588,10 @@ where o.Group_Id ={group_Id} and o.PeriodId ={periodId} AND o.Status =2 and o.Pr
string sql = $@" string sql = $@"
select * from( select * from(
select e.EmployeeId AS CreateBy,e.EmName,e.EmPhoto,e.DeptName,e.PostName, select e.EmployeeId AS CreateBy,e.EmName,e.EmPhoto,e.DeptName,e.PostName,
sum(case when o.ProgressState = 1 then 1 else 0 end) as ObjectiveNum1, sum(case when o.IsUpdated <> 1 then 1 else 0 end) as ObjectiveNum1,
sum(case when o.ProgressState = 2 then 1 else 0 end) as ObjectiveNum2, sum(case when o.IsUpdated = 1 and o.ProgressState = 1 then 1 else 0 end) as ObjectiveNum2,
sum(case when o.ProgressState = 3 then 1 else 0 end) as ObjectiveNum3 sum(case when o.IsUpdated = 1 and o.ProgressState = 2 then 1 else 0 end) as ObjectiveNum3,
sum(case when o.IsUpdated = 1 and o.ProgressState = 3 then 1 else 0 end) as ObjectiveNum4
from rb_employee e from rb_employee e
LEFT JOIN RB_OKR_Objective o on e.EmployeeId = o.CreateBy and o.Group_Id ={group_Id} and o.PeriodId ={periodId} AND o.Status =2 LEFT JOIN RB_OKR_Objective o on e.EmployeeId = o.CreateBy and o.Group_Id ={group_Id} and o.PeriodId ={periodId} AND o.Status =2
where e.RB_Group_id ={group_Id} and e.IsLeave =0 {(!string.IsNullOrEmpty(userIds) ? "and e.EmployeeId in (" + userIds + ")" : "")} group by e.EmployeeId where e.RB_Group_id ={group_Id} and e.IsLeave =0 {(!string.IsNullOrEmpty(userIds) ? "and e.EmployeeId in (" + userIds + ")" : "")} group by e.EmployeeId
...@@ -603,9 +604,10 @@ where e.RB_Group_id ={group_Id} and e.IsLeave =0 {(!string.IsNullOrEmpty(userIds ...@@ -603,9 +604,10 @@ where e.RB_Group_id ={group_Id} and e.IsLeave =0 {(!string.IsNullOrEmpty(userIds
{ {
string sql = $@" string sql = $@"
select e.RB_Department_Id, select e.RB_Department_Id,
sum(case when o.ProgressState = 1 then 1 else 0 end) as ObjectiveNum1, sum(case when o.IsUpdated <> 1 then 1 else 0 end) as ObjectiveNum1,
sum(case when o.ProgressState = 2 then 1 else 0 end) as ObjectiveNum2, sum(case when o.IsUpdated = 1 and o.ProgressState = 1 then 1 else 0 end) as ObjectiveNum2,
sum(case when o.ProgressState = 3 then 1 else 0 end) as ObjectiveNum3 sum(case when o.IsUpdated = 1 and o.ProgressState = 2 then 1 else 0 end) as ObjectiveNum3,
sum(case when o.IsUpdated = 1 and o.ProgressState = 3 then 1 else 0 end) as ObjectiveNum4
from rb_employee e from rb_employee e
LEFT JOIN RB_OKR_Objective o on e.EmployeeId = o.CreateBy and o.Group_Id ={group_Id} and o.PeriodId ={periodId} AND o.Status =2 LEFT JOIN RB_OKR_Objective o on e.EmployeeId = o.CreateBy and o.Group_Id ={group_Id} and o.PeriodId ={periodId} AND o.Status =2
where e.RB_Group_id ={group_Id} and e.IsLeave =0 and e.RB_Department_Id in ({deptIds}) group by e.RB_Department_Id where e.RB_Group_id ={group_Id} and e.IsLeave =0 and e.RB_Department_Id in ({deptIds}) group by e.RB_Department_Id
...@@ -708,5 +710,120 @@ where e.RB_Group_id ={group_Id} and e.IsLeave =0 and e.RB_Department_Id in ({dep ...@@ -708,5 +710,120 @@ where e.RB_Group_id ={group_Id} and e.IsLeave =0 and e.RB_Department_Id in ({dep
} }
#endregion #endregion
#region 注意事项
/// <summary>
/// 未填写人数
/// </summary>
/// <param name="groupId"></param>
/// <param name="periodId"></param>
/// <param name="userIds"></param>
/// <returns></returns>
public int GetNotFilledList(int groupId,int periodId, string userIds)
{
string sql = $@"SELECT COUNT(0) FROM(
SELECT CreateBy FROM rb_okr_objective WHERE Group_Id={groupId} and Status <>5 and PeriodId={periodId} and CreateBy in({userIds}) GROUP BY CreateBy
)t ";
var obj = ExecuteScalar(sql);
return obj == null ? 0 : Convert.ToInt32(obj);
}
/// <summary>
/// 未更新人数
/// </summary>
/// <param name="groupId"></param>
/// <param name="periodId"></param>
/// <param name="userIds"></param>
/// <returns></returns>
public int GetNotUpdatedList(int groupId, int periodId, string userIds)
{
string sql = $@"SELECT COUNT(0) FROM(
SELECT CreateBy FROM rb_okr_objective WHERE Group_Id={groupId} and Status <>5 and Progress =0 and PeriodId={periodId} and CreateBy in({userIds}) GROUP BY CreateBy
)t ";
var obj = ExecuteScalar(sql);
return obj == null ? 0 : Convert.ToInt32(obj);
}
/// <summary>
/// 未打分人数
/// </summary>
/// <param name="groupId"></param>
/// <param name="periodId"></param>
/// <param name="userIds"></param>
/// <returns></returns>
public int GetNotScoreList(int groupId, int periodId, string userIds)
{
string sql = $@"SELECT COUNT(0) FROM(
SELECT CreateBy FROM rb_okr_objective WHERE Group_Id={groupId} and Status <>5 and Score =0 and PeriodId={periodId} and CreateBy in({userIds}) GROUP BY CreateBy
)t ";
var obj = ExecuteScalar(sql);
return obj == null ? 0 : Convert.ToInt32(obj);
}
/// <summary>
/// 获取未填写人分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="group_Id"></param>
/// <param name="periodId"></param>
/// <param name="userIds"></param>
/// <returns></returns>
public List<RB_OKR_Objective_ViewModel> GetNotFilledPageList(int pageIndex, int pageSize, out long count, int groupId, int periodId, string userIds)
{
string sql = $@"
SELECT e.EmployeeId as CreateBy,e.EmName,e.EmPhoto,e.DeptName,e.PostName FROM
rb_employee e
left join rb_okr_objective o on e.EmployeeId = o.CreateBy and o.Status <>5 and o.PeriodId={periodId}
WHERE e.RB_Group_id={groupId} and e.EmployeeId in({userIds}) and o.Id is null
";
return GetPage<RB_OKR_Objective_ViewModel>(pageIndex, pageSize, out count, sql).ToList();
}
/// <summary>
/// 获取未更新人分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="groupId"></param>
/// <param name="periodId"></param>
/// <param name="userIds"></param>
/// <returns></returns>
public List<RB_OKR_Objective_ViewModel> GetNotpdatedPageList(int pageIndex, int pageSize, out long count, int groupId, int periodId, string userIds)
{
string sql = $@"
SELECT e.EmployeeId as CreateBy,e.EmName,e.EmPhoto,e.DeptName,e.PostName FROM
rb_employee e
left join rb_okr_objective o on e.EmployeeId = o.CreateBy
WHERE e.RB_Group_id={groupId} and e.EmployeeId in({userIds}) and o.Status <>5 and o.PeriodId ={periodId} and o.Progress =0 group by e.EmployeeId
";
return GetPage<RB_OKR_Objective_ViewModel>(pageIndex, pageSize, out count, sql).ToList();
}
/// <summary>
/// 获取未打分人分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="group_Id"></param>
/// <param name="periodId"></param>
/// <param name="userIds"></param>
/// <returns></returns>
public List<RB_OKR_Objective_ViewModel> GetNotScorePageList(int pageIndex, int pageSize, out long count, int groupId, int periodId, string userIds)
{
string sql = $@"
SELECT e.EmployeeId as CreateBy,e.EmName,e.EmPhoto,e.DeptName,e.PostName FROM
rb_employee e
left join rb_okr_objective o on e.EmployeeId = o.CreateBy
WHERE e.RB_Group_id={groupId} and e.EmployeeId in({userIds}) and o.Status <>5 and o.PeriodId ={periodId} and o.Score =0 group by e.EmployeeId
";
return GetPage<RB_OKR_Objective_ViewModel>(pageIndex, pageSize, out count, sql).ToList();
}
#endregion
} }
} }
using Edu.Common.Enum;
using Edu.Model.Entity.OKR;
using Edu.Model.ViewModel.OKR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.OKR
{
/// <summary>
/// OKR进度更新记录仓储层
/// </summary>
public class RB_OKR_UpdateProgressRepository : BaseRepository<RB_OKR_UpdateProgress>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_OKR_UpdateProgress> GetList(RB_OKR_UpdateProgress demodel)
{
string where = $@" 1=1 ";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_OKR_UpdateProgress.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.PeriodId > 0)
{
where += $@" and {nameof(RB_OKR_UpdateProgress.PeriodId)} ={demodel.PeriodId}";
}
if (demodel.UserId > 0)
{
where += $@" and {nameof(RB_OKR_UpdateProgress.UserId)} ={demodel.UserId}";
}
string sql = $@" select * from RB_OKR_UpdateProgress where {where} order by Id desc";
return Get<RB_OKR_UpdateProgress>(sql).ToList();
}
}
}
...@@ -2047,6 +2047,83 @@ namespace Edu.WebApi.Controllers.OKR ...@@ -2047,6 +2047,83 @@ namespace Edu.WebApi.Controllers.OKR
return ApiResult.Success("", list); return ApiResult.Success("", list);
} }
/// <summary>
/// 获取事项统计
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetOKRMatterList() {
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int PeriodId = parms.GetInt("PeriodId", 0);//周期id
int IsAdmin = parms.GetInt("IsAdmin", 2);//是否管理端查询 1是 2否
int DepartId = parms.GetInt("DepartId", 0);//部门ID 管理端可用查询
int PostId = parms.GetInt("PostId", 0);//岗位ID
int LeaveStatus = parms.GetInt("LeaveStatus", 0);//在职状态
if (PeriodId <= 0)
{
return ApiResult.ParamIsNull();
}
var list = okrPeriodModule.GetOKRMatterList(PeriodId, DepartId, PostId, LeaveStatus, userInfo, IsAdmin == 1 ? true : false);
return ApiResult.Success("", list);
}
/// <summary>
/// 获取事项明细列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetOKRMatterDetailPageList()
{
var userInfo = base.UserInfo;
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int PeriodId = parms.GetInt("PeriodId", 0);//周期id
int Type = parms.GetInt("Type", 0);//类型
int DepartId = parms.GetInt("DepartId", 0);//部门ID
int PostId = parms.GetInt("PostId", 0);//岗位ID
int LeaveStatus = parms.GetInt("LeaveStatus", 0);//在职状态
if (PeriodId <= 0)
{
return ApiResult.ParamIsNull("请传递周期");
}
if (Type <= 0) {
return ApiResult.ParamIsNull("请传递类型");
}
var list = okrPeriodModule.GetOKRMatterDetailPageList(pageModel.PageIndex, pageModel.PageSize, out long count, PeriodId, Type, DepartId, PostId, LeaveStatus, userInfo);
pageModel.Count = Convert.ToInt32(count);
pageModel.PageData = list.Select(x => new
{
x.CreateBy,
x.EmName,
x.EmPhoto,
x.DeptName,
x.PostName
});
return ApiResult.Success("", pageModel);
}
/// <summary>
/// 忽略注意事项
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetOKRMatterIgnore() {
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int PeriodId = parms.GetInt("PeriodId", 0);//周期id
int Type = parms.GetInt("Type", 0);//类型
if (PeriodId <= 0)
{
return ApiResult.ParamIsNull();
}
if (Type <= 0)
{
return ApiResult.ParamIsNull();
}
bool flag = okrPeriodModule.SetOKRMatterIgnore(PeriodId, Type, userInfo);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion #endregion
#region 个人端数据看板 #region 个人端数据看板
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
"RedisPwd": "Viitto2018" "RedisPwd": "Viitto2018"
}, },
"VirtualDirectory": "WebFile", "VirtualDirectory": "WebFile",
"OKRMatterValue": "30,100",
//是否是线上环境 //是否是线上环境
"IsOnline": false, "IsOnline": false,
//退课流程编号 //退课流程编号
......
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