From 4e649f5c1a6acac75d51437cfaa7f27a1e6bae35 Mon Sep 17 00:00:00 2001 From: cuibaocheng Date: Sat, 15 May 2021 19:11:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=83=E5=9C=BA?= =?UTF-8?q?=E5=88=86=E9=85=8D=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../classplan/impl/ClassPlanServiceImpl.java | 2 ++ .../impl/DistributionServiceImpl.java | 35 ++++++++++++------- .../mapper/classplan/class-plan-mapper.xml | 7 ++++ .../static/route/examapply/list-check.html | 1 - .../route/examination/distribution/show.html | 17 +++++---- .../examination/distribution/update.html | 17 ++++----- 6 files changed, 50 insertions(+), 29 deletions(-) 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 6adce95..67179d6 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 @@ -283,6 +283,8 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl @Override public List list(Map params) { + String[] classPlanIdListIds = params.get("classPlanIdListIds") == null ? null : params.get("classPlanIdListIds").toString().split(","); + params.put("classPlanIdList", classPlanIdListIds); return classPlanDao.list(params); } 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 87c4dcf..5ea390a 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 @@ -29,6 +29,8 @@ import cn.com.tenlion.service.examination.stationuser.IStationUserService; 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; import ink.wgink.util.map.HashMapUtil; @@ -64,11 +66,13 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist @Autowired private IApplyService iApplyService; @Autowired - private IClassPlanService iClassPlanService; - @Autowired private IDistributionCardService iDistributionCardService; @Autowired private IApplyStudentsService applyStudentsService; + @Autowired + private IClassPlanService iClassPlanService; + @Autowired + private IDataService dataDictionaryServiceImpl; @Override public void save(DistributionSaveVO dstributionSaveVO) { @@ -242,19 +246,15 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist if(userTotalNumber > fieldTotalNumber ) { throw new UpdateException("当前分配的考场无法容纳考试人数"); } - /** - * 遍历保存所有的考试申请分配信息 - */ - Map params = HashMapUtil.beanToMap(distributionVO); - if (StringUtils.isBlank(token)) { - setUpdateInfo(params); - } else { - setAppUpdateInfo(token, params); - } int index = 0; int subNumber = 0; + int currentNumber = 0; String currentFieldId = ""; for(String classPlanId : distributionIdArray) { + DistributionDTO distributionDTO = get(classPlanId); + if(distributionDTO != null) { + throw new UpdateException("非法操作."); + } // 共分配的多个考场ID ArrayList fieldList = new ArrayList(); // 是否存在跨考点, 做记录 @@ -291,6 +291,7 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist if(distributionDTOS != null && distributionDTOS.size() > 0) { throw new UpdateException(organizationDTO.getOrganizationName() + "该时段已被(" + distributionDTOS.get(0).getPlanName() + ")占用"); } + currentNumber = 0; } /** * 保存card表 @@ -298,12 +299,13 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist DistributionCardVO distributionCardVO = new DistributionCardVO(); distributionCardVO.setDistributionCardUserId(userList.get(i).getCreator()); distributionCardVO.setDistributionCardUserName(userList.get(i).getApplyName()); - distributionCardVO.setDistributionCardNumber(subNumber+""); + distributionCardVO.setDistributionCardNumber( (++currentNumber ) + "" ); distributionCardVO.setDistributionFieldId(currentFieldId); distributionCardVO.setClassPlanId(classPlanId); distributionCardVO.setDistributionId(classPlanId); distributionCardVO.setDistributionCardPictures(""); - distributionCardVO.setDistributionCardUserSex(userList.get(i).getApplySex()); + DataDTO dataDTO = dataDictionaryServiceImpl.get(userList.get(i).getApplySex()); + distributionCardVO.setDistributionCardUserSex(dataDTO.getDataName()); distributionCardVO.setDistributionCardUserIdentity(userList.get(i).getApplyCardNumber()); distributionCardVO.setDistributionCardUserResult(""); distributionCardVO.setDistributionCardUserStatus("0"); @@ -325,6 +327,12 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist /** * 保存考试申请 */ + Map params = HashMapUtil.beanToMap(distributionVO); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setAppUpdateInfo(token, params); + } params.put("stationId", stationId.length() > 0 ? stationId.substring(1, stationId.length()) : ""); params.put("planId", classPlanId); params.put("planName", classPlanDTO.getPlanName()); @@ -341,6 +349,7 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist ExamApplyVO vo = new ExamApplyVO(); vo.setExamId(distributionId); vo.setStatus(1); + vo.setCheckStatus(1); vo.setPracticeExamStartTime(distributionVO.getDistributionAllotTime()); vo.setPracticeExamEndTime(distributionVO.getDistributionAllotEndTime()); iExamApplyService.updateStatus(distributionId, vo); 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 6bf24c0..bf60d8e 100644 --- a/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml +++ b/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml @@ -317,6 +317,13 @@ #{classPlanIds[${index}]} + + AND + t1.class_plan_id IN + + #{classPlanIdList[${index}]} + + diff --git a/src/main/resources/static/route/examapply/list-check.html b/src/main/resources/static/route/examapply/list-check.html index 61849a8..aeb9cf1 100644 --- a/src/main/resources/static/route/examapply/list-check.html +++ b/src/main/resources/static/route/examapply/list-check.html @@ -461,7 +461,6 @@ var ids = ''; var planIds = ''; for(var i = 0, item; item = checkDatas[i++];) { - debugger if(item.checkStatus === 0) { if (i > 1) { ids += '_'; diff --git a/src/main/resources/static/route/examination/distribution/show.html b/src/main/resources/static/route/examination/distribution/show.html index e7430fb..efa470a 100644 --- a/src/main/resources/static/route/examination/distribution/show.html +++ b/src/main/resources/static/route/examination/distribution/show.html @@ -26,13 +26,14 @@
考试计划申请
+