refactor: 调整 admin dto 目录

11111
winter 12 months ago
parent 48588b12fc
commit 2fb38aa62c

@ -2,7 +2,7 @@ package cn.teammodel.controller.admin.controller;
import cn.teammodel.common.R; import cn.teammodel.common.R;
import cn.teammodel.controller.admin.service.AdminAppraiseService; import cn.teammodel.controller.admin.service.AdminAppraiseService;
import cn.teammodel.model.dto.admin.UpdateAchievementRuleDto; import cn.teammodel.model.dto.admin.appraise.UpdateAchievementRuleDto;
import cn.teammodel.model.entity.appraise.AchievementRule; import cn.teammodel.model.entity.appraise.AchievementRule;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;

@ -0,0 +1,35 @@
package cn.teammodel.controller.admin.controller;
import cn.teammodel.common.R;
import cn.teammodel.model.dto.admin.weekduty.AdminFindDutyRecordDto;
import cn.teammodel.model.dto.weekDuty.FindDutyRecordDto;
import cn.teammodel.model.vo.weekDuty.DutyRecordVo;
import cn.teammodel.service.DutyService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
/**
* @author winter
* @create 2024-01-09 17:59
*/
@RestController
@RequestMapping("admin/duty")
public class AdminDutyController {
@Resource
private DutyService dutyService;
@PostMapping("records")
public R<List<DutyRecordVo>> findRecords(@Valid @RequestBody AdminFindDutyRecordDto adminFindDutyRecordDto) {
List<DutyRecordVo> res = dutyService.findAdminRecords(adminFindDutyRecordDto);
return R.success(res);
}
}

@ -2,7 +2,7 @@ package cn.teammodel.controller.admin.controller;
import cn.teammodel.common.R; import cn.teammodel.common.R;
import cn.teammodel.controller.admin.service.AdminAppraiseService; import cn.teammodel.controller.admin.service.AdminAppraiseService;
import cn.teammodel.model.dto.admin.TimeRangeDto; import cn.teammodel.model.dto.admin.appraise.TimeRangeDto;
import cn.teammodel.model.vo.admin.*; import cn.teammodel.model.vo.admin.*;
import cn.teammodel.model.vo.appraise.RecordVo; import cn.teammodel.model.vo.appraise.RecordVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;

@ -1,7 +1,7 @@
package cn.teammodel.controller.admin.service; package cn.teammodel.controller.admin.service;
import cn.teammodel.model.dto.admin.TimeRangeDto; import cn.teammodel.model.dto.admin.appraise.TimeRangeDto;
import cn.teammodel.model.dto.admin.UpdateAchievementRuleDto; import cn.teammodel.model.dto.admin.appraise.UpdateAchievementRuleDto;
import cn.teammodel.model.entity.appraise.AchievementRule; import cn.teammodel.model.entity.appraise.AchievementRule;
import cn.teammodel.model.vo.admin.*; import cn.teammodel.model.vo.admin.*;
import cn.teammodel.model.vo.appraise.RecordVo; import cn.teammodel.model.vo.appraise.RecordVo;

@ -5,8 +5,8 @@ import cn.teammodel.common.PK;
import cn.teammodel.config.exception.ServiceException; import cn.teammodel.config.exception.ServiceException;
import cn.teammodel.controller.admin.service.AdminAppraiseService; import cn.teammodel.controller.admin.service.AdminAppraiseService;
import cn.teammodel.repository.*; import cn.teammodel.repository.*;
import cn.teammodel.model.dto.admin.TimeRangeDto; import cn.teammodel.model.dto.admin.appraise.TimeRangeDto;
import cn.teammodel.model.dto.admin.UpdateAchievementRuleDto; import cn.teammodel.model.dto.admin.appraise.UpdateAchievementRuleDto;
import cn.teammodel.model.entity.User; import cn.teammodel.model.entity.User;
import cn.teammodel.model.entity.appraise.AchievementRule; import cn.teammodel.model.entity.appraise.AchievementRule;
import cn.teammodel.model.entity.appraise.Appraise; import cn.teammodel.model.entity.appraise.Appraise;
@ -250,6 +250,7 @@ public class AdminAppraiseServiceImpl implements AdminAppraiseService {
if (rankVoList == null) return null; if (rankVoList == null) return null;
List<String> names = rankVoList.stream().map(AppraiseNodeRankVo::getName).collect(Collectors.toList()); List<String> names = rankVoList.stream().map(AppraiseNodeRankVo::getName).collect(Collectors.toList());
if (ObjectUtils.isEmpty(names)) return null;
// 去重后的 nodes // 去重后的 nodes
List<AppraiseTreeNode> nodesByName = appraiseRecordRepository.findAppraiseRecordInNames(String.format(PK.PK_APPRAISE_RECORD, schoolId), academicYearId, names); List<AppraiseTreeNode> nodesByName = appraiseRecordRepository.findAppraiseRecordInNames(String.format(PK.PK_APPRAISE_RECORD, schoolId), academicYearId, names);
// 正常情况下 name 一一对应 todo: 临时解决 // 正常情况下 name 一一对应 todo: 临时解决

@ -1,4 +1,4 @@
package cn.teammodel.model.dto.admin; package cn.teammodel.model.dto.admin.appraise;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;

@ -1,4 +1,4 @@
package cn.teammodel.model.dto.admin; package cn.teammodel.model.dto.admin.appraise;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;

@ -0,0 +1,29 @@
package cn.teammodel.model.dto.admin.weekduty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @author winter
* @create 2024-01-15 10:30
*/
@Data
public class AdminFindDutyRecordDto {
@ApiModelProperty("老师 id")
private String teacherId;
@ApiModelProperty("学生 id")
private String studentId;
@ApiModelProperty(value = "班级 id", notes = "若不携带默认不指定某个班级")
private String classId;
@ApiModelProperty(required = true)
@NotNull(message = "academicYearid 不能为空")
private String academicYearId;
@ApiModelProperty(value = "是否加分", notes = "若不携带默认为全部")
private Boolean positive;
@ApiModelProperty(value = "起始时间", notes = "若不携带默认为当前周")
private Long startTime;
@ApiModelProperty(value = "结束时间", notes = "若不携带默认为当前周")
private Long endTime;
}

@ -1,5 +1,6 @@
package cn.teammodel.service; package cn.teammodel.service;
import cn.teammodel.model.dto.admin.weekduty.AdminFindDutyRecordDto;
import cn.teammodel.model.dto.weekDuty.*; import cn.teammodel.model.dto.weekDuty.*;
import cn.teammodel.model.entity.weekDuty.WeekDuty; import cn.teammodel.model.entity.weekDuty.WeekDuty;
import cn.teammodel.model.vo.weekDuty.DutyRecordVo; import cn.teammodel.model.vo.weekDuty.DutyRecordVo;
@ -28,4 +29,6 @@ public interface DutyService {
List<DutyRecordVo> findRecords(FindDutyRecordDto findDutyRecordDto); List<DutyRecordVo> findRecords(FindDutyRecordDto findDutyRecordDto);
void recallVote(RecallDutyVoteDto recallDutyVoteDto); void recallVote(RecallDutyVoteDto recallDutyVoteDto);
List<DutyRecordVo> findAdminRecords(AdminFindDutyRecordDto adminFindDutyRecordDto);
} }

@ -4,6 +4,7 @@ import cn.hutool.core.lang.UUID;
import cn.teammodel.common.ErrorCode; import cn.teammodel.common.ErrorCode;
import cn.teammodel.common.PK; import cn.teammodel.common.PK;
import cn.teammodel.config.exception.ServiceException; import cn.teammodel.config.exception.ServiceException;
import cn.teammodel.model.dto.admin.weekduty.AdminFindDutyRecordDto;
import cn.teammodel.model.dto.weekDuty.*; import cn.teammodel.model.dto.weekDuty.*;
import cn.teammodel.model.entity.User; import cn.teammodel.model.entity.User;
import cn.teammodel.model.entity.school.ClassInfo; import cn.teammodel.model.entity.school.ClassInfo;
@ -368,6 +369,11 @@ public class DutyServiceImpl implements DutyService {
dutyRecordRepository.save(weekDutyRecord); dutyRecordRepository.save(weekDutyRecord);
} }
@Override
public List<DutyRecordVo> findAdminRecords(AdminFindDutyRecordDto adminFindDutyRecordDto) {
return null;
}
/** /**
* spots id * spots id
*/ */

@ -4,8 +4,8 @@ import cn.teammodel.common.PK;
import cn.teammodel.controller.admin.service.AdminAppraiseService; import cn.teammodel.controller.admin.service.AdminAppraiseService;
import cn.teammodel.repository.*; import cn.teammodel.repository.*;
import cn.teammodel.manager.DingAlertNotifier; import cn.teammodel.manager.DingAlertNotifier;
import cn.teammodel.model.dto.admin.TimeRangeDto; import cn.teammodel.model.dto.admin.appraise.TimeRangeDto;
import cn.teammodel.model.dto.admin.UpdateAchievementRuleDto; import cn.teammodel.model.dto.admin.appraise.UpdateAchievementRuleDto;
import cn.teammodel.model.entity.appraise.*; import cn.teammodel.model.entity.appraise.*;
import cn.teammodel.model.entity.school.School; import cn.teammodel.model.entity.school.School;
import cn.teammodel.service.EvaluationService; import cn.teammodel.service.EvaluationService;

Loading…
Cancel
Save