Commit c95e8999 by lcx

no message

parent e36acb62
......@@ -12,7 +12,7 @@ namespace Performance.Services.AllotCompute
{
public class QueryDataService : IAutoInjection
{
private readonly LogManageService logManageService;
private readonly NotificationsService notificationsService;
private readonly PerforPersheetRepository persheetRepository;
private readonly PerforImemployeeRepository imemployeeRepository;
private readonly PerforImemployeeclinicRepository imemployeeclinicRepository;
......@@ -21,16 +21,18 @@ public class QueryDataService : IAutoInjection
private readonly PerforImdataRepository imdataRepository;
private readonly PerforImheaderRepository imheaderRepository;
public QueryDataService(LogManageService logManageService,
public QueryDataService(
NotificationsService notificationsService,
PerforPersheetRepository persheetRepository,
PerforImemployeeRepository imemployeeRepository,
PerforImemployeeclinicRepository imemployeeclinicRepository,
PerforImaccountbasicRepository imaccountbasicRepository,
PerforImspecialunitRepository imspecialunitRepository,
PerforImdataRepository imdataRepository,
PerforImheaderRepository imheaderRepository)
PerforImheaderRepository imheaderRepository
)
{
this.logManageService = logManageService;
this.notificationsService = notificationsService;
this.persheetRepository = persheetRepository;
this.imemployeeRepository = imemployeeRepository;
this.imemployeeclinicRepository = imemployeeclinicRepository;
......@@ -87,7 +89,7 @@ private PerExcel Query(List<per_sheet> sheets, int allotId)
foreach (var sheet in perExcel.PerSheet)
{
var imSheet = sheets.FirstOrDefault(t => t.SheetName == sheet.SheetName && t.SheetType == (int)sheet.SheetType);
logManageService.WriteMsg("获取基础数据", $"开始查询数据 -- {sheet.SheetName}", 1, allotId, "ReceiveMessage", true);
notificationsService.SendGenerateMessage(allotId, $"获取基础数据:开始查询数据 -- {sheet.SheetName}。");
if (sheet.SheetType == SheetType.Employee)
{
QueryHeader(allotId, imSheet.ID, allheader, sheet);
......@@ -114,7 +116,7 @@ private PerExcel Query(List<per_sheet> sheets, int allotId)
QueryCommon(allotId, imSheet.ID, sheet);
}
}
logManageService.WriteMsg("保存基础数据", $"基础数据保存完成!", 1, allotId, "ReceiveMessage", true);
notificationsService.SendGenerateMessage(allotId, $"保存基础数据:基础数据保存完成。");
return perExcel;
}
......
......@@ -30,7 +30,7 @@ public class ResultComputeService : IAutoInjection
private readonly PerforResspecialunitRepository perforResspecialunitRepository;
private readonly PerforImaccountbasicRepository perforImaccountbasicRepository;
private readonly PerforResaccountRepository perforResaccountRepository;
private readonly LogManageService logManageService;
private readonly NotificationsService notificationsService;
private readonly PerforImemployeeclinicRepository perforImemployeeclinicRepository;
private readonly PerforImemployeelogisticsRepository perforImemployeelogisticsRepository;
......@@ -43,7 +43,7 @@ public class ResultComputeService : IAutoInjection
PerforImaccountbasicRepository perforImaccountbasicRepository,
PerforResaccountRepository perforResaccountRepository,
BaiscNormService baiscNormService, ComputeDirector computeDirector,
LogManageService logManageService, BudgetService budgetService,
NotificationsService notificationsService, BudgetService budgetService,
PerforPeremployeeRepository perforPeremployeeRepository,
PerforPerallotRepository perforPerallotRepository,
PerforAgcomputeRepository perforAgcomputeRepository,
......@@ -61,7 +61,7 @@ public class ResultComputeService : IAutoInjection
this.perforResspecialunitRepository = perforResspecialunitRepository;
this.perforImaccountbasicRepository = perforImaccountbasicRepository;
this.perforResaccountRepository = perforResaccountRepository;
this.logManageService = logManageService;
this.notificationsService = notificationsService;
this.budgetService = budgetService;
this.perforPeremployeeRepository = perforPeremployeeRepository;
this.perforPerallotRepository = perforPerallotRepository;
......@@ -84,7 +84,7 @@ public List<res_baiscnorm> Compute(per_allot allot, List<PerSheet> accountSheet)
List<ComputeEmployee> computeEmployees = Mapper.Map<List<ComputeEmployee>>(empolyeeList);
logManageService.WriteMsg("正在生成绩效", "科室主任、护士长 最终绩效数据计算", 1, allot.ID, "ReceiveMessage");
notificationsService.SendGenerateMessage(allot.ID, $"正在生成绩效:科室主任、护士长 最终绩效数据计算。");
var computResult = computeDirector.Compute(computeEmployees, accountSheet, allot);
//计算 绩效标准 基数(科主任、副主任、护士长 =>> 平均值)
List<res_baiscnorm> baiscnormList = new List<res_baiscnorm>();
......@@ -93,12 +93,12 @@ public List<res_baiscnorm> Compute(per_allot allot, List<PerSheet> accountSheet)
var empolyeeList2 = perforImEmployeeRepository.GetEntities(t => t.AllotID == allot.ID);
var computeEmployees2 = Mapper.Map<List<ComputeEmployee>>(empolyeeList2);
logManageService.WriteMsg("正在生成绩效", "行政中高层 最终绩效数据计算", 1, allot.ID, "ReceiveMessage");
notificationsService.SendGenerateMessage(allot.ID, $"正在生成绩效:行政中高层 最终绩效数据计算。");
var computResult2 = computeDirector.Compute(computeEmployees2, allot, baiscnormList);
var empolyeeList3 = perforImemployeelogisticsRepository.GetEntities(t => t.AllotID == allot.ID);
var computeEmployees3 = Mapper.Map<List<ComputeEmployee>>(empolyeeList3);
logManageService.WriteMsg("正在生成绩效", "行政后勤 最终绩效数据计算", 1, allot.ID, "ReceiveMessage");
notificationsService.SendGenerateMessage(allot.ID, $"正在生成绩效:行政后勤 最终绩效数据计算。");
var computResult3 = computeDirector.Compute(computeEmployees3, allot, baiscnormList);
//计算 行政中高层 平均值
......@@ -113,7 +113,7 @@ public List<res_baiscnorm> Compute(per_allot allot, List<PerSheet> accountSheet)
perforRescomputeRepository.AddRange(computes.ToArray());
baiscnormList.ForEach(t => t.AllotID = allot.ID);
logManageService.WriteMsg("正在生成绩效", "保存最终绩效数据", 1, allot.ID, "ReceiveMessage");
notificationsService.SendGenerateMessage(allot.ID, $"正在生成绩效:保存最终绩效数据。");
return baiscnormList;
}
......
......@@ -33,6 +33,7 @@ PerforLogdsignalrRepository repository
}
public const string AllotGenerateKeyPrefix = "Allot-Generate-";
public const string AllotExtractKeyPrefix = "Allot-Extract-";
public void SendGenerateMessage(int allotId, string message, ComponentType type = ComponentType.info)
{
......@@ -44,6 +45,16 @@ public void SendGenerateMessage(int allotId, string message, ComponentType type
SendMessage(data.UserId, info);
}
public void SendExtractMessage(int allotId, string message, ComponentType type = ComponentType.info)
{
var data = GetCache<SingleData>(AllotExtractKeyPrefix + allotId);
if (data == null || data.UserId == 0)
return;
var info = new MessageInfo(data.Uuid, allotId, "提取数据", message, Component.Notification, type);
SendMessage(data.UserId, info);
}
public void SendMessage(int userId, MessageInfo data)
{
string key = userId.ToString();
......
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