Commit d34a8b37 authored by liudong1993's avatar liudong1993

1

parent f00e9096
This diff is collapsed.
......@@ -56,5 +56,29 @@ namespace Edu.Repository.OKR
string sql = $@" select ParentId,COUNT(0) AS ObjectiveId from RB_OKR_ObjectiveRelation WHERE ParentId in({ObjectiveIds}) GROUP BY ParentId";
return Get<RB_OKR_ObjectiveRelation>(sql).ToList();
}
/// <summary>
/// 获取目标的上对齐 所有的目标
/// </summary>
/// <param name="objectiveId"></param>
/// <returns></returns>
public string GetObjectiveParentIds(int objectiveId)
{
string sql = $" SELECT func_okr_getobjectiveparentids({objectiveId});";
var obj = ExecuteScalar(sql);
return obj == null ? "" : obj.ToString();
}
/// <summary>
/// 获取目标的下对齐 所有的目标
/// </summary>
/// <param name="objectiveId"></param>
/// <returns></returns>
public string GetObjectiveChildIds(int objectiveId)
{
string sql = $" SELECT func_okr_getobjectivechildids({objectiveId});";
var obj = ExecuteScalar(sql);
return obj == null ? "" : obj.ToString();
}
}
}
......@@ -980,6 +980,39 @@ namespace Edu.WebApi.Controllers.OKR
return ApiResult.Success("", list);
}
/// <summary>
/// 获取他人的单个目标
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetOKROthersObjectiveInfo() {
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int ObjectiveId = parms.GetInt("ObjectiveId", 0);
int PeriodId = parms.GetInt("PeriodId", 0);
int UserId = parms.GetInt("UserId", 0);
if (ObjectiveId <= 0)
{
return ApiResult.ParamIsNull("请传递目标id");
}
if (PeriodId <= 0)
{
return ApiResult.ParamIsNull("请传递周期id");
}
if (UserId <= 0)
{
return ApiResult.ParamIsNull("请传递当前用户id");
}
if (UserId == userInfo.Id)
{
return ApiResult.Failed("只能查看他人目标");
}
var obj = okrPeriodModule.GetOKROthersObjectiveInfo(PeriodId, UserId, ObjectiveId, userInfo);
return ApiResult.Success("", obj);
}
#endregion
#region 关注
......@@ -1209,12 +1242,69 @@ namespace Edu.WebApi.Controllers.OKR
return ApiResult.Success("", obj);
}
#endregion
/// <summary>
/// 获取管理员对齐视图
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetOKRAdminAlignView()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int PeriodId = parms.GetInt("PeriodId", 0);
int UserId = parms.GetInt("UserId", 0);
if (PeriodId <= 0)
{
return ApiResult.ParamIsNull("请传递周期id");
}
var obj = okrPeriodModule.GetOKRAdminAlignView(PeriodId, UserId, userInfo);
return ApiResult.Success("", obj);
}
#region 后台管理
/// <summary>
/// 获取管理员对齐视图 再下一级
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetOKRAdminAlignViewNext()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int PeriodId = parms.GetInt("PeriodId", 0);
int ObjectiveId = parms.GetInt("ObjectiveId", 0);//目标id
int Type = parms.GetInt("Type", 1);//类型 1向上 2向下
if (PeriodId <= 0)
{
return ApiResult.ParamIsNull("请传递周期id");
}
if (ObjectiveId <= 0)
{
return ApiResult.ParamIsNull("请传递关联目标id");
}
var obj = okrPeriodModule.GetOKRAdminAlignViewNext(PeriodId, ObjectiveId, Type, userInfo);
return ApiResult.Success("", obj);
}
/// <summary>
/// 获取管理员查看单个目标
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetOKRAdminLookObjectiveInfo()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int ObjectiveId = parms.GetInt("ObjectiveId", 0);
if (ObjectiveId <= 0)
{
return ApiResult.ParamIsNull("请传递目标id");
}
var obj = okrPeriodModule.GetOKRAdminLookObjectiveInfo(ObjectiveId, userInfo);
return ApiResult.Success("", obj);
}
#endregion
#region okr评论管理
......
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