Commit d74bb436 by 纪旭 韦

详情接口增加科室来源

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