解决作业确认以及missimg的bug
This commit is contained in:
parent
3b5c67b5e5
commit
bd6787da62
|
@ -4133,7 +4133,7 @@ def apimiss(req):
|
|||
obj.lesson = data['lesson']
|
||||
obj.missnum = 'WS'+time.strftime('%Y%m%d%H%M%S')
|
||||
obj.usecomp = Partment.objects.get(partid=companyid)
|
||||
if 'missimg' in data:
|
||||
if 'missimg' in data and data['missimg']:
|
||||
obj.missimg = '?'.join(data['missimg'])
|
||||
obj.save()
|
||||
yjjs_ws.delay(companyid)
|
||||
|
@ -5283,6 +5283,20 @@ def apitool(req):
|
|||
# Questioncat.objects.filter(usecomp__partname='广安厂').update(parent=None, link=',', deletemark=1)
|
||||
# print(Questioncat.objects.filter(name='冬季四防安全生产知识').values('usecomp__partname'))
|
||||
return JsonResponse({"code":1})
|
||||
elif a == 'check_part':
|
||||
objs = []
|
||||
for i in Partment.objects.exclude(parentid=None, deletemark=1).values('partid', 'parentid', 'partlink'):
|
||||
if str(i['parentid']) not in i['partlink']:
|
||||
print(i)
|
||||
parent = Partment.objects.get(partid=i['parentid'])
|
||||
partlink = parent.partlink + str(parent.partid) + ','
|
||||
obj = Partment.objects.get(partid=i['partid'])
|
||||
obj.partlink = partlink
|
||||
obj.save()
|
||||
print("调整后")
|
||||
print(partlink)
|
||||
|
||||
return JsonResponse({"code":1})
|
||||
|
||||
|
||||
|
||||
|
@ -5511,7 +5525,7 @@ def apinotice(req):
|
|||
@transaction.atomic
|
||||
def apioperation(req):
|
||||
a = req.GET.get('a')
|
||||
logger.info(req.get_full_path())
|
||||
# logger.info(req.get_full_path())
|
||||
userid = req.session['userid']
|
||||
if a == 'add':
|
||||
userid = req.session['userid']
|
||||
|
@ -5922,7 +5936,7 @@ def apioperation(req):
|
|||
tolist = list(User.objects.filter(
|
||||
userid__in=sprs).values_list('openid', flat=True))
|
||||
send_wechatmsgs.delay(postdict, tolist)
|
||||
return JsonResponse({"code": 1})
|
||||
return JsonResponse({"code": 1})
|
||||
elif a == 'spzy':
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
zyid = data['zyid']
|
||||
|
|
Loading…
Reference in New Issue