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
0c70484a
Commit
0c70484a
authored
Jan 06, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
医院其他绩效核算单元没填则补全
parent
d4ffb970
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
21 deletions
+15
-21
performance/Performance.Services/EmployeeService.cs
+15
-21
No files found.
performance/Performance.Services/EmployeeService.cs
View file @
0c70484a
...
@@ -516,34 +516,28 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
...
@@ -516,34 +516,28 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
var
sheet
=
workbook
.
GetSheetAt
(
0
);
var
sheet
=
workbook
.
GetSheetAt
(
0
);
var
firstRow
=
sheet
.
GetRow
(
0
);
var
firstRow
=
sheet
.
GetRow
(
0
);
List
<(
string
,
int
)>
excelheader
=
new
List
<(
string
,
int
)
>();
Dictionary
<
int
,
string
>
excelheader
=
new
Dictionary
<
int
,
string
>();
for
(
int
cellindex
=
0
;
cellindex
<
firstRow
.
LastCellNum
+
1
;
cellindex
++)
for
(
int
cellindex
=
0
;
cellindex
<
firstRow
.
LastCellNum
+
1
;
cellindex
++)
{
{
var
cell
=
firstRow
.
GetCell
(
cellindex
);
var
value
=
firstRow
.
GetCell
(
cellindex
).
GetValue
();
if
(
cell
==
null
)
continue
;
if
(!
string
.
IsNullOrEmpty
(
value
)
&&
!
excelheader
.
ContainsKey
(
cellindex
))
excelheader
.
Add
(
cellindex
,
value
);
if
(!
string
.
IsNullOrEmpty
(
cell
.
ToString
()))
excelheader
.
Add
((
cell
.
ToString
(),
cellindex
));
}
}
if
(
excelheader
==
null
||
!
excelheader
.
Any
()
)
if
(
excelheader
==
null
||
excelheader
.
Count
==
0
)
throw
new
PerformanceException
(
"上传excel内容错误"
);
throw
new
PerformanceException
(
"上传excel内容错误"
);
Dictionary
<
string
,
int
>
dict
=
new
Dictionary
<
string
,
int
>
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
>();
foreach
(
var
key
in
dict
.
Keys
.
ToList
())
foreach
(
var
key
in
dict
.
Keys
.
ToList
())
{
{
if
(
!
excelheader
.
Select
(
t
=>
t
.
Item1
).
Contains
(
key
))
errorHeaders
.
Add
(
key
);
if
(
excelheader
.
Any
(
w
=>
w
.
Value
==
key
))
else
dict
[
key
]
=
excelheader
.
First
(
t
=>
t
.
Item1
==
key
).
Item2
;
dict
[
key
]
=
excelheader
.
First
(
w
=>
w
.
Value
==
key
).
Key
;
}
}
if
(
errorHeaders
!=
null
&&
errorHeaders
.
Any
())
throw
new
PerformanceException
(
$"excel缺少列
{
string
.
Join
(
", "
,
errorHeaders
)}
"
);
var
entities
=
new
List
<
per_apr_amount
>();
var
entities
=
new
List
<
per_apr_amount
>();
var
createtime
=
DateTime
.
Now
;
var
createtime
=
DateTime
.
Now
;
...
@@ -555,12 +549,12 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
...
@@ -555,12 +549,12 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
var
entity
=
new
per_apr_amount
var
entity
=
new
per_apr_amount
{
{
Status
=
2
,
Status
=
2
,
PersonnelNumber
=
row
.
GetCell
(
dict
[
"人员工号"
]).
GetValue
(),
PersonnelNumber
=
dict
[
"人员工号"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"人员工号"
]).
GetValue
(),
DoctorName
=
row
.
GetCell
(
dict
[
"姓名"
]).
GetValue
(),
DoctorName
=
dict
[
"姓名"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"姓名"
]).
GetValue
(),
PerforType
=
row
.
GetCell
(
dict
[
"绩效类型"
]).
GetValue
(),
PerforType
=
dict
[
"绩效类型"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"绩效类型"
]).
GetValue
(),
Amount
=
ConvertHelper
.
To
<
decimal
>(
row
.
GetCell
(
dict
[
"金额"
]).
GetValue
(),
0
),
Amount
=
dict
[
"金额"
]
<
0
?
0
:
ConvertHelper
.
To
<
decimal
>(
row
.
GetCell
(
dict
[
"金额"
]).
GetValue
(),
0
),
TypeInDepartment
=
row
.
GetCell
(
dict
[
"录入科室"
]).
GetValue
(),
TypeInDepartment
=
dict
[
"录入科室"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"录入科室"
]).
GetValue
(),
//AccountingUnit =
row.GetCell(dict["核算单元"]).GetValue(),
AccountingUnit
=
dict
[
"核算单元"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"核算单元"
]).
GetValue
(),
AllotId
=
allotid
,
AllotId
=
allotid
,
CreateDate
=
createtime
,
CreateDate
=
createtime
,
CreateUser
=
userid
,
CreateUser
=
userid
,
...
@@ -579,7 +573,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
...
@@ -579,7 +573,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
throw
new
PerformanceException
(
"文件中存在“录入科室”为空的数据"
);
throw
new
PerformanceException
(
"文件中存在“录入科室”为空的数据"
);
var
employees
=
peremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotid
);
var
employees
=
peremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotid
);
foreach
(
var
item
in
entities
.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
PersonnelNumber
)))
foreach
(
var
item
in
entities
.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
PersonnelNumber
)
&&
!
string
.
IsNullOrEmpty
(
w
.
AccountingUnit
)
))
{
{
item
.
AccountingUnit
=
employees
?.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
item
.
PersonnelNumber
)?.
AccountingUnit
??
""
;
item
.
AccountingUnit
=
employees
?.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
item
.
PersonnelNumber
)?.
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