|
|
@@ -0,0 +1,83 @@
|
|
|
+package com.xjrsoft.module.assessment.controller;
|
|
|
+
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.xjrsoft.common.model.result.RT;
|
|
|
+import com.xjrsoft.common.page.ConventPage;
|
|
|
+import com.xjrsoft.common.page.PageOutput;
|
|
|
+import com.xjrsoft.module.assessment.dto.AssessmentPlanAnswerPageDto;
|
|
|
+import com.xjrsoft.module.assessment.dto.AssessmentTemplatePlanSureDto;
|
|
|
+import com.xjrsoft.module.assessment.entity.AssessmentTemplatePlan;
|
|
|
+import com.xjrsoft.module.assessment.service.IAssessmentTemplatePlanService;
|
|
|
+import com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerPageVo;
|
|
|
+import com.xjrsoft.module.assessment.vo.AssessmentTemplatePlanVo;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+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.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+
|
|
|
+/**
|
|
|
+* @title: 考核计划
|
|
|
+* @Author dzx
|
|
|
+* @Date: 2024-04-01
|
|
|
+* @Version 1.0
|
|
|
+*/
|
|
|
+@RestController
|
|
|
+@RequestMapping("/assessment" + "/assessmentTemplateAnswer")
|
|
|
+@Api(value = "/assessment" + "/assessmentTemplateAnswer",tags = "考核计划答题代码")
|
|
|
+@AllArgsConstructor
|
|
|
+public class AssessmentPlanAnswerController {
|
|
|
+
|
|
|
+
|
|
|
+ private final IAssessmentTemplatePlanService planService;
|
|
|
+
|
|
|
+ @GetMapping(value = "/student-page")
|
|
|
+ @ApiOperation(value="考核计划答题列表-学生端(分页)")
|
|
|
+ @SaCheckPermission("assessmenttemplateplan:detail")
|
|
|
+ public RT<PageOutput<AssessmentPlanAnswerPageVo>> studentPage(@Valid AssessmentPlanAnswerPageDto dto){
|
|
|
+ dto.setStudentUserId(StpUtil.getLoginIdAsLong());
|
|
|
+ Page<AssessmentPlanAnswerPageVo> page = planService.getStudentPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
+ PageOutput<AssessmentPlanAnswerPageVo> pageOutput = ConventPage.getPageOutput(page, AssessmentPlanAnswerPageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/teacher-page")
|
|
|
+ @ApiOperation(value="考核计划答题列表-教师端(分页)")
|
|
|
+ @SaCheckPermission("assessmenttemplateplan:detail")
|
|
|
+ public RT<PageOutput<AssessmentPlanAnswerPageVo>> teacherPage(@Valid AssessmentPlanAnswerPageDto dto){
|
|
|
+ dto.setTeacherId(StpUtil.getLoginIdAsLong());
|
|
|
+ Page<AssessmentPlanAnswerPageVo> page = planService.getTeacherPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
+ PageOutput<AssessmentPlanAnswerPageVo> pageOutput = ConventPage.getPageOutput(page, AssessmentPlanAnswerPageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/info")
|
|
|
+ @ApiOperation(value="根据id查询考核计划信息")
|
|
|
+ @SaCheckPermission("assessmenttemplateplan:detail")
|
|
|
+ public RT<AssessmentTemplatePlanVo> info(@RequestParam Long id){
|
|
|
+ AssessmentTemplatePlan assessmentTemplatePlan = planService.getByIdDeep(id);
|
|
|
+ if (assessmentTemplatePlan == null) {
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
+ }
|
|
|
+ return RT.ok(BeanUtil.toBean(assessmentTemplatePlan, AssessmentTemplatePlanVo.class));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping(value="sure")
|
|
|
+ @ApiOperation(value = "班主任确认考核")
|
|
|
+ @SaCheckPermission("assessmenttemplateplan:add")
|
|
|
+ public RT<Boolean> add(@Valid @RequestBody AssessmentTemplatePlanSureDto dto){
|
|
|
+ boolean isSuccess = planService.sure(dto);
|
|
|
+ return RT.ok(isSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|