|
@@ -2107,8 +2107,9 @@ OPTION (MAXRECURSION 0); -- 允许无限递归 ";
|
|
|
|
|
|
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)
|
|
|
.Where((a, b) => a.IsDel == 0 && ids.Contains(a.Id))
|
|
|
- .Select((a, b) => new TreeNode
|
|
|
+ .Select((a, b, c) => new TreeNode
|
|
|
{
|
|
|
Id = a.Id,
|
|
|
Name = a.Name,
|
|
@@ -2121,7 +2122,15 @@ OPTION (MAXRECURSION 0); -- 允许无限递归 ";
|
|
|
AssessmentSettingId = b.AssessmentSettingId,
|
|
|
Fixed = b.Fixed,
|
|
|
TargetValue = b.TargetValue,
|
|
|
- AssessmentProportion_Percentage = a.AssessmentProportion * 100
|
|
|
+ AssessmentProportion_Percentage = a.AssessmentProportion * 100,
|
|
|
+ HigherUpAssessment = c.HigherUpAssessment,
|
|
|
+ HigherUpConfig = c.HigherUpConfig,
|
|
|
+ HigherUpUserId = c.HigherUpUserId,
|
|
|
+ Score = c.Score,
|
|
|
+ ScoreTotal = c.ScoreTotal,
|
|
|
+ SelfAssessment = c.SelfAssessment,
|
|
|
+ Status = c.Status,
|
|
|
+ YearMonth = c.YearMonth,
|
|
|
})
|
|
|
.ToList();
|
|
|
|
|
@@ -2147,6 +2156,80 @@ OPTION (MAXRECURSION 0); -- 允许无限递归 ";
|
|
|
return parent;
|
|
|
}
|
|
|
|
|
|
+ [HttpPost]
|
|
|
+ public async Task<IActionResult> AssessmentSettingOperationAsync(PerAssessmentSettingOperationDto dto)
|
|
|
+ {
|
|
|
+ var jw = JsonView(false);
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var entity = new Per_AssessmentSetting
|
|
|
+ {
|
|
|
+ Name = dto.Name,
|
|
|
+ AssessmentProportion = dto.AssessmentProportion,
|
|
|
+ AssessmentStandard = dto.AssessmentStandard,
|
|
|
+ ParentId = dto.ParentId,
|
|
|
+ Id = dto.Id,
|
|
|
+ Remark = dto.Remark,
|
|
|
+ };
|
|
|
+
|
|
|
+ jw.Code = 200;
|
|
|
+ jw.Data = "";
|
|
|
+ if (dto.Id == 0)
|
|
|
+ {
|
|
|
+ entity.CreateUserId = dto.CreateId;
|
|
|
+ entity.CreateTime = DateTime.Now;
|
|
|
+ await _sqlSugar.Insertable(entity).ExecuteCommandAsync();
|
|
|
+ jw.Msg = "添加成功!";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ await _sqlSugar.Updateable(entity).ExecuteCommandAsync();
|
|
|
+ jw.Msg = "修改成功!";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ jw.Msg = "Api error " + ex.Message;
|
|
|
+ jw.Code = 400;
|
|
|
+ jw.Data = "";
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
+ [HttpPost]
|
|
|
+ public async Task<IActionResult> QueryAssessmentSettingListOffsetAsync(QueryAssessmentSettingListOffsetAsyncDto dto)
|
|
|
+ {
|
|
|
+ var jw = JsonView(false);
|
|
|
+
|
|
|
+ RefAsync<int> total = 0;//REF和OUT不支持异步,想要真的异步这是最优解
|
|
|
+ var entities = await _sqlSugar.Queryable<Per_AssessmentSetting>()
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.SearchValue), e => e.Name.Contains(dto.SearchValue))
|
|
|
+ .ToPageListAsync(dto.pageIndex, dto.pageSize, total);
|
|
|
+
|
|
|
+ var DtoResult = entities.Select(e => new
|
|
|
+ {
|
|
|
+ Name = e.Name,
|
|
|
+ AssessmentProportion = e.AssessmentProportion,
|
|
|
+ AssessmentStandard = e.AssessmentStandard,
|
|
|
+ ParentId = e.ParentId,
|
|
|
+ Remark = e.Remark
|
|
|
+ }).ToList();
|
|
|
+
|
|
|
+ jw.Data = new
|
|
|
+ {
|
|
|
+ total = total.Value,
|
|
|
+ dto.pageIndex,
|
|
|
+ dto.pageSize,
|
|
|
+ List = DtoResult
|
|
|
+ };
|
|
|
+
|
|
|
+ jw.Code = 200;
|
|
|
+ jw.Msg = "查询成功!";
|
|
|
+
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
}
|
|
|
}
|