|
@@ -0,0 +1,119 @@
|
|
|
|
|
+package com.xjrsoft.module.student.controller;
|
|
|
|
|
+
|
|
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
+import com.github.yulichang.toolkit.MPJWrappers;
|
|
|
|
|
+import com.xjrsoft.common.model.result.RT;
|
|
|
|
|
+import com.xjrsoft.common.page.ConventPage;
|
|
|
|
|
+import com.xjrsoft.common.page.PageOutput;
|
|
|
|
|
+import com.xjrsoft.module.student.dto.AddBaseStudentAssessmentInspectionDto;
|
|
|
|
|
+import com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionPageDto;
|
|
|
|
|
+import com.xjrsoft.module.student.dto.UpdateBaseStudentAssessmentInspectionDto;
|
|
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentAssessmentCategory;
|
|
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentAssessmentInspection;
|
|
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentAssessmentProject;
|
|
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentAssessmentInspectionService;
|
|
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionPageVo;
|
|
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionVo;
|
|
|
|
|
+import com.xjrsoft.module.teacher.entity.XjrUser;
|
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
|
+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;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+* @title: 学生班级巡查考核
|
|
|
|
|
+* @Author dzx
|
|
|
|
|
+* @Date: 2023-11-16
|
|
|
|
|
+* @Version 1.0
|
|
|
|
|
+*/
|
|
|
|
|
+@RestController
|
|
|
|
|
+@RequestMapping("/student" + "/basestudentassessmentinspection")
|
|
|
|
|
+@Api(value = "/student" + "/basestudentassessmentinspection",tags = "学生班级巡查考核代码")
|
|
|
|
|
+@AllArgsConstructor
|
|
|
|
|
+public class BaseStudentAssessmentInspectionController {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ private final IBaseStudentAssessmentInspectionService baseStudentAssessmentInspectionService;
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping(value = "/page")
|
|
|
|
|
+ @ApiOperation(value="学生班级巡查考核列表(分页)")
|
|
|
|
|
+ @SaCheckPermission("basestudentassessmentinspection:detail")
|
|
|
|
|
+ public RT<PageOutput<BaseStudentAssessmentInspectionPageVo>> page(@Valid BaseStudentAssessmentInspectionPageDto dto){
|
|
|
|
|
+ IPage<BaseStudentAssessmentInspectionPageVo> page = baseStudentAssessmentInspectionService.selectJoinListPage(ConventPage.getPage(dto), BaseStudentAssessmentInspectionPageVo.class,
|
|
|
|
|
+ MPJWrappers.<BaseStudentAssessmentInspection>lambdaJoin()
|
|
|
|
|
+ .select("c.name as class_name")
|
|
|
|
|
+ .select("u.name as class_teacher")
|
|
|
|
|
+ .select("d.name as dept_name")
|
|
|
|
|
+ .select("(SELECT COUNT(*) FROM base_student_assessment_student_relation WHERE base_student_assessment_inspection_id = t.id) as student_count")
|
|
|
|
|
+ .selectAs(XjrUser::getName, BaseStudentAssessmentInspectionPageVo::getCreateUserName)
|
|
|
|
|
+ .select(BaseStudentAssessmentInspection::getScore)
|
|
|
|
|
+ .select(BaseStudentAssessmentInspection::getSortCode)
|
|
|
|
|
+ .select(BaseStudentAssessmentInspection::getReason)
|
|
|
|
|
+ .select(BaseStudentAssessmentInspection::getId)
|
|
|
|
|
+ .select(BaseStudentAssessmentInspection::getFileId)
|
|
|
|
|
+ .selectAs(BaseStudentAssessmentCategory::getName, BaseStudentAssessmentInspectionPageVo::getAssessmentCategoryName)
|
|
|
|
|
+ .selectAs(BaseStudentAssessmentProject::getName, BaseStudentAssessmentInspectionPageVo::getAssessmentProjectName)
|
|
|
|
|
+ .innerJoin(BaseStudentAssessmentCategory.class, BaseStudentAssessmentCategory::getId, BaseStudentAssessmentInspection::getBaseStudentAssessmentCategoryId)
|
|
|
|
|
+ .innerJoin(BaseStudentAssessmentProject.class, BaseStudentAssessmentProject::getId, BaseStudentAssessmentInspection::getBaseStudentAssessmentProjectId)
|
|
|
|
|
+ .innerJoin(XjrUser.class, XjrUser::getId, BaseStudentAssessmentInspection::getCreateUserId)
|
|
|
|
|
+ .innerJoin("base_class c ON t.class_ids LIKE CONCAT('%', c.id, '%')")
|
|
|
|
|
+ .innerJoin("xjr_user u on c.teacher_id = u.id")
|
|
|
|
|
+ .innerJoin("xjr_department d on c.org_id = d.id")
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ PageOutput<BaseStudentAssessmentInspectionPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentAssessmentInspectionPageVo.class);
|
|
|
|
|
+ return RT.ok(pageOutput);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping(value = "/info")
|
|
|
|
|
+ @ApiOperation(value="根据id查询学生班级巡查考核信息")
|
|
|
|
|
+ @SaCheckPermission("basestudentassessmentinspection:detail")
|
|
|
|
|
+ public RT<BaseStudentAssessmentInspectionVo> info(@RequestParam Long id){
|
|
|
|
|
+ BaseStudentAssessmentInspection baseStudentAssessmentInspection = baseStudentAssessmentInspectionService.getById(id);
|
|
|
|
|
+ if (baseStudentAssessmentInspection == null) {
|
|
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
|
|
+ }
|
|
|
|
|
+ return RT.ok(BeanUtil.toBean(baseStudentAssessmentInspection, BaseStudentAssessmentInspectionVo.class));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping
|
|
|
|
|
+ @ApiOperation(value = "新增学生班级巡查考核")
|
|
|
|
|
+ @SaCheckPermission("basestudentassessmentinspection:add")
|
|
|
|
|
+ public RT<Boolean> add(@Valid @RequestBody AddBaseStudentAssessmentInspectionDto dto){
|
|
|
|
|
+ BaseStudentAssessmentInspection baseStudentAssessmentInspection = BeanUtil.toBean(dto, BaseStudentAssessmentInspection.class);
|
|
|
|
|
+ boolean isSuccess = baseStudentAssessmentInspectionService.save(baseStudentAssessmentInspection);
|
|
|
|
|
+ return RT.ok(isSuccess);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @PutMapping
|
|
|
|
|
+ @ApiOperation(value = "修改学生班级巡查考核")
|
|
|
|
|
+ @SaCheckPermission("basestudentassessmentinspection:edit")
|
|
|
|
|
+ public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentAssessmentInspectionDto dto){
|
|
|
|
|
+
|
|
|
|
|
+ BaseStudentAssessmentInspection baseStudentAssessmentInspection = BeanUtil.toBean(dto, BaseStudentAssessmentInspection.class);
|
|
|
|
|
+ return RT.ok(baseStudentAssessmentInspectionService.updateById(baseStudentAssessmentInspection));
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @DeleteMapping
|
|
|
|
|
+ @ApiOperation(value = "删除学生班级巡查考核")
|
|
|
|
|
+ @SaCheckPermission("basestudentassessmentinspection:delete")
|
|
|
|
|
+ public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
|
|
+ return RT.ok(baseStudentAssessmentInspectionService.removeBatchByIds(ids));
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|