Merge branch 'master' of https://e.coding.net/ctcdevteam/safesite
This commit is contained in:
commit
3d446a34dc
|
@ -4836,6 +4836,12 @@ def apitool(req):
|
|||
i.took = (i.endtime-i.starttime).total_seconds()
|
||||
i.save()
|
||||
return JsonResponse({"code":1})
|
||||
elif a == 'correct_map':
|
||||
for i in Partment.objects.filter(iscompany=1):
|
||||
obj,created = Map.objects.get_or_create(usecomp=i,defaults={'name':'默认地图','pic':'/static/safesite/mystatic/images/snc.jpg','usecomp':i})
|
||||
if created:
|
||||
print(i.partname+'建立默认地图')
|
||||
return JsonResponse({"code":1})
|
||||
elif a == 'panjuan':
|
||||
test = ExamTest.objects.get(id=req.GET.get('test'))
|
||||
answers = ExamPaperDetail.objects.filter(exampaper=test.exampaper).values('id', 'question__right')
|
||||
|
@ -5527,16 +5533,20 @@ def apioperation(req):
|
|||
elif a == 'gbzy': # 关闭作业
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
# print(data)
|
||||
user = User.objects.get(userid=userid)
|
||||
zyid = data['zyid']
|
||||
obj = Operation.objects.get(zyid=zyid)
|
||||
if 'zyimg2' in data:
|
||||
zyimg2 = data['zyimg2']
|
||||
obj.zyimg2 = '?'.join(zyimg2)
|
||||
obj.zyzt['zyzt'] = '已关闭'
|
||||
obj.zyzt['jdmc'] = ''
|
||||
obj.todouser = None
|
||||
obj.todousers = None
|
||||
obj.save()
|
||||
if obj.zyfzr == user:
|
||||
if 'zyimg2' in data:
|
||||
zyimg2 = data['zyimg2']
|
||||
obj.zyimg2 = '?'.join(zyimg2)
|
||||
obj.zyzt['zyzt'] = '已关闭'
|
||||
obj.zyzt['jdmc'] = ''
|
||||
obj.todouser = None
|
||||
obj.todousers = None
|
||||
obj.save()
|
||||
else:
|
||||
return JsonResponse({"code": 0,"msg":'非作业负责人不可关闭'})
|
||||
return JsonResponse({"code": 1})
|
||||
elif a == 'todonum':
|
||||
userid = req.session['userid']
|
||||
|
|
Loading…
Reference in New Issue