Browse Source

bug修复

master
luoweijian 2 days ago
parent
commit
6eda219436
  1. 3
      src/main/java/com/project/task/domain/dto/TaskDTO.java
  2. 4
      src/main/java/com/project/task/domain/entity/TaskEntity.java
  3. 8
      src/main/java/com/project/task/domain/service/impl/SaveOrUpdateTaskDomainServiceImpl.java

3
src/main/java/com/project/task/domain/dto/TaskDTO.java

@ -31,6 +31,9 @@ public class TaskDTO extends BaseDTO {
private String note;
private List<Long> relatedDocumentList;
private Integer singleChoiceNum;
private Integer remindTimePoint;
private Double singleChoiceScore;
private Integer multipleChoiceNum;
private Double multipleChoiceScore;

4
src/main/java/com/project/task/domain/entity/TaskEntity.java

@ -83,6 +83,10 @@ public class TaskEntity extends BaseEntity {
@Comment("考试时长")
private Integer duration;
@Column(name = "remind_time_point")
@Comment("提示时间点")
private Integer remindTimePoint = 10;
@Column(name = "pass_score")
@Comment("通过考试分数线")
private Integer passScore;

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

@ -91,6 +91,8 @@ public class SaveOrUpdateTaskDomainServiceImpl implements SaveOrUpdateTaskDomain
dto.setSingleChoiceScore(Math.round(configTotal / dto.getSingleChoiceNum() * 100) / 100.0);
}
dto.setTotalScore((int) configTotal);
// 补全冗余字段
ProductLineEntity subProductLine = productLineBaseService.getById(dto.getSubLineId());
@ -191,6 +193,12 @@ public class SaveOrUpdateTaskDomainServiceImpl implements SaveOrUpdateTaskDomain
if (Objects.isNull(dto.getDuration())) {
throw new BusinessErrorException("考试时长不能为空");
}
if (Objects.isNull(dto.getRemindTimePoint())) {
throw new BusinessErrorException("剩余时间提示点不能为空");
}
if (dto.getRemindTimePoint() > dto.getDuration()) {
throw new BusinessErrorException("剩余时间提示点不能大于考试时长");
}
if (Objects.isNull(dto.getPassScore())) {
throw new BusinessErrorException("通过考试分数线不能为空");
}

Loading…
Cancel
Save