Browse Source

知识点确认,资料名称修改

master
luoweijian 2 months ago
parent
commit
7c4ba29188
  1. 2
      src/main/java/com/project/task/domain/param/TaskParam.java
  2. 11
      src/main/java/com/project/task/domain/service/impl/SaveOrUpdateTaskDomainServiceImpl.java
  3. 8
      src/main/java/com/project/task/domain/service/impl/SearchTaskDomainServiceImpl.java

2
src/main/java/com/project/task/domain/param/TaskParam.java

@ -25,4 +25,6 @@ public class TaskParam extends BaseParam {
private Boolean excludeEnd = Boolean.TRUE;
private Long classicCategoryId;
}

11
src/main/java/com/project/task/domain/service/impl/SaveOrUpdateTaskDomainServiceImpl.java

@ -112,7 +112,15 @@ public class SaveOrUpdateTaskDomainServiceImpl implements SaveOrUpdateTaskDomain
dto.setBusinessId(subProductLine.getBusinessId());
}
// 经典模式:补全分类冗余字段
if (ExamModeEnum.CLASSIC.getValue().equals(dto.getExamMode()) && dto.getClassicCategoryId() != null) {
if (ExamModeEnum.CLASSIC.getValue().equals(dto.getExamMode())) {
// 如果前端没传 classicCategoryId,从套题组推导
if (dto.getClassicCategoryId() == null && dto.getClassicPaperSetId() != null) {
ClassicPaperSetEntity paperSet = classicPaperSetBaseService.getById(dto.getClassicPaperSetId());
if (paperSet != null) {
dto.setClassicCategoryId(paperSet.getClassicCategoryId());
}
}
if (dto.getClassicCategoryId() != null) {
ClassicCategoryEntity category = classicCategoryBaseService.getById(dto.getClassicCategoryId());
if (category != null) {
dto.setClassicCategoryName(category.getName());
@ -126,6 +134,7 @@ public class SaveOrUpdateTaskDomainServiceImpl implements SaveOrUpdateTaskDomain
}
}
}
}
// 保存
TaskEntity saveEntity = dto.toEntity(TaskEntity::new);
saveEntity.setParticipantNum(dto.getParticipantUserIdList().size());

8
src/main/java/com/project/task/domain/service/impl/SearchTaskDomainServiceImpl.java

@ -83,6 +83,9 @@ public class SearchTaskDomainServiceImpl implements SearchTaskDomainService {
queryWrapper.in(TaskEntity::getSubLineId, productLineEntityList);
}
}
if (Objects.nonNull(param.getClassicCategoryId())) {
queryWrapper.eq(TaskEntity::getClassicCategoryId, param.getClassicCategoryId());
}
// 考试状态过滤
Date endOfToday = DateUtil.endOfDay(new Date());
Date beginOfToday = DateUtil.beginOfDay(new Date());
@ -99,11 +102,6 @@ public class SearchTaskDomainServiceImpl implements SearchTaskDomainService {
queryWrapper.le(TaskEntity::getStartTime, endOfToday);
queryWrapper.ge(TaskEntity::getEndTime, beginOfToday);
}
if (BooleanUtil.isTrue(param.getExcludeEnd())) {
// 强制要求:结束时间必须 >= 今天 00:00:00
// 这样,截止时间是今天的任务会被【保留】,只有昨天及以前截止的任务会被【排除】
queryWrapper.ge(TaskEntity::getEndTime, beginOfToday);
}
queryWrapper.orderByDesc(TaskEntity::getId);
IPage<TaskEntity> taskEntityPage = taskMapper.selectPage(
PageConverter.toMpPage(param),

Loading…
Cancel
Save