Commit 500f9e47 by 1391696987

手工录入验证修改,取消上一版修改,员工姓名工号可空

parent 4440698b
...@@ -1583,11 +1583,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather) ...@@ -1583,11 +1583,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
for (int i = 0; i < newGather.Count; i++) for (int i = 0; i < newGather.Count; i++)
{ {
if (string.IsNullOrEmpty(newGather[i].Department) if (string.IsNullOrEmpty(newGather[i].Department))
|| string.IsNullOrEmpty(newGather[i].PersonnelNumber)
|| string.IsNullOrEmpty(newGather[i].DoctorName)
)
{
error.Add(new Dictionary<string, string> error.Add(new Dictionary<string, string>
{ {
{ "行号", $"第{i+1}行" }, { "行号", $"第{i+1}行" },
...@@ -1598,9 +1594,6 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather) ...@@ -1598,9 +1594,6 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
{ "来源", "粘贴数据" }, { "来源", "粘贴数据" },
{ "错误原因", "关键信息缺失”请补全或删除" }, { "错误原因", "关键信息缺失”请补全或删除" },
}); });
break;
}
if (newGather[i].Fee == 0) if (newGather[i].Fee == 0)
error.Add(new Dictionary<string, string> error.Add(new Dictionary<string, string>
...@@ -1611,7 +1604,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather) ...@@ -1611,7 +1604,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
{ "人员工号", newGather[i].PersonnelNumber??"" }, { "人员工号", newGather[i].PersonnelNumber??"" },
{ "数值", newGather[i].Fee.ToString() }, { "数值", newGather[i].Fee.ToString() },
{ "来源", "粘贴数据" }, { "来源", "粘贴数据" },
{ "错误原因", "数值不能等于0" }, { "错误原因", "数值不能为空和0" },
}); });
var ExistsDeptData = departments.FirstOrDefault(w => w.AllotId == allotId var ExistsDeptData = departments.FirstOrDefault(w => w.AllotId == allotId
...@@ -1630,6 +1623,8 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather) ...@@ -1630,6 +1623,8 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
{ "错误原因", $"科室字典中不存在科室[{newGather[i].Department}]" }, { "错误原因", $"科室字典中不存在科室[{newGather[i].Department}]" },
}); });
if (!string.IsNullOrEmpty(newGather[i].DoctorName))
{
var ExistNameData = employees.FirstOrDefault(w => w.AllotId == allotId && (w.DoctorName != null && w.DoctorName == newGather[i].DoctorName)); var ExistNameData = employees.FirstOrDefault(w => w.AllotId == allotId && (w.DoctorName != null && w.DoctorName == newGather[i].DoctorName));
if (ExistNameData == null) if (ExistNameData == null)
error.Add(new Dictionary<string, string> error.Add(new Dictionary<string, string>
...@@ -1642,7 +1637,10 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather) ...@@ -1642,7 +1637,10 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
{ "来源", "粘贴数据" }, { "来源", "粘贴数据" },
{ "错误原因", $"人员字典中不存在医生姓名[{newGather[i].DoctorName}]" }, { "错误原因", $"人员字典中不存在医生姓名[{newGather[i].DoctorName}]" },
}); });
}
if (!string.IsNullOrEmpty(newGather[i].DoctorName))
{
var ExistNumberData = employees.FirstOrDefault(w => w.AllotId == allotId && (w.PersonnelNumber != null && w.PersonnelNumber == newGather[i].PersonnelNumber)); var ExistNumberData = employees.FirstOrDefault(w => w.AllotId == allotId && (w.PersonnelNumber != null && w.PersonnelNumber == newGather[i].PersonnelNumber));
if (ExistNumberData == null) if (ExistNumberData == null)
error.Add(new Dictionary<string, string> error.Add(new Dictionary<string, string>
...@@ -1656,6 +1654,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather) ...@@ -1656,6 +1654,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
{ "错误原因", $"人员字典中不存在工号[{newGather[i].PersonnelNumber}]" }, { "错误原因", $"人员字典中不存在工号[{newGather[i].PersonnelNumber}]" },
}); });
var ExistNameData = employees.FirstOrDefault(w => w.AllotId == allotId && (w.DoctorName != null && w.DoctorName == newGather[i].DoctorName));
if ((ExistNumberData == null || ExistNumberData.DoctorName != newGather[i].DoctorName) if ((ExistNumberData == null || ExistNumberData.DoctorName != newGather[i].DoctorName)
|| (ExistNameData == null || ExistNameData.PersonnelNumber != newGather[i].PersonnelNumber)) || (ExistNameData == null || ExistNameData.PersonnelNumber != newGather[i].PersonnelNumber))
error.Add(new Dictionary<string, string> error.Add(new Dictionary<string, string>
...@@ -1668,6 +1667,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather) ...@@ -1668,6 +1667,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
{ "来源", "粘贴数据" }, { "来源", "粘贴数据" },
{ "错误原因", $"该人员姓名和工号与人员字典中不匹配" }, { "错误原因", $"该人员姓名和工号与人员字典中不匹配" },
}); });
}
if (accountingUnit.Login != "admin") if (accountingUnit.Login != "admin")
{ {
......
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