Commit ac936e83 by lcx

Merge branch 'v2020morge' into v2020morge-graphql

parents 51a28dc6 b9125776
......@@ -114,7 +114,7 @@ private void DefaultModules(int hospitalId)
public ex_module AddModule(ModModuleRequest request)
{
if (!new int[] { (int)SheetType.Income, (int)SheetType.OtherWorkload }.Contains(request.SheetType.Value))
if (!new int[] { (int)SheetType.Income, (int)SheetType.OtherWorkload, (int)SheetType.Assess }.Contains(request.SheetType.Value))
throw new PerformanceException("模块类型错误,只支持收入模板配置");
string addname = "";
......@@ -160,7 +160,20 @@ public ex_module AddModule(ModModuleRequest request)
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;
addname = $"{sort[0]}.{sort[1]} " + request.ModuleName;
}
else if (request.SheetType == (int)SheetType.Assess)
{
var incomeList = exmoduleRepository.GetEntities(t => t.HospitalId == request.HospitalId && t.SheetType == (int)SheetType.Assess);
if (incomeList != null && 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("5.") != -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]} " + request.ModuleName;
}
ex_module entity = new ex_module
......
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