Merge branch 'master' of https://e.coding.net/ctcdevteam/safesite
This commit is contained in:
commit
13101997b7
|
@ -7774,7 +7774,7 @@ def checkprojects(req):
|
|||
total = a.count()
|
||||
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")
|
||||
|
||||
|
@ -7783,15 +7783,15 @@ def checkprojects(req):
|
|||
a = Checkjob.objects.filter(usecomp=Partment.objects.get(partid=companyid),taskstate=2,checktask__createuser__userid=userid).exclude(deletemark=0)
|
||||
total = a.count()
|
||||
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")
|
||||
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()
|
||||
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")
|
||||
elif a == 'listallx':
|
||||
|
@ -7799,7 +7799,7 @@ def checkprojects(req):
|
|||
partid=companyid),deletemark=1)
|
||||
total = a.count()
|
||||
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")
|
||||
|
||||
|
@ -7858,6 +7858,59 @@ def checkprojects(req):
|
|||
|
||||
|
||||
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':
|
||||
obj = Checkjob.objects.get(id=req.GET.get('id'))
|
||||
obj.yanshou = datetime.now()
|
||||
|
|
Loading…
Reference in New Issue