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

解决冲突

parents 9b0142f1 63284792
......@@ -345,6 +345,16 @@ namespace Edu.Common
}
}
/// <summary>
/// okr关注事项配置
/// </summary>
public static string OKRMatterValue {
get
{
return ReadConfigKey("OKRMatterValue");
}
}
/// <summary>
/// 分区校长岗位编号
/// </summary>
......
......@@ -13,19 +13,19 @@ namespace Edu.Common.Enum.OKR
/// <summary>
/// 未填写OKR
/// </summary>
[EnumField("未填写OKR")]
[EnumField("请提醒 Ta 们尽快填写,避免重点工作实施受到影响")]
NotFilled = 1,
/// <summary>
/// 有OKR未更新进度
/// </summary>
[EnumField("有OKR未更新进度")]
[EnumField("请提醒 Ta 及时更新,对 OKR 结果进行复盘")]
NotUpdated = 2,
/// <summary>
/// 有OKR未打分
/// </summary>
[EnumField("有OKR未打分")]
[EnumField("请提醒 Ta 及时打分,对 OKR 结果进行复盘")]
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
/// 是否默认全部可见权限 1是 2否
/// </summary>
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; }
}
}
This diff is collapsed.
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
string sql = $@"
select * from(
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.ProgressState = 2 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 then 1 else 0 end) as ObjectiveNum1,
sum(case when o.IsUpdated = 1 and o.ProgressState = 1 then 1 else 0 end) as ObjectiveNum2,
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
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
......@@ -603,9 +604,10 @@ where e.RB_Group_id ={group_Id} and e.IsLeave =0 {(!string.IsNullOrEmpty(userIds
{
string sql = $@"
select e.RB_Department_Id,
sum(case when o.ProgressState = 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.ProgressState = 3 then 1 else 0 end) as ObjectiveNum3
sum(case when o.IsUpdated <> 1 then 1 else 0 end) as ObjectiveNum1,
sum(case when o.IsUpdated = 1 and o.ProgressState = 1 then 1 else 0 end) as ObjectiveNum2,
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
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
......@@ -708,5 +710,120 @@ where e.RB_Group_id ={group_Id} and e.IsLeave =0 and e.RB_Department_Id in ({dep
}
#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
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
#region 个人端数据看板
......
......@@ -37,6 +37,7 @@
"RedisPwd": "Viitto2018"
},
"VirtualDirectory": "WebFile",
"OKRMatterValue": "30,100",
//是否是线上环境
"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