diff --git a/src/main/java/cn/teammodel/controller/frontend/DutyController.java b/src/main/java/cn/teammodel/controller/frontend/DutyController.java index 0d7ef8c..704d57f 100644 --- a/src/main/java/cn/teammodel/controller/frontend/DutyController.java +++ b/src/main/java/cn/teammodel/controller/frontend/DutyController.java @@ -82,7 +82,7 @@ public class DutyController { } @PostMapping("/findRecords") - @ApiOperation("多条件查询评价明细") + @ApiOperation(value = "多条件查询评价明细", notes = "只带 periodId 默认查询当前登录老师在本周的评价明细") public R> findRecords(@RequestBody @Valid FindDutyRecordDto findDutyRecordDto) { List items = dutyService.findRecords(findDutyRecordDto); return R.success(items); diff --git a/src/main/java/cn/teammodel/model/dto/weekDuty/FindDutyRecordDto.java b/src/main/java/cn/teammodel/model/dto/weekDuty/FindDutyRecordDto.java index 93a1634..664a302 100644 --- a/src/main/java/cn/teammodel/model/dto/weekDuty/FindDutyRecordDto.java +++ b/src/main/java/cn/teammodel/model/dto/weekDuty/FindDutyRecordDto.java @@ -14,8 +14,8 @@ public class FindDutyRecordDto { @ApiModelProperty(value = "班级 id", notes = "若不携带默认不指定某个班级") private String classId; @ApiModelProperty(required = true) - @NotNull(message = "学年 id 不能为空") - private String academicYearId; + @NotNull(message = "学段 id 不能为空") + private String periodId; @ApiModelProperty(value = "是否加分", notes = "若不携带默认为全部") private Boolean positive; @ApiModelProperty(value = "起始时间", notes = "若不携带默认为当前周") diff --git a/src/main/java/cn/teammodel/service/impl/DutyServiceImpl.java b/src/main/java/cn/teammodel/service/impl/DutyServiceImpl.java index 8c5187b..d6ef3de 100644 --- a/src/main/java/cn/teammodel/service/impl/DutyServiceImpl.java +++ b/src/main/java/cn/teammodel/service/impl/DutyServiceImpl.java @@ -314,7 +314,7 @@ public class DutyServiceImpl implements DutyService { @Override public List findRecords(FindDutyRecordDto findDutyRecordDto) { String classId = StringUtils.isEmpty(findDutyRecordDto.getClassId()) ? null : findDutyRecordDto.getClassId(); - String academicYearId = findDutyRecordDto.getAcademicYearId(); + String periodId = findDutyRecordDto.getPeriodId(); Boolean positive = findDutyRecordDto.getPositive(); Long startTime = findDutyRecordDto.getStartTime(); Long endTime = findDutyRecordDto.getEndTime(); @@ -322,6 +322,9 @@ public class DutyServiceImpl implements DutyService { String schoolId = user.getSchoolId(); String userId = user.getId(); + List semesters = schoolRepository.findSemestersById(schoolId, periodId); + String academicYearId = SchoolDateUtil.calculateAcademicYearId(semesters, LocalDate.now()); + if (startTime == null || endTime == null) { LocalDateTime mondayOfCurWeek = LocalDateTime.now().with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)) .withHour(0)