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
e143c928
Commit
e143c928
authored
Jan 10, 2023
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
员工工号重复BUG修复
parent
a0a53097
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
performance/Performance.Services/PersonService.cs
+7
-7
No files found.
performance/Performance.Services/PersonService.cs
View file @
e143c928
...
...
@@ -336,12 +336,9 @@ public ApiResponse UpdatePerson(PerEmployeeResponse request)
throw
new
PerformanceException
(
$"“关键信息缺失”请补全!"
);
}
var
employees
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
&&
t
.
Id
==
request
.
Id
);
if
(
employees
==
null
)
throw
new
PerformanceException
(
$"员工工号为“
{
request
.
PersonnelNumber
}
”不存在,请重新添加!"
);
if
(
employees
.
Count
()
>
1
)
throw
new
PerformanceException
(
$"工号为“
{
request
.
PersonnelNumber
}
”存在多条数据,请删除多余数据!"
);
var
employees
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
&&
t
.
Id
!=
request
.
Id
&&
t
.
PersonnelNumber
==
request
.
PersonnelNumber
);
if
(
employees
!=
null
&&
employees
.
Count
>
0
)
throw
new
PerformanceException
(
$"员工工号为“
{
request
.
PersonnelNumber
}
”已存在,请勿重复添加!"
);
var
unittype
=
UnitTypeUtil
.
GetUnitTypeFromEnum
().
Select
(
t
=>
t
.
Description
).
ToList
();
unittype
.
AddRange
(
EnumHelper
.
GetItems
<
AccountUnitType
>().
Select
(
t
=>
t
.
Description
));
...
...
@@ -349,7 +346,10 @@ public ApiResponse UpdatePerson(PerEmployeeResponse request)
if
(!
unittype
.
Contains
(
request
.
UnitType
))
throw
new
PerformanceException
(
$"核算组别不符合规范!"
);
var
employee
=
employees
.
First
();
var
employee
=
peremployeeRepository
.
GetEntity
(
t
=>
t
.
AllotId
==
request
.
AllotId
&&
t
.
Id
==
request
.
Id
);
if
(
employee
==
null
)
throw
new
PerformanceException
(
$"当前要修改的员工信息不存在,请检查后重试!"
);
//_mapper.Map(request, employee, typeof(per_employee), typeof(per_employee));
employee
.
AccountingUnit
=
request
.
AccountingUnit
;
...
...
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