From 5099a92f1ebaa172a7f554024ebc44162a044ab9 Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Sat, 15 May 2021 19:42:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=E6=98=AF=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/classplan/ClassPlanController.java | 11 + .../service/classplan/IClassPlanService.java | 7 + .../mybatis/mapper/teacher/teacher-mapper.xml | 4 +- .../route/classplan/list-signup-user.html | 75 ++---- .../static/route/classplan/list-signup.html | 32 ++- .../static/route/classplan/list.html | 250 +++++++----------- .../static/route/classplan/save.html | 7 +- 7 files changed, 157 insertions(+), 229 deletions(-) diff --git a/src/main/java/cn/com/tenlion/controller/api/classplan/ClassPlanController.java b/src/main/java/cn/com/tenlion/controller/api/classplan/ClassPlanController.java index 3389dda..a630e90 100644 --- a/src/main/java/cn/com/tenlion/controller/api/classplan/ClassPlanController.java +++ b/src/main/java/cn/com/tenlion/controller/api/classplan/ClassPlanController.java @@ -174,4 +174,15 @@ public class ClassPlanController extends DefaultBaseController { return classPlanService.listExamUser(classPlanId); } + @ApiOperation(value = "查询参考人员", notes = "查询参考人员接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "orgId", value = "orgId", paramType = "query"), + @ApiImplicitParam(name = "workerCatalog", value = "workerCatalog", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get-exam-check-type") + public Map getExamCheckType() { + Map params = requestParams(); + return classPlanService.getExamCheckType(params); + } } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java b/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java index 8471bce..2c3ac07 100644 --- a/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java +++ b/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java @@ -250,4 +250,11 @@ public interface IClassPlanService { * @return */ SuccessResultList> listSignUpPage(ListPage page); + + /** + * 获取是否能开班 + * @param params + * @return + */ + Map getExamCheckType(Map params); } \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/teacher/teacher-mapper.xml b/src/main/resources/mybatis/mapper/teacher/teacher-mapper.xml index 7df455e..82ecf34 100644 --- a/src/main/resources/mybatis/mapper/teacher/teacher-mapper.xml +++ b/src/main/resources/mybatis/mapper/teacher/teacher-mapper.xml @@ -221,9 +221,9 @@ INSERT INTO e_teach_lessons_time ( - teacher_id,teacher_id_card,org_id,project_catalog_id,worker_catalog,lesson_id,start_time,end_time + class_plan_id,teacher_id,teacher_id_card,org_id,project_catalog_id,worker_catalog,lesson_id,start_time,end_time ) VALUES( - #{teacherId}, #{teacherIdCard},#{orgId},#{projectCatalogId},#{workerCatalog},#{lessonId}, #{startTime},#{endTime} + #{classPlanId},#{teacherId}, #{teacherIdCard},#{orgId},#{projectCatalogId},#{workerCatalog},#{lessonId}, #{startTime},#{endTime} ) diff --git a/src/main/resources/static/route/classplan/list-signup-user.html b/src/main/resources/static/route/classplan/list-signup-user.html index 56bfe3a..ac1c9a0 100644 --- a/src/main/resources/static/route/classplan/list-signup-user.html +++ b/src/main/resources/static/route/classplan/list-signup-user.html @@ -28,16 +28,6 @@
-
- -
@@ -63,8 +53,17 @@ var laydate = layui.laydate; var common = layui.common; var resizeTimeout = null; - var tableUrl = 'api/apply/listpage'; var classPlanId = top.restAjax.params(window.location.href).classPlanId; + var reportType = top.restAjax.params(window.location.href).reportType; + var orgId = top.restAjax.params(window.location.href).orgId; + var workerCatalog = top.restAjax.params(window.location.href).workerCatalog; + var tableUrl = ''; + if(reportType == '2'){ + tableUrl = 'api/applystudents/listpage'; + } else{ + tableUrl = 'api/apply/listpage'; + } + // 初始化表格 function initTable() { @@ -77,7 +76,10 @@ limit: 20, limits: [20, 40, 60, 80, 100, 200], where :{ - applyClassId: classPlanId + applyInstitutionId: orgId, + applyWorkTypeId : workerCatalog, + applyWorkTypeId : workerCatalog, + applyClassId : reportType == "2" ? classPlanId : '' }, toolbar: false, request: { @@ -86,7 +88,6 @@ }, cols: [ [ - // {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, {field: 'applyName', width: 120, title: '姓名', align:'center', templet: function(row) { @@ -97,15 +98,6 @@ return rowData; } }, - {field: 'applySexName', width: 100, title: '性别', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, {field: 'applyCardNumber', width: 180, title: '证件号码', align:'center', templet: function(row) { var rowData = row[this.field]; @@ -132,44 +124,7 @@ } return rowData; } - }, - {field: 'applyAuditState', width: 180, title: '报名状态', align:'center', fixed: 'right', - templet: function(row) { - var rowData = row[this.field]; - if(rowData === 0){ - return '待审核'; - } - if(rowData === 1){ - return '自行撤回'; - } - if(rowData === 2){ - return '审核通过'; - } - if(rowData === 3){ - return '报名完成'; - } - if(rowData === -1){ - return '审核不通过'; - } - return '-'; - } - }, - {field: 'cz', width: 180, title: '操作', align:'center', fixed: 'right', - templet: function(row) { - var applyAuditState = row['applyAuditState']; - var rowData = '
'; - rowData +=''; - if (applyAuditState === 0) { - rowData +=''; - } - if (applyAuditState === 2) { - rowData +=''; - } - rowData +='' - rowData +='
'; - return rowData; - } - }, + } ] ], page: true, diff --git a/src/main/resources/static/route/classplan/list-signup.html b/src/main/resources/static/route/classplan/list-signup.html index 52cbdd0..550fbec 100644 --- a/src/main/resources/static/route/classplan/list-signup.html +++ b/src/main/resources/static/route/classplan/list-signup.html @@ -112,9 +112,25 @@ } init(); + function getExamCheckType(){ + var loadIndex = layer.load(1); + top.restAjax.get(top.restAjax.path('api/classplan/get-exam-check-type', []), + {orgId: orgId, workerCatalog : workerCatalog}, null, function (code, data) { + if(data.checkType != '1'){ + $('#class-plan-btn-event').hide(); + } + layer.close(loadIndex); + }, function (code, data) { + $('#class-plan-btn-event').hide(); + top.dialog.msg(data.msg); + layer.close(loadIndex); + }); + } + function getOrgInfo(){ top.restAjax.get(top.restAjax.path('api/teacher/getorginfo', []), {}, null, function (code, data) { orgId = data.institutionId; + getExamCheckType(); initTable(); $('#listContent').attr('src', top.restAjax.path('route/classplan/list-signup.html?orgId={arg1}&workerCatalog={arg2}', [orgId,''])); @@ -139,14 +155,13 @@ limitName: 'rows' }, where : { - orgId : orgId, - + applyWorkTypeId : workerCatalog }, cols: [ [ // {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {field: 'applyClassName', width: 180, title: '报名计划', align:'center', + {field: 'applyWorkTypeName', width: 180, title: '报考工种', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -267,9 +282,6 @@ if (applyAuditState === 0) { rowData +=''; } - if (applyAuditState === 2) { - rowData +=''; - } rowData +='' rowData +=''; return rowData; @@ -297,13 +309,15 @@ keywords: $('#keywords').val(), startTime: $('#startTime').val(), endTime: $('#endTime').val(), - applyAuditStates:$('#applyAuditStates').val() + applyAuditStates:$('#applyAuditStates').val(), + applyWorkTypeId : workerCatalog }, page: { curr: currentPage }, height: $win.height() - 115, }); + getExamCheckType(); } // 初始化日期 @@ -339,15 +353,13 @@ area: ['90%', '90%'], shadeClose: false, anim: 2, - content: top.restAjax.path('route/classplan/save.html?orgId={arg}', [orgId]), + content: top.restAjax.path('route/classplan/save.html?orgId={arg}&workerCatalog={arg1}', [orgId,workerCatalog]), end: function() { reloadTable(); } }); }); - - table.on('tool(dataTable)', function(obj) { var layEvent = obj.event; var data = obj.data; diff --git a/src/main/resources/static/route/classplan/list.html b/src/main/resources/static/route/classplan/list.html index afb986d..60df4c5 100644 --- a/src/main/resources/static/route/classplan/list.html +++ b/src/main/resources/static/route/classplan/list.html @@ -31,20 +31,6 @@
- - @@ -93,7 +79,7 @@ height: $win.height() - 90, limit: 20, limits: [20, 40, 60, 80, 100, 200], - toolbar: '#headerToolBar', + toolbar: false, request: { pageName: 'page', limitName: 'rows' @@ -103,32 +89,62 @@ }, cols: [ [ - {type:'checkbox', fixed: 'left'}, - {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {width:100, title: '审核状态', fixed: 'left', align:'center', + {width:90, title: '', fixed: 'left', align:'center', templet: function(row) { var dom = ''; - if(row['reportType'] === '1'){ - return '报备待审'; + dom += '报名人员'; + return dom; + } + }, + {width:150, title: '状态', fixed: 'left', align:'center', + templet: function(row) { + var dom = ''; + if(row['reportType'] === '0'){ + return '开班待审'; } - if(row['reportType'] === '2'){ - dom += '审核通过'; + if(row['reportType'] === '2' && row['examType'] === '' ){ + dom += '开班通过'; + return dom; + } + if(row['reportType'] === '2' && row['examType'] === '0' ){ + dom += '考试申请中'; + return dom; + } + if(row['reportType'] === '2' && row['examType'] === '1' ){ + dom += '考试申请通过'; + return dom; + } + if(row['reportType'] === '2' && row['examType'] === '2' ){ + dom += '考试申请不通过'; return dom; } if(row['reportType'] === '3'){ - return '审核不通过'; + return '开班不通过'; } return dom; } }, - {width:100, title: '操作', fixed: 'left', align:'center', + {width:120, title: '操作', fixed: 'left', align:'center', templet: function(row) { var dom = ''; if(row['reportType'] === '0'){ - return '开班报备'; + dom += '查看开班申请'; + return dom; } - if(row['reportType'] === '2'){ - dom += '报名人员'; + if(row['reportType'] === '2' && row['examType'] === ''){ + dom += '申请考试'; + return dom; + } + if(row['reportType'] === '2' && row['examType'] === '0'){ + dom += '查看申请'; + return dom; + } + if(row['reportType'] === '2' && row['examType'] === '1'){ + dom += '查看考试安排'; + return dom; + } + if(row['reportType'] === '2' && row['examType'] === '1'){ + dom += '再次申请考试'; return dom; } if(row['reportType'] === '3'){ @@ -137,7 +153,7 @@ return dom; } }, - {field: 'planNumber', width: 190, title: '培训计划编号', align:'center', + {field: 'planNumber', width: 190, title: '班号', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -146,30 +162,21 @@ return rowData; } }, - {field: 'planName', width: 180, title: '培训计划名称', align:'center', + {field: 'planName', width: 180, title: '班级名称', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } + if(row['planType'] == '1'){ + return '[初训] ' + rowData; + } + if(row['planType'] == '2'){ + return '[复训] ' + rowData; + } return rowData; } }, - {field: 'planType', width: 90, title: '培训类型', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(rowData == '1'){ - return '初训'; - } - if(rowData == '2'){ - return '复训'; - } - if(rowData == '3'){ - return '换证'; - } - return '-'; - } - }, {field: 'projectCatalogName', width: 180, title: '培训项目', align:'center', templet: function(row) { var rowData = row[this.field]; @@ -188,25 +195,7 @@ return rowData; } }, - {field: 'planPersonNum', width: 90, title: '计划人数', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return '' + rowData + ' 人'; - } - }, - {field: 'waitSignUpUser', width: 100, title: '报名待处理', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return '' + rowData + ' 人'; - } - }, - {field: 'signUpUserCount', width: 90, title: '完成报名', align:'center', + {field: 'signUpUserCount', width: 90, title: '报名人数', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') { @@ -243,17 +232,10 @@ return rowData; } }, - {width: 330, title: '培训时间', align:'center', + {width: 330, title: '开班时间', align:'center', templet: function(row) { - var start = row['planStartTime']; - var end = row['planEndTime']; - return start + ' ~ ' + end; - } - }, - {width: 330, title: '报名时间', align:'center', - templet: function(row) { - var start = row['signUpStartTime']; - var end = row['signUpEndTime']; + var start = row['planStartTime'].substring(0,10); + var end = row['planEndTime'].substring(0,10); return start + ' ~ ' + end; } }, @@ -335,95 +317,20 @@ $(document).on('click', '#search', function() { reloadTable(1); }); - // 事件 - 增删改 - table.on('toolbar(dataTable)', function(obj) { - var layEvent = obj.event; - var checkStatus = table.checkStatus('dataTable'); - var checkDatas = checkStatus.data; - if(layEvent === 'saveEvent') { - if(typeof (orgInfo.institutionId) === 'undefined' - || orgInfo.institutionId == ''){ - layer.msg('当前用户未绑定机构信息'); - return; - } - layer.open({ - type: 2, - title: false, - closeBtn: 0, - area: ['100%', '100%'], - shadeClose: true, - anim: 2, - content: top.restAjax.path('route/classplan/save.html?orgId={orgId}&orgName={orgName}', - [orgInfo.institutionId,orgInfo.institutionName]), - end: function() { - reloadTable(); - } - }); - } - if(layEvent === 'updateEvent') { - if(checkDatas.length === 0) { - top.dialog.msg('请勾选要 修改/查看 的数据'); - } else if(checkDatas.length > 1) { - top.dialog.msg(top.dataMessage.table.selectOneEdit); - } else { - if(checkDatas[0].reportType == '1' - || checkDatas[0].reportType == '2'){ - layer.open({ - type: 2, - title: false, - closeBtn: 0, - area: ['100%', '100%'], - shadeClose: true, - anim: 2, - content: top.restAjax.path('route/classplan/show.html?classPlanId={classPlanId}', [checkDatas[0].classPlanId]), - end: function() { - reloadTable(); - } - }); - return; - } - layer.open({ - type: 2, - title: false, - closeBtn: 0, - area: ['100%', '100%'], - shadeClose: true, - anim: 2, - content: top.restAjax.path('route/classplan/update.html?classPlanId={classPlanId}', [checkDatas[0].classPlanId]), - end: function() { - reloadTable(); - } - }); - } - } else if(layEvent === 'removeEvent') { - if(checkDatas.length === 0) { - top.dialog.msg(top.dataMessage.table.selectDelete); - } else { - var ids = ''; - for(var i = 0, item; item = checkDatas[i++];) { - if(i > 1) { - ids += '_'; - } - ids += item['classPlanId']; - } - removeData(ids); - } - } - }); table.on('tool(dataTable)', function(obj) { var layEvent = obj.event; var checkStatus = table.checkStatus('dataTable'); var checkDatas = checkStatus.data; - if(layEvent == 'reportEvent'){ - top.dialog.msg('确认提交报备?', { + if(layEvent == 'examReportEvent'){ + top.dialog.msg('确认提交考试申请?', { time: 0, btn: [top.dataMessage.button.yes, top.dataMessage.button.no], shade: 0.3, yes: function (index) { top.dialog.close(index); var layIndex; - top.restAjax.put(top.restAjax.path('api/classplan/update-report/{classPlanId}', [obj.data.classPlanId]), {reportType: '1'}, null, function (code, data) { + top.restAjax.put(top.restAjax.path('api/classplan/update-exam/{classPlanId}', [obj.data.classPlanId]), {reportType: '1'}, null, function (code, data) { top.dialog.msg('提交成功', {time: 1000}); reloadTable(); }, function (code, data) { @@ -437,6 +344,42 @@ }); return; } + if(layEvent == 'reExamEvent'){ + top.dialog.msg('重新提交考试申请?', { + time: 0, + btn: [top.dataMessage.button.yes, top.dataMessage.button.no], + shade: 0.3, + yes: function (index) { + top.dialog.close(index); + var layIndex; + top.restAjax.put(top.restAjax.path('api/classplan/update-exam-recommit/{classPlanId}', [obj.data.classPlanId]), {reportType: '1'}, null, function (code, data) { + top.dialog.msg('提交成功', {time: 1000}); + reloadTable(); + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + layIndex = top.dialog.msg('提交中', {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(layIndex); + }); + } + }); + return; + } + if(layEvent == 'showExamEvent') { + layer.open({ + type: 2, + title: '查看考试安排', + closeBtn: 1, + area: ['90%', '90%'], + shadeClose: false, + anim: 2, + content: top.restAjax.path('route/examination/distribution/show.html?planId={classPlanId}', [obj.data.classPlanId]), + end: function () { + reloadTable(); + } + }); + } if(layEvent == 'unPassEvent') { layer.open({ type: 2, @@ -454,12 +397,13 @@ if(layEvent == 'signUpUserEvent') { layer.open({ type: 2, - title: obj.data.planName, + title: '报名人员列表', closeBtn: 1, area: ['90%', '90%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/classplan/list-signup-user.html?classPlanId={classPlanId}', [obj.data.classPlanId]), + content: top.restAjax.path('route/classplan/list-signup-user.html?classPlanId={arg}&reportType={arg1}&orgId={arg2}&workerCatalog={arg3}', + [obj.data.classPlanId,obj.data.reportType, obj.data.orgId,obj.data.workerCatalog]), end: function () { reloadTable(); } diff --git a/src/main/resources/static/route/classplan/save.html b/src/main/resources/static/route/classplan/save.html index 6609903..fe03fa4 100644 --- a/src/main/resources/static/route/classplan/save.html +++ b/src/main/resources/static/route/classplan/save.html @@ -207,6 +207,7 @@ var laydate = layui.laydate; var teacherList = []; var orgId = top.restAjax.params(window.location.href).orgId; + var workerCatalog = top.restAjax.params(window.location.href).workerCatalog; // 初始化内容 function initData() { @@ -429,10 +430,8 @@ layer.msg('培训开始时间不能大于结束时间'); return; } - if(verifyDate(formData.field['signUpStartTime'],formData.field['signUpEndTime']) == 1){ - layer.msg('报名开始时间不能大于结束时间'); - return; - } + formData.field['orgId'] = orgId; + formData.field['workerCatalog'] = workerCatalog; formData.field['lessonList'] = lessonList; top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index);