From 7c8c39c4d07182e94926ce2572ca92f6f2b179a2 Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Wed, 12 May 2021 17:31:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84=EF=BC=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=B1=95=E7=A4=BA=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExaminationController.java | 13 ++++ .../dao/examinationuser/IExaminationDao.java | 8 ++ .../examapply/impl/ExamApplyServiceImpl.java | 10 ++- .../examcheck/impl/ExamCheckServiceImpl.java | 2 + .../examinationuser/IExaminationService.java | 8 ++ .../impl/ExaminationServiceImpl.java | 5 ++ .../examinationuser/examination-mapper.xml | 23 +++++- .../static/route/examapply/list.html | 50 ++++++++++++- .../static/route/examapply/update.html | 73 +++++++++++++------ .../static/route/examcheck/list.html | 5 +- .../static/route/examinationuser/list.html | 4 +- .../static/route/examinationuser/update.html | 7 +- .../route/examinationuser/view-list.html | 1 - 13 files changed, 173 insertions(+), 36 deletions(-) diff --git a/src/main/java/cn/com/tenlion/controller/api/examinationuser/ExaminationController.java b/src/main/java/cn/com/tenlion/controller/api/examinationuser/ExaminationController.java index 5295ae0..7f28999 100644 --- a/src/main/java/cn/com/tenlion/controller/api/examinationuser/ExaminationController.java +++ b/src/main/java/cn/com/tenlion/controller/api/examinationuser/ExaminationController.java @@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -125,4 +126,16 @@ public class ExaminationController extends DefaultBaseController { return examinationService.resultExamUser(page); } + @ApiOperation(value = "分配的监考老师", notes = "分配的监考老师接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "examinationId", value = "ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get-exam-user/{examId}") + public ExaminationDTO getExamUser(@PathVariable("examId") String examId) { + Map params = new HashMap<>(); + params.put("examId", examId); + return examinationService.getExamUser(params); + } + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/dao/examinationuser/IExaminationDao.java b/src/main/java/cn/com/tenlion/dao/examinationuser/IExaminationDao.java index 29593ca..de2b12c 100644 --- a/src/main/java/cn/com/tenlion/dao/examinationuser/IExaminationDao.java +++ b/src/main/java/cn/com/tenlion/dao/examinationuser/IExaminationDao.java @@ -147,4 +147,12 @@ public interface IExaminationDao { * @throws SearchException */ void updateExamHis(Map params) throws SearchException; + + /** + * 分配的监考老师 + * @param params + * @return + * @throws SearchException + */ + ExaminationDTO getExamUser(Map params) throws SearchException; } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/examapply/impl/ExamApplyServiceImpl.java b/src/main/java/cn/com/tenlion/service/examapply/impl/ExamApplyServiceImpl.java index cb7ad09..696a6a3 100644 --- a/src/main/java/cn/com/tenlion/service/examapply/impl/ExamApplyServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examapply/impl/ExamApplyServiceImpl.java @@ -144,8 +144,14 @@ public class ExamApplyServiceImpl extends DefaultBaseService implements IExamApp DistributionSaveVO dstributionSaveVO = new DistributionSaveVO(); dstributionSaveVO.setPlanId(examApplyVO.getExamId()); dstributionSaveVO.setPlanName(examApplyVO.getPlanName()); - dstributionSaveVO.setDistributionTime(examApplyVO.getTheoryExamStartTime()); - dstributionSaveVO.setDistributionEndTime(examApplyVO.getTheoryExamEndTime()); + if(1 == examApplyVO.getExamType()) { + dstributionSaveVO.setDistributionTime(examApplyVO.getTheoryExamStartTime()); + dstributionSaveVO.setDistributionEndTime(examApplyVO.getTheoryExamEndTime()); + } + if(2 == examApplyVO.getExamType()) { + dstributionSaveVO.setDistributionTime(examApplyVO.getPracticeExamStartTime()); + dstributionSaveVO.setDistributionEndTime(examApplyVO.getPracticeExamEndTime()); + } dstributionSaveVO.setDistributionNumber(examApplyVO.getPlanPersonNum()); dstributionSaveVO.setStationId(examApplyVO.getTheoryExamAddressId()); distributionService.save(dstributionSaveVO); diff --git a/src/main/java/cn/com/tenlion/service/examcheck/impl/ExamCheckServiceImpl.java b/src/main/java/cn/com/tenlion/service/examcheck/impl/ExamCheckServiceImpl.java index b2ce45b..bdab920 100644 --- a/src/main/java/cn/com/tenlion/service/examcheck/impl/ExamCheckServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examcheck/impl/ExamCheckServiceImpl.java @@ -182,6 +182,8 @@ public class ExamCheckServiceImpl extends DefaultBaseService implements IExamChe ClassPlanDTO classPlanDTO = classPlanService.get(examCheckDTO.getPlanId()); examCheckDTO.setClassPlanDTO(classPlanDTO); if(null != classPlanDTO) { + System.out.println(classPlanDTO.getClassPlanId()); + System.out.println(classPlanDTO.getOrgId()); InstitutionDTO institutionDTO = iInstitutionService.get(classPlanDTO.getOrgId()); if(null != institutionDTO) { classPlanDTO.setOrgId(institutionDTO.getInstitutionName()); diff --git a/src/main/java/cn/com/tenlion/service/examinationuser/IExaminationService.java b/src/main/java/cn/com/tenlion/service/examinationuser/IExaminationService.java index fa9e687..0fc8b3c 100644 --- a/src/main/java/cn/com/tenlion/service/examinationuser/IExaminationService.java +++ b/src/main/java/cn/com/tenlion/service/examinationuser/IExaminationService.java @@ -201,4 +201,12 @@ public interface IExaminationService { * @throws SearchException */ SuccessResultList> resultExamUser(ListPage page) throws SearchException; + + /** + * 分配的监考老师 + * @param params + * @return + * @throws SearchException + */ + ExaminationDTO getExamUser(Map params) throws SearchException; } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/examinationuser/impl/ExaminationServiceImpl.java b/src/main/java/cn/com/tenlion/service/examinationuser/impl/ExaminationServiceImpl.java index 1898e16..9c97b8e 100644 --- a/src/main/java/cn/com/tenlion/service/examinationuser/impl/ExaminationServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examinationuser/impl/ExaminationServiceImpl.java @@ -262,6 +262,11 @@ public class ExaminationServiceImpl extends DefaultBaseService implements IExami return new SuccessResultList<>(examinationDTOList, pageInfo.getPageNum(), pageInfo.getTotal()); } + @Override + public ExaminationDTO getExamUser(Map params) throws SearchException { + return examinationDao.getExamUser(params); + } + /** * 判断当天是否存在该考务人员的监考记录 * @param params diff --git a/src/main/resources/mybatis/mapper/examinationuser/examination-mapper.xml b/src/main/resources/mybatis/mapper/examinationuser/examination-mapper.xml index 00feb60..2617dfb 100644 --- a/src/main/resources/mybatis/mapper/examinationuser/examination-mapper.xml +++ b/src/main/resources/mybatis/mapper/examinationuser/examination-mapper.xml @@ -131,8 +131,8 @@ WHERE t1.is_delete = 0 - AND - t1.examination_id = #{examinationId} + AND + t1.examination_id = #{examinationId} @@ -330,7 +330,7 @@ emergency_examination_his t1 WHERE ( - datediff(t1.gmt_create, #{startDay}) = 0 + datediff(t1.start_time, #{startDay}) = 0 ) AND t1.is_delete = 0 @@ -380,4 +380,21 @@ AND exam_id = #{examId} + + + \ No newline at end of file diff --git a/src/main/resources/static/route/examapply/list.html b/src/main/resources/static/route/examapply/list.html index e87d2e8..5b1fe15 100644 --- a/src/main/resources/static/route/examapply/list.html +++ b/src/main/resources/static/route/examapply/list.html @@ -301,6 +301,18 @@ rowData = '分配监考老师'; return rowData; } + }, + {field: 'viewExamination', fixed: 'right', width: 150, title: '查看监考老师', align:'center', + templet: function(row) { + var status = row['status']; + var rowData; + if('0' == status) { + rowData = '暂未分配考场信息'; + return rowData; + } + rowData = '查看监考老师'; + return rowData; + } } ] ], @@ -450,9 +462,42 @@ }); } + // 查看监考老师 + function viewExamination(data) { + var loadLayerIndex; + top.restAjax.get(top.restAjax.path('api/examination/get-exam-user/{examId}', + [data.examId]), {}, null, function(code, resultData) { + layer.open({ + type: 2, + title: false, + closeBtn: 0, + area: ['100%', '100%'], + shadeClose: true, + anim: 2, + content: top.restAjax.path('route/examinationuser/update.html?examinationId={examinationId}&isView={isView}', [resultData.examinationId, 'yes']), + end: function() { + reloadTable(); + } + }); + }, function(code, data) { + top.dialog.msg(data.msg); + }, function() { + loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3}); + }, function() { + top.dialog.close(loadLayerIndex); + }); + } + function selOther(data) { + var startTime; + if(data.examType == '1') { + startTime = data.theoryExamStartTime; + } + if(data.examType == '2') { + startTime = data.practiceExamStartTime + } top.dialog.open({ - url: top.restAjax.path('route/examinationuser/view-list.html?startTime={startTime}', [data.theoryExamStartTime]), + url: top.restAjax.path('route/examinationuser/view-list.html?startTime={startTime}', [startTime]), title: "剩余考务人员", width: '80%', height: '80%', @@ -471,6 +516,9 @@ }else if('selOther' == obj.event) { // 查看剩余监考老师 selOther(data); + }else if('viewExamination' == obj.event) { + // 查看监考老师 + viewExamination(data); } }); }); diff --git a/src/main/resources/static/route/examapply/update.html b/src/main/resources/static/route/examapply/update.html index 38af78b..fa3df1d 100644 --- a/src/main/resources/static/route/examapply/update.html +++ b/src/main/resources/static/route/examapply/update.html @@ -104,7 +104,7 @@ -
+
-
+
@@ -131,7 +131,7 @@
-
+
-
+
@@ -225,6 +225,7 @@ var wangEditor = window.wangEditor; var wangEditorObj = {}; var viewerObj = {}; + var examType = 1; // 初始化实操考试地点下拉选择 function initPracticeExamAddressIdSelect(selectValue) { @@ -420,6 +421,8 @@ var loadLayerIndex; top.restAjax.get(top.restAjax.path('api/examapply/get/{examApplyId}', [examApplyId]), {}, null, function(code, data) { var dataFormData = {}; + examType = data.examType; + initExamType(data.examType); for(var i in data) { dataFormData[i] = data[i] +''; } @@ -447,6 +450,27 @@ } initData(); + function initExamType(examType) { + if('1' == examType) { + $('#theoryAddressDiv').show(); + $('#theoryTimeDiv').show(); + $('#practiceAddressDiv').hide(); + $('#practiceTimeDiv').hide(); + } + if('2' == examType) { + $('#theoryAddressDiv').hide(); + $('#theoryTimeDiv').hide(); + $('#practiceAddressDiv').show(); + $('#practiceTimeDiv').show(); + } + if('3' == examType) { + $('#theoryAddressDiv').show(); + $('#theoryTimeDiv').show(); + $('#practiceAddressDiv').show(); + $('#practiceTimeDiv').show(); + } + } + // 获取考试申请基本信息 function initExamBaseInfo() { var loadLayerIndex; @@ -492,21 +516,37 @@ }); } } - - // 提交表单 - form.on('submit(submitForm)', function(formData) { + + function theoryCheck() { var theoryExamStartTime = new Date($('#theoryExamEndTime').val()).getTime(); var theoryExamEndTime = new Date($('#theoryExamStartTime').val()).getTime(); if(theoryExamEndTime >= theoryExamStartTime) { top.dialog.msg('理论考试结束时间不能早于等于开始时间'); return false; } + } - /*var practiceExamStartTime = new Date($('#practiceExamEndTime').val()).getTime(); + function practiceCheck() { + var practiceExamStartTime = new Date($('#practiceExamEndTime').val()).getTime(); var practiceExamEndTime = new Date($('#practiceExamStartTime').val()).getTime(); - if(practiceExamEndTime <= practiceExamStartTime) { + if(practiceExamEndTime >= practiceExamStartTime) { layer.msg('实操考试结束时间不能早于等于开始时间'); - }*/ + return false; + } + } + + // 提交表单 + form.on('submit(submitForm)', function(formData) { + if('1' == examType) { + theoryCheck(); + } + if('2' == examType) { + practiceCheck(); + } + if('3' == examType) { + theoryCheck(); + practiceCheck(); + } formData.field.planName = $('#planName').val(); formData.field.planPersonNum = $('#planPersonNum').val(); @@ -514,18 +554,7 @@ top.dialog.close(index); var loadLayerIndex; top.restAjax.put(top.restAjax.path('api/examapply/update/{examApplyId}', [examApplyId]), formData.field, null, function(code, data) { - var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, { - time: 0, - btn: [top.dataMessage.button.yes, top.dataMessage.button.no], - shade: 0.3, - yes: function(index) { - top.dialog.close(index); - window.location.reload(); - }, - btn2: function() { - closeBox(); - } - }); + top.dialog.close(index); }, function(code, data) { top.dialog.msg(data.msg); }, function() { diff --git a/src/main/resources/static/route/examcheck/list.html b/src/main/resources/static/route/examcheck/list.html index 65ab363..d62e36b 100644 --- a/src/main/resources/static/route/examcheck/list.html +++ b/src/main/resources/static/route/examcheck/list.html @@ -35,10 +35,7 @@ diff --git a/src/main/resources/static/route/examinationuser/list.html b/src/main/resources/static/route/examinationuser/list.html index 5046b06..247d507 100644 --- a/src/main/resources/static/route/examinationuser/list.html +++ b/src/main/resources/static/route/examinationuser/list.html @@ -222,7 +222,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/examination/save.html', []), + content: top.restAjax.path('route/examinationuser/save.html', []), end: function() { reloadTable(); } @@ -240,7 +240,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/examination/update.html?examinationId={examinationId}', [checkDatas[0].examinationId]), + content: top.restAjax.path('route/examinationuser/update.html?examinationId={examinationId}', [checkDatas[0].examinationId]), end: function() { reloadTable(); } diff --git a/src/main/resources/static/route/examinationuser/update.html b/src/main/resources/static/route/examinationuser/update.html index 3935a51..c456bdc 100644 --- a/src/main/resources/static/route/examinationuser/update.html +++ b/src/main/resources/static/route/examinationuser/update.html @@ -37,7 +37,7 @@
@@ -61,11 +61,16 @@ var laytpl = layui.laytpl; var laydate = layui.laydate; var examinationId = top.restAjax.params(window.location.href).examinationId; + var isView = top.restAjax.params(window.location.href).isView; var wangEditor = window.wangEditor; var wangEditorObj = {}; var viewerObj = {}; + if('yes' == isView) { + $('#subBtn').hide(); + } + function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); } diff --git a/src/main/resources/static/route/examinationuser/view-list.html b/src/main/resources/static/route/examinationuser/view-list.html index 84b4e70..9cc3026 100644 --- a/src/main/resources/static/route/examinationuser/view-list.html +++ b/src/main/resources/static/route/examinationuser/view-list.html @@ -71,7 +71,6 @@ }, cols: [ [ - {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, {field: 'name', width: 180, title: '考务人员姓名', align:'center', templet: function(row) {