Commit cf8d50a4 by lcx

Merge branch 'v2020morge' into v2020morge-graphql

# Conflicts:
#	performance/Performance.Api/Controllers/SecondAllotController.cs
#	performance/Performance.EntityModels/Entity/im_accountbasic.cs
#	performance/Performance.Repository/PerforCofdirectorRepository.cs
#	performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
parents 26996e64 7ffa0d8c
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "5.0.1",
"commands": [
"dotnet-ef"
]
}
}
}
\ No newline at end of file
using FluentValidation.AspNetCore; using FluentValidation.AspNetCore;
using Hangfire;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal; using Microsoft.AspNetCore.Http.Internal;
...@@ -7,7 +6,6 @@ ...@@ -7,7 +6,6 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.EntityModels;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Services; using Performance.Services;
using Performance.Services.AllotCompute; using Performance.Services.AllotCompute;
...@@ -16,7 +14,6 @@ ...@@ -16,7 +14,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks; using System.Threading.Tasks;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
...@@ -27,19 +24,17 @@ namespace Performance.Api.Controllers ...@@ -27,19 +24,17 @@ namespace Performance.Api.Controllers
public class AllotController : Controller public class AllotController : Controller
{ {
private AllotService _allotService; private AllotService _allotService;
private readonly ResultComputeService resultComputeService; private ResultComputeService _resultComputeService;
private HospitalService _hospitalService;
private ConfigService _configService; private ConfigService _configService;
private IHostingEnvironment _evn; private IHostingEnvironment _evn;
private ILogger<AllotController> _logger; private ILogger<AllotController> _logger;
private ClaimService _claim; private ClaimService _claim;
private readonly LogManageService logManageService; private LogManageService _logManageService;
private IBackgroundTaskQueue _backgroundTaskQueue; private IBackgroundTaskQueue _backgroundTaskQueue;
private IServiceScopeFactory _serviceScopeFactory; private IServiceScopeFactory _serviceScopeFactory;
public AllotController(AllotService allotService, public AllotController(AllotService allotService,
ResultComputeService resultComputeService, ResultComputeService resultComputeService,
HospitalService hospitalService,
ConfigService configService, ConfigService configService,
ILogger<AllotController> logger, ILogger<AllotController> logger,
IHostingEnvironment evn, IHostingEnvironment evn,
...@@ -49,12 +44,11 @@ public class AllotController : Controller ...@@ -49,12 +44,11 @@ public class AllotController : Controller
LogManageService logManageService) LogManageService logManageService)
{ {
_allotService = allotService; _allotService = allotService;
this.resultComputeService = resultComputeService; _resultComputeService = resultComputeService;
_hospitalService = hospitalService;
_logger = logger; _logger = logger;
_evn = evn; _evn = evn;
_claim = claim; _claim = claim;
this.logManageService = logManageService; _logManageService = logManageService;
_configService = configService; _configService = configService;
_backgroundTaskQueue = backgroundTaskQueue; _backgroundTaskQueue = backgroundTaskQueue;
_serviceScopeFactory = serviceScopeFactory; _serviceScopeFactory = serviceScopeFactory;
...@@ -190,7 +184,7 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A ...@@ -190,7 +184,7 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A
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);
if (_evn.IsEnvironment("Localhost")) if (_evn.IsEnvironment("Localhost"))
{ {
...@@ -211,13 +205,27 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A ...@@ -211,13 +205,27 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A
}); });
} }
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);
////BackgroundJob.Enqueue(() => _allotService.Generate(allot, email)); ////BackgroundJob.Enqueue(() => _allotService.Generate(allot, email));
return new ApiResponse(ResponseType.OK); return new ApiResponse(ResponseType.OK);
} }
/// <summary> /// <summary>
/// 重新计算院领导绩效
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("recalculation")]
[HttpPost]
public ApiResponse Recalculation([FromBody] RecalculationRequest request)
{
if (request.Money.HasValue)
_allotService.Recalculation(request.AllotId, request.Money.Value);
return new ApiResponse(ResponseType.OK);
}
/// <summary>
/// 归档绩效记录 /// 归档绩效记录
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
...@@ -296,7 +304,7 @@ public ApiResponse Issued([FromBody] AllotRequest request) ...@@ -296,7 +304,7 @@ public ApiResponse Issued([FromBody] AllotRequest request)
throw new PerformanceException("当前绩效记录不存在"); throw new PerformanceException("当前绩效记录不存在");
_allotService.UpdateAllotStates(allot.ID, (int)AllotStates.GenerateSucceed, EnumHelper.GetDescription(AllotStates.GenerateSucceed)); _allotService.UpdateAllotStates(allot.ID, (int)AllotStates.GenerateSucceed, EnumHelper.GetDescription(AllotStates.GenerateSucceed));
// 科室下发 // 科室下发
resultComputeService.GenerateSecondAllot(allot); _resultComputeService.GenerateSecondAllot(allot);
return new ApiResponse(ResponseType.OK); return new ApiResponse(ResponseType.OK);
} }
......
...@@ -194,58 +194,58 @@ public ConfigController(ConfigService configService, AllotService allotService) ...@@ -194,58 +194,58 @@ public ConfigController(ConfigService configService, AllotService allotService)
#endregion #endregion
#region drugprop #region drugprop
/// <summary> ///// <summary>
/// 获取 药占比配置信息列表 ///// 获取 药占比配置信息列表
/// </summary> ///// </summary>
/// <param name="request"></param> ///// <param name="request"></param>
/// <returns></returns> ///// <returns></returns>
[Route("drugproplist")] //[Route("drugproplist")]
[HttpPost] //[HttpPost]
public ApiResponse<List<DrugpropResponse>> GetDrugList([CustomizeValidator(RuleSet = "Select"), FromBody] DrugpropRequest request) //public ApiResponse<List<DrugpropResponse>> GetDrugList([CustomizeValidator(RuleSet = "Select"), FromBody] DrugpropRequest request)
{ //{
var list = _configService.GetDrugList(request.AllotID); // var list = _configService.GetDrugList(request.AllotID);
return new ApiResponse<List<DrugpropResponse>>(ResponseType.OK, "ok", list); // return new ApiResponse<List<DrugpropResponse>>(ResponseType.OK, "ok", list);
} //}
/// <summary> ///// <summary>
/// 新增药占比配置 ///// 新增药占比配置
/// </summary> ///// </summary>
/// <param name="request"></param> ///// <param name="request"></param>
/// <returns></returns> ///// <returns></returns>
[Route("druginsert")] //[Route("druginsert")]
[HttpPost] //[HttpPost]
public ApiResponse<DrugpropResponse> DrugInsert([CustomizeValidator(RuleSet = "Insert"), FromBody] DrugpropRequest request) //public ApiResponse<DrugpropResponse> DrugInsert([CustomizeValidator(RuleSet = "Insert"), FromBody] DrugpropRequest request)
{ //{
var drugprop = _configService.DrugInsert(request); // var drugprop = _configService.DrugInsert(request);
return new ApiResponse<DrugpropResponse>(ResponseType.OK, drugprop); // return new ApiResponse<DrugpropResponse>(ResponseType.OK, drugprop);
} //}
/// <summary> ///// <summary>
/// 修改药占比配置 ///// 修改药占比配置
/// </summary> ///// </summary>
/// <param name="request"></param> ///// <param name="request"></param>
/// <returns></returns> ///// <returns></returns>
[Route("drugupdate")] //[Route("drugupdate")]
[HttpPost] //[HttpPost]
public ApiResponse<DrugpropResponse> Update([CustomizeValidator(RuleSet = "Update"), FromBody] DrugpropRequest request) //public ApiResponse<DrugpropResponse> Update([CustomizeValidator(RuleSet = "Update"), FromBody] DrugpropRequest request)
{ //{
var drugprop = _configService.DrugUpdate(request); // var drugprop = _configService.DrugUpdate(request);
return new ApiResponse<DrugpropResponse>(ResponseType.OK, drugprop); // return new ApiResponse<DrugpropResponse>(ResponseType.OK, drugprop);
} //}
/// <summary> ///// <summary>
/// 删除药占比配置 ///// 删除药占比配置
/// </summary> ///// </summary>
/// <param name="request"></param> ///// <param name="request"></param>
/// <returns></returns> ///// <returns></returns>
[Route("drugdelete")] //[Route("drugdelete")]
[HttpPost] //[HttpPost]
public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody] DrugpropRequest request) //public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody] DrugpropRequest request)
{ //{
if (!_configService.DrugDelete(request)) // if (!_configService.DrugDelete(request))
return new ApiResponse(ResponseType.Fail); // return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK); // return new ApiResponse(ResponseType.OK);
} //}
#endregion #endregion
#region drugtype #region drugtype
...@@ -372,7 +372,7 @@ public ApiResponse<List<cof_workitem>> GetWorkItems([CustomizeValidator(RuleSet ...@@ -372,7 +372,7 @@ public ApiResponse<List<cof_workitem>> GetWorkItems([CustomizeValidator(RuleSet
return new ApiResponse<List<cof_workitem>>(ResponseType.OK, "ok", list); return new ApiResponse<List<cof_workitem>>(ResponseType.OK, "ok", list);
} }
/// <summary> /// <summary>
/// 新增工作量绩效配置 /// 新增工作量绩效配置
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
...@@ -469,58 +469,58 @@ public ApiResponse DepttypeDelete([CustomizeValidator(RuleSet = "Delete"), FromB ...@@ -469,58 +469,58 @@ public ApiResponse DepttypeDelete([CustomizeValidator(RuleSet = "Delete"), FromB
#endregion #endregion
#region cmi #region cmi
/// <summary> ///// <summary>
/// 获取 CMI配置信息 ///// 获取 CMI配置信息
/// </summary> ///// </summary>
/// <param name="request"></param> ///// <param name="request"></param>
/// <returns></returns> ///// <returns></returns>
[Route("cmilist")] //[Route("cmilist")]
[HttpPost] //[HttpPost]
public ApiResponse GetHosCMIList([FromBody] cof_cmi request) //public ApiResponse GetHosCMIList([FromBody] cof_cmi request)
{ //{
var list = _configService.GetCMIList(request.AllotId); // var list = _configService.GetCMIList(request.AllotId);
return new ApiResponse(ResponseType.OK, "ok", list); // return new ApiResponse(ResponseType.OK, "ok", list);
} //}
/// <summary> ///// <summary>
/// 新增 CMI配置 ///// 新增 CMI配置
/// </summary> ///// </summary>
/// <param name="request"></param> ///// <param name="request"></param>
/// <returns></returns> ///// <returns></returns>
[Route("cmiinsert")] //[Route("cmiinsert")]
[HttpPost] //[HttpPost]
public ApiResponse HosCMIInsert([FromBody] cof_cmi request) //public ApiResponse HosCMIInsert([FromBody] cof_cmi request)
{ //{
var drugprop = _configService.HosCMIInsert(request); // var drugprop = _configService.HosCMIInsert(request);
return new ApiResponse(ResponseType.OK, drugprop); // return new ApiResponse(ResponseType.OK, drugprop);
} //}
/// <summary> ///// <summary>
/// 修改 CMI配置 ///// 修改 CMI配置
/// </summary> ///// </summary>
/// <param name="request"></param> ///// <param name="request"></param>
/// <returns></returns> ///// <returns></returns>
[Route("cmiupdate")] //[Route("cmiupdate")]
[HttpPost] //[HttpPost]
public ApiResponse HosCMIUpdate([FromBody] cof_cmi request) //public ApiResponse HosCMIUpdate([FromBody] cof_cmi request)
{ //{
var drugprop = _configService.HosCMIUpdate(request); // var drugprop = _configService.HosCMIUpdate(request);
return new ApiResponse(ResponseType.OK, drugprop); // return new ApiResponse(ResponseType.OK, drugprop);
} //}
/// <summary> ///// <summary>
/// 删除 CMI配置 ///// 删除 CMI配置
/// </summary> ///// </summary>
/// <param name="request"></param> ///// <param name="request"></param>
/// <returns></returns> ///// <returns></returns>
[Route("cmidelete")] //[Route("cmidelete")]
[HttpPost] //[HttpPost]
public ApiResponse HosCMIDelete([FromBody] cof_cmi request) //public ApiResponse HosCMIDelete([FromBody] cof_cmi request)
{ //{
if (!_configService.HosCMIDelete(request)) // if (!_configService.HosCMIDelete(request))
return new ApiResponse(ResponseType.Fail); // return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK); // return new ApiResponse(ResponseType.OK);
} //}
#endregion #endregion
/// <summary> /// <summary>
......
...@@ -17,17 +17,18 @@ namespace Performance.Api.Controllers ...@@ -17,17 +17,18 @@ namespace Performance.Api.Controllers
[ApiController] [ApiController]
public class ExConfigController : Controller public class ExConfigController : Controller
{ {
private readonly ILogger<ExConfigController> logger; private ILogger logger;
private WebapiUrl options;
private ExConfigService configService; private ExConfigService configService;
private WebapiUrl url;
public ExConfigController( public ExConfigController(
ILogger<ExConfigController> logger, ILogger<ExConfigController> logger,
ExConfigService configService, IOptions<WebapiUrl> options,
IOptions<WebapiUrl> url) ExConfigService configService)
{ {
this.logger = logger; this.logger = logger;
this.options = options.Value;
this.configService = configService; this.configService = configService;
this.url = url.Value;
} }
/// <summary> /// <summary>
...@@ -43,7 +44,7 @@ public ApiResponse Extract([CustomizeValidator(RuleSet = "Query"), FromBody] Mod ...@@ -43,7 +44,7 @@ public ApiResponse Extract([CustomizeValidator(RuleSet = "Query"), FromBody] Mod
if (request.ExecuteType == null || !request.ExecuteType.Any()) if (request.ExecuteType == null || !request.ExecuteType.Any())
return new ApiResponse(ResponseType.ParameterError, "ExecuteType 不存在,请重新选择!"); return new ApiResponse(ResponseType.ParameterError, "ExecuteType 不存在,请重新选择!");
var list = configService.ExtractScheme(request.HospitalId.Value, request.ExecuteType); var list = configService.ExtractScheme(request.HospitalId.Value, request.ExecuteType, request.SheetType);
return new ApiResponse(ResponseType.OK, list); return new ApiResponse(ResponseType.OK, list);
} }
...@@ -70,9 +71,24 @@ public ApiResponse FeeSource([FromBody] ModModuleRequest request) ...@@ -70,9 +71,24 @@ public ApiResponse FeeSource([FromBody] ModModuleRequest request)
if (request.HospitalId == null || request.HospitalId.Value == 0) if (request.HospitalId == null || request.HospitalId.Value == 0)
return new ApiResponse(ResponseType.ParameterError, "HospitalId 参数错误!"); return new ApiResponse(ResponseType.ParameterError, "HospitalId 参数错误!");
string retJson = HttpHelper.HttpPost(url.HttpPost + "/modextract/source", JsonHelper.Serialize(request), true); bool isSingle = false;
var ret = JsonHelper.Deserialize<ApiResponse>(retJson); configService.QueryHosConfigs(request.ModuleId.Value, ref isSingle, out int sheetType);
return new ApiResponse(ResponseType.OK, ret.Data);
ModFeeResponse response;
if (isSingle)
{
response = configService.FeeSource(request);
}
else
{
var http = new RestSharpHelper();
var url = http.SetUrl(options.HttpPost, "/modextract/source");
var req = http.CreatePostRequest(JsonHelper.Serialize(request));
var res = http.GetResponse(url, req);
var ret = http.GetContent<ApiResponse<ModFeeResponse>>(res);
response = ret.Data;
}
return new ApiResponse(ResponseType.OK, response);
} }
/// <summary> /// <summary>
...@@ -161,14 +177,28 @@ public ApiResponse AddItem([FromBody] ItemListRequest request) ...@@ -161,14 +177,28 @@ public ApiResponse AddItem([FromBody] ItemListRequest request)
[HttpPost] [HttpPost]
public ApiResponse Items([FromBody] ModItemRequest request) public ApiResponse Items([FromBody] ModItemRequest request)
{ {
if (!configService.QueryHosConfigs(request.ModuleId.Value, out int sheetType)) bool isSingle = false;
if (!configService.QueryHosConfigs(request.ModuleId.Value, ref isSingle, out int sheetType))
return new ApiResponse(ResponseType.Fail, "当前医院未配置地址"); return new ApiResponse(ResponseType.Fail, "当前医院未配置地址");
if (sheetType == (int)SheetType.Income) if (sheetType == (int)SheetType.Income)
{ {
logger.LogInformation($"绩效收入模板配置项列表 : 请求地址 {url.HttpPost}/modextract/items"); if (isSingle)
HttpHelper.HttpPost(url.HttpPost + "/modextract/items", JsonHelper.Serialize(request), true); {
logger.LogInformation($"绩效收入模板配置项列表在{DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss完成请求")}"); configService.AddItems(request.ModuleId.Value);
}
else
{
logger.LogInformation($"绩效收入模板配置项列表 : 请求地址 {options.HttpPost}/modextract/items");
var http = new RestSharpHelper();
var url = http.SetUrl(options.HttpPost, "/modextract/items");
var req = http.CreatePostRequest(JsonHelper.Serialize(request));
var res = http.GetResponse(url, req);
var ret = http.GetContent<ApiResponse>(res);
logger.LogInformation($"绩效收入模板配置项列表在{DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss完成请求")}");
}
} }
var list = configService.QueryItems(request.ModuleId.Value); var list = configService.QueryItems(request.ModuleId.Value);
return new ApiResponse(ResponseType.OK, list); return new ApiResponse(ResponseType.OK, list);
...@@ -204,8 +234,8 @@ public ApiResponse DelItem([FromBody] ModItemRequest request) ...@@ -204,8 +234,8 @@ public ApiResponse DelItem([FromBody] ModItemRequest request)
return new ApiResponse(ResponseType.OK, "删除成功!"); return new ApiResponse(ResponseType.OK, "删除成功!");
} }
#region 特殊科室模板 #region 特殊科室模板
/// <summary> /// <summary>
/// 特殊科室模板配置项新增 /// 特殊科室模板配置项新增
/// </summary> /// </summary>
...@@ -266,7 +296,6 @@ public ApiResponse DelSpecial([FromBody] ModSpecialRequest request) ...@@ -266,7 +296,6 @@ public ApiResponse DelSpecial([FromBody] ModSpecialRequest request)
return new ApiResponse(ResponseType.OK, "删除成功!"); return new ApiResponse(ResponseType.OK, "删除成功!");
} }
/// <summary> /// <summary>
/// 特殊科室人均 /// 特殊科室人均
/// </summary> /// </summary>
...@@ -278,7 +307,8 @@ public ApiResponse PerforType() ...@@ -278,7 +307,8 @@ public ApiResponse PerforType()
var list = configService.PerforType(); var list = configService.PerforType();
return new ApiResponse(ResponseType.OK, list); return new ApiResponse(ResponseType.OK, list);
} }
#endregion
#endregion 特殊科室模板
/// <summary> /// <summary>
/// 数据配置项 /// 数据配置项
......
...@@ -402,10 +402,10 @@ public ApiResponse NursingDeptAuditResult([FromBody] SecondAuditRequest request) ...@@ -402,10 +402,10 @@ public ApiResponse NursingDeptAuditResult([FromBody] SecondAuditRequest request)
public ApiResponse OtherList([FromBody] AgOtherRequest request) public ApiResponse OtherList([FromBody] AgOtherRequest request)
{ {
//var result = secondAllotService.OtherList(request.SecondId, claimService.GetUserId()); //var result = secondAllotService.OtherList(request.SecondId, claimService.GetUserId());
var result = secondAllotDetails.GetOtherTempDetails(claimService.GetUserId(), request.SecondId, request.IsArchive, request.EmployeeSource); var result = secondAllotDetails.GetOtherTempData(claimService.GetUserId(), request.SecondId, request.IsArchive, request.EmployeeSource, out decimal? realAmount);
var obj = new var obj = new
{ {
header = secondAllotService.OtherListHeader(request.SecondId, result?.Sum(t => t.RealAmount)), header = secondAllotService.OtherListHeader(request.SecondId, realAmount ?? 0),
body = result, body = result,
}; };
return new ApiResponse(ResponseType.OK, obj); return new ApiResponse(ResponseType.OK, obj);
...@@ -415,12 +415,12 @@ public ApiResponse OtherList([FromBody] AgOtherRequest request) ...@@ -415,12 +415,12 @@ public ApiResponse OtherList([FromBody] AgOtherRequest request)
/// 二次绩效其他绩效保存 /// 二次绩效其他绩效保存
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Route("api/second/other/save")] [Route("api/second/other/save/{secondId}")]
[HttpPost] [HttpPost]
public ApiResponse OtherSave([FromBody] AgOtherRequest request) public ApiResponse OtherSave(int secondId, [FromBody] SaveCollectData request)
{ {
var result = secondAllotService.OtherSave(request.SecondId, request.Othersources); secondAllotService.OtherSave(secondId, request);
return new ApiResponse(ResponseType.OK, result); return new ApiResponse(ResponseType.OK);
} }
#endregion 二次绩效其他绩效 #endregion 二次绩效其他绩效
...@@ -448,6 +448,7 @@ public ApiResponse DeptComputeDetail(int allotId) ...@@ -448,6 +448,7 @@ public ApiResponse DeptComputeDetail(int allotId)
var userId = claimService.GetUserId(); var userId = claimService.GetUserId();
//var data = secondAllotService.DeptComputeDetail(userId, allotId, out int isShowManage); //var data = secondAllotService.DeptComputeDetail(userId, allotId, out int isShowManage);
var data = secondAllotService.DeptComputeDetailList(userId, allotId, out int isShowManage); var data = secondAllotService.DeptComputeDetailList(userId, allotId, out int isShowManage);
return new ApiResponse(ResponseType.OK, new { isShowManage, data }); return new ApiResponse(ResponseType.OK, new { isShowManage, data });
} }
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<PropertyGroup> <PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest> <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
<UserSecretsId>e732666b-5531-4cd8-b713-2fe3db31126c</UserSecretsId>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
}, },
"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_performance;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_yubei;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;",
"HangfireConnectionString": "server=192.168.18.166;database=db_hangfire;uid=root;pwd=1234qwer;port=3306;allow user variables=true;", "HangfireConnectionString": "server=192.168.18.166;database=db_hangfire;uid=root;pwd=1234qwer;port=3306;allow user variables=true;",
"RedisConnectionString": "116.62.245.55:6379,defaultDatabase=2" "RedisConnectionString": "116.62.245.55:6379,defaultDatabase=2"
}, },
......
...@@ -184,6 +184,13 @@ ...@@ -184,6 +184,13 @@
<param name="request"></param> <param name="request"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.AllotController.Recalculation(Performance.DtoModels.RecalculationRequest)">
<summary>
重新计算院领导绩效
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.AllotController.Pigeonhole(Performance.DtoModels.AllotRequest)"> <member name="M:Performance.Api.Controllers.AllotController.Pigeonhole(Performance.DtoModels.AllotRequest)">
<summary> <summary>
归档绩效记录 归档绩效记录
...@@ -426,34 +433,6 @@ ...@@ -426,34 +433,6 @@
<param name="computeId"></param> <param name="computeId"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.ConfigController.GetDrugList(Performance.DtoModels.DrugpropRequest)">
<summary>
获取 药占比配置信息列表
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ConfigController.DrugInsert(Performance.DtoModels.DrugpropRequest)">
<summary>
新增药占比配置
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ConfigController.Update(Performance.DtoModels.DrugpropRequest)">
<summary>
修改药占比配置
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ConfigController.Delete(Performance.DtoModels.DrugpropRequest)">
<summary>
删除药占比配置
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ConfigController.GetDrugtypeList(Performance.DtoModels.DrugpropRequest)"> <member name="M:Performance.Api.Controllers.ConfigController.GetDrugtypeList(Performance.DtoModels.DrugpropRequest)">
<summary> <summary>
获取 药占比类型信息列表 获取 药占比类型信息列表
...@@ -518,7 +497,7 @@ ...@@ -518,7 +497,7 @@
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.ConfigController.WorkItemInsert(Performance.DtoModels.WorkItemRequest)"> <member name="M:Performance.Api.Controllers.ConfigController.WorkItemInsert(Performance.DtoModels.WorkItemRequest)">
<summary> <summary>
新增工作量绩效配置 新增工作量绩效配置
</summary> </summary>
<param name="request"></param> <param name="request"></param>
...@@ -566,34 +545,6 @@ ...@@ -566,34 +545,6 @@
<param name="request"></param> <param name="request"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.ConfigController.GetHosCMIList(Performance.EntityModels.cof_cmi)">
<summary>
获取 CMI配置信息
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ConfigController.HosCMIInsert(Performance.EntityModels.cof_cmi)">
<summary>
新增 CMI配置
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ConfigController.HosCMIUpdate(Performance.EntityModels.cof_cmi)">
<summary>
修改 CMI配置
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ConfigController.HosCMIDelete(Performance.EntityModels.cof_cmi)">
<summary>
删除 CMI配置
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ConfigController.WorkHeader(Performance.DtoModels.WorkItemRequest)"> <member name="M:Performance.Api.Controllers.ConfigController.WorkHeader(Performance.DtoModels.WorkItemRequest)">
<summary> <summary>
获取工作量绩效列头 获取工作量绩效列头
...@@ -1287,7 +1238,7 @@ ...@@ -1287,7 +1238,7 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.SecondAllotController.OtherSave(Performance.DtoModels.AgOtherRequest)"> <member name="M:Performance.Api.Controllers.SecondAllotController.OtherSave(System.Int32,Performance.DtoModels.SaveCollectData)">
<summary> <summary>
二次绩效其他绩效保存 二次绩效其他绩效保存
</summary> </summary>
...@@ -1359,24 +1310,17 @@ ...@@ -1359,24 +1310,17 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.TemplateController.SaveFile(Microsoft.AspNetCore.Http.IFormCollection,System.Int32,System.Int32)"> <member name="M:Performance.Api.Controllers.TemplateController.SaveFile">
<summary> <summary>
保存提取文件 保存提取文件
</summary> </summary>
<param name="form"></param>
<param name="allotId"></param>
<param name="hospitalId"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.TemplateController.ReturnLog(System.Int32,System.String,System.String,System.Int32,System.String)"> <member name="M:Performance.Api.Controllers.TemplateController.ReturnLog(Performance.DtoModels.SignalrLogRequest)">
<summary> <summary>
返回日志 返回日志
</summary> </summary>
<param name="type">1 进度条 2 信息</param> <param name="request"></param>
<param name="tag"></param>
<param name="message"></param>
<param name="level"></param>
<param name="groupName"></param>
</member> </member>
<member name="M:Performance.Api.Controllers.TemplateController.ReturnLog(Performance.EntityModels.log_dbug)"> <member name="M:Performance.Api.Controllers.TemplateController.ReturnLog(Performance.EntityModels.log_dbug)">
<summary> <summary>
......
...@@ -180,11 +180,11 @@ ...@@ -180,11 +180,11 @@
<summary> 日期 </summary> <summary> 日期 </summary>
</member> </member>
<member name="M:Performance.DtoModels.HandsonTable.SetRowData(System.Collections.Generic.IEnumerable{Performance.DtoModels.HandsonRowData},System.Boolean)"> <member name="M:Performance.DtoModels.HandsonTable.SetRowData(System.Collections.Generic.IEnumerable{Performance.DtoModels.HandsonRowData},System.Boolean)">
<summary> <summary>
</summary> </summary>
<param name="datas"></param> <param name="datas"></param>
<param name="isTypein">是否是用户录入的 是:true 不是:false</param> <param name="isTypein">是否是用户录入的 是:true 不是:false</param>
</member> </member>
<member name="P:Performance.DtoModels.HistoryData.Year"> <member name="P:Performance.DtoModels.HistoryData.Year">
<summary> <summary>
...@@ -396,11 +396,6 @@ ...@@ -396,11 +396,6 @@
门诊药占比分值 门诊药占比分值
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.CofDrugProp.Prop">
<summary>
占比
</summary>
</member>
<member name="P:Performance.DtoModels.CofDrugProp.Factor"> <member name="P:Performance.DtoModels.CofDrugProp.Factor">
<summary> <summary>
分值 分值
...@@ -804,6 +799,18 @@ ...@@ -804,6 +799,18 @@
<member name="F:Performance.DtoModels.SheetType.PersonPostCoefficient"> <member name="F:Performance.DtoModels.SheetType.PersonPostCoefficient">
<summary> 个人岗位系数 </summary> <summary> 个人岗位系数 </summary>
</member> </member>
<member name="F:Performance.DtoModels.SheetType.WorkloadMedicineProp">
<summary> 药占比系数 </summary>
</member>
<member name="F:Performance.DtoModels.SheetType.WorkloadCMI">
<summary> CMI系数 </summary>
</member>
<member name="F:Performance.DtoModels.SheetType.WorkloadIncline">
<summary> 工作量倾斜系数 </summary>
</member>
<member name="F:Performance.DtoModels.SheetType.Assess">
<summary> 考核 </summary>
</member>
<member name="T:Performance.DtoModels.AccountUnitType"> <member name="T:Performance.DtoModels.AccountUnitType">
<summary> <summary>
核算单元类型 核算单元类型
...@@ -1037,11 +1044,6 @@ ...@@ -1037,11 +1044,6 @@
应发管理绩效 应发管理绩效
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.PerDataAccountBaisc.MedicineFactor">
<summary>
药占比系数
</summary>
</member>
<member name="P:Performance.DtoModels.PerDataAccountBaisc.Income"> <member name="P:Performance.DtoModels.PerDataAccountBaisc.Income">
<summary> <summary>
科室业绩 科室业绩
...@@ -2014,23 +2016,33 @@ ...@@ -2014,23 +2016,33 @@
<member name="P:Performance.DtoModels.ExtractRequest.AllotId"> <member name="P:Performance.DtoModels.ExtractRequest.AllotId">
<summary> <summary>
绩效ID 绩效ID
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.ExtractRequest.HospitalId"> <member name="P:Performance.DtoModels.ExtractRequest.HospitalId">
<summary> <summary>
医院ID 医院ID
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.ExtractRequest.UseScheme"> <member name="P:Performance.DtoModels.ExtractRequest.UseScheme">
<summary> <summary>
使用方案 使用方案
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.ExtractRequest.Email"> <member name="P:Performance.DtoModels.ExtractRequest.Email">
<summary> <summary>
邮箱 邮箱
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.ExtractRequest.GroupName">
<summary>
Signalr分组名称
</summary>
</member>
<member name="P:Performance.DtoModels.ExtractRequest.UserId">
<summary>
用户Id
</summary>
</member>
<member name="P:Performance.DtoModels.GuaranteeRequest.Id"> <member name="P:Performance.DtoModels.GuaranteeRequest.Id">
<summary> </summary> <summary> </summary>
</member> </member>
...@@ -2842,6 +2854,9 @@ ...@@ -2842,6 +2854,9 @@
<member name="P:Performance.DtoModels.DetailModule.CMIFactor"> <member name="P:Performance.DtoModels.DetailModule.CMIFactor">
<summary> CMI系数 </summary> <summary> CMI系数 </summary>
</member> </member>
<member name="P:Performance.DtoModels.DetailModule.InclineFactor">
<summary> 工作量倾斜系数 </summary>
</member>
<member name="P:Performance.DtoModels.DetailModule.ItemValue"> <member name="P:Performance.DtoModels.DetailModule.ItemValue">
<summary> 结算值 </summary> <summary> 结算值 </summary>
</member> </member>
......
...@@ -67,18 +67,12 @@ ...@@ -67,18 +67,12 @@
<member name="P:Performance.EntityModels.PerformanceDbContext.cof_check"> <member name="P:Performance.EntityModels.PerformanceDbContext.cof_check">
<summary> 上传excel文件校验配置 </summary> <summary> 上传excel文件校验配置 </summary>
</member> </member>
<member name="P:Performance.EntityModels.PerformanceDbContext.cof_cmi">
<summary> </summary>
</member>
<member name="P:Performance.EntityModels.PerformanceDbContext.cof_depttype"> <member name="P:Performance.EntityModels.PerformanceDbContext.cof_depttype">
<summary> 科室类型 </summary> <summary> 科室类型 </summary>
</member> </member>
<member name="P:Performance.EntityModels.PerformanceDbContext.cof_director"> <member name="P:Performance.EntityModels.PerformanceDbContext.cof_director">
<summary> 规模绩效、效率绩效计算系数配置 </summary> <summary> 规模绩效、效率绩效计算系数配置 </summary>
</member> </member>
<member name="P:Performance.EntityModels.PerformanceDbContext.cof_drugprop">
<summary> 工作量门诊药占比系数 </summary>
</member>
<member name="P:Performance.EntityModels.PerformanceDbContext.cof_drugtype"> <member name="P:Performance.EntityModels.PerformanceDbContext.cof_drugtype">
<summary> 药占比费用列头名称 </summary> <summary> 药占比费用列头名称 </summary>
</member> </member>
...@@ -1316,36 +1310,6 @@ ...@@ -1316,36 +1310,6 @@
单元格列头名称 单元格列头名称
</summary> </summary>
</member> </member>
<member name="T:Performance.EntityModels.cof_cmi">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.cof_cmi.Id">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.cof_cmi.AllotId">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.cof_cmi.UnitType">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.cof_cmi.AccountingUnit">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.cof_cmi.Value">
<summary>
</summary>
</member>
<member name="T:Performance.EntityModels.cof_depttype"> <member name="T:Performance.EntityModels.cof_depttype">
<summary> <summary>
科室类型 科室类型
...@@ -1406,36 +1370,6 @@ ...@@ -1406,36 +1370,6 @@
绩效系数 绩效系数
</summary> </summary>
</member> </member>
<member name="T:Performance.EntityModels.cof_drugprop">
<summary>
工作量门诊药占比系数
</summary>
</member>
<member name="P:Performance.EntityModels.cof_drugprop.ID">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.cof_drugprop.AllotID">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.cof_drugprop.MaxRange">
<summary>
药占比最大范围(小于)
</summary>
</member>
<member name="P:Performance.EntityModels.cof_drugprop.MinRange">
<summary>
药占比最小范围(大于等于)
</summary>
</member>
<member name="P:Performance.EntityModels.cof_drugprop.Value">
<summary>
药占比对应系数
</summary>
</member>
<member name="T:Performance.EntityModels.cof_drugtype"> <member name="T:Performance.EntityModels.cof_drugtype">
<summary> <summary>
药占比费用列头名称 药占比费用列头名称
...@@ -2136,11 +2070,6 @@ ...@@ -2136,11 +2070,6 @@
核算单元(护理组) 核算单元(护理组)
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.im_accountbasic.Department">
<summary>
科室
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.IncludeAvgCalculate"> <member name="P:Performance.EntityModels.im_accountbasic.IncludeAvgCalculate">
<summary> <summary>
是否带入平均计算 是 否 是否带入平均计算 是 否
...@@ -2151,11 +2080,6 @@ ...@@ -2151,11 +2080,6 @@
定科人数 定科人数
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.im_accountbasic.DoctorDirectorNumber">
<summary>
科主任数量
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.DoctorNumber"> <member name="P:Performance.EntityModels.im_accountbasic.DoctorNumber">
<summary> <summary>
核算单元医生数量 核算单元医生数量
...@@ -2166,11 +2090,6 @@ ...@@ -2166,11 +2090,6 @@
医生基础系数 医生基础系数
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.im_accountbasic.DoctorSlopeFactor">
<summary>
倾斜系数
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.DoctorScale"> <member name="P:Performance.EntityModels.im_accountbasic.DoctorScale">
<summary> <summary>
规模绩效系数 规模绩效系数
...@@ -2206,11 +2125,6 @@ ...@@ -2206,11 +2125,6 @@
材料占比奖罚 材料占比奖罚
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.im_accountbasic.DoctorExtra">
<summary>
医院奖罚
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.DoctorScoringAverage"> <member name="P:Performance.EntityModels.im_accountbasic.DoctorScoringAverage">
<summary> <summary>
考核对分率 考核对分率
...@@ -2231,71 +2145,6 @@ ...@@ -2231,71 +2145,6 @@
保底绩效系数 保底绩效系数
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.im_accountbasic.NurseHeadNumber">
<summary>
护士长人数
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.NurseNumber">
<summary>
护士人数
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.NurseBasicFactor">
<summary>
护理基础系数
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.NurseSlopeFactor">
<summary>
倾斜系数
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.NurseScale">
<summary>
规模绩效系数
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.NurseEffic">
<summary>
效率绩效系数
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.NurseGrant">
<summary>
发放系数
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.NurseOtherPerfor1">
<summary>
其他绩效1
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.NurseOtherPerfor2">
<summary>
其他绩效2
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.NurseExtra">
<summary>
医院奖罚
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.NurseScoringAverage">
<summary>
考核对分率
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.NurseAdjustFactor">
<summary>
调节系数
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.WorkSlopeFactor">
<summary>
工作量倾斜系数
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.UpdateDate"> <member name="P:Performance.EntityModels.im_accountbasic.UpdateDate">
<summary> <summary>
......
...@@ -10,12 +10,12 @@ public class HandsonTable ...@@ -10,12 +10,12 @@ public class HandsonTable
{ {
private IEnumerable<collect_permission> _permissions; private IEnumerable<collect_permission> _permissions;
private List<Dictionary<string, string>> _data; private List<Dictionary<string, string>> _data;
public HandsonTable(int sheetType, string[] cols, List<collect_permission> permissions) public HandsonTable(int sheetType, string[] cols, List<collect_permission> permissions)
{ {
_permissions = permissions; _permissions = permissions;
_data = new List<Dictionary<string, string>>(); _data = new List<Dictionary<string, string>>();
InitColHeaders(sheetType, cols); InitColHeaders(sheetType, cols);
InitColumns(permissions); InitColumns(permissions);
} }
...@@ -25,7 +25,7 @@ public HandsonTable(int sheetType, string[] cols, List<collect_permission> permi ...@@ -25,7 +25,7 @@ public HandsonTable(int sheetType, string[] cols, List<collect_permission> permi
public HandsonColumn[] Columns { get; private set; } public HandsonColumn[] Columns { get; private set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="datas"></param> /// <param name="datas"></param>
/// <param name="isTypein">是否是用户录入的 是:true 不是:false</param> /// <param name="isTypein">是否是用户录入的 是:true 不是:false</param>
...@@ -40,6 +40,8 @@ public void SetRowData(IEnumerable<HandsonRowData> datas, bool isTypein) ...@@ -40,6 +40,8 @@ public void SetRowData(IEnumerable<HandsonRowData> datas, bool isTypein)
dic[item.Name.ToLower()] = item.Value?.ToString() ?? ""; dic[item.Name.ToLower()] = item.Value?.ToString() ?? "";
else if (dic.ContainsKey(item.Name.ToLower()) && _permissions.Any(w => w.HeadName.ToLower() == item.Name.ToLower() && w.AttachLast > 0)) else if (dic.ContainsKey(item.Name.ToLower()) && _permissions.Any(w => w.HeadName.ToLower() == item.Name.ToLower() && w.AttachLast > 0))
dic[item.Name.ToLower()] = item.Value?.ToString() ?? ""; dic[item.Name.ToLower()] = item.Value?.ToString() ?? "";
else if (dic.ContainsKey(item.Name.ToLower()) && _permissions.Any(w => w.HeadName.ToLower() == item.Name.ToLower()))
dic[item.Name.ToLower()] = item.Value?.ToString() ?? "";
} }
_data.Add(dic); _data.Add(dic);
} }
...@@ -105,20 +107,25 @@ public HandsonColumn(string data, bool readOnly = false, DataFormat format = Dat ...@@ -105,20 +107,25 @@ public HandsonColumn(string data, bool readOnly = false, DataFormat format = Dat
case DataFormat.普通格式: case DataFormat.普通格式:
Type = "text"; Type = "text";
break; break;
case DataFormat.小数: case DataFormat.小数:
Type = "numeric"; Type = "numeric";
NumericFormat = new NumericFormat { Pattern = "0,00.00" }; NumericFormat = new NumericFormat { Pattern = "0,00.00" };
break; break;
case DataFormat.百分比: case DataFormat.百分比:
Type = "numeric"; Type = "numeric";
NumericFormat = new NumericFormat { Pattern = "0,00.00%" }; NumericFormat = new NumericFormat { Pattern = "0,00.00%" };
break; break;
} }
} }
public string Data { get; set; } public string Data { get; set; }
public bool ReadOnly { get; set; } public bool ReadOnly { get; set; }
public string Type { get; set; } public string Type { get; set; }
public string[] Source { get; set; }
public bool Strict { get; set; } = false;
public NumericFormat NumericFormat { get; set; } public NumericFormat NumericFormat { get; set; }
} }
......
...@@ -9,11 +9,13 @@ namespace Performance.DtoModels ...@@ -9,11 +9,13 @@ namespace Performance.DtoModels
/// </summary> /// </summary>
public class CofDrugProp public class CofDrugProp
{ {
public string AccoutingUnit { get; set; } public string AccountingUnit { get; set; }
/// <summary> public string UnitType { get; set; }
/// 占比 //public string AccoutingUnit { get; set; }
/// </summary> ///// <summary>
public decimal Prop { get; set; } ///// 占比
///// </summary>
//public decimal Prop { get; set; }
/// <summary> /// <summary>
/// 分值 /// 分值
/// </summary> /// </summary>
......
...@@ -11,32 +11,41 @@ public enum ExcelVersion ...@@ -11,32 +11,41 @@ public enum ExcelVersion
xls xls
} }
/// <summary> 核算单元类型 </summary> /// <summary> 核算单元类型 </summary>
public enum UnitType public enum UnitType
{ {
[Description("医生组")] [Description("医生组")]
医生组 = 1, 医生组 = 1,
[Description("护理组")] [Description("护理组")]
护理组 = 2, 护理组 = 2,
[Description("医技组")] [Description("医技组")]
医技组 = 3, 医技组 = 3,
[Description("专家组")] [Description("专家组")]
专家组 = 4, 专家组 = 4,
//[Description("其他")] //[Description("其他")]
//其他 = 5, //其他 = 5,
[Description("特殊核算组")] [Description("特殊核算组")]
特殊核算组 = 6, 特殊核算组 = 6,
[Description("其他医生组")] [Description("其他医生组")]
其他医生组 = 7, 其他医生组 = 7,
[Description("其他护理组")] [Description("其他护理组")]
其他护理组 = 8, 其他护理组 = 8,
[Description("其他医技组")] [Description("其他医技组")]
其他医技组 = 9, 其他医技组 = 9,
[Description("行政高层")] [Description("行政高层")]
行政高层 = 10, 行政高层 = 10,
[Description("行政中层")] [Description("行政中层")]
行政中层 = 11, 行政中层 = 11,
[Description("行政后勤")] [Description("行政后勤")]
行政后勤 = 12, 行政后勤 = 12,
} }
...@@ -46,27 +55,35 @@ public enum SheetType ...@@ -46,27 +55,35 @@ public enum SheetType
/// <summary> 无法识别 </summary> /// <summary> 无法识别 </summary>
[Description("无法识别")] [Description("无法识别")]
Unidentifiable = 1, Unidentifiable = 1,
/// <summary> 行政中高层 </summary> /// <summary> 行政中高层 </summary>
[Description("行政中高层")] [Description("行政中高层")]
Employee = 2, Employee = 2,
/// <summary> 收入 </summary> /// <summary> 收入 </summary>
[Description("收入")] [Description("收入")]
Income = 3, Income = 3,
/// <summary> 其他收入 </summary> /// <summary> 其他收入 </summary>
[Description("其他收入")] [Description("其他收入")]
OtherIncome = 4, OtherIncome = 4,
/// <summary> 支出 </summary> /// <summary> 支出 </summary>
[Description("支出")] [Description("支出")]
Expend = 5, Expend = 5,
/// <summary> 加班 </summary> /// <summary> 加班 </summary>
[Description("加班")] [Description("加班")]
Overtime = 6, Overtime = 6,
/// <summary> 工作量 </summary> /// <summary> 工作量 </summary>
[Description("工作量")] [Description("工作量")]
Workload = 7, Workload = 7,
/// <summary> 特殊核算单元 </summary> /// <summary> 特殊核算单元 </summary>
[Description("特殊核算单元")] [Description("特殊核算单元")]
SpecialUnit = 8, SpecialUnit = 8,
/// <summary> 临床科室医护绩效测算基础 </summary> /// <summary> 临床科室医护绩效测算基础 </summary>
[Description("临床科室医护绩效测算基础")] [Description("临床科室医护绩效测算基础")]
AccountBasic = 9, AccountBasic = 9,
...@@ -74,15 +91,19 @@ public enum SheetType ...@@ -74,15 +91,19 @@ public enum SheetType
/// <summary> 科室经济核算汇总表 </summary> /// <summary> 科室经济核算汇总表 </summary>
[Description("科室经济核算汇总表")] [Description("科室经济核算汇总表")]
ComputeEconomic = 10, ComputeEconomic = 10,
/// <summary> 医生工作量计算 </summary> /// <summary> 医生工作量计算 </summary>
[Description("医生工作量计算")] [Description("医生工作量计算")]
ComputeDoctorWorkload = 11, ComputeDoctorWorkload = 11,
/// <summary> 护士工作量计算 </summary> /// <summary> 护士工作量计算 </summary>
[Description("护士工作量计算")] [Description("护士工作量计算")]
ComputeNurseWorkload = 12, ComputeNurseWorkload = 12,
/// <summary> 临床科室医生绩效测算表 </summary> /// <summary> 临床科室医生绩效测算表 </summary>
[Description("临床科室医生绩效测算表")] [Description("临床科室医生绩效测算表")]
ComputeDoctorAccount = 13, ComputeDoctorAccount = 13,
/// <summary> 临床科室护士绩效测算表 </summary> /// <summary> 临床科室护士绩效测算表 </summary>
[Description("临床科室护士绩效测算表")] [Description("临床科室护士绩效测算表")]
ComputeNurseAccount = 14, ComputeNurseAccount = 14,
...@@ -115,7 +136,6 @@ public enum SheetType ...@@ -115,7 +136,6 @@ public enum SheetType
[Description("行政后勤")] [Description("行政后勤")]
LogisticsEmployee = 21, LogisticsEmployee = 21,
/// <summary> 科室考核 </summary> /// <summary> 科室考核 </summary>
[Description("科室考核")] [Description("科室考核")]
AccountScoreAverage = 25, AccountScoreAverage = 25,
...@@ -132,22 +152,41 @@ public enum SheetType ...@@ -132,22 +152,41 @@ public enum SheetType
[Description("其他工作量")] [Description("其他工作量")]
OtherWorkload = 28, OtherWorkload = 28,
/// <summary> 预算比例 </summary> /// <summary> 预算比例 </summary>
[Description("预算比例")] [Description("预算比例")]
BudgetRatio = 30, BudgetRatio = 30,
/// <summary> 科室考核前其他绩效 </summary> /// <summary> 科室考核前其他绩效 </summary>
[Description("科室考核前其他绩效")] [Description("科室考核前其他绩效")]
AssessBeforeOtherFee = 31, AssessBeforeOtherFee = 31,
/// <summary> 其他管理绩效 </summary> /// <summary> 其他管理绩效 </summary>
[Description("其他管理绩效")] [Description("其他管理绩效")]
PersonOtherManagePerforFee = 32, PersonOtherManagePerforFee = 32,
/// <summary> 调节后其他管理绩效 </summary> /// <summary> 调节后其他管理绩效 </summary>
[Description("调节后其他管理绩效")] [Description("调节后其他管理绩效")]
PersonAdjustLaterOtherManagePerforFee = 33, PersonAdjustLaterOtherManagePerforFee = 33,
/// <summary> 个人岗位系数 </summary> /// <summary> 个人岗位系数 </summary>
[Description("个人岗位系数")] [Description("个人岗位系数")]
PersonPostCoefficient = 34, PersonPostCoefficient = 34,
/// <summary> 药占比系数 </summary>
[Description("药占比系数")]
WorkloadMedicineProp = 35,
/// <summary> CMI系数 </summary>
[Description("CMI系数")]
WorkloadCMI = 36,
/// <summary> 工作量倾斜系数 </summary>
[Description("工作量倾斜系数")]
WorkloadIncline = 37,
/// <summary> 考核 </summary>
[Description("考核")]
Assess = 38, //该参数作用类似于 其他工作量
} }
/// <summary> /// <summary>
...@@ -158,18 +197,23 @@ public enum AccountUnitType ...@@ -158,18 +197,23 @@ public enum AccountUnitType
/// <summary> </summary> /// <summary> </summary>
[Description("")] [Description("")]
Null = 1, Null = 1,
/// <summary> 临床科室 </summary> /// <summary> 临床科室 </summary>
[Description("科主任")] [Description("科主任")]
科主任 = 2, 科主任 = 2,
/// <summary> 临床科室 </summary> /// <summary> 临床科室 </summary>
[Description("护士长")] [Description("护士长")]
护士长 = 3, 护士长 = 3,
/// <summary> 行政高层 </summary> /// <summary> 行政高层 </summary>
[Description("行政高层")] [Description("行政高层")]
行政高层 = 4, 行政高层 = 4,
/// <summary> 临床科室 </summary> /// <summary> 临床科室 </summary>
[Description("行政中层")] [Description("行政中层")]
行政中层 = 5, 行政中层 = 5,
/// <summary> 临床科室 </summary> /// <summary> 临床科室 </summary>
[Description("行政工勤")] [Description("行政工勤")]
行政工勤 = 6, 行政工勤 = 6,
...@@ -179,30 +223,43 @@ public enum PerforType ...@@ -179,30 +223,43 @@ public enum PerforType
{ {
[Description("临床科室主任人均绩效")] [Description("临床科室主任人均绩效")]
临床主任, 临床主任,
[Description("临床科室副主任人均绩效")] [Description("临床科室副主任人均绩效")]
临床副主任, 临床副主任,
[Description("医技科室主任人均绩效")] [Description("医技科室主任人均绩效")]
医技主任, 医技主任,
[Description("医技科室副主任人均绩效")] [Description("医技科室副主任人均绩效")]
医技副主任, 医技副主任,
[Description("护士长人均绩效")] [Description("护士长人均绩效")]
护士长, 护士长,
[Description("护士人均绩效")] [Description("护士人均绩效")]
护士, 护士,
[Description("临床主任护士长平均")] [Description("临床主任护士长平均")]
临床主任护士长平均, 临床主任护士长平均,
[Description("临床主任医技主任护士长平均")] [Description("临床主任医技主任护士长平均")]
临床主任医技主任护士长平均, 临床主任医技主任护士长平均,
[Description("临床医生人均绩效")] [Description("临床医生人均绩效")]
临床医生, 临床医生,
[Description("医技医生人均绩效")] [Description("医技医生人均绩效")]
医技医生, 医技医生,
[Description("行政高层人均绩效")] [Description("行政高层人均绩效")]
行政高层, 行政高层,
[Description("行政中层人均绩效")] [Description("行政中层人均绩效")]
行政中层, 行政中层,
[Description("行政工勤人均绩效")] [Description("行政工勤人均绩效")]
行政工勤, 行政工勤,
[Description("医生护士平均绩效")] [Description("医生护士平均绩效")]
医生护士平均, 医生护士平均,
} }
...@@ -214,12 +271,16 @@ public enum MinimumType ...@@ -214,12 +271,16 @@ public enum MinimumType
{ {
[Description("保底绩效临床医生人均绩效")] [Description("保底绩效临床医生人均绩效")]
保底临床医生 = 1, 保底临床医生 = 1,
[Description("保底绩效医技医生人均绩效")] [Description("保底绩效医技医生人均绩效")]
保底医技医生 = 2, 保底医技医生 = 2,
[Description("保底绩效护士人均绩效")] [Description("保底绩效护士人均绩效")]
保底护士 = 3, 保底护士 = 3,
[Description("保底绩效行政工勤人均绩效")] [Description("保底绩效行政工勤人均绩效")]
保底工勤 = 4, 保底工勤 = 4,
[Description("自定义保底绩效")] [Description("自定义保底绩效")]
自定义保底 = 5, 自定义保底 = 5,
} }
......
...@@ -72,6 +72,6 @@ public class PerData : IPerData ...@@ -72,6 +72,6 @@ public class PerData : IPerData
public int PointCell { get; set; } public int PointCell { get; set; }
public string SignID { get; set; } public string SignID { get; set; }
public decimal? MedicineFactor { get; set; } //public decimal? MedicineFactor { get; set; }
} }
} }
...@@ -177,10 +177,10 @@ public class PerDataAccountBaisc : IPerData ...@@ -177,10 +177,10 @@ public class PerDataAccountBaisc : IPerData
#region 由计算得出 #region 由计算得出
/// <summary> ///// <summary>
/// 药占比系数 ///// 药占比系数
/// </summary> ///// </summary>
public Nullable<decimal> MedicineFactor { get; set; } //public Nullable<decimal> MedicineFactor { get; set; }
///// <summary> ///// <summary>
///// 保底绩效金额 ///// 保底绩效金额
......
...@@ -9,17 +9,17 @@ public class ExtractRequest ...@@ -9,17 +9,17 @@ public class ExtractRequest
{ {
/// <summary> /// <summary>
/// 绩效ID /// 绩效ID
/// </summary> /// </summary>
public int AllotId { get; set; } public int AllotId { get; set; }
/// <summary> /// <summary>
/// 医院ID /// 医院ID
/// </summary> /// </summary>
public int HospitalId { get; set; } public int HospitalId { get; set; }
/// <summary> /// <summary>
/// 使用方案 /// 使用方案
/// </summary> /// </summary>
public int UseScheme { get; set; } public int UseScheme { get; set; }
/// <summary> /// <summary>
...@@ -27,9 +27,16 @@ public class ExtractRequest ...@@ -27,9 +27,16 @@ public class ExtractRequest
/// </summary> /// </summary>
public string Email { get; set; } public string Email { get; set; }
/// <summary>
/// Signalr分组名称
/// </summary>
public string GroupName { get; set; } public string GroupName { get; set; }
}
/// <summary>
/// 用户Id
/// </summary>
public int UserId { get; set; }
}
public class ExtractRequestValidator : AbstractValidator<ExtractRequest> public class ExtractRequestValidator : AbstractValidator<ExtractRequest>
{ {
......
namespace Performance.DtoModels
{
public class RecalculationRequest
{
public int AllotId { get; set; }
public decimal? Money { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class SignalrLogRequest
{
public int Type { get; set; }
public string Tag { get; set; }
public string Message { get; set; }
public int Level { get; set; }
public string GroupName { get; set; }
}
}
...@@ -85,6 +85,9 @@ public class DetailModule ...@@ -85,6 +85,9 @@ public class DetailModule
/// <summary> CMI系数 </summary> /// <summary> CMI系数 </summary>
public decimal? CMIFactor { get; set; } public decimal? CMIFactor { get; set; }
/// <summary> 工作量倾斜系数 </summary>
public decimal? InclineFactor { get; set; }
/// <summary> 结算值 </summary> /// <summary> 结算值 </summary>
public decimal? ItemValue { get; set; } public decimal? ItemValue { get; set; }
} }
......
...@@ -74,8 +74,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options) ...@@ -74,8 +74,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
/// <summary> 上传excel文件校验配置 </summary> /// <summary> 上传excel文件校验配置 </summary>
public virtual DbSet<cof_check> cof_check { get; set; } public virtual DbSet<cof_check> cof_check { get; set; }
/// <summary> </summary> ///// <summary> </summary>
public virtual DbSet<cof_cmi> cof_cmi { get; set; } //public virtual DbSet<cof_cmi> cof_cmi { get; set; }
/// <summary> 科室类型 </summary> /// <summary> 科室类型 </summary>
public virtual DbSet<cof_depttype> cof_depttype { get; set; } public virtual DbSet<cof_depttype> cof_depttype { get; set; }
...@@ -83,8 +83,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options) ...@@ -83,8 +83,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
/// <summary> 规模绩效、效率绩效计算系数配置 </summary> /// <summary> 规模绩效、效率绩效计算系数配置 </summary>
public virtual DbSet<cof_director> cof_director { get; set; } public virtual DbSet<cof_director> cof_director { get; set; }
/// <summary> 工作量门诊药占比系数 </summary> ///// <summary> 工作量门诊药占比系数 </summary>
public virtual DbSet<cof_drugprop> cof_drugprop { get; set; } //public virtual DbSet<cof_drugprop> cof_drugprop { get; set; }
/// <summary> 药占比费用列头名称 </summary> /// <summary> 药占比费用列头名称 </summary>
public virtual DbSet<cof_drugtype> cof_drugtype { get; set; } public virtual DbSet<cof_drugtype> cof_drugtype { get; set; }
......
//----------------------------------------------------------------------- ////-----------------------------------------------------------------------
// <copyright file=" cof_cmi.cs"> //// <copyright file=" cof_cmi.cs">
// * FileName: .cs //// * FileName: .cs
// </copyright> //// </copyright>
//----------------------------------------------------------------------- ////-----------------------------------------------------------------------
using System; //using System;
using System.ComponentModel.DataAnnotations; //using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; //using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels //namespace Performance.EntityModels
{ //{
/// <summary> // /// <summary>
/// // ///
/// </summary> // /// </summary>
[Table("cof_cmi")] // [Table("cof_cmi")]
public class cof_cmi // public class cof_cmi
{ // {
/// <summary> // /// <summary>
/// // ///
/// </summary> // /// </summary>
[Key] // [Key]
public int Id { get; set; } // public int Id { get; set; }
/// <summary> // /// <summary>
/// // ///
/// </summary> // /// </summary>
public int AllotId { get; set; } // public int AllotId { get; set; }
/// <summary> // /// <summary>
/// // ///
/// </summary> // /// </summary>
public int UnitType { get; set; } // public int UnitType { get; set; }
/// <summary> // /// <summary>
/// // ///
/// </summary> // /// </summary>
public string AccountingUnit { get; set; } // public string AccountingUnit { get; set; }
/// <summary> // /// <summary>
/// // ///
/// </summary> // /// </summary>
public Nullable<decimal> Value { get; set; } // public Nullable<decimal> Value { get; set; }
} // }
} //}
//----------------------------------------------------------------------- ////-----------------------------------------------------------------------
// <copyright file=" cof_drugprop.cs"> //// <copyright file=" cof_drugprop.cs">
// * FileName: 工作量门诊药占比系数.cs //// * FileName: 工作量门诊药占比系数.cs
// </copyright> //// </copyright>
//----------------------------------------------------------------------- ////-----------------------------------------------------------------------
using System; //using System;
using System.ComponentModel.DataAnnotations; //using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; //using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels //namespace Performance.EntityModels
{ //{
/// <summary> // /// <summary>
/// 工作量门诊药占比系数 // /// 工作量门诊药占比系数
/// </summary> // /// </summary>
[Table("cof_drugprop")] // [Table("cof_drugprop")]
public class cof_drugprop // public class cof_drugprop
{ // {
/// <summary> // /// <summary>
/// // ///
/// </summary> // /// </summary>
[Key] // [Key]
public int ID { get; set; } // public int ID { get; set; }
/// <summary> // /// <summary>
/// // ///
/// </summary> // /// </summary>
public Nullable<int> AllotID { get; set; } // public Nullable<int> AllotID { get; set; }
/// <summary> // /// <summary>
/// 药占比最大范围(小于) // /// 药占比最大范围(小于)
/// </summary> // /// </summary>
public Nullable<decimal> MaxRange { get; set; } // public Nullable<decimal> MaxRange { get; set; }
/// <summary> // /// <summary>
/// 药占比最小范围(大于等于) // /// 药占比最小范围(大于等于)
/// </summary> // /// </summary>
public Nullable<decimal> MinRange { get; set; } // public Nullable<decimal> MinRange { get; set; }
/// <summary> // /// <summary>
/// 药占比对应系数 // /// 药占比对应系数
/// </summary> // /// </summary>
public Nullable<decimal> Value { get; set; } // public Nullable<decimal> Value { get; set; }
} // }
} //}
...@@ -46,10 +46,10 @@ public class im_accountbasic ...@@ -46,10 +46,10 @@ public class im_accountbasic
/// </summary> /// </summary>
public string NurseAccountingUnit { get; set; } public string NurseAccountingUnit { get; set; }
/// <summary> ///// <summary>
/// 科室 ///// 科室
/// </summary> ///// </summary>
public string Department { get; set; } //public string Department { get; set; }
/// <summary> /// <summary>
/// 是否带入平均计算 是 否 /// 是否带入平均计算 是 否
...@@ -61,10 +61,10 @@ public class im_accountbasic ...@@ -61,10 +61,10 @@ public class im_accountbasic
/// </summary> /// </summary>
public Nullable<decimal> PermanentStaff { get; set; } public Nullable<decimal> PermanentStaff { get; set; }
/// <summary> ///// <summary>
/// 科主任数量 ///// 科主任数量
/// </summary> ///// </summary>
public Nullable<decimal> DoctorDirectorNumber { get; set; } //public Nullable<decimal> DoctorDirectorNumber { get; set; }
/// <summary> /// <summary>
/// 核算单元医生数量 /// 核算单元医生数量
...@@ -76,10 +76,10 @@ public class im_accountbasic ...@@ -76,10 +76,10 @@ public class im_accountbasic
/// </summary> /// </summary>
public Nullable<decimal> DoctorBasicFactor { get; set; } public Nullable<decimal> DoctorBasicFactor { get; set; }
/// <summary> ///// <summary>
/// 倾斜系数 ///// 倾斜系数
/// </summary> ///// </summary>
public Nullable<decimal> DoctorSlopeFactor { get; set; } //public Nullable<decimal> DoctorSlopeFactor { get; set; }
/// <summary> /// <summary>
/// 规模绩效系数 /// 规模绩效系数
...@@ -116,9 +116,9 @@ public class im_accountbasic ...@@ -116,9 +116,9 @@ public class im_accountbasic
/// </summary> /// </summary>
public Nullable<decimal> MaterialsExtra { get; set; } public Nullable<decimal> MaterialsExtra { get; set; }
/// <summary> ///// <summary>
/// 医院奖罚 ///// 医院奖罚
/// </summary> ///// </summary>
public Nullable<decimal> DoctorExtra { get; set; } public Nullable<decimal> DoctorExtra { get; set; }
/// <summary> /// <summary>
...@@ -141,70 +141,70 @@ public class im_accountbasic ...@@ -141,70 +141,70 @@ public class im_accountbasic
/// </summary> /// </summary>
public Nullable<decimal> MinimumFactor { get; set; } public Nullable<decimal> MinimumFactor { get; set; }
/// <summary> ///// <summary>
/// 护士长人数 ///// 护士长人数
/// </summary> ///// </summary>
public Nullable<decimal> NurseHeadNumber { get; set; } //public Nullable<decimal> NurseHeadNumber { get; set; }
/// <summary> ///// <summary>
/// 护士人数 ///// 护士人数
/// </summary> ///// </summary>
public Nullable<decimal> NurseNumber { get; set; } //public Nullable<decimal> NurseNumber { get; set; }
/// <summary> ///// <summary>
/// 护理基础系数 ///// 护理基础系数
/// </summary> ///// </summary>
public Nullable<decimal> NurseBasicFactor { get; set; } //public Nullable<decimal> NurseBasicFactor { get; set; }
/// <summary> ///// <summary>
/// 倾斜系数 ///// 倾斜系数
/// </summary> ///// </summary>
public Nullable<decimal> NurseSlopeFactor { get; set; } //public Nullable<decimal> NurseSlopeFactor { get; set; }
/// <summary> ///// <summary>
/// 规模绩效系数 ///// 规模绩效系数
/// </summary> ///// </summary>
public Nullable<decimal> NurseScale { get; set; } //public Nullable<decimal> NurseScale { get; set; }
/// <summary> ///// <summary>
/// 效率绩效系数 ///// 效率绩效系数
/// </summary> ///// </summary>
public Nullable<decimal> NurseEffic { get; set; } //public Nullable<decimal> NurseEffic { get; set; }
/// <summary> ///// <summary>
/// 发放系数 ///// 发放系数
/// </summary> ///// </summary>
public Nullable<decimal> NurseGrant { get; set; } //public Nullable<decimal> NurseGrant { get; set; }
/// <summary> ///// <summary>
/// 其他绩效1 ///// 其他绩效1
/// </summary> ///// </summary>
public Nullable<decimal> NurseOtherPerfor1 { get; set; } //public Nullable<decimal> NurseOtherPerfor1 { get; set; }
/// <summary> ///// <summary>
/// 其他绩效2 ///// 其他绩效2
/// </summary> ///// </summary>
public Nullable<decimal> NurseOtherPerfor2 { get; set; } //public Nullable<decimal> NurseOtherPerfor2 { get; set; }
/// <summary> ///// <summary>
/// 医院奖罚 ///// 医院奖罚
/// </summary> ///// </summary>
public Nullable<decimal> NurseExtra { get; set; } //public Nullable<decimal> NurseExtra { get; set; }
/// <summary> ///// <summary>
/// 考核对分率 ///// 考核对分率
/// </summary> ///// </summary>
public Nullable<decimal> NurseScoringAverage { get; set; } //public Nullable<decimal> NurseScoringAverage { get; set; }
/// <summary> ///// <summary>
/// 调节系数 ///// 调节系数
/// </summary> ///// </summary>
public Nullable<decimal> NurseAdjustFactor { get; set; } //public Nullable<decimal> NurseAdjustFactor { get; set; }
/// <summary> ///// <summary>
/// 工作量倾斜系数 ///// 工作量倾斜系数
/// </summary> ///// </summary>
public Nullable<decimal> WorkSlopeFactor { get; set; } //public Nullable<decimal> WorkSlopeFactor { get; set; }
/// <summary> /// <summary>
/// ///
...@@ -215,17 +215,15 @@ public class im_accountbasic ...@@ -215,17 +215,15 @@ public class im_accountbasic
/// ///
/// </summary> /// </summary>
public Nullable<int> UpdateUser { get; set; } public Nullable<int> UpdateUser { get; set; }
/// <summary> /// <summary>
/// 考核前其他绩效 /// 考核前其他绩效
/// </summary> /// </summary>
public Nullable<decimal> AssessBeforeOtherFee { get; set; } public Nullable<decimal> AssessBeforeOtherFee { get; set; }
/// <summary> /// <summary>
/// 考核后其他绩效 /// 考核后其他绩效
/// </summary> /// </summary>
public Nullable<decimal> AssessLaterOtherFee { get; set; } public Nullable<decimal> AssessLaterOtherFee { get; set; }
/// <summary> /// <summary>
/// 调节后其他绩效 /// 调节后其他绩效
/// </summary> /// </summary>
......
...@@ -16,6 +16,7 @@ public class ModExtractController : Controller ...@@ -16,6 +16,7 @@ public class ModExtractController : Controller
{ {
private readonly ILogger<ModExtractController> logger; private readonly ILogger<ModExtractController> logger;
private ExConfigService service; private ExConfigService service;
public ModExtractController( public ModExtractController(
ILogger<ModExtractController> logger, ILogger<ModExtractController> logger,
ExConfigService service) ExConfigService service)
...@@ -24,34 +25,38 @@ public class ModExtractController : Controller ...@@ -24,34 +25,38 @@ public class ModExtractController : Controller
this.service = service; this.service = service;
} }
/// <summary> #region 弃用
/// 绩效数据抽取模板
/// </summary>
/// <returns></returns>
[Route("scheme")]
[HttpPost]
public ApiResponse Extract([CustomizeValidator(RuleSet = "Query"), FromBody]ModModuleRequest request)
{
if (request.HospitalId == null || request.HospitalId.Value == 0)
return new ApiResponse(ResponseType.ParameterError, "HospitalId 不存在,请重新选择!");
if (request.ExecuteType == null || !request.ExecuteType.Any())
return new ApiResponse(ResponseType.ParameterError, "ExecuteType 不存在,请重新选择!");
var list = service.ExtractScheme(request.HospitalId.Value, request.ExecuteType); ///// <summary>
return new ApiResponse(ResponseType.OK, list); ///// 绩效数据抽取模板
} ///// </summary>
///// <returns></returns>
//[Route("scheme")]
//[HttpPost]
//public ApiResponse Extract([CustomizeValidator(RuleSet = "Query"), FromBody]ModModuleRequest request)
//{
// if (request.HospitalId == null || request.HospitalId.Value == 0)
// return new ApiResponse(ResponseType.ParameterError, "HospitalId 不存在,请重新选择!");
// if (request.ExecuteType == null || !request.ExecuteType.Any())
// return new ApiResponse(ResponseType.ParameterError, "ExecuteType 不存在,请重新选择!");
/// <summary> // var list = service.ExtractScheme(request.HospitalId.Value, request.ExecuteType);
/// 费用类型 // return new ApiResponse(ResponseType.OK, list);
/// </summary> //}
/// <returns></returns>
[Route("type")] ///// <summary>
[HttpPost] ///// 费用类型
public ApiResponse FeeType() ///// </summary>
{ ///// <returns></returns>
var list = service.FeeType(); //[Route("type")]
return new ApiResponse(ResponseType.OK, list); //[HttpPost]
} //public ApiResponse FeeType()
//{
// var list = service.FeeType();
// return new ApiResponse(ResponseType.OK, list);
//}
#endregion 弃用
/// <summary> /// <summary>
/// 绩效考核项费用来源 /// 绩效考核项费用来源
...@@ -59,7 +64,7 @@ public ApiResponse FeeType() ...@@ -59,7 +64,7 @@ public ApiResponse FeeType()
/// <returns></returns> /// <returns></returns>
[Route("source")] [Route("source")]
[HttpPost] [HttpPost]
public ApiResponse FeeSource([FromBody]ModModuleRequest request) public ApiResponse FeeSource([FromBody] ModModuleRequest request)
{ {
if (request.HospitalId == null || request.HospitalId.Value == 0) if (request.HospitalId == null || request.HospitalId.Value == 0)
return new ApiResponse(ResponseType.ParameterError, "HospitalId 参数错误!"); return new ApiResponse(ResponseType.ParameterError, "HospitalId 参数错误!");
...@@ -75,11 +80,11 @@ public ApiResponse FeeSource([FromBody]ModModuleRequest request) ...@@ -75,11 +80,11 @@ public ApiResponse FeeSource([FromBody]ModModuleRequest request)
/// <returns></returns> /// <returns></returns>
[Route("items")] [Route("items")]
[HttpPost] [HttpPost]
public ApiResponse Items([FromBody]ModItemRequest request) public ApiResponse Items([FromBody] ModItemRequest request)
{ {
logger.LogInformation($"绩效收入模板配置项列表:{JsonHelper.Serialize(request)}"); logger.LogInformation($"绩效收入模板配置项列表:{JsonHelper.Serialize(request)}");
service.AddItems(request.ModuleId.Value); service.AddItems(request.ModuleId.Value);
return new ApiResponse(ResponseType.OK); return new ApiResponse(ResponseType.OK);
} }
} }
} }
\ No newline at end of file
using RestSharp;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Performance.Infrastructure
{
public class RestSharpHelper
{
public const string tokenHeader = "Authorization";
public RestClient SetUrl(string baseUrl, string endpoint)
{
var url = Path.Combine(baseUrl, endpoint);
var restClient = new RestClient(url);
return restClient;
}
public RestRequest CreateGetRequest(string tokenHeader = tokenHeader, string token = null, int timeout = -1)
{
var restRequest = new RestRequest(Method.GET);
restRequest.AddHeader(tokenHeader, token);
restRequest.AddHeader("Accept", "application/json");
restRequest.Timeout = timeout;
return restRequest;
}
public RestRequest CreatePostRequest(string payload, string tokenHeader = tokenHeader, string token = null, int timeout = -1)
{
var restRequest = new RestRequest(Method.POST);
restRequest.AddHeader(tokenHeader, token);
restRequest.AddHeader("Accept", "application/json");
restRequest.AddParameter("application/json", payload, ParameterType.RequestBody);
restRequest.Timeout = timeout;
return restRequest;
}
public RestRequest CreateFileRequest(string[] files, Dictionary<string, object> parameter = null, string tokenHeader = tokenHeader, string token = null, int timeout = -1)
{
var restRequest = new RestRequest(Method.POST);
restRequest.AddHeader(tokenHeader, token);
if (files != null && files.Any(t => !string.IsNullOrEmpty(t)))
{
int i = 1;
foreach (var file in files.Where(t => !string.IsNullOrEmpty(t)))
{
restRequest.AddFile(i.ToString(), file);
i++;
}
}
if (parameter != null)
{
foreach (var item in parameter)
{
restRequest.AddParameter(item.Key, item.Value);
}
}
restRequest.Timeout = timeout;
return restRequest;
}
public RestRequest CreatePutRequest(string payload, string tokenHeader = tokenHeader, string token = null, int timeout = -1)
{
var restRequest = new RestRequest(Method.PUT);
restRequest.AddHeader(tokenHeader, token);
restRequest.AddHeader("Accept", "application/json");
restRequest.AddParameter("application/json", payload, ParameterType.RequestBody);
restRequest.Timeout = timeout;
return restRequest;
}
public RestRequest CreateDeleteRequest(string tokenHeader = tokenHeader, string token = null, int timeout = -1)
{
var restRequest = new RestRequest(Method.DELETE);
restRequest.AddHeader(tokenHeader, token);
restRequest.AddHeader("Accept", "application/json");
restRequest.Timeout = timeout;
return restRequest;
}
public IRestResponse GetResponse(RestClient client, RestRequest request)
{
return client.Execute(request);
}
public async Task<IRestResponse> GetResponseAsync(RestClient client, RestRequest request)
{
return await client.ExecuteAsync(request);
}
public DTO GetContent<DTO>(IRestResponse response)
{
var content = response.Content;
DTO dtoObject = JsonHelper.Deserialize<DTO>(content);
return dtoObject;
}
}
}
...@@ -28,6 +28,8 @@ public int DeleteData(int allotId) ...@@ -28,6 +28,8 @@ public int DeleteData(int allotId)
"im_employee_logistics", "im_employee_logistics",
"im_header", "im_header",
"im_specialunit", "im_specialunit",
"log_check",
"per_employee",
"per_sheet", "per_sheet",
"res_account", "res_account",
"res_accountdoctor", "res_accountdoctor",
...@@ -35,7 +37,13 @@ public int DeleteData(int allotId) ...@@ -35,7 +37,13 @@ public int DeleteData(int allotId)
"res_baiscnorm", "res_baiscnorm",
"res_compute", "res_compute",
"res_specialunit", "res_specialunit",
"log_check", "report_allot_crowd",
"report_allot_summary",
"report_original_income",
"report_original_persontime",
"report_original_stays",
"report_original_surgery",
"report_original_workload",
}; };
string sql = ""; string sql = "";
tableArray.ForEach(t => sql += $"delete from {t} where allotid=@allotId;"); tableArray.ForEach(t => sql += $"delete from {t} where allotid=@allotId;");
...@@ -68,21 +76,22 @@ public int DeleteAllotData(int allotId) ...@@ -68,21 +76,22 @@ public int DeleteAllotData(int allotId)
"im_employee_logistics", "im_employee_logistics",
"im_header", "im_header",
"im_specialunit", "im_specialunit",
"per_sheet",
"res_account",
"res_accountdoctor",
"res_accountnurse",
"res_baiscnorm",
"res_compute",
"res_specialunit",
"log_check", "log_check",
"per_employee", "per_employee",
"per_sheet",
"report_allot_crowd", "report_allot_crowd",
"report_allot_summary", "report_allot_summary",
"report_original_income", "report_original_income",
"report_original_persontime", "report_original_persontime",
"report_original_stays", "report_original_stays",
"report_original_surgery", "report_original_surgery",
"report_original_workload",
"res_account",
"res_accountdoctor",
"res_accountnurse",
"res_baiscnorm",
"res_compute",
"res_specialunit",
}; };
string sql = ""; string sql = "";
tableArray.ForEach(t => sql += $"delete from {t} where allotid=@allotId;"); tableArray.ForEach(t => sql += $"delete from {t} where allotid=@allotId;");
...@@ -95,13 +104,20 @@ public int DeleteResData(int allotId) ...@@ -95,13 +104,20 @@ public int DeleteResData(int allotId)
{ {
List<string> tableArray = new List<string> List<string> tableArray = new List<string>
{ {
"log_dbug",
"report_allot_crowd",
"report_allot_summary",
"report_original_income",
"report_original_persontime",
"report_original_stays",
"report_original_surgery",
"report_original_workload",
"res_account", "res_account",
"res_accountdoctor", "res_accountdoctor",
"res_accountnurse", "res_accountnurse",
"res_baiscnorm", "res_baiscnorm",
"res_compute", "res_compute",
"res_specialunit", "res_specialunit",
"log_dbug",
}; };
string sql = ""; string sql = "";
tableArray.ForEach(t => sql += $"delete from {t} where allotid=@allotId;"); tableArray.ForEach(t => sql += $"delete from {t} where allotid=@allotId;");
......
//----------------------------------------------------------------------- ////-----------------------------------------------------------------------
// <copyright file=" cof_cmi.cs"> //// <copyright file=" cof_cmi.cs">
// * FileName: cof_cmi.cs //// * FileName: cof_cmi.cs
// </copyright> //// </copyright>
//----------------------------------------------------------------------- ////-----------------------------------------------------------------------
using System; //using System;
using Performance.EntityModels; //using Performance.EntityModels;
namespace Performance.Repository //namespace Performance.Repository
{ //{
/// <summary> // /// <summary>
/// cof_cmi Repository // /// cof_cmi Repository
/// </summary> // /// </summary>
public partial class PerforCofcmiRepository : PerforRepository<cof_cmi> // public partial class PerforCofcmiRepository : PerforRepository<cof_cmi>
{ // {
public PerforCofcmiRepository(PerformanceDbContext context) : base(context) // public PerforCofcmiRepository(PerformanceDbContext context) : base(context)
{ // {
} // }
} // }
} //}
//----------------------------------------------------------------------- ////-----------------------------------------------------------------------
// <copyright file=" cof_drugprop.cs"> //// <copyright file=" cof_drugprop.cs">
// * FileName: cof_drugprop.cs //// * FileName: cof_drugprop.cs
// </copyright> //// </copyright>
//----------------------------------------------------------------------- ////-----------------------------------------------------------------------
using System; //using System;
using Performance.EntityModels; //using Performance.EntityModels;
namespace Performance.Repository //namespace Performance.Repository
{ //{
/// <summary> // /// <summary>
/// cof_drugprop Repository // /// cof_drugprop Repository
/// </summary> // /// </summary>
public partial class PerforCofdrugpropRepository : PerforRepository<cof_drugprop> // public partial class PerforCofdrugpropRepository : PerforRepository<cof_drugprop>
{ // {
public PerforCofdrugpropRepository(PerformanceDbContext context) : base(context) // public PerforCofdrugpropRepository(PerformanceDbContext context) : base(context)
{ // {
} // }
} // }
} //}
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Repository; using Performance.Repository;
using Performance.Services.AllotCompute; using Performance.Services.AllotCompute;
using Performance.Services.ExtractExcelService;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
...@@ -32,6 +33,9 @@ public class AllotService : IAutoInjection ...@@ -32,6 +33,9 @@ public class AllotService : IAutoInjection
private PerforPerallotRepository _allotRepository; private PerforPerallotRepository _allotRepository;
private IEmailService emailService; private IEmailService emailService;
private readonly IOptions<Application> options; private readonly IOptions<Application> options;
private readonly ComputeDirector _computeDirector;
private readonly PerforRescomputeRepository _perforRescomputeRepository;
private readonly PerforImemployeeRepository _perforImEmployeeRepository;
private PerforPeragainallotRepository _againallotRepository; private PerforPeragainallotRepository _againallotRepository;
private PerforLogcheckRepository perforLogcheckRepository; private PerforLogcheckRepository perforLogcheckRepository;
private readonly PerforHospitalRepository perforHospitalRepository; private readonly PerforHospitalRepository perforHospitalRepository;
...@@ -59,6 +63,9 @@ public class AllotService : IAutoInjection ...@@ -59,6 +63,9 @@ public class AllotService : IAutoInjection
IHostingEnvironment evn, ILogger<AllotService> logger, IHostingEnvironment evn, ILogger<AllotService> logger,
IEmailService emailService, IEmailService emailService,
IOptions<Application> options, IOptions<Application> options,
ComputeDirector computeDirector,
PerforRescomputeRepository perforRescomputeRepository,
PerforImemployeeRepository perforImEmployeeRepository,
PerforPeragainallotRepository againallotRepository, PerforPeragainallotRepository againallotRepository,
PerforLogcheckRepository perforLogcheckRepository, PerforLogcheckRepository perforLogcheckRepository,
PerforHospitalRepository perforHospitalRepository, PerforHospitalRepository perforHospitalRepository,
...@@ -83,6 +90,9 @@ public class AllotService : IAutoInjection ...@@ -83,6 +90,9 @@ public class AllotService : IAutoInjection
this.resultComputeService = resultComputeService; this.resultComputeService = resultComputeService;
this.emailService = emailService; this.emailService = emailService;
this.options = options; this.options = options;
_computeDirector = computeDirector;
_perforRescomputeRepository = perforRescomputeRepository;
_perforImEmployeeRepository = perforImEmployeeRepository;
this.configService = configService; this.configService = configService;
this.logdbug = logdbug; this.logdbug = logdbug;
this.perforresreservedRepository = perforresreservedRepository; this.perforresreservedRepository = perforresreservedRepository;
...@@ -314,6 +324,8 @@ public void Generate(per_allot allot, string mail) ...@@ -314,6 +324,8 @@ public void Generate(per_allot allot, string mail)
logManageService.WriteMsg("绩效开始执行", $"数据来源:用户上传的Excel。", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("绩效开始执行", $"数据来源:用户上传的Excel。", 1, allot.ID, "ReceiveMessage", true);
configService.Clear(allot.ID); configService.Clear(allot.ID);
// 关闭筛选功能
ExtractHelper.CloseAutoFilter(allot.Path);
// 导出数据 // 导出数据
excel = importDataService.ReadDataAndSave(allot); excel = importDataService.ReadDataAndSave(allot);
...@@ -451,6 +463,45 @@ public void Generate(per_allot allot, string mail) ...@@ -451,6 +463,45 @@ public void Generate(per_allot allot, string mail)
} }
/// <summary> /// <summary>
/// 重新计算院领导绩效
/// </summary>
/// <param name="allotId"></param>
/// <param name="money"></param>
public void Recalculation(int allotId, decimal money)
{
var allot = _allotRepository.GetEntity(w => w.ID == allotId);
var empolyeeList = _perforImEmployeeRepository.GetEntities(t => t.AllotID == allotId && t.AccountType == AccountUnitType.行政高层.ToString());
if (empolyeeList == null) return;
var computeEmployees = Mapper.Map<List<ComputeEmployee>>(empolyeeList);
computeEmployees.ForEach(w => w.FitPeopleValue = money);
List<res_baiscnorm> baiscnormList = new List<res_baiscnorm>();
var computResult = _computeDirector.Compute(computeEmployees, allot, baiscnormList);
if (computResult == null) return;
baiscnormList = baiscNormService.ComputeOtherAvg(baiscnormList, computResult, empolyeeList);
baiscnormList.ForEach(t => t.AllotID = allot.ID);
var historyRescompute = _perforRescomputeRepository.GetEntities(w => w.AllotID == allotId && w.AccountType == AccountUnitType.行政高层.ToString());
if (historyRescompute != null && historyRescompute.Any())
_perforRescomputeRepository.RemoveRange(historyRescompute.ToArray());
var computes = Mapper.Map<List<res_compute>>(computResult);
computes.ForEach(t => t.AllotID = allot.ID);
_perforRescomputeRepository.AddRange(computes.ToArray());
var names = baiscnormList.Select(b => b.PositionName).ToList();
var historyResbaiscnorm = perforResbaiscnormRepository.GetEntities(w => w.AllotID == allotId && names.Contains(w.PositionName));
if (historyResbaiscnorm != null && historyResbaiscnorm.Any())
perforResbaiscnormRepository.RemoveRange(historyResbaiscnorm.ToArray());
perforResbaiscnormRepository.AddRange(Mapper.Map<res_baiscnorm[]>(baiscnormList));
}
/// <summary>
/// 发送邮件 /// 发送邮件
/// </summary> /// </summary>
/// <param name="allot"></param> /// <param name="allot"></param>
......
...@@ -78,8 +78,13 @@ public bool SaveBudgetData(int mainYear, List<BudgetResponse> request, int userI ...@@ -78,8 +78,13 @@ public bool SaveBudgetData(int mainYear, List<BudgetResponse> request, int userI
if (amounts != null && perbudgetamountRepository.AddRange(amounts.ToArray())) if (amounts != null && perbudgetamountRepository.AddRange(amounts.ToArray()))
{ {
var ratios = Mapper.Map<List<per_budget_ratio>>(request.Where(t => t.Type == 2)); var ratios = Mapper.Map<List<per_budget_ratio>>(request.Where(t => t.Type == 2));
var budgetData = request.FirstOrDefault(t => t.Type == 2);
ratios.ForEach(t => ratios.ForEach(t =>
{ {
t.HospitalRevenue = budgetData?.HospitalRevenue;
t.MeritPayIncrement = budgetData?.MeritPayIncrement;
t.TheDrugIncomeBudget = budgetData?.TheDrugIncomeBudget;
t.MaterialIncomeBudget = budgetData?.MaterialIncomeBudget;
t.MainYear = mainYear; t.MainYear = mainYear;
t.CreateTime = DateTime.Now; t.CreateTime = DateTime.Now;
t.CreateUser = userId; t.CreateUser = userId;
...@@ -136,19 +141,20 @@ public bool ModifyBudgetData(List<BudgetResponse> request) ...@@ -136,19 +141,20 @@ public bool ModifyBudgetData(List<BudgetResponse> request)
foreach (var item in ratios) foreach (var item in ratios)
{ {
var data = request.FirstOrDefault(t => t.Type == 2 && t.Id == item.Id); var data = request.FirstOrDefault(t => t.Type == 2 && t.Id == item.Id);
var budgetData = request.FirstOrDefault(t => t.Type == 2);
if (data == null) continue; if (data == null) continue;
item.HospitalRevenue = data.HospitalRevenue; item.HospitalRevenue = data.HospitalRevenue == 0 ? budgetData?.HospitalRevenue:data.HospitalRevenue;
item.TotalLaborCost = data.TotalLaborCost; item.TotalLaborCost = data.TotalLaborCost;
item.StaffSpendingFixed = data.StaffSpendingFixed; item.StaffSpendingFixed = data.StaffSpendingFixed;
item.StaffSpendingBonus = data.StaffSpendingBonus; item.StaffSpendingBonus = data.StaffSpendingBonus;
item.MeritPayIncrement = data.MeritPayIncrement; item.MeritPayIncrement = data.MeritPayIncrement==0?budgetData?.MeritPayIncrement:data.MeritPayIncrement;
item.TotalMeritPay = data.TotalMeritPay; item.TotalMeritPay = data.TotalMeritPay;
item.Amplification = data.Amplification; item.Amplification = data.Amplification;
item.IncrementCapitaRatio = data.IncrementCapitaRatio; item.IncrementCapitaRatio = data.IncrementCapitaRatio;
item.TheDrugIncome = data.TheDrugIncome; item.TheDrugIncome = data.TheDrugIncome;
item.TheDrugIncomeBudget = data.TheDrugIncomeBudget; item.TheDrugIncomeBudget = data.TheDrugIncomeBudget==0?budgetData?.TheDrugIncomeBudget:data.TheDrugIncomeBudget;
item.MaterialIncome = data.MaterialIncome; item.MaterialIncome = data.MaterialIncome;
item.MaterialIncomeBudget = data.MaterialIncomeBudget; item.MaterialIncomeBudget = data.MaterialIncomeBudget==0?budgetData?.MaterialIncomeBudget:data.MaterialIncomeBudget;
item.TheCostInTotal = data.TheCostInTotal; item.TheCostInTotal = data.TheCostInTotal;
item.DepreOfFixedAssets = data.DepreOfFixedAssets; item.DepreOfFixedAssets = data.DepreOfFixedAssets;
item.AmortOfIntangibleAssets = data.AmortOfIntangibleAssets; item.AmortOfIntangibleAssets = data.AmortOfIntangibleAssets;
......
using AutoMapper; using AutoMapper;
using NPOI.SS.Formula.Functions;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure; using Performance.Infrastructure;
...@@ -7,7 +6,6 @@ ...@@ -7,7 +6,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace Performance.Services namespace Performance.Services
...@@ -28,7 +26,6 @@ public class ComputeService : IAutoInjection ...@@ -28,7 +26,6 @@ public class ComputeService : IAutoInjection
private readonly PerforPerallotRepository perforPerallotRepository; private readonly PerforPerallotRepository perforPerallotRepository;
private readonly PerforHospitalRepository hospitalRepository; private readonly PerforHospitalRepository hospitalRepository;
private readonly PerforPerapramountRepository perapramountRepository; private readonly PerforPerapramountRepository perapramountRepository;
private readonly PerforCofcmiRepository cofcmiRepository;
private readonly PerforPeremployeeRepository perforPeremployeeRepository; private readonly PerforPeremployeeRepository perforPeremployeeRepository;
private readonly PerforCofworkitemRepository cofworkitemRepository; private readonly PerforCofworkitemRepository cofworkitemRepository;
...@@ -46,7 +43,6 @@ public class ComputeService : IAutoInjection ...@@ -46,7 +43,6 @@ public class ComputeService : IAutoInjection
PerforPerallotRepository perforPerallotRepository, PerforPerallotRepository perforPerallotRepository,
PerforHospitalRepository hospitalRepository, PerforHospitalRepository hospitalRepository,
PerforPerapramountRepository perapramountRepository, PerforPerapramountRepository perapramountRepository,
PerforCofcmiRepository cofcmiRepository,
PerforPeremployeeRepository perforPeremployeeRepository, PerforPeremployeeRepository perforPeremployeeRepository,
PerforCofworkitemRepository cofworkitemRepository) PerforCofworkitemRepository cofworkitemRepository)
{ {
...@@ -64,7 +60,6 @@ public class ComputeService : IAutoInjection ...@@ -64,7 +60,6 @@ public class ComputeService : IAutoInjection
this.perforPerallotRepository = perforPerallotRepository; this.perforPerallotRepository = perforPerallotRepository;
this.hospitalRepository = hospitalRepository; this.hospitalRepository = hospitalRepository;
this.perapramountRepository = perapramountRepository; this.perapramountRepository = perapramountRepository;
this.cofcmiRepository = cofcmiRepository;
this.perforPeremployeeRepository = perforPeremployeeRepository; this.perforPeremployeeRepository = perforPeremployeeRepository;
this.cofworkitemRepository = cofworkitemRepository; this.cofworkitemRepository = cofworkitemRepository;
} }
...@@ -763,7 +758,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId) ...@@ -763,7 +758,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
{ {
(int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload, (int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload,
(int)SheetType.AccountExtra,(int)SheetType.AccountDrugAssess, (int)SheetType.AccountMaterialsAssess, (int)SheetType.AccountScoreAverage, (int)SheetType.AccountExtra,(int)SheetType.AccountDrugAssess, (int)SheetType.AccountMaterialsAssess, (int)SheetType.AccountScoreAverage,
(int)SheetType.AccountAdjustLaterOtherFee, (int)SheetType.BudgetRatio, (int)SheetType.AssessBeforeOtherFee (int)SheetType.AccountAdjustLaterOtherFee, (int)SheetType.BudgetRatio, (int)SheetType.AssessBeforeOtherFee,
}; };
int groupbasis = 1; string single = ""; int groupbasis = 1; string single = "";
...@@ -791,15 +786,20 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId) ...@@ -791,15 +786,20 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
continue; continue;
var workitems = cofworkitemRepository.GetEntities(t => t.AllotID == account.AllotID); var workitems = cofworkitemRepository.GetEntities(t => t.AllotID == account.AllotID);
var allotCmi = cofcmiRepository.GetEntity(t => t.AllotId == account.AllotID && t.UnitType == account.UnitType && t.AccountingUnit == account.AccountingUnit); //var allotCmi = cofcmiRepository.GetEntity(t => t.AllotId == account.AllotID && t.UnitType == account.UnitType && t.AccountingUnit == account.AccountingUnit);
var medicineFactor = GetFactors(persheet, basicData, type, SheetType.WorkloadMedicineProp);
var cmiFactor = GetFactors(persheet, basicData, type, SheetType.WorkloadCMI);
var inclineFactor = GetFactors(persheet, basicData, type, SheetType.WorkloadIncline);
foreach (var dto in items) foreach (var dto in items)
{ {
if (workitems != null && workitems.Any(a => a.Type == 1 && a.Item == dto.ItemName)) if (workitems != null && workitems.Any(a => a.Type == 1 && a.Item == dto.ItemName) && medicineFactor != null)
dto.MediFactor = account.MedicineFactor; dto.MediFactor = medicineFactor;
if (workitems != null && workitems.Any(a => a.Type == 2 && a.Item == dto.ItemName) && allotCmi != null) if (workitems != null && workitems.Any(a => a.Type == 2 && a.Item == dto.ItemName) && cmiFactor != null)
dto.CMIFactor = allotCmi.Value; dto.CMIFactor = cmiFactor;
dto.ItemValue = dto.ItemValue * (dto.MediFactor ?? 1) * (dto.CMIFactor ?? 1); if (workitems != null && workitems.Any(a => a.Type == 3 && a.Item == dto.ItemName) && inclineFactor != null)
dto.InclineFactor = inclineFactor;
dto.ItemValue = dto.ItemValue * (dto.MediFactor ?? 1) * (dto.CMIFactor ?? 1) * (dto.InclineFactor ?? 1);
} }
} }
...@@ -818,6 +818,14 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId) ...@@ -818,6 +818,14 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
//return deptDetails; //return deptDetails;
} }
private decimal? GetFactors(List<per_sheet> persheet, List<im_data> basicData, UnitType type, SheetType sheetType)
{
var sheet = persheet.FirstOrDefault(w => w.SheetType == (int)sheetType);
if (sheet == null)
return null;
return basicData.FirstOrDefault(t => t.SheetID == sheet.ID && t.UnitType == (int)type && t.IsTotal == 1)?.CellValue;
}
private (int sheettype, decimal amount) ClinicDepartmentDetail(List<per_sheet> persheet, res_account account, List<im_data> basicData, per_sheet sheet, UnitType type, string sheetName) private (int sheettype, decimal amount) ClinicDepartmentDetail(List<per_sheet> persheet, res_account account, List<im_data> basicData, per_sheet sheet, UnitType type, string sheetName)
{ {
var sheettype = 1; var sheettype = 1;
...@@ -879,7 +887,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId) ...@@ -879,7 +887,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
SheetType[] pairs = new SheetType[] SheetType[] pairs = new SheetType[]
{ {
SheetType.AccountExtra, SheetType.AccountDrugAssess, SheetType.AccountMaterialsAssess, SheetType.AccountScoreAverage, SheetType.AccountAdjustLaterOtherFee, SheetType.AccountExtra, SheetType.AccountDrugAssess, SheetType.AccountMaterialsAssess, SheetType.AccountScoreAverage, SheetType.AccountAdjustLaterOtherFee,
SheetType.AssessBeforeOtherFee, SheetType.BudgetRatio SheetType.AssessBeforeOtherFee, SheetType.BudgetRatio,
}; };
if (pairs.Contains((SheetType)sheet.SheetType)) if (pairs.Contains((SheetType)sheet.SheetType))
{ {
...@@ -993,6 +1001,7 @@ private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details ...@@ -993,6 +1001,7 @@ private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details
Factor = t.Factor, Factor = t.Factor,
MediFactor = t.MediFactor, MediFactor = t.MediFactor,
CMIFactor = t.CMIFactor, CMIFactor = t.CMIFactor,
InclineFactor = t.InclineFactor,
}).ToList(); }).ToList();
} }
} }
......
...@@ -107,7 +107,7 @@ public SecondResponse GetSecondDetails(int userId, int secondId, int hospitalId, ...@@ -107,7 +107,7 @@ public SecondResponse GetSecondDetails(int userId, int secondId, int hospitalId,
SupplyHeaderByWorkItem(hospitalId, result, secondAllot, savedDataList); SupplyHeaderByWorkItem(hospitalId, result, secondAllot, savedDataList);
result.HeadItems = result.HeadItems.OrderBy(t => t.Type).ThenBy(t => t.WorkType).ThenBy(t => t.Sort).ThenBy(t => t.FiledName).ToList(); result.HeadItems = result.HeadItems.OrderBy(t => t.Type).ThenBy(t => t.WorkType).ThenBy(t => t.Sort).ThenBy(t => t.FiledName).ToList();
result.BodyItems = result.BodyItems.OrderBy(t => t.RowNumber).ThenBy(t => t.Type).ThenBy(t => t.Sort).ToList(); result.BodyItems = result.BodyItems.OrderBy(t => t.RowNumber).ToList();
return result; return result;
} }
...@@ -565,7 +565,58 @@ private void SupplyHeaderByWorkItem(int hospitalId, SecondResponse result, ag_se ...@@ -565,7 +565,58 @@ private void SupplyHeaderByWorkItem(int hospitalId, SecondResponse result, ag_se
#region 其他模板详情 #region 其他模板详情
public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int isArchive, int employeeSource) public HandsonTable GetOtherTempData(int userId, int secondId, int isArchive, int employeeSource, out decimal? realAmount)
{
var result = new HandsonTable((int)SheetType.Unidentifiable, OtherTemp.Select(t => t.Value).ToArray(), OtherTemp.Select(t => new collect_permission
{
HeadName = t.Value,
Visible = 1,
Readnoly = new string[] { "可分配绩效", "医院其他绩效", "预留比例", "预留金额", "实发绩效工资金额" }.Contains(t.Value) ? 1 : 0
}).ToList());
string[] workNumbers = new string[] { };
var details = GetOtherTempDetails(userId, secondId, isArchive, employeeSource, ref workNumbers);
if (result.Columns != null && result.Columns.Any())
{
foreach (var column in result.Columns)
{
if (column.Data == "工号")
{
column.Type = "autocomplete";
column.Source = workNumbers;
column.Strict = true;
}
}
}
realAmount = details?.Sum(t => t.RealAmount);
if (details == null || !details.Any()) return result;
details.ForEach(t =>
{
if (!t.OtherPerformance.HasValue) t.OtherPerformance = 0;
});
List<HandsonRowData> rowDatas = new List<HandsonRowData>();
int i = 1;
foreach (var item in details)
{
var json = JsonHelper.Serialize(item);
var firstDic = JsonHelper.Deserialize<Dictionary<string, string>>(json);
var cells = (from conf in OtherTemp
join fst in firstDic on conf.Key.ToUpper() equals fst.Key.ToUpper()
select new HandsonCellData(conf.Value, fst.Value)).ToList();
cells.Add(new HandsonCellData(nameof(ag_othersource.Id), item.Id));
rowDatas.Add(new HandsonRowData(i, cells));
i++;
}
result.SetRowData(rowDatas, rowDatas != null);
return result;
}
public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int isArchive, int employeeSource, ref string[] workNumbers)
{ {
var secondAllot = agsecondallotRepository.GetEntity(t => t.Id == secondId); var secondAllot = agsecondallotRepository.GetEntity(t => t.Id == secondId);
if (secondAllot == null) throw new PerformanceException("二次绩效信息无效!"); if (secondAllot == null) throw new PerformanceException("二次绩效信息无效!");
...@@ -598,21 +649,22 @@ public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int is ...@@ -598,21 +649,22 @@ public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int is
// 如果已经保存>>走保存加载逻辑 // 如果已经保存>>走保存加载逻辑
if (employeeSource == (int)EmployeeSource.Initial) if (employeeSource == (int)EmployeeSource.Initial)
{ {
result = savedDataList.OrderBy(t => t.Id).ToList(); result = savedDataList.OrderBy(t => t.WorkNumber).ToList();
} }
// 如果没保存>>走加载im_employee_logistics人员名单逻辑 // 如果没保存>>走加载im_employee_logistics人员名单逻辑
else else
{ {
var types = new string[] { "行政后勤", "行政工勤" }; var types = new string[] { "行政后勤", "行政工勤" };
var logistics = _imemployeelogisticsRepository.GetEntities(w => w.AllotID == secondAllot.AllotId && types.Contains(w.AccountType) && w.AccountingUnit == secondAllot.Department); var logistics = _imemployeelogisticsRepository.GetEntities(w => w.AllotID == secondAllot.AllotId && types.Contains(w.AccountType) && w.AccountingUnit == secondAllot.Department);
result = (logistics ?? new List<im_employee_logistics>()).Select(w => new ag_othersource result = (logistics ?? new List<im_employee_logistics>())
{ .OrderBy(t => Convert.ToInt32(t.PersonnelNumber)).Select(w => new ag_othersource
SecondId = secondId, {
WorkNumber = w.PersonnelNumber, SecondId = secondId,
Name = w.DoctorName, WorkNumber = w.PersonnelNumber,
Department = w.AccountingUnit, Name = w.DoctorName,
WorkPost = w.JobTitle, Department = w.AccountingUnit,
}).ToDistinct().ToList(); WorkPost = w.JobTitle,
}).ToDistinct().ToList();
} }
} }
//非行政科室 有三种逻辑,或从保存中加载,或从人员字典加载,或从上次绩效中加载 //非行政科室 有三种逻辑,或从保存中加载,或从人员字典加载,或从上次绩效中加载
...@@ -621,12 +673,12 @@ public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int is ...@@ -621,12 +673,12 @@ public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int is
switch (employeeSource) switch (employeeSource)
{ {
case (int)EmployeeSource.Initial: case (int)EmployeeSource.Initial:
result = savedDataList.OrderBy(t => t.Id).ToList(); result = savedDataList.OrderBy(t => t.WorkNumber).ToList();
break; break;
case (int)EmployeeSource.EmployeeDict: case (int)EmployeeSource.EmployeeDict:
if (employees == null || !employees.Any()) return new List<ag_othersource>(); if (employees == null || !employees.Any()) return new List<ag_othersource>();
result = employees.Select(t => new ag_othersource result = employees.OrderBy(t => t.PersonnelNumber).Select(t => new ag_othersource
{ {
SecondId = secondId, SecondId = secondId,
WorkNumber = t.PersonnelNumber, WorkNumber = t.PersonnelNumber,
...@@ -641,7 +693,7 @@ public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int is ...@@ -641,7 +693,7 @@ public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int is
isSupplementTitlePerformance = prevSavedDataList == null || !prevSavedDataList.Any(); isSupplementTitlePerformance = prevSavedDataList == null || !prevSavedDataList.Any();
if (prevSavedDataList != null && prevSavedDataList.Any()) if (prevSavedDataList != null && prevSavedDataList.Any())
{ {
result = prevSavedDataList.OrderBy(t => t.Id) result = prevSavedDataList.OrderBy(t => t.WorkNumber)
.Select(t => new ag_othersource .Select(t => new ag_othersource
{ {
SecondId = secondId, SecondId = secondId,
...@@ -655,6 +707,7 @@ public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int is ...@@ -655,6 +707,7 @@ public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int is
} }
} }
var originalEmployees = personService.GetPerEmployee(secondAllot.AllotId.Value); var originalEmployees = personService.GetPerEmployee(secondAllot.AllotId.Value);
workNumbers = originalEmployees?.Select(t => t.PersonnelNumber).Distinct().ToArray();
SupplementSecondDetail(secondAllot, originalEmployees, result, isSupplementTitlePerformance); SupplementSecondDetail(secondAllot, originalEmployees, result, isSupplementTitlePerformance);
return result; return result;
...@@ -700,8 +753,27 @@ private void SupplementSecondDetail(ag_secondallot second, List<per_employee> em ...@@ -700,8 +753,27 @@ private void SupplementSecondDetail(ag_secondallot second, List<per_employee> em
} }
} }
public static Dictionary<string, string> OtherTemp { get; } = new Dictionary<string, string>
{
{ nameof(ag_othersource.WorkNumber), "工号" },
{ nameof(ag_othersource.Name), "姓名" },
{ nameof(ag_othersource.Department), "科室" },
{ nameof(ag_othersource.WorkPost), "职称" },
{ nameof(ag_othersource.TitlePerformance), "职称绩效" },
{ nameof(ag_othersource.WorkPerformance), "工作量绩效工资" },
{ nameof(ag_othersource.DeptReward), "科室单项奖励" },
{ nameof(ag_othersource.DistPerformance), "可分配绩效" },
{ nameof(ag_othersource.OtherPerformance), "医院其他绩效" },
{ nameof(ag_othersource.NightWorkPerformance), "夜班工作量绩效" },
{ nameof(ag_othersource.ReservedRatio), "预留比例" },
{ nameof(ag_othersource.ReservedAmount), "预留金额" },
{ nameof(ag_othersource.RealAmount), "实发绩效工资金额" },
};
#endregion 其他模板详情 #endregion 其他模板详情
#region Common
/// <summary> /// <summary>
/// 获取上一次的二次绩效 /// 获取上一次的二次绩效
/// </summary> /// </summary>
...@@ -724,6 +796,8 @@ private ag_secondallot GetPreviousSecondAllot(int hospitalId, ag_secondallot sec ...@@ -724,6 +796,8 @@ private ag_secondallot GetPreviousSecondAllot(int hospitalId, ag_secondallot sec
var prevSecondAllot = agsecondallotRepository.GetEntity(w => w.AllotId == prevAllot.ID && w.UnitType == secondAllot.UnitType && w.Department == secondAllot.Department); var prevSecondAllot = agsecondallotRepository.GetEntity(w => w.AllotId == prevAllot.ID && w.UnitType == secondAllot.UnitType && w.Department == secondAllot.Department);
return prevSecondAllot; return prevSecondAllot;
} }
#endregion Common
} }
/// <summary> /// <summary>
......
...@@ -516,17 +516,15 @@ public void ImpoerAprEmployees(int allotid, string path, int userid) ...@@ -516,17 +516,15 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
var sheet = workbook.GetSheetAt(0); var sheet = workbook.GetSheetAt(0);
var firstRow = sheet.GetRow(0); var firstRow = sheet.GetRow(0);
List<(string, int)> excelheader = new List<(string, int)>(); Dictionary<int, string> excelheader = new Dictionary<int, string>();
for (int cellindex = 0; cellindex < firstRow.LastCellNum + 1; cellindex++) for (int cellindex = 0; cellindex < firstRow.LastCellNum + 1; cellindex++)
{ {
var cell = firstRow.GetCell(cellindex); var value = firstRow.GetCell(cellindex).GetValue();
if (cell == null) continue; if (!string.IsNullOrEmpty(value) && !excelheader.ContainsKey(cellindex))
excelheader.Add(cellindex, value);
if (!string.IsNullOrEmpty(cell.ToString()))
excelheader.Add((cell.ToString(), cellindex));
} }
if (excelheader == null || !excelheader.Any()) if (excelheader == null || excelheader.Count == 0)
throw new PerformanceException("上传excel内容错误"); throw new PerformanceException("上传excel内容错误");
Dictionary<string, int> dict = new Dictionary<string, int> Dictionary<string, int> dict = new Dictionary<string, int>
...@@ -534,16 +532,12 @@ public void ImpoerAprEmployees(int allotid, string path, int userid) ...@@ -534,16 +532,12 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
{ "录入科室", -1 },{ "核算单元", -1 },{ "人员工号", -1 }, { "姓名", -1 }, { "绩效类型", -1 }, { "金额", -1 }, { "录入科室", -1 },{ "核算单元", -1 },{ "人员工号", -1 }, { "姓名", -1 }, { "绩效类型", -1 }, { "金额", -1 },
}; };
List<string> errorHeaders = new List<string>();
foreach (var key in dict.Keys.ToList()) foreach (var key in dict.Keys.ToList())
{ {
if (!excelheader.Select(t => t.Item1).Contains(key)) errorHeaders.Add(key); if (excelheader.Any(w => w.Value == key))
else dict[key] = excelheader.First(t => t.Item1 == key).Item2; dict[key] = excelheader.First(w => w.Value == key).Key;
} }
if (errorHeaders != null && errorHeaders.Any())
throw new PerformanceException($"excel缺少列{string.Join(", ", errorHeaders)}");
var entities = new List<per_apr_amount>(); var entities = new List<per_apr_amount>();
var createtime = DateTime.Now; var createtime = DateTime.Now;
...@@ -555,19 +549,40 @@ public void ImpoerAprEmployees(int allotid, string path, int userid) ...@@ -555,19 +549,40 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
var entity = new per_apr_amount var entity = new per_apr_amount
{ {
Status = 2, Status = 2,
PersonnelNumber = row.GetCell(dict["人员工号"]).GetValue(), PersonnelNumber = dict["人员工号"] < 0 ? "" : row.GetCell(dict["人员工号"]).GetValue(),
DoctorName = row.GetCell(dict["姓名"]).GetValue(), DoctorName = dict["姓名"] < 0 ? "" : row.GetCell(dict["姓名"]).GetValue(),
PerforType = row.GetCell(dict["绩效类型"]).GetValue(), PerforType = dict["绩效类型"] < 0 ? "" : row.GetCell(dict["绩效类型"]).GetValue(),
Amount = ConvertHelper.To<decimal>(row.GetCell(dict["金额"]).GetValue(), 0), Amount = dict["金额"] < 0 ? 0 : ConvertHelper.To<decimal>(row.GetCell(dict["金额"]).GetValue(), 0),
TypeInDepartment = row.GetCell(dict["录入科室"]).GetValue(), TypeInDepartment = dict["录入科室"] < 0 ? "" : row.GetCell(dict["录入科室"]).GetValue(),
AccountingUnit = row.GetCell(dict["核算单元"]).GetValue(), AccountingUnit = dict["核算单元"] < 0 ? "" : row.GetCell(dict["核算单元"]).GetValue(),
AllotId = allotid, AllotId = allotid,
CreateDate = createtime, CreateDate = createtime,
CreateUser = userid, CreateUser = userid,
}; };
entities.Add(entity); entities.Add(entity);
} }
perapramountRepository.AddRange(entities.ToArray());
// 补充核算单元
if (entities.Any())
{
if (entities.Any(w => string.IsNullOrEmpty(w.PersonnelNumber) && w.Amount != 0))
throw new PerformanceException("文件中存在“工号”为空的数据");
if (entities.Any(w => string.IsNullOrEmpty(w.PerforType) && w.Amount != 0))
throw new PerformanceException("文件中存在“绩效类型”为空的数据");
if (entities.Any(w => string.IsNullOrEmpty(w.TypeInDepartment) && w.Amount != 0))
throw new PerformanceException("文件中存在“录入科室”为空的数据");
var employees = peremployeeRepository.GetEntities(w => w.AllotId == allotid);
foreach (var item in entities.Where(w => !string.IsNullOrEmpty(w.PersonnelNumber) && !string.IsNullOrEmpty(w.AccountingUnit)))
{
item.AccountingUnit = employees?.FirstOrDefault(w => w.PersonnelNumber == item.PersonnelNumber)?.AccountingUnit ?? "";
}
perapramountRepository.AddRange(entities.ToArray());
}
}
catch (PerformanceException ex)
{
throw ex;
} }
catch (Exception ex) catch (Exception ex)
{ {
......
using Dapper;
using Microsoft.Extensions.Logging;
using Performance.DtoModels;
using Performance.EntityModels;
using Performance.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace Performance.Services.ExtractExcelService
{
public class DictionaryService : IAutoInjection
{
private readonly ILogger<DictionaryService> logger;
private readonly QueryService queryService;
private readonly LogManageService logService;
private readonly PerforPeremployeeRepository peremployeeRepository;
private readonly PerforHospitalconfigRepository hospitalconfigRepository;
private readonly PerforExtypeRepository extypeRepository;
private readonly PerforExscriptRepository exscriptRepository;
public DictionaryService(
ILogger<DictionaryService> logger,
QueryService queryService,
LogManageService logService,
PerforPeremployeeRepository peremployeeRepository,
PerforHospitalconfigRepository hospitalconfigRepository,
PerforExtypeRepository extypeRepository,
PerforExscriptRepository exscriptRepository
)
{
this.logger = logger;
this.queryService = queryService;
this.logService = logService;
this.peremployeeRepository = peremployeeRepository;
this.hospitalconfigRepository = hospitalconfigRepository;
this.extypeRepository = extypeRepository;
this.exscriptRepository = exscriptRepository;
}
public void Handler(int hospitalId, per_allot allot, string groupName, bool isSingle)
{
try
{
var configs = hospitalconfigRepository.GetEntities(t => t.HospitalId == hospitalId);
if (configs == null || !configs.Any()) throw new Exception("医院未配置绩效抽取信息");
var types = extypeRepository.GetEntities(t => t.HospitalId == hospitalId && new int[] { 2 }.Contains(t.Source));
if (types == null || !types.Any()) return;
logService.ReturnTheLog(allot.ID, groupName, 2, "提取数据", $"提取人员信息数据", isSingle: isSingle);
var scripts = exscriptRepository.GetEntities(t => types.Select(s => s.Id).Contains(t.TypeId) && t.IsEnable == 1);
if (scripts != null && scripts.Any())
{
if (types.Any(t => t.Source == (int)SheetType.Employee)) //人员字典抽取配置
{
var typeIds = types.Where(t => t.Source == (int)SheetType.Employee).Select(t => t.Id);
var script = scripts.FirstOrDefault(t => typeIds.Contains(t.TypeId));
if (script == null) return;
Employee(allot, configs.FirstOrDefault(t => t.Id == script.ConfigId), script.ExecScript);
}
}
}
catch (Exception ex)
{
logger.LogError("获取数据时发生异常");
throw ex;
}
}
private void Employee(per_allot allot, sys_hospitalconfig config, string sql)
{
try
{
if (config == null || string.IsNullOrEmpty(sql)) return;
var data = queryService.QueryData<per_employee>(config, allot, sql);
if (data == null || !data.Any()) return;
var employees = peremployeeRepository.GetEntities(t => t.AllotId == allot.ID);
if (employees != null && employees.Any())
{
peremployeeRepository.RemoveRange(employees.ToArray());
}
peremployeeRepository.AddRange(data.ToArray());
}
catch (Exception ex)
{
logger.LogError("获取人员名单时发生异常:" + ex.ToString());
}
}
private void Department()
{
}
}
}
using NPOI.SS.UserModel; using NPOI.SS.UserModel;
using OfficeOpenXml;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure; using Performance.Infrastructure;
...@@ -17,6 +18,7 @@ public static string GetExtractFile(int hospitalId, ref string newFilePath, stri ...@@ -17,6 +18,7 @@ public static string GetExtractFile(int hospitalId, ref string newFilePath, stri
string originalPath = string.IsNullOrEmpty(allotFilePath) string originalPath = string.IsNullOrEmpty(allotFilePath)
? Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Template", "医院绩效模板.xls") ? Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Template", "医院绩效模板.xls")
: allotFilePath; : allotFilePath;
CloseAutoFilter(originalPath);
var (tempPath, filePath) = CopyOriginalFile(hospitalId, originalPath); var (tempPath, filePath) = CopyOriginalFile(hospitalId, originalPath);
newFilePath = filePath; newFilePath = filePath;
return tempPath; return tempPath;
...@@ -36,7 +38,7 @@ private static (string TempPath, string FilePath) CopyOriginalFile(int hospitalI ...@@ -36,7 +38,7 @@ private static (string TempPath, string FilePath) CopyOriginalFile(int hospitalI
FileHelper.CreateDirectory(dpath); FileHelper.CreateDirectory(dpath);
string tempPath = Path.Combine(dpath, $"Template{DateTime.Now.ToString("yyyyMMddHHmmssfff")}{ext}"); string tempPath = Path.Combine(dpath, $"Template{DateTime.Now.ToString("yyyyMMddHHmmssfff")}{ext}");
FileHelper.Copy(originalPath, tempPath); FileHelper.Copy(originalPath, tempPath);
string filePath = Path.Combine(dpath, $"绩效提取数据{DateTime.Now.ToString("yyyyMMddHHmmssfff")}{ext}"); string filePath = Path.Combine(dpath, $"绩效提取数据{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xls");
return (tempPath, filePath); return (tempPath, filePath);
} }
...@@ -66,7 +68,8 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo ...@@ -66,7 +68,8 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
} }
} }
foreach (var module in modulesList.Where(t => t.SheetType == (int)SheetType.OtherWorkload)?.OrderBy(t => t.ModuleName)) foreach (var module in modulesList.Where(t => new int[] { (int)SheetType.OtherWorkload, (int)SheetType.Assess }
.Contains(t.SheetType.Value))?.OrderBy(t => t.ModuleName))
{ {
var sheet = workbook.GetSheet(module.ModuleName) ?? workbook.GetSheet(module.ModuleName.NoBlank()); var sheet = workbook.GetSheet(module.ModuleName) ?? workbook.GetSheet(module.ModuleName.NoBlank());
if (sheet == null) if (sheet == null)
...@@ -78,6 +81,9 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo ...@@ -78,6 +81,9 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
var copysheet = workbook.GetSheet(item.Key); var copysheet = workbook.GetSheet(item.Key);
var newSheet = copysheet.CopySheet(module.ModuleName, true); var newSheet = copysheet.CopySheet(module.ModuleName, true);
workbook.SetSheetOrder(newSheet.SheetName, workbook.NumberOfSheets - 1); workbook.SetSheetOrder(newSheet.SheetName, workbook.NumberOfSheets - 1);
var point = PerSheetDataFactory.GetDataRead(SheetType.Workload)?.Point;
ClearSheetTemplate(newSheet, point, (SheetType)module.SheetType);
//} //}
} }
} }
...@@ -108,5 +114,64 @@ public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, Shee ...@@ -108,5 +114,64 @@ public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, Shee
} }
} }
} }
public static void ClearSheetTemplate(ISheet sheet, PerSheetPoint point, SheetType sheetType)
{
if (sheet == null)
return;
for (int i = point.HeaderFirstRowNum.Value; i < sheet.LastRowNum + 1; i++)
{
var row = sheet.GetRow(i);
if (row != null)
{
row.ZeroHeight = false; //取消隐藏行
int dataFirstCellRowNum = point.DataFirstCellNum.Value;
//跳过核算单元和科室
for (int j = dataFirstCellRowNum; j < row.LastCellNum; j++)
{
var cell = row.GetCell(j);
if (cell != null)
{
cell.RemoveCellComment(); //删除批注
row.RemoveCell(cell);
}
}
}
}
if (!new SheetType[] { SheetType.Workload, SheetType.OtherWorkload }.Contains(sheetType))
{
var row = sheet.GetRow(0);
if (row != null) sheet.RemoveRow(row);
sheet.ShiftRows(point.DataFirstRowNum.Value, sheet.LastRowNum + 1, -1);
}
}
public static void CloseAutoFilter(string path)
{
try
{
var fileInfo = new FileInfo(path);
using (ExcelPackage package = new ExcelPackage(fileInfo))
{
ExcelWorkbook workbook = package.Workbook;
if (workbook == null) return;
foreach (var sheet in workbook.Worksheets)
{
if (sheet.AutoFilterAddress != null)
{
sheet.Cells[sheet.AutoFilterAddress.Address].AutoFilter = false;
}
}
package.Save();
}
}
catch (Exception ex)
{
}
}
} }
} }
...@@ -34,17 +34,18 @@ public static void WriteSheetHeader(ISheet sheet, PerSheetPoint point, SheetType ...@@ -34,17 +34,18 @@ public static void WriteSheetHeader(ISheet sheet, PerSheetPoint point, SheetType
// 去除excel中已存在的列 // 去除excel中已存在的列
int headerFirstCellNum = point.DataFirstCellNum.Value; int headerFirstCellNum = point.DataFirstCellNum.Value;
if (columnHeader.LastCellNum > point.DataFirstCellNum) if (columnHeader.LastCellNum > point.DataFirstCellNum.Value)
{ {
for (int index = headerFirstCellNum; index < columnHeader.LastCellNum; index++) for (int index = point.DataFirstCellNum.Value; index < columnHeader.LastCellNum; index++)
{ {
var column = columnHeader.GetCell(index).GetDecodeEscapes(); var column = columnHeader.GetCell(index).GetDecodeEscapes();
if (string.IsNullOrEmpty(column)) continue; if (string.IsNullOrEmpty(column)) continue;
if (index > headerFirstCellNum) headerFirstCellNum = index;
columns.RemoveAll(t => t.ColumnName.NoBlank() == column); columns.RemoveAll(t => t.ColumnName.NoBlank() == column);
if (index > headerFirstCellNum)
headerFirstCellNum = index + 1;
} }
if (headerFirstCellNum > point.DataFirstCellNum.Value)
headerFirstCellNum += 1;
} }
if (columns == null || !columns.Any()) return; if (columns == null || !columns.Any()) return;
...@@ -53,7 +54,6 @@ public static void WriteSheetHeader(ISheet sheet, PerSheetPoint point, SheetType ...@@ -53,7 +54,6 @@ public static void WriteSheetHeader(ISheet sheet, PerSheetPoint point, SheetType
: style.SetBgkColorAndFormat(style.GetCellStyle(), StyleType.系数, CellFormat.百分比); : style.SetBgkColorAndFormat(style.GetCellStyle(), StyleType.系数, CellFormat.百分比);
var columnStyle = style.SetBgkColorAndFormat(style.GetCellStyle(), StyleType.列头); var columnStyle = style.SetBgkColorAndFormat(style.GetCellStyle(), StyleType.列头);
headerFirstCellNum += 1;
// 补充excel中不存在的列 // 补充excel中不存在的列
foreach (var item in columns) foreach (var item in columns)
{ {
...@@ -111,7 +111,7 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s ...@@ -111,7 +111,7 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
int dataFirstCellNum = point.DataFirstCellNum.Value; int dataFirstCellNum = point.DataFirstCellNum.Value;
for (int rowIndex = dataFirstRowNum; rowIndex < sheet.LastRowNum + 1; rowIndex++) for (int rowIndex = point.DataFirstRowNum.Value; rowIndex < sheet.LastRowNum + 1; rowIndex++)
{ {
var row = sheet.GetRow(rowIndex); var row = sheet.GetRow(rowIndex);
if (row == null) continue; if (row == null) continue;
...@@ -119,6 +119,8 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s ...@@ -119,6 +119,8 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
string department = row.GetOrCreate(dataFirstCellNum - 1).GetDecodeEscapes(); string department = row.GetOrCreate(dataFirstCellNum - 1).GetDecodeEscapes();
if (string.IsNullOrEmpty(department)) continue; if (string.IsNullOrEmpty(department)) continue;
if (rowIndex > dataFirstRowNum) dataFirstRowNum = rowIndex;
var deptData = data.Where(t => t.Department == department); var deptData = data.Where(t => t.Department == department);
if (deptData == null || !deptData.Any()) continue; if (deptData == null || !deptData.Any()) continue;
...@@ -146,8 +148,8 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s ...@@ -146,8 +148,8 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
} }
data.RemoveAll(t => t.Department == department); data.RemoveAll(t => t.Department == department);
if (rowIndex > dataFirstRowNum) dataFirstRowNum = rowIndex + 1;
} }
dataFirstRowNum += 1;
} }
private static void WriteSheetDataNonexistent(ISheet sheet, IRow columnHeader, PerSheetPoint point, SheetType sheetType, ExcelStyle style, private static void WriteSheetDataNonexistent(ISheet sheet, IRow columnHeader, PerSheetPoint point, SheetType sheetType, ExcelStyle style,
...@@ -166,7 +168,6 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s ...@@ -166,7 +168,6 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
headers = headers.Select(t => t.NoBlank()).ToList(); headers = headers.Select(t => t.NoBlank()).ToList();
dataFirstRowNum += 1;
foreach (string department in departments) foreach (string department in departments)
{ {
var deptData = data.Where(t => t.Department == department); var deptData = data.Where(t => t.Department == department);
...@@ -266,7 +267,7 @@ public static void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType ...@@ -266,7 +267,7 @@ public static void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType
int dataFirstCellNum = point.DataFirstCellNum.Value; int dataFirstCellNum = point.DataFirstCellNum.Value;
for (int rowIndex = dataFirstRowNum; rowIndex < sheet.LastRowNum + 1; rowIndex++) for (int rowIndex = point.DataFirstRowNum.Value; rowIndex < sheet.LastRowNum + 1; rowIndex++)
{ {
var row = sheet.GetRow(rowIndex); var row = sheet.GetRow(rowIndex);
if (row == null) continue; if (row == null) continue;
...@@ -274,6 +275,8 @@ public static void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType ...@@ -274,6 +275,8 @@ public static void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType
string department = row.GetOrCreate(dataFirstCellNum - 1).GetDecodeEscapes(); string department = row.GetOrCreate(dataFirstCellNum - 1).GetDecodeEscapes();
if (string.IsNullOrEmpty(department)) continue; if (string.IsNullOrEmpty(department)) continue;
if (rowIndex > dataFirstRowNum) dataFirstRowNum = rowIndex;
var deptData = data.Where(t => t.Department == department); var deptData = data.Where(t => t.Department == department);
if (deptData == null || !deptData.Any()) continue; if (deptData == null || !deptData.Any()) continue;
...@@ -300,8 +303,8 @@ public static void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType ...@@ -300,8 +303,8 @@ public static void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType
} }
data.RemoveAll(t => t.Department == department); data.RemoveAll(t => t.Department == department);
if (rowIndex > dataFirstRowNum) dataFirstRowNum = rowIndex + 1;
} }
dataFirstRowNum += 1;
} }
private static void WriteCollectDataNonexistent(ISheet sheet, IRow columnHeader, PerSheetPoint point, SheetType sheetType, ExcelStyle style, private static void WriteCollectDataNonexistent(ISheet sheet, IRow columnHeader, PerSheetPoint point, SheetType sheetType, ExcelStyle style,
...@@ -318,7 +321,6 @@ public static void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType ...@@ -318,7 +321,6 @@ public static void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType
headers = headers.Select(t => t.NoBlank()).ToList(); headers = headers.Select(t => t.NoBlank()).ToList();
dataFirstRowNum += 1;
foreach (string department in departments) foreach (string department in departments)
{ {
var deptData = data.Where(t => t.Department == department); var deptData = data.Where(t => t.Department == department);
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text;
namespace Performance.Services.ExtractExcelService namespace Performance.Services.ExtractExcelService
{ {
...@@ -19,7 +18,7 @@ public class ExtractService : IAutoInjection ...@@ -19,7 +18,7 @@ public class ExtractService : IAutoInjection
private readonly QueryService queryService; private readonly QueryService queryService;
private readonly PersonService personService; private readonly PersonService personService;
private readonly PerSheetService perSheetService; private readonly PerSheetService perSheetService;
private readonly PerforHospitalRepository hospitalRepository; private readonly DictionaryService dictionaryService;
private readonly PerforPerallotRepository perallotRepository; private readonly PerforPerallotRepository perallotRepository;
private readonly PerforCollectdataRepository collectdataRepository; private readonly PerforCollectdataRepository collectdataRepository;
private readonly PerforPeremployeeRepository peremployeeRepository; private readonly PerforPeremployeeRepository peremployeeRepository;
...@@ -30,7 +29,7 @@ public class ExtractService : IAutoInjection ...@@ -30,7 +29,7 @@ public class ExtractService : IAutoInjection
QueryService queryService, QueryService queryService,
PersonService personService, PersonService personService,
PerSheetService perSheetService, PerSheetService perSheetService,
PerforHospitalRepository hospitalRepository, DictionaryService dictionaryService,
PerforPerallotRepository perallotRepository, PerforPerallotRepository perallotRepository,
PerforCollectdataRepository collectdataRepository, PerforCollectdataRepository collectdataRepository,
PerforPeremployeeRepository peremployeeRepository PerforPeremployeeRepository peremployeeRepository
...@@ -41,7 +40,7 @@ PerforPeremployeeRepository peremployeeRepository ...@@ -41,7 +40,7 @@ PerforPeremployeeRepository peremployeeRepository
this.queryService = queryService; this.queryService = queryService;
this.personService = personService; this.personService = personService;
this.perSheetService = perSheetService; this.perSheetService = perSheetService;
this.hospitalRepository = hospitalRepository; this.dictionaryService = dictionaryService;
this.perallotRepository = perallotRepository; this.perallotRepository = perallotRepository;
this.collectdataRepository = collectdataRepository; this.collectdataRepository = collectdataRepository;
this.peremployeeRepository = peremployeeRepository; this.peremployeeRepository = peremployeeRepository;
...@@ -74,6 +73,7 @@ public string Main(int allotId, int hospitalId, string email, string groupName, ...@@ -74,6 +73,7 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
var dict = new Dictionary<ExDataDict, object>(); var dict = new Dictionary<ExDataDict, object>();
logService.ReturnTheLog(allotId, groupName, 3, "", 5, 1, isSingle); logService.ReturnTheLog(allotId, groupName, 3, "", 5, 1, isSingle);
dictionaryService.Handler(hospitalId, allot, groupName, isSingle);
var data = queryService.Handler(hospitalId, allot, groupName, isSingle, ref dict); var data = queryService.Handler(hospitalId, allot, groupName, isSingle, ref dict);
var standData = StandDataFormat(hospitalId, data); var standData = StandDataFormat(hospitalId, data);
...@@ -90,6 +90,8 @@ public string Main(int allotId, int hospitalId, string email, string groupName, ...@@ -90,6 +90,8 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
WriteDataToFile(workbook, allotId, dict, standData, groupName, isSingle); WriteDataToFile(workbook, allotId, dict, standData, groupName, isSingle);
logService.ReturnTheLog(allotId, groupName, 2, "提取完成", $"绩效数据提取成功", 5, isSingle); logService.ReturnTheLog(allotId, groupName, 2, "提取完成", $"绩效数据提取成功", 5, isSingle);
workbook.GetCreationHelper().CreateFormulaEvaluator().EvaluateAll(); //实时更新公式的结果
allot.IsExtracting = isSingle ? 2 : 0; allot.IsExtracting = isSingle ? 2 : 0;
allot.ExtractPath = extractFilePath; allot.ExtractPath = extractFilePath;
} }
......
...@@ -80,7 +80,7 @@ public List<ex_result> Handler(int hospitalId, per_allot allot, string groupName ...@@ -80,7 +80,7 @@ public List<ex_result> Handler(int hospitalId, per_allot allot, string groupName
var data = new List<ex_result>(); var data = new List<ex_result>();
logService.ReturnTheLog(allot.ID, groupName, 2, "提取数据", $"开始提取数据"); logService.ReturnTheLog(allot.ID, groupName, 2, "提取数据", $"开始提取数据", isSingle: isSingle);
var scripts = exscriptRepository.GetEntities(t => extypeIds.Contains(t.TypeId)); var scripts = exscriptRepository.GetEntities(t => extypeIds.Contains(t.TypeId));
if (scripts != null && scripts.Any()) if (scripts != null && scripts.Any())
...@@ -367,7 +367,7 @@ private List<ex_result> ExtractSpecialData(per_allot allot, string groupName, bo ...@@ -367,7 +367,7 @@ private List<ex_result> ExtractSpecialData(per_allot allot, string groupName, bo
/// <param name="source"></param> /// <param name="source"></param>
/// <param name="category"></param> /// <param name="category"></param>
/// <returns></returns> /// <returns></returns>
private IEnumerable<ExtractDto> QueryData(sys_hospitalconfig config, per_allot allot, string execsql) public IEnumerable<ExtractDto> QueryData(sys_hospitalconfig config, per_allot allot, string execsql)
{ {
var parameters = GetParameters(allot); var parameters = GetParameters(allot);
using (var connection = ConnectionBuilder.Create((DatabaseType)config.DataBaseType, config.DbSource, config.DbName, config.DbUser, config.DbPassword)) using (var connection = ConnectionBuilder.Create((DatabaseType)config.DataBaseType, config.DbSource, config.DbName, config.DbUser, config.DbPassword))
...@@ -386,6 +386,33 @@ private IEnumerable<ExtractDto> QueryData(sys_hospitalconfig config, per_allot a ...@@ -386,6 +386,33 @@ private IEnumerable<ExtractDto> QueryData(sys_hospitalconfig config, per_allot a
} }
/// <summary> /// <summary>
/// 查询数据
/// </summary>
/// <param name="config"></param>
/// <param name="allot"></param>
/// <param name="execsql"></param>
/// <param name="source"></param>
/// <param name="category"></param>
/// <returns></returns>
public IEnumerable<T> QueryData<T>(sys_hospitalconfig config, per_allot allot, string execsql)
{
var parameters = GetParameters(allot);
using (var connection = ConnectionBuilder.Create((DatabaseType)config.DataBaseType, config.DbSource, config.DbName, config.DbUser, config.DbPassword))
{
foreach (var item in parameters)
{
execsql = Regex.Replace(execsql, item.Key, item.Value, RegexOptions.IgnoreCase);
}
logger.LogInformation($"提取绩效数据SQL脚本{execsql}");
var result = connection.Query<T>(execsql, commandTimeout: 20000);
logger.LogInformation($"提取绩效数据执行脚本获取数据{result?.Count() ?? 0}条记录");
return result;
}
}
/// <summary>
/// 获取参数 /// 获取参数
/// </summary> /// </summary>
/// <param name="allot"></param> /// <param name="allot"></param>
......
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Performance.DtoModels;
using Performance.DtoModels.AppSettings; using Performance.DtoModels.AppSettings;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Repository; using Performance.Repository;
using System; using System;
using System.Threading.Tasks;
namespace Performance.Services namespace Performance.Services
{ {
...@@ -28,7 +30,7 @@ public class LogManageService : IAutoInjection ...@@ -28,7 +30,7 @@ public class LogManageService : IAutoInjection
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="tag">标签</param> /// <param name="tag">标签</param>
/// <param name="message">内容</param> /// <param name="message">内容</param>
...@@ -70,7 +72,7 @@ public void ExtractLog(string groupName, string tag, string message, int level) ...@@ -70,7 +72,7 @@ public void ExtractLog(string groupName, string tag, string message, int level)
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="allotId"></param> /// <param name="allotId"></param>
/// <param name="groupName"></param> /// <param name="groupName"></param>
...@@ -102,8 +104,20 @@ public void ReturnTheLog(int allotId, string groupName, int type, string tag, ob ...@@ -102,8 +104,20 @@ public void ReturnTheLog(int allotId, string groupName, int type, string tag, ob
logdbug.Add(allotId, tag, content, level, type); logdbug.Add(allotId, tag, content, level, type);
if (!isSingle) if (!isSingle)
{ {
var http = url.ImportFile + $"/template/returnlog?type={type}&tag={tag}&message={content}&level={level}&groupName={groupName}"; var http = new RestSharpHelper();
HttpHelper.HttpPost(http); var importUrl = http.SetUrl(url.ImportFile, "/template/returnlog");
var info = new SignalrLogRequest()
{
Type = type,
Tag = tag,
Message = content,
Level = level,
GroupName = groupName
};
string json = JsonHelper.Serialize(info);
var request = http.CreatePostRequest(json);
Task.Run(() => http.GetResponse(importUrl, request));
} }
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -101,6 +101,16 @@ public static IPerSheetDataRead GetDataRead(SheetType sheetType, bool isnew = fa ...@@ -101,6 +101,16 @@ public static IPerSheetDataRead GetDataRead(SheetType sheetType, bool isnew = fa
case SheetType.PersonPostCoefficient: case SheetType.PersonPostCoefficient:
dataread = new PerSheetDataReadPersonExtra(); // 个人岗位系数 dataread = new PerSheetDataReadPersonExtra(); // 个人岗位系数
break; break;
case SheetType.WorkloadMedicineProp:
dataread = new PerSheetDataReadAccountExtra(); // 药占比系数
break;
case SheetType.WorkloadCMI:
dataread = new PerSheetDataReadAccountExtra(); // CMI系数
break;
case SheetType.WorkloadIncline:
dataread = new PerSheetDataReadAccountExtra(); // 工作量倾斜系数
break;
} }
return dataread; return dataread;
} }
......
...@@ -14,14 +14,14 @@ namespace Performance.Services ...@@ -14,14 +14,14 @@ namespace Performance.Services
public class PerSheetService : IAutoInjection public class PerSheetService : IAutoInjection
{ {
private PerHeaderService _perHeader; private PerHeaderService _perHeader;
private PerforCofdrugpropRepository _perforCofdrugpropRepository; //private PerforCofdrugpropRepository _perforCofdrugpropRepository;
private PerforCofdrugtypeRepository _perforCofdrugtypeRepository; private PerforCofdrugtypeRepository _perforCofdrugtypeRepository;
public PerSheetService(PerHeaderService perHeader, public PerSheetService(PerHeaderService perHeader,
PerforCofdrugpropRepository perforCofdrugpropRepository, //PerforCofdrugpropRepository perforCofdrugpropRepository,
PerforCofdrugtypeRepository perforCofdrugtypeRepository) PerforCofdrugtypeRepository perforCofdrugtypeRepository)
{ {
_perHeader = perHeader; _perHeader = perHeader;
_perforCofdrugpropRepository = perforCofdrugpropRepository; //_perforCofdrugpropRepository = perforCofdrugpropRepository;
_perforCofdrugtypeRepository = perforCofdrugtypeRepository; _perforCofdrugtypeRepository = perforCofdrugtypeRepository;
} }
/// <summary> /// <summary>
...@@ -113,6 +113,14 @@ public SheetType GetSheetType(string sheetName) ...@@ -113,6 +113,14 @@ public SheetType GetSheetType(string sheetName)
return SheetType.PersonAdjustLaterOtherManagePerforFee; return SheetType.PersonAdjustLaterOtherManagePerforFee;
else if (sheetName.StartsWith("6.11")) // 个人岗位系数 else if (sheetName.StartsWith("6.11")) // 个人岗位系数
return SheetType.PersonPostCoefficient; return SheetType.PersonPostCoefficient;
else if (sheetName.StartsWith("6.12")) // 药占比系数
return SheetType.WorkloadMedicineProp;
else if (sheetName.StartsWith("6.13")) // CMI系数
return SheetType.WorkloadCMI;
else if (sheetName.StartsWith("6.14")) // 工作量倾斜系数
return SheetType.WorkloadIncline;
else if (sheetName.StartsWith("6.1")) else if (sheetName.StartsWith("6.1"))
return SheetType.AccountScoreAverage; return SheetType.AccountScoreAverage;
else if (sheetName.StartsWith("6.2")) else if (sheetName.StartsWith("6.2"))
......
...@@ -84,7 +84,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null) ...@@ -84,7 +84,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
var value = group.Sum(s => s.IsFactor ? s.CellValue * s.FactorValue : s.CellValue); var value = group.Sum(s => s.IsFactor ? s.CellValue * s.FactorValue : s.CellValue);
if (header.CellValue == "门急诊工作量") if (header.CellValue == "门急诊工作量")
{ {
var factor = confs.FirstOrDefault(t => t.AccoutingUnit == group.Key)?.Factor ?? 0; var factor = confs.FirstOrDefault(t => t.AccountingUnit == group.Key)?.Factor ?? 0;
value = value * factor; value = value * factor;
} }
...@@ -99,7 +99,8 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null) ...@@ -99,7 +99,8 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
/// </summary> /// </summary>
/// <param name="sheet"></param> /// <param name="sheet"></param>
/// <returns></returns> /// <returns></returns>
public (PerSheet Sheet, List<PerData> PerData) TwiceCompute(PerSheet sheet, sys_hospital hospital, List<CofDrugProp> confs = null, List<cof_cmi> cmis = null, List<cof_workitem> workitems = null, bool isDoctor = false) public (PerSheet Sheet, List<PerData> PerData) TwiceCompute(PerSheet sheet, sys_hospital hospital,
IEnumerable<cof_workitem> workitems, IEnumerable<CofDrugProp> medicineProps, IEnumerable<CofDrugProp> cmis, IEnumerable<CofDrugProp> inclines, bool isDoctor = false)
{ {
//获取最大列坐标位置 //获取最大列坐标位置
int thiscell = sheet.PerHeader.OrderByDescending(t => t.PointCell).FirstOrDefault().PointCell + 1; int thiscell = sheet.PerHeader.OrderByDescending(t => t.PointCell).FirstOrDefault().PointCell + 1;
...@@ -115,7 +116,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null) ...@@ -115,7 +116,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
{ {
var ds = group.Select(t => var ds = group.Select(t =>
{ {
var (cellvalue, factor) = ComputValue(group, hospital, confs, cmis, workitems, isDoctor); var cellvalue = ComputValue(group, hospital, workitems, medicineProps, cmis, inclines, isDoctor);
var dto = new PerData var dto = new PerData
{ {
...@@ -123,7 +124,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null) ...@@ -123,7 +124,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
AccountingUnit = group.Key.AccountingUnit, AccountingUnit = group.Key.AccountingUnit,
//CellValue = group.Sum(s => s.CellValue), //CellValue = group.Sum(s => s.CellValue),
CellValue = cellvalue, CellValue = cellvalue,
MedicineFactor = factor, //MedicineFactor = factor,
TypeName = group.Key.UnitType, TypeName = group.Key.UnitType,
RowNumber = group.FirstOrDefault()?.RowNumber ?? 0, RowNumber = group.FirstOrDefault()?.RowNumber ?? 0,
IsTotal = 1, IsTotal = 1,
...@@ -140,45 +141,32 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null) ...@@ -140,45 +141,32 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
return (sheet, perDataList); return (sheet, perDataList);
} }
private (decimal?, decimal?) ComputValue(IGrouping<object, PerData> group, sys_hospital hospital, List<CofDrugProp> confs = null, List<cof_cmi> cmis = null, List<cof_workitem> workitems = null, bool isDoctor = false) private decimal? ComputValue(IGrouping<object, PerData> group, sys_hospital hospital,
IEnumerable<cof_workitem> workitems, IEnumerable<CofDrugProp> medicineProps, IEnumerable<CofDrugProp> cmis, IEnumerable<CofDrugProp> inclines, bool isDoctor = false)
{ {
var unittype = isDoctor ? new List<int> { (int)UnitType.医生组, (int)UnitType.医技组, (int)UnitType.专家组, (int)UnitType.其他医生组, (int)UnitType.其他医技组, (int)UnitType.特殊核算组 } : new List<int> { (int)UnitType.护理组, (int)UnitType.其他护理组 }; var unittype = isDoctor
? new List<string> { UnitType.医生组.ToString(), UnitType.医技组.ToString(), UnitType.专家组.ToString(), UnitType.其他医生组.ToString(), UnitType.其他医技组.ToString(), UnitType.特殊核算组.ToString() }
: new List<string> { UnitType.护理组.ToString(), UnitType.其他护理组.ToString() };
if ((medicineProps == null && cmis == null && inclines == null) || workitems == null)
return group.Sum(s => s.IsFactor ? s.CellValue * s.FactorValue : s.CellValue);
if ((confs == null && cmis == null) || workitems == null) decimal medicinefactor = medicineProps?.FirstOrDefault(t => t.AccountingUnit == group.First().AccountingUnit && unittype.Contains(t.UnitType))?.Factor ?? 1;
return (group.Sum(s => s.IsFactor ? s.CellValue * s.FactorValue : s.CellValue), null); decimal cmifactor = cmis?.FirstOrDefault(t => t.AccountingUnit == group.First().AccountingUnit && unittype.Contains(t.UnitType))?.Factor ?? 1;
else decimal inclinefactor = inclines?.FirstOrDefault(t => t.AccountingUnit == group.First().AccountingUnit && unittype.Contains(t.UnitType))?.Factor ?? 1;
{
var factor = hospital.IsOpenDrugprop == 2 ? 1 : (confs?.FirstOrDefault(t => t.AccoutingUnit == group.First().AccountingUnit)?.Factor ?? 1);
var cmifactor = hospital.IsOpenCMIPercent == 2 ? 1 : (cmis?.FirstOrDefault(t => t.AccountingUnit == group.First().AccountingUnit && unittype.Contains(t.UnitType))?.Value ?? 1);
//需要乘系数的项
var fgroup = group.Where(t => workitems.Select(s => s.Item).Contains(t.TypeName));
//需要乘系数的项
var ngroup = group.Where(t => !workitems.Select(s => s.Item).Contains(t.TypeName));
//var value = fgroup.Sum(s => s.IsFactor ? s.CellValue * s.FactorValue : s.CellValue) * factor;
//value += ngroup.Sum(s => s.IsFactor ? s.CellValue * s.FactorValue : s.CellValue);
var value = fgroup.Sum(s =>
{
var cellvalue = s.IsFactor ? s.CellValue * s.FactorValue : s.CellValue;
if (workitems.Any(w => w.Type == 2) && workitems.Where(w => w.Type == 2).Select(q => q.Item).Contains(s.TypeName))
{
cellvalue = cmifactor * cellvalue;
}
return cellvalue;
});
value += ngroup.Sum(s => var value = group.Sum(s =>
{ {
var cellvalue = s.IsFactor ? s.CellValue * s.FactorValue : s.CellValue; var cellvalue = s.IsFactor ? s.CellValue * s.FactorValue : s.CellValue;
if (workitems.Any(w => w.Type == 1) && workitems.Where(w => w.Type == 1).Select(q => q.Item).Contains(s.TypeName)) if (workitems.Any(w => w.Type == 3 && w.Item == s.TypeName))
{ cellvalue = cellvalue * inclinefactor;
cellvalue = factor * cellvalue; if (workitems.Any(w => w.Type == 2 && w.Item == s.TypeName))
} cellvalue = cellvalue * cmifactor;
return cellvalue; if (workitems.Any(w => w.Type == 1 && w.Item == s.TypeName))
}); cellvalue = cellvalue * medicinefactor;
return (value, factor); return cellvalue;
} });
return value;
} }
#endregion #endregion
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="CSRedisCore" Version="3.0.45" /> <PackageReference Include="CSRedisCore" Version="3.0.45" />
<PackageReference Include="DotNetCore.NPOI" Version="1.2.1" /> <PackageReference Include="DotNetCore.NPOI" Version="1.2.1" />
<PackageReference Include="EPPlus" Version="4.5.3.2" />
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" /> <PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
</ItemGroup> </ItemGroup>
......
...@@ -1688,6 +1688,39 @@ public List<ag_othersource> OtherSave(int secondId, List<ag_othersource> request ...@@ -1688,6 +1688,39 @@ public List<ag_othersource> OtherSave(int secondId, List<ag_othersource> request
return perforAgothersourceRepository.GetEntities(t => t.SecondId == secondId); return perforAgothersourceRepository.GetEntities(t => t.SecondId == secondId);
} }
public void OtherSave(int secondId, SaveCollectData collectData)
{
if (collectData.ColHeaders == null || !collectData.ColHeaders.Any()) return;
var parameters = new List<string>();
foreach (var item in collectData.ColHeaders)
{
if (!SecondAllotDetails.OtherTemp.ContainsValue(item)) throw new PerformanceException($"请确认列'{item}'是否正确");
parameters.Add(SecondAllotDetails.OtherTemp.FirstOrDefault(t => t.Value == item).Key);
}
if (parameters == null || !parameters.Any()) return;
List<string> josn = new List<string>();
foreach (var item in collectData.Data)
{
var list = item.ToList();
var itemList = list.Select(t => $"\"{parameters[list.IndexOf(t)]}\":\"{t}\"");
josn.Add($"{{{string.Join(",", itemList)}}}");
}
var data = JsonHelper.Deserialize<List<ag_othersource>>($"[{string.Join(",", josn)}]");
data = data.Where(t => !string.IsNullOrEmpty(t.WorkNumber) || !string.IsNullOrEmpty(t.Name))?.ToList();
if (data == null || !data.Any()) return;
var existEntities = perforAgothersourceRepository.GetEntities(t => t.SecondId == secondId);
if (existEntities != null && existEntities.Any())
{
perforAgothersourceRepository.RemoveRange(existEntities.ToArray());
}
data.ForEach(t => t.SecondId = secondId);
perforAgothersourceRepository.AddRange(data.ToArray());
}
#endregion 二次绩效其他来源 #endregion 二次绩效其他来源
#region 打印 #region 打印
......
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