|
@@ -2052,12 +2052,19 @@ namespace OASystem.API.Controllers
|
|
/// 员工绩效组成结构获取
|
|
/// 员工绩效组成结构获取
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="userid"></param>
|
|
/// <param name="userid"></param>
|
|
|
|
+ /// <param name="date"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[HttpGet]
|
|
- public IActionResult GetPerformanceList(int userid)
|
|
|
|
|
|
+ public IActionResult GetPerformanceList(int userid,string date)
|
|
{
|
|
{
|
|
var jw = JsonView(false);
|
|
var jw = JsonView(false);
|
|
|
|
|
|
|
|
+ if (!DateTime.TryParse(date,out DateTime date_Dt))
|
|
|
|
+ {
|
|
|
|
+ jw.Msg = "日期格式有误!";
|
|
|
|
+ return Ok(jw);
|
|
|
|
+ }
|
|
|
|
+
|
|
string sql_CTE = $@"-- 定义递归查询的CTE
|
|
string sql_CTE = $@"-- 定义递归查询的CTE
|
|
WITH PerAssessmentSettingsCTE AS (
|
|
WITH PerAssessmentSettingsCTE AS (
|
|
-- 选择指定ID的记录作为起点
|
|
-- 选择指定ID的记录作为起点
|
|
@@ -2107,12 +2114,13 @@ OPTION (MAXRECURSION 0); -- 允许无限递归 ";
|
|
var ids = result_CTE.Select(x => x.Id);
|
|
var ids = result_CTE.Select(x => x.Id);
|
|
|
|
|
|
var List = _sqlSugar.Queryable<Per_AssessmentSetting>()
|
|
var List = _sqlSugar.Queryable<Per_AssessmentSetting>()
|
|
- .LeftJoin<Per_AssessmentContentSetting>((a, b) => a.Id == b.AssessmentSettingId && b.IsDel == 0)
|
|
|
|
- .LeftJoin<Per_AssessmentScore>((a, b,c) => b.Id == c.AssessmentContentSettingId && c.IsDel == 0)
|
|
|
|
|
|
+ .LeftJoin<Per_AssessmentContentSetting>((a, b) => a.Id == b.AssessmentSettingId && b.IsDel == 0 && b.UserId == userid)
|
|
|
|
+ .LeftJoin<Per_AssessmentScore>((a, b,c) => b.Id == c.AssessmentContentSettingId && c.IsDel == 0 && c.YearMonth.Year == date_Dt.Year && c.YearMonth.Month == date_Dt.Month)
|
|
.Where((a, b) => a.IsDel == 0 && ids.Contains(a.Id))
|
|
.Where((a, b) => a.IsDel == 0 && ids.Contains(a.Id))
|
|
.Select((a, b, c) => new TreeNode
|
|
.Select((a, b, c) => new TreeNode
|
|
{
|
|
{
|
|
Id = a.Id,
|
|
Id = a.Id,
|
|
|
|
+ ContentId = b.Id,
|
|
Name = a.Name,
|
|
Name = a.Name,
|
|
ParentId = a.ParentId,
|
|
ParentId = a.ParentId,
|
|
AssessmentProportion = a.AssessmentProportion, //占比
|
|
AssessmentProportion = a.AssessmentProportion, //占比
|
|
@@ -2345,7 +2353,7 @@ OPTION (MAXRECURSION 0); -- 允许无限递归 ";
|
|
b.AssessmentStandard,
|
|
b.AssessmentStandard,
|
|
MergeStr = $"【项名称:{b.Name}/目标值:{a.TargetValue}/评估标准:{b.AssessmentStandard}】",
|
|
MergeStr = $"【项名称:{b.Name}/目标值:{a.TargetValue}/评估标准:{b.AssessmentStandard}】",
|
|
a.AssessmentProportionChi,
|
|
a.AssessmentProportionChi,
|
|
- b.Name
|
|
|
|
|
|
+ b.Name
|
|
})
|
|
})
|
|
.ToList()
|
|
.ToList()
|
|
.ToDictionary(x => x.ContentSettingId);
|
|
.ToDictionary(x => x.ContentSettingId);
|
|
@@ -2407,6 +2415,66 @@ OPTION (MAXRECURSION 0); -- 允许无限递归 ";
|
|
return Ok(jw);
|
|
return Ok(jw);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 绩效项删除
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost]
|
|
|
|
+ public IActionResult DeleteAssessmentSetting(DeleteAssessmentSettingDto dto)
|
|
|
|
+ {
|
|
|
|
+ var jw = JsonView(false, "删除失败!");
|
|
|
|
+ if (!dto.IdArr.Any())
|
|
|
|
+ {
|
|
|
|
+ jw.Msg = "id不能为空!";
|
|
|
|
+ return Ok(jw);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var rowCount = _sqlSugar.Updateable<Per_AssessmentSetting>()
|
|
|
|
+ .Where(x => dto.IdArr.Contains(x.Id) && x.IsDel == 0)
|
|
|
|
+ .SetColumns(x => new Per_AssessmentSetting
|
|
|
|
+ {
|
|
|
|
+ IsDel = 1,
|
|
|
|
+ DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm"),
|
|
|
|
+ DeleteUserId = dto.UserId,
|
|
|
|
+ })
|
|
|
|
+ .ExecuteCommand();
|
|
|
|
+
|
|
|
|
+ jw.Code = 200;
|
|
|
|
+ jw.Msg = $"修改成功!,修改数量{rowCount}";
|
|
|
|
+ return Ok(jw);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 绩效内容删除
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost]
|
|
|
|
+ public IActionResult DeleteAssessmentContentSetting(DeleteAssessmentSettingDto dto)
|
|
|
|
+ {
|
|
|
|
+ var jw = JsonView(false, "删除失败!");
|
|
|
|
+ if (!dto.IdArr.Any())
|
|
|
|
+ {
|
|
|
|
+ jw.Msg = "id不能为空!";
|
|
|
|
+ return Ok(jw);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var rowCount = _sqlSugar.Updateable<Per_AssessmentContentSetting>()
|
|
|
|
+ .Where(x => dto.IdArr.Contains(x.Id) && x.IsDel == 0)
|
|
|
|
+ .SetColumns(x => new Per_AssessmentContentSetting
|
|
|
|
+ {
|
|
|
|
+ IsDel = 1,
|
|
|
|
+ DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm"),
|
|
|
|
+ DeleteUserId = dto.UserId,
|
|
|
|
+ })
|
|
|
|
+ .ExecuteCommand();
|
|
|
|
+
|
|
|
|
+ jw.Code = 200;
|
|
|
|
+ jw.Msg = $"修改成功!,修改数量{rowCount}";
|
|
|
|
+ return Ok(jw);
|
|
|
|
+ }
|
|
|
|
+
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 企微Api测试
|
|
#region 企微Api测试
|