Commit d74bb436 by 纪旭 韦

详情接口增加科室来源

parent 18253a0a
......@@ -770,7 +770,6 @@ public ApiResponse GetGatherHands([FromRoute] int allotId, [FromBody] GatherRequ
{
if (allotId <= 0)
return new ApiResponse(ResponseType.Fail, "参数错误", "allotid无效");
var relust = employeeService.GetGatherHands(allotId, request);
return new ApiResponse(ResponseType.OK, relust);
}
......@@ -783,12 +782,12 @@ public ApiResponse GetGatherHands([FromRoute] int allotId, [FromBody] GatherRequ
/// <returns></returns>
[Route("savegatherhands/{allotId}")]
[HttpPost]
public ApiResponse SaveGatherHands(int allotId, [FromBody] SaveGatherData request)
public ApiResponse SaveGatherHands([FromRoute] int allotId, [FromBody] SaveGatherData request)
{
if (allotId <= 0)
return new ApiResponse(ResponseType.Fail, "参数错误", "allotid无效");
if (string.IsNullOrEmpty(request.Source) || string.IsNullOrEmpty(request.Category))
return new ApiResponse(ResponseType.OK);
return new ApiResponse(ResponseType.Fail);
employeeService.SaveGatherHands(allotId, request);
return new ApiResponse(ResponseType.OK);
......
......@@ -94,6 +94,7 @@ public class ColumnHeadsConfig
{
public static List<Heads> GatherHeads { get; } = new List<Heads>
{
new Heads{Column="来源",Name=nameof(GatherInfoRequest.Source)},
new Heads{Column="科室",Name=nameof(GatherInfoRequest.Department)},
new Heads{Column="医生姓名",Name=nameof(GatherInfoRequest.DoctorName)},
new Heads{Column="人员工号",Name=nameof(GatherInfoRequest.PersonnelNumber)},
......
......@@ -48,6 +48,7 @@ public class GatherTotalRequest
}
public class GatherInfoRequest
{
public string Source { get; set; }
public string Department { get; set; }
public string DoctorName { get; set; }
public string PersonnelNumber { get; set; }
......
......@@ -17,6 +17,7 @@
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Text.RegularExpressions;
namespace Performance.Services
{
......@@ -1165,8 +1166,8 @@ public List<GatherDropResponse> GetGatherDrop(int allotId)
{
var drop = new GatherDropResponse();
var header = imHeaders.Where(t => t.SheetID == sheet.ID && !cellValue.Contains(t.CellValue)).Select(t => t.CellValue).Distinct();
drop.Label = sheet.SheetName.Split(' ')[1];
drop.Value = sheet.SheetName.Split(' ')[1];
drop.Label = Regex.Replace(sheet.SheetName.Replace(" ", "").Replace(".", ""), "[0-9]", "")/*sheet.SheetName.Split(' ')[1]*/;
drop.Value = Regex.Replace(sheet.SheetName.Replace(" ", "").Replace(".", ""), "[0-9]", "")/*sheet.SheetName.Split(' ')[1]*/;
drop.Children = header.Select(t => new GatherDropResponse() { Label = t, Value = t }).ToList();
result.Add(drop);
}
......@@ -1182,6 +1183,7 @@ public HandsonTable GetGatherHands(int AllotId, GatherRequest request)
HeadName = t.Value,
Visible = 1
}).ToList());
if (result.Columns != null && result.Columns.Any())
{
......@@ -1196,8 +1198,12 @@ public HandsonTable GetGatherHands(int AllotId, GatherRequest request)
column.Type = "text";
}
}
var data = exresultgatherRepository.GetEntities(t => t.AllotId == AllotId && t.Source.Contains(request.Source) && t.Category.Contains(request.Category));
List<ex_result_gather> data = new List<ex_result_gather>();
if (!string.IsNullOrEmpty(request.Source) && !string.IsNullOrEmpty(request.Category))
{
data = exresultgatherRepository.GetEntities(t => t.AllotId == AllotId && t.Source.Contains(request.Source) && t.Category.Contains(request.Category));
}
if (data == null)
return result;
......@@ -1243,15 +1249,16 @@ public void SaveGatherHands(int allotId, SaveGatherData request)
public GatherInfo GetGather(int allotId,string department,string source, PersonParamsRequest request)
{
Expression<Func<ex_result_gather, bool>> exp = t => t.AllotId == allotId && t.Department.Contains(department) && t.Source.Contains(source) && (t.PersonnelNumber != "" || t.DoctorName != "");
Expression<Func<ex_result_gather, bool>> exp = t => t.AllotId == allotId && t.Department.Contains(department) && t.Source.Contains(source);
if (request != null && !string.IsNullOrEmpty(request.SearchQuery))
exp = exp.And(t => t.AllotId == allotId && t.Department.Contains(department) && t.Source.Contains(source) && (t.PersonnelNumber != "" || t.DoctorName != "") && t.DoctorName.Contains(request.SearchQuery) || t.PersonnelNumber.Contains(request.SearchQuery));
exp = exp.And(t => t.AllotId == allotId && t.Department.Contains(department) && t.Source.Contains(source) && t.DoctorName.Contains(request.SearchQuery) || t.PersonnelNumber.Contains(request.SearchQuery));
var datas = exresultgatherRepository.GetEntities(exp);
var result = datas.GroupBy(a => new { a.Department, a.DoctorName, a.PersonnelNumber }).Select(t => new
var result = datas.GroupBy(a => new {a.Source, a.Department, a.DoctorName, a.PersonnelNumber }).Select(t => new
{
Source = t.Key.Source,
Department = t.Key.Department,
DoctorName = t.Key.DoctorName,
PersonnelNumber = t.Key.PersonnelNumber,
......@@ -1267,6 +1274,7 @@ public GatherInfo GetGather(int allotId,string department,string source, PersonP
{
GatherInfoRequest gatherInfoRequest = new GatherInfoRequest()
{
Source = Regex.Replace(item.Source.Replace(" ", "").Replace(".", ""), "[0-9]", ""),
Department = item.Department,
DoctorName = item.DoctorName,
PersonnelNumber = item.PersonnelNumber,
......@@ -1329,17 +1337,20 @@ public GatherResponse GetGatherTotal(int allotId, PersonParamsRequest request)
TotalPages = data.TotalPages
};*/
#endregion
Expression<Func<ex_result_gather, bool>> exp = t => t.AllotId == allotId && (t.DoctorName != "" || t.PersonnelNumber != "");
Expression<Func<ex_result_gather, bool>> exp = t => t.AllotId == allotId;
//var datas = exresultgatherRepository.GetEntities(t => t.AllotId == allotId && (t.DoctorName != "" || t.PersonnelNumber != ""));
if (request != null && !string.IsNullOrEmpty(request.SearchQuery))
{
exp = exp.And(t => t.AllotId == allotId && (t.DoctorName != "" || t.PersonnelNumber != "") && t.Department.Contains(request.SearchQuery) || t.Source.Contains(request.SearchQuery));
exp = exp.And(t => t.AllotId == allotId&& t.Department.Contains(request.SearchQuery) || t.Source.Contains(request.SearchQuery));
//datas = exresultgatherRepository.GetEntities(t => t.AllotId == allotId && (t.DoctorName != "" || t.PersonnelNumber != "") && t.Department.Contains(request.SearchQuery) || t.Source.Contains(request.SearchQuery));
try
{
Convert.ToDecimal(request.SearchQuery);
exp = t => t.AllotId == allotId && (t.DoctorName != "" || t.PersonnelNumber != "");
exp = t => t.AllotId == allotId;
//datas = exresultgatherRepository.GetEntities(t => t.AllotId == allotId && (t.DoctorName != "" || t.PersonnelNumber != ""));
}
catch
{
......@@ -1347,15 +1358,13 @@ public GatherResponse GetGatherTotal(int allotId, PersonParamsRequest request)
}
}
var datas = exresultgatherRepository.GetEntities(exp);
var datas = exresultgatherRepository.GetEntities(exp);
var result = datas.GroupBy(a => new { a.AllotId,a.Department,a.Source}).Select(t => new
{
ID = t.Key.AllotId,
Department = t.Key.Department,
Source = t.Key.Source.Split(' ')[1],
Source = t.Key.Source,
Fee = t.Sum(a=> a.Fee)
});
......@@ -1368,7 +1377,7 @@ public GatherResponse GetGatherTotal(int allotId, PersonParamsRequest request)
{
ID = item.ID,
Department = item.Department,
Source = item.Source,
Source = Regex.Replace(item.Source.Replace(" ","").Replace(".",""),"[0-9]","")/*item.Source.Split(' ')[1]*/,
Fee = item.Fee
};
gatherTotalRequests.Add(gatherTotalRequest);
......
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