| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.utils.TimeSwitchUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.modules.apply.entity.Apply; |
| | | import org.springblade.modules.exam.entity.*; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | if (examPaperVO1.getExamType()==2) { |
| | | examPaperVO1.setNum(baseMapper.getTrainNumber(examPaperVO1)); |
| | | examPaperVO1.setExamNum(baseMapper.getExamNumber(examPaperVO1)); |
| | | //计算截止时间 |
| | | long nowTime = System.currentTimeMillis(); |
| | | long examStartTime = examPaperVO1.getStartTime().getTime(); |
| | | long examEndTime = examPaperVO1.getEndTime().getTime(); |
| | | //判断时间 |
| | | if (nowTime-examEndTime>0){ |
| | | //剩余时间大于1天 |
| | | examPaperVO1.setDeadline("考试已结束"); |
| | | }else if(nowTime-examStartTime>=0 && nowTime-examEndTime<=0){ |
| | | //已到考试时间 |
| | | examPaperVO1.setDeadline("已到考试时间"); |
| | | }else { |
| | | long time = examStartTime - nowTime; |
| | | examPaperVO1.setDeadline(TimeSwitchUtil.secondToTime(time)); |
| | | } |
| | | } |
| | | }); |
| | | return examPaperVOIPage; |