Commit eef574ce by zry

绩效BUG修复

parent e61d2e75
......@@ -116,17 +116,17 @@ public ApiResponse SecondDetail([CustomizeValidator(RuleSet = "Refresh"), FromBo
return new ApiResponse(ResponseType.OK, result);
}
/// <summary>
/// 二次绩效录入页面配置信息
/// </summary>
/// <returns></returns>
[Route("api/second/otherdetail/{secondid}")]
[HttpPost]
public ApiResponse SecondOtherDetail(int secondid)
{
var result = secondAllotService.GetSecondDetail(secondid);
return new ApiResponse(ResponseType.OK, result);
}
///// <summary>
///// 二次绩效录入页面配置信息
///// </summary>
///// <returns></returns>
//[Route("api/second/otherdetail/{secondid}")]
//[HttpPost]
//public ApiResponse SecondOtherDetail(int secondid)
//{
// var result = secondAllotService.GetSecondDetail(secondid);
// return new ApiResponse(ResponseType.OK, result);
//}
#endregion
#region 模板使用
......
......@@ -797,12 +797,6 @@
</summary>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.SecondAllotController.SecondOtherDetail(System.Int32)">
<summary>
二次绩效录入页面配置信息
</summary>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.SecondAllotController.Temp(Performance.DtoModels.AllotDeptRequest)">
<summary>
选择二次绩效模板
......
......@@ -614,27 +614,27 @@ private void WriteSpecialUnit(ISheet sheet, IPerSheetDataRead sheetRead, List<sy
if (lastAllot != null)
allotDataList = perforImspecialunitRepository.GetEntities(t => t.AllotID == lastAllot.ID);
//查询数据
var extractIdList = speaialList.Select(t => t.ExtractId).Distinct().ToList();
var extractList = extracts.Where(t => extractIdList.Contains(t.Id)).ToList();
List<ExtractDto> allExtract = new List<ExtractDto>();
foreach (var item in extractList)
{
var category = speaialList.Where(t => t.ExtractId == item.Id);
if (category == null || category.Count() == 0) continue;
foreach (var specialitem in category)
{
logManageService.WriteMsg("提取绩效数据", $"执行SQL脚本获取数据 -- 特殊核算单元绩效测算表", 1, Allot.ID, "ReceiveMessage");
LogHelper.Information($"执行SQL脚本获取数据 -- 特殊核算单元绩效测算表,", "提取绩效数据");
var config = configs.FirstOrDefault(t => t.Id == specialitem.ConfigId);
if (config == null) continue;
var result = QueryDatabase(config, item, Allot, specialitem.Target);
if (result != null)
allExtract.AddRange(result);
}
}
////查询数据
//var extractIdList = speaialList.Select(t => t.ExtractId).Distinct().ToList();
//var extractList = extracts.Where(t => extractIdList.Contains(t.Id)).ToList();
//List<ExtractDto> allExtract = new List<ExtractDto>();
//foreach (var item in extractList)
//{
// var category = speaialList.Where(t => t.ExtractId == item.Id);
// if (category == null || category.Count() == 0) continue;
// foreach (var specialitem in category)
// {
// logManageService.WriteMsg("提取绩效数据", $"执行SQL脚本获取数据 -- 特殊核算单元绩效测算表", 1, Allot.ID, "ReceiveMessage");
// LogHelper.Information($"执行SQL脚本获取数据 -- 特殊核算单元绩效测算表,", "提取绩效数据");
// var config = configs.FirstOrDefault(t => t.Id == specialitem.ConfigId);
// if (config == null) continue;
// var result = QueryDatabase(config, item, Allot, specialitem.Target);
// if (result != null)
// allExtract.AddRange(result);
// }
//}
//取消合并单元格
int mergedCount = sheet.NumMergedRegions;
......@@ -680,8 +680,18 @@ private void WriteSpecialUnit(ISheet sheet, IPerSheetDataRead sheetRead, List<sy
mergedEnd = mergedBegin + count - 1;
}
}
if (cell.StringCellValue == "数量")
value = allExtract.FirstOrDefault(t => t.Category == speaialList[i].Target && t.Department == speaialList[i].Department)?.Value;
if (cell.StringCellValue == "数量" && speaialList[i]?.ExtractId > 0)
{
logManageService.WriteMsg("提取绩效数据", $"执行SQL脚本获取数据 -- 特殊核算单元绩效测算表", 1, Allot.ID, "ReceiveMessage");
LogHelper.Information($"执行SQL脚本获取数据 -- 特殊核算单元绩效测算表,", "提取绩效数据");
var config = configs.FirstOrDefault(t => t.Id == speaialList[i].ConfigId);
if (config == null) continue;
var ext = extracts.FirstOrDefault(w => w.Id == speaialList[i]?.ExtractId);
var result = QueryDatabase(config, ext, Allot);
value = result?.FirstOrDefault()?.Value;
}
if (!new List<string> { "量化指标", "数量", "量化指标绩效分值" }.Contains(cell.StringCellValue) && rowIndex == mergedBegin)
{
......@@ -840,6 +850,8 @@ private List<ExtractDto> QueryDatabase(sys_hospitalconfig config, mod_extract ex
/// <param name="body"></param>
private void SendEmail(string mail, string path, string subject, string body)
{
if (string.IsNullOrEmpty(mail)) return;
var message = new EmailMessage
{
To = new List<string> { mail },
......
......@@ -223,15 +223,15 @@ public SecondResponse GetSecondDetail(UseTempRequest request)
};
}
/// <summary>
/// 二次绩效详情
/// </summary>
/// <returns></returns>
public List<ag_othersource> GetSecondDetail(int secondid)
{
var others = perforAgothersourceRepository.GetEntities(t => t.SecondId == secondid);
return others;
}
///// <summary>
///// 二次绩效详情
///// </summary>
///// <returns></returns>
//public List<ag_othersource> GetSecondDetail(int secondid)
//{
// var others = perforAgothersourceRepository.GetEntities(t => t.SecondId == secondid);
// return others;
//}
/// <summary>
/// 二次绩效项录入保存
/// </summary>
......@@ -621,6 +621,10 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
if (result && request.IsPass == 1)
{
var histories = perforAgcomputeRepository.GetEntities(w => w.SecondId == request.SecondId);
if (histories != null && histories.Any())
perforAgcomputeRepository.RemoveRange(histories.ToArray());
var computes = new List<ag_compute>();
if (second.SubmitType == 1)
{
......
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