From 49978c26a01d53bf155b005581d7e31dfae90fd0 Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Tue, 11 May 2021 09:19:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=80=83=E8=AF=95=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=AF=B9=E6=8E=A5=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 | 13 +- .../pojo/dtos/classplan/ClassPlanDTO.java | 30 ++ .../pojo/vos/classplan/ClassPlanVO.java | 30 ++ .../service/classplan/IClassPlanService.java | 13 + .../classplan/impl/ClassPlanServiceImpl.java | 70 +++- .../route/classplan/list-report-exam.html | 217 +++--------- .../route/classplan/list-signup-user.html | 322 ++++++++++++++++++ .../static/route/classplan/list.html | 97 ++++-- .../route/classplan/save-report-exam.html | 126 +++++++ .../static/route/classplan/save.html | 57 ++-- .../static/route/classplan/show.html | 322 ++++++++++++++++++ .../static/route/classplan/update.html | 74 ++-- .../static/route/lessons/list-tree.html | 2 + .../resources/static/route/lessons/list.html | 5 + 14 files changed, 1110 insertions(+), 268 deletions(-) create mode 100644 src/main/resources/static/route/classplan/list-signup-user.html create mode 100644 src/main/resources/static/route/classplan/save-report-exam.html create mode 100644 src/main/resources/static/route/classplan/show.html 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 222d52b..5ebb4e3 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 @@ -118,7 +118,7 @@ public class ClassPlanController extends DefaultBaseController { params.put("examNowDate", DateUtil.getTime()); params.put("reportType", "2"); page.setParams(params); - return classPlanService.listPage(page); + return classPlanService.listPageExam(page); } @ApiOperation(value = "统计", notes = "统计接口") @@ -141,4 +141,15 @@ public class ClassPlanController extends DefaultBaseController { return new SuccessResult(); } + @ApiOperation(value = "提交考试申请", notes = "提交考试申请接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "classPlanId", value = "ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("update-exam/{classPlanId}") + public SuccessResult updateExamType(@PathVariable("classPlanId") String classPlanId, @RequestBody ClassPlanVO classPlanVO) { + classPlanService.updateExamType(classPlanId, classPlanVO); + return new SuccessResult(); + } + } \ 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 2ea7bfb..37111c1 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 @@ -67,6 +67,12 @@ public class ClassPlanDTO { private String orgName; @ApiModelProperty(name = "classPlanLessons", value = "计划下课程列表") private List> classPlanLessons; + @ApiModelProperty(name = "signUpUserCount", value = "已报名完成人数") + private Integer signUpUserCount; + @ApiModelProperty(name = "examType", value = "考试申请状态0未审核1审核通过2审核驳回") + private String examType; + @ApiModelProperty(name = "examReason", value = "考试申请原因") + private String examReason; public String getPlanNumber() { @@ -239,4 +245,28 @@ public class ClassPlanDTO { public void setClassPlanLessons(List> classPlanLessons) { this.classPlanLessons = classPlanLessons; } + + public Integer getSignUpUserCount() { + return signUpUserCount; + } + + public void setSignUpUserCount(Integer signUpUserCount) { + this.signUpUserCount = signUpUserCount; + } + + public String getExamType() { + return examType == null ? "" : examType; + } + + public void setExamType(String examType) { + this.examType = examType; + } + + public String getExamReason() { + return examReason == null ? "" : examReason; + } + + public void setExamReason(String examReason) { + this.examReason = examReason; + } } 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 732e069..740a683 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 @@ -48,6 +48,12 @@ public class ClassPlanVO { private String reportType; @ApiModelProperty(name = "reportReason", value = "报备审核原因") private String reportReason; + @ApiModelProperty(name = "estimateStart", value = "预计考试开始时间") + private String estimateStart; + @ApiModelProperty(name = "estimateEnd", value = "预计考试结束时间") + private String estimateEnd; + @ApiModelProperty(name = "examType", value = "考试申请类型1理论2实操3理论与实操") + private String examType; public String getPlanNumber() { return planNumber == null ? "" : planNumber.trim(); @@ -184,4 +190,28 @@ public class ClassPlanVO { public void setReportReason(String reportReason) { this.reportReason = reportReason; } + + public String getExamType() { + return examType == null ? "" : examType; + } + + public void setExamType(String examType) { + this.examType = examType; + } + + public String getEstimateStart() { + return estimateStart == null ? "" : estimateStart; + } + + public void setEstimateStart(String estimateStart) { + this.estimateStart = estimateStart; + } + + public String getEstimateEnd() { + return estimateEnd == null ? "" : estimateEnd; + } + + public void setEstimateEnd(String estimateEnd) { + this.estimateEnd = estimateEnd; + } } 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 2ef4f5d..29c4d72 100644 --- a/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java +++ b/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java @@ -206,4 +206,17 @@ public interface IClassPlanService { */ void updateReportType(String classPlanId, ClassPlanVO classPlanVO); + /** + * 查询考试计划分页列表 + * @param page + * @return + */ + SuccessResultList> listPageExam(ListPage page); + + /** + * 提交考试申请接口 + * @param classPlanId + * @param classPlanVO + */ + void updateExamType(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 d5d4b1a..6aee96e 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 @@ -4,12 +4,17 @@ import cn.com.tenlion.dao.classplan.IClassPlanDao; import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO; import cn.com.tenlion.institutionmanagement.service.institution.IInstitutionService; import cn.com.tenlion.pojo.bos.classplan.ClassPlanBO; +import cn.com.tenlion.pojo.dtos.apply.ApplyDTO; import cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO; +import cn.com.tenlion.pojo.dtos.examapply.ExamApplyDTO; import cn.com.tenlion.pojo.dtos.worktype.WorkTypeDTO; import cn.com.tenlion.pojo.pos.classplan.ClassPlanPO; import cn.com.tenlion.pojo.vos.classplan.ClassPlanVO; +import cn.com.tenlion.pojo.vos.examapply.ExamApplyVO; import cn.com.tenlion.pojo.vos.examcheck.ExamCheckVO; +import cn.com.tenlion.service.apply.IApplyService; import cn.com.tenlion.service.classplan.IClassPlanService; +import cn.com.tenlion.service.examapply.IExamApplyService; import cn.com.tenlion.service.examcheck.IExamCheckService; import cn.com.tenlion.service.worktype.IWorkTypeService; import com.alibaba.fastjson.JSONArray; @@ -43,15 +48,22 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl @Autowired private IClassPlanDao classPlanDao; - @Autowired private IExamCheckService examCheckService; @Autowired private IDataService dataService; + //工种信息 @Autowired private IWorkTypeService workTypeService; + //机构信息 @Autowired private IInstitutionService iInstitutionService; + //报名情况 + @Autowired + private IApplyService applyService; + //考试申请 + @Autowired + private IExamApplyService examApplyService; @Override public void save(ClassPlanVO classPlanVO) { @@ -285,6 +297,7 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl } PageHelper.startPage(page.getPage(), page.getRows()); List classPlanDTOs = list(page.getParams()); + Map queryMap = getHashMap(4); for(ClassPlanDTO item : classPlanDTOs){ //处理培训项目 DataDTO dataDTO = dataService.get(item.getProjectCatalogId()); @@ -292,7 +305,49 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl //处理工种类型 WorkTypeDTO workTypeDTO = workTypeService.get(item.getWorkerCatalog()); item.setWorkerCatalogName(workTypeDTO.getWorkTypeName()); + //查询已报名人数 + queryMap.put("applyClassId",item.getClassPlanId()); + List applyAuditStates = new ArrayList<>(); + applyAuditStates.add("3"); + queryMap.put("applyAuditStates",applyAuditStates); + List list = applyService.list(queryMap); + item.setSignUpUserCount(list == null ? 0 : list.size()); + } + PageInfo pageInfo = new PageInfo<>(classPlanDTOs); + return new SuccessResultList<>(classPlanDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + @Override + public SuccessResultList> listPageExam(ListPage page) { + if(page.getParams().get("orgId") == null + || page.getParams().get("orgId").toString().length() == 0){ + return new SuccessResultList<>(new ArrayList<>(), 0, 0L); + } + PageHelper.startPage(page.getPage(), page.getRows()); + List classPlanDTOs = list(page.getParams()); + Map queryMap = getHashMap(4); + for(ClassPlanDTO item : classPlanDTOs){ + //处理培训项目 + DataDTO dataDTO = dataService.get(item.getProjectCatalogId()); + item.setProjectCatalogName(dataDTO.getDataName()); + //处理工种类型 + WorkTypeDTO workTypeDTO = workTypeService.get(item.getWorkerCatalog()); + item.setWorkerCatalogName(workTypeDTO.getWorkTypeName()); + //查询已报名人数 + queryMap.put("applyClassId",item.getClassPlanId()); + List applyAuditStates = new ArrayList<>(); + applyAuditStates.add("3"); + queryMap.put("applyAuditStates",applyAuditStates); + List list = applyService.list(queryMap); + item.setSignUpUserCount(list == null ? 0 : list.size()); + //查询计划申请状态 + queryMap.clear(); + queryMap.put("examId",item.getClassPlanId()); + ExamApplyDTO examApplyDTO = examApplyService.get(queryMap); + item.setExamType(""); + if(examApplyDTO != null){ + item.setExamType(examApplyDTO.getCheckStatus() + ""); + } } PageInfo pageInfo = new PageInfo<>(classPlanDTOs); return new SuccessResultList<>(classPlanDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); @@ -304,4 +359,17 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl return count == null ? 0 : count; } + @Override + public void updateExamType(String classPlanId, ClassPlanVO classPlanVO) { + ExamApplyVO examApplyVO = new ExamApplyVO(); + examApplyVO.setExamId(classPlanId); + examApplyVO.setExamType(Integer.parseInt(classPlanVO.getExamType())); + examApplyVO.setTheoryExamStartTime(classPlanVO.getEstimateStart()); + examApplyVO.setTheoryExamEndTime(classPlanVO.getEstimateEnd()); + if("3".equals(classPlanVO.getExamType())){ + examApplyVO.setPracticeExamStartTime(classPlanVO.getEstimateStart()); + examApplyVO.setPracticeExamEndTime(classPlanVO.getEstimateEnd()); + } + examApplyService.save(examApplyVO); + } } \ No newline at end of file diff --git a/src/main/resources/static/route/classplan/list-report-exam.html b/src/main/resources/static/route/classplan/list-report-exam.html index 48841c7..01bd595 100644 --- a/src/main/resources/static/route/classplan/list-report-exam.html +++ b/src/main/resources/static/route/classplan/list-report-exam.html @@ -21,10 +21,10 @@
- +
- +
+ +
+ + + + + + + + + + \ 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 d491be7..2115879 100644 --- a/src/main/resources/static/route/classplan/list.html +++ b/src/main/resources/static/route/classplan/list.html @@ -38,7 +38,7 @@ 新增 + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/classplan/save.html b/src/main/resources/static/route/classplan/save.html index 9d32ba5..2d13d53 100644 --- a/src/main/resources/static/route/classplan/save.html +++ b/src/main/resources/static/route/classplan/save.html @@ -23,30 +23,30 @@
-
+
- +
-
-
- +
- +
-
+
+
+
- +
- +
@@ -54,7 +54,7 @@
- +
- +
- +
- +
- +
- +
@@ -94,7 +94,7 @@
- +
@@ -102,7 +102,7 @@
- +
@@ -110,7 +110,7 @@
- +
@@ -118,7 +118,7 @@
- +
@@ -128,17 +128,17 @@
- +
- +
- +
- +
@@ -147,9 +147,9 @@
- +
- +
@@ -441,6 +441,11 @@ // 校验 form.verify({ + checkPlanPersonNum : function(value){ + if(value <= 0){ + return '计划人数必须大于0'; + } + } }); }); diff --git a/src/main/resources/static/route/classplan/show.html b/src/main/resources/static/route/classplan/show.html new file mode 100644 index 0000000..7b3199c --- /dev/null +++ b/src/main/resources/static/route/classplan/show.html @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + +
+
+ +
+ +
+
+
+ +
+ + +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+ + + + + + + + + + + + +
确认课程选择讲师课程名称课程类型授课方式
+
+
+ +
+
+
+ + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/classplan/update.html b/src/main/resources/static/route/classplan/update.html index e3f44ba..a797faf 100644 --- a/src/main/resources/static/route/classplan/update.html +++ b/src/main/resources/static/route/classplan/update.html @@ -17,37 +17,37 @@
-
+
- +
+
+
+ +
+ +
+
+
- +
- -
-
-
-
-
- -
- +
@@ -55,9 +55,9 @@
- +
- @@ -67,27 +67,27 @@
- +
- +
- +
- +
- +
- +
@@ -95,7 +95,7 @@
- +
@@ -103,7 +103,7 @@
- +
@@ -111,7 +111,7 @@
- +
@@ -119,7 +119,7 @@
- +
@@ -129,17 +129,17 @@
- +
- +
- +
- +
@@ -148,9 +148,9 @@
- +
- +
@@ -207,7 +207,7 @@
@@ -233,9 +233,6 @@ var admin = layui.admin; var laytpl = layui.laytpl; var laydate = layui.laydate; - var wangEditor = window.wangEditor; - var wangEditorObj = {}; - var viewerObj = {}; var teacherList = []; var classPlanLessons = []; var classPlanId = top.restAjax.params(window.location.href).classPlanId; @@ -254,7 +251,7 @@ dataFormData['signUpEndTime'] = dataFormData['signUpEndTime'].substring(0,10); form.val('dataForm', dataFormData); form.render(null, 'dataForm'); - if(dataFormData['reportReason'] = ''){ + if(dataFormData['reportReason'] != ''){ $('#report-reason-block').show(); } initPlanStartTimeDateTime(); @@ -471,6 +468,11 @@ // 校验 form.verify({ + checkPlanPersonNum : function(value){ + if(value <= 0){ + return '计划人数必须大于0'; + } + } }); }); diff --git a/src/main/resources/static/route/lessons/list-tree.html b/src/main/resources/static/route/lessons/list-tree.html index 020c88c..093120a 100644 --- a/src/main/resources/static/route/lessons/list-tree.html +++ b/src/main/resources/static/route/lessons/list-tree.html @@ -51,6 +51,8 @@ function initData(){ initSize(); initThree(); + $('#listContent').attr('src', top.restAjax.path('route/lessons/list.html?projectCatalogId={parentId}&parentName={parentName}', + ['',''])); } initData(); diff --git a/src/main/resources/static/route/lessons/list.html b/src/main/resources/static/route/lessons/list.html index 9fd55a9..6cf3134 100644 --- a/src/main/resources/static/route/lessons/list.html +++ b/src/main/resources/static/route/lessons/list.html @@ -234,6 +234,11 @@ layer.msg('当前用户未绑定机构信息'); return; } + if(typeof (projectCatalogId) === 'undefined' + || projectCatalogId === ''){ + layer.msg('请先在左侧选择培训项目'); + return; + } layer.open({ type: 2, title: false,