Commit 3c8c03ca by ruyun.zhang

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

parent 4cecffe9
......@@ -273,23 +273,23 @@ public ApiResponse GenerateAsync([CustomizeValidator(RuleSet = "Delete"), FromBo
if (null == allot || string.IsNullOrEmpty(allot.Path))
throw new PerformanceException("当前绩效记录不存在或没有上传数据文件");
//if (_evn.IsEnvironment("Localhost"))
//{
// var tasks = _taskService.GetTasks(-1);
// 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 (_evn.IsEnvironment("Localhost"))
{
//var tasks = _taskService.GetTasks(-1);
//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)))
// return new ApiResponse(ResponseType.OK, "当前绩效正在生成中,请等待生成完成后重新生成");
// if (allot.States == (int)AllotStates.Wait)
//if (allot.States == (int)AllotStates.Wait)
// return new ApiResponse(ResponseType.OK, "当前绩效正在等待生成");
// _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);
//_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.Generate(allot);
//}
//else
//{
_allotService.Generate(allot);
}
else
{
var tasks = _taskService.GetTasks(-1);
var status = new int[] { (int)Background.Status.等待, (int)Background.Status.执行中 };
......@@ -313,7 +313,7 @@ public ApiResponse GenerateAsync([CustomizeValidator(RuleSet = "Delete"), FromBo
//});
_taskService.Add(Background.JobType.生成测算表, allot.ID.ToString());
//}
}
_logManageService.WriteMsg("等待绩效生成", $"等待绩效生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效!", 1, allot.ID, "ReceiveMessage");
//_allotService.Generate(allot, email);
......
......@@ -33,12 +33,10 @@ public ExpirationLimitMiddleware(RequestDelegate next)
});
context.Response.ContentType = "application/json";
await context.Response.WriteAsync(JsonHelper.Serialize(response));
return;
}
else if (FunctionLimit.Limit.ExpirationTime > DateTime.Now)
{
await _next.Invoke(context);
return;
}
else
{
......
......@@ -21,6 +21,7 @@
},
"Performance.Api": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "index.html",
"environmentVariables": {
//"ASPNETCORE_ENVIRONMENT": "Development"
......
......@@ -7,8 +7,8 @@
},
"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=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=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_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": {
"OpenOAuth": true
......
......@@ -207,7 +207,7 @@ public void ImportWorkloadData(per_allot allot, object parameters)
/// 查询工作量数据(新)
/// </summary>
/// <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())
{
......@@ -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>
/// 查询门诊收入数据
......@@ -328,12 +300,23 @@ public IEnumerable<string> GetSecondWorkloadMaps(int hospitalId)
if (connection.State != ConnectionState.Open) connection.Open();
try
{
string query = $@"SELECT DISTINCT Category FROM (
string query = $@"
SELECT DISTINCT Category FROM (
SELECT IF(Source = 102,EName,ItemName) Category FROM ex_type t1
LEFT JOIN ex_item t2 ON t1.Id = t2.TypeId
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
WHERE IFNULL(Category,'')<>''";
WHERE IFNULL(Category,'')<>''
ORDER BY Category
";
return connection.Query<string>(query, new { hospitalId }, commandTimeout: 60 * 60);
}
catch (Exception)
......
......@@ -1747,10 +1747,9 @@ public GatherResponse GetGatherTotal(Gather gather)
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
{
Department = s.Key.Department,
Source = s.Key.Source,
Category = s.Key.Category,
UserId = s.Key.Submitter,
......
......@@ -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() { };
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