Commit 500f9e47 by 1391696987

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

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