Commit b3e297c8 authored by 黄奎's avatar 黄奎

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents 5aa84d63 9d84d3c0
......@@ -24,6 +24,11 @@ namespace Edu.Model.ViewModel.OKR
/// </summary>
public int ObjectiveId { get; set; }
/// <summary>
/// 父级id
/// </summary>
public int ParentId { get; set; }
/// <summary>
/// 对齐列表
/// </summary>
......@@ -34,6 +39,25 @@ namespace Edu.Model.ViewModel.OKR
/// </summary>
public List<ObjectiveEmployeeModel> ChildList { get; set; }
/// <summary>
/// 对齐列表
/// </summary>
public List<RB_OKR_Objective_ViewModel> ParentSingleList { get; set; }
/// <summary>
/// 上对齐数量
/// </summary>
public int ParentNum { get; set; }
/// <summary>
/// 对齐列表
/// </summary>
public List<RB_OKR_Objective_ViewModel> ChildSingleList { get; set; }
/// <summary>
/// 下对齐数量
/// </summary>
public int ChildNum { get; set; }
/// <summary>
/// 关键结果列表
/// </summary>
......@@ -81,6 +105,11 @@ namespace Edu.Model.ViewModel.OKR
/// </summary>
public string AccountName { get; set; }
/// <summary>
/// 头像
/// </summary>
public string Icon { get; set; }
/// <summary>
/// 对齐列表
/// </summary>
......
......@@ -161,5 +161,10 @@ namespace Edu.Model.ViewModel.User
/// 邮箱
/// </summary>
public string Email { get; set; }
/// <summary>
/// 直接主管ids
/// </summary>
public string DirectSupervisorIds { get; set; }
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -41,6 +41,10 @@ namespace Edu.Repository.OKR
{
where += $@" and {nameof(RB_OKR_Comment_ViewModel.CreateBy)} ={demodel.CreateBy}";
}
if (demodel.AccountId > 0)
{
where += $@" and {nameof(RB_OKR_Comment_ViewModel.AccountId)} ={demodel.AccountId}";
}
string sql = $@" select * from RB_OKR_Comment where {where} order by Id desc";
return GetPage<RB_OKR_Comment_ViewModel>(pageIndex, pageSize, out rowsCount, sql).ToList();
}
......@@ -69,6 +73,10 @@ namespace Edu.Repository.OKR
{
where += $@" and {nameof(RB_OKR_Comment_ViewModel.CreateBy)} ={demodel.CreateBy}";
}
if (demodel.AccountId > 0)
{
where += $@" and {nameof(RB_OKR_Comment_ViewModel.AccountId)} ={demodel.AccountId}";
}
string sql = $@" select * from RB_OKR_Comment where {where} order by Id desc";
return Get<RB_OKR_Comment_ViewModel>(sql).ToList();
}
......
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;
......@@ -20,7 +21,7 @@ namespace Edu.Repository.OKR
/// <returns></returns>
public List<RB_OKR_ObjectiveRelation> GetList(RB_OKR_ObjectiveRelation demodel)
{
string where = $@" 1=1 and State <> 3";
string where = $@" 1=1 ";
if (demodel.ObjectiveId > 0)
{
where += $@" and {nameof(RB_OKR_ObjectiveRelation.ObjectiveId)} ={demodel.ObjectiveId}";
......@@ -33,5 +34,16 @@ namespace Edu.Repository.OKR
string sql = $@" select * from RB_OKR_ObjectiveRelation where {where} order by Id desc";
return Get<RB_OKR_ObjectiveRelation>(sql).ToList();
}
/// <summary>
/// 获取上对齐数量
/// </summary>
/// <param name="ObjectiveIds"></param>
/// <returns></returns>
public List<RB_OKR_ObjectiveRelation> GetParentAlignNum(string ObjectiveIds)
{
string sql = $@" select ObjectiveId,COUNT(0) AS ParentId from RB_OKR_ObjectiveRelation WHERE ObjectiveId in({ObjectiveIds}) GROUP BY ObjectiveId";
return Get<RB_OKR_ObjectiveRelation>(sql).ToList();
}
}
}
......@@ -21,7 +21,7 @@ namespace Edu.Repository.OKR
/// <returns></returns>
public List<RB_OKR_UpdateNotification_ViewModel> GetList(RB_OKR_UpdateNotification_ViewModel demodel)
{
string where = $@" 1=1 and Status =0";
string where = $@" 1=1 ";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_OKR_UpdateNotification_ViewModel.Group_Id)} ={demodel.Group_Id}";
......
......@@ -231,7 +231,11 @@ WHERE 1=1 {1}
}
if (query.DirectSupervisor > 0)
{
where.AppendFormat(" AND A.{0} ={1} ", nameof(Employee_ViewModel.Id), query.DirectSupervisor);
where.AppendFormat(" AND A.{0} ={1} ", nameof(Employee_ViewModel.DirectSupervisor), query.DirectSupervisor);
}
if (!string.IsNullOrEmpty(query.DirectSupervisorIds))
{
where.AppendFormat(" AND A.{0} in({1}) ", nameof(Employee_ViewModel.DirectSupervisor), query.DirectSupervisorIds);
}
if (!string.IsNullOrEmpty(query.QIds))
{
......@@ -312,7 +316,7 @@ WHERE 1=1 {1}
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT ar.AccountRemark,A.Id,A.Account,A.AccountId,A.Group_Id,A.School_Id,A.EmployeeName,A.UserIcon,A.IDCard,A.Sex,A.Education,A.EntryTime,A.Address,A.BirthDate
,A.LeaveStatus,A.LeaveTime,A.EmployeeTel,A.AccountType,A.Email
,A.LeaveStatus,A.LeaveTime,A.EmployeeTel,A.AccountType,A.Email,A.DirectSupervisor
,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName
,IFNULL(d.DeptId,0) AS Dept_Id,IFNULL(d.DeptName,'') AS DeptName,IFNULL(p.PostId,0) AS Post_Id, IFNULL(p.PostName,'') AS PostName
,(CASE WHEN CONCAT(DATE_FORMAT(now(),'%Y'),'-',DATE_FORMAT(BirthDate,'%m-%d')) >= DATE_FORMAT(now(),'%Y-%m-%d')
......@@ -322,7 +326,7 @@ SELECT ar.AccountRemark,A.Id,A.Account,A.AccountId,A.Group_Id,A.School_Id,A.Empl
FROM
(
SELECT A.Id,A.Account,A.`Password`, 1 as AccountType,B.MId as AccountId
,A.CreateBy,A.CreateTime,A.UpdateBy,A.UpdateTime,A.Group_Id,A.`Status`,A.AnnualLeaveDay
,A.CreateBy,A.CreateTime,A.UpdateBy,A.UpdateTime,A.Group_Id,A.`Status`,A.AnnualLeaveDay,A.DirectSupervisor
,b.School_Id,IFNULL(B.MName,'') AS EmployeeName,B.MHead AS UserIcon,B.Dept_Id,B.Post_Id,B.IDCard
,B.Sex,B.Education,B.EntryTime,B.Address,B.BirthDate
,B.LeaveStatus,B.LeaveTime,B.MTel AS EmployeeTel,IFNULL(B.Email,'') AS Email
......@@ -330,7 +334,7 @@ FROM
WHERE 1=1 {0} {1}
UNION ALL
SELECT A.Id,A.Account,A.`Password`, 2 as AccountType,B.TId as AccountId
,A.CreateBy,A.CreateTime,A.UpdateBy,A.UpdateTime,A.Group_Id,A.`Status`,A.AnnualLeaveDay
,A.CreateBy,A.CreateTime,A.UpdateBy,A.UpdateTime,A.Group_Id,A.`Status`,A.AnnualLeaveDay,A.DirectSupervisor
,b.School_Id,IFNULL(B.TeacherName,'') AS EmployeeName,B.TeacherIcon AS UserIcon,B.Dept_Id,B.Post_Id,B.IDCard
,B.Sex,B.Education,B.EntryTime,B.Address,B.BirthDate
,B.LeaveStatus,B.LeaveTime,B.TeacherTel AS EmployeeTel,IFNULL(B.Email,'') AS Email
......@@ -338,7 +342,7 @@ FROM
WHERE 1=1 {0} {2}
UNION ALL
SELECT A.Id,A.Account,A.`Password`, 3 as AccountType,B.AId as AccountId
,A.CreateBy,A.CreateTime,A.UpdateBy,A.UpdateTime,A.Group_Id,A.`Status`,A.AnnualLeaveDay
,A.CreateBy,A.CreateTime,A.UpdateBy,A.UpdateTime,A.Group_Id,A.`Status`,A.AnnualLeaveDay,A.DirectSupervisor
,b.School_Id,IFNULL(B.AssistName,'') AS EmployeeName,B.AssistIcon AS UserIcon,B.Dept_Id,B.Post_Id,B.IDCard
,B.Sex,B.Education,B.EntryTime,B.Address,B.BirthDate
,B.LeaveStatus,B.LeaveTime,B.AssistTel AS EmployeeTel,IFNULL(B.Email,'') AS Email
......
......@@ -371,6 +371,7 @@ namespace Edu.WebApi.Controllers.OKR
#endregion
#region 目标管理
#region 基础目标
/// <summary>
/// 获取周期列表
/// </summary>
......@@ -470,7 +471,7 @@ namespace Edu.WebApi.Controllers.OKR
{
return ApiResult.ParamIsNull("请传递结果值");
}
if (KeyResultId <= 0 && ObjectiveId <= 0)
if (KeyResultId <= 0 || ObjectiveId <= 0)
{
return ApiResult.ParamIsNull("结果id不正确");
}
......@@ -703,6 +704,8 @@ namespace Edu.WebApi.Controllers.OKR
return okrPeriodModule.SgetOKRMyKeyResultDel(KeyResultId, userInfo);
}
#endregion
//权限 添加对齐 审核 评论 左边人员列表 对齐视图 数据看板 (管理员版 对齐视图 数据看板)
#region 添加对齐
......@@ -979,11 +982,216 @@ namespace Edu.WebApi.Controllers.OKR
#endregion
#region 评论+关注
#region 关注
/// <summary>
/// 获取该员工是否关注
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetOKREmployeeAttention() {
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int UserId = parms.GetInt("UserId", 0);
if (UserId <= 0) {
return ApiResult.ParamIsNull("请传递用户id");
}
return okrPeriodModule.GetOKREmployeeAttention(UserId, userInfo);
}
/// <summary>
/// 设置关注
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SgetOKREmployeeAttention() {
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int UserId = parms.GetInt("UserId", 0);
int Type = parms.GetInt("Type", 0);//类型 1关注 2取消关注
if (UserId <= 0)
{
return ApiResult.ParamIsNull("请传递用户id");
}
string msg = okrPeriodModule.SgetOKREmployeeAttention(UserId, Type, userInfo);
if (msg == "")
{
return ApiResult.Success();
}
else {
return ApiResult.Failed(msg);
}
}
#endregion
#region 审核
/// <summary>
/// 获取待我审核的列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetOKRObjectiveAuditList()
{
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");
}
if (UserId <= 0)
{
return ApiResult.ParamIsNull("请传递用户id");
}
if (UserId == userInfo.Id)
{
return ApiResult.Failed("只能审核他人目标");
}
return okrPeriodModule.GetOKRObjectiveAuditList(PeriodId, UserId, userInfo);
}
/// <summary>
/// 审核目标
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetOKRObjectiveAudit()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int ObjectiveId = parms.GetInt("ObjectiveId", 0);
int Type = parms.GetInt("Type", 0);//类型 1通过 2不通过
string Remark = parms.GetStringValue("Remark");
if (ObjectiveId <= 0)
{
return ApiResult.ParamIsNull("请传递目标sid");
}
if (Type <= 0)
{
return ApiResult.ParamIsNull("请传递类型");
}
string msg = okrPeriodModule.SetOKRObjectiveAudit(ObjectiveId, Type, Remark, userInfo);
if (msg == "")
{
return ApiResult.Success();
}
else {
return ApiResult.Failed(msg);
}
}
/// <summary>
/// 重新发起审核
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetOKRObjectiveAuditAgain()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int ObjectiveId = parms.GetInt("ObjectiveId", 0);
if (ObjectiveId <= 0)
{
return ApiResult.ParamIsNull("请传递目标sid");
}
string msg = okrPeriodModule.SetOKRObjectiveAuditAgain(ObjectiveId, userInfo);
if (msg == "")
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed(msg);
}
}
#endregion
#region 更新提示
/// <summary>
/// 清除人员的更新提示
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult ClearMyEmployeeUpdateNotification() {
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int UserId = parms.GetInt("UserId", 0);
if (UserId <= 0) {
return ApiResult.ParamIsNull("请传递用户id");
}
string msg = okrPeriodModule.ClearMyEmployeeUpdateNotification(UserId, userInfo);
if (msg == "")
{
return ApiResult.Success();
}
else {
return ApiResult.Failed(msg);
}
}
/// <summary>
/// 前端调用更新用户提示
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SgetMyUserUpdateNotification() {
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
string UserIds = parms.GetStringValue("UserIds");
if (string.IsNullOrEmpty(UserIds))
{
return ApiResult.ParamIsNull("请传递用户id");
}
List<int> UserIdList = JsonHelper.DeserializeObject<List<int>>(UserIds);
bool flag = okrPeriodModule.SetMyUserUpdateNotification(UserIdList, userInfo);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
#endregion
#endregion
#region 统计模块
/// <summary>
/// 获取我的对齐视图
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetOKRMyAlignView()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int PeriodId = parms.GetInt("PeriodId", 0);
if (PeriodId <= 0) {
return ApiResult.ParamIsNull("请传递周期id");
}
var obj = okrPeriodModule.GetOKRMyAlignView(PeriodId, userInfo);
return ApiResult.Success("", obj);
}
#endregion
#region 后台管理
#endregion
#region okr评论管理
......@@ -1000,8 +1208,15 @@ namespace Edu.WebApi.Controllers.OKR
School_Id = base.ParmJObj.GetInt("School_Id"),
State = base.ParmJObj.GetInt("State", 0),
PeriodId = base.ParmJObj.GetInt("PeriodId", 0)
PeriodId = base.ParmJObj.GetInt("PeriodId", 0),
AccountId = base.ParmJObj.GetInt("AccountId", 0)
};
if (query.PeriodId <= 0) {
return ApiResult.ParamIsNull("请传递期数");
}
if (query.AccountId <= 0) {
return ApiResult.ParamIsNull("请传递用户id");
}
query.Group_Id = base.UserInfo.Group_Id;
var list = okrPeriodModule.GetCommentPageList(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
......@@ -1033,7 +1248,17 @@ namespace Edu.WebApi.Controllers.OKR
School_Id = base.ParmJObj.GetInt("School_Id"),
PeriodId = base.ParmJObj.GetInt("PeriodId"),
Content = base.ParmJObj.GetStringValue("Content"),
AccountId = base.ParmJObj.GetInt("AccountId", 0)
};
if (extModel.PeriodId <= 0) {
return ApiResult.ParamIsNull("请传递周期id");
}
if (extModel.AccountId <= 0) {
return ApiResult.ParamIsNull("请传递用户id");
}
if (string.IsNullOrEmpty(extModel.Content)) {
return ApiResult.ParamIsNull("请传递内容");
}
extModel.CreateBy = base.UserInfo.Id;
extModel.State = 1;
extModel.CreateTime = System.DateTime.Now;
......
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