Commit dd4fedc9 by lcx

其他工作量

parent 99b93088
......@@ -677,6 +677,9 @@
<member name="F:Performance.DtoModels.SheetType.AccountScoreAverage">
<summary> 科室材料考核 </summary>
</member>
<member name="F:Performance.DtoModels.SheetType.OtherWorkload">
<summary> 其他工作量(不参与核算) </summary>
</member>
<member name="T:Performance.DtoModels.AccountUnitType">
<summary>
核算单元类型
......
......@@ -119,6 +119,11 @@ public enum SheetType
/// <summary> 科室材料考核 </summary>
[Description("科室考核")]
AccountScoreAverage = 25,
/// <summary> 其他工作量(不参与核算) </summary>
[Description("其他工作量")]
OtherWorkload = 26,
}
/// <summary>
......
......@@ -424,6 +424,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:
......@@ -519,6 +520,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;
......@@ -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)
......
......@@ -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;
......
......@@ -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}";
//logger.LogInformation("发送日志:" + http);
logdbug.Add(allotId, tag, message.ToString(), level, type);
HttpHelper.HttpPost(http);
//HttpHelper.HttpPost(http);
}
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