Commit b79d6a92 by lcx

添加其他工作量

parent bc32742a
......@@ -682,6 +682,9 @@
<member name="F:Performance.DtoModels.SheetType.AccountAssess">
<summary> 临床科室医护绩效考核表 </summary>
</member>
<member name="F:Performance.DtoModels.SheetType.OtherWorkload">
<summary> 其他工作量(不参与核算) </summary>
</member>
<member name="T:Performance.DtoModels.AccountUnitType">
<summary>
核算单元类型
......
......@@ -92,6 +92,10 @@ public enum SheetType
/// <summary> 临床科室医护绩效考核表 </summary>
[Description("临床科室医护绩效考核表")]
AccountAssess = 17,
/// <summary> 其他工作量(不参与核算) </summary>
[Description("其他工作量")]
OtherWorkload = 28,
}
/// <summary>
......
......@@ -411,6 +411,7 @@ public string TemplateExecute(string email, sys_hospital hospital, List<sys_hosp
WriteExpend(sheet, sheetRead, modules, items, data);
break;
case SheetType.Workload:
case SheetType.OtherWorkload:
WriteWorkload(sheet, sheetRead, modules, items, data);
break;
//case SheetType.AccountBasic:
......@@ -506,6 +507,7 @@ public string AlllotExecute(string email, sys_hospital hospital, List<sys_hospit
WriteExpend(sheet, sheetRead, modules, items, extracts, false);
break;
case SheetType.Workload:
case SheetType.OtherWorkload:
ClearData(sheet, 3, 3);
WriteWorkload(sheet, sheetRead, modules, items, extracts, false);
break;
......@@ -772,6 +774,7 @@ private void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook workbook
}
int sheetIndex = 0;
int newSheetCount = 0;
foreach (var module in modulesList.Where(t => t.SheetType == (int)SheetType.Income)?.OrderBy(t => t.ModuleName))
{
var sheet = workbook.GetSheet(module.ModuleName);
......@@ -789,6 +792,29 @@ private void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook workbook
logger.LogInformation($"newSheet: {newSheet.SheetName}");
workbook.SetSheetOrder(newSheet.SheetName, sheetIndex);
workbook.SetSheetName(sheetIndex, module.ModuleName);
sheetIndex++; newSheetCount++;
}
}
}
sheetIndex = 0;
foreach (var module in modulesList.Where(t => t.SheetType == (int)SheetType.OtherWorkload)?.OrderBy(t => t.ModuleName))
{
var sheet = workbook.GetSheet(module.ModuleName);
if (sheet == null)
{
logger.LogInformation($"CreateNotExistSheet: {module.ModuleName}");
string key = "工作量";
if (module.ModuleName.Contains(key))
{
var item = pairs.Where(t => t.Key.StartsWith("3.")).OrderByDescending(t => t.Key).First();
if (sheetIndex == 0)
sheetIndex = item.Value + newSheetCount + 1;
var copysheet = workbook.GetSheet(item.Key);
var newSheet = copysheet.CopySheet(item.Key + Guid.NewGuid().ToString("N"), true);
logger.LogInformation($"newSheet: {newSheet.SheetName}");
workbook.SetSheetOrder(newSheet.SheetName, sheetIndex);
workbook.SetSheetName(sheetIndex, module.ModuleName);
sheetIndex++;
}
}
......
......@@ -100,33 +100,49 @@ private void DefaultModules(int hospitalId)
public ex_module AddModule(ModModuleRequest request)
{
if (request.SheetType != (int)SheetType.Income)
if (!new int[] { (int)SheetType.Income, (int)SheetType.OtherWorkload }.Contains(request.SheetType.Value))
throw new PerformanceException("模块类型错误,只支持收入模板配置");
string[] array = new string[] { "开单收入", "执行收入" };
if (request.ModuleName.IndexOf("开单收入") == -1 && request.ModuleName.IndexOf("执行收入") == -1)
throw new PerformanceException("模块名称规则错误");
//if (!Regex.IsMatch(request.ModuleName, @"^[\u4e00-\u9fa5]+$"))
// throw new PerformanceException("模块名称规则错误,请使用全中文命名");
string addname = "";
if (request.SheetType == (int)SheetType.Income)
{
string[] array = new string[] { "开单收入", "执行收入" };
if (request.ModuleName.IndexOf("开单收入") == -1 && request.ModuleName.IndexOf("执行收入") == -1)
throw new PerformanceException("模块名称规则错误");
//if (!Regex.IsMatch(request.ModuleName, @"^[\u4e00-\u9fa5]+$"))
// throw new PerformanceException("模块名称规则错误,请使用全中文命名");
var incomeList = exmoduleRepository.GetEntities(t => t.HospitalId == request.HospitalId && t.SheetType == (int)SheetType.Income);
var incomeList = exmoduleRepository.GetEntities(t => t.HospitalId == request.HospitalId && t.SheetType == (int)SheetType.Income);
if (incomeList.Any(t => Regex.Replace(t.ModuleName, @"\d", "").Replace(".", "").Replace(" ", "") == request.ModuleName))
throw new PerformanceException("绩效模板已存在!");
if (incomeList.Any(t => Regex.Replace(t.ModuleName, @"\d", "").Replace(".", "").Replace(" ", "") == request.ModuleName))
throw new PerformanceException("绩效模板已存在!");
string addname = "";
var moduleList = exmoduleRepository.GetEntities(t => t.HospitalId == request.HospitalId && t.ModuleName.IndexOf("1.") != -1);
string name = request.ModuleName.Replace("开单收入", "").Replace("执行收入", "");
var exist = moduleList.Where(t => t.ModuleName.Contains(name));
if (exist != null && exist.Any())
{
string modulename = exist.OrderByDescending(t => t.ModuleName).First().ModuleName;
int[] sort = Array.ConvertAll(modulename.Split(' ')[0].Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries), t => ConvertHelper.TryInt(t));
sort[2] += 1;
addname = string.Join(".", sort) + " " + request.ModuleName;
var moduleList = exmoduleRepository.GetEntities(t => t.HospitalId == request.HospitalId && t.ModuleName.IndexOf("1.") != -1);
string name = request.ModuleName.Replace("开单收入", "").Replace("执行收入", "");
var exist = moduleList.Where(t => t.ModuleName.Contains(name));
if (exist != null && exist.Any())
{
string modulename = exist.OrderByDescending(t => t.ModuleName).First().ModuleName;
int[] sort = Array.ConvertAll(modulename.Split(' ')[0].Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries), t => ConvertHelper.TryInt(t));
sort[2] += 1;
addname = string.Join(".", sort) + " " + request.ModuleName;
}
else
{
string modulename = moduleList.OrderByDescending(t => t.ModuleName).First().ModuleName;
int[] sort = Array.ConvertAll(modulename.Split(' ')[0].Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries), t => ConvertHelper.TryInt(t));
sort[1] += 1;
addname = $"{sort[0]}.{sort[1]}.1 " + request.ModuleName;
}
}
else
else if (request.SheetType == (int)SheetType.OtherWorkload)
{
var incomeList = exmoduleRepository.GetEntities(t => t.HospitalId == request.HospitalId && t.SheetType == (int)SheetType.OtherWorkload);
if (incomeList.Any(t => Regex.Replace(t.ModuleName, @"\d", "").Replace(".", "").Replace(" ", "") == request.ModuleName))
throw new PerformanceException("绩效模板已存在!");
var moduleList = exmoduleRepository.GetEntities(t => t.HospitalId == request.HospitalId && t.ModuleName.IndexOf("3.") != -1);
string modulename = moduleList.OrderByDescending(t => t.ModuleName).First().ModuleName;
int[] sort = Array.ConvertAll(modulename.Split(' ')[0].Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries), t => ConvertHelper.TryInt(t));
sort[1] += 1;
......@@ -488,7 +504,7 @@ public List<TitleValue> ExtractScheme(int hospitalId, List<int> executeType)
public List<TitleValue> FeeType()
{
var titlevalue = new List<TitleValue>();
var type = EnumHelper.GetItems<SheetType>().Where(t => new List<int> { (int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload, (int)SheetType.SpecialUnit }.Contains(t.Value));
var type = EnumHelper.GetItems<SheetType>().Where(t => new List<int> { (int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload, (int)SheetType.SpecialUnit, (int)SheetType.OtherWorkload }.Contains(t.Value));
if (type != null && type.Any())
{
titlevalue = type.Select(t => new TitleValue
......
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