Commit 863f9506 by 纪旭 韦

绩效审核通过,绩效下发 增加人员和核算单元是否匹配判断

parent e7ee7bcb
......@@ -465,6 +465,15 @@ public ApiResponse Issued([FromBody] AllotRequest request)
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var res = _allotService.GetCheckBase(request.ID);
string error = "";
if (res.CheckEmp.Body?.Any() != true)
error += "测算表人员信息与「人员字典」无法匹配,";
if (res.CheckDept.Body?.Any() != true)
error += "测算表核算单元与「核算单元及组别」信息无法匹配";
if (!string.IsNullOrEmpty(error))
throw new PerformanceException(error);
var seconds = _resultComputeService.GetSeconds(allot);
if (request.isIssued == 1)
{
......@@ -509,7 +518,7 @@ public ApiResponse Issued([FromBody] AllotRequest request)
/// <returns></returns>
[Route("getCheckBase")]
[HttpGet]
public ApiResponse GetCheckBase([FromQuery]int allotId)
public ApiResponse GetCheckBase([FromQuery] int allotId)
{
var res = _allotService.GetCheckBase(allotId);
return new ApiResponse(ResponseType.OK, res);
......@@ -581,14 +590,14 @@ public IActionResult ReservedDownload([FromBody] ReservedRequest request)
if (request.Source == 1)
{
name = "预留金额(按人员字典)";
ignoreColumns = new string[] { "hospitalid","source","newunittype","newaccountingunit"};
ignoreColumns = new string[] { "hospitalid", "source", "newunittype", "newaccountingunit" };
}
else
{
name = "预留金额(按发放科室)";
ignoreColumns = new string[]{ "hospitalid", "newunittype", "newaccountingunit" };
ignoreColumns = new string[] { "hospitalid", "newunittype", "newaccountingunit" };
}
var filepath = _allotService.ExcelDownload(rows, name , excelDownloadHeads, ignoreColumns);
var filepath = _allotService.ExcelDownload(rows, name, excelDownloadHeads, ignoreColumns);
var memoryStream = new MemoryStream();
using (var stream = new FileStream(filepath, FileMode.Open))
......@@ -687,7 +696,7 @@ private void LogAllotAction(int allotId, string path, string actionName)
AllotId = allotId,
CreateDate = DateTime.Now,
CreateUser = _claim.GetUserId(),
FilePath = path??"",
FilePath = path ?? "",
ActionName = actionName
};
......
......@@ -244,6 +244,7 @@
<summary>
查询CheckBase
</summary>
<param name="allotId"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.AllotController.UpdateAllotShowFormula(Performance.DtoModels.AllotRequest)">
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Performance.DtoModels
{
public class EmpDeptCheckBase
{
public CheckBase CheckEmp { get; set; }
public CheckBase CheckDept { get; set; }
}
public class CheckBase
{
public IEnumerable<dynamic> Body { get; set; }
public IEnumerable<dynamic> Columns { get; set; }
}
}
......@@ -484,21 +484,23 @@ public void Generate(per_allot allot)
}
}
public Dictionary<string, object> GetCheckBase(int allotid)
public EmpDeptCheckBase GetCheckBase(int allotid)
{
var views = new[] { "view_check_base_emp", "view_check_base_dept" };
var names = new[] { "CheckEmp", "CheckDept" };
var dics = new Dictionary<string, object>();
for (int i = 0; i < views.Length; i++)
var empDeptCheckBase = new EmpDeptCheckBase()
{
var dic = new Dictionary<string, object>()
CheckEmp = new CheckBase()
{
{ "body",_service.QueryView(views[i],allotid)},
{ "columns",_service.QueryTableStructure(views[i])}
};
dics.Add(names[i], dic);
}
return dics;
Body = _service.QueryView("view_check_base_emp", allotid),
Columns = _service.QueryTableStructure("view_check_base_emp")
},
CheckDept = new CheckBase()
{
Body = _service.QueryView("view_check_base_dept", allotid),
Columns = _service.QueryTableStructure("view_check_base_dept")
},
};
return empDeptCheckBase;
}
/// <summary>
......
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