Commit 4029533d by 纪旭 韦

no message

parent 2b16cb62
...@@ -819,15 +819,14 @@ public ApiResponse GetGather([FromRoute] int allotId, [FromBody] PersonParamsReq ...@@ -819,15 +819,14 @@ public ApiResponse GetGather([FromRoute] int allotId, [FromBody] PersonParamsReq
/// <returns></returns> /// <returns></returns>
[Route("getgathertotal/{allotId}")] [Route("getgathertotal/{allotId}")]
[HttpPost] [HttpPost]
public ApiResponse<List<GatherTotalRequest>> GetGatherTotal([FromRoute] int allotId, [FromBody] PersonParamsRequest request) public ApiResponse GetGatherTotal([FromRoute] int allotId, [FromBody] PersonParamsRequest request)
{ {
//var allot = allotService.GetAllot(allotId); if (allotId <= 0)
//if (null == allot) return new ApiResponse(ResponseType.Fail, "参数错误", "allotid无效");
// throw new PerformanceException("当前记录不存在");
var list = employeeService.GetGatherTotal(allotId,request); var result = employeeService.GetGather(allotId, request);
if (null == list)
throw new PerformanceException("当前记录不存在"); return new ApiResponse(ResponseType.OK, result);
return new ApiResponse<List<GatherTotalRequest>>(ResponseType.OK, "ok", list);
} }
///// <summary> ///// <summary>
///// 手工录入列表 - 汇总 ///// 手工录入列表 - 汇总
......
using Performance.EntityModels; using Performance.DtoModels.Request;
using Performance.EntityModels;
using Performance.Infrastructure.Models; using Performance.Infrastructure.Models;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -7,7 +8,17 @@ namespace Performance.DtoModels ...@@ -7,7 +8,17 @@ namespace Performance.DtoModels
public class GatherResponse public class GatherResponse
{ {
public List<Heads> Heads { get; set; } public List<Heads> Heads { get; set; }
public PageList<ex_result_gather> Datas { get; set; } public List<GatherTotalRequest> Datas { get; set; }
public int CurrentPage { get; set; }
public int TotalPages { get; set; }
public int PageSize { get; set; }
public int TotalCount { get; set; }
}
public class GatherInfo
{
public List<Heads> Heads { get; set; }
public List<ex_result_gather> Datas { get; set; }
public List<GatherRequest> Children { get; set; }
public int CurrentPage { get; set; } public int CurrentPage { get; set; }
public int TotalPages { get; set; } public int TotalPages { get; set; }
public int PageSize { get; set; } public int PageSize { get; set; }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
using Performance.DtoModels.Request; using Performance.DtoModels.Request;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Infrastructure.Models;
using Performance.Repository; using Performance.Repository;
using Performance.Services.AllotCompute; using Performance.Services.AllotCompute;
using System; using System;
...@@ -1237,7 +1238,7 @@ public void SaveGatherHands(int allotId, SaveGatherData request) ...@@ -1237,7 +1238,7 @@ public void SaveGatherHands(int allotId, SaveGatherData request)
exresultgatherRepository.AddRange(depts.ToArray()); exresultgatherRepository.AddRange(depts.ToArray());
} }
public GatherResponse GetGather(int allotId, PersonParamsRequest request) public GatherInfo GetGather(int allotId, PersonParamsRequest request)
{ {
var head = ColumnHeadsConfig.GatherHeads; var head = ColumnHeadsConfig.GatherHeads;
head.ForEach(t => head.ForEach(t =>
...@@ -1252,31 +1253,58 @@ public GatherResponse GetGather(int allotId, PersonParamsRequest request) ...@@ -1252,31 +1253,58 @@ public GatherResponse GetGather(int allotId, PersonParamsRequest request)
var data = exresultgatherRepository.GetGatherForPaging(request.PageNumber, request.PageSize, exp); var data = exresultgatherRepository.GetGatherForPaging(request.PageNumber, request.PageSize, exp);
List<ex_result_gather> Info = Mapper.Map<List<ex_result_gather>>(data);
return new GatherResponse() GatherInfo gatherInfo = new GatherInfo()
{ {
Heads = head, Heads = head,
Datas = data, Datas = Info,
CurrentPage = data.CurrentPage, CurrentPage = data.CurrentPage,
TotalCount = data.TotalCount, TotalCount = data.TotalCount,
PageSize = data.PageSize, PageSize = data.PageSize,
TotalPages = data.TotalPages TotalPages = data.TotalPages
}; };
List<GatherRequest> gatherRequest = new List<GatherRequest>();
foreach (var item in exresultgatherRepository.GetEntities(a => a.AllotId == allotId))
{
GatherRequest gatherRequest1 = new GatherRequest()
{
Source = "",
Category = item.Category
};
gatherRequest.Add(gatherRequest1);
}
gatherInfo.Children = gatherRequest;
return gatherInfo;
} }
public List<GatherTotalRequest> GetGatherTotal(int allotId, PersonParamsRequest request) public GatherResponse GetGatherTotal(int allotId, PersonParamsRequest request)
{ {
var head = ColumnHeadsConfig.GatherTotal;
head.ForEach(t =>
{
t.Name = t.Name.ToLower();
});
Expression<Func<ex_result_gather, bool>> exp = t => t.AllotId == allotId; Expression<Func<ex_result_gather, bool>> exp = t => t.AllotId == allotId;
if (request != null && !string.IsNullOrEmpty(request.SearchQuery)) if (request != null && !string.IsNullOrEmpty(request.SearchQuery))
exp = exp.And(t => t.Department.Contains(request.SearchQuery) || t.DoctorName.Contains(request.SearchQuery) || t.PersonnelNumber.Contains(request.SearchQuery) || t.Category.Contains(request.SearchQuery) || t.Source.Contains(request.SearchQuery)); exp = exp.And(t => t.Department.Contains(request.SearchQuery) || t.DoctorName.Contains(request.SearchQuery) || t.PersonnelNumber.Contains(request.SearchQuery) || t.Category.Contains(request.SearchQuery) || t.Source.Contains(request.SearchQuery));
var data = exresultgatherRepository.GetGatherForPaging(request.PageNumber, request.PageSize, exp);
var list = exresultgatherRepository.GetGatherForPaging(request.PageNumber, request.PageSize, exp); List<GatherTotalRequest> deptTotal = Mapper.Map<List<GatherTotalRequest>>(data);
return new GatherResponse()
List<GatherTotalRequest> deptTotal = Mapper.Map<List<GatherTotalRequest>>(list); {
return deptTotal; Heads = head,
Datas = deptTotal,
CurrentPage = data.CurrentPage,
TotalCount = data.TotalCount,
PageSize = data.PageSize,
TotalPages = data.TotalPages
};
} }
......
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