Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
4f59deeb
Commit
4f59deeb
authored
Mar 01, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员字典验证修改返回表格信息
parent
cbddac61
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
23 deletions
+84
-23
performance/Performance.Api/Controllers/PersonController.cs
+1
-5
performance/Performance.Services/EmployeeService.cs
+2
-2
performance/Performance.Services/PersonService.cs
+81
-16
No files found.
performance/Performance.Api/Controllers/PersonController.cs
View file @
4f59deeb
...
...
@@ -253,11 +253,7 @@ public ApiResponse GetBatchPersonStructrue(int hospitalId)
[
Route
(
"person/{allotId}/BathSavePerson/{hospitalId}"
)]
public
ApiResponse
BathSavePerson
(
int
allotId
,
int
hospitalId
,
SaveCollectData
request
)
{
var
result
=
personService
.
BathSavePerson
(
allotId
,
hospitalId
,
request
);
if
(
result
)
return
new
ApiResponse
(
ResponseType
.
OK
);
else
return
new
ApiResponse
(
ResponseType
.
Error
,
"出勤天数或预留比例格式错误"
);
return
personService
.
BathSavePerson
(
allotId
,
hospitalId
,
request
);
}
/// <summary>
...
...
performance/Performance.Services/EmployeeService.cs
View file @
4f59deeb
...
...
@@ -562,7 +562,7 @@ public ApiResponse ConfirmAudit(int userid, AprAmountAuditRequest request)
error
.
AddRange
(
err
);
if
(
error
.
Count
>
0
)
return
new
ApiResponse
(
ResponseType
.
WarningTable
,
"当前操作已拒绝"
,
error
);
return
new
ApiResponse
(
ResponseType
.
WarningTable
,
"
验证不通过,
当前操作已拒绝"
,
error
);
var
allApramounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
);
foreach
(
var
member
in
request
.
Members
)
...
...
@@ -986,7 +986,7 @@ public ApiResponse ConfirmAuditHide(int userid, AprAmountAuditRequest request)
error
.
AddRange
(
err
);
if
(
error
.
Count
>
0
)
return
new
ApiResponse
(
ResponseType
.
WarningTable
,
"当前操作已拒绝"
,
error
);
return
new
ApiResponse
(
ResponseType
.
WarningTable
,
"
验证不通过,
当前操作已拒绝"
,
error
);
var
allApramounts
=
_hideRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
);
foreach
(
var
member
in
request
.
Members
)
...
...
performance/Performance.Services/PersonService.cs
View file @
4f59deeb
...
...
@@ -745,33 +745,98 @@ public HandsonTable GetDepartmentHands(int hospitalId)
return
handson
;
}
public
bool
BathSavePerson
(
int
AllotId
,
int
HospitalId
,
SaveCollectData
request
)
public
ApiResponse
BathSavePerson
(
int
AllotId
,
int
HospitalId
,
SaveCollectData
request
)
{
var
dict
=
new
Dictionary
<
string
,
string
>();
Person
.
ForEach
(
t
=>
dict
.
Add
(
t
.
Item1
,
t
.
Item2
));
var
dicData
=
CreateDataRow
(
request
,
dict
);
List
<
per_employee
>
employees
=
new
List
<
per_employee
>();
var
persons
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
HospitalId
&&
t
.
AllotId
==
AllotId
);
if
(
dicData
==
null
||
dicData
.
Count
==
0
)
return
new
ApiResponse
(
ResponseType
.
Error
,
"空数据,无效操作"
);
var
delPersonsNum
=
new
List
<
string
>();
foreach
(
var
item
in
dicData
)
var
jsons
=
JsonHelper
.
Serialize
(
dicData
);
var
newEmployees
=
JsonHelper
.
Deserialize
<
List
<
per_employee
>>(
jsons
);
var
oldEmployees
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
HospitalId
&&
t
.
AllotId
==
AllotId
);
List
<
Dictionary
<
string
,
string
>>
error
=
new
List
<
Dictionary
<
string
,
string
>>();
for
(
int
i
=
0
;
i
<
newEmployees
.
Count
;
i
++)
{
if
(
newEmployees
[
i
].
PersonnelNumber
?.
Trim
()
==
"2095"
)
{
var
json
=
JsonHelper
.
Serialize
(
item
);
var
data
=
JsonHelper
.
Deserialize
<
per_employee
>(
json
);
//if (!string.IsNullOrEmpty(item["AttendanceDay"]) && !string.IsNullOrEmpty(item["ReservedRatio"]))
//{
// decimal attendanceDay = ConvertHelper.To<decimal>(item["AttendanceDay"]), reservedRatio = ConvertHelper.To<decimal>(item["ReservedRatio"]);
// if ((!Regex.IsMatch(item["AttendanceDay"], "^(?:[0-2]*[0-9]?|30|31)$")) || (!Regex.IsMatch(item["ReservedRatio"], @"^(0.\d{1,2}|0|1)?$")))
// return false;
//}
}
if
(
string
.
IsNullOrEmpty
(
newEmployees
[
i
].
UnitType
?.
Trim
())
||
string
.
IsNullOrEmpty
(
newEmployees
[
i
].
Department
?.
Trim
())
||
string
.
IsNullOrEmpty
(
newEmployees
[
i
].
AccountingUnit
?.
Trim
())
||
string
.
IsNullOrEmpty
(
newEmployees
[
i
].
DoctorName
?.
Trim
())
||
string
.
IsNullOrEmpty
(
newEmployees
[
i
].
PersonnelNumber
?.
Trim
()))
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newEmployees
[
i
].
PersonnelNumber
??
""
},
{
"姓名"
,
newEmployees
[
i
].
DoctorName
??
""
},
{
"来源"
,
"粘贴数据"
},
{
"错误原因"
,
"“关键信息缺失”请补全或删除"
},
});
}
if
(
newEmployees
.
Count
(
w
=>
w
.
PersonnelNumber
==
newEmployees
[
i
].
PersonnelNumber
)
>
1
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newEmployees
[
i
].
PersonnelNumber
??
""
},
{
"姓名"
,
newEmployees
[
i
].
DoctorName
??
""
},
{
"来源"
,
"粘贴数据"
},
{
"错误原因"
,
"“人员工号”重复"
},
});
}
var
oldEmp
=
oldEmployees
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
newEmployees
[
i
].
PersonnelNumber
);
if
(!
string
.
IsNullOrEmpty
(
newEmployees
[
i
].
DoctorName
)
&&
oldEmp
!=
null
&&
oldEmp
.
DoctorName
!=
newEmployees
[
i
].
DoctorName
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newEmployees
[
i
].
PersonnelNumber
??
""
},
{
"姓名"
,
newEmployees
[
i
].
DoctorName
??
""
},
{
"来源"
,
"“粘贴数据”与“历史数据”比对"
},
{
"错误原因"
,
$"原名“
{
oldEmp
.
DoctorName
}
”,工号相同但姓名不同,请删除“历史数据”中该员工"
},
});
}
}
for
(
int
i
=
0
;
i
<
oldEmployees
.
Count
;
i
++)
{
if
(
oldEmployees
.
Count
(
w
=>
w
.
PersonnelNumber
==
oldEmployees
[
i
].
PersonnelNumber
)
>
1
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
oldEmployees
[
i
].
PersonnelNumber
??
""
},
{
"姓名"
,
oldEmployees
[
i
].
DoctorName
??
""
},
{
"来源"
,
"历史数据"
},
{
"错误原因"
,
"“人员工号”重复"
},
});
}
}
if
(
error
.
Count
>
0
)
return
new
ApiResponse
(
ResponseType
.
WarningTable
,
"验证不通过,当前操作已拒绝"
,
error
);
List
<
per_employee
>
employees
=
new
List
<
per_employee
>();
var
delPersonsNum
=
new
List
<
string
>();
foreach
(
var
data
in
newEmployees
)
{
var
any
=
employees
.
Any
(
w
=>
w
.
Department
?.
Trim
()
==
data
.
Department
?.
Trim
()
&&
w
.
DoctorName
?.
Trim
()
==
data
.
DoctorName
?.
Trim
());
if
(!
string
.
IsNullOrEmpty
(
data
.
Department
?.
Trim
())
&&
!
string
.
IsNullOrEmpty
(
data
.
AccountingUnit
?.
Trim
())
&&
!
string
.
IsNullOrEmpty
(
data
.
DoctorName
?.
Trim
())
&&
!
any
)
{
if
(
persons
!=
null
&&
person
s
.
Any
(
t
=>
t
.
PersonnelNumber
?.
Trim
()
==
data
.
PersonnelNumber
?.
Trim
()))
if
(
oldEmployees
!=
null
&&
oldEmployee
s
.
Any
(
t
=>
t
.
PersonnelNumber
?.
Trim
()
==
data
.
PersonnelNumber
?.
Trim
()))
delPersonsNum
.
Add
(
data
.
PersonnelNumber
);
data
.
HospitalId
=
HospitalId
;
...
...
@@ -784,7 +849,7 @@ public bool BathSavePerson(int AllotId, int HospitalId, SaveCollectData request)
}
}
var
delPerson
=
person
s
?.
Where
(
t
=>
delPersonsNum
.
Contains
(
t
.
PersonnelNumber
));
var
delPerson
=
oldEmployee
s
?.
Where
(
t
=>
delPersonsNum
.
Contains
(
t
.
PersonnelNumber
));
if
(
delPerson
!=
null
&&
delPerson
.
Any
())
peremployeeRepository
.
RemoveRange
(
delPerson
.
ToArray
());
if
(
employees
!=
null
&&
employees
.
Any
())
...
...
@@ -792,7 +857,7 @@ public bool BathSavePerson(int AllotId, int HospitalId, SaveCollectData request)
//个人绩效查询用户添加
SaveQueryRole
(
HospitalId
,
request
);
return
true
;
return
new
ApiResponse
(
ResponseType
.
OK
,
""
)
;
}
public
void
SaveDeptDicHands
(
int
HospitalId
,
SaveCollectData
request
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment