Commit 4029533d by 纪旭 韦

no message

parent 2b16cb62
......@@ -819,15 +819,14 @@ public ApiResponse GetGather([FromRoute] int allotId, [FromBody] PersonParamsReq
/// <returns></returns>
[Route("getgathertotal/{allotId}")]
[HttpPost]
public ApiResponse<List<GatherTotalRequest>> GetGatherTotal([FromRoute] int allotId, [FromBody] PersonParamsRequest request)
{
//var allot = allotService.GetAllot(allotId);
//if (null == allot)
// throw new PerformanceException("当前记录不存在");
var list = employeeService.GetGatherTotal(allotId,request);
if (null == list)
throw new PerformanceException("当前记录不存在");
return new ApiResponse<List<GatherTotalRequest>>(ResponseType.OK, "ok", list);
public ApiResponse GetGatherTotal([FromRoute] int allotId, [FromBody] PersonParamsRequest request)
{
if (allotId <= 0)
return new ApiResponse(ResponseType.Fail, "参数错误", "allotid无效");
var result = employeeService.GetGather(allotId, request);
return new ApiResponse(ResponseType.OK, result);
}
///// <summary>
///// 手工录入列表 - 汇总
......
......@@ -249,7 +249,7 @@ public AutoMapperConfigs()
.ReverseMap();
CreateMap<ag_secondallot, IssuedPromptResponse>()
.ReverseMap();
.ReverseMap();
}
}
}
using Performance.EntityModels;
using Performance.DtoModels.Request;
using Performance.EntityModels;
using Performance.Infrastructure.Models;
using System.Collections.Generic;
......@@ -7,7 +8,17 @@ namespace Performance.DtoModels
public class GatherResponse
{
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 TotalPages { get; set; }
public int PageSize { get; set; }
......
......@@ -9,6 +9,7 @@
using Performance.DtoModels.Request;
using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Infrastructure.Models;
using Performance.Repository;
using Performance.Services.AllotCompute;
using System;
......@@ -1237,7 +1238,7 @@ public void SaveGatherHands(int allotId, SaveGatherData request)
exresultgatherRepository.AddRange(depts.ToArray());
}
public GatherResponse GetGather(int allotId, PersonParamsRequest request)
public GatherInfo GetGather(int allotId, PersonParamsRequest request)
{
var head = ColumnHeadsConfig.GatherHeads;
head.ForEach(t =>
......@@ -1252,31 +1253,58 @@ public GatherResponse GetGather(int allotId, PersonParamsRequest request)
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,
Datas = data,
Datas = Info,
CurrentPage = data.CurrentPage,
TotalCount = data.TotalCount,
PageSize = data.PageSize,
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;
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));
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>>(list);
return deptTotal;
List<GatherTotalRequest> deptTotal = Mapper.Map<List<GatherTotalRequest>>(data);
return new GatherResponse()
{
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