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
82be2bf2
Commit
82be2bf2
authored
Sep 26, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绩效发放表排序,医院其他绩效添加时核对人员字典
parent
8279aa70
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
8 deletions
+30
-8
performance/Performance.Api/Controllers/EmployeeController.cs
+3
-3
performance/Performance.Services/ComputeService.cs
+9
-2
performance/Performance.Services/EmployeeService.cs
+18
-3
No files found.
performance/Performance.Api/Controllers/EmployeeController.cs
View file @
82be2bf2
...
@@ -436,8 +436,8 @@ public ApiResponse Import([FromForm] IFormCollection form)
...
@@ -436,8 +436,8 @@ public ApiResponse Import([FromForm] IFormCollection form)
if
(!
FileHelper
.
CreateFile
(
path
,
bytes
))
if
(!
FileHelper
.
CreateFile
(
path
,
bytes
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
$"
{
file
.
FileName
}
上传失败"
);
return
new
ApiResponse
(
ResponseType
.
Fail
,
$"
{
file
.
FileName
}
上传失败"
);
}
}
employeeService
.
ImpoerAprEmployees
(
allotid
,
path
,
claim
.
GetUserId
());
var
result
=
employeeService
.
ImpoerAprEmployees
(
allotid
,
path
,
claim
.
GetUserId
());
return
new
ApiResponse
(
ResponseType
.
OK
);
return
result
==
""
?
new
ApiResponse
(
ResponseType
.
OK
)
:
new
ApiResponse
(
ResponseType
.
ParameterError
,
result
);
}
}
/// <summary>
/// <summary>
...
@@ -469,7 +469,7 @@ public ApiResponse AprOverview(int allotId)
...
@@ -469,7 +469,7 @@ public ApiResponse AprOverview(int allotId)
var
result
=
new
List
<
Dictionary
<
string
,
string
>>();
var
result
=
new
List
<
Dictionary
<
string
,
string
>>();
if
(
role
.
Any
(
t
=>
roleType
.
Contains
(
t
.
Type
.
Value
)))
if
(
role
.
Any
(
t
=>
roleType
.
Contains
(
t
.
Type
.
Value
)))
result
=
employeeService
.
GetOtherPerStats
(
allotId
,
user
.
Department
??
""
);
result
=
employeeService
.
GetOtherPerStats
(
allotId
,
user
.
Department
??
""
);
else
else
result
=
employeeService
.
GetOtherPerStats
(
allotId
);
result
=
employeeService
.
GetOtherPerStats
(
allotId
);
...
...
performance/Performance.Services/ComputeService.cs
View file @
82be2bf2
...
@@ -697,8 +697,15 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
...
@@ -697,8 +697,15 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
result
.
AddRange
(
hideOtherResult
);
result
.
AddRange
(
hideOtherResult
);
#
endregion
#
endregion
var
enumItems
=
EnumHelper
.
GetItems
<
AccountUnitType
>();
var
enumItems
=
EnumHelper
.
GetItems
<
UnitType
>();
result
=
result
.
OrderBy
(
t
=>
enumItems
.
FirstOrDefault
(
e
=>
e
.
Name
==
t
.
UnitName
)?.
Value
)
/*.ThenBy(t => t.AccountingUnit)*/
.
ToList
();
enumItems
.
ForEach
(
t
=>
{
t
.
Value
=
UnitTypeUtil
.
Is
(
t
.
Name
,
UnitType
.
护理组
)
?
t
.
Value
+
2
:
t
.
Value
;
if
(
t
.
Name
==
UnitType
.
行政后勤
.
ToString
())
t
.
Name
=
"行政工勤"
;
});
result
=
result
.
OrderBy
(
t
=>
enumItems
.
FirstOrDefault
(
e
=>
e
.
Name
==
t
.
UnitName
)?.
Value
).
ThenBy
(
t
=>
t
.
AccountingUnit
).
ToList
();
return
result
;
return
result
;
}
}
...
...
performance/Performance.Services/EmployeeService.cs
View file @
82be2bf2
...
@@ -445,6 +445,10 @@ public bool InsertApr(per_apr_amount request, int userId)
...
@@ -445,6 +445,10 @@ public bool InsertApr(per_apr_amount request, int userId)
if
(
string
.
IsNullOrEmpty
(
request
.
PerforType
)
&&
request
.
Amount
!=
0
)
if
(
string
.
IsNullOrEmpty
(
request
.
PerforType
)
&&
request
.
Amount
!=
0
)
throw
new
PerformanceException
(
"文件中存在“绩效类型”为空的数据"
);
throw
new
PerformanceException
(
"文件中存在“绩效类型”为空的数据"
);
var
employee
=
peremployeeRepository
.
GetEntity
(
t
=>
t
.
AllotId
==
request
.
AllotId
&&
t
.
PersonnelNumber
==
request
.
PersonnelNumber
);
if
(
employee
==
null
)
throw
new
PerformanceException
(
"工号在字典中不存在"
);
request
.
TypeInDepartment
=
GetTypeInDepartment
(
userId
);
request
.
TypeInDepartment
=
GetTypeInDepartment
(
userId
);
request
.
Status
=
2
;
request
.
Status
=
2
;
request
.
CreateDate
=
DateTime
.
Now
;
request
.
CreateDate
=
DateTime
.
Now
;
...
@@ -538,7 +542,7 @@ public bool ConfirmAudit(int userid, AprAmountAuditRequest request)
...
@@ -538,7 +542,7 @@ public bool ConfirmAudit(int userid, AprAmountAuditRequest request)
/// <param name="allotid"></param>
/// <param name="allotid"></param>
/// <param name="path"></param>
/// <param name="path"></param>
/// <param name="userid"></param>
/// <param name="userid"></param>
public
void
ImpoerAprEmployees
(
int
allotid
,
string
path
,
int
userid
)
public
string
ImpoerAprEmployees
(
int
allotid
,
string
path
,
int
userid
)
{
{
var
userrole
=
userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
userid
);
var
userrole
=
userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
userid
);
if
(
userrole
==
null
)
throw
new
PerformanceException
(
"用户未绑定角色"
);
if
(
userrole
==
null
)
throw
new
PerformanceException
(
"用户未绑定角色"
);
...
@@ -563,7 +567,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
...
@@ -563,7 +567,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
?
(
IWorkbook
)(
new
XSSFWorkbook
(
fs
))
?
(
IWorkbook
)(
new
XSSFWorkbook
(
fs
))
:
(
IWorkbook
)(
new
HSSFWorkbook
(
fs
));
:
(
IWorkbook
)(
new
HSSFWorkbook
(
fs
));
}
}
if
(
workbook
==
null
)
return
;
if
(
workbook
==
null
)
return
""
;
var
sheet
=
workbook
.
GetSheetAt
(
0
);
var
sheet
=
workbook
.
GetSheetAt
(
0
);
var
firstRow
=
sheet
.
GetRow
(
0
);
var
firstRow
=
sheet
.
GetRow
(
0
);
...
@@ -592,6 +596,8 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
...
@@ -592,6 +596,8 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
var
entities
=
new
List
<
per_apr_amount
>();
var
entities
=
new
List
<
per_apr_amount
>();
var
createtime
=
DateTime
.
Now
;
var
createtime
=
DateTime
.
Now
;
var
typeIn
=
GetTypeInDepartment
(
userid
);
var
typeIn
=
GetTypeInDepartment
(
userid
);
var
employees
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotid
);
for
(
int
rowindex
=
1
;
rowindex
<
sheet
.
LastRowNum
+
1
;
rowindex
++)
for
(
int
rowindex
=
1
;
rowindex
<
sheet
.
LastRowNum
+
1
;
rowindex
++)
{
{
var
row
=
sheet
.
GetRow
(
rowindex
);
var
row
=
sheet
.
GetRow
(
rowindex
);
...
@@ -613,6 +619,13 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
...
@@ -613,6 +619,13 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
entities
.
Add
(
entity
);
entities
.
Add
(
entity
);
}
}
var
numbers
=
entities
.
Select
(
t
=>
t
.
PersonnelNumber
).
Except
(
employees
.
Select
(
w
=>
w
.
PersonnelNumber
));
if
(
numbers
?.
Count
()
>
0
&&
numbers
?.
Count
()
<=
5
)
return
$@"以下工号在字典中不存在:
{
JsonHelper
.
Serialize
(
numbers
.
ToArray
())}
"
;
else
if
(
numbers
?.
Count
()
>
5
)
return
$@"以下工号在字典中不存在:
{
JsonHelper
.
Serialize
(
numbers
.
Take
(
5
)).
Replace
(
"]"
,
",...]"
)}
"
;
// 补充核算单元
// 补充核算单元
if
(
entities
.
Any
())
if
(
entities
.
Any
())
{
{
...
@@ -630,6 +643,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
...
@@ -630,6 +643,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
//}
//}
perapramountRepository
.
AddRange
(
entities
.
ToArray
());
perapramountRepository
.
AddRange
(
entities
.
ToArray
());
}
}
return
""
;
}
}
catch
(
PerformanceException
ex
)
catch
(
PerformanceException
ex
)
{
{
...
@@ -638,6 +652,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
...
@@ -638,6 +652,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
logger
.
LogError
(
ex
.
ToString
());
logger
.
LogError
(
ex
.
ToString
());
return
"上传失败"
;
}
}
}
}
...
@@ -714,7 +729,7 @@ public view_per_apr_amount GetEmployeeMessage(int allotId, string personnelNumbe
...
@@ -714,7 +729,7 @@ public view_per_apr_amount GetEmployeeMessage(int allotId, string personnelNumbe
var
user
=
userRepository
.
GetEntity
(
w
=>
w
.
ID
==
userId
&&
w
.
IsDelete
==
1
);
var
user
=
userRepository
.
GetEntity
(
w
=>
w
.
ID
==
userId
&&
w
.
IsDelete
==
1
);
if
(
user
==
null
)
throw
new
PerformanceException
(
"操作用户不存在或用户信息错误!"
);
if
(
user
==
null
)
throw
new
PerformanceException
(
"操作用户不存在或用户信息错误!"
);
var
employee
=
peremployeeRepository
.
GetEntity
(
w
=>
w
.
AllotId
==
allotId
&&
w
.
PersonnelNumber
.
Trim
()
==
personnelNumber
.
Trim
());
var
employee
=
peremployeeRepository
.
GetEntity
(
w
=>
w
.
AllotId
==
allotId
&&
w
.
PersonnelNumber
!=
null
&&
w
.
PersonnelNumber
.
Trim
()
==
personnelNumber
.
Trim
());
if
(
employee
==
null
)
return
new
view_per_apr_amount
();
if
(
employee
==
null
)
return
new
view_per_apr_amount
();
return
new
view_per_apr_amount
return
new
view_per_apr_amount
...
...
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