检查任务
This commit is contained in:
parent
08bd2a111c
commit
b4c83999e3
|
@ -7764,7 +7764,7 @@ def checkprojects(req):
|
||||||
total = a.count()
|
total = a.count()
|
||||||
startnum, endnum = fenye(req)
|
startnum, endnum = fenye(req)
|
||||||
|
|
||||||
a = a[startnum:endnum].values('id','checktask__checktaskname','jobstate','starttime','endtime','yanshou','checkquestion','zguser__username','zgtime','checktask__checktype__checktitle','checkname__username', 'taskstate','checktask__checktime','createuser__username','createdate')
|
a = a.order_by('-starttime')[startnum:endnum].values('id','checktask__checktaskname','jobstate','starttime','endtime','yanshou','checkquestion','zguser__username','zgtime','checktask__checktype__checktitle','checkname__username', 'taskstate','checktask__checktime','createuser__username','createdate')
|
||||||
|
|
||||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||||
|
|
||||||
|
@ -7773,15 +7773,15 @@ def checkprojects(req):
|
||||||
a = Checkjob.objects.filter(usecomp=Partment.objects.get(partid=companyid),taskstate=2,checktask__createuser__userid=userid).exclude(deletemark=0)
|
a = Checkjob.objects.filter(usecomp=Partment.objects.get(partid=companyid),taskstate=2,checktask__createuser__userid=userid).exclude(deletemark=0)
|
||||||
total = a.count()
|
total = a.count()
|
||||||
startnum, endnum = fenye(req)
|
startnum, endnum = fenye(req)
|
||||||
a = a[startnum:endnum].values('id','checktask__checktaskname','jobstate','starttime','endtime','yanshou','checkquestion','zguser__username','zgtime','checktask__checktype__checktitle','checkname__username', 'taskstate','checktask__checktime','createuser__username','createdate')
|
a = a.order_by('-starttime')[startnum:endnum].values('id','checktask__checktaskname','jobstate','starttime','endtime','yanshou','checkquestion','zguser__username','zgtime','checktask__checktype__checktitle','checkname__username', 'taskstate','checktask__checktime','createuser__username','createdate')
|
||||||
|
|
||||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||||
elif a == 'listself':
|
elif a == 'listself':
|
||||||
a = Checkjob.objects.filter(usecomp=Partment.objects.get(partid=companyid),checkname__userid=userid,deletemark=1)
|
a = Checkjob.objects.filter(usecomp=Partment.objects.get(partid=companyid),taskstate=1,checkname__userid=userid,deletemark=1)
|
||||||
total = a.count()
|
total = a.count()
|
||||||
startnum, endnum = fenye(req)
|
startnum, endnum = fenye(req)
|
||||||
|
|
||||||
a = a[startnum:endnum].values('id','checktask__checktaskname','jobstate','starttime','endtime','yanshou','checkquestion','zguser__username','zgtime','checktask__checktype__checktitle','checkname__username', 'taskstate','checktask__checktime','createuser__username','createdate')
|
a = a.order_by('-starttime')[startnum:endnum].values('id','checktask__checktaskname','jobstate','starttime','endtime','yanshou','checkquestion','zguser__username','zgtime','checktask__checktype__checktitle','checkname__username', 'taskstate','checktask__checktime','createuser__username','createdate')
|
||||||
|
|
||||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||||
elif a == 'listallx':
|
elif a == 'listallx':
|
||||||
|
@ -7789,7 +7789,7 @@ def checkprojects(req):
|
||||||
partid=companyid),deletemark=1)
|
partid=companyid),deletemark=1)
|
||||||
total = a.count()
|
total = a.count()
|
||||||
startnum, endnum = fenye(req)
|
startnum, endnum = fenye(req)
|
||||||
a = a[startnum:endnum].values('id','checktask__checktaskname','jobstate','starttime','endtime','yanshou','checkquestion','zguser__username','zgtime','checktask__checktype__checktitle','checkname__username', 'taskstate','checktask__checktime','createuser__username','createdate')
|
a = a.order_by('-starttime')[startnum:endnum].values('id','checktask__checktaskname','jobstate','starttime','endtime','yanshou','checkquestion','zguser__username','zgtime','checktask__checktype__checktitle','checkname__username', 'taskstate','checktask__checktime','createuser__username','createdate')
|
||||||
|
|
||||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||||
|
|
||||||
|
@ -7848,6 +7848,59 @@ def checkprojects(req):
|
||||||
|
|
||||||
|
|
||||||
return JsonResponse({'code': 1})
|
return JsonResponse({'code': 1})
|
||||||
|
elif a == 'addjobwx':
|
||||||
|
obj = Checkjob.objects.get(id=req.GET.get('jobid'))
|
||||||
|
obj.checkquestion = req.POST.get('checkquestion')
|
||||||
|
obj.zgjg = req.POST.get('zgjg')
|
||||||
|
obj.taskstate = req.POST.get('taskstate')
|
||||||
|
obj.createuser = User.objects.get(userid=userid)
|
||||||
|
if req.POST.get('content')!='undefined':
|
||||||
|
obj.content=req.POST.get('content')
|
||||||
|
|
||||||
|
s=[]
|
||||||
|
if req.POST.get('participant')!='undefined':
|
||||||
|
list = req.POST.get('participant').split(',')
|
||||||
|
for i in list:
|
||||||
|
x = User.objects.get(userid=i)
|
||||||
|
obj.pmpeople.add(x)
|
||||||
|
s.append(x.openid)
|
||||||
|
postdict = {
|
||||||
|
'touser': '',
|
||||||
|
'template_id': 'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||||
|
"miniprogram": {"appid": "wx5c39b569f01c27db"},
|
||||||
|
'data': {
|
||||||
|
'first': {
|
||||||
|
'value': '处罚通知:'
|
||||||
|
},
|
||||||
|
'keyword1': {
|
||||||
|
'value':'处罚内容:'+ obj.content
|
||||||
|
},
|
||||||
|
'keyword2': {
|
||||||
|
'value': '通知时间:'+str(obj.createdate)
|
||||||
|
},
|
||||||
|
'keyword3': {
|
||||||
|
'value': '处罚人:'+obj.createuser.name
|
||||||
|
},
|
||||||
|
'remark': {
|
||||||
|
'value': '请及时查看阅读'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
send_wechatmsgs.delay(postdict, s)
|
||||||
|
obj.save()
|
||||||
|
objs = Checktask.objects.get(id=obj.checktask.id)
|
||||||
|
if objs.zxstate==2:
|
||||||
|
for i in objs.checkname.all():
|
||||||
|
user = User.objects.get(userid=i.userid)
|
||||||
|
if user!=User.objects.get(userid=userid):
|
||||||
|
jobss = Checkjob.objects.get(checkname=user,checktask=objs)
|
||||||
|
jobss.taskstate=3
|
||||||
|
jobss.save()
|
||||||
|
|
||||||
|
|
||||||
|
return JsonResponse({'code': 1})
|
||||||
|
|
||||||
elif a == 'yanshou':
|
elif a == 'yanshou':
|
||||||
obj = Checkjob.objects.get(id=req.GET.get('id'))
|
obj = Checkjob.objects.get(id=req.GET.get('id'))
|
||||||
obj.yanshou = datetime.now()
|
obj.yanshou = datetime.now()
|
||||||
|
|
Loading…
Reference in New Issue