Commit eb6cabe0 by 李承祥

Merge branch 'develop' into feature/signalr

# Conflicts:
#	performance/Performance.Services/NewExtractService.cs
parents cfc49e03 372166f5
......@@ -21,6 +21,8 @@ public enum UnitType
护理组 = 2,
[Description("医技组")]
医技组 = 3,
[Description("专家组")]
专家组 = 4,
}
public enum SheetType
......
......@@ -256,8 +256,9 @@ private List<PerSheet> MergeCompute(PerExcel excel, int allotid)
{
var pairs = new[]
{
new { Name = "医生组临床科室单元核算表", Data = doctorWorkloadData, SheetType = SheetType.ComputeDoctorAccount, UnitTypes = new List<UnitType> { UnitType.医生组, UnitType.医技组 } },
new { Name = "医生组临床科室单元核算表", Data = doctorWorkloadData, SheetType = SheetType.ComputeDoctorAccount, UnitTypes = new List<UnitType> { UnitType.医生组, UnitType.医技组, UnitType.专家组 } },
new { Name = "护理组临床科室单元核算表", Data = nurseWorkloadData, SheetType = SheetType.ComputeNurseAccount, UnitTypes = new List<UnitType> { UnitType.护理组 } },
new { Name = "专家核算表", Data = doctorWorkloadData, SheetType = SheetType.ComputeDoctorAccount, UnitTypes = new List<UnitType> { UnitType.专家组 } },
};
List<PerSheet> result = new List<PerSheet>();
foreach (var info in pairs)
......@@ -266,13 +267,19 @@ private List<PerSheet> MergeCompute(PerExcel excel, int allotid)
foreach (var unitType in info.UnitTypes)
{
var atDataList = dataList.Where(t => t.UnitType == unitType.ToString());
if (atDataList == null || !atDataList.Any())
continue;
foreach (var dept in dataList.Where(t => t.UnitType == unitType.ToString()))
{
if (string.IsNullOrEmpty(dept.AccountingUnit))
continue;
var econDoctor = economicData.FirstOrDefault(t => t.UnitType == unitType.ToString() && t.AccountingUnit == dept.Department);
var workDoctor = info.Data.FirstOrDefault(t => t.UnitType == unitType.ToString() && t.AccountingUnit == dept.Department);
if (UnitType.专家组 == unitType)
{
econDoctor = economicData.FirstOrDefault(t => t.AccountingUnit == dept.Department);
workDoctor = info.Data.FirstOrDefault(t => t.AccountingUnit == dept.Department);
}
//保底绩效
var minimum = baiscnormList.FirstOrDefault(t => t.PositionName == dept.MinimumReference);
if (!string.IsNullOrEmpty(dept.MinimumReference) && minimum != null)
......@@ -312,9 +319,11 @@ private List<PerSheet> MergeCompute(PerExcel excel, int allotid)
}
}
}
sheet.PerData.AddRange(atDataList);
}
if ("专家核算表" == info.Name && (sheet.PerData == null || sheet.PerData.Any()))
continue;
result.Add(sheet);
}
return result;
......
......@@ -7,6 +7,7 @@
namespace Performance.Services
{
//[Authorize(Policy = "allotLogHub")]
public class AllotLogHub : Hub
{
public override Task OnConnectedAsync()
......@@ -15,33 +16,39 @@ public override Task OnConnectedAsync()
}
public override Task OnDisconnectedAsync(Exception exception)
{
var connectionId = Context.ConnectionId;
//1 查询用户分组信息
var groupName = "aaaa";
var groupName = "";
//2 删除数据库中用户分组数据
if (RedisHelper.HExists("MyGroup", groupName))
if (RedisHelper.HExists("MyGroup", connectionId))
{
var connectionId = Context.ConnectionId;
RedisHelper.HDel("MyGroup", groupName);
groupName = RedisHelper.HGet("MyGroup", connectionId);
RedisHelper.HDel("MyGroup", connectionId);
}
//3 分组中删除用户
Groups.RemoveFromGroupAsync(Context.ConnectionId, groupName);
Groups.RemoveFromGroupAsync(connectionId, groupName);
return base.OnDisconnectedAsync(exception);
}
public async Task AddGroup(string token, string groupName)
{
if (!RedisHelper.HExists("MyGroup", groupName))
var connectionId = Context.ConnectionId;
if (!RedisHelper.HExists("MyGroup", connectionId))
{
//1 向数据库中插入用户及分组信息
var connectionId = Context.ConnectionId;
RedisHelper.HSet("MyGroup", groupName, connectionId);
RedisHelper.HSet("MyGroup", connectionId, groupName);
//2 将用户插入分组
await Groups.AddToGroupAsync(Context.ConnectionId, groupName);
await Groups.AddToGroupAsync(connectionId, groupName);
}
}
public async Task SendMessage(string groupName, string message)
{
await Clients.Group(groupName).SendAsync("ReceiveMessage", "测试", message);
}
}
}
......@@ -471,7 +471,7 @@ private void WriteWorkload(ISheet sheet, int hospitalId, List<AccountUnitEntity>
private List<ExtractDto> QueryDatabase(List<sys_hospitalconfig> hospitalConfigList, mod_extract extract, per_allot allot, string category = null)
{
var config = hospitalConfigList.FirstOrDefault(t => t.Type == extract.SourceType);
var executeScript = extract.ExecuteScript;
string executeScript = extract.ExecuteScript;
var parameters = GetParameters(allot);
using (var connection = ConnectionBuilder.Create(DatabaseType.SqlServer, config.DbSource, config.DbName, config.DbUser, config.DbPassword))
{
......@@ -567,7 +567,7 @@ private void WriteEmployee(ISheet sheet, int allotLastId, IPerSheetDataRead shee
logManageService.WriteMsg("提取绩效数据", $"填充数据 -- 人员信息", AllotId, "ReceiveMessage");
LogHelper.Information($"填充数据 -- 人员信息", "提取绩效数据");
var dataList = perforImemployeeRepository.GetEntities(t => t.AllotID == allotLastId);
var dataList = perforImemployeeRepository.GetEntities(t => t.AllotID == allotLastId)?.OrderBy(t => t.AccountType).ToList();
for (int i = 0; i < dataList.Count; i++)
{
var headIndex = sheetRead.Point.HeaderFirstRowNum;
......@@ -693,7 +693,7 @@ private void WriteAccountBasic(ISheet sheet, int allotLastId, IPerSheetDataRead
logManageService.WriteMsg("提取绩效数据", $"填充数据 -- 临床科室医护绩效测算表", AllotId, "ReceiveMessage");
LogHelper.Information($"填充数据 -- 临床科室医护绩效测算表", "提取绩效数据");
var dataList = perforImaccountbasicRepository.GetEntities(t => t.AllotID == allotLastId);
var dataList = perforImaccountbasicRepository.GetEntities(t => t.AllotID == allotLastId)?.OrderBy(t => t.UnitType).ThenBy(t => t.DoctorAccountingUnit).ToList();
for (int i = 0; i < dataList.Count; i++)
{
var headIndex = sheetRead.Point.HeaderFirstRowNum;
......
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