Commit 863f9506 by 纪旭 韦

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

parent e7ee7bcb
...@@ -465,6 +465,15 @@ public ApiResponse Issued([FromBody] AllotRequest request) ...@@ -465,6 +465,15 @@ public ApiResponse Issued([FromBody] AllotRequest request)
if (null == allot) if (null == allot)
throw new PerformanceException("当前绩效记录不存在"); 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); var seconds = _resultComputeService.GetSeconds(allot);
if (request.isIssued == 1) if (request.isIssued == 1)
{ {
...@@ -509,7 +518,7 @@ public ApiResponse Issued([FromBody] AllotRequest request) ...@@ -509,7 +518,7 @@ public ApiResponse Issued([FromBody] AllotRequest request)
/// <returns></returns> /// <returns></returns>
[Route("getCheckBase")] [Route("getCheckBase")]
[HttpGet] [HttpGet]
public ApiResponse GetCheckBase([FromQuery]int allotId) public ApiResponse GetCheckBase([FromQuery] int allotId)
{ {
var res = _allotService.GetCheckBase(allotId); var res = _allotService.GetCheckBase(allotId);
return new ApiResponse(ResponseType.OK, res); return new ApiResponse(ResponseType.OK, res);
...@@ -581,14 +590,14 @@ public IActionResult ReservedDownload([FromBody] ReservedRequest request) ...@@ -581,14 +590,14 @@ public IActionResult ReservedDownload([FromBody] ReservedRequest request)
if (request.Source == 1) if (request.Source == 1)
{ {
name = "预留金额(按人员字典)"; name = "预留金额(按人员字典)";
ignoreColumns = new string[] { "hospitalid","source","newunittype","newaccountingunit"}; ignoreColumns = new string[] { "hospitalid", "source", "newunittype", "newaccountingunit" };
} }
else else
{ {
name = "预留金额(按发放科室)"; 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(); var memoryStream = new MemoryStream();
using (var stream = new FileStream(filepath, FileMode.Open)) using (var stream = new FileStream(filepath, FileMode.Open))
...@@ -687,7 +696,7 @@ private void LogAllotAction(int allotId, string path, string actionName) ...@@ -687,7 +696,7 @@ private void LogAllotAction(int allotId, string path, string actionName)
AllotId = allotId, AllotId = allotId,
CreateDate = DateTime.Now, CreateDate = DateTime.Now,
CreateUser = _claim.GetUserId(), CreateUser = _claim.GetUserId(),
FilePath = path??"", FilePath = path ?? "",
ActionName = actionName ActionName = actionName
}; };
......
...@@ -244,6 +244,7 @@ ...@@ -244,6 +244,7 @@
<summary> <summary>
查询CheckBase 查询CheckBase
</summary> </summary>
<param name="allotId"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.AllotController.UpdateAllotShowFormula(Performance.DtoModels.AllotRequest)"> <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) ...@@ -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 empDeptCheckBase = new EmpDeptCheckBase()
var names = new[] { "CheckEmp", "CheckDept" };
var dics = new Dictionary<string, object>();
for (int i = 0; i < views.Length; i++)
{ {
var dic = new Dictionary<string, object>() CheckEmp = new CheckBase()
{ {
{ "body",_service.QueryView(views[i],allotid)}, Body = _service.QueryView("view_check_base_emp", allotid),
{ "columns",_service.QueryTableStructure(views[i])} Columns = _service.QueryTableStructure("view_check_base_emp")
}; },
dics.Add(names[i], dic); CheckDept = new CheckBase()
} {
return dics; Body = _service.QueryView("view_check_base_dept", allotid),
Columns = _service.QueryTableStructure("view_check_base_dept")
},
};
return empDeptCheckBase;
} }
/// <summary> /// <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