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 6e2931c..99461db 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 @@ -160,8 +160,8 @@ public class ClassPlanController extends DefaultBaseController { }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PutMapping("update-exam-recommit/{classPlanId}") - public SuccessResult updateExamRecommit(@PathVariable("classPlanId") String classPlanId) { - classPlanService.updateExamRecommit(classPlanId); + public SuccessResult updateExamRecommit(@PathVariable("classPlanId") String classPlanId,@RequestBody ClassPlanVO classPlanVO) { + classPlanService.updateExamRecommit(classPlanId, classPlanVO); return new SuccessResult(); } diff --git a/src/main/java/cn/com/tenlion/controller/api/traininginstitutionuser/TrainingInstitutionUserController.java b/src/main/java/cn/com/tenlion/controller/api/traininginstitutionuser/TrainingInstitutionUserController.java index d4f325f..8eaf999 100644 --- a/src/main/java/cn/com/tenlion/controller/api/traininginstitutionuser/TrainingInstitutionUserController.java +++ b/src/main/java/cn/com/tenlion/controller/api/traininginstitutionuser/TrainingInstitutionUserController.java @@ -1,8 +1,11 @@ package cn.com.tenlion.controller.api.traininginstitutionuser; +import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO; import com.alibaba.fastjson.JSONObject; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.common.component.SecurityComponent; +import ink.wgink.exceptions.ParamsException; import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.ErrorResult; @@ -13,6 +16,7 @@ import cn.com.tenlion.pojo.dtos.traininginstitutionuser.TrainingInstitutionUserD import cn.com.tenlion.pojo.vos.traininginstitutionuser.TrainingInstitutionUserVO; import cn.com.tenlion.service.traininginstitutionuser.ITrainingInstitutionUserService; import io.swagger.annotations.*; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -34,6 +38,25 @@ public class TrainingInstitutionUserController extends DefaultBaseController { @Autowired private ITrainingInstitutionUserService trainingInstitutionUserService; + @Autowired + protected SecurityComponent securityComponent; + + + @ApiOperation(value = "获取当前登录人的培训机构详情", notes = "获取当前登录人的培训机构详情接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get-now-institution") + public InstitutionDTO getNowInstitution(){ + String userId = securityComponent.getCurrentUser().getUserId(); + if(StringUtils.isBlank(userId)){ + throw new ParamsException("请重新登录"); + } + return trainingInstitutionUserService.getByUserId(userId); + } + + + + + @@ -80,7 +103,7 @@ public class TrainingInstitutionUserController extends DefaultBaseController { }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("get/{trainingInstitutionUserId}") - public TrainingInstitutionUserDTO get(@PathVariable("trainingInstitutionUserId") String trainingInstitutionUserId) { + public TrainingInstitutionUserDTO get(@PathVariable("trainingInstitutionUserId") String trainingInstitutionUserId) { return trainingInstitutionUserService.get(trainingInstitutionUserId); } diff --git a/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java b/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java index 2d6e2e9..98b844e 100644 --- a/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java +++ b/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java @@ -149,4 +149,22 @@ public interface IClassPlanDao { */ Map countPlanType(Map params); + /** + * 保存考试申请图片和PDF + * @param params + */ + void saveExamFile(Map params); + + /** + * 查询考试申请图片和PDF + * @param params + * @return + */ + Map getExamFile(Map params); + + /** + * 更新考试申请图片和PDF + * @param params + */ + void updateExamFile(Map params); } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/classplan/ClassPlanDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/classplan/ClassPlanDTO.java index 953152c..d70ebf9 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/classplan/ClassPlanDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/classplan/ClassPlanDTO.java @@ -81,6 +81,10 @@ public class ClassPlanDTO { private String planImages; @ApiModelProperty(name = "planPDF", value = "开班申请PDF") private String planPDF; + @ApiModelProperty(name = "examImages", value = "考试申请图片") + private String examImages; + @ApiModelProperty(name = "examPDF", value = "考试申请PDF") + private String examPDF; public String getPlanNumber() { @@ -309,4 +313,20 @@ public class ClassPlanDTO { public void setPlanPDF(String planPDF) { this.planPDF = planPDF; } + + public String getExamImages() { + return examImages == null ? "" : examImages; + } + + public void setExamImages(String examImages) { + this.examImages = examImages; + } + + public String getExamPDF() { + return examPDF == null ? "" : examPDF; + } + + public void setExamPDF(String examPDF) { + this.examPDF = examPDF; + } } diff --git a/src/main/java/cn/com/tenlion/pojo/vos/classplan/ClassPlanVO.java b/src/main/java/cn/com/tenlion/pojo/vos/classplan/ClassPlanVO.java index 77055b0..0cc81aa 100644 --- a/src/main/java/cn/com/tenlion/pojo/vos/classplan/ClassPlanVO.java +++ b/src/main/java/cn/com/tenlion/pojo/vos/classplan/ClassPlanVO.java @@ -58,6 +58,10 @@ public class ClassPlanVO { private String planImages; @ApiModelProperty(name = "planPDF", value = "开班申请PDF") private String planPDF; + @ApiModelProperty(name = "examImages", value = "考试申请图片") + private String examImages; + @ApiModelProperty(name = "examPDF", value = "考试申请PDF") + private String examPDF; public String getPlanNumber() { return planNumber == null ? "" : planNumber.trim(); @@ -234,4 +238,21 @@ public class ClassPlanVO { public void setPlanPDF(String planPDF) { this.planPDF = planPDF; } + + + public String getExamImages() { + return examImages == null ? "" : examImages; + } + + public void setExamImages(String examImages) { + this.examImages = examImages; + } + + public String getExamPDF() { + return examPDF == null ? "" : examPDF; + } + + public void setExamPDF(String examPDF) { + this.examPDF = examPDF; + } } 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 cc40f98..bd013a6 100644 --- a/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java +++ b/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java @@ -275,6 +275,7 @@ public interface IClassPlanService { /** * 重新提交考试申请 * @param classPlanId + * @param classPlanVO */ - void updateExamRecommit(String classPlanId); + void updateExamRecommit(String classPlanId, ClassPlanVO classPlanVO); } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/classplan/impl/ClassPlanServiceImpl.java b/src/main/java/cn/com/tenlion/service/classplan/impl/ClassPlanServiceImpl.java index 11918f9..2a52299 100644 --- a/src/main/java/cn/com/tenlion/service/classplan/impl/ClassPlanServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/classplan/impl/ClassPlanServiceImpl.java @@ -421,6 +421,24 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl // 查询当前计划下所有课程和讲师绑定信息 List> classPlanLessons = classPlanDao.listClassPlanLessons(classPlanId); dto.setClassPlanLessons(classPlanLessons); + // 查询考试申请图片及PDF + Map examFile = classPlanDao.getExamFile(params); + if(examFile != null && examFile.size() > 0){ + dto.setExamImages(examFile.get("examImages").toString()); + dto.setExamPDF(examFile.get("examPDF").toString()); + } + //查询考试申请状态 + params.clear(); + params.put("examId",classPlanId); + ExamApplyDTO examApplyDTO = examApplyService.get(params); + if(null == examApplyDTO){ + // 未提交考试申请 + dto.setExamType(""); + } else { + // 0待审核 1审核通过 2退回 + dto.setExamType(examApplyDTO.getCheckStatus() + ""); + dto.setExamReason(examApplyDTO.getReason()); + } return dto; } @@ -598,13 +616,22 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl examApplyVO.setOrgId(classPlanDTO.getOrgId()); examApplyVO.setPlanName(classPlanDTO.getPlanName()); examApplyService.save(examApplyVO); + Map params = new HashMap<>(8); + params.put("classPlanId",classPlanId); + params.put("examImages",classPlanVO.getExamImages()); + params.put("examPDF",classPlanVO.getExamPDF()); + classPlanDao.saveExamFile(params); } @Override - public void updateExamRecommit(String classPlanId) { + public void updateExamRecommit(String classPlanId, ClassPlanVO classPlanVO) { ExamApplyVO examApplyVO = new ExamApplyVO(); examApplyVO.setCheckStatus(0); examApplyService.updateStatus(classPlanId,examApplyVO); + // 更新考试申请图片和PDF信息 + Map params = HashMapUtil.beanToMap(classPlanVO); + params.put("classPlanId", classPlanId); + classPlanDao.updateExamFile(params); } @Override diff --git a/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml b/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml index ddf1727..44d244e 100644 --- a/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml +++ b/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml @@ -478,4 +478,31 @@ class_plan_id = #{classPlanId} + + INSERT INTO e_class_plan_exam_file + (class_plan_id, exam_images, exam_pdf) + VALUES + (#{classPlanId}, #{examImages}, #{examPDF}) + + + + + + UPDATE e_class_plan_exam_file SET + exam_images = #{examImages}, + exam_pdf = #{examPDF} + WHERE + class_plan_id = #{classPlanId} + + \ No newline at end of file diff --git a/src/main/resources/static/route/classplan/list.html b/src/main/resources/static/route/classplan/list.html index a4ca0ff..3c847f5 100644 --- a/src/main/resources/static/route/classplan/list.html +++ b/src/main/resources/static/route/classplan/list.html @@ -137,7 +137,7 @@ return dom; } if(row['reportType'] === '2' && row['examType'] === '0'){ - dom += '查看详情'; + dom += '考试申请信息'; return dom; } if(row['reportType'] === '2' && row['examType'] === '1'){ @@ -145,7 +145,6 @@ return dom; } if(row['reportType'] === '2' && row['examType'] === '2'){ - dom += '查看原因'; dom += '重新申考'; return dom; } @@ -155,7 +154,7 @@ return dom; } }, - {field: 'planNumber', width: 190, title: '班号', align:'center', + {field: 'planNumber', width: 190, title: '班号', align:'left', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -164,7 +163,7 @@ return rowData; } }, - {field: 'planName', width: 180, title: '班级名称', align:'center', + {field: 'planName', width: 180, title: '班级名称', align:'left', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -308,39 +307,33 @@ shade: 0.3, yes: function (index) { top.dialog.close(index); - var layIndex; - 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) { - top.dialog.msg(data.msg); - }, function () { - layIndex = top.dialog.msg('提交中', {icon: 16, time: 0, shade: 0.3}); - }, function () { - top.dialog.close(layIndex); + layer.open({ + type: 2, + title: '提交 【' + obj.data.workerCatalogName + '】 考试申请', + closeBtn: 1, + area: ['70%', '70%'], + shadeClose: false, + anim: 2, + content: top.restAjax.path('route/classplan/save-exam-commit.html?classPlanId={classPlanId}', [obj.data.classPlanId]), + end: function () { + reloadTable(); + } }); } }); 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); - }); + layer.open({ + type: 2, + title: '重新提交 【' + obj.data.workerCatalogName + '】 考试申请', + closeBtn: 1, + area: ['70%', '70%'], + shadeClose: false, + anim: 2, + content: top.restAjax.path('route/classplan/update-exam-commit.html?classPlanId={classPlanId}', [obj.data.classPlanId]), + end: function () { + reloadTable(); } }); return; @@ -359,6 +352,20 @@ } }); } + if(layEvent == 'showExamCommitEvent') { + layer.open({ + type: 2, + title: '查看 【' + obj.data.workerCatalogName + '】 考试申请', + closeBtn: 1, + area: ['90%', '90%'], + shadeClose: false, + anim: 2, + content: top.restAjax.path('route/classplan/show-exam-commit.html?classPlanId={classPlanId}', [obj.data.classPlanId]), + end: function () { + reloadTable(); + } + }); + } if(layEvent == 'showReasonEvent') { var reason = obj.data.examReason == '' ? '未填写原因' : obj.data.examReason; layer.open({ diff --git a/src/main/resources/static/route/classplan/save-exam-commit.html b/src/main/resources/static/route/classplan/save-exam-commit.html new file mode 100644 index 0000000..754c85f --- /dev/null +++ b/src/main/resources/static/route/classplan/save-exam-commit.html @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/classplan/show-exam-commit.html b/src/main/resources/static/route/classplan/show-exam-commit.html new file mode 100644 index 0000000..8a4e2ae --- /dev/null +++ b/src/main/resources/static/route/classplan/show-exam-commit.html @@ -0,0 +1,640 @@ + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+ + + + + + + + + + + + + +
确认课程选择讲师授课时间课程名称课程类型授课方式
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/classplan/update-exam-commit.html b/src/main/resources/static/route/classplan/update-exam-commit.html new file mode 100644 index 0000000..f511c82 --- /dev/null +++ b/src/main/resources/static/route/classplan/update-exam-commit.html @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + +
+
+
+
+ +
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/traininginstitution/update-creator.html b/src/main/resources/static/route/traininginstitution/update-creator.html new file mode 100644 index 0000000..055912c --- /dev/null +++ b/src/main/resources/static/route/traininginstitution/update-creator.html @@ -0,0 +1,444 @@ + + + + + + + + + + + + + + +
+
+ + + + + + +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ + + +
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + + + + + + + \ No newline at end of file