提交
This commit is contained in:
parent
5cedacf50c
commit
574d083472
@ -1,14 +1,17 @@
|
||||
package cn.com.tenlion.service.classplan.impl;
|
||||
|
||||
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.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.applystudents.ApplyStudentsDTO;
|
||||
import cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO;
|
||||
import cn.com.tenlion.pojo.dtos.classplan.ClassPlanReportExamDTO;
|
||||
import cn.com.tenlion.pojo.dtos.distributioncard.DistributionCardDTO;
|
||||
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.worktype.WorkTypeDTO;
|
||||
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.examcheck.ExamCheckVO;
|
||||
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.examapply.IExamApplyService;
|
||||
import cn.com.tenlion.service.examcheck.IExamCheckService;
|
||||
@ -57,6 +61,8 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|
||||
@Autowired
|
||||
private IExamCheckService examCheckService;
|
||||
@Autowired
|
||||
private IExamCheckDao examCheckDao;
|
||||
@Autowired
|
||||
private IDataService dataService;
|
||||
// 工种信息
|
||||
@Autowired
|
||||
@ -75,6 +81,8 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|
||||
private IDistributionCardService distributionCardService;
|
||||
@Autowired
|
||||
private ITeacherService teacher;
|
||||
@Autowired
|
||||
private IApplyStudentsService studentsService;
|
||||
|
||||
@Override
|
||||
public void save(ClassPlanVO classPlanVO) {
|
||||
@ -129,10 +137,15 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|
||||
params.put("classPlanId", classPlanId);
|
||||
setSaveInfo(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<>();
|
||||
long daySub = DateUtil.getDaySub("2021-05-15", "2021-05-15");
|
||||
long daySub = DateUtil.getDaySub(planStartTime, planEndTime);
|
||||
if(daySub == 0L){
|
||||
dayList.add(planStartTime);
|
||||
} else {
|
||||
@ -164,7 +177,8 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|
||||
|| sd.parse(sDateTime).getTime() > sd.parse(eeDateTime).getTime()){
|
||||
//...没有发生冲突
|
||||
} else {
|
||||
throw new SaveException(tlMap.toString());
|
||||
throw new SaveException("【"+teacherDTO.getTeacherName()+"】与其他课程安排时间冲突 "
|
||||
+ ssDateTime + " 至 " + eeDateTime + "");
|
||||
}
|
||||
}
|
||||
params.put("classPlanId",classPlanId);
|
||||
@ -198,6 +212,8 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|
||||
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);
|
||||
}
|
||||
@ -376,19 +392,37 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|
||||
//处理工种类型
|
||||
WorkTypeDTO workTypeDTO = workTypeService.get(item.getWorkerCatalog());
|
||||
item.setWorkerCatalogName(workTypeDTO.getWorkTypeName());
|
||||
//查询已报名人数
|
||||
queryMap.put("applyClassId",item.getClassPlanId());
|
||||
List<String> applyAuditStates = new ArrayList<>();
|
||||
applyAuditStates.add("3");
|
||||
queryMap.put("applyAuditStates",applyAuditStates);
|
||||
List<ApplyDTO> list = applyService.list(queryMap);
|
||||
item.setSignUpUserCount(list == null ? 0 : list.size());
|
||||
//查询待处理人数
|
||||
applyAuditStates.clear();
|
||||
applyAuditStates.add("0");
|
||||
queryMap.put("applyAuditStates",applyAuditStates);
|
||||
List<ApplyDTO> waitList = applyService.list(queryMap);
|
||||
item.setWaitSignUpUser(waitList == null ? 0 : waitList.size());
|
||||
//查询审核状态
|
||||
queryMap.clear();
|
||||
queryMap.put("planId", item.getClassPlanId());
|
||||
queryMap.put("workTypeId", item.getWorkerCatalog());
|
||||
queryMap.put("orgId", item.getOrgId());
|
||||
ExamCheckDTO examCheck = examCheckDao.get(queryMap);
|
||||
item.setReportType(examCheck.getCheckStatus() + "");
|
||||
//查询考试申请状态
|
||||
queryMap.clear();
|
||||
queryMap.put("examId",item.getClassPlanId());
|
||||
ExamApplyDTO examApplyDTO = examApplyService.get(queryMap);
|
||||
if(null == examApplyDTO){
|
||||
// 未提交考试申请
|
||||
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);
|
||||
return new SuccessResultList<>(classPlanDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
@ -463,24 +497,17 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|
||||
|
||||
@Override
|
||||
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.setExamId(classPlanId);
|
||||
examApplyVO.setExamType(Integer.parseInt(classPlanVO.getExamType()));
|
||||
examApplyVO.setTheoryExamStartTime(classPlanVO.getEstimateStart());
|
||||
examApplyVO.setTheoryExamEndTime(classPlanVO.getEstimateEnd());
|
||||
examApplyVO.setCheckStatus(0);
|
||||
examApplyVO.setUserStatus(0);
|
||||
examApplyVO.setStatus(0);
|
||||
examApplyVO.setReason("重新申请");
|
||||
if("3".equals(classPlanVO.getExamType())){
|
||||
examApplyVO.setPracticeExamStartTime(classPlanVO.getEstimateStart());
|
||||
examApplyVO.setPracticeExamEndTime(classPlanVO.getEstimateEnd());
|
||||
}
|
||||
//先查询再修改
|
||||
Map<String, Object> queryMap = getHashMap(8);
|
||||
queryMap.put("examId",classPlanId);
|
||||
ExamApplyDTO history = examApplyService.get(queryMap);
|
||||
examApplyService.update(history.getExamApplyId(),examApplyVO);
|
||||
examApplyVO.setWorkTypeId(classPlanDTO.getWorkerCatalog());
|
||||
examApplyVO.setOrgId(classPlanDTO.getOrgId());
|
||||
examApplyVO.setPlanName(classPlanDTO.getPlanName());
|
||||
examApplyService.save(examApplyVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -526,7 +553,27 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|
||||
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){
|
||||
Map<String, Object> parmas = new HashMap<>();
|
||||
|
Loading…
Reference in New Issue
Block a user