Merge remote-tracking branch 'origin/baotou-signup' into baotou-signup

This commit is contained in:
Renpc-kilig 2021-06-16 18:29:49 +08:00
commit 3e8192b952
3 changed files with 60 additions and 23 deletions

View File

@ -160,10 +160,10 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
params.put("teacherName",item.getString("teacherName")); params.put("teacherName",item.getString("teacherName"));
params.put("startDate",item.getString("startDate")); params.put("startDate",item.getString("startDate"));
params.put("endDate",item.getString("endDate")); params.put("endDate",item.getString("endDate"));
params.put("startTime",item.getString("startTime") + ":00"); params.put("startTime",item.getString("startTime"));
params.put("endTime",item.getString("endTime") + ":00"); params.put("endTime",item.getString("endTime"));
classPlanDao.saveClassPlanLesson(params); classPlanDao.saveClassPlanLesson(params);
// TODO 这里还需要将讲师的课程安排时刻表进行拆分整理单独存表(e_teach_lessons_time) saveTeacherLessonsTime(params);
} }
// 处理完成后自动提交审核 // 处理完成后自动提交审核
ExamCheckVO checkVO = new ExamCheckVO(); ExamCheckVO checkVO = new ExamCheckVO();
@ -194,14 +194,11 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
classPlanVO.setPlanPDF(obj.getString("planPDF")); classPlanVO.setPlanPDF(obj.getString("planPDF"));
Map<String, Object> params = HashMapUtil.beanToMap(classPlanVO); Map<String, Object> params = HashMapUtil.beanToMap(classPlanVO);
setUpdateInfo(params); setUpdateInfo(params);
//classPlanDao.update(params); classPlanDao.update(params);
// 删除历史课程信息 // 删除历史课程信息
classPlanDao.deleteClassPlanLessons(params); classPlanDao.deleteClassPlanLessons(params);
// 删除该培训计划下所有授课时刻表
// TODO 这里需要在添加了讲师时刻后进行添加 classPlanDao.deleteTeacherLessonsTime(params);
// classPlanDao.deleteTeacherLessonsTime(params);
//保存课程及讲师 //保存课程及讲师
JSONArray array = obj.getJSONArray("lessonList"); JSONArray array = obj.getJSONArray("lessonList");
params.clear(); params.clear();
@ -216,12 +213,11 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
params.put("teacherName",item.getString("teacherName")); params.put("teacherName",item.getString("teacherName"));
params.put("startDate",item.getString("startDate")); params.put("startDate",item.getString("startDate"));
params.put("endDate",item.getString("endDate")); params.put("endDate",item.getString("endDate"));
params.put("startTime",item.getString("startTime") + ":00"); params.put("startTime",item.getString("startTime"));
params.put("endTime",item.getString("endTime") + ":00"); params.put("endTime",item.getString("endTime"));
classPlanDao.saveClassPlanLesson(params); classPlanDao.saveClassPlanLesson(params);
// TODO 这里还需要将讲师的课程安排时刻表进行拆分整理单独存表(e_teach_lessons_time) saveTeacherLessonsTime(params);
} }
// 更新完成后修改审核状态 // 更新完成后修改审核状态
ExamCheckVO checkVO = new ExamCheckVO(); ExamCheckVO checkVO = new ExamCheckVO();
checkVO.setPlanId(classPlanId); checkVO.setPlanId(classPlanId);
@ -232,6 +228,47 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
examCheckService.updateByClassPlanId(classPlanId,checkVO); examCheckService.updateByClassPlanId(classPlanId,checkVO);
} }
/**
* 保存讲师各课程授课时刻表
*/
private void saveTeacherLessonsTime(Map<String, Object> params) throws Exception{
TeacherDTO teacherDTO = teacher.getById(params.get("teacherId").toString());
if(teacherDTO == null){
return;
}
String startDate = params.get("startDate").toString();
String endDate = params.get("endDate").toString();
String startTime = params.get("endTime").toString();
String endTime = params.get("endTime").toString();
List<String> dayList = new ArrayList<>();
long daySub = DateUtil.getDaySub(startDate, endDate);
if(daySub == 0L){
dayList.add(startDate);
} else {
for(long i = 0; i <= daySub; i++){
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
Date sDate = sd.parse(startDate);
String formatDate = sd.format(sDate.getTime() + (i * 24 * 60 * 60 * 1000));
dayList.add(formatDate);
}
}
Map<String, Object> saveParam = new HashMap<>();
for(String tempDate : dayList){
String sDateTime = tempDate + " " + startTime;
String eDateTime = tempDate + " " + endTime;
saveParam.put("classPlanId",params.get("classPlanId").toString());
saveParam.put("teacherId",teacherDTO.getTeacherId());
saveParam.put("teacherIdCard",teacherDTO.getIdCardNumber());
saveParam.put("orgId",params.get("orgId").toString());
saveParam.put("projectCatalogId","");
saveParam.put("workerCatalog",params.get("workTypeId").toString());
saveParam.put("lessonId",params.get("lessonId").toString());
saveParam.put("startTime",sDateTime);
saveParam.put("endTime",eDateTime);
teacher.saveTeacherLessonsTime(saveParam);
}
}
@Override @Override
public void remove(List<String> ids) { public void remove(List<String> ids) {
remove(null, ids); remove(null, ids);

View File

@ -187,23 +187,23 @@ public class TeacherServiceImpl extends DefaultBaseService implements ITeacherSe
public List<TeacherLessonsTimeDTO> listTeacherLessonsTime(Map<String, Object> params) { public List<TeacherLessonsTimeDTO> listTeacherLessonsTime(Map<String, Object> params) {
List<TeacherLessonsTimeDTO> list = teacherDao.listTeacherLessonsTimeDTO(params); List<TeacherLessonsTimeDTO> list = teacherDao.listTeacherLessonsTimeDTO(params);
for(TeacherLessonsTimeDTO item : list){ for(TeacherLessonsTimeDTO item : list){
item.setOrgName(""); if(item.getOrgId() != null && item.getOrgId().length() != 0){
InstitutionDTO institutionDTO = iInstitutionService.get(item.getOrgId());
item.setOrgName(institutionDTO == null ? "" : institutionDTO.getInstitutionName());
}
// 查询讲师名称 // 查询讲师名称
TeacherDTO byId = getById(item.getTeacherId()); TeacherDTO byId = getById(item.getTeacherId());
item.setTeacherName(byId.getTeacherName()); item.setTeacherName(byId == null ? "" : byId.getTeacherName());
item.setTeacherIdCard(byId.getIdCardNumber()); item.setTeacherIdCard(byId == null ? "" : byId.getIdCardNumber());
// 查询开班计划名称 // 查询开班计划名称
ClassPlanDTO classPlanDTO = classPlanService.get(item.getClassPlanId()); ClassPlanDTO classPlanDTO = classPlanService.get(item.getClassPlanId());
item.setClassPlanName(classPlanDTO.getPlanName()); item.setClassPlanName(classPlanDTO == null ? "" : classPlanDTO.getPlanName());
// 查询培训项目
DataDTO dataDTO = dataService.get(item.getProjectCatalogId());
item.setProjectCatalogName(dataDTO.getDataName());
// 查询课程 // 查询课程
LessonsDTO lessonsDTO = lessonsService.get(item.getLessonId()); LessonsDTO lessonsDTO = lessonsService.get(item.getLessonId());
item.setLessonName(lessonsDTO.getLessonName()); item.setLessonName(lessonsDTO == null ? "" : lessonsDTO.getLessonName());
// 查询工种 // 查询工种
WorkTypeDTO workTypeDTO = workTypeService.get(item.getWorkerCatalog()); WorkTypeDTO workTypeDTO = workTypeService.get(item.getWorkerCatalog());
item.setWorkerCatalogName(workTypeDTO.getWorkTypeName()); item.setWorkerCatalogName(workTypeDTO == null ? "" : workTypeDTO.getWorkTypeName());
} }
return list; return list;
} }

View File

@ -25,7 +25,7 @@
<label class="layui-form-label"><span style="color: red">*</span>班号</label> <label class="layui-form-label"><span style="color: red">*</span>班号</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="planNumber" name="planNumber" class="layui-input" value="" <input type="text" id="planNumber" name="planNumber" class="layui-input" value=""
autocomplete="off" placeholder="班号不可重复" lay-verify="required" maxlength="100"> autocomplete="off" placeholder="班号不可重复" lay-verify="required" maxlength="100" readonly="readonly">
</div> </div>
</div> </div>
</div> </div>