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
d4ffb970
Commit
d4ffb970
authored
Dec 14, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动补全核算单元
parent
52015418
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
performance/Performance.Services/EmployeeService.cs
+23
-2
No files found.
performance/Performance.Services/EmployeeService.cs
View file @
d4ffb970
...
...
@@ -531,7 +531,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
Dictionary
<
string
,
int
>
dict
=
new
Dictionary
<
string
,
int
>
{
{
"录入科室"
,
-
1
},{
"
核算单元"
,
-
1
},{
"人员工号"
,
-
1
},
{
"姓名"
,
-
1
},
{
"绩效类型"
,
-
1
},
{
"金额
"
,
-
1
},
{
"录入科室"
,
-
1
},{
"
人员工号"
,
-
1
},
{
"姓名"
,
-
1
},
{
"绩效类型"
,
-
1
},
{
"金额"
,
-
1
},
//{ "核算单元
", -1 },
};
List
<
string
>
errorHeaders
=
new
List
<
string
>();
...
...
@@ -560,15 +560,36 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
PerforType
=
row
.
GetCell
(
dict
[
"绩效类型"
]).
GetValue
(),
Amount
=
ConvertHelper
.
To
<
decimal
>(
row
.
GetCell
(
dict
[
"金额"
]).
GetValue
(),
0
),
TypeInDepartment
=
row
.
GetCell
(
dict
[
"录入科室"
]).
GetValue
(),
AccountingUnit
=
row
.
GetCell
(
dict
[
"核算单元"
]).
GetValue
(),
//
AccountingUnit = row.GetCell(dict["核算单元"]).GetValue(),
AllotId
=
allotid
,
CreateDate
=
createtime
,
CreateUser
=
userid
,
};
entities
.
Add
(
entity
);
}
// 补充核算单元
if
(
entities
.
Any
())
{
if
(
entities
.
Any
(
w
=>
string
.
IsNullOrEmpty
(
w
.
PersonnelNumber
)
&&
w
.
Amount
!=
0
))
throw
new
PerformanceException
(
"文件中存在“工号”为空的数据"
);
if
(
entities
.
Any
(
w
=>
string
.
IsNullOrEmpty
(
w
.
PerforType
)
&&
w
.
Amount
!=
0
))
throw
new
PerformanceException
(
"文件中存在“绩效类型”为空的数据"
);
if
(
entities
.
Any
(
w
=>
string
.
IsNullOrEmpty
(
w
.
TypeInDepartment
)
&&
w
.
Amount
!=
0
))
throw
new
PerformanceException
(
"文件中存在“录入科室”为空的数据"
);
var
employees
=
peremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotid
);
foreach
(
var
item
in
entities
.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
PersonnelNumber
)))
{
item
.
AccountingUnit
=
employees
?.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
item
.
PersonnelNumber
)?.
AccountingUnit
??
""
;
}
perapramountRepository
.
AddRange
(
entities
.
ToArray
());
}
}
catch
(
PerformanceException
ex
)
{
throw
ex
;
}
catch
(
Exception
ex
)
{
logger
.
LogError
(
ex
.
ToString
());
...
...
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