Commit 3c8c03ca by ruyun.zhang

工作量加载选项/手工录入取消聚合条件

parent 4cecffe9
...@@ -273,47 +273,47 @@ public ApiResponse GenerateAsync([CustomizeValidator(RuleSet = "Delete"), FromBo ...@@ -273,47 +273,47 @@ public ApiResponse GenerateAsync([CustomizeValidator(RuleSet = "Delete"), FromBo
if (null == allot || string.IsNullOrEmpty(allot.Path)) if (null == allot || string.IsNullOrEmpty(allot.Path))
throw new PerformanceException("当前绩效记录不存在或没有上传数据文件"); throw new PerformanceException("当前绩效记录不存在或没有上传数据文件");
//if (_evn.IsEnvironment("Localhost")) if (_evn.IsEnvironment("Localhost"))
//{ {
// var tasks = _taskService.GetTasks(-1); //var tasks = _taskService.GetTasks(-1);
// var status = new int[] { (int)Background.Status.等待, (int)Background.Status.执行中 }; //var status = new int[] { (int)Background.Status.等待, (int)Background.Status.执行中 };
// if (tasks.Any(w => w.Argument == allot.ID.ToString() && w.JobType == (int)Background.JobType.生成测算表 && status.Contains(w.Status))) //if (tasks.Any(w => w.Argument == allot.ID.ToString() && w.JobType == (int)Background.JobType.生成测算表 && status.Contains(w.Status)))
// return new ApiResponse(ResponseType.OK, "当前绩效正在生成中,请等待生成完成后重新生成"); // return new ApiResponse(ResponseType.OK, "当前绩效正在生成中,请等待生成完成后重新生成");
// if (allot.States == (int)AllotStates.Wait) //if (allot.States == (int)AllotStates.Wait)
// return new ApiResponse(ResponseType.OK, "当前绩效正在等待生成"); // return new ApiResponse(ResponseType.OK, "当前绩效正在等待生成");
// _logManageService.WriteMsg("生成绩效准备中", $"准备生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效,请稍等!", 1, allot.ID, "ReceiveMessage", true); //_logManageService.WriteMsg("生成绩效准备中", $"准备生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效,请稍等!", 1, allot.ID, "ReceiveMessage", true);
// _allotService.UpdateAllotStates(allot.ID, (int)AllotStates.Wait, EnumHelper.GetDescription(AllotStates.Wait), allot.Generate); //_allotService.UpdateAllotStates(allot.ID, (int)AllotStates.Wait, EnumHelper.GetDescription(AllotStates.Wait), allot.Generate);
// _allotService.Generate(allot); _allotService.Generate(allot);
//} }
//else else
//{ {
var tasks = _taskService.GetTasks(-1); var tasks = _taskService.GetTasks(-1);
var status = new int[] { (int)Background.Status.等待, (int)Background.Status.执行中 }; var status = new int[] { (int)Background.Status.等待, (int)Background.Status.执行中 };
if (tasks.Any(w => w.Argument == allot.ID.ToString() && w.JobType == (int)Background.JobType.生成测算表 && status.Contains(w.Status))) if (tasks.Any(w => w.Argument == allot.ID.ToString() && w.JobType == (int)Background.JobType.生成测算表 && status.Contains(w.Status)))
return new ApiResponse(ResponseType.OK, "当前绩效正在生成中,请等待生成完成后重新生成"); return new ApiResponse(ResponseType.OK, "当前绩效正在生成中,请等待生成完成后重新生成");
if (allot.States == (int)AllotStates.等待) if (allot.States == (int)AllotStates.等待)
return new ApiResponse(ResponseType.OK, "当前绩效正在等待生成"); return new ApiResponse(ResponseType.OK, "当前绩效正在等待生成");
_logManageService.WriteMsg("生成绩效准备中", $"准备生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效,请稍等!", 1, allot.ID, "ReceiveMessage", true); _logManageService.WriteMsg("生成绩效准备中", $"准备生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效,请稍等!", 1, allot.ID, "ReceiveMessage", true);
_allotService.UpdateAllotStates(allot.ID, (int)AllotStates.等待, EnumHelper.GetDescription(AllotStates.等待), allot.Generate); _allotService.UpdateAllotStates(allot.ID, (int)AllotStates.等待, EnumHelper.GetDescription(AllotStates.等待), allot.Generate);
//_backgroundTaskQueue.QueueBackgroundWorkItem(async token => //_backgroundTaskQueue.QueueBackgroundWorkItem(async token =>
//{ //{
// using (var scope = _serviceScopeFactory.CreateScope()) // using (var scope = _serviceScopeFactory.CreateScope())
// { // {
// var scopedServices = scope.ServiceProvider.GetRequiredService<AllotService>(); // var scopedServices = scope.ServiceProvider.GetRequiredService<AllotService>();
// scopedServices.Generate(allot); // scopedServices.Generate(allot);
// await Task.Delay(TimeSpan.FromSeconds(5), token); // await Task.Delay(TimeSpan.FromSeconds(5), token);
// } // }
//}); //});
_taskService.Add(Background.JobType.生成测算表, allot.ID.ToString()); _taskService.Add(Background.JobType.生成测算表, allot.ID.ToString());
//} }
_logManageService.WriteMsg("等待绩效生成", $"等待绩效生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效!", 1, allot.ID, "ReceiveMessage"); _logManageService.WriteMsg("等待绩效生成", $"等待绩效生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效!", 1, allot.ID, "ReceiveMessage");
//_allotService.Generate(allot, email); //_allotService.Generate(allot, email);
......
...@@ -33,12 +33,10 @@ public ExpirationLimitMiddleware(RequestDelegate next) ...@@ -33,12 +33,10 @@ public ExpirationLimitMiddleware(RequestDelegate next)
}); });
context.Response.ContentType = "application/json"; context.Response.ContentType = "application/json";
await context.Response.WriteAsync(JsonHelper.Serialize(response)); await context.Response.WriteAsync(JsonHelper.Serialize(response));
return;
} }
else if (FunctionLimit.Limit.ExpirationTime > DateTime.Now) else if (FunctionLimit.Limit.ExpirationTime > DateTime.Now)
{ {
await _next.Invoke(context); await _next.Invoke(context);
return;
} }
else else
{ {
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
}, },
"Performance.Api": { "Performance.Api": {
"commandName": "Project", "commandName": "Project",
"launchBrowser": true,
"launchUrl": "index.html", "launchUrl": "index.html",
"environmentVariables": { "environmentVariables": {
//"ASPNETCORE_ENVIRONMENT": "Development" //"ASPNETCORE_ENVIRONMENT": "Development"
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
}, },
"AppConnection": { "AppConnection": {
//"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;", //"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"PerformanceConnectionString": "server=192.168.18.166;database=db_test_beiliu;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;" //"PerformanceConnectionString": "server=192.168.18.166;database=db_test_beiliu;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;"
//"PerformanceConnectionString": "server=116.62.245.55;database=db_performance;uid=suvalue;pwd=suvalue2017;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;" "PerformanceConnectionString": "server=116.62.245.55;database=db_performance_cxjx;uid=cxjx;pwd=Suvalue@cxjx;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;"
}, },
"AppOptions": { "AppOptions": {
"OpenOAuth": true "OpenOAuth": true
......
...@@ -207,7 +207,7 @@ public void ImportWorkloadData(per_allot allot, object parameters) ...@@ -207,7 +207,7 @@ public void ImportWorkloadData(per_allot allot, object parameters)
/// 查询工作量数据(新) /// 查询工作量数据(新)
/// </summary> /// </summary>
/// <param name="allotid"></param> /// <param name="allotid"></param>
public IEnumerable<viewSecondReportWorkloadResponse> QueryWorkloadDatas(int allotid, string accountingunit, string[] unittypes, int hospitalid) public IEnumerable<viewSecondReportWorkloadResponse> QueryWorkloadData(int allotid, string accountingunit, string[] unittypes, int hospitalid)
{ {
using (var connection = context.Database.GetDbConnection()) using (var connection = context.Database.GetDbConnection())
{ {
...@@ -228,34 +228,6 @@ FROM view_second_report_workload ...@@ -228,34 +228,6 @@ FROM view_second_report_workload
} }
} }
} }
/// <summary>
/// 查询工作量数据
/// </summary>
/// <param name="allotid"></param>
public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, string accountingunit, string[] unittypes, int hospitalid)
{
using (var connection = context.Database.GetDbConnection())
{
if (connection.State != ConnectionState.Open) connection.Open();
try
{
string clear = @"
SELECT DISTINCT AccountingUnit as Department,if(ifnull(DoctorName,'')='', '未知',DoctorName) DoctorName,PersonnelNumber,Category,ROUND(SUM(Fee),2) Fee
FROM view_second_report_workload
WHERE AllotId = @allotid AND UnitType in @unittypes AND AccountingUnit = @accountingunit
GROUP BY AccountingUnit,DoctorName,PersonnelNumber,Category
ORDER BY doctorname,Category;";
return connection.Query<report_original_workload>(clear, new { allotid, accountingunit, unittypes = unittypes.Union(new string[] { "通用工作量" }), hospitalid }, commandTimeout: 60 * 60);
}
catch (Exception)
{
throw;
}
}
}
/// <summary> /// <summary>
/// 查询门诊收入数据 /// 查询门诊收入数据
...@@ -328,12 +300,23 @@ public IEnumerable<string> GetSecondWorkloadMaps(int hospitalId) ...@@ -328,12 +300,23 @@ public IEnumerable<string> GetSecondWorkloadMaps(int hospitalId)
if (connection.State != ConnectionState.Open) connection.Open(); if (connection.State != ConnectionState.Open) connection.Open();
try try
{ {
string query = $@"SELECT DISTINCT Category FROM ( string query = $@"
SELECT DISTINCT Category FROM (
SELECT IF(Source = 102,EName,ItemName) Category FROM ex_type t1 SELECT IF(Source = 102,EName,ItemName) Category FROM ex_type t1
LEFT JOIN ex_item t2 ON t1.Id = t2.TypeId LEFT JOIN ex_item t2 ON t1.Id = t2.TypeId
WHERE Source IN (102,7) AND HospitalId = @hospitalId WHERE Source IN (102,7) AND HospitalId = @hospitalId
UNION ALL
SELECT DISTINCT Category
FROM ex_result
WHERE IsDelete = 0 AND (source like '%医生组工作量%' or source like '%通用工作量%')
AND AllotId IN (SELECT DISTINCT ID FROM per_allot WHERE HospitalId = @hospitalId)
)TAB )TAB
WHERE IFNULL(Category,'')<>''"; WHERE IFNULL(Category,'')<>''
ORDER BY Category
";
return connection.Query<string>(query, new { hospitalId }, commandTimeout: 60 * 60); return connection.Query<string>(query, new { hospitalId }, commandTimeout: 60 * 60);
} }
catch (Exception) catch (Exception)
......
...@@ -1747,10 +1747,9 @@ public GatherResponse GetGatherTotal(Gather gather) ...@@ -1747,10 +1747,9 @@ public GatherResponse GetGatherTotal(Gather gather)
var datas = exresultgather var datas = exresultgather
.GroupBy(t => new { t.Department, t.Source, t.Category, t.Submitter }) .GroupBy(t => new { t.Source, t.Category, t.Submitter })
.Select(s => new .Select(s => new
{ {
Department = s.Key.Department,
Source = s.Key.Source, Source = s.Key.Source,
Category = s.Key.Category, Category = s.Key.Category,
UserId = s.Key.Submitter, UserId = s.Key.Submitter,
......
...@@ -787,7 +787,7 @@ public DeptWorkloadDetailResponse GetDeptWorkloadDetail(WorkDetailRequest reques ...@@ -787,7 +787,7 @@ public DeptWorkloadDetailResponse GetDeptWorkloadDetail(WorkDetailRequest reques
} }
} }
var viewData = perallotRepository.QueryWorkloadDatas(request.AllotId, accountingUnit, unitTypes, hospitalId); var viewData = perallotRepository.QueryWorkloadData(request.AllotId, accountingUnit, unitTypes, hospitalId);
if (viewData == null || !viewData.Any()) return new DeptWorkloadDetailResponse() { }; if (viewData == null || !viewData.Any()) return new DeptWorkloadDetailResponse() { };
var groupedData = viewData.GroupBy(item => new { item.Department, item.DoctorName, item.PersonnelNumber, item.SquadName }); var groupedData = viewData.GroupBy(item => new { item.Department, item.DoctorName, item.PersonnelNumber, item.SquadName });
......
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