Commit 0a860949 by ruyun.zhang@suvalue.com

Merge remote-tracking branch 'origin/feature/df' into dev

parents 9da16caa e73d4b6a
......@@ -160,8 +160,9 @@ public ApiResponse AddItem([FromBody]ItemListRequest request)
[HttpPost]
public ApiResponse Items([FromBody]ModItemRequest request)
{
logger.LogInformation($"请求地址 {url.HttpPost}/modextract/items");
logger.LogInformation($"绩效收入模板配置项列表 : 请求地址 {url.HttpPost}/modextract/items");
HttpHelper.HttpPost(url.HttpPost + "/modextract/items", JsonHelper.Serialize(request), true);
logger.LogInformation($"绩效收入模板配置项列表在{DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss完成请求")}");
var list = modExtractService.Items(request.ModuleId.Value);
return new ApiResponse(ResponseType.OK, list);
}
......
......@@ -233,7 +233,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
#endregion
app.UseCors("SignalrCore");
app.UseSignalR(routes => routes.MapHub<AllotLogHub>("/performance/allotLogHub"));
//app.UseSignalR(routes => routes.MapHub<AllotLogHub>("/performance/allotLogHub"));
loggerFactory.CreateLogger<Startup>().LogDebug(env.EnvironmentName);
app.UseMvc();
......
......@@ -136,6 +136,8 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
path = Path.Combine(dpath, FileHelper.GetFileName(file.FileName));
logger.LogInformation($"保存历史绩效文件保存路径:" + path);
if (!string.IsNullOrEmpty(path) && FileHelper.IsExistFile(path))
FileHelper.DeleteFile(path);
if (!string.IsNullOrEmpty(path) && FileHelper.IsExistFile(path))
FileHelper.DeleteFile(path);
......@@ -159,7 +161,11 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
if (!string.IsNullOrEmpty(filePath) && FileHelper.IsExistFile(filePath))
{
logger.LogInformation("请求路径:" + url.ImportFile + ",请求参数" + JsonHelper.Serialize(new { allotId, hospitalId }));
logger.LogInformation("请求路径:" + url.ImportFile + ",请求参数" + JsonHelper.Serialize(new
{
allotId,
hospitalId
}));
int i = 1;
while (i <= 5)
{
......
......@@ -262,7 +262,7 @@ public void Generate(per_allot allot, string mail)
if (!checkDataService.Check(excel, allot))
{
UpdateAllotStates(allot.ID, (int)AllotStates.CheckFail, EnumHelper.GetDescription(AllotStates.CheckFail));
SendEmail(allot, mail, 3, time);
//SendEmail(allot, mail, 3, time);
logManageService.WriteMsg("绩效数据校验失败", "详情可至“更多 -- 查看日志”查看", 3, allot.ID, "ReceiveMessage", true);
return;
}
......@@ -335,7 +335,7 @@ public void Generate(per_allot allot, string mail)
//发送邮件
logManageService.WriteMsg("正在发送邮件", "正在发送邮件", 1, allot.ID, "ReceiveMessage", true);
SendEmail(allot, mail, 1, time);
//SendEmail(allot, mail, 1, time);
//logdbug.Add(allot.ID, "绩效开始执行", "绩效生成成功");
logManageService.WriteMsg("绩效生成结束", "绩效生成成功", 5, allot.ID, "ReceiveMessage", true);
}
......@@ -344,7 +344,7 @@ public void Generate(per_allot allot, string mail)
logManageService.WriteMsg("绩效生成失败", "程序异常,请重新尝试。", 4, allot.ID, "ReceiveMessage");
logdbug.Add(allot.ID, "绩效开始执行", ex.ToString(), 4);
UpdateAllotStates(allot.ID, (int)AllotStates.GenerateFail, EnumHelper.GetDescription(AllotStates.GenerateFail));
SendEmail(allot, mail, 2, time);
//SendEmail(allot, mail, 2, time);
//throw ex;
}
}
......
......@@ -9,6 +9,12 @@
namespace Performance.Services
{
public class HubGroupInfo
{
public DateTime AddTime { get; set; }
public string ConnectionId { get; set; }
}
public class AllotLogHub : Hub
{
private readonly ILogger<AllotLogHub> logger;
......
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Logging;
using Performance.Repository;
using System;
using System.Collections.Generic;
......@@ -9,11 +10,15 @@ namespace Performance.Services
{
public class LogManageService : IAutoInjection
{
private readonly ILogger<LogManageService> logger;
private readonly IHubContext<AllotLogHub> hubContext;
private PerforLogdbugRepository logdbug;
public LogManageService(IHubContext<AllotLogHub> hubContext,
public LogManageService(
ILogger<LogManageService> logger,
IHubContext<AllotLogHub> hubContext,
PerforLogdbugRepository logdbug)
{
this.logger = logger;
this.hubContext = hubContext;
this.logdbug = logdbug;
}
......@@ -28,6 +33,7 @@ public class LogManageService : IAutoInjection
/// <param name="method">方法名称</param>
public void WriteMsg(string tag, string message, int level, int allotId, string method, bool isDebug = false)
{
logger.LogInformation($"method:{method};tag:{tag}; message:{message}; level:{level}");
hubContext.Clients.Group(allotId.ToString()).SendAsync(method, tag, message, level);
if (isDebug)
{
......
......@@ -440,9 +440,12 @@ public void AddItems(int moduleId)
throw new PerformanceException($"医院配置信息未设置");
}
var connection = ConnectionBuilder.Create(DatabaseType.SqlServer, hospitalConfig.DbSource, hospitalConfig.DbName, hospitalConfig.DbUser, hospitalConfig.DbPassword);
logger.LogInformation("创建数据库连接");
var connection = ConnectionBuilder.Create(DatabaseType.Oracle, hospitalConfig.DbSource, hospitalConfig.DbName, hospitalConfig.DbUser, hospitalConfig.DbPassword);
string sql = sqlconfig.Content;
logger.LogInformation($"执行sql:{sql}");
var dataList = perforExtractRepository.ExecuteScript(connection, sql, null);
logger.LogInformation($"获取数据{dataList?.Count ?? 0}条");
if (dataList != null && dataList.Any())
{
var itemList = dataList.Select(t => new mod_item
......
......@@ -88,7 +88,13 @@ public List<SecondListResponse> GetSecondList(int userId)
throw new NotImplementedException("该医院未生成绩效");
var allotListId = allotList.Select(t => t.ID).ToList();
var secondList = perforAgsecondallotRepository.GetEntities(t => allotListId.Contains(t.AllotId.Value) && t.Department == user.Department);
Expression<Func<ag_secondallot, bool>> exp = t => allotListId.Contains(t.AllotId.Value) && t.Department == user.Department;
if (role.RoleID == application.NurseRole)
exp = exp.And(t => t.UnitType == "护理组");
else
exp = exp.And(t => t.UnitType != "护理组");
var secondList = perforAgsecondallotRepository.GetEntities(exp);
//各科室绩效分配结果
var accountList = perforResaccountRepository.GetEntities(t => allotListId.Contains(t.AllotID.Value) && t.Department == user.Department);
//取得未生成二次绩效的绩效id
......
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