Commit 6894dee7 by 1391696987

手工录入传入参数改实体类

parent acfde9f7
......@@ -854,16 +854,16 @@ public ApiResponse GetDeptComparisonTotal([FromRoute] int allotId)
/// <summary>
/// 手工录入 - 下拉列表
/// </summary>
/// <param name="allotId"></param>
/// <param name="gather"></param>
/// <returns></returns>
[Route("getgatherdrop/{allotId}")]
[Route("getgatherdrop")]
[HttpPost]
public ApiResponse GetGatherDrop([FromRoute] int allotId,int userId)
public ApiResponse GetGatherDrop([FromBody] Gather gather)
{
if (allotId <= 0)
if (gather.AllotId <= 0)
return new ApiResponse(ResponseType.Fail, "参数错误", "allotid无效");
var relust = employeeService.GetGatherDrop(allotId,userId);
var relust = employeeService.GetGatherDrop(gather);
return new ApiResponse(ResponseType.OK, relust);
}
......@@ -892,7 +892,7 @@ public ApiResponse GetGatherHands([FromRoute] int allotId, [FromBody] GatherRequ
/// <returns></returns>
[Route("savegatherhands/{allotId}")]
[HttpPost]
public ApiResponse SaveGatherHands([FromRoute] int allotId, [FromBody] SaveGatherData request)
public ApiResponse SaveGatherHands([FromBody] int allotId, [FromBody] SaveGatherData request)
{
if (allotId <= 0)
return new ApiResponse(ResponseType.Fail, "参数错误", "allotid无效");
......@@ -911,20 +911,16 @@ public ApiResponse SaveGatherHands([FromRoute] int allotId, [FromBody] SaveGathe
/// <summary>
/// 手工录入列表 - 明细
/// </summary>
/// <param name="allotId"></param>
/// <param name="department">科室</param>
/// <param name="source">来源</param>
/// <param name="category">费用类型</param>
/// <param name="request">分页</param>
/// <param name="gather"></param>
/// <returns></returns>
[Route("getgather/{allotId},{department},{source},{category}")]
[Route("getgather")]
[HttpPost]
public ApiResponse GetGather([FromRoute] int allotId,string department, string source, string category, [FromBody] PersonParamsRequest request)
public ApiResponse GetGather([FromBody] Gather gather)
{
if (allotId <= 0 || string.IsNullOrEmpty(source) || string.IsNullOrEmpty(category) || string.IsNullOrEmpty(department) )
if (gather.AllotId <= 0 || string.IsNullOrEmpty(gather.Source) || string.IsNullOrEmpty(gather.Category) || string.IsNullOrEmpty(gather.Department) )
return new ApiResponse(ResponseType.Fail, "参数错误", "请检查allotId,source,category,department是否正确");
var result = employeeService.GetGather(allotId, department, source, category, request);
var result = employeeService.GetGather(gather);
return new ApiResponse(ResponseType.OK, result);
......@@ -933,18 +929,16 @@ public ApiResponse GetGather([FromRoute] int allotId,string department, string s
/// <summary>
/// 手工录入列表 - 汇总
/// </summary>
/// <param name="allotId"></param>
/// <param name="userId"></param>
/// <param name="request">分页</param>
/// <param name="gather"></param>
/// <returns></returns>
[Route("getgathertotal/{allotId}")]
[Route("getgathertotal")]
[HttpPost]
public ApiResponse GetGatherTotal([FromRoute] int allotId,int userId, [FromBody] PersonParamsRequest request)
public ApiResponse GetGatherTotal([FromBody] Gather gather)
{
if (allotId <= 0)
if (gather.AllotId <= 0)
return new ApiResponse(ResponseType.Fail, "参数错误", "allotid无效");
var result = employeeService.GetGatherTotal(allotId,userId, request);
var result = employeeService.GetGatherTotal(gather);
return new ApiResponse(ResponseType.OK, result);
}
......
......@@ -1356,11 +1356,11 @@
<param name="allotId"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.EmployeeController.GetGatherDrop(System.Int32,System.Int32)">
<member name="M:Performance.Api.Controllers.EmployeeController.GetGatherDrop(Performance.DtoModels.Gather)">
<summary>
手工录入 - 下拉列表
</summary>
<param name="allotId"></param>
<param name="gather"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.EmployeeController.GetGatherHands(System.Int32,Performance.DtoModels.GatherRequest)">
......@@ -1379,24 +1379,18 @@
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.EmployeeController.GetGather(System.Int32,System.String,System.String,System.String,Performance.DtoModels.PersonParamsRequest)">
<member name="M:Performance.Api.Controllers.EmployeeController.GetGather(Performance.DtoModels.Gather)">
<summary>
手工录入列表 - 明细
</summary>
<param name="allotId"></param>
<param name="department">科室</param>
<param name="source">来源</param>
<param name="category">费用类型</param>
<param name="request">分页</param>
<param name="gather"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.EmployeeController.GetGatherTotal(System.Int32,System.Int32,Performance.DtoModels.PersonParamsRequest)">
<member name="M:Performance.Api.Controllers.EmployeeController.GetGatherTotal(Performance.DtoModels.Gather)">
<summary>
手工录入列表 - 汇总
</summary>
<param name="allotId"></param>
<param name="userId"></param>
<param name="request">分页</param>
<param name="gather"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ExConfigController.Extract(Performance.DtoModels.ModModuleRequest)">
......
......@@ -50,6 +50,14 @@ public class GatherTotalRequest
public string States { get; set; }
public string Remark { get; set; }
}
public class Gather: PersonParamsRequest
{
public int AllotId { get; set; }
public int UserId { get; set; }
public string Department { get; set; }
public string Source { get; set; }
public string Category { get; set; }
}
public class GatherInfoRequest
{
public string Source { get; set; }
......
......@@ -1251,14 +1251,17 @@ public ComparisonResponse<DtoModels.Comparison<DeptComparisonTotal>> GetDeptComp
#region 手工数据录入
public List<GatherDropResponse> GetGatherDrop(int allotId,int userId)
public List<GatherDropResponse> GetGatherDrop(Gather gather)
{
var collectPermission = perforcollectpermissionRepository.GetEntities(t=>t.UserId == userId).Select(t=> t.SheetName).Distinct();
var collectPermission = perforcollectpermissionRepository.GetEntities(t=>t.UserId == gather.UserId).Select(t=> t.SheetName).Distinct();
var perSheets = perforPersheetRepository.GetEntities(t => t.AllotID == allotId && new[] { 3, 4, 7 }.Contains(t.SheetType.Value) && collectPermission.Contains(t.SheetName));
var perSheets = perforPersheetRepository.GetEntities(t => t.AllotID == gather.AllotId && new[] { 3, 4, 7 }.Contains(t.SheetType.Value)).Select(s=> new{
s.ID,
SheetName = Regex.Replace(s.SheetName.Replace(" ", "").Replace(".", ""), "[0-9]", "")
});
if (perSheets == null || !perSheets.Any())
{
var allot = perallotRepository.GetEntity(t => t.ID == allotId);
var allot = perallotRepository.GetEntity(t => t.ID == gather.AllotId);
var list = perallotRepository.GetEntities(t => t.HospitalId == allot.HospitalId);
if (list == null || !list.Any(t => t.ID == allot.ID)) return new List<GatherDropResponse>();
......@@ -1268,17 +1271,17 @@ public List<GatherDropResponse> GetGatherDrop(int allotId,int userId)
var index = list.IndexOf(list.First(t => t.ID == allot.ID));
// 先取上一个月的绩效Id,若没有取最后一个月的绩效Id,若都不存在则获取allotId为-1的数据
allotId = index + 1 < list.Count ? list[index + 1].ID : list.First().ID;
if (allotId == allot.ID) return new List<GatherDropResponse>();
gather.AllotId = index + 1 < list.Count ? list[index + 1].ID : list.First().ID;
if (gather.AllotId == allot.ID) return new List<GatherDropResponse>();
}
//var sheets = perSheets.Select(t => new GatherDropResponse() { Label = t.SheetName, Value = t.SheetName });
var imHeaders = imheaderRepository.GetEntities(t => t.AllotID == allotId);
var imHeaders = imheaderRepository.GetEntities(t => t.AllotID == gather.AllotId);
var exresultgather = exresultgatherRepository.GetEntities(t => t.AllotId == allotId);
var exresultgather = exresultgatherRepository.GetEntities(t => t.AllotId == gather.AllotId);
foreach (var item in exresultgather.Select(t => new { t.Category, t.Source }).Distinct())
......@@ -1380,12 +1383,12 @@ public void SaveGatherHands(int allotId, SaveGatherData request)
exresultgatherRepository.AddRange(depts.ToArray());
}
public GatherInfo GetGather(int allotId,string department, string source,string category, PersonParamsRequest request)
public GatherInfo GetGather(Gather gather)
{
Expression<Func<ex_result_gather, bool>> exp = t => t.AllotId == allotId && t.Department == department && t.Source.Contains(source) && t.Category.Contains(category);
Expression<Func<ex_result_gather, bool>> exp = t => t.AllotId == gather.AllotId && t.Department == gather.Department && t.Source.Contains(gather.Source) && t.Category.Contains(gather.Category);
if (request != null && !string.IsNullOrEmpty(request.SearchQuery))
exp = exp.And(t => t.DoctorName.Contains(request.SearchQuery) || t.PersonnelNumber.Contains(request.SearchQuery));
if (gather != null && !string.IsNullOrEmpty(gather.SearchQuery))
exp = exp.And(t => t.DoctorName.Contains(gather.SearchQuery) || t.PersonnelNumber.Contains(gather.SearchQuery));
var datas = exresultgatherRepository.GetEntities(exp);
......@@ -1398,7 +1401,7 @@ public GatherInfo GetGather(int allotId,string department, string source,string
DoctorName = t.DoctorName,
Detail = new GatherInfoFee
{
Category = category,
Category = gather.Category,
Fee = t.Fee
},
});
......@@ -1412,25 +1415,25 @@ public GatherInfo GetGather(int allotId,string department, string source,string
GatherInfo gatherInfo = new GatherInfo()
{
Heads = head,
Datas = result.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize).ToList(),
CurrentPage = request.PageNumber,
Datas = result.Skip((gather.PageNumber - 1) * gather.PageSize).Take(gather.PageSize).ToList(),
CurrentPage = gather.PageNumber,
TotalCount = result.Count(),
PageSize = request.PageSize,
TotalPages = (int)Math.Ceiling((double)result.Count() / request.PageSize)
PageSize = gather.PageSize,
TotalPages = (int)Math.Ceiling((double)result.Count() / gather.PageSize)
};
return gatherInfo;
}
public GatherResponse GetGatherTotal(int allotId, int userId, PersonParamsRequest request)
public GatherResponse GetGatherTotal(Gather gather)
{
Expression<Func<ex_result_gather, bool>> exp = t => t.AllotId == allotId;
Expression<Func<ex_result_gather, bool>> exp = t => t.AllotId == gather.AllotId;
if (request != null && !string.IsNullOrEmpty(request.SearchQuery))
if (gather != null && !string.IsNullOrEmpty(gather.SearchQuery))
{
exp = exp.And(t => t.Category.Contains(request.SearchQuery));
exp = exp.And(t => t.Category.Contains(gather.SearchQuery));
}
var userSource = perforcollectpermissionRepository.GetEntities(t => t.UserId == userId)
var userSource = perforcollectpermissionRepository.GetEntities(t => t.UserId == gather.UserId)
.Select(s => Regex.Replace(s.SheetName.Replace(" ", "").Replace(".", ""), "[0-9]", ""))
.Distinct().ToList();
......@@ -1474,11 +1477,11 @@ public GatherResponse GetGatherTotal(int allotId, int userId, PersonParamsReques
GatherResponse gatherResponse = new GatherResponse()
{
Heads = head,
Datas = data.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize).ToList(),
CurrentPage = request.PageNumber,
Datas = data.Skip((gather.PageNumber - 1) * gather.PageSize).Take(gather.PageSize).ToList(),
CurrentPage = gather.PageNumber,
TotalCount = data.Count(),
PageSize = request.PageSize,
TotalPages = (int)Math.Ceiling((double)data.Count() / request.PageSize)
PageSize = gather.PageSize,
TotalPages = (int)Math.Ceiling((double)data.Count() / gather.PageSize)
};
return gatherResponse;
......
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