From b8d77f35e714a5944ab8731b8071dd58158df45f Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Thu, 17 Jun 2021 16:03:24 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../examplan/impl/ExamPlanServiceImpl.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 db80700..db70a6b 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 @@ -292,7 +292,7 @@ public class ExamPlanServiceImpl extends DefaultBaseService implements IExamPlan // 时间比较 Date nowDate = simpleDateFormat.parse(nowTime); Date endDate = simpleDateFormat.parse(endTime); - if(nowDate.getTime() <= endDate.getTime()) { + if(nowDate.getTime() >= endDate.getTime()) { examPlanDTO.setBtnStatus("报名截止"); } }catch (Exception e){ @@ -335,4 +335,17 @@ public class ExamPlanServiceImpl extends DefaultBaseService implements IExamPlan contentService.updatePublishStatus(params.get("contentId").toString(), Integer.valueOf(params.get("isSend").toString())); } + public static void main(String[] args) throws ParseException { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String nowTime = simpleDateFormat.format(new Date()); + String endTime = "2021-06-10 14:47:29"; + Date nowDate = simpleDateFormat.parse(nowTime); + Date endDate = simpleDateFormat.parse(endTime); + if(nowDate.getTime() <= endDate.getTime()) { + System.out.println("报名截至"); + }else { + System.out.println("报名继续"); + } + } + } \ No newline at end of file