This commit is contained in:
wans 2021-05-15 19:12:22 +08:00
parent 5cedacf50c
commit 574d083472

View File

@ -1,14 +1,17 @@
package cn.com.tenlion.service.classplan.impl; package cn.com.tenlion.service.classplan.impl;
import cn.com.tenlion.dao.classplan.IClassPlanDao; import cn.com.tenlion.dao.classplan.IClassPlanDao;
import cn.com.tenlion.dao.examcheck.IExamCheckDao;
import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO; import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO;
import cn.com.tenlion.institutionmanagement.service.institution.IInstitutionService; import cn.com.tenlion.institutionmanagement.service.institution.IInstitutionService;
import cn.com.tenlion.pojo.bos.classplan.ClassPlanBO; import cn.com.tenlion.pojo.bos.classplan.ClassPlanBO;
import cn.com.tenlion.pojo.dtos.apply.ApplyDTO; import cn.com.tenlion.pojo.dtos.apply.ApplyDTO;
import cn.com.tenlion.pojo.dtos.applystudents.ApplyStudentsDTO;
import cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO; import cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO;
import cn.com.tenlion.pojo.dtos.classplan.ClassPlanReportExamDTO; import cn.com.tenlion.pojo.dtos.classplan.ClassPlanReportExamDTO;
import cn.com.tenlion.pojo.dtos.distributioncard.DistributionCardDTO; import cn.com.tenlion.pojo.dtos.distributioncard.DistributionCardDTO;
import cn.com.tenlion.pojo.dtos.examapply.ExamApplyDTO; import cn.com.tenlion.pojo.dtos.examapply.ExamApplyDTO;
import cn.com.tenlion.pojo.dtos.examcheck.ExamCheckDTO;
import cn.com.tenlion.pojo.dtos.teacher.TeacherDTO; import cn.com.tenlion.pojo.dtos.teacher.TeacherDTO;
import cn.com.tenlion.pojo.dtos.worktype.WorkTypeDTO; import cn.com.tenlion.pojo.dtos.worktype.WorkTypeDTO;
import cn.com.tenlion.pojo.pos.classplan.ClassPlanPO; import cn.com.tenlion.pojo.pos.classplan.ClassPlanPO;
@ -16,6 +19,7 @@ import cn.com.tenlion.pojo.vos.classplan.ClassPlanVO;
import cn.com.tenlion.pojo.vos.examapply.ExamApplyVO; import cn.com.tenlion.pojo.vos.examapply.ExamApplyVO;
import cn.com.tenlion.pojo.vos.examcheck.ExamCheckVO; import cn.com.tenlion.pojo.vos.examcheck.ExamCheckVO;
import cn.com.tenlion.service.apply.IApplyService; import cn.com.tenlion.service.apply.IApplyService;
import cn.com.tenlion.service.applystudents.IApplyStudentsService;
import cn.com.tenlion.service.classplan.IClassPlanService; import cn.com.tenlion.service.classplan.IClassPlanService;
import cn.com.tenlion.service.examapply.IExamApplyService; import cn.com.tenlion.service.examapply.IExamApplyService;
import cn.com.tenlion.service.examcheck.IExamCheckService; import cn.com.tenlion.service.examcheck.IExamCheckService;
@ -57,6 +61,8 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
@Autowired @Autowired
private IExamCheckService examCheckService; private IExamCheckService examCheckService;
@Autowired @Autowired
private IExamCheckDao examCheckDao;
@Autowired
private IDataService dataService; private IDataService dataService;
// 工种信息 // 工种信息
@Autowired @Autowired
@ -75,6 +81,8 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
private IDistributionCardService distributionCardService; private IDistributionCardService distributionCardService;
@Autowired @Autowired
private ITeacherService teacher; private ITeacherService teacher;
@Autowired
private IApplyStudentsService studentsService;
@Override @Override
public void save(ClassPlanVO classPlanVO) { public void save(ClassPlanVO classPlanVO) {
@ -129,10 +137,15 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
params.put("classPlanId", classPlanId); params.put("classPlanId", classPlanId);
setSaveInfo(params); setSaveInfo(params);
classPlanDao.save(params); classPlanDao.save(params);
// 开班申请提交后是否需要先将考试人员信息从报名表中转移到班级表 ExamCheckVO checkVO = new ExamCheckVO();
checkVO.setPlanId(classPlanId);
checkVO.setOrgId(obj.getString("orgId"));
checkVO.setCheckStatus(0);
checkVO.setWorkTypeId(obj.getString("workerCatalog"));
examCheckService.save(checkVO);
//保存课程及讲师 //保存课程及讲师
List<String> dayList = new ArrayList<>(); List<String> dayList = new ArrayList<>();
long daySub = DateUtil.getDaySub("2021-05-15", "2021-05-15"); long daySub = DateUtil.getDaySub(planStartTime, planEndTime);
if(daySub == 0L){ if(daySub == 0L){
dayList.add(planStartTime); dayList.add(planStartTime);
} else { } else {
@ -164,7 +177,8 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|| sd.parse(sDateTime).getTime() > sd.parse(eeDateTime).getTime()){ || sd.parse(sDateTime).getTime() > sd.parse(eeDateTime).getTime()){
//...没有发生冲突 //...没有发生冲突
} else { } else {
throw new SaveException(tlMap.toString()); throw new SaveException(""+teacherDTO.getTeacherName()+"】与其他课程安排时间冲突 "
+ ssDateTime + "" + eeDateTime + "");
} }
} }
params.put("classPlanId",classPlanId); params.put("classPlanId",classPlanId);
@ -198,6 +212,8 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
params.put("classPlanId",classPlanId); params.put("classPlanId",classPlanId);
params.put("lessonId",item.getString("lessonId")); params.put("lessonId",item.getString("lessonId"));
params.put("teacherId",item.getString("teacherId")); params.put("teacherId",item.getString("teacherId"));
params.put("lessonStart",item.getString("lessonStartTime"));
params.put("lessonEnd",item.getString("lessonEndTime"));
params.put("isDelete",item.getString("teacherId")); params.put("isDelete",item.getString("teacherId"));
classPlanDao.saveClassPlanLesson(params); classPlanDao.saveClassPlanLesson(params);
} }
@ -376,19 +392,37 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
//处理工种类型 //处理工种类型
WorkTypeDTO workTypeDTO = workTypeService.get(item.getWorkerCatalog()); WorkTypeDTO workTypeDTO = workTypeService.get(item.getWorkerCatalog());
item.setWorkerCatalogName(workTypeDTO.getWorkTypeName()); item.setWorkerCatalogName(workTypeDTO.getWorkTypeName());
//查询已报名人数 //查询审核状态
queryMap.put("applyClassId",item.getClassPlanId()); queryMap.clear();
List<String> applyAuditStates = new ArrayList<>(); queryMap.put("planId", item.getClassPlanId());
applyAuditStates.add("3"); queryMap.put("workTypeId", item.getWorkerCatalog());
queryMap.put("applyAuditStates",applyAuditStates); queryMap.put("orgId", item.getOrgId());
List<ApplyDTO> list = applyService.list(queryMap); ExamCheckDTO examCheck = examCheckDao.get(queryMap);
item.setSignUpUserCount(list == null ? 0 : list.size()); item.setReportType(examCheck.getCheckStatus() + "");
//查询待处理人数 //查询考试申请状态
applyAuditStates.clear(); queryMap.clear();
applyAuditStates.add("0"); queryMap.put("examId",item.getClassPlanId());
queryMap.put("applyAuditStates",applyAuditStates); ExamApplyDTO examApplyDTO = examApplyService.get(queryMap);
List<ApplyDTO> waitList = applyService.list(queryMap); if(null == examApplyDTO){
item.setWaitSignUpUser(waitList == null ? 0 : waitList.size()); // 未提交考试申请
item.setExamType("");
} else {
// 0待审核 1审核通过 2退回
item.setExamType(examApplyDTO.getCheckStatus() + "");
}
//查询报名人数
if(examCheck.getCheckStatus() == 2){
List<ApplyStudentsDTO> applyStudentsDTOS = studentsService.listByClssId(item.getClassPlanId());
item.setSignUpUserCount(applyStudentsDTOS == null ? 0 : applyStudentsDTOS.size());
} else {
queryMap.put("applyInstitutionId",item.getOrgId());
queryMap.put("applyWorkTypeId",item.getWorkerCatalog());
List<String> applyAuditStates = new ArrayList<>();
applyAuditStates.add("2");
queryMap.put("applyAuditStates",applyAuditStates);
List<ApplyDTO> list = applyService.list(queryMap);
item.setSignUpUserCount(list == null ? 0 : list.size());
}
} }
PageInfo<ClassPlanDTO> pageInfo = new PageInfo<>(classPlanDTOs); PageInfo<ClassPlanDTO> pageInfo = new PageInfo<>(classPlanDTOs);
return new SuccessResultList<>(classPlanDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); return new SuccessResultList<>(classPlanDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
@ -463,24 +497,17 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
@Override @Override
public void updateExamType(String classPlanId, ClassPlanVO classPlanVO) { public void updateExamType(String classPlanId, ClassPlanVO classPlanVO) {
Map<String, Object> query = new HashMap<>();
query.put("classPlanId",classPlanId);
ClassPlanDTO classPlanDTO = classPlanDao.get(query);
ExamApplyVO examApplyVO = new ExamApplyVO(); ExamApplyVO examApplyVO = new ExamApplyVO();
examApplyVO.setExamId(classPlanId); examApplyVO.setExamId(classPlanId);
examApplyVO.setExamType(Integer.parseInt(classPlanVO.getExamType()));
examApplyVO.setTheoryExamStartTime(classPlanVO.getEstimateStart());
examApplyVO.setTheoryExamEndTime(classPlanVO.getEstimateEnd());
examApplyVO.setCheckStatus(0); examApplyVO.setCheckStatus(0);
examApplyVO.setUserStatus(0);
examApplyVO.setStatus(0); examApplyVO.setStatus(0);
examApplyVO.setReason("重新申请"); examApplyVO.setWorkTypeId(classPlanDTO.getWorkerCatalog());
if("3".equals(classPlanVO.getExamType())){ examApplyVO.setOrgId(classPlanDTO.getOrgId());
examApplyVO.setPracticeExamStartTime(classPlanVO.getEstimateStart()); examApplyVO.setPlanName(classPlanDTO.getPlanName());
examApplyVO.setPracticeExamEndTime(classPlanVO.getEstimateEnd()); examApplyService.save(examApplyVO);
}
//先查询再修改
Map<String, Object> queryMap = getHashMap(8);
queryMap.put("examId",classPlanId);
ExamApplyDTO history = examApplyService.get(queryMap);
examApplyService.update(history.getExamApplyId(),examApplyVO);
} }
@Override @Override
@ -526,7 +553,27 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
return list; return list;
} }
@Override
public Map<String, Object> getExamCheckType(Map<String, Object> params) {
String orgId = params.get("orgId").toString();
if(params.get("workerCatalog") == null
|| params.get("workerCatalog").toString().length() == 0){
params.put("checkType","0");
return params;
}
String workerCatalog = params.get("workerCatalog").toString();
params.clear();
params.put("workTypeId", workerCatalog);
params.put("orgId", orgId);
ExamCheckDTO examCheck = examCheckDao.getExamCheck(params);
params.clear();
if(null == examCheck){
params.put("checkType","1");
} else {
params.put("checkType","0");
}
return params;
}
public Map<String,Object> countPlanType(String orgId){ public Map<String,Object> countPlanType(String orgId){
Map<String, Object> parmas = new HashMap<>(); Map<String, Object> parmas = new HashMap<>();