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
ad933cd9
Commit
ad933cd9
authored
Mar 29, 2019
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbug
parent
89150e7f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
13 deletions
+16
-13
performance/Performance.Api/Filters/ActionsFilter.cs
+11
-8
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeDirector.cs
+3
-2
performance/Performance.Services/SheetSevice.cs
+2
-3
No files found.
performance/Performance.Api/Filters/ActionsFilter.cs
View file @
ad933cd9
...
...
@@ -47,16 +47,19 @@ public ActionsFilter(ILoggerFactory factory, IMemoryCache cache, IHostingEnviron
return
;
}
//token验证
var
arry
=
((
ControllerActionDescriptor
)
context
.
ActionDescriptor
).
MethodInfo
.
GetCustomAttributes
(
typeof
(
NoVerifyAttribute
),
true
);
if
(
arry
.
Length
==
0
)
if
(!
_env
.
IsDevelopment
())
{
var
token
=
kv
.
GetValue
(
"token"
,
""
);
var
user
=
_cache
.
Get
<
UserIdentity
>(
token
);
if
(
string
.
IsNullOrEmpty
(
token
)
||
user
==
null
||
!
user
.
Token
.
Equals
(
token
))
var
arry
=
((
ControllerActionDescriptor
)
context
.
ActionDescriptor
).
MethodInfo
.
GetCustomAttributes
(
typeof
(
NoVerifyAttribute
),
true
);
if
(
arry
.
Length
==
0
)
{
var
response
=
new
ApiResponse
(
ResponseType
.
TokenError
,
"Token无效"
);
context
.
Result
=
new
ObjectResult
(
response
);
return
;
var
token
=
kv
.
GetValue
(
"token"
,
""
);
var
user
=
_cache
.
Get
<
UserIdentity
>(
token
);
if
(
string
.
IsNullOrEmpty
(
token
)
||
user
==
null
||
!
user
.
Token
.
Equals
(
token
))
{
var
response
=
new
ApiResponse
(
ResponseType
.
TokenError
,
"Token无效"
);
context
.
Result
=
new
ObjectResult
(
response
);
return
;
}
}
}
//验证请求参数
...
...
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeDirector.cs
View file @
ad933cd9
...
...
@@ -162,9 +162,10 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<res_
var
years
=
((
DateTime
.
Now
.
Year
-
item
.
WorkTime
.
Value
.
Year
)
*
12
+
(
DateTime
.
Now
.
Month
-
item
.
WorkTime
.
Value
.
Month
))
/
12.0
m
;
var
value
=
workyearList
.
FirstOrDefault
(
t
=>
t
.
MinRange
<
years
&&
years
<=
t
.
MaxRange
)?.
Value
;
compute
.
WorkYear
=
value
;
}
compute
.
GiveFee
=
baiscnorm
*
compute
.
PostCoefficient
*
compute
.
Attendance
*
compute
.
ScoreAverageRate
*
(
compute
.
WorkYear
??
1
)
+
(
compute
.
OtherPerfor
??
0
)
+
(
item
.
Workload
??
0
)
+
(
compute
.
Punishment
??
0
);
}
//应发绩效
compute
.
GiveFee
=
baiscnorm
*
compute
.
PostCoefficient
*
compute
.
Attendance
*
compute
.
ScoreAverageRate
*
(
compute
.
WorkYear
??
1
)
+
(
compute
.
OtherPerfor
??
0
)
+
(
item
.
Workload
??
0
)
+
(
compute
.
Punishment
??
0
);
//实发绩效
compute
.
RealGiveFee
=
compute
.
GiveFee
*
item
.
Adjust
*
item
.
Grant
;
computeList
.
Add
(
compute
);
}
...
...
performance/Performance.Services/SheetSevice.cs
View file @
ad933cd9
...
...
@@ -136,7 +136,7 @@ private void SpecialUnitExport(int sheetID, SheetExportResponse response)
rowbody
.
Data
.
Add
(
new
Cell
(
9
,
item
.
Punishment
,
1
,
1
,
false
,
true
));
rowbody
.
Data
.
Add
(
new
Cell
(
10
,
item
.
Adjust
,
1
,
1
,
false
,
true
));
response
.
Row
.
Add
(
rowbody
);
}
}
}
}
...
...
@@ -212,8 +212,7 @@ private void CommonExport(int sheetID, SheetExportResponse response)
}
else
if
(!
rowbody
.
Data
.
Any
(
t
=>
t
.
PointCell
==
head
.
PointCell
))
{
var
accountingUnit
=
dataList
.
FirstOrDefault
(
t
=>
t
.
RowNumber
==
rowNumber
)?.
AccountingUnit
;
var
data
=
dataList
.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
accountingUnit
&&
t
.
SignID
==
head
.
SignID
);
var
data
=
dataList
.
FirstOrDefault
(
t
=>
t
.
RowNumber
==
rowNumber
&&
t
.
SignID
==
head
.
SignID
);
var
value
=
data
?.
CellValue
;
if
(
value
.
HasValue
&&
value
.
Value
>
0
)
rowbody
.
Data
.
Add
(
new
Cell
(
head
.
PointCell
.
Value
,
value
,
1
,
1
,
data
.
IsTotal
==
1
,
true
,
data
.
Annotation
));
...
...
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