Merge branch 'master' of https://e.coding.net/ctcdevteam/examtest
This commit is contained in:
commit
a37097e324
|
@ -12,6 +12,8 @@ npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
**/*.log
|
**/*.log
|
||||||
|
test_server/media/*
|
||||||
|
test_server/quota.dat
|
||||||
|
|
||||||
tests/**/coverage/
|
tests/**/coverage/
|
||||||
tests/e2e/reports
|
tests/e2e/reports
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
4f04a87f0f966902d03e402267e5c805
|
|
@ -209,8 +209,12 @@
|
||||||
<el-table-column label="单位" sortable="custom" prop="company">
|
<el-table-column label="单位" sortable="custom" prop="company">
|
||||||
<template
|
<template
|
||||||
slot-scope="scope"
|
slot-scope="scope"
|
||||||
v-if="scope.row.company_name != null"
|
>
|
||||||
>{{ scope.row.company_name }}</template>
|
<span v-if="scope.row.company_name">{{ scope.row.company_name }}</span>
|
||||||
|
<span v-else>
|
||||||
|
<span v-if="scope.row.companyname">{{ scope.row.companyname }}</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="工作类别" sortable="custom" prop="workscope">
|
<el-table-column label="工作类别" sortable="custom" prop="workscope">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
@ -297,6 +301,9 @@
|
||||||
<el-button slot="append" icon="el-icon-search" @click="choose()"></el-button>
|
<el-button slot="append" icon="el-icon-search" @click="choose()"></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="单位(自填)" prop="companyname">
|
||||||
|
<el-input v-model="consumer.companyname" placeholder="单位" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="缴费学科" prop="subjects">
|
<el-form-item label="缴费学科" prop="subjects">
|
||||||
<el-select v-model="consumer.subjects" placeholder="缴费学科" style="width:100%" multiple>
|
<el-select v-model="consumer.subjects" placeholder="缴费学科" style="width:100%" multiple>
|
||||||
<el-option
|
<el-option
|
||||||
|
|
|
@ -23,18 +23,22 @@ class BasicCount(APIView):
|
||||||
ret={}
|
ret={}
|
||||||
q1 = Consumer.objects.filter(is_delete=False)
|
q1 = Consumer.objects.filter(is_delete=False)
|
||||||
q1 = q1.filter(create_time__gte = request.query_params.get('datestart')) if request.query_params.get('datestart', None) else q1
|
q1 = q1.filter(create_time__gte = request.query_params.get('datestart')) if request.query_params.get('datestart', None) else q1
|
||||||
|
q1 = q1.filter(create_time__lte = request.query_params.get('dateend')) if request.query_params.get('dateend', None) else q1
|
||||||
ret['consumer1_count'] = q1.count()
|
ret['consumer1_count'] = q1.count()
|
||||||
|
|
||||||
q2 = Consumer.objects.filter(is_delete=False).exclude(create_admin=None)
|
q2 = Consumer.objects.filter(is_delete=False).exclude(create_admin=None)
|
||||||
q2 = q2.filter(create_time__gte = request.query_params.get('datestart')) if request.query_params.get('datestart', None) else q2
|
q2 = q2.filter(create_time__gte = request.query_params.get('datestart')) if request.query_params.get('datestart', None) else q2
|
||||||
|
q2 = q2.filter(create_time__lte = request.query_params.get('dateend')) if request.query_params.get('dateend', None) else q2
|
||||||
ret['consumer2_count'] = q2.count()
|
ret['consumer2_count'] = q2.count()
|
||||||
|
|
||||||
q3 = ExamTest.objects.filter(is_delete=False)
|
q3 = ExamTest.objects.filter(is_delete=False)
|
||||||
q3 = q3.filter(create_time__gte = request.query_params.get('datestart')) if request.query_params.get('datestart', None) else q3
|
q3 = q3.filter(create_time__gte = request.query_params.get('datestart')) if request.query_params.get('datestart', None) else q3
|
||||||
|
q3 = q3.filter(create_time__lte = request.query_params.get('dateend')) if request.query_params.get('dateend', None) else q3
|
||||||
ret['test_count'] = q3.count()
|
ret['test_count'] = q3.count()
|
||||||
|
|
||||||
q4 = Question.objects.filter(is_delete=False)
|
q4 = Question.objects.filter(is_delete=False)
|
||||||
q4 = q4.filter(create_time__gte = request.query_params.get('datestart')) if request.query_params.get('datestart', None) else q4
|
# q4 = q4.filter(create_time__gte = request.query_params.get('datestart')) if request.query_params.get('datestart', None) else q4
|
||||||
|
# q4 = q4.filter(create_time__lte = request.query_params.get('dateend')) if request.query_params.get('dateend', None) else q4
|
||||||
ret['question_count'] = q4.count()
|
ret['question_count'] = q4.count()
|
||||||
return Response(ret)
|
return Response(ret)
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,11 @@ def export_consumer(users):
|
||||||
wb = Workbook()
|
wb = Workbook()
|
||||||
ws1 = wb.active
|
ws1 = wb.active
|
||||||
ws1.title = '用户表'
|
ws1.title = '用户表'
|
||||||
ws1.append(['姓名','手机号', '单位', '身份证号', '微信昵称', '工作类别', '用户角色', '创建日期', '所属账户'])
|
ws1.append(['姓名','手机号', '单位', '单位自填', '身份证号', '微信昵称', '工作类别', '用户角色', '创建日期', '所属账户'])
|
||||||
row = ws1.row_dimensions[1]
|
row = ws1.row_dimensions[1]
|
||||||
row.font = Font(bold=True)
|
row.font = Font(bold=True)
|
||||||
for i in users:
|
for i in users:
|
||||||
ws1.append([i['name'], i['username'], i['company_name'], i['ID_number1'], i['nickname'], i['workscope_name'], i['role_name'], i['create_time'], i['create_admin_name']])
|
ws1.append([i['name'], i['username'], i['company_name'], i['companyname'], i['ID_number1'], i['nickname'], i['workscope_name'], i['role_name'], i['create_time'], i['create_admin_name']])
|
||||||
filename = 'users' + datetime.now().strftime("%Y%m%d%H%M%S") +'.xlsx'
|
filename = 'users' + datetime.now().strftime("%Y%m%d%H%M%S") +'.xlsx'
|
||||||
path = '/media/export/' + filename
|
path = '/media/export/' + filename
|
||||||
wb.save((BASE_DIR + path).replace('\\', '/'))
|
wb.save((BASE_DIR + path).replace('\\', '/'))
|
||||||
|
|
|
@ -625,7 +625,7 @@ class ConsumerRegister(APIView):
|
||||||
# 默认一个工作类别
|
# 默认一个工作类别
|
||||||
if not consumer.workscope:
|
if not consumer.workscope:
|
||||||
try:
|
try:
|
||||||
consumer.workscope = WorkScope.objects.filter(sortnum=1).order_by('id').first()
|
consumer.workscope = WorkScope.objects.filter(sortnum=0).order_by('id').first()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
consumer.save()
|
consumer.save()
|
||||||
|
@ -641,7 +641,7 @@ class ConsumerRegister(APIView):
|
||||||
# 默认一个工作类别
|
# 默认一个工作类别
|
||||||
if not consumer.workscope:
|
if not consumer.workscope:
|
||||||
try:
|
try:
|
||||||
consumer.workscope = WorkScope.objects.filter(sortnum=1).order_by('id').first()
|
consumer.workscope = WorkScope.objects.filter(sortnum=0).order_by('id').first()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
consumer.save()
|
consumer.save()
|
||||||
|
@ -675,7 +675,10 @@ class WxphoneRegister(APIView):
|
||||||
if request.user.role.name =='游客':
|
if request.user.role.name =='游客':
|
||||||
request.user.role = ConsumerRole.objects.get(name='注册用户')
|
request.user.role = ConsumerRole.objects.get(name='注册用户')
|
||||||
if not request.user.workscope:
|
if not request.user.workscope:
|
||||||
request.user.workscope = WorkScope.objects.filter(sortnum=1).order_by('id').first()
|
try:
|
||||||
|
request.user.workscope = WorkScope.objects.filter(sortnum=0).order_by('id').first()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
request.user.save()
|
request.user.save()
|
||||||
return Response(status=status.HTTP_200_OK, data=ConsumerDetailSerializer(instance=request.user).data)
|
return Response(status=status.HTTP_200_OK, data=ConsumerDetailSerializer(instance=request.user).data)
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -134,6 +134,7 @@ USE_L10N = True
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
|
|
||||||
|
# Static files (CSS, JavaScript, Images)
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/3.0/howto/static-files/
|
# https://docs.djangoproject.com/en/3.0/howto/static-files/
|
||||||
|
|
||||||
|
@ -258,4 +259,4 @@ LOGGING = {
|
||||||
'propagate': True
|
'propagate': True
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,23 @@ from utils.file import UploadFileView
|
||||||
from utils.view import redirect
|
from utils.view import redirect
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
path('rbac/', include('rbac.urls')),
|
||||||
|
path('vod/', include('vod.urls')),
|
||||||
|
path('develop/', include('develop.urls')),
|
||||||
|
path('crm/', include('crm.urls')),
|
||||||
|
path('question/', include('question.urls')),
|
||||||
|
path('examtest/', include('examtest.urls')),
|
||||||
|
path('cms/', include('cms.urls')),
|
||||||
|
path('analyse/', include('analyse.urls')),
|
||||||
|
path('qtest/', include('qtest.urls')),
|
||||||
|
path('token/', obtain_jwt_token),
|
||||||
|
path('token/refresh/', refresh_jwt_token),
|
||||||
|
path('token/verify/', verify_jwt_token),
|
||||||
|
path('token/remove/', UserLogoutView.as_view()),
|
||||||
|
path('uploadfile/', UploadFileView.as_view()),
|
||||||
|
path('redirect/',redirect),
|
||||||
|
|
||||||
|
|
||||||
path('api/rbac/', include('rbac.urls')),
|
path('api/rbac/', include('rbac.urls')),
|
||||||
path('api/vod/', include('vod.urls')),
|
path('api/vod/', include('vod.urls')),
|
||||||
path('api/develop/', include('develop.urls')),
|
path('api/develop/', include('develop.urls')),
|
||||||
|
|
Loading…
Reference in New Issue