|
@@ -127,10 +127,8 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public PageResult<StudentApplyVO> page(StudentApplyReq req) {
|
|
public PageResult<StudentApplyVO> page(StudentApplyReq req) {
|
|
- if (req.getTaskId() == null) {
|
|
|
|
- ApplyTaskEntity task = getApplyTask();
|
|
|
|
- req.setTaskId(task.getId());
|
|
|
|
- }
|
|
|
|
|
|
+ ApplyTaskEntity task = getApplyTask();
|
|
|
|
+ req.setTaskId(task.getId());
|
|
if (req.getTeachingId() != null) {
|
|
if (req.getTeachingId() != null) {
|
|
List<CategoryVO> examSiteList = examSiteService.listExamSite(req.getTeachingId(), Boolean.FALSE);
|
|
List<CategoryVO> examSiteList = examSiteService.listExamSite(req.getTeachingId(), Boolean.FALSE);
|
|
if (examSiteList == null || examSiteList.isEmpty()) {
|
|
if (examSiteList == null || examSiteList.isEmpty()) {
|
|
@@ -139,6 +137,7 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
|
|
List<Long> examSiteIds = examSiteList.stream().map(CategoryVO::getId).collect(Collectors.toList());
|
|
List<Long> examSiteIds = examSiteList.stream().map(CategoryVO::getId).collect(Collectors.toList());
|
|
req.setExamSiteIds(examSiteIds.isEmpty() ? null : examSiteIds);
|
|
req.setExamSiteIds(examSiteIds.isEmpty() ? null : examSiteIds);
|
|
}
|
|
}
|
|
|
|
+
|
|
IPage<StudentApplyVO> iPage = baseMapper.page(new Page<>(req.getPageNumber(), req.getPageSize()), req);
|
|
IPage<StudentApplyVO> iPage = baseMapper.page(new Page<>(req.getPageNumber(), req.getPageSize()), req);
|
|
List<StudentApplyVO> records = iPage.getRecords();
|
|
List<StudentApplyVO> records = iPage.getRecords();
|
|
for (StudentApplyVO record : records) {
|
|
for (StudentApplyVO record : records) {
|
|
@@ -148,6 +147,16 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
|
|
record.setApplyTeachingName(agentRoom.getApplyTeachingName());
|
|
record.setApplyTeachingName(agentRoom.getApplyTeachingName());
|
|
record.setRoomName(agentRoom.getRoomName());
|
|
record.setRoomName(agentRoom.getRoomName());
|
|
record.setUserName(agentRoom.getUserName());
|
|
record.setUserName(agentRoom.getUserName());
|
|
|
|
+
|
|
|
|
+ // 是否可取消
|
|
|
|
+ TimePeriodEntity timePeriod = timePeriodService.getById(record.getTimePeriodId());
|
|
|
|
+ Date applyDate = DateUtils.truncate(new Date(timePeriod.getStartTime()), Calendar.DATE);
|
|
|
|
+ Date canCancelDay = DateUtil.addValues(applyDate, Calendar.DAY_OF_MONTH, -task.getAllowApplyCancelDays());
|
|
|
|
+ if (new Date().after(canCancelDay)) {
|
|
|
|
+ record.setCanCancelFlag(Boolean.FALSE);
|
|
|
|
+ } else {
|
|
|
|
+ record.setCanCancelFlag(Boolean.TRUE);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return PageUtil.of(iPage);
|
|
return PageUtil.of(iPage);
|
|
}
|
|
}
|