refactor: 前台查询老师评价值周明细接口参数调整

11111
winter 12 months ago
parent 8c15427ff7
commit 256b233b4c

@ -82,7 +82,7 @@ public class DutyController {
}
@PostMapping("/findRecords")
@ApiOperation("多条件查询评价明细")
@ApiOperation(value = "多条件查询评价明细", notes = "只带 periodId 默认查询当前登录老师在本周的评价明细")
public R<List<DutyRecordVo>> findRecords(@RequestBody @Valid FindDutyRecordDto findDutyRecordDto) {
List<DutyRecordVo> items = dutyService.findRecords(findDutyRecordDto);
return R.success(items);

@ -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 = "若不携带默认为当前周")

@ -314,7 +314,7 @@ public class DutyServiceImpl implements DutyService {
@Override
public List<DutyRecordVo> 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<School.Semester> 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)

Loading…
Cancel
Save