部门排名 part
This commit is contained in:
parent
66d3730917
commit
89123441ec
|
@ -15,7 +15,7 @@ from uuid import UUID
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from datetime import datetime, date, timedelta
|
from datetime import datetime, date, timedelta
|
||||||
from django.db.models import F, Count, Sum
|
from django.db.models import F, Count, Sum, Avg
|
||||||
import requests
|
import requests
|
||||||
from .tasks import send_wechatmsgs, send_wechatmsg, yjjs, gettime, yjjs_px, yjjs_yl, updateTzzs, updateAqzs, yjjs_gc, yjjs_ws
|
from .tasks import send_wechatmsgs, send_wechatmsg, yjjs, gettime, yjjs_px, yjjs_yl, updateTzzs, updateAqzs, yjjs_gc, yjjs_ws
|
||||||
from .export import exportdoc, exportxlsx, exportyjdoc, exportsimplexlsx, exportdoc2
|
from .export import exportdoc, exportxlsx, exportyjdoc, exportsimplexlsx, exportdoc2
|
||||||
|
@ -6204,8 +6204,9 @@ def apiexamtestrate(req):
|
||||||
objslist = list(objs)
|
objslist = list(objs)
|
||||||
for i in objslist:
|
for i in objslist:
|
||||||
i['rate'] = objslist.index(i) + 1
|
i['rate'] = objslist.index(i) + 1
|
||||||
|
orgsCal = ExamTestDetail.objects.filter(examtest__in=alltest,ison=1,score>0).values('user__ubelongpart__partid','user__ubelongpart__partname').annotate(totaltest=Count('user__ubelongpart__partid'),avgscore=Avg('score'),totaluser=Count('user__userid'))
|
||||||
with open('ratedata.dat','wb') as f:
|
with open('ratedata.dat','wb') as f:
|
||||||
pickle.dump({'total':total,'rows':objslist,'updatetime':datetime.now().strftime('%Y-%m-%d %H:%M')},f)
|
pickle.dump({'total':total,'rows':objslist,'rows2':list(orgsCal),'updatetime':datetime.now().strftime('%Y-%m-%d %H:%M')},f)
|
||||||
return JsonResponse({"code": 1})
|
return JsonResponse({"code": 1})
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue