Commit 381a1b2f by 邓敏

亚平换电脑BUG

1 parent b29efd27
...@@ -38,7 +38,7 @@ public class ClassDictController { ...@@ -38,7 +38,7 @@ public class ClassDictController {
@PostMapping("getAllClasses") @PostMapping("getAllClasses")
@ApiOperation("获取某公司下的所有班级 companyId 所选企业id className 班级名称 openStatus 开放状态 startDate 开始时间 endDate 结束时间") @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{ public ResponseVO getAllClasses(@RequestBody ClassDictDO classDictDO)throws Exception{
return ResponseData.generateCreatedResponse(0,classDictService.getAllClasses(classDictDO)); return ResponseData.generateCreatedResponse(0,classDictService.getAllClasses(classDictDO));
} }
......
...@@ -43,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -43,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -88,10 +89,12 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict ...@@ -88,10 +89,12 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
List<GetAllClassesVO> getAllClassesVOS = this.baseMapper.getAllClasses(classDictDO); List<GetAllClassesVO> getAllClassesVOS = this.baseMapper.getAllClasses(classDictDO);
for (GetAllClassesVO getAllClassesVO : getAllClassesVOS) { 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()))) { if (new Date().before(fmt.parse(getAllClassesVO.getStartDate()))) {
getAllClassesVO.setOpenStatus("1"); //待开始 getAllClassesVO.setOpenStatus("1"); //待开始
} else if (new Date().after(fmt.parse(getAllClassesVO.getEndDate()))) { } else if (new Date().after(calendar.getTime())) {
getAllClassesVO.setOpenStatus("2"); getAllClassesVO.setOpenStatus("2");
} else { } else {
getAllClassesVO.setOpenStatus("0"); getAllClassesVO.setOpenStatus("0");
......
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
AND t.member_id = #{memberId} AND t.member_id = #{memberId}
<if test="status ==1"> <if test="status ==1">
AND DATE_FORMAT(now(), '%Y-%m-%d') >= DATE_FORMAT(start_date, '%Y-%m-%d') AND DATE_FORMAT(now(), '%Y-%m-%d') >= DATE_FORMAT(start_date, '%Y-%m-%d')
AND DATE_FORMAT(now(), '%Y-%m-%d') &lt; DATE_FORMAT(end_date, '%Y-%m-%d') AND DATE_FORMAT(now(), '%Y-%m-%d') &lt;= DATE_FORMAT(end_date, '%Y-%m-%d')
</if> </if>
<if test="status ==2"> <if test="status ==2">
AND DATE_FORMAT(now(), '%Y-%m-%d') &lt; DATE_FORMAT(start_date, '%Y-%m-%d') AND DATE_FORMAT(now(), '%Y-%m-%d') &lt; DATE_FORMAT(start_date, '%Y-%m-%d')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!