Commit 9507bf30 by 纪旭 韦

把之前去掉的Heads加回来了

parent 3cde66a2
......@@ -804,7 +804,7 @@ public ApiResponse SaveGatherHands(int allotId, [FromBody] SaveGatherData reques
/// <returns></returns>
[Route("getgather/{allotId}")]
[HttpPost]
public ApiResponse GetGather([FromRoute] int allotId, string department, string source,[FromBody] PersonParamsRequest request)
public ApiResponse GetGather([FromRoute] int allotId,string department,string source,[FromBody] PersonParamsRequest request)
{
if (allotId <= 0)
return new ApiResponse(ResponseType.Fail, "参数错误", "allotid无效");
......@@ -819,7 +819,7 @@ public ApiResponse GetGather([FromRoute] int allotId, string department, string
/// 手工录入列表 - 汇总
/// </summary>
/// <param name="allotId"></param>
/// <param name="request"></param>
/// <param name="request">分页</param>
/// <returns></returns>
[Route("getgathertotal/{allotId}")]
[HttpPost]
......@@ -832,18 +832,6 @@ public ApiResponse GetGatherTotal([FromRoute] int allotId, [FromBody] PersonPara
return new ApiResponse(ResponseType.OK, result);
}
///// <summary>
///// 手工录入列表 - 汇总
///// </summary>
///// <param name="allotId"></param>
///// <param name="request"></param>
///// <returns></returns>
//[Route("getgathertotal/{allotId}")]
//[HttpPost]
//public ApiResponse GetGatherTotal([FromRoute] int allotId, [FromBody] PersonParamsRequest request)
//{
// return new ApiResponse(ResponseType.OK);
//}
#endregion
}
}
......@@ -1228,7 +1228,7 @@
手工录入列表 - 汇总
</summary>
<param name="allotId"></param>
<param name="request"></param>
<param name="request">分页</param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ExConfigController.Extract(Performance.DtoModels.ModModuleRequest)">
......
......@@ -94,18 +94,18 @@ public class ColumnHeadsConfig
{
public static List<Heads> GatherHeads { get; } = new List<Heads>
{
new Heads{Column="科室",Name=nameof(ex_result_gather.Department)},
new Heads{Column="医生姓名",Name=nameof(ex_result_gather.DoctorName)},
new Heads{Column="人员工号",Name=nameof(ex_result_gather.PersonnelNumber)},
new Heads{Column="费用类型",Name=nameof(ex_result_gather.Category)},
new Heads{Column="费用",Name=nameof(ex_result_gather.Fee)},
new Heads{Column="科室",Name=nameof(GatherInfoRequest.Department)},
new Heads{Column="医生姓名",Name=nameof(GatherInfoRequest.DoctorName)},
new Heads{Column="人员工号",Name=nameof(GatherInfoRequest.PersonnelNumber)},
new Heads{Column="费用类型",Name=nameof(GatherInfoFee.Category)},
new Heads{Column="费用",Name=nameof(GatherInfoFee.Fee)},
};
public static List<Heads> GatherTotal { get; } = new List<Heads>
{
new Heads{Column="科室",Name=nameof(ex_result_gather.Department)},
new Heads{Column="来源",Name=nameof(ex_result_gather.Source)},
new Heads{Column="数值",Name=nameof(ex_result_gather.Fee)}
new Heads{Column="科室",Name=nameof(GatherTotalRequest.Department)},
new Heads{Column="来源",Name=nameof(GatherTotalRequest.Source)},
new Heads{Column="费用",Name=nameof(GatherTotalRequest.Fee)}
};
}
......
......@@ -57,6 +57,6 @@ public class GatherInfoFee
{
public string Category { get; set; }
public decimal? Value { get; set; }
public decimal? Fee { get; set; }
}
}
......@@ -1272,14 +1272,22 @@ public GatherInfo GetGather(int allotId,string department,string source, PersonP
GatherInfoFee gatherInfoFee = new GatherInfoFee()
{
Category = item2.Title,
Value = item2.Value
Fee = item2.Value
};
gatherInfoRequest.Detail.Add(gatherInfoFee);
}
gatherInfoRequests.Add(gatherInfoRequest);
}
var head = ColumnHeadsConfig.GatherHeads;
head.ForEach(t =>
{
t.Name = t.Name.ToLower();
});
GatherInfo gatherInfo = new GatherInfo()
{
Heads = head,
Datas = gatherInfoRequests.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize).ToList(),
CurrentPage = request.PageNumber,
TotalCount = gatherInfoRequests.Count(),
......@@ -1289,12 +1297,6 @@ public GatherInfo GetGather(int allotId,string department,string source, PersonP
return gatherInfo;
}
public List<ex_result_gather> GetGatherCategory(int allotId,string department, string source)
{
return exresultgatherRepository.GetEntities(a => a.AllotId == allotId && a.Department == department && a.Source == source).ToList();
}
public GatherResponse GetGatherTotal(int allotId, PersonParamsRequest request)
{
#region 旧的
......@@ -1333,10 +1335,12 @@ public GatherResponse GetGatherTotal(int allotId, PersonParamsRequest request)
var result = datas.GroupBy(a => new { a.Department,a.Source}).Select(t => new
{
Department = t.Key.Department,
Source = t.Key.Source,
Source = t.Key.Source.Split(' ')[1],
Fee = t.Sum(a=> a.Fee)
});
List<GatherTotalRequest> gatherTotalRequests = new List<GatherTotalRequest>();
foreach (var item in result.ToList())
{
......@@ -1349,8 +1353,14 @@ public GatherResponse GetGatherTotal(int allotId, PersonParamsRequest request)
gatherTotalRequests.Add(gatherTotalRequest);
}
var head = ColumnHeadsConfig.GatherTotal;
head.ForEach(t =>
{
t.Name = t.Name.ToLower();
});
GatherResponse gatherResponse = new GatherResponse()
{
Heads = head,
Datas = gatherTotalRequests.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize).ToList(),
CurrentPage = request.PageNumber,
TotalCount = gatherTotalRequests.Count(),
......
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