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
19794494
Commit
19794494
authored
Dec 13, 2021
by
纪旭 韦
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 手工录入_
parents
df42baec
912dbcc4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
27 deletions
+33
-27
performance/Performance.Services/SecondAllot/SecondAllotService.cs
+33
-27
No files found.
performance/Performance.Services/SecondAllot/SecondAllotService.cs
View file @
19794494
...
...
@@ -511,44 +511,50 @@ public void SaveSecondAllotHeadData(int secondId, string json)
List
<
ag_worktype_source
>
insertData
=
new
List
<
ag_worktype_source
>();
var
worktypeSources
=
agworktypesourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
if
(
worktypeSources
==
null
||
!
worktypeSources
.
Any
())
//多工作量
var
workTypes
=
agworkloadtypeRepository
.
GetEntities
();
var
workValue
=
new
List
<
int
>();
foreach
(
var
item
in
keys
)
{
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
;
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
)
foreach
(
var
value
in
workValue
)
{
for
(
int
i
=
0
;
i
<
prefix
.
Length
;
i
++)
{
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
{
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
);
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
());
}
foreach
(
var
k
in
worktypeSources
.
Select
(
t
=>
t
.
FieldId
))
{
var
remove
=
insertData
.
FirstOrDefault
(
t
=>
t
.
FieldId
.
EqualsIgnoreCase
(
k
));
if
(
remove
!=
null
)
{
insertData
.
Remove
(
remove
);
}
}
agworktypesourceRepository
.
AddRange
(
insertData
.
ToArray
());
worktypeSources
=
agworktypesourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
foreach
(
var
key
in
keys
)
{
var
update
=
worktypeSources
.
FirstOrDefault
(
t
=>
t
.
FieldId
.
EqualsIgnoreCase
(
key
));
...
...
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