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 92fe69c..6e2931c 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 @@ -54,7 +54,7 @@ public class ClassPlanController extends DefaultBaseController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PutMapping("update/{classPlanId}") @CheckRequestBodyAnnotation - public SuccessResult update(@PathVariable("classPlanId") String classPlanId, @RequestBody JSONObject obj) { + public SuccessResult update(@PathVariable("classPlanId") String classPlanId, @RequestBody JSONObject obj) throws Exception{ obj.put("classPlanId",classPlanId); classPlanService.updateJson(obj); return new SuccessResult(); @@ -154,6 +154,19 @@ 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-recommit/{classPlanId}") + public SuccessResult updateExamRecommit(@PathVariable("classPlanId") String classPlanId) { + classPlanService.updateExamRecommit(classPlanId); + return new SuccessResult(); + } + + + @ApiOperation(value = "查询考试申请详情", notes = "查询考试申请详情接口") @ApiImplicitParams({ @ApiImplicitParam(name = "classPlanId", value = "ID", paramType = "path") 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 f8ca14a..2d6e2e9 100644 --- a/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java +++ b/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java @@ -136,10 +136,17 @@ public interface IClassPlanDao { */ void deleteClassPlanLessons(Map params); + /** + * 逻辑删除开班计划下所有老师的授课时刻安排 + * @param params + */ + void deleteTeacherLessonsTime(Map params); + /** * 根据机构id统计计划的分类数量 * @param params * @return */ Map countPlanType(Map params); + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/lessons/LessonsDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/lessons/LessonsDTO.java index 1d9eae6..a3b73b9 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/lessons/LessonsDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/lessons/LessonsDTO.java @@ -26,21 +26,11 @@ public class LessonsDTO { private String lessonType; @ApiModelProperty(name = "teachWay", value = "授课方式1面授") private String teachWay; - @ApiModelProperty(name = "creator", value = "") - private String creator; - @ApiModelProperty(name = "gmtCreate", value = "") - private String gmtCreate; - @ApiModelProperty(name = "modifier", value = "") - private String modifier; - @ApiModelProperty(name = "gmtModified", value = "") - private String gmtModified; - @ApiModelProperty(name = "isDelete", value = "") - private Integer isDelete; @ApiModelProperty(name = "projectCatalogName", value = "培训项目") private String projectCatalogName; public String getLessonId() { - return lessonId == null ? "" : lessonId.trim(); + return lessonId == null ? "" : lessonId; } public void setLessonId(String lessonId) { @@ -56,7 +46,7 @@ public class LessonsDTO { } public String getProjectCatalogId() { - return projectCatalogId == null ? "" : projectCatalogId.trim(); + return projectCatalogId == null ? "" : projectCatalogId; } public void setProjectCatalogId(String projectCatalogId) { @@ -64,7 +54,7 @@ public class LessonsDTO { } public String getLessonName() { - return lessonName == null ? "" : lessonName.trim(); + return lessonName == null ? "" : lessonName; } public void setLessonName(String lessonName) { @@ -72,7 +62,7 @@ public class LessonsDTO { } public String getLessonType() { - return lessonType == null ? "" : lessonType.trim(); + return lessonType == null ? "" : lessonType; } public void setLessonType(String lessonType) { @@ -80,53 +70,13 @@ public class LessonsDTO { } public String getTeachWay() { - return teachWay == null ? "" : teachWay.trim(); + return teachWay == null ? "" : teachWay; } public void setTeachWay(String teachWay) { this.teachWay = teachWay; } - public String getCreator() { - return creator == null ? "" : creator.trim(); - } - - public void setCreator(String creator) { - this.creator = creator; - } - - public String getGmtCreate() { - return gmtCreate == null ? "" : gmtCreate.trim(); - } - - public void setGmtCreate(String gmtCreate) { - this.gmtCreate = gmtCreate; - } - - public String getModifier() { - return modifier == null ? "" : modifier.trim(); - } - - public void setModifier(String modifier) { - this.modifier = modifier; - } - - public String getGmtModified() { - return gmtModified == null ? "" : gmtModified.trim(); - } - - public void setGmtModified(String gmtModified) { - this.gmtModified = gmtModified; - } - - public Integer getIsDelete() { - return isDelete == null ? 0 : isDelete; - } - - public void setIsDelete(Integer isDelete) { - this.isDelete = isDelete; - } - public String getProjectCatalogName() { return projectCatalogName == null ? "" : projectCatalogName; } 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 4fa1df5..cc40f98 100644 --- a/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java +++ b/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java @@ -103,7 +103,7 @@ public interface IClassPlanService { * @param obj * @return */ - void updateJson(JSONObject obj); + void updateJson(JSONObject obj) throws Exception; /** * 修改 @@ -271,4 +271,10 @@ public interface IClassPlanService { * @return */ Map getSignUserCounts(Map params); + + /** + * 重新提交考试申请 + * @param classPlanId + */ + void updateExamRecommit(String classPlanId); } \ 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 e5c2ebb..ff970e8 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 @@ -231,38 +231,111 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl } @Override - public void updateJson(JSONObject obj) { + public void updateJson(JSONObject obj) throws Exception{ String classPlanId = obj.getString("classPlanId"); ClassPlanVO classPlanVO = new ClassPlanVO(); classPlanVO.setClassPlanId(classPlanId); classPlanVO.setOrgId(obj.getString("orgId")); classPlanVO.setPlanNumber(obj.getString("planNumber")); classPlanVO.setPlanName(obj.getString("planName")); - classPlanVO.setPlanType(obj.getString("planType")); classPlanVO.setProjectCatalogId(obj.getString("projectCatalogId")); classPlanVO.setWorkerCatalog(obj.getString("workerCatalog")); - classPlanVO.setPlanPersonNum(Integer.parseInt(obj.getString("planPersonNum"))); classPlanVO.setPlanStartTime(obj.getString("planStartTime")); classPlanVO.setPlanEndTime(obj.getString("planEndTime")); - classPlanVO.setSignUpStartTime(obj.getString("signUpStartTime")); - classPlanVO.setSignUpEndTime(obj.getString("signUpEndTime")); classPlanVO.setPlanAddress(obj.getString("planAddress")); classPlanVO.setChargePerson(obj.getString("chargePerson")); classPlanVO.setChargePersonTel(obj.getString("chargePersonTel")); - classPlanVO.setReportType("0"); - classPlanVO.setReportReason(""); Map params = HashMapUtil.beanToMap(classPlanVO); setUpdateInfo(params); classPlanDao.update(params); + // 更新完成后修改审核状态 + ExamCheckVO checkVO = new ExamCheckVO(); + checkVO.setPlanId(classPlanId); + checkVO.setOrgId(obj.getString("orgId")); + checkVO.setWorkTypeId(obj.getString("workerCatalog")); + checkVO.setCheckStatus(0); + checkVO.setReason(""); + examCheckService.updateByClassPlanId(classPlanId,checkVO); + String planStartTime = obj.getString("planStartTime"); + String planEndTime = obj.getString("planEndTime"); + // 删除历史课程信息 classPlanDao.deleteClassPlanLessons(params); - //保存课程及讲师 + // 删除该开班计划下所有讲师授课记录 + classPlanDao.deleteTeacherLessonsTime(params); + // 处理开班时间日期转换为list + List dayList = new ArrayList<>(); + long daySub = DateUtil.getDaySub(planStartTime, planEndTime); + if(daySub == 0L){ + dayList.add(planStartTime); + } else { + for(long i = 0; i <= daySub; i++){ + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); + Date startDate = sd.parse(planStartTime); + String formatDate = sd.format(startDate.getTime() + (i * 24 * 60 * 60 * 1000)); + dayList.add(formatDate); + } + } + // 校验每一天课程是否冲突 JSONArray array = obj.getJSONArray("lessonList"); - params.clear(); + Map query = getHashMap(8); for(int i = 0; i < array.size(); i++){ JSONObject item = array.getJSONObject(i); + String lessonStartTime = item.getString("lessonStartTime") + ":00"; + String lessonEndTime = item.getString("lessonEndTime") + ":00"; + // 查询当前教师信息 + TeacherDTO teacherDTO = teacher.getById(item.getString("teacherId")); + query.clear(); + query.put("teacherIdCard",teacherDTO.getIdCardNumber()); + List tlList = teacher.listTeacherLessonsTime(query); + if(tlList != null && tlList.size() > 0){ + for(String tempDate : dayList){ + String sDateTime = tempDate + " " + lessonStartTime; + String eDateTime = tempDate + " " + lessonEndTime; + for(TeacherLessonsTimeDTO tlMap : tlList){ + String ssDateTime = tlMap.getStartTime(); + String eeDateTime = tlMap.getStartEnd(); + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + if(sd.parse(eDateTime).getTime() < sd.parse(ssDateTime).getTime() + || sd.parse(sDateTime).getTime() > sd.parse(eeDateTime).getTime()){ + //...没有发生冲突 + } else { + throw new SaveException("【"+teacherDTO.getTeacherName()+"】与其他课程安排时间冲突 " + + ssDateTime + " 至 " + eeDateTime + ""); + } + } + params.put("classPlanId",classPlanId); + params.put("teacherId",teacherDTO.getTeacherId()); + params.put("teacherIdCard", teacherDTO.getIdCardNumber()); + params.put("orgId",teacherDTO.getOrgId()); + params.put("projectCatalogId",obj.getString("projectCatalogId")); + params.put("workerCatalog",obj.getString("workerCatalog")); + params.put("lessonId",item.getString("lessonId")); + params.put("startTime",sDateTime); + params.put("endTime",eDateTime); + teacher.saveTeacherLessonsTime(params); + } + } else { + for(String tempDate : dayList){ + String sDateTime = tempDate + " " + lessonStartTime; + String eDateTime = tempDate + " " + lessonEndTime; + params.put("classPlanId",classPlanId); + params.put("teacherId",teacherDTO.getTeacherId()); + params.put("teacherIdCard", teacherDTO.getIdCardNumber()); + params.put("orgId",teacherDTO.getOrgId()); + params.put("projectCatalogId",obj.getString("projectCatalogId")); + params.put("workerCatalog",obj.getString("workerCatalog")); + params.put("lessonId",item.getString("lessonId")); + params.put("startTime",sDateTime); + params.put("endTime",eDateTime); + teacher.saveTeacherLessonsTime(params); + } + } + params.clear(); params.put("classPlanId",classPlanId); params.put("lessonId",item.getString("lessonId")); params.put("teacherId",item.getString("teacherId")); + params.put("lessonStart",item.getString("lessonStartTime")); + params.put("lessonEnd",item.getString("lessonEndTime")); params.put("isDelete",item.getString("teacherId")); classPlanDao.saveClassPlanLesson(params); } @@ -422,6 +495,7 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl } else { // 0待审核 1审核通过 2退回 item.setExamType(examApplyDTO.getCheckStatus() + ""); + item.setExamReason(examApplyDTO.getReason()); } //查询报名人数 if(examCheck.getCheckStatus() == 2){ @@ -523,6 +597,13 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl examApplyService.save(examApplyVO); } + @Override + public void updateExamRecommit(String classPlanId) { + ExamApplyVO examApplyVO = new ExamApplyVO(); + examApplyVO.setCheckStatus(0); + examApplyService.updateStatus(classPlanId,examApplyVO); + } + @Override public ClassPlanReportExamDTO getReportExamDetail(String classPlanId) { Map queryMap = getHashMap(8); 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 b114712..828c3e5 100644 --- a/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml +++ b/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml @@ -438,7 +438,9 @@ SELECT t1.class_plan_id classPlanId, t1.lesson_id lessonId, - t1.teacher_id teacherId + t1.teacher_id teacherId, + t1.lesson_start lessonStart, + t1.lesson_end lessonEnd FROM e_class_plan_lesson t1 WHERE @@ -453,4 +455,11 @@ class_plan_id = #{classPlanId} + + UPDATE e_teach_lessons_time SET + is_delete = '1' + WHERE + class_plan_id = #{classPlanId} + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/lessons/lessons-mapper.xml b/src/main/resources/mybatis/mapper/lessons/lessons-mapper.xml index 204b71e..9670f3f 100644 --- a/src/main/resources/mybatis/mapper/lessons/lessons-mapper.xml +++ b/src/main/resources/mybatis/mapper/lessons/lessons-mapper.xml @@ -9,11 +9,6 @@ - - - - - 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 47c6f6a..69a55f3 100644 --- a/src/main/resources/static/route/classplan/list-signup-user.html +++ b/src/main/resources/static/route/classplan/list-signup-user.html @@ -82,7 +82,8 @@ where :{ applyInstitutionId: orgId, applyWorkTypeId : workerCatalog, - applyClassId : reportType == "2" ? classPlanId : '' + applyClassId : reportType == "2" ? classPlanId : '', + applyAuditStates : '2' }, toolbar: false, request: { @@ -152,7 +153,7 @@ applyInstitutionId: orgId, applyWorkTypeId : workerCatalog, applyClassId : reportType == "2" ? classPlanId : '', - applyAuditStates:$('#applyAuditStates').val(), + applyAuditStates : '2', }, page: { curr: currentPage diff --git a/src/main/resources/static/route/classplan/list-signup.html b/src/main/resources/static/route/classplan/list-signup.html index ff7ed9c..e715221 100644 --- a/src/main/resources/static/route/classplan/list-signup.html +++ b/src/main/resources/static/route/classplan/list-signup.html @@ -152,7 +152,6 @@ } else { $('#totalSignUpUser').text('预计人数'); $('#totalSignUpUserNumber').text('50 人'); - $('#class-plan-btn-event').show(); } }, function (code, data) { top.dialog.msg(data.msg); diff --git a/src/main/resources/static/route/classplan/list.html b/src/main/resources/static/route/classplan/list.html index 7a67d58..a4ca0ff 100644 --- a/src/main/resources/static/route/classplan/list.html +++ b/src/main/resources/static/route/classplan/list.html @@ -115,16 +115,16 @@ return dom; } if(row['reportType'] === '2' && row['examType'] === '2' ){ - dom += '考试申请不通过'; + dom += '考试申请驳回'; return dom; } if(row['reportType'] === '3'){ - return '开班不通过'; + return '开班不通过'; } return dom; } }, - {width:120, title: '操作', fixed: 'left', align:'center', + {width:160, title: '操作', fixed: 'left', align:'center', templet: function(row) { var dom = ''; if(row['reportType'] === '0'){ @@ -132,23 +132,25 @@ return dom; } if(row['reportType'] === '2' && row['examType'] === ''){ + dom += '查看详情'; dom += '申请考试'; return dom; } if(row['reportType'] === '2' && row['examType'] === '0'){ - dom += '查看申请'; + dom += '查看详情'; return dom; } if(row['reportType'] === '2' && row['examType'] === '1'){ dom += '查看考试安排'; return dom; } - if(row['reportType'] === '2' && row['examType'] === '1'){ - dom += '再次申请考试'; + if(row['reportType'] === '2' && row['examType'] === '2'){ + dom += '查看原因'; + dom += '重新申考'; return dom; } if(row['reportType'] === '3'){ - return '重新审核'; + return '重新编辑'; } return dom; } @@ -283,29 +285,6 @@ }); } - // 删除 - function removeData(ids) { - top.dialog.msg(top.dataMessage.delete, { - 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.delete(top.restAjax.path('api/classplan/remove/{ids}', [ids]), {}, null, function (code, data) { - top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000}); - reloadTable(); - }, function (code, data) { - top.dialog.msg(data.msg); - }, function () { - layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3}); - }, function () { - top.dialog.close(layIndex); - }); - } - }); - } - // 事件 - 页面变化 $win.on('resize', function() { clearTimeout(resizeTimeout); @@ -369,7 +348,7 @@ if(layEvent == 'showEvent') { layer.open({ type: 2, - title: '查看开班申请', + title: '查看 【' + obj.data.workerCatalogName + '】 开班申请', closeBtn: 1, area: ['90%', '90%'], shadeClose: false, @@ -380,6 +359,21 @@ } }); } + if(layEvent == 'showReasonEvent') { + var reason = obj.data.examReason == '' ? '未填写原因' : obj.data.examReason; + layer.open({ + type: 1, + title: '申请不通过原因', + closeBtn: 1, + offset:'200px', + area: ['300px', '150px'], + shadeClose: false, + content: '
'+ reason +'
', + end: function () { + reloadTable(); + } + }); + } if(layEvent == 'showExamEvent') { layer.open({ type: 2, @@ -397,10 +391,10 @@ if(layEvent == 'unPassEvent') { layer.open({ type: 2, - title: false, - closeBtn: 0, - area: ['100%', '100%'], - shadeClose: true, + title: '重新编辑 【' +obj.data.workerCatalogName + '】 开班申请', + closeBtn: 1, + area: ['90%', '90%'], + shadeClose: false, anim: 2, content: top.restAjax.path('route/classplan/update.html?classPlanId={classPlanId}', [obj.data.classPlanId]), end: function () { diff --git a/src/main/resources/static/route/classplan/save.html b/src/main/resources/static/route/classplan/save.html index e410ddc..7e1ac0a 100644 --- a/src/main/resources/static/route/classplan/save.html +++ b/src/main/resources/static/route/classplan/save.html @@ -19,7 +19,7 @@
- +
@@ -147,12 +147,12 @@
+ style="width: 150px" placeholder="开始时间" readonly>
+ style="width: 150px" placeholder="结束时间" readonly>
@@ -417,7 +417,6 @@ var obj = {}; obj['lessonId'] = $(e).attr('data-lesson-id'); obj['teacherId'] = $('#select-' + obj['lessonId']).val(); - obj['teacherId'] = $('#select-' + obj['lessonId']).val(); obj['lessonStartTime'] = $('#date-start-' + obj['lessonId']).val(); obj['lessonEndTime'] = $('#date-end-' + obj['lessonId']).val(); lessonList.push(obj); diff --git a/src/main/resources/static/route/classplan/show.html b/src/main/resources/static/route/classplan/show.html index 891f8cd..9b9c379 100644 --- a/src/main/resources/static/route/classplan/show.html +++ b/src/main/resources/static/route/classplan/show.html @@ -12,30 +12,27 @@ -
+
-
- +
-
+
+
+
- +
- +
@@ -43,39 +40,27 @@
- +
- +
- +
- -
- - -
-
-
-
-
-
-
- +
@@ -83,7 +68,7 @@
- +
@@ -93,17 +78,19 @@
- +
- +
- +
- +
@@ -112,9 +99,10 @@
- +
- +
@@ -125,7 +113,8 @@ 确认课程 - 选择讲师 + 选择讲师 + 授课时间 课程名称 课程类型 授课方式 @@ -146,6 +135,19 @@ {{# } }} + +
+
+ +
+ 至 +
+ +
+
+ {{item.lessonName}} @@ -195,6 +197,7 @@ // 初始化内容 function initData() { + $('.layui-card').height($win.height()); var loadLayerIndex; top.restAjax.get(top.restAjax.path('api/classplan/get/{classPlanId}', [classPlanId]), {}, null, function(code, data) { var dataFormData = {}; @@ -266,6 +269,8 @@ $(checkBox).attr('checked', 'checked'); $('#select-' + e.lessonId).val(e.teacherId); $('#select-' + e.lessonId).attr("disabled","disabled"); + $('#date-start-' + e.lessonId).val(e.lessonStart); + $('#date-end-' + e.lessonId).val(e.lessonEnd); }); form.render(); } diff --git a/src/main/resources/static/route/classplan/update.html b/src/main/resources/static/route/classplan/update.html index b73fd3e..4c247c0 100644 --- a/src/main/resources/static/route/classplan/update.html +++ b/src/main/resources/static/route/classplan/update.html @@ -12,40 +12,28 @@ -
+
-
+ +
- +
- - -
-
-
-
-
- -
- +
-
+
- +
@@ -57,10 +45,9 @@
- -
@@ -70,58 +57,23 @@
- +
- +
- - +
- +
- -
-
-
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- +
@@ -159,13 +111,14 @@
- - - - - - - + + + + + + + +
确认课程选择讲师课程名称课程类型授课方式
确认课程选择讲师授课时间课程名称课程类型授课方式