Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
inspect_report
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengjinlei
inspect_report
Commits
9c114833
Commit
9c114833
authored
Jun 09, 2020
by
zhengjinlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加id
parent
0897f51a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
report_utils.py
src/inspect_report/utils/report_utils.py
+3
-3
No files found.
src/inspect_report/utils/report_utils.py
View file @
9c114833
...
@@ -35,18 +35,18 @@ def get_inspect_rule(task):
...
@@ -35,18 +35,18 @@ def get_inspect_rule(task):
if
rule
[
'type'
]
==
'服务类'
:
if
rule
[
'type'
]
==
'服务类'
:
service_score
=
ScoreItems
.
objects
.
filter
(
id__in
=
rule
[
'scoreItemIds'
])
.
aggregate
(
ss
=
Sum
(
'score'
))[
'ss'
]
service_score
=
ScoreItems
.
objects
.
filter
(
id__in
=
rule
[
'scoreItemIds'
])
.
aggregate
(
ss
=
Sum
(
'score'
))[
'ss'
]
service_items
=
list
(
set
(
rule
[
'scoreItemIds'
])
.
intersection
(
set
(
score_item_ids
)))
service_items
=
list
(
set
(
rule
[
'scoreItemIds'
])
.
intersection
(
set
(
score_item_ids
)))
items
=
ScoreItems
.
objects
.
filter
(
id__in
=
service_items
)
.
values
(
'name'
,
'score'
,
'scoreType'
)
items
=
ScoreItems
.
objects
.
filter
(
id__in
=
service_items
)
.
values
(
'
id'
,
'
name'
,
'score'
,
'scoreType'
)
for
item
in
items
:
for
item
in
items
:
score_item_service
[
item
[
'id'
]]
=
item
[
'score'
]
if
item
[
'scoreType'
]
==
1
else
-
item
[
'score'
]
score_item_service
[
item
[
'id'
]]
=
item
[
'score'
]
if
item
[
'scoreType'
]
==
1
else
-
item
[
'score'
]
elif
rule
[
'type'
]
==
'业务类'
:
elif
rule
[
'type'
]
==
'业务类'
:
business_score
=
ScoreItems
.
objects
.
filter
(
id__in
=
rule
[
'scoreItemIds'
])
.
aggregate
(
ss
=
Sum
(
'score'
))[
'ss'
]
business_score
=
ScoreItems
.
objects
.
filter
(
id__in
=
rule
[
'scoreItemIds'
])
.
aggregate
(
ss
=
Sum
(
'score'
))[
'ss'
]
business_items
=
list
(
set
(
rule
[
'scoreItemIds'
])
.
intersection
(
set
(
score_item_ids
)))
business_items
=
list
(
set
(
rule
[
'scoreItemIds'
])
.
intersection
(
set
(
score_item_ids
)))
items
=
ScoreItems
.
objects
.
filter
(
id__in
=
business_items
)
.
values
(
'name'
,
'score'
,
'scoreType'
)
items
=
ScoreItems
.
objects
.
filter
(
id__in
=
business_items
)
.
values
(
'
id'
,
'
name'
,
'score'
,
'scoreType'
)
for
item
in
items
:
for
item
in
items
:
score_item_business
[
item
[
'id'
]]
=
item
[
'score'
]
if
item
[
'scoreType'
]
==
1
else
-
item
[
'score'
]
score_item_business
[
item
[
'id'
]]
=
item
[
'score'
]
if
item
[
'scoreType'
]
==
1
else
-
item
[
'score'
]
elif
rule
[
'type'
]
==
'0分项'
:
elif
rule
[
'type'
]
==
'0分项'
:
zero_items
=
list
(
set
(
rule
[
'scoreItemIds'
])
.
intersection
(
set
(
score_item_ids
)))
zero_items
=
list
(
set
(
rule
[
'scoreItemIds'
])
.
intersection
(
set
(
score_item_ids
)))
items
=
ScoreItems
.
objects
.
filter
(
id__in
=
zero_items
)
.
values
(
'name'
,
'score'
,
'scoreType'
)
items
=
ScoreItems
.
objects
.
filter
(
id__in
=
zero_items
)
.
values
(
'
id'
,
'
name'
,
'score'
,
'scoreType'
)
for
item
in
items
:
for
item
in
items
:
score_item_zero
[
item
[
'id'
]]
=
item
[
'score'
]
if
item
[
'scoreType'
]
==
1
else
-
item
[
'score'
]
score_item_zero
[
item
[
'id'
]]
=
item
[
'score'
]
if
item
[
'scoreType'
]
==
1
else
-
item
[
'score'
]
return
service_score
,
business_score
,
validate_zero
,
score_item_service
,
score_item_business
,
score_item_zero
return
service_score
,
business_score
,
validate_zero
,
score_item_service
,
score_item_business
,
score_item_zero
...
...
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