修改培训提醒bug;证书更新
This commit is contained in:
parent
1c597970ff
commit
1b430f9d7a
|
@ -19,7 +19,8 @@ from django.views.generic import View,TemplateView,CreateView,UpdateView
|
||||||
from django.contrib.auth.hashers import make_password, check_password
|
from django.contrib.auth.hashers import make_password, check_password
|
||||||
from django.core.serializers.json import DjangoJSONEncoder
|
from django.core.serializers.json import DjangoJSONEncoder
|
||||||
from .forms import CompanyForm
|
from .forms import CompanyForm
|
||||||
|
from uuid import UUID
|
||||||
|
import decimal
|
||||||
|
|
||||||
def fenye(request):
|
def fenye(request):
|
||||||
start = request.GET.get('offset',None)
|
start = request.GET.get('offset',None)
|
||||||
|
|
|
@ -18,7 +18,7 @@ $.ajaxSetup({
|
||||||
});
|
});
|
||||||
}else if(jsonData.code == 0){
|
}else if(jsonData.code == 0){
|
||||||
//其他的异常情况,给个提示。
|
//其他的异常情况,给个提示。
|
||||||
$.messager.alert('错误','操作失败!','error');
|
// $.messager.alert('错误','操作失败!','error');
|
||||||
}else{
|
}else{
|
||||||
//正常情况就不统一处理了
|
//正常情况就不统一处理了
|
||||||
}
|
}
|
||||||
|
|
|
@ -434,8 +434,8 @@ def updateTzzs():
|
||||||
updated_values['zszt'] = guoqi(i['应复审日期'])
|
updated_values['zszt'] = guoqi(i['应复审日期'])
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
obj, created = Socertificate.objects.update_or_create(
|
# obj, created = Socertificate.objects.update_or_create(
|
||||||
cardnum=x.cardnum, czxm=i['操作项目'], defaults=updated_values)
|
# cardnum=x.cardnum, czxm=i['操作项目'], defaults=updated_values)
|
||||||
try:
|
try:
|
||||||
obj = Socertificate.objects.get(cardnum=x.cardnum, czxm=i['操作项目'])
|
obj = Socertificate.objects.get(cardnum=x.cardnum, czxm=i['操作项目'])
|
||||||
if obj.yxqjssj.strftime('%Y-%m-%d')<i['有效期结束时间']:
|
if obj.yxqjssj.strftime('%Y-%m-%d')<i['有效期结束时间']:
|
||||||
|
@ -452,6 +452,7 @@ def updateTzzs():
|
||||||
except:
|
except:
|
||||||
obj = Socertificate(**updated_values)
|
obj = Socertificate(**updated_values)
|
||||||
obj.save()
|
obj.save()
|
||||||
|
print(obj.realname, obj.yfsrq)
|
||||||
|
|
||||||
def guoqi(x):
|
def guoqi(x):
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
|
@ -465,7 +466,8 @@ def guoqi(x):
|
||||||
|
|
||||||
@shared_task
|
@shared_task
|
||||||
def updateAqzs():
|
def updateAqzs():
|
||||||
for x in Safecert.objects.all():
|
queryset = Safecert.objects.filter(yfsrq__lte = datetime.datetime.now()+datetime.timedelta(days=200))
|
||||||
|
for x in queryset:
|
||||||
data = getAqzs(x.cardnum,x.realname)
|
data = getAqzs(x.cardnum,x.realname)
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
if data:
|
if data:
|
||||||
|
@ -486,8 +488,8 @@ def updateAqzs():
|
||||||
updated_values['zszt'] = guoqi(i['有效期结束时间'])
|
updated_values['zszt'] = guoqi(i['有效期结束时间'])
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
obj, created = Safecert.objects.update_or_create(
|
# obj, created = Safecert.objects.update_or_create(
|
||||||
cardnum=x.cardnum, zglx=i['资格类型'], dwlx=i['单位类型'], defaults=updated_values)
|
# cardnum=x.cardnum, zglx=i['资格类型'], dwlx=i['单位类型'], defaults=updated_values)
|
||||||
try:
|
try:
|
||||||
obj = Safecert.objects.get(cardnum=x.cardnum, zglx=i['资格类型'], dwlx=i['单位类型'])
|
obj = Safecert.objects.get(cardnum=x.cardnum, zglx=i['资格类型'], dwlx=i['单位类型'])
|
||||||
if obj.yxqjssj.strftime('%Y-%m-%d')<i['有效期结束时间']:
|
if obj.yxqjssj.strftime('%Y-%m-%d')<i['有效期结束时间']:
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
{ field: 'id', title: 'ID', hidden: true },
|
{ field: 'id', title: 'ID', hidden: true },
|
||||||
{ field: 'realname', title: '姓名', width: 80 },
|
{ field: 'realname', title: '姓名', width: 80 },
|
||||||
{ field: 'gender', title: '性别', width: 40 },
|
{ field: 'gender', title: '性别', width: 40 },
|
||||||
|
{ field: 'cardnum', title: '身份证号', width: 100 },
|
||||||
{ field: 'zglx', title: '资格类型', width: 100 },
|
{ field: 'zglx', title: '资格类型', width: 100 },
|
||||||
{ field: 'fzjg', title: '发证机关', width: 100 },
|
{ field: 'fzjg', title: '发证机关', width: 100 },
|
||||||
{ field: 'dwlx', title: '单位类型', width: 100 ,sortable:true},
|
{ field: 'dwlx', title: '单位类型', width: 100 ,sortable:true},
|
||||||
|
|
|
@ -81,6 +81,7 @@
|
||||||
{ field: 'id', title: 'ID', hidden: true },
|
{ field: 'id', title: 'ID', hidden: true },
|
||||||
{ field: 'realname', title: '姓名', width: 80 },
|
{ field: 'realname', title: '姓名', width: 80 },
|
||||||
{ field: 'gender', title: '性别', width: 40 },
|
{ field: 'gender', title: '性别', width: 40 },
|
||||||
|
{ field: 'cardnum', title: '身份证号', width: 100 },
|
||||||
{ field: 'zylb', title: '作业类别', width: 100 },
|
{ field: 'zylb', title: '作业类别', width: 100 },
|
||||||
{ field: 'fzjg', title: '发证机关', width: 100 },
|
{ field: 'fzjg', title: '发证机关', width: 100 },
|
||||||
{ field: 'czxm', title: '操作项目', width: 100 ,sortable:true},
|
{ field: 'czxm', title: '操作项目', width: 100 ,sortable:true},
|
||||||
|
|
|
@ -3108,7 +3108,7 @@ def pxhandle(req):
|
||||||
userid = req.session['userid']
|
userid = req.session['userid']
|
||||||
companyid = getcompany(userid)
|
companyid = getcompany(userid)
|
||||||
dqdnum = Trainuser.objects.filter(participant=User.objects.get(
|
dqdnum = Trainuser.objects.filter(participant=User.objects.get(
|
||||||
userid=userid), checked=0, train__deletemark=1).count()
|
userid=userid), checked=0, train__deletemark=1, train__state=1).count()
|
||||||
return JsonResponse({'code': 1, 'dqdnum': dqdnum})
|
return JsonResponse({'code': 1, 'dqdnum': dqdnum})
|
||||||
elif req.GET.get('a') == 'detail':
|
elif req.GET.get('a') == 'detail':
|
||||||
trainid = req.GET.get('trainid')
|
trainid = req.GET.get('trainid')
|
||||||
|
@ -4047,7 +4047,7 @@ def apisocert(req):
|
||||||
if req.GET.get('sort'):
|
if req.GET.get('sort'):
|
||||||
a = a.order_by(req.GET.get('sort'))
|
a = a.order_by(req.GET.get('sort'))
|
||||||
a = a[startnum:endnum].values('id', 'realname', 'gender', 'zylb', 'czxm',
|
a = a[startnum:endnum].values('id', 'realname', 'gender', 'zylb', 'czxm',
|
||||||
'fzjg', 'ccfzrq', 'yfsrq', 'yxqkssj', 'yxqjssj', 'sjfssj', 'zszt', 'url')
|
'fzjg', 'ccfzrq', 'yfsrq', 'yxqkssj', 'yxqjssj', 'sjfssj', 'zszt', 'url', 'cardnum')
|
||||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||||
elif a == 'listself':
|
elif a == 'listself':
|
||||||
userid = req.session['userid']
|
userid = req.session['userid']
|
||||||
|
@ -4058,7 +4058,7 @@ def apisocert(req):
|
||||||
if req.GET.get('sort'):
|
if req.GET.get('sort'):
|
||||||
a = a.order_by(req.GET.get('sort'))
|
a = a.order_by(req.GET.get('sort'))
|
||||||
a = a.values('id', 'realname', 'gender', 'zylb', 'czxm', 'fzjg',
|
a = a.values('id', 'realname', 'gender', 'zylb', 'czxm', 'fzjg',
|
||||||
'ccfzrq', 'yfsrq', 'yxqkssj', 'yxqjssj', 'sjfssj', 'zszt', 'url')
|
'ccfzrq', 'yfsrq', 'yxqkssj', 'yxqjssj', 'sjfssj', 'zszt', 'url', 'cardnum')
|
||||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||||
elif a == 'addspider':
|
elif a == 'addspider':
|
||||||
postdata = json.loads(req.body.decode('utf-8'))
|
postdata = json.loads(req.body.decode('utf-8'))
|
||||||
|
@ -4218,7 +4218,7 @@ def apisafecert(req):
|
||||||
if req.GET.get('sort'):
|
if req.GET.get('sort'):
|
||||||
a = a.order_by(req.GET.get('sort'))
|
a = a.order_by(req.GET.get('sort'))
|
||||||
a = a[startnum:endnum].values('id', 'realname', 'gender', 'zglx',
|
a = a[startnum:endnum].values('id', 'realname', 'gender', 'zglx',
|
||||||
'dwlx', 'fzjg', 'yfsrq', 'yxqkssj', 'yxqjssj', 'zszt', 'url')
|
'dwlx', 'fzjg', 'yfsrq', 'yxqkssj', 'yxqjssj', 'zszt', 'url', 'cardnum')
|
||||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||||
elif a == 'listself':
|
elif a == 'listself':
|
||||||
userid = req.session['userid']
|
userid = req.session['userid']
|
||||||
|
@ -4229,7 +4229,7 @@ def apisafecert(req):
|
||||||
if req.GET.get('sort'):
|
if req.GET.get('sort'):
|
||||||
a = a.order_by(req.GET.get('sort'))
|
a = a.order_by(req.GET.get('sort'))
|
||||||
a = a.values('id', 'realname', 'gender', 'zglx', 'dwlx',
|
a = a.values('id', 'realname', 'gender', 'zglx', 'dwlx',
|
||||||
'fzjg', 'yfsrq', 'yxqkssj', 'yxqjssj', 'zszt', 'url')
|
'fzjg', 'yfsrq', 'yxqkssj', 'yxqjssj', 'zszt', 'url', 'cardnum')
|
||||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||||
elif a == 'addspider':
|
elif a == 'addspider':
|
||||||
postdata = json.loads(req.body.decode('utf-8'))
|
postdata = json.loads(req.body.decode('utf-8'))
|
||||||
|
@ -6581,7 +6581,8 @@ def apiquestioncat(req):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
companys = Partment.objects.filter(partid=companyid).values_list('partid', flat=True)
|
companys = Partment.objects.filter(partid=companyid).values_list('partid', flat=True)
|
||||||
list_items = (Questioncat.objects.filter(usecomp__in=companys, deletemark=1)).annotate(
|
list_items = (Questioncat.objects.filter(usecomp__in=companys, deletemark=1)| Questioncat.objects.filter(
|
||||||
|
usecomp__partid=1, deletemark=1)).annotate(
|
||||||
parentId=F('parent__id')).values('id', 'parentId', 'name')
|
parentId=F('parent__id')).values('id', 'parentId', 'name')
|
||||||
return HttpResponse(json.dumps(list(list_items)), content_type="application/json")
|
return HttpResponse(json.dumps(list(list_items)), content_type="application/json")
|
||||||
elif a == 'tree':
|
elif a == 'tree':
|
||||||
|
|
Loading…
Reference in New Issue