diff --git a/src/main/java/cn/com/tenlion/pojo/bos/examplan/ExamPlanBO.java b/src/main/java/cn/com/tenlion/pojo/bos/examplan/ExamPlanBO.java index b68e2da..c067767 100644 --- a/src/main/java/cn/com/tenlion/pojo/bos/examplan/ExamPlanBO.java +++ b/src/main/java/cn/com/tenlion/pojo/bos/examplan/ExamPlanBO.java @@ -34,6 +34,7 @@ public class ExamPlanBO { private String site; private String roomName; private String siteName; + private String signupTime; private String creator; private String gmtCreate; private String modifier; @@ -232,6 +233,14 @@ public class ExamPlanBO { this.siteName = siteName; } + public String getSignupTime() { + return signupTime; + } + + public void setSignupTime(String signupTime) { + this.signupTime = signupTime; + } + public String getCreator() { return creator == null ? "" : creator.trim(); } diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/examplan/ExamPlanDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/examplan/ExamPlanDTO.java index 0c08540..4b108b6 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/examplan/ExamPlanDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/examplan/ExamPlanDTO.java @@ -80,6 +80,8 @@ public class ExamPlanDTO { private Integer surplusCount; @ApiModelProperty(name = "btnStatus", value = "按钮状态") private String btnStatus; + @ApiModelProperty(name = "signupTime", value = "报名截止时间") + private String signupTime; public String getExamPlanId() { return examPlanId == null ? "" : examPlanId.trim(); @@ -344,4 +346,12 @@ public class ExamPlanDTO { public void setBtnStatus(String btnStatus) { this.btnStatus = btnStatus; } + + public String getSignupTime() { + return signupTime; + } + + public void setSignupTime(String signupTime) { + this.signupTime = signupTime; + } } diff --git a/src/main/java/cn/com/tenlion/pojo/pos/examplan/ExamPlanPO.java b/src/main/java/cn/com/tenlion/pojo/pos/examplan/ExamPlanPO.java index d26b906..a3f7a96 100644 --- a/src/main/java/cn/com/tenlion/pojo/pos/examplan/ExamPlanPO.java +++ b/src/main/java/cn/com/tenlion/pojo/pos/examplan/ExamPlanPO.java @@ -34,6 +34,7 @@ public class ExamPlanPO { private String site; private String roomName; private String siteName; + private String signupTime; private String creator; private String gmtCreate; private String modifier; @@ -232,6 +233,14 @@ public class ExamPlanPO { this.siteName = siteName; } + public String getSignupTime() { + return signupTime; + } + + public void setSignupTime(String signupTime) { + this.signupTime = signupTime; + } + public String getCreator() { return creator == null ? "" : creator.trim(); } diff --git a/src/main/java/cn/com/tenlion/pojo/vos/examplan/ExamPlanVO.java b/src/main/java/cn/com/tenlion/pojo/vos/examplan/ExamPlanVO.java index b1e8c00..b5bcf8b 100644 --- a/src/main/java/cn/com/tenlion/pojo/vos/examplan/ExamPlanVO.java +++ b/src/main/java/cn/com/tenlion/pojo/vos/examplan/ExamPlanVO.java @@ -28,10 +28,10 @@ public class ExamPlanVO { @CheckNumberAnnotation(name = "1:知识;2:实操;3:补考") private Integer examType; @ApiModelProperty(name = "startTime", value = "考试开始时间") - @CheckEmptyAnnotation(name = "考试开始时间", verifyType = "datetime") + // @CheckEmptyAnnotation(name = "考试开始时间", verifyType = "datetime") private String startTime; @ApiModelProperty(name = "endTime", value = "考试结束时间") - @CheckEmptyAnnotation(name = "考试结束时间", verifyType = "datetime") + // @CheckEmptyAnnotation(name = "考试结束时间", verifyType = "datetime") private String endTime; @ApiModelProperty(name = "examCount", value = "考试人数") private String examCount; @@ -65,6 +65,8 @@ public class ExamPlanVO { private String roomName; @ApiModelProperty(name = "siteName", value = "考点名称") private String siteName; + @ApiModelProperty(name = "signupTime", value = "报名截止时间") + private String signupTime; public String getName() { return name == null ? "" : name.trim(); @@ -249,4 +251,12 @@ public class ExamPlanVO { public void setSiteName(String siteName) { this.siteName = siteName; } + + public String getSignupTime() { + return signupTime; + } + + public void setSignupTime(String signupTime) { + this.signupTime = signupTime; + } } 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 e7f941f..94967d0 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 @@ -125,10 +125,11 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist } /** * 判断考试时间是否为空 + * renpc2021-06-17注释掉此段内容 */ - if (StringUtils.isEmpty(dDistributionSaveVO.getDistributionTime())) { + /*if (StringUtils.isEmpty(dDistributionSaveVO.getDistributionTime())) { throw new SaveException("考试时间不能为空"); - } + }*/ /** * 判断计划名称是否为空 */ @@ -143,10 +144,11 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist } /** * 判断考试人数是否为空 + * renpc2021-06-17注释掉此段内容 */ - if (dDistributionSaveVO.getDistributionNumber() == null || dDistributionSaveVO.getDistributionNumber() < 1) { + /*if (dDistributionSaveVO.getDistributionNumber() == null || dDistributionSaveVO.getDistributionNumber() < 1) { throw new SaveException("考试人数不合法"); - } + }*/ /** * 判断预计考试时间是否为空是否大于今天 */ @@ -166,9 +168,10 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist for (OrganizationDTO dto : orgList) { totalNumber = totalNumber + dto.getOrganizationUserNum(); } - if(totalNumber < dDistributionSaveVO.getDistributionNumber()) { + // renpc2021-06-17注释掉此段内容 + /*if(totalNumber < dDistributionSaveVO.getDistributionNumber()) { throw new SaveException("该考点无法容纳本次考试的人数"); - } + }*/ Map save = HashMapUtil.beanToMap(dDistributionSaveVO); save.put("distributionAllotTime", ""); save.put("distributionFields", ""); diff --git a/src/main/java/cn/com/tenlion/service/examplan/impl/ExamPlanServiceImpl.java b/src/main/java/cn/com/tenlion/service/examplan/impl/ExamPlanServiceImpl.java index a6138a5..bf8fd56 100644 --- a/src/main/java/cn/com/tenlion/service/examplan/impl/ExamPlanServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examplan/impl/ExamPlanServiceImpl.java @@ -151,7 +151,7 @@ public class ExamPlanServiceImpl extends DefaultBaseService implements IExamPlan distributionSaveVO.setPlanName(examPlanVO.getName()); distributionSaveVO.setDistributionTime(examPlanVO.getStartTime()); distributionSaveVO.setDistributionEndTime(examPlanVO.getEndTime()); - distributionSaveVO.setDistributionNumber(Integer.valueOf(examPlanVO.getExamCount())); + // distributionSaveVO.setDistributionNumber(Integer.valueOf(examPlanVO.getExamCount())); distributionSaveVO.setStationId(examPlanVO.getSite()); distributionService.saveReturnId(distributionSaveVO); } @@ -245,7 +245,7 @@ public class ExamPlanServiceImpl extends DefaultBaseService implements IExamPlan String nowTime = simpleDateFormat.format(new Date()); for(ExamPlanDTO examPlanDTO: list) { examPlanDTO.setBtnStatus("确认报考"); - Integer count = Integer.valueOf(examPlanDTO.getExamCount()); + // Integer count = Integer.valueOf(examPlanDTO.getExamCount()); params = new HashMap<>(1); params.put("classPlanId", examPlanDTO.getExamPlanId()); // 查找并判断当前用户是否可以报考 @@ -270,9 +270,9 @@ public class ExamPlanServiceImpl extends DefaultBaseService implements IExamPlan Integer overCount = applyStudentsNewDTOList1.size(); examPlanDTO.setOverCount(overCount); // 是否可以继续申报按钮控制 - if(overCount >= count) { + /*if(overCount >= count) { examPlanDTO.setBtnStatus("暂停申报"); - } + }*/ } // 查找审核通过人数 params.put("checkStatus", 1); @@ -281,24 +281,25 @@ public class ExamPlanServiceImpl extends DefaultBaseService implements IExamPlan Integer passCount = applyStudentsNewDTOList2.size(); examPlanDTO.setPassCount(passCount); // 计算剩余未报人数 - examPlanDTO.setSurplusCount(count - passCount); + // examPlanDTO.setSurplusCount(count - passCount); // 是否可以继续申报按钮控制 - if(passCount >= count) { + /*if(passCount >= count) { examPlanDTO.setBtnStatus("暂停申报"); + }*/ + } + String endTime = examPlanDTO.getSignupTime(); + if(!StringUtils.isEmpty(endTime)) { + try{ + // 时间比较 + Date nowDate = simpleDateFormat.parse(nowTime); + Date endDate = simpleDateFormat.parse(endTime); + if(nowDate.getTime() >= endDate.getTime()) { + examPlanDTO.setBtnStatus("报名截止"); + } + }catch (Exception e){ + e.printStackTrace(); } } - String endTime = examPlanDTO.getStartTime(); - try{ - // 时间比较 - Date nowDate = simpleDateFormat.parse(nowTime); - Date endDate = simpleDateFormat.parse(endTime); - if(nowDate.getTime() >= endDate.getTime()) { - examPlanDTO.setBtnStatus("报名截止"); - } - }catch (Exception e){ - e.printStackTrace(); - } - } } return list; diff --git a/src/main/resources/mybatis/mapper/examplan/exam-plan-mapper.xml b/src/main/resources/mybatis/mapper/examplan/exam-plan-mapper.xml index 03997f9..f09c3c2 100644 --- a/src/main/resources/mybatis/mapper/examplan/exam-plan-mapper.xml +++ b/src/main/resources/mybatis/mapper/examplan/exam-plan-mapper.xml @@ -27,6 +27,7 @@ + @@ -59,6 +60,7 @@ + @@ -91,6 +93,7 @@ + @@ -125,6 +128,7 @@ site, room_name, site_name, + signup_time, creator, gmt_create, modifier, @@ -155,6 +159,7 @@ #{site}, #{roomName}, #{siteName}, + #{signupTime}, #{creator}, #{gmtCreate}, #{modifier}, @@ -262,6 +267,9 @@ site_name = #{siteName}, + + + signup_time = #{signupTime}, gmt_modified = #{gmtModified}, modifier = #{modifier}, @@ -296,6 +304,7 @@ t1.site, t1.room_name, t1.site_name, + t1.signup_time, t1.exam_plan_id FROM e_exam_plan t1 @@ -338,6 +347,7 @@ t1.site, t1.room_name, t1.site_name, + t1.signup_time, t1.creator, t1.gmt_create, t1.modifier, @@ -380,6 +390,7 @@ t1.site, t1.room_name, t1.site_name, + t1.signup_time, t1.creator, t1.gmt_create, t1.modifier, @@ -422,6 +433,7 @@ t1.site, t1.room_name, t1.site_name, + t1.signup_time, 1 FROM e_exam_plan t1 @@ -489,6 +501,7 @@ t1.site, t1.room_name, t1.site_name, + t1.signup_time, t1.creator, t1.gmt_create, t1.modifier, @@ -548,6 +561,7 @@ t1.site, t1.room_name, t1.site_name, + t1.signup_time, t1.creator, t1.gmt_create, t1.modifier, diff --git a/src/main/resources/static/route/examplan/save.html b/src/main/resources/static/route/examplan/save.html index 24e7782..1886c8a 100644 --- a/src/main/resources/static/route/examplan/save.html +++ b/src/main/resources/static/route/examplan/save.html @@ -77,7 +77,7 @@ -
+
-
+ +
+ +
+ +
@@ -418,6 +424,16 @@ } } + // 报名截止时间 + function initSignupTimeDateTime() { + laydate.render({ + elem: '#signupTime', + type: 'datetime', + value: new Date(), + trigger: 'click' + }); + } + // 初始化考试开始时间时间戳 function initStartTimeDateTime() { laydate.render({ @@ -537,6 +553,7 @@ // 初始化内容 function initData() { + initSignupTimeDateTime(); initStartTimeDateTime(); initEndTimeDateTime(); initPictureUploadFile(); diff --git a/src/main/resources/static/route/examplan/update.html b/src/main/resources/static/route/examplan/update.html index 08a256d..07c2b4d 100644 --- a/src/main/resources/static/route/examplan/update.html +++ b/src/main/resources/static/route/examplan/update.html @@ -77,7 +77,7 @@
-
+
-
+ +
+ +
+ +
@@ -442,6 +448,16 @@ } } + // 初始化考试开始时间时间戳 + function initSignupTimeDateTime() { + laydate.render({ + elem: '#signupTime', + type: 'datetime', + value: new Date(), + trigger: 'click' + }); + } + // 初始化考试开始时间时间戳 function initStartTimeDateTime() { laydate.render({ @@ -569,6 +585,7 @@ } form.val('dataForm', dataFormData); form.render(null, 'dataForm'); + initSignupTimeDateTime(); initStartTimeDateTime(); initEndTimeDateTime(); initPictureUploadFile();