operation check complete
This commit is contained in:
parent
b388dce777
commit
0848977438
|
|
@ -29,7 +29,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-bottom:5px;">
|
<div style="margin-bottom:5px;">
|
||||||
<input id="starttime" editable="false" name="starttime" class="easyui-datetimebox" style="width:90%"
|
<input id="starttime" editable="false" name="starttime" 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 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%"
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-bottom:5px;">
|
<div style="margin-bottom:5px;">
|
||||||
<input id="starttime" editable="false" name="starttime" class="easyui-datetimebox" style="width:90%"
|
<input id="starttime" editable="false" name="starttime" 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 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%"
|
||||||
|
|
|
||||||
|
|
@ -588,44 +588,50 @@ def getsprs(userid,ubp):
|
||||||
return User.objects.get(ubelongpart=currentpart,issuper=1)
|
return User.objects.get(ubelongpart=currentpart,issuper=1)
|
||||||
return a
|
return a
|
||||||
|
|
||||||
def getsprs_ubp(userid,ubp):#主管和被授权人员
|
def getsprs_ubp(userid,ubp):#主管
|
||||||
|
a=ubp
|
||||||
|
if a.bmzg !=',':
|
||||||
|
zgstr = a.bmzg
|
||||||
|
zglist = zgstr.split(',')
|
||||||
|
zglist = list(map(int, list(filter(None, zglist))))
|
||||||
|
if userid in zglist:
|
||||||
|
return [userid]
|
||||||
|
else:
|
||||||
|
return zglist
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
def getsprs2(userid,ubp):
|
||||||
|
currentpart=ubp
|
||||||
|
a=getsprs_ubp2(userid,currentpart)
|
||||||
|
while a==False:
|
||||||
|
currentpart=currentpart.parentid #已找不到上级部门
|
||||||
|
if currentpart:
|
||||||
|
a=getsprs_ubp2(userid,currentpart)
|
||||||
|
else:
|
||||||
|
return User.objects.get(ubelongpart=currentpart,issuper=1)
|
||||||
|
return a
|
||||||
|
|
||||||
|
def getsprs_ubp2(userid,ubp):#主管和被授权人员
|
||||||
a=ubp
|
a=ubp
|
||||||
# if a.aqy !=',':
|
|
||||||
# aqystr = a.aqy
|
|
||||||
# aqylist = aqystr.split(',')
|
|
||||||
# aqylist = list(map(int, list(filter(None, aqylist))))
|
|
||||||
# if userid in aqylist:
|
|
||||||
# return [userid]
|
|
||||||
# else:
|
|
||||||
# if ',' + str(userid) + ',' in a.bmzg:
|
|
||||||
# return [userid]
|
|
||||||
# else:
|
|
||||||
# return aqylist
|
|
||||||
if a.bmzg !=',':
|
if a.bmzg !=',':
|
||||||
zgstr = a.bmzg
|
zgstr = a.bmzg
|
||||||
zglist = zgstr.split(',')
|
zglist = zgstr.split(',')
|
||||||
zglist = list(map(int, list(filter(None, zglist))))
|
zglist = list(map(int, list(filter(None, zglist))))
|
||||||
bsqstr = a.bsq
|
bsqstr = a.bsq
|
||||||
bsqlist = list(map(int, list(filter(None, bsqstr.split(',')))))
|
bsqlist = list(map(int, list(filter(None, bsqstr.split(',')))))
|
||||||
if userid in zglist:
|
# if userid in zglist:
|
||||||
return [userid]
|
# return [userid]
|
||||||
elif userid in bsqlist:
|
# elif userid in bsqlist:
|
||||||
zglist.append(userid)
|
# zglist.append(userid)
|
||||||
return zglist
|
# return zglist
|
||||||
else:
|
# else:
|
||||||
return zglist
|
# return zglist
|
||||||
|
zglist.extend(bsqlist)
|
||||||
|
return list(set(zglist))
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# def getsprs_ubp2(userid,ubp):
|
|
||||||
# a=ubp
|
|
||||||
# if a.aqy !=',' or a.bmzg !=',':
|
|
||||||
# allstr = a.aqy + a.bmzg
|
|
||||||
# alllist = allstr.split(',')
|
|
||||||
# alist = list(map(int, list(filter(None, alllist))))
|
|
||||||
# return alist
|
|
||||||
# else:
|
|
||||||
# return False
|
|
||||||
|
|
||||||
|
|
||||||
def menutree(req):
|
def menutree(req):
|
||||||
|
|
@ -4172,6 +4178,21 @@ def apitool(req):
|
||||||
i.zyzt['jdmc'] =''
|
i.zyzt['jdmc'] =''
|
||||||
i.save()
|
i.save()
|
||||||
return JsonResponse({"code":1})
|
return JsonResponse({"code":1})
|
||||||
|
elif a == 'correct_examtest':
|
||||||
|
for i in ExamTest.objects.all():
|
||||||
|
if i.starttime:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
print(i.id,'start')
|
||||||
|
i.starttime = i.createtime
|
||||||
|
i.save()
|
||||||
|
if i.endtime:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
print(i.id,'end')
|
||||||
|
i.endtime = i.createtime + timedelta(days=1)
|
||||||
|
i.save()
|
||||||
|
return JsonResponse({"code":1})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -4387,11 +4408,18 @@ def apioperation(req):
|
||||||
obj.zyimg = '?'.join(data['zyimg'])
|
obj.zyimg = '?'.join(data['zyimg'])
|
||||||
obj.fxcs = '?'.join(map(str,data['fxcs']))
|
obj.fxcs = '?'.join(map(str,data['fxcs']))
|
||||||
obj.zyzt = {'zyzt':'确认中','index':0}
|
obj.zyzt = {'zyzt':'确认中','index':0}
|
||||||
obj.save()
|
|
||||||
splc = []
|
splc = []
|
||||||
|
if 'spr1s' in data:
|
||||||
|
spr1s = [data['spr1s']]
|
||||||
|
else:
|
||||||
|
spr1s = getsprs(userid,obj.zybm)
|
||||||
|
if 'spr2s' in data:
|
||||||
|
spr2s = [data['spr2s']]
|
||||||
|
else:
|
||||||
|
spr2s = getsprs(userid,obj.sdbm)
|
||||||
splc.append({'jdmc':'作业负责人审批','sprs':[userid]})
|
splc.append({'jdmc':'作业负责人审批','sprs':[userid]})
|
||||||
splc.append({'jdmc':'作业部门审批','sprs':getsprs(userid,obj.zybm)})
|
splc.append({'jdmc':'作业部门审批','sprs':spr1s})
|
||||||
splc.append({'jdmc':'属地部门审批','sprs':getsprs(userid,obj.sdbm)})
|
splc.append({'jdmc':'属地部门审批','sprs':spr2s})
|
||||||
for i in Operationspjd.objects.filter(zylx=obj.zylx,usecomp=Partment.objects.get(partid=getcompany(userid))).order_by('id'):
|
for i in Operationspjd.objects.filter(zylx=obj.zylx,usecomp=Partment.objects.get(partid=getcompany(userid))).order_by('id'):
|
||||||
splc.append({'jdmc':i.jdmc,'sprs':i.sprs})
|
splc.append({'jdmc':i.jdmc,'sprs':i.sprs})
|
||||||
obj.zyzt['splc']=splc
|
obj.zyzt['splc']=splc
|
||||||
|
|
@ -4401,7 +4429,7 @@ def apioperation(req):
|
||||||
for i in data['zyry']:
|
for i in data['zyry']:
|
||||||
x=User.objects.get(userid=i)
|
x=User.objects.get(userid=i)
|
||||||
if int(userid)==int(i):#申请人包含作业人直接确认
|
if int(userid)==int(i):#申请人包含作业人直接确认
|
||||||
m = Operzyry.objects.create(oper=obj,operzyry=x,checked=1)
|
Operzyry.objects.create(oper=obj,operzyry=x,checked=1)
|
||||||
if Operzyry.objects.filter(oper=obj,checked=0).exists():
|
if Operzyry.objects.filter(oper=obj,checked=0).exists():
|
||||||
pass
|
pass
|
||||||
else:#工作人员全部确认
|
else:#工作人员全部确认
|
||||||
|
|
@ -4443,9 +4471,8 @@ def apioperation(req):
|
||||||
send_wechatmsgs.delay(postdict,tolist)
|
send_wechatmsgs.delay(postdict,tolist)
|
||||||
return JsonResponse({"code":1})
|
return JsonResponse({"code":1})
|
||||||
else:
|
else:
|
||||||
m = Operzyry.objects.create(oper=obj,operzyry=x)
|
Operzyry.objects.create(oper=obj,operzyry=x)
|
||||||
m.save()
|
b.append(x.openid)
|
||||||
b.append(x.openid)
|
|
||||||
|
|
||||||
postdict={
|
postdict={
|
||||||
'touser':'',
|
'touser':'',
|
||||||
|
|
@ -4745,6 +4772,14 @@ def apioperation(req):
|
||||||
return JsonResponse({"code":1})
|
return JsonResponse({"code":1})
|
||||||
else:
|
else:
|
||||||
return JsonResponse({"code":0})
|
return JsonResponse({"code":0})
|
||||||
|
elif a == 'getspr12':
|
||||||
|
zybm = User.objects.get(userid=userid).ubelongpart#作业部门
|
||||||
|
sdbm = Partment.objects.get(partid=json.loads(req.body.decode('utf-8'))['sdbm'])
|
||||||
|
spr1 = getsprs2(userid,zybm)
|
||||||
|
spr2 = getsprs2(userid,sdbm)
|
||||||
|
spr1Array = User.objects.filter(userid__in=spr1).annotate(value=F('userid'),text=F('name')).values('value','text')
|
||||||
|
spr2Array = User.objects.filter(userid__in=spr2).annotate(value=F('userid'),text=F('name')).values('value','text')
|
||||||
|
return JsonResponse({"code":1,"data":{'spr1Array':list(spr1Array),'spr2Array':list(spr2Array)}})
|
||||||
|
|
||||||
|
|
||||||
def apioperationsetting(req):
|
def apioperationsetting(req):
|
||||||
|
|
@ -5248,10 +5283,13 @@ def apiexamtestdetail(req):
|
||||||
startnum,endnum=fenye(req)
|
startnum,endnum=fenye(req)
|
||||||
a = a[startnum:endnum].values('id','examtest__id','examtest__name','examtest__starttime','examtest__endtime','examtest__passscore','examtest__state','examtest__duration')
|
a = a[startnum:endnum].values('id','examtest__id','examtest__name','examtest__starttime','examtest__endtime','examtest__passscore','examtest__state','examtest__duration')
|
||||||
for i in a:
|
for i in a:
|
||||||
if i['examtest__endtime']>datetime.now():
|
if i['examtest__endtime']:
|
||||||
i['isActive'] = True
|
if i['examtest__endtime']>datetime.now():
|
||||||
|
i['isActive'] = True
|
||||||
|
else:
|
||||||
|
i['isActive'] = False
|
||||||
else:
|
else:
|
||||||
i['isActive'] = False
|
i['isActive'] = True
|
||||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
return HttpResponse(transjson(total,a),content_type="application/json")
|
||||||
elif a=='listyk':
|
elif a=='listyk':
|
||||||
a = ExamTestDetail.objects
|
a = ExamTestDetail.objects
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue