From 381a1b2f5d4c8823663a6c26d344d17615228ada Mon Sep 17 00:00:00 2001 From: DengMin <16679070171@qq.com> Date: Fri, 4 Mar 2022 19:02:10 +0800 Subject: [PATCH] 亚平换电脑BUG --- src/main/java/com/subsidy/controller/ClassDictController.java | 2 +- src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java | 7 +++++-- src/main/resources/mapper/MemberMapper.xml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/subsidy/controller/ClassDictController.java b/src/main/java/com/subsidy/controller/ClassDictController.java index 3124ce7..a1c447b 100644 --- a/src/main/java/com/subsidy/controller/ClassDictController.java +++ b/src/main/java/com/subsidy/controller/ClassDictController.java @@ -38,7 +38,7 @@ public class ClassDictController { @PostMapping("getAllClasses") @ApiOperation("获取某公司下的所有班级 companyId 所选企业id className 班级名称 openStatus 开放状态 startDate 开始时间 endDate 结束时间") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + // @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO getAllClasses(@RequestBody ClassDictDO classDictDO)throws Exception{ return ResponseData.generateCreatedResponse(0,classDictService.getAllClasses(classDictDO)); } diff --git a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java index 662f92e..2eb8235 100644 --- a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java @@ -43,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional; import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -88,10 +89,12 @@ public class ClassDictServiceImpl extends ServiceImpl getAllClassesVOS = this.baseMapper.getAllClasses(classDictDO); for (GetAllClassesVO getAllClassesVO : getAllClassesVOS) { - + Calendar calendar = Calendar.getInstance(); + calendar.setTime(fmt.parse(getAllClassesVO.getEndDate())); + calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) + 1); if (new Date().before(fmt.parse(getAllClassesVO.getStartDate()))) { getAllClassesVO.setOpenStatus("1"); //待开始 - } else if (new Date().after(fmt.parse(getAllClassesVO.getEndDate()))) { + } else if (new Date().after(calendar.getTime())) { getAllClassesVO.setOpenStatus("2"); } else { getAllClassesVO.setOpenStatus("0"); diff --git a/src/main/resources/mapper/MemberMapper.xml b/src/main/resources/mapper/MemberMapper.xml index 7f77847..b3cba79 100644 --- a/src/main/resources/mapper/MemberMapper.xml +++ b/src/main/resources/mapper/MemberMapper.xml @@ -137,7 +137,7 @@ AND t.member_id = #{memberId} AND DATE_FORMAT(now(), '%Y-%m-%d') >= DATE_FORMAT(start_date, '%Y-%m-%d') - AND DATE_FORMAT(now(), '%Y-%m-%d') < DATE_FORMAT(end_date, '%Y-%m-%d') + AND DATE_FORMAT(now(), '%Y-%m-%d') <= DATE_FORMAT(end_date, '%Y-%m-%d') AND DATE_FORMAT(now(), '%Y-%m-%d') < DATE_FORMAT(start_date, '%Y-%m-%d') -- libgit2 0.25.0