Commit dd4fedc9 by lcx

其他工作量

parent 99b93088
...@@ -677,6 +677,9 @@ ...@@ -677,6 +677,9 @@
<member name="F:Performance.DtoModels.SheetType.AccountScoreAverage"> <member name="F:Performance.DtoModels.SheetType.AccountScoreAverage">
<summary> 科室材料考核 </summary> <summary> 科室材料考核 </summary>
</member> </member>
<member name="F:Performance.DtoModels.SheetType.OtherWorkload">
<summary> 其他工作量(不参与核算) </summary>
</member>
<member name="T:Performance.DtoModels.AccountUnitType"> <member name="T:Performance.DtoModels.AccountUnitType">
<summary> <summary>
核算单元类型 核算单元类型
......
...@@ -119,6 +119,11 @@ public enum SheetType ...@@ -119,6 +119,11 @@ public enum SheetType
/// <summary> 科室材料考核 </summary> /// <summary> 科室材料考核 </summary>
[Description("科室考核")] [Description("科室考核")]
AccountScoreAverage = 25, AccountScoreAverage = 25,
/// <summary> 其他工作量(不参与核算) </summary>
[Description("其他工作量")]
OtherWorkload = 26,
} }
/// <summary> /// <summary>
......
...@@ -424,6 +424,7 @@ public string TemplateExecute(string email, sys_hospital hospital, List<sys_hosp ...@@ -424,6 +424,7 @@ public string TemplateExecute(string email, sys_hospital hospital, List<sys_hosp
WriteExpend(sheet, sheetRead, modules, items, data); WriteExpend(sheet, sheetRead, modules, items, data);
break; break;
case SheetType.Workload: case SheetType.Workload:
case SheetType.OtherWorkload:
WriteWorkload(sheet, sheetRead, modules, items, data); WriteWorkload(sheet, sheetRead, modules, items, data);
break; break;
//case SheetType.AccountBasic: //case SheetType.AccountBasic:
...@@ -519,6 +520,7 @@ public string AlllotExecute(string email, sys_hospital hospital, List<sys_hospit ...@@ -519,6 +520,7 @@ public string AlllotExecute(string email, sys_hospital hospital, List<sys_hospit
WriteExpend(sheet, sheetRead, modules, items, extracts, false); WriteExpend(sheet, sheetRead, modules, items, extracts, false);
break; break;
case SheetType.Workload: case SheetType.Workload:
case SheetType.OtherWorkload:
ClearData(sheet, 3, 3); ClearData(sheet, 3, 3);
WriteWorkload(sheet, sheetRead, modules, items, extracts, false); WriteWorkload(sheet, sheetRead, modules, items, extracts, false);
break; break;
...@@ -824,6 +826,29 @@ private void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook workbook ...@@ -824,6 +826,29 @@ private void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook workbook
} }
} }
} }
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 + 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++;
}
}
}
} }
private void ClearData(ISheet sheet, int beginRowNum, int beginCellNum, bool isIncome = false, int? endCellNum = null) private void ClearData(ISheet sheet, int beginRowNum, int beginCellNum, bool isIncome = false, int? endCellNum = null)
......
...@@ -100,9 +100,12 @@ private void DefaultModules(int hospitalId) ...@@ -100,9 +100,12 @@ private void DefaultModules(int hospitalId)
public ex_module AddModule(ModModuleRequest request) 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("模块类型错误,只支持收入模板配置"); throw new PerformanceException("模块类型错误,只支持收入模板配置");
string addname = "";
if (request.SheetType == (int)SheetType.Income)
{
string[] array = new string[] { "开单收入", "执行收入" }; string[] array = new string[] { "开单收入", "执行收入" };
if (request.ModuleName.IndexOf("开单收入") == -1 && request.ModuleName.IndexOf("执行收入") == -1) if (request.ModuleName.IndexOf("开单收入") == -1 && request.ModuleName.IndexOf("执行收入") == -1)
throw new PerformanceException("模块名称规则错误"); throw new PerformanceException("模块名称规则错误");
...@@ -114,7 +117,6 @@ public ex_module AddModule(ModModuleRequest request) ...@@ -114,7 +117,6 @@ public ex_module AddModule(ModModuleRequest request)
if (incomeList.Any(t => Regex.Replace(t.ModuleName, @"\d", "").Replace(".", "").Replace(" ", "") == request.ModuleName)) if (incomeList.Any(t => Regex.Replace(t.ModuleName, @"\d", "").Replace(".", "").Replace(" ", "") == request.ModuleName))
throw new PerformanceException("绩效模板已存在!"); throw new PerformanceException("绩效模板已存在!");
string addname = "";
var moduleList = exmoduleRepository.GetEntities(t => t.HospitalId == request.HospitalId && t.ModuleName.IndexOf("1.") != -1); var moduleList = exmoduleRepository.GetEntities(t => t.HospitalId == request.HospitalId && t.ModuleName.IndexOf("1.") != -1);
string name = request.ModuleName.Replace("开单收入", "").Replace("执行收入", ""); string name = request.ModuleName.Replace("开单收入", "").Replace("执行收入", "");
var exist = moduleList.Where(t => t.ModuleName.Contains(name)); var exist = moduleList.Where(t => t.ModuleName.Contains(name));
...@@ -132,6 +134,20 @@ public ex_module AddModule(ModModuleRequest request) ...@@ -132,6 +134,20 @@ public ex_module AddModule(ModModuleRequest request)
sort[1] += 1; sort[1] += 1;
addname = $"{sort[0]}.{sort[1]}.1 " + request.ModuleName; addname = $"{sort[0]}.{sort[1]}.1 " + request.ModuleName;
} }
}
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;
addname = $"{sort[0]}.{sort[1]}.1 " + request.ModuleName;
}
ex_module entity = new ex_module ex_module entity = new ex_module
{ {
......
...@@ -83,7 +83,7 @@ public void ReturnTheLog(int allotId, string groupName, int type, string tag, ob ...@@ -83,7 +83,7 @@ public void ReturnTheLog(int allotId, string groupName, int type, string tag, ob
var http = url.ImportFile + $"/template/returnlog?type={type}&tag={tag}&message={message}&level={level}&groupName={groupName}"; var http = url.ImportFile + $"/template/returnlog?type={type}&tag={tag}&message={message}&level={level}&groupName={groupName}";
//logger.LogInformation("发送日志:" + http); //logger.LogInformation("发送日志:" + http);
logdbug.Add(allotId, tag, message.ToString(), level, type); logdbug.Add(allotId, tag, message.ToString(), level, type);
HttpHelper.HttpPost(http); //HttpHelper.HttpPost(http);
} }
catch (Exception ex) catch (Exception ex)
{ {
......
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