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
58df56db
Commit
58df56db
authored
Oct 12, 2021
by
钟博
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '二次分配工作量占比' into 发放表下载
parents
8d597c61
3514a30e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletions
+37
-1
performance/Performance.Services/SecondAllot/SecondAllotService.cs
+37
-1
No files found.
performance/Performance.Services/SecondAllot/SecondAllotService.cs
View file @
58df56db
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text.RegularExpressions
;
namespace
Performance.Services
namespace
Performance.Services
{
{
...
@@ -511,7 +512,42 @@ public void SaveSecondAllotHeadData(int secondId, string json)
...
@@ -511,7 +512,42 @@ public void SaveSecondAllotHeadData(int secondId, string json)
List
<
ag_worktype_source
>
insertData
=
new
List
<
ag_worktype_source
>();
List
<
ag_worktype_source
>
insertData
=
new
List
<
ag_worktype_source
>();
var
worktypeSources
=
agworktypesourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
var
worktypeSources
=
agworktypesourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
if
(
worktypeSources
==
null
||
!
worktypeSources
.
Any
())
if
(
worktypeSources
==
null
||
!
worktypeSources
.
Any
())
return
;
{
var
workTypes
=
agworkloadtypeRepository
.
GetEntities
();
var
workValue
=
new
List
<
int
>();
foreach
(
var
item
in
keys
)
{
var
value
=
item
.
Replace
(
"workload_ratio_"
,
""
).
Replace
(
"workload_amount_"
,
""
);
if
(!
Regex
.
IsMatch
(
value
,
@"^\d"
))
continue
;
workValue
.
Add
(
Convert
.
ToInt32
(
value
));
}
if
(
workValue
==
null
||
!
workValue
.
Any
())
return
;
foreach
(
var
value
in
workValue
)
{
for
(
int
i
=
0
;
i
<
prefix
.
Length
;
i
++)
{
var
fieldId
=
prefix
[
i
]
+
$"
{
value
}
"
;
var
typeName
=
workTypes
?.
FirstOrDefault
(
t
=>
t
.
Id
==
value
)?.
TypeName
;
var
source
=
new
ag_worktype_source
{
WorkTypeId
=
value
,
SecondId
=
secondId
,
FieldId
=
fieldId
,
FieldName
=
i
==
0
?
typeName
+
"占比"
:
typeName
+
"金额"
,
Value
=
prefix
[
i
].
StartsWith
(
prefix
[
0
])
?
(
decimal
?)
Convert
.
ToDecimal
(
dict
[
fieldId
.
ToLower
()])
:
null
,
};
insertData
.
Add
(
source
);
}
}
agworktypesourceRepository
.
AddRange
(
insertData
.
ToArray
());
}
worktypeSources
=
agworktypesourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
foreach
(
var
key
in
keys
)
foreach
(
var
key
in
keys
)
{
{
...
...
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