更新已完成功能/设备异常抄送

This commit is contained in:
caoqianming 2021-01-10 21:15:36 +08:00
parent 297c8cf966
commit e834c617ef
4 changed files with 57 additions and 27 deletions

View File

@ -230,7 +230,7 @@
if ($("#userindex").attr('userid') == row.submituser__userid || $("#userindex").attr('userid') == row.lecturer__userid) {
url = 'abtrain?trainid=' + row.trainid + '&a=accesstrain'
opendg('评估培训', url)
} else { $.messager.alert('提示', '非填报人不能评估!'); }
} else { $.messager.alert('提示', '非填报人或授课人不能评估!'); }
}
else { $.messager.alert('提示', '该培训已经评估!'); }

View File

@ -1 +1 @@
27_ZMzXL6pksqZTNkvIvgYF-nBi-6821AXB_40FIB0yfBPtcoS5dLtefEygNYYUSYtoKkElSyqpRPulZ02rkOEwK5HZvcGkS8NZdUos3noO8CcI_xnjHAA2XernXtZcd6IYLZowAW2kQECiKiQpPVEfAHAWCL
41_I-HP1hSZv5r3OEvFVNp2NbY1tQzg0fdOizw0Kldq-LhlVIDqECdTwaMM-O62-8s5I4KMbRx1gAhIZhb_eELSlh_LXEIyBdEpfODF_Ax668oSJcBiiOIfn2U3CEj-lNrwBAsaHz7a7LxAkWJDQWRjAIAMSN

View File

@ -1001,7 +1001,12 @@ def addyh(req):
a.yhlx = Dicclass.objects.get(dicid=yhlx)
if yhlb != '':
a.yhlb = Dickey.objects.get(dickeyid=yhlb)
if a.yhdj.dickeyname == '无隐患' or zgms != '':
if a.yhdj.dickeyname == '无隐患':
a.yhzt = 6
a.sybzt = 0
a.save()
return JsonResponse({"code": 1, "trouble": a.troubleid, "yhnum": a.yhnum})
if zgms != '':
# 直接到待复查
a.zghtp = zghtp
a.yhzt = 5
@ -1701,14 +1706,12 @@ def addtrain(req):
plist = req.POST.getlist('trainpart')
ustr = req.POST.get('participant')
ulist = ustr.split(',')
b = []
m = []
for i in ulist:
x = User.objects.get(userid=i)
m = Trainuser(train=a, participant=x)
m.save()
b.append(x.openid)
for i in plist:
a.trainpart.add(Partment.objects.get(partid=i))
m.append(Trainuser(train=a, participant=User.objects.get(userid=i)))
Trainuser.objects.bulk_create(m)
a.trainpart.add(*plist)
b = list(User.objects.filter(userid__in=ulist).values_list('openid', flat=True))
postdict = {
'touser': '',
'template_id': 'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
@ -1756,14 +1759,12 @@ def adddrill(req):
plist = req.POST.getlist('drillpart')
ustr = req.POST.get('participant')
ulist = ustr.split(',')
b = []
m = []
for i in ulist:
x = User.objects.get(userid=i)
m = Drilluser(drillid=a, participant=x)
m.save()
b.append(x.openid)
for i in plist:
a.drillpart.add(Partment.objects.get(partid=i))
m.append(Drilluser(drillid=a, participant=User.objects.get(userid=i)))
Drilluser.objects.bulk_create(m)
a.drillpart.add(*plist)
b = list(User.objects.filter(userid__in=ulist).values_list('openid', flat=True))
postdict = {
'touser': 'oPGqkweX75QtLmgehUN-ipR4hcyc',
'template_id': 'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
@ -5089,12 +5090,12 @@ def apinotice(req):
obj.isgg = 0
obj.save()
ulist = data['tousers'].split(',')
b = []
m = []
for i in ulist:
x = User.objects.get(userid=i)
m = Noticeto(noticeid=obj, receiver=x)
m.save()
b.append(x.openid)
m.append(Noticeto(noticeid=obj, receiver=x))
Noticeto.objects.bulk_create(m)
b = list(User.objects.filter(userid__in=ulist).values_list('openid', flat=True))
postdict = {
'touser': '',
'template_id': 'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
@ -6262,11 +6263,12 @@ def apiexamtest(req):
obj.save()
if 'participant' in data and data['participant']:
ksry = data['participant'].split(',')
b = []
m = []
for i in ksry:
uobj = User.objects.get(userid=i)
ExamTestDetail.objects.create(examtest=obj, user=uobj, remainnum = obj.testnum)
b.append(uobj.openid)
m.append(ExamTestDetail(examtest=obj, user=uobj, remainnum = obj.testnum))
ExamTestDetail.objects.bulk_create(m)
b = list(User.objects.filter(userid__in=ksry).values_list('openid', flat=True))
postdict = {
'touser': '',
'template_id': 'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
@ -6359,11 +6361,12 @@ def apiexamtest(req):
obj.save()
if 'participant' in data and data['participant']:
ksry = data['participant'].split(',')
b = []
m = []
for i in ksry:
uobj = User.objects.get(userid=i)
ExamTestDetail.objects.create(examtest=obj, user=uobj, remainnum = obj.testnum)
b.append(uobj.openid)
m.append(ExamTestDetail(examtest=obj, user=uobj, remainnum = obj.testnum))
ExamTestDetail.objects.bulk_create(m)
b = list(User.objects.filter(userid__in=ksry).values_list('openid', flat=True))
postdict = {
'touser': '',
'template_id': 'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
@ -7070,6 +7073,7 @@ def apiinspect(req):
if 'trouble' in data:
if data['trouble']:
a.trouble = Trouble.objects.get(troubleid=data['trouble'])
x = Equipment.objects.get(id=equipment)
a.equipment = x
a.state = state
@ -7078,6 +7082,32 @@ def apiinspect(req):
a.usecomp = Partment.objects.get(partid=companyid)
a.user = User.objects.get(userid=userid)
a.save()
if 'csry' in data:
ulist = data['csry'].split(',')
ulist_o = list(User.objects.filter(userid__in=ulist).values_list('openid', flat=True))
postdict = {
'touser': '',
'template_id': 'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
'miniprogram': {'appid': 'wx5c39b569f01c27db'},
'data': {
'first': {
'value': a.equipment.name + '-设备存在异常处理中:'
},
'keyword1': {
'value': ""
},
'keyword2': {
'value': a.creattime.strftime("%Y-%m-%d %H:%M")
},
'keyword3': {
'value': ''
},
'remark': {
'value': '请及时关注进程'
}
}
}
send_wechatmsgs.delay(postdict, ulist_o)
return JsonResponse({"code": 1,"inspect":a.pk})
elif a == 'del':
id = req.GET.get('id')

Binary file not shown.