Commit 9c114833 authored by zhengjinlei's avatar zhengjinlei

增加id

parent 0897f51a
......@@ -35,18 +35,18 @@ def get_inspect_rule(task):
if rule['type'] == '服务类':
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)))
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:
score_item_service[item['id']] = item['score'] if item['scoreType'] == 1 else -item['score']
elif rule['type'] == '业务类':
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)))
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:
score_item_business[item['id']] = item['score'] if item['scoreType'] == 1 else -item['score']
elif rule['type'] == '0分项':
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:
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment