机构排名
This commit is contained in:
parent
ed10ef1260
commit
fe44b5d492
BIN
ratedata.dat
BIN
ratedata.dat
Binary file not shown.
|
@ -146,7 +146,7 @@
|
||||||
<p class="_p">
|
<p class="_p">
|
||||||
|
|
||||||
<a class="list" href="javascript:;">
|
<a class="list" href="javascript:;">
|
||||||
<input id="file" type="file" name="myfile" accept=".xls,.ppt,.doc,.pdf,.rar,.zip,.pptx,.docx,.xlsx" onchange="UpladFile(this); " /><span>选择文件</span>
|
<input id="file" type="file" name="myfile" accept=".xls,.ppt,.doc,.pdf,.rar,.zip,.pptx,.docx,.xlsx,.mp4" onchange="UpladFile(this); " /><span>选择文件</span>
|
||||||
</a>
|
</a>
|
||||||
<!--<button class="btn" type="button" onclick="sub();">上传</button>-->
|
<!--<button class="btn" type="button" onclick="sub();">上传</button>-->
|
||||||
<a class="el-upload-list__item-name">
|
<a class="el-upload-list__item-name">
|
||||||
|
@ -241,7 +241,7 @@ $("#cate").treegrid("unselect");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var filetypes = [".xls",".txt",".ppt",".doc",".pdf",".dot",".rar",".zip",".docx", ".pptx", ".xlsx"];
|
var filetypes = [".xls",".txt",".ppt",".doc",".pdf",".dot",".rar",".zip",".docx", ".pptx", ".xlsx", ".mp4"];
|
||||||
var filepath = target.value;
|
var filepath = target.value;
|
||||||
if (filepath) {
|
if (filepath) {
|
||||||
var isnext = false;
|
var isnext = false;
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-bottom:5px;">
|
<div style="margin-bottom:5px;">
|
||||||
<input id="endtime" editable="false" name="endtime" class="easyui-datetimebox" style="width:90%"
|
<input id="endtime" editable="false" name="endtime" class="easyui-datetimebox" style="width:90%"
|
||||||
data-options="label:'最迟参加',currentText:'今天',closeText:'关闭',showSeconds: false" />
|
data-options="label:'最迟参加',currentText:'今天',closeText:'关闭',showSeconds: false,required:true" />
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-bottom:5px">
|
<div style="margin-bottom:5px">
|
||||||
<input class="easyui-textbox" id="participantname" style="width:80%;height:120px" editable="false"
|
<input class="easyui-textbox" id="participantname" style="width:80%;height:120px" editable="false"
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-bottom:5px;">
|
<div style="margin-bottom:5px;">
|
||||||
<input id="endtime" editable="false" name="endtime" class="easyui-datetimebox" style="width:90%"
|
<input id="endtime" editable="false" name="endtime" class="easyui-datetimebox" style="width:90%"
|
||||||
data-options="label:'考试结束',currentText:'今天',closeText:'关闭',showSeconds: false" />
|
data-options="label:'考试结束',currentText:'今天',closeText:'关闭',showSeconds: false,required:true" />
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-bottom:5px">
|
<div style="margin-bottom:5px">
|
||||||
<input class="easyui-textbox" id="participantname" style="width:90%;height:120px" editable="false"
|
<input class="easyui-textbox" id="participantname" style="width:90%;height:120px" editable="false"
|
||||||
|
|
|
@ -6329,15 +6329,23 @@ def apiexamtestrate(req):
|
||||||
'''
|
'''
|
||||||
companyid = req.GET.get('companyid')
|
companyid = req.GET.get('companyid')
|
||||||
alltest = ExamTest.objects.filter(usecomps__contains=','+str(companyid)+',').exclude(nousecomps__contains=','+str(companyid)+',')
|
alltest = ExamTest.objects.filter(usecomps__contains=','+str(companyid)+',').exclude(nousecomps__contains=','+str(companyid)+',')
|
||||||
print(alltest)
|
allexamtestdetail = ExamTestDetail.objects.filter(examtest__in=alltest,ison=1)
|
||||||
objs = ExamTestDetail.objects.filter(examtest__in=alltest,ison=1).values('user__userid','user__name','user__headimgurl','user__ubelongpart__partname').annotate(totalscore=Sum('score'),totaltook=Sum('took'),testnum=Count('user__userid')).order_by('-totalscore','totaltook')
|
objs = allexamtestdetail.values('user__userid','user__name','user__headimgurl','user__ubelongpart__partname').annotate(totalscore=Sum('score'),totaltook=Sum('took'),testnum=Count('user__userid')).order_by('-totalscore','totaltook')
|
||||||
total = objs.count()
|
total = objs.count()
|
||||||
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'))
|
i['avgscore'] = round(i['totalscore']/i['testnum'],1)
|
||||||
|
orgsCal = allexamtestdetail.filter(score__gt=0).values('user__ubelongpart__partid','user__ubelongpart__partname').annotate(totaltest=Count('user__ubelongpart__partid'),avgscore=Avg('score')).order_by('-totaltest','-avgscore')
|
||||||
|
allattenduser = allexamtestdetail.values_list('user__userid', flat=True)
|
||||||
|
orgsCallist = list(orgsCal)
|
||||||
|
for i in orgsCallist:
|
||||||
|
users = User.objects.filter(ubelongpart__partid=i['user__ubelongpart__partid'])
|
||||||
|
usersattend = users.filter(userid__in=allattenduser)
|
||||||
|
i['totaluser'] = usersattend.count()
|
||||||
|
i['avgscore'] = round(i['avgscore'],1)
|
||||||
with open('ratedata.dat','wb') as f:
|
with open('ratedata.dat','wb') as f:
|
||||||
pickle.dump({'total':total,'rows':objslist,'rows2':list(orgsCal),'updatetime':datetime.now().strftime('%Y-%m-%d %H:%M')},f)
|
pickle.dump({'total':total,'rows':objslist,'rows2':orgsCallist,'updatetime':datetime.now().strftime('%Y-%m-%d %H:%M')},f)
|
||||||
return JsonResponse({"code": 1})
|
return JsonResponse({"code": 1})
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue