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 9fcd605..d36f6f3 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 @@ -18,6 +18,7 @@ import cn.com.tenlion.pojo.dtos.teacher.TeacherDTO; 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.distribution.DistributionSaveVO; import cn.com.tenlion.pojo.vos.examapply.ExamApplyVO; import cn.com.tenlion.pojo.vos.examcheck.ExamCheckVO; import cn.com.tenlion.service.apply.IApplyService; @@ -25,6 +26,7 @@ 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; +import cn.com.tenlion.service.examination.distribution.IDistributionService; import cn.com.tenlion.service.examination.distributioncard.IDistributionCardService; import cn.com.tenlion.service.teacher.ITeacherService; import cn.com.tenlion.service.worktype.IWorkTypeService; @@ -88,6 +90,8 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl private IApplyStudentsService studentsService; @Autowired private IPicturesTemplateBuildingService credentialService; + @Autowired + private IDistributionService iDistributionService; @Override public void save(ClassPlanVO classPlanVO) { @@ -549,6 +553,13 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl params.put("examImages",classPlanVO.getExamImages()); params.put("examPDF",classPlanVO.getExamPDF()); classPlanDao.saveExamFile(params); + /** + * CBC 准考证生成基础信息关联 2021年6月19日16:29:30加入代码 + */ + DistributionSaveVO saveData = new DistributionSaveVO(); + saveData.setPlanId(classPlanId); + saveData.setPlanName(classPlanDTO.getPlanName()); + iDistributionService.save(saveData); } @Override diff --git a/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java b/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java index 07cd238..b3a6c10 100644 --- a/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java @@ -38,6 +38,7 @@ import com.github.pagehelper.PageInfo; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.exceptions.SaveException; import ink.wgink.exceptions.UpdateException; +import ink.wgink.module.dictionary.pojo.dtos.DataDTO; import ink.wgink.module.dictionary.service.IDataService; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.SuccessResultList; @@ -139,39 +140,39 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist /** * 判断考点是否为空 */ - if (StringUtils.isEmpty(dDistributionSaveVO.getStationId())) { +/* if (StringUtils.isEmpty(dDistributionSaveVO.getStationId())) { throw new SaveException("考点不能为空"); - } + }*/ /** * 判断考试人数是否为空 * renpc2021-06-17注释掉此段内容 */ - if (dDistributionSaveVO.getDistributionNumber() == null || dDistributionSaveVO.getDistributionNumber() < 1) { +/* if (dDistributionSaveVO.getDistributionNumber() == null || dDistributionSaveVO.getDistributionNumber() < 1) { throw new SaveException("考试人数不合法"); - } + }*/ /** * 判断预计考试时间是否为空是否大于今天 */ /** * 判断该考点是否有考场 */ - Map params = new HashMap(); + /* Map params = new HashMap(); params.put("organizationType" ,dDistributionSaveVO.getStationId()); List orgList = iOrganizationService.list(params); if(orgList == null || orgList.size() < 1) { throw new SaveException("该考点暂无考场可以分配"); - } + }*/ /** * 判断该考点的全部考场容纳相加是否大于参加考试人数 */ - int totalNumber = 0; + /* int totalNumber = 0; for (OrganizationDTO dto : orgList) { totalNumber = totalNumber + dto.getOrganizationUserNum(); } // renpc2021-06-17注释掉此段内容 if(totalNumber < dDistributionSaveVO.getDistributionNumber()) { throw new SaveException("该考点无法容纳本次考试的人数"); - } + }*/ Map save = HashMapUtil.beanToMap(dDistributionSaveVO); save.put("distributionAllotTime", ""); save.put("distributionFields", ""); @@ -282,7 +283,7 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist String currentFieldId = ""; for(String classPlanId : distributionIdArray) { DistributionDTO distributionDTO = get(classPlanId); - if(distributionDTO != null) { + if(distributionDTO == null) { throw new UpdateException("非法操作."); } // 共分配的多个考场ID @@ -335,8 +336,8 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist distributionCardVO.setDistributionId(classPlanId); distributionCardVO.setDistributionCardPictures(""); // 保存性别中文,又用中文差名称,暂时改为直接输出 - // DataDTO dataDTO = dataDictionaryServiceImpl.get(userList.get(i).getApplySex()); - // distributionCardVO.setDistributionCardUserSex(dataDTO.getDataName()); +// DataDTO dataDTO = dataDictionaryServiceImpl.get(userList.get(i).getApplySex()); +// distributionCardVO.setDistributionCardUserSex(dataDTO.getDataName()); distributionCardVO.setDistributionCardUserSex(userList.get(i).getApplySex()); distributionCardVO.setDistributionCardUserIdentity(userList.get(i).getApplyCardNumber()); distributionCardVO.setDistributionCardUserResult(""); @@ -381,48 +382,59 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist params.put("distributionStatus", "1"); params.put("distributionNumber", userList == null ? 0 : userList.size()); params.put("distributionId", classPlanId); - distributionDao.save(params); + distributionDao.update(params); + /** + * 为任鹏程接口 CBC 2021年6月19日17:43:16 + * 更新此条申请的考场分配信息与考点分配信息 + */ + Map ren = new HashMap<>(1); + if(!StringUtils.isEmpty(stationId)) { + String[] stationArray = stationId.substring(1, stationId.length()).split(","); + // 考点名称与ID串 + StringBuffer stationNameBuffer = new StringBuffer(); + for(String tempStationId : stationArray) { + InstitutionDTO institutionDTO = institutionService.get(tempStationId); + if(stationNameBuffer.length() < 1) { + stationNameBuffer.append(institutionDTO.getInstitutionName()); + }else{ + stationNameBuffer.append("," + institutionDTO.getInstitutionName()); + } + } + ren.put("examOrgId", stationId.substring(1, stationId.length())); + ren.put("examOrgName", stationNameBuffer.toString()); + }else{ + ren.put("examOrgId", ""); + ren.put("examOrgName", ""); + } + if(!StringUtils.isEmpty(fieldId)) { + // 考场名称与ID串 + StringBuffer fieldNameBuffer = new StringBuffer(); + for(OrganizationDTO organizationDTO : fieldList) { + if(fieldNameBuffer.length() < 1) { + fieldNameBuffer.append(organizationDTO.getOrganizationName()); + }else{ + + fieldNameBuffer.append("," + organizationDTO.getOrganizationName()); + } + } + ren.put("examPointId", fieldId.substring(1, fieldId.length())); + ren.put("examPointName", fieldNameBuffer.toString()); + } else{ + ren.put("examPointId",""); + ren.put("examPointName", ""); + } + ren.put("classPlanId", classPlanId); + applyStudentsNewDao.update(ren); /** * 更新应急局的考试申请审核主表中的考试时间以及状态 */ ExamApplyVO vo = new ExamApplyVO(); vo.setExamId(distributionId); vo.setStatus(1); - vo.setCheckStatus(1); + // vo.setCheckStatus(1); vo.setPracticeExamStartTime(distributionVO.getDistributionAllotTime()); vo.setPracticeExamEndTime(distributionVO.getDistributionAllotEndTime()); iExamApplyService.updateStatus(distributionId, vo); - - /** - * 更新考试人员信息(添加考场信息到考试人员表中) - */ - params = new HashMap<>(1); - String examOrgId = ""; - String examOrgName = ""; - for(int i=0;i query = new HashMap(); - query.put("examPlanId", dto.getDistributionId()); - ExamPlanDTO examPlanDTO = examPlanService.get(query); + query.put("examId", dto.getDistributionId()); + ExamApplyDTO examPlanDTO = iExamApplyService.get(query); dto.setExamType(examPlanDTO.getExamType()); return dto; } diff --git a/src/main/resources/static/route/examination/distribution/show.html b/src/main/resources/static/route/examination/distribution/show.html index 5371d42..d07f771 100644 --- a/src/main/resources/static/route/examination/distribution/show.html +++ b/src/main/resources/static/route/examination/distribution/show.html @@ -30,34 +30,28 @@