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
c460ae30
Commit
c460ae30
authored
Aug 23, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
清理 将所有0赋空
parent
b3574823
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
performance/Performance.Api/Controllers/SecondAllotController.cs
+3
-0
performance/Performance.Services/RedistributionService.cs
+25
-0
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
c460ae30
...
...
@@ -575,6 +575,8 @@ public ApiResponse RedistributionLoad([FromBody] SecondLoadDto request)
overrideMode
=
(
EmployeeSource
)
request
.
OverrideMode
;
var
result
=
_redistributionService
.
Load
(
request
.
SecondId
,
(
ComputeMode
)
request
.
ComputeMode
,
overrideMode
);
_redistributionService
.
ClearInvalidValue
(
result
.
Body
?.
Data
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
catch
(
PerformanceException
ex
)
...
...
@@ -702,6 +704,7 @@ public ApiResponse RedistributionCompute([FromBody] SecondComputeDto request)
// 重算部分数据
_redistributionService
.
RedistributionCompute
((
ComputeMode
)
request
.
ComputeMode
,
request
.
Head
,
cleanDatas
);
_redistributionService
.
ClearInvalidValue
(
cleanDatas
);
var
dic
=
_redistributionService
.
GetTableHeaderDictionary
((
ComputeMode
)
request
.
ComputeMode
,
allot
,
second
,
loads
,
workloadGroups
);
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
Head
=
request
.
Head
,
Body
=
cleanDatas
,
Dic
=
dic
});
}
...
...
performance/Performance.Services/RedistributionService.cs
View file @
c460ae30
...
...
@@ -14,6 +14,7 @@
using
System.Diagnostics
;
using
System.Drawing
;
using
System.Linq.Expressions
;
using
System.Text.RegularExpressions
;
namespace
Performance.Services
{
...
...
@@ -401,6 +402,30 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
}
/// <summary>
/// 清理 将所有0赋空
/// </summary>
/// <param name="datas"></param>
public
void
ClearInvalidValue
(
List
<
Dictionary
<
string
,
object
>>
datas
)
{
if
(
datas
!=
null
)
{
foreach
(
var
row
in
datas
)
{
foreach
(
var
key
in
row
.
Keys
.
ToArray
())
{
if
(
key
.
StartsWithIgnoreCase
(
"SingleAwards_"
)
||
key
.
StartsWithIgnoreCase
(
"Workload_"
))
{
var
value
=
row
[
key
]?.
ToString
()
??
""
;
if
(
value
==
"0"
||
Regex
.
IsMatch
(
value
,
"^0.[0]+$"
))
row
[
key
]
=
""
;
}
}
}
}
}
/// <summary>
/// 按指定方式加载人员数据
/// </summary>
/// <param name="allot"></param>
...
...
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