公司活动总排名
This commit is contained in:
parent
7131de4384
commit
b96576aa79
|
@ -6726,35 +6726,35 @@ def apiexamtestrate(req):
|
||||||
i['avgscore'] = round(i['avgscore'],1)
|
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':orgsCallist,'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)
|
||||||
from openpyxl import Workbook, load_workbook
|
# from openpyxl import Workbook, load_workbook
|
||||||
wb = load_workbook('e:/个人总排名.xlsx')
|
# wb = load_workbook('e:/个人总排名.xlsx')
|
||||||
sheet = wb.active
|
# sheet = wb.active
|
||||||
for i in objslist:
|
# for i in objslist:
|
||||||
num = str(objslist.index(i)+3)
|
# num = str(objslist.index(i)+3)
|
||||||
sheet['a'+num] = i['user__name']
|
# sheet['a'+num] = i['user__name']
|
||||||
sheet['b'+num] = i['user__ubelongpart__partname']
|
# sheet['b'+num] = i['user__ubelongpart__partname']
|
||||||
sheet['c'+num] = i['testnum']
|
# sheet['c'+num] = i['testnum']
|
||||||
sheet['d'+num] = i['totalscore']
|
# sheet['d'+num] = i['totalscore']
|
||||||
sheet['e'+num] = convertseconds(i['totaltook'])
|
# sheet['e'+num] = convertseconds(i['totaltook'])
|
||||||
nowtime = datetime.now().strftime('%Y%m%d')
|
# nowtime = datetime.now().strftime('%Y%m%d')
|
||||||
sheet['b1'] = nowtime
|
# sheet['b1'] = nowtime
|
||||||
filename = '个人总排名' + nowtime
|
# filename = '个人总排名' + nowtime
|
||||||
filepath = 'e:/' + filename +'.xlsx'
|
# filepath = 'e:/' + filename +'.xlsx'
|
||||||
wb.save(filepath)
|
# wb.save(filepath)
|
||||||
|
|
||||||
wb2 = load_workbook('e:/机构总排名.xlsx')
|
# wb2 = load_workbook('e:/机构总排名.xlsx')
|
||||||
sheet = wb2.active
|
# sheet = wb2.active
|
||||||
for i in orgsCallist:
|
# for i in orgsCallist:
|
||||||
num = str(orgsCallist.index(i)+3)
|
# num = str(orgsCallist.index(i)+3)
|
||||||
sheet['a'+num] = i['user__ubelongpart__partname']
|
# sheet['a'+num] = i['user__ubelongpart__partname']
|
||||||
sheet['b'+num] = i['totaluser']
|
# sheet['b'+num] = i['totaluser']
|
||||||
sheet['c'+num] = i['totaltest']
|
# sheet['c'+num] = i['totaltest']
|
||||||
sheet['d'+num] = i['avgscore']
|
# sheet['d'+num] = i['avgscore']
|
||||||
nowtime = datetime.now().strftime('%Y%m%d')
|
# nowtime = datetime.now().strftime('%Y%m%d')
|
||||||
sheet['b1'] = nowtime
|
# sheet['b1'] = nowtime
|
||||||
filename = '机构总排名' + nowtime
|
# filename = '机构总排名' + nowtime
|
||||||
filepath = 'e:/' + filename +'.xlsx'
|
# filepath = 'e:/' + filename +'.xlsx'
|
||||||
wb2.save(filepath)
|
# wb2.save(filepath)
|
||||||
|
|
||||||
return JsonResponse({"code": 1})
|
return JsonResponse({"code": 1})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue