|
|
@@ -5,6 +5,7 @@ import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.xjrsoft.common.annotation.XjrLog;
|
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.enums.EnabledMark;
|
|
|
import com.xjrsoft.common.exception.MyException;
|
|
|
@@ -12,6 +13,8 @@ import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.TreeUtil;
|
|
|
+import com.xjrsoft.module.banding.entity.BandingTask;
|
|
|
+import com.xjrsoft.module.banding.service.IBandingTaskService;
|
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
import com.xjrsoft.module.base.entity.BaseSemester;
|
|
|
import com.xjrsoft.module.base.service.IBaseClassService;
|
|
|
@@ -64,10 +67,12 @@ public class StudentReportPlanController {
|
|
|
private final IStudentReportPlanService studentReportPlanService;
|
|
|
private final IBaseSemesterService semesterService;
|
|
|
private final IBaseClassService classService;
|
|
|
+ private final IBandingTaskService taskService;
|
|
|
|
|
|
@GetMapping(value = "/page")
|
|
|
@ApiOperation(value="学生报到计划列表(分页)")
|
|
|
@SaCheckPermission("studentreportplan:detail")
|
|
|
+ @XjrLog(value="学生报到计划列表(分页)")
|
|
|
public RT<PageOutput<StudentReportPlanPageVo>> page(@Valid StudentReportPlanPageDto dto){
|
|
|
Page<StudentReportPlanPageVo> page = studentReportPlanService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
PageOutput<StudentReportPlanPageVo> pageOutput = ConventPage.getPageOutput(page, StudentReportPlanPageVo.class);
|
|
|
@@ -77,6 +82,7 @@ public class StudentReportPlanController {
|
|
|
@GetMapping(value = "/info")
|
|
|
@ApiOperation(value="根据id查询学生报到计划信息")
|
|
|
@SaCheckPermission("studentreportplan:detail")
|
|
|
+ @XjrLog(value="根据id查询学生报到计划信息")
|
|
|
public RT<StudentReportPlanVo> info(@RequestParam Long id){
|
|
|
StudentReportPlan studentReportPlan = studentReportPlanService.getByIdDeep(id);
|
|
|
if (studentReportPlan == null) {
|
|
|
@@ -99,6 +105,7 @@ public class StudentReportPlanController {
|
|
|
@PostMapping
|
|
|
@ApiOperation(value = "新增学生报到计划")
|
|
|
@SaCheckPermission("studentreportplan:add")
|
|
|
+ @XjrLog(value="新增学生报到计划")
|
|
|
public RT<Boolean> add(@Valid @RequestBody AddStudentReportPlanDto dto){
|
|
|
StudentReportPlan studentReportPlan = BeanUtil.toBean(dto, StudentReportPlan.class);
|
|
|
boolean isSuccess = studentReportPlanService.add(studentReportPlan);
|
|
|
@@ -108,6 +115,7 @@ public class StudentReportPlanController {
|
|
|
@PutMapping
|
|
|
@ApiOperation(value = "修改学生报到计划")
|
|
|
@SaCheckPermission("studentreportplan:edit")
|
|
|
+ @XjrLog(value="修改学生报到计划")
|
|
|
public RT<Boolean> update(@Valid @RequestBody UpdateStudentReportPlanDto dto){
|
|
|
|
|
|
StudentReportPlan studentReportPlan = BeanUtil.toBean(dto, StudentReportPlan.class);
|
|
|
@@ -118,6 +126,7 @@ public class StudentReportPlanController {
|
|
|
@DeleteMapping
|
|
|
@ApiOperation(value = "删除学生报到计划")
|
|
|
@SaCheckPermission("studentreportplan:delete")
|
|
|
+ @XjrLog(value="删除学生报到计划")
|
|
|
public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
return RT.ok(studentReportPlanService.delete(ids));
|
|
|
|
|
|
@@ -126,6 +135,7 @@ public class StudentReportPlanController {
|
|
|
@PostMapping(value = "/change-status")
|
|
|
@ApiOperation(value="修改状态")
|
|
|
@SaCheckPermission("classroom:detail")
|
|
|
+ @XjrLog(value="修改状态")
|
|
|
public RT<Boolean> changeStatus(@Valid @RequestBody StudentReportPlanStatusDto dto) throws Exception {
|
|
|
StudentReportPlan reportPlan = studentReportPlanService.getByIdDeep(dto.getId());
|
|
|
if(reportPlan == null){
|
|
|
@@ -180,6 +190,7 @@ public class StudentReportPlanController {
|
|
|
@GetMapping(value = "/tree")
|
|
|
@ApiOperation(value="学期计划树")
|
|
|
@SaCheckPermission("studentreportplan:detail")
|
|
|
+ @XjrLog(value="学期计划树")
|
|
|
public RT<List<StudentReportPlanTreeVo>> tree(){
|
|
|
List<Integer> statusList = new ArrayList<>();
|
|
|
statusList.add(1);statusList.add(2);
|
|
|
@@ -224,4 +235,23 @@ public class StudentReportPlanController {
|
|
|
List<StudentReportPlanTreeVo> treeVoList = TreeUtil.build(resultList);
|
|
|
return RT.ok(treeVoList);
|
|
|
}
|
|
|
+
|
|
|
+ @GetMapping(value = "/try-reading-plan")
|
|
|
+ @ApiOperation(value="根据分班任务id查询试读报到计划信息")
|
|
|
+ @SaCheckPermission("bandingrule:try-reading-plan")
|
|
|
+ @XjrLog(value="根据分班任务id查询试读报到计划信息")
|
|
|
+ public RT<StudentReportPlanVo> tryReadingPlan(@RequestParam Long bandingTaskId){
|
|
|
+ BandingTask bandingTask = taskService.getById(bandingTaskId);
|
|
|
+ BaseSemester semester = semesterService.getCurrentSemester();
|
|
|
+ StudentReportPlan plan = studentReportPlanService.getOne(
|
|
|
+ new QueryWrapper<StudentReportPlan>().lambda()
|
|
|
+ .eq(StudentReportPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ .eq(StudentReportPlan::getSemesterId, semester.getId())
|
|
|
+ .eq(StudentReportPlan::getName, bandingTask.getName())
|
|
|
+ );
|
|
|
+ if (plan == null) {
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
+ }
|
|
|
+ return RT.ok(BeanUtil.toBean(plan, StudentReportPlanVo.class));
|
|
|
+ }
|
|
|
}
|