Commit b1d5311f by 钟博

Merge branch 'v2020morge' into v2020morge-graphql

# Conflicts:
#	performance/Performance.Api/wwwroot/Performance.EntityModels.xml
#	performance/Performance.EntityModels/Entity/res_account.cs
#	performance/Performance.EntityModels/Entity/sys_hospital.cs
parents e71c6b21 3bd9a58d
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Services; using Performance.Services;
using Performance.Services.ExtractExcelService;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
...@@ -85,6 +86,9 @@ public ApiResponse Import([FromForm] IFormCollection form) ...@@ -85,6 +86,9 @@ public ApiResponse Import([FromForm] IFormCollection form)
if (file == null) if (file == null)
return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效"); return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效");
if (!ExtractHelper.IsXlsxFile(file.FileName))
return new ApiResponse(ResponseType.Fail, "文件格式错误", "文件暂只支持xlsx文件");
var again = againAllotService.GetAgainallot(againid); var again = againAllotService.GetAgainallot(againid);
if (again == null) if (again == null)
return new ApiResponse(ResponseType.Fail, "二次绩效记录不存在"); return new ApiResponse(ResponseType.Fail, "二次绩效记录不存在");
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Services; using Performance.Services;
using Performance.Services.AllotCompute; using Performance.Services.AllotCompute;
using Performance.Services.ExtractExcelService;
using Performance.Services.Queues; using Performance.Services.Queues;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -138,12 +139,16 @@ public ApiResponse Import([FromForm] IFormCollection form) ...@@ -138,12 +139,16 @@ public ApiResponse Import([FromForm] IFormCollection form)
if (file == null) if (file == null)
return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效"); return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效");
if (!ExtractHelper.IsXlsxFile(file.FileName))
return new ApiResponse(ResponseType.Fail, "文件格式错误", "文件暂只支持xlsx文件");
var allot = _allotService.GetAllot(allotid); var allot = _allotService.GetAllot(allotid);
if (allot == null) if (allot == null)
return new ApiResponse(ResponseType.Fail, "allotid不存在"); return new ApiResponse(ResponseType.Fail, "allotid不存在");
var name = FileHelper.GetFileNameNoExtension(file.FileName) + DateTime.Now.ToString("yyyyMMddHHmmssfff"); var name = FileHelper.GetFileNameNoExtension(file.FileName) + DateTime.Now.ToString("yyyyMMddHHmmssfff");
var ext = FileHelper.GetExtension(file.FileName); var ext = FileHelper.GetExtension(file.FileName);
var dpath = Path.Combine(_evn.ContentRootPath, "Files", $"{allot.HospitalId}", $"{allot.Year}{allot.Month.ToString().PadLeft(2, '0')}"); var dpath = Path.Combine(_evn.ContentRootPath, "Files", $"{allot.HospitalId}", $"{allot.Year}{allot.Month.ToString().PadLeft(2, '0')}");
FileHelper.CreateDirectory(dpath); FileHelper.CreateDirectory(dpath);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Performance.Api.Controllers namespace Performance.Api.Controllers
...@@ -300,8 +301,21 @@ public ApiResponse AllComputeByPM([FromBody] ComputerRequest request) ...@@ -300,8 +301,21 @@ public ApiResponse AllComputeByPM([FromBody] ComputerRequest request)
OthePerfor = t.Sum(s => s.OthePerfor), OthePerfor = t.Sum(s => s.OthePerfor),
NightWorkPerfor = t.Sum(s => s.NightWorkPerfor), NightWorkPerfor = t.Sum(s => s.NightWorkPerfor),
RealGiveFee = t.Sum(s => s.RealGiveFee), RealGiveFee = t.Sum(s => s.RealGiveFee),
//ReservedRatio = t.Sum(s => s.ReservedRatio), ReservedRatio = t.Sum(s => s.ReservedRatio),
//ReservedRatioFee = t.Sum(s => s.ReservedRatioFee), ReservedRatioFee = t.Sum(s => s.ReservedRatioFee),
}).OrderBy(t =>
{
string value = t.JobNumber;
switch (value)
{
case string val when string.IsNullOrEmpty(val):
break;
case string val when Regex.IsMatch(val, @"^[+-]?\d*$"):
value = value.PadLeft(20, '0');
break;
}
return value;
}); });
return new ApiResponse(ResponseType.OK, "ok", result); return new ApiResponse(ResponseType.OK, "ok", result);
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Services; using Performance.Services;
using Performance.Services.ExtractExcelService;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
...@@ -407,6 +408,9 @@ public ApiResponse Import([FromForm] IFormCollection form) ...@@ -407,6 +408,9 @@ public ApiResponse Import([FromForm] IFormCollection form)
if (file == null) if (file == null)
return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效"); return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效");
if (!ExtractHelper.IsXlsxFile(file.FileName))
return new ApiResponse(ResponseType.Fail, "文件格式错误", "文件暂只支持xlsx文件");
var allot = allotService.GetAllot(allotid); var allot = allotService.GetAllot(allotid);
if (allot == null) if (allot == null)
return new ApiResponse(ResponseType.Fail, "allotid不存在"); return new ApiResponse(ResponseType.Fail, "allotid不存在");
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
using Performance.DtoModels; using Performance.DtoModels;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Services; using Performance.Services;
using Performance.Services.ExtractExcelService;
namespace Performance.Api.Controllers namespace Performance.Api.Controllers
{ {
...@@ -47,6 +48,9 @@ public ApiResponse Import([FromForm] IFormCollection form) ...@@ -47,6 +48,9 @@ public ApiResponse Import([FromForm] IFormCollection form)
if (file == null) if (file == null)
return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效"); return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效");
if (!ExtractHelper.IsXlsxFile(file.FileName))
return new ApiResponse(ResponseType.Fail, "文件格式错误", "文件暂只支持xlsx文件");
var name = $"History_{FileHelper.GetFileNameNoExtension(file.FileName)}{DateTime.Now:yyyyMMddHHmmssfff}"; var name = $"History_{FileHelper.GetFileNameNoExtension(file.FileName)}{DateTime.Now:yyyyMMddHHmmssfff}";
var ext = FileHelper.GetExtension(file.FileName); var ext = FileHelper.GetExtension(file.FileName);
var dpath = Path.Combine(evn.ContentRootPath, "Files", hospitalid.ToString()); var dpath = Path.Combine(evn.ContentRootPath, "Files", hospitalid.ToString());
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Services; using Performance.Services;
using Performance.Services.ExtractExcelService;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
...@@ -103,6 +104,9 @@ public ApiResponse Import(int hospitalId, [FromForm] IFormCollection form) ...@@ -103,6 +104,9 @@ public ApiResponse Import(int hospitalId, [FromForm] IFormCollection form)
if (file == null) if (file == null)
return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效"); return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效");
if (!ExtractHelper.IsXlsxFile(file.FileName))
return new ApiResponse(ResponseType.Fail, "文件格式错误", "文件暂只支持xlsx文件");
var name = FileHelper.GetFileNameNoExtension(file.FileName) + DateTime.Now.ToString("yyyyMMddHHmmssfff"); var name = FileHelper.GetFileNameNoExtension(file.FileName) + DateTime.Now.ToString("yyyyMMddHHmmssfff");
var ext = FileHelper.GetExtension(file.FileName); var ext = FileHelper.GetExtension(file.FileName);
var dpath = Path.Combine(env.ContentRootPath, "Files", $"{hospitalId}", $"ImportDataFiles"); var dpath = Path.Combine(env.ContentRootPath, "Files", $"{hospitalId}", $"ImportDataFiles");
......
...@@ -79,7 +79,7 @@ public IActionResult DownFile(int type = 1) ...@@ -79,7 +79,7 @@ public IActionResult DownFile(int type = 1)
switch (type) switch (type)
{ {
case 1: case 1:
path = Path.Combine(env.ContentRootPath, "Template", "医院绩效模板.xls"); path = Path.Combine(env.ContentRootPath, "Template", "医院绩效模板.xlsx");
break; break;
case 2: case 2:
...@@ -91,11 +91,11 @@ public IActionResult DownFile(int type = 1) ...@@ -91,11 +91,11 @@ public IActionResult DownFile(int type = 1)
break; break;
case 4: case 4:
path = Path.Combine(env.ContentRootPath, "Template", "医院人员绩效模板.xls"); path = Path.Combine(env.ContentRootPath, "Template", "医院人员绩效模板.xlsx");
break; break;
case 5: case 5:
path = Path.Combine(env.ContentRootPath, "Template", "工作量数据导入模板.xls"); path = Path.Combine(env.ContentRootPath, "Template", "工作量数据导入模板.xlsx");
break; break;
} }
...@@ -129,6 +129,9 @@ public ApiResponse Import([FromForm] IFormCollection form) ...@@ -129,6 +129,9 @@ public ApiResponse Import([FromForm] IFormCollection form)
if (file == null) if (file == null)
return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效"); return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效");
if (!ExtractHelper.IsXlsxFile(file.FileName))
return new ApiResponse(ResponseType.Fail, "文件格式错误", "文件暂只支持xlsx文件");
var hospital = hospitalService.GetHopital(hospitalid); var hospital = hospitalService.GetHopital(hospitalid);
if (hospital == null) if (hospital == null)
return new ApiResponse(ResponseType.Fail, "hospitalid不存在"); return new ApiResponse(ResponseType.Fail, "hospitalid不存在");
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
} }
}, },
"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_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;", //"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"
}, },
......
...@@ -536,6 +536,11 @@ ...@@ -536,6 +536,11 @@
夜班费 夜班费
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.ComputeEmployee.NeedSecondAllot">
<summary>
是否需要二次分配
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResult.AccountType"> <member name="P:Performance.DtoModels.ComputeResult.AccountType">
<summary> <summary>
科室类别(例如 医技科室 临床科室 其他科室) 科室类别(例如 医技科室 临床科室 其他科室)
...@@ -706,6 +711,11 @@ ...@@ -706,6 +711,11 @@
夜班费 夜班费
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.ComputeResult.NeedSecondAllot">
<summary>
是否需要二次分配
</summary>
</member>
<member name="T:Performance.DtoModels.UnitType"> <member name="T:Performance.DtoModels.UnitType">
<summary> 核算单元类型 </summary> <summary> 核算单元类型 </summary>
</member> </member>
...@@ -1089,6 +1099,11 @@ ...@@ -1089,6 +1099,11 @@
实发绩效 实发绩效
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.PerDataAccountBaisc.NeedSecondAllot">
<summary>
是否需要二次分配
</summary>
</member>
<member name="P:Performance.DtoModels.PerDataClinicEmployee.UnitType"> <member name="P:Performance.DtoModels.PerDataClinicEmployee.UnitType">
<summary> <summary>
核算单元分类 核算单元分类
...@@ -1354,6 +1369,11 @@ ...@@ -1354,6 +1369,11 @@
调节后其他绩效 调节后其他绩效
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.PerDataLogisticsEmployee.NeedSecondAllot">
<summary>
是否需要二次分配
</summary>
</member>
<member name="P:Performance.DtoModels.PerDataLogisticsEmployee.RowNumber"> <member name="P:Performance.DtoModels.PerDataLogisticsEmployee.RowNumber">
<summary> <summary>
行号 行号
...@@ -2116,11 +2136,6 @@ ...@@ -2116,11 +2136,6 @@
是否开启科室CMI占比 1 启用 2 禁用 是否开启科室CMI占比 1 启用 2 禁用
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.HospitalRequest.IsOpenLogisticsSecondAllot">
<summary>
是否开启行政后勤二次绩效分配 1 启用 2 禁用
</summary>
</member>
<member name="P:Performance.DtoModels.IncomeRequest.SheetNameKeyword"> <member name="P:Performance.DtoModels.IncomeRequest.SheetNameKeyword">
<summary> <summary>
关键字匹配 关键字匹配
......
...@@ -160,5 +160,10 @@ public class ComputeEmployee ...@@ -160,5 +160,10 @@ public class ComputeEmployee
/// 夜班费 /// 夜班费
/// </summary> /// </summary>
public Nullable<decimal> NightWorkPerfor { get; set; } public Nullable<decimal> NightWorkPerfor { get; set; }
/// <summary>
/// 是否需要二次分配
/// </summary>
public string NeedSecondAllot { get; set; }
} }
} }
...@@ -198,5 +198,10 @@ public class ComputeResult ...@@ -198,5 +198,10 @@ public class ComputeResult
/// 夜班费 /// 夜班费
/// </summary> /// </summary>
public Nullable<decimal> NightWorkPerfor { get; set; } public Nullable<decimal> NightWorkPerfor { get; set; }
/// <summary>
/// 是否需要二次分配
/// </summary>
public string NeedSecondAllot { get; set; }
} }
} }
...@@ -232,6 +232,11 @@ public class PerDataAccountBaisc : IPerData ...@@ -232,6 +232,11 @@ public class PerDataAccountBaisc : IPerData
/// </summary> /// </summary>
public Nullable<decimal> RealGiveFee { get; set; } public Nullable<decimal> RealGiveFee { get; set; }
/// <summary>
/// 是否需要二次分配
/// </summary>
public string NeedSecondAllot { get; set; }
#endregion 由计算得出 #endregion 由计算得出
} }
} }
...@@ -67,6 +67,11 @@ public class PerDataLogisticsEmployee : IPerData ...@@ -67,6 +67,11 @@ public class PerDataLogisticsEmployee : IPerData
public Nullable<decimal> AdjustLaterOtherFee { get; set; } public Nullable<decimal> AdjustLaterOtherFee { get; set; }
/// <summary> /// <summary>
/// 是否需要二次分配
/// </summary>
public string NeedSecondAllot { get; set; }
/// <summary>
/// 行号 /// 行号
/// </summary> /// </summary>
public int RowNumber { get; set; } public int RowNumber { get; set; }
......
...@@ -60,10 +60,10 @@ public class HospitalRequest ...@@ -60,10 +60,10 @@ public class HospitalRequest
/// </summary> /// </summary>
public Nullable<int> IsOpenCMIPercent { get; set; } public Nullable<int> IsOpenCMIPercent { get; set; }
/// <summary> ///// <summary>
/// 是否开启行政后勤二次绩效分配 1 启用 2 禁用 ///// 是否开启行政后勤二次绩效分配 1 启用 2 禁用
/// </summary> ///// </summary>
public Nullable<int> IsOpenLogisticsSecondAllot { get; set; } //public Nullable<int> IsOpenLogisticsSecondAllot { get; set; }
} }
public class HospitalRequestValidator : AbstractValidator<HospitalRequest> public class HospitalRequestValidator : AbstractValidator<HospitalRequest>
......
...@@ -57,7 +57,7 @@ public class ag_othersource ...@@ -57,7 +57,7 @@ public class ag_othersource
public Nullable<decimal> WorkPerformance { get; set; } public Nullable<decimal> WorkPerformance { get; set; }
/// <summary> /// <summary>
/// 科室单项奖励 /// 科室单项奖励(只读)
/// </summary> /// </summary>
public Nullable<decimal> DeptReward { get; set; } public Nullable<decimal> DeptReward { get; set; }
...@@ -90,5 +90,20 @@ public class ag_othersource ...@@ -90,5 +90,20 @@ public class ag_othersource
/// 预留金额 /// 预留金额
/// </summary> /// </summary>
public Nullable<decimal> ReservedAmount { get; set; } public Nullable<decimal> ReservedAmount { get; set; }
/// <summary>
/// 管理津贴
/// </summary>
public Nullable<decimal> ManagementAllowance { get; set; }
/// <summary>
/// 单项奖励
/// </summary>
public Nullable<decimal> IndividualReward { get; set; }
/// <summary>
/// 重点专科分配
/// </summary>
public Nullable<decimal> AllocationOfKeySpecialty { get; set; }
} }
} }
...@@ -125,5 +125,10 @@ public class im_employee_logistics ...@@ -125,5 +125,10 @@ public class im_employee_logistics
/// 调节后其他绩效 /// 调节后其他绩效
/// </summary> /// </summary>
public Nullable<decimal> AdjustLaterOtherFee { get; set; } public Nullable<decimal> AdjustLaterOtherFee { get; set; }
/// <summary>
/// 是否需要二次分配
/// </summary>
public string NeedSecondAllot { get; set; }
} }
} }
...@@ -190,5 +190,10 @@ public class res_account ...@@ -190,5 +190,10 @@ public class res_account
/// 考核后绩效 /// 考核后绩效
/// </summary> /// </summary>
public Nullable<decimal> AssessLaterPerforTotal { get; set; } public Nullable<decimal> AssessLaterPerforTotal { get; set; }
/// <summary>
/// 是否需要二次分配
/// </summary>
public string NeedSecondAllot { get; set; }
} }
} }
...@@ -245,5 +245,9 @@ public class res_compute ...@@ -245,5 +245,9 @@ public class res_compute
/// 调节后其他绩效 /// 调节后其他绩效
/// </summary> /// </summary>
public Nullable<decimal> AdjustLaterOtherFee { get; set; } public Nullable<decimal> AdjustLaterOtherFee { get; set; }
/// <summary>
/// 是否需要二次分配 是 否
/// </summary>
public string NeedSecondAllot { get; set; }
} }
} }
...@@ -101,10 +101,10 @@ public class sys_hospital ...@@ -101,10 +101,10 @@ public class sys_hospital
/// </summary> /// </summary>
public Nullable<int> IsShowSecondDirector { get; set; } public Nullable<int> IsShowSecondDirector { get; set; }
/// <summary> ///// <summary>
/// 是否开启行政后勤二次绩效分配 1 启用 2 禁用 ///// 是否开启行政后勤二次绩效分配 1 启用 2 禁用
/// </summary> ///// </summary>
public Nullable<int> IsOpenLogisticsSecondAllot { get; set; } //public Nullable<int> IsOpenLogisticsSecondAllot { get; set; }
/// <summary> /// <summary>
/// 抽取项目是否在同一环境 1 是 2 否 /// 抽取项目是否在同一环境 1 是 2 否
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<UserSecretsId>3af57781-f816-4c0e-ab66-9b69387e7d35</UserSecretsId>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
<ExcludeApp_Data>False</ExcludeApp_Data> <ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>a7ae6d0f-7b11-4eef-9fea-a279001ea54d</ProjectGuid> <ProjectGuid>a7ae6d0f-7b11-4eef-9fea-a279001ea54d</ProjectGuid>
<publishUrl>bin\Release\netcoreapp2.2\publish\</publishUrl> <publishUrl>bin\Release\netcoreapp2.2\publish\</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles> <DeleteExistingFiles>True</DeleteExistingFiles>
<TargetFramework>netcoreapp2.2</TargetFramework>
<SelfContained>false</SelfContained>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
\ No newline at end of file
...@@ -377,6 +377,7 @@ public void ComputeOffice(per_allot allot, PerExcel excel) ...@@ -377,6 +377,7 @@ public void ComputeOffice(per_allot allot, PerExcel excel)
dept.ScoringAverage = resAccount?.ScoringAverage == null ? 1 : resAccount.ScoringAverage; dept.ScoringAverage = resAccount?.ScoringAverage == null ? 1 : resAccount.ScoringAverage;
dept.AdjustFactor = (isBudget ? adjust : resAccount?.AdjustFactor) ?? 1; dept.AdjustFactor = (isBudget ? adjust : resAccount?.AdjustFactor) ?? 1;
dept.Income = empolyees.Sum(w => w.PerforTotal ?? 0); dept.Income = empolyees.Sum(w => w.PerforTotal ?? 0);
dept.NeedSecondAllot = empolyees.Any(w => w.NeedSecondAllot == "是") ? "是" : "否";
//dept.Extra = (extra ?? 0); //dept.Extra = (extra ?? 0);
//dept.MedicineExtra = 0;// (drugExtra ?? 0); //dept.MedicineExtra = 0;// (drugExtra ?? 0);
//dept.MaterialsExtra = 0;//(materialsExtra ?? 0); //dept.MaterialsExtra = 0;//(materialsExtra ?? 0);
......
...@@ -514,13 +514,18 @@ public void GenerateSecondAllot(per_allot allot) ...@@ -514,13 +514,18 @@ public void GenerateSecondAllot(per_allot allot)
List<ag_secondallot> insSecond = new List<ag_secondallot>(); List<ag_secondallot> insSecond = new List<ag_secondallot>();
List<ag_secondallot> updSecond = new List<ag_secondallot>(); List<ag_secondallot> updSecond = new List<ag_secondallot>();
var types = new List<int> { (int)UnitType.行政高层, (int)UnitType.行政中层 }; var types = new List<int> { (int)UnitType.行政高层, (int)UnitType.行政中层, (int)UnitType.行政后勤 };
// 获取医院是否开启后勤二次分配 //// 获取医院是否开启后勤二次分配
var hospital = hospitalRepository.GetEntity(w => w.ID == allot.HospitalId); //var hospital = hospitalRepository.GetEntity(w => w.ID == allot.HospitalId);
if (hospital?.IsOpenLogisticsSecondAllot != 1) //if (hospital?.IsOpenLogisticsSecondAllot != 1)
types.Add((int)UnitType.行政后勤); // types.Add((int)UnitType.行政后勤);
var accountUnit = perforResaccountRepository.GetEntities(t => t.AllotID == allot.ID && !types.Contains(t.UnitType.Value)); var accountUnit = perforResaccountRepository.GetEntities(t => t.AllotID == allot.ID && !types.Contains(t.UnitType.Value));
// 查询需要进行二次分配的行政后勤科室
var xzAccountUnit = perforResaccountRepository.GetEntities(t => t.AllotID == allot.ID && t.UnitType.Value == (int)UnitType.行政后勤 && t.NeedSecondAllot == "是");
if (xzAccountUnit != null && xzAccountUnit.Count > 0)
(accountUnit ?? new List<res_account>()).AddRange(xzAccountUnit);
var specialList = perforResspecialunitRepository.GetEntities(t => t.AllotID == allot.ID); var specialList = perforResspecialunitRepository.GetEntities(t => t.AllotID == allot.ID);
if (accountUnit != null) if (accountUnit != null)
......
...@@ -16,7 +16,7 @@ public class ExtractHelper ...@@ -16,7 +16,7 @@ public class ExtractHelper
public static string GetExtractFile(int hospitalId, ref string newFilePath, string allotFilePath = "") public static string GetExtractFile(int hospitalId, ref string newFilePath, string allotFilePath = "")
{ {
string originalPath = string.IsNullOrEmpty(allotFilePath) string originalPath = string.IsNullOrEmpty(allotFilePath)
? Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Template", "医院绩效模板.xls") ? Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Template", "医院绩效模板.xlsx")
: allotFilePath; : allotFilePath;
CloseAutoFilter(originalPath); CloseAutoFilter(originalPath);
var (tempPath, filePath) = CopyOriginalFile(hospitalId, originalPath); var (tempPath, filePath) = CopyOriginalFile(hospitalId, originalPath);
...@@ -28,7 +28,7 @@ public static string GetExtractFile(int hospitalId, string prefix = "绩效提 ...@@ -28,7 +28,7 @@ public static string GetExtractFile(int hospitalId, string prefix = "绩效提
{ {
var dpath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Files", $"{hospitalId}", "autoextract"); var dpath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Files", $"{hospitalId}", "autoextract");
FileHelper.CreateDirectory(dpath); FileHelper.CreateDirectory(dpath);
return Path.Combine(dpath, $"{prefix}{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xls"); return Path.Combine(dpath, $"{prefix}{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx");
} }
private static (string TempPath, string FilePath) CopyOriginalFile(int hospitalId, string originalPath) private static (string TempPath, string FilePath) CopyOriginalFile(int hospitalId, string originalPath)
...@@ -114,7 +114,6 @@ public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, Shee ...@@ -114,7 +114,6 @@ public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, Shee
} }
} }
} }
public static void ClearSheetTemplate(ISheet sheet, PerSheetPoint point, SheetType sheetType) public static void ClearSheetTemplate(ISheet sheet, PerSheetPoint point, SheetType sheetType)
{ {
if (sheet == null) if (sheet == null)
...@@ -180,5 +179,24 @@ public static void CloseAutoFilter(string path) ...@@ -180,5 +179,24 @@ public static void CloseAutoFilter(string path)
{ {
} }
} }
/// <summary>
/// 判断文件是否是xlsx文件
/// </summary>
/// <param name="filename">文件名称、文件扩展名</param>
/// <returns></returns>
public static bool IsXlsxFile(string filename)
{
if (string.IsNullOrEmpty(filename)) return false;
string ext = filename;
if (ext.Contains("."))
{
int start = filename.LastIndexOf('.') + 1;
ext = filename.Substring(start, filename.Length - start);
}
return ext.ToLower() == ExcelVersion.xlsx.ToString().ToLower();
}
} }
} }
...@@ -134,7 +134,7 @@ public HospitalResponse Update(HospitalRequest request) ...@@ -134,7 +134,7 @@ public HospitalResponse Update(HospitalRequest request)
hospital.IsOpenDrugprop = request.IsOpenDrugprop; hospital.IsOpenDrugprop = request.IsOpenDrugprop;
hospital.IsShowManage = request.IsShowManage; hospital.IsShowManage = request.IsShowManage;
hospital.IsOpenCMIPercent = request.IsOpenCMIPercent; hospital.IsOpenCMIPercent = request.IsOpenCMIPercent;
hospital.IsOpenLogisticsSecondAllot = request.IsOpenLogisticsSecondAllot; //hospital.IsOpenLogisticsSecondAllot = request.IsOpenLogisticsSecondAllot;
//hospital.IsOpenIncome = request.IsOpenIncome; //hospital.IsOpenIncome = request.IsOpenIncome;
if (!_hospitalRepository.Update(hospital)) if (!_hospitalRepository.Update(hospital))
......
...@@ -512,6 +512,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -512,6 +512,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
if (AccountUnitType.行政高层.ToString() == involve || AccountUnitType.行政中层.ToString() == involve) if (AccountUnitType.行政高层.ToString() == involve || AccountUnitType.行政中层.ToString() == involve)
{ {
// 行政高层、行政中层 默认不需要二次分配
compute.NeedSecondAllot = "否";
// 行政高层 行政中层 夜班费 // 行政高层 行政中层 夜班费
compute.NightWorkPerfor = item.NightWorkPerfor; compute.NightWorkPerfor = item.NightWorkPerfor;
//考核前绩效 //考核前绩效
...@@ -523,6 +525,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -523,6 +525,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
} }
else if (AccountUnitType.行政工勤.ToString() == involve) else if (AccountUnitType.行政工勤.ToString() == involve)
{ {
// 行政工勤 根据测算表判读是否需要二次分配 默认不需要
compute.NeedSecondAllot = string.IsNullOrWhiteSpace(item.NeedSecondAllot) ? "否" : item.NeedSecondAllot;
//考核前绩效 //考核前绩效
compute.PerforTotal = Math.Round(compute.BaiscNormValue * compute.PostCoefficient * compute.Attendance + compute.OtherPerfor ?? 0); compute.PerforTotal = Math.Round(compute.BaiscNormValue * compute.PostCoefficient * compute.Attendance + compute.OtherPerfor ?? 0);
//考核后绩效 更加开关来控制显示 //考核后绩效 更加开关来控制显示
......
...@@ -70,6 +70,7 @@ public class ExcelReadConfig ...@@ -70,6 +70,7 @@ public class ExcelReadConfig
new ColumnInfo(nameof(PerDataLogisticsEmployee.PostCoefficient), "岗位系数", true), new ColumnInfo(nameof(PerDataLogisticsEmployee.PostCoefficient), "岗位系数", true),
new ColumnInfo(nameof(PerDataLogisticsEmployee.Attendance), "出勤率", true), new ColumnInfo(nameof(PerDataLogisticsEmployee.Attendance), "出勤率", true),
new ColumnInfo(nameof(PerDataLogisticsEmployee.OthePerfor), "其他绩效", true), new ColumnInfo(nameof(PerDataLogisticsEmployee.OthePerfor), "其他绩效", true),
new ColumnInfo(nameof(PerDataLogisticsEmployee.NeedSecondAllot), "是否需要二次分配"),
//new ColumnInfo(nameof(PerDataLogisticsEmployee.AdjustLaterOtherFee), "调节后其他绩效", true), //new ColumnInfo(nameof(PerDataLogisticsEmployee.AdjustLaterOtherFee), "调节后其他绩效", true),
}; };
......
...@@ -1614,9 +1614,9 @@ private void SupplementSecondDetail(ag_secondallot second, List<per_employee> em ...@@ -1614,9 +1614,9 @@ private void SupplementSecondDetail(ag_secondallot second, List<per_employee> em
// return; // return;
// 补充医院其他绩效 及 预留比例 // 补充医院其他绩效 及 预留比例
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == second.AllotId && t.Status == 3); var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == second.AllotId && t.Status == 3);
Func<per_employee, decimal?> getAprAmount = (t) => second.Department == t.AccountingUnit ? perapramounts Func<per_employee, decimal?> getAprAmount = (t) => second.Department == t.AccountingUnit
?.Where(w => w.PersonnelNumber?.Trim() == t.PersonnelNumber?.Trim()) ? perapramounts?.Where(w => w.PersonnelNumber?.Trim() == t.PersonnelNumber?.Trim())?.Sum(w => w.Amount)
?.Sum(w => w.Amount) : 0; : 0;
var distPerformance = rescomputeRepository.GetEntities(t => t.AllotID == second.AllotId && employees.Select(s => s.PersonnelNumber).Contains(t.JobNumber)); var distPerformance = rescomputeRepository.GetEntities(t => t.AllotID == second.AllotId && employees.Select(s => s.PersonnelNumber).Contains(t.JobNumber));
Func<per_employee, decimal?> getDistPerformance = (t) => 0; Func<per_employee, decimal?> getDistPerformance = (t) => 0;
...@@ -1671,6 +1671,9 @@ public List<ag_othersource> OtherSave(int secondId, List<ag_othersource> request ...@@ -1671,6 +1671,9 @@ public List<ag_othersource> OtherSave(int secondId, List<ag_othersource> request
existEntities.First(t => t.Id == item.Id).OtherPerformance = item.OtherPerformance; existEntities.First(t => t.Id == item.Id).OtherPerformance = item.OtherPerformance;
existEntities.First(t => t.Id == item.Id).NightWorkPerformance = item.NightWorkPerformance; existEntities.First(t => t.Id == item.Id).NightWorkPerformance = item.NightWorkPerformance;
existEntities.First(t => t.Id == item.Id).RealAmount = item.RealAmount; existEntities.First(t => t.Id == item.Id).RealAmount = item.RealAmount;
existEntities.First(t => t.Id == item.Id).ManagementAllowance = item.ManagementAllowance;
existEntities.First(t => t.Id == item.Id).IndividualReward = item.IndividualReward;
existEntities.First(t => t.Id == item.Id).AllocationOfKeySpecialty = item.AllocationOfKeySpecialty;
} }
perforAgothersourceRepository.UpdateRange(existEntities.ToArray()); perforAgothersourceRepository.UpdateRange(existEntities.ToArray());
......
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