|
@@ -3,10 +3,12 @@ package com.xjrsoft.module.student.controller;
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
+import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
+import com.xjrsoft.common.annotation.XjrLog;
|
|
|
import com.xjrsoft.common.enums.EnabledMark;
|
|
import com.xjrsoft.common.enums.EnabledMark;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
@@ -16,11 +18,14 @@ import com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionMobilePageD
|
|
|
import com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionPageDto;
|
|
import com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionPageDto;
|
|
|
import com.xjrsoft.module.student.dto.CalssQuantitativeAssessmentPageDto;
|
|
import com.xjrsoft.module.student.dto.CalssQuantitativeAssessmentPageDto;
|
|
|
import com.xjrsoft.module.student.dto.CancelStudentDto;
|
|
import com.xjrsoft.module.student.dto.CancelStudentDto;
|
|
|
|
|
+import com.xjrsoft.module.student.dto.ImportBaseStudentAssessmentInspectionDto;
|
|
|
import com.xjrsoft.module.student.dto.UpdateBaseStudentAssessmentInspectionDto;
|
|
import com.xjrsoft.module.student.dto.UpdateBaseStudentAssessmentInspectionDto;
|
|
|
|
|
+import com.xjrsoft.module.student.entity.BaseMajorCategor;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentAssessmentInspection;
|
|
import com.xjrsoft.module.student.entity.BaseStudentAssessmentInspection;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentAssessmentStudentRelation;
|
|
import com.xjrsoft.module.student.entity.BaseStudentAssessmentStudentRelation;
|
|
|
import com.xjrsoft.module.student.service.IBaseStudentAssessmentInspectionService;
|
|
import com.xjrsoft.module.student.service.IBaseStudentAssessmentInspectionService;
|
|
|
import com.xjrsoft.module.student.service.IBaseStudentAssessmentStudentRelationService;
|
|
import com.xjrsoft.module.student.service.IBaseStudentAssessmentStudentRelationService;
|
|
|
|
|
+import com.xjrsoft.module.student.vo.BaseMajorCategorPageVo;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobilePageVo;
|
|
import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobilePageVo;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobileVo;
|
|
import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobileVo;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionPageVo;
|
|
import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionPageVo;
|
|
@@ -38,6 +43,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
@@ -64,6 +70,7 @@ public class BaseStudentAssessmentInspectionController {
|
|
|
@GetMapping(value = "/page")
|
|
@GetMapping(value = "/page")
|
|
|
@ApiOperation(value = "学生班级巡查考核列表(分页)")
|
|
@ApiOperation(value = "学生班级巡查考核列表(分页)")
|
|
|
@SaCheckPermission("basestudentassessmentinspection:detail")
|
|
@SaCheckPermission("basestudentassessmentinspection:detail")
|
|
|
|
|
+ @XjrLog(value = "学生班级巡查考核列表(分页)", saveRequestData = true)
|
|
|
public RT<PageOutput<BaseStudentAssessmentInspectionPageVo>> page(@Valid BaseStudentAssessmentInspectionPageDto dto) {
|
|
public RT<PageOutput<BaseStudentAssessmentInspectionPageVo>> page(@Valid BaseStudentAssessmentInspectionPageDto dto) {
|
|
|
List<String> roleList = StpUtil.getRoleList();
|
|
List<String> roleList = StpUtil.getRoleList();
|
|
|
if(roleList.size() == 2 && roleList.contains("TEACHER") && roleList.contains("CLASSTE")){
|
|
if(roleList.size() == 2 && roleList.contains("TEACHER") && roleList.contains("CLASSTE")){
|
|
@@ -76,6 +83,7 @@ public class BaseStudentAssessmentInspectionController {
|
|
|
@GetMapping(value = "/info")
|
|
@GetMapping(value = "/info")
|
|
|
@ApiOperation(value = "根据id查询学生班级巡查考核信息")
|
|
@ApiOperation(value = "根据id查询学生班级巡查考核信息")
|
|
|
@SaCheckPermission("basestudentassessmentinspection:detail")
|
|
@SaCheckPermission("basestudentassessmentinspection:detail")
|
|
|
|
|
+ @XjrLog(value = "根据id查询学生班级巡查考核信息")
|
|
|
public RT<BaseStudentAssessmentInspectionVo> info(@RequestParam Long id) {
|
|
public RT<BaseStudentAssessmentInspectionVo> info(@RequestParam Long id) {
|
|
|
BaseStudentAssessmentInspectionVo result = inspectionService.getInfo(id);
|
|
BaseStudentAssessmentInspectionVo result = inspectionService.getInfo(id);
|
|
|
return RT.ok(result);
|
|
return RT.ok(result);
|
|
@@ -84,6 +92,7 @@ public class BaseStudentAssessmentInspectionController {
|
|
|
@GetMapping(value = "/mobile-page")
|
|
@GetMapping(value = "/mobile-page")
|
|
|
@ApiOperation(value = "学生操行分记录管理列表(移动端)")
|
|
@ApiOperation(value = "学生操行分记录管理列表(移动端)")
|
|
|
@SaCheckPermission("basestudentbehaviormanage:detail")
|
|
@SaCheckPermission("basestudentbehaviormanage:detail")
|
|
|
|
|
+ @XjrLog(value = "学生操行分记录管理列表(移动端)")
|
|
|
public RT<PageOutput<BaseStudentAssessmentInspectionMobilePageVo>> mobilePage(@Valid BaseStudentAssessmentInspectionMobilePageDto dto) {
|
|
public RT<PageOutput<BaseStudentAssessmentInspectionMobilePageVo>> mobilePage(@Valid BaseStudentAssessmentInspectionMobilePageDto dto) {
|
|
|
Page<BaseStudentAssessmentInspectionMobilePageVo> page = inspectionService.getMobilePage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
Page<BaseStudentAssessmentInspectionMobilePageVo> page = inspectionService.getMobilePage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
if (page == null) {
|
|
if (page == null) {
|
|
@@ -95,6 +104,7 @@ public class BaseStudentAssessmentInspectionController {
|
|
|
@GetMapping(value = "/mobile-info")
|
|
@GetMapping(value = "/mobile-info")
|
|
|
@ApiOperation(value = "根据id查询学生班级巡查考核信息(移动端)")
|
|
@ApiOperation(value = "根据id查询学生班级巡查考核信息(移动端)")
|
|
|
@SaCheckPermission("basestudentassessmentinspection:detail")
|
|
@SaCheckPermission("basestudentassessmentinspection:detail")
|
|
|
|
|
+ @XjrLog(value = "根据id查询学生班级巡查考核信息(移动端)")
|
|
|
public RT<BaseStudentAssessmentInspectionMobileVo> mobileInfo(@Valid Long id) {
|
|
public RT<BaseStudentAssessmentInspectionMobileVo> mobileInfo(@Valid Long id) {
|
|
|
BaseStudentAssessmentInspectionMobileVo result = inspectionService.getMobileInfo(id);
|
|
BaseStudentAssessmentInspectionMobileVo result = inspectionService.getMobileInfo(id);
|
|
|
return RT.ok(result);
|
|
return RT.ok(result);
|
|
@@ -103,6 +113,7 @@ public class BaseStudentAssessmentInspectionController {
|
|
|
@PostMapping
|
|
@PostMapping
|
|
|
@ApiOperation(value = "新增学生班级巡查考核")
|
|
@ApiOperation(value = "新增学生班级巡查考核")
|
|
|
@SaCheckPermission("basestudentassessmentinspection:add")
|
|
@SaCheckPermission("basestudentassessmentinspection:add")
|
|
|
|
|
+ @XjrLog(value = "新增学生班级巡查考核")
|
|
|
public RT<Boolean> add(@Valid @RequestBody AddBaseStudentAssessmentInspectionDto dto) {
|
|
public RT<Boolean> add(@Valid @RequestBody AddBaseStudentAssessmentInspectionDto dto) {
|
|
|
BaseStudentAssessmentInspection inspection = BeanUtil.toBean(dto, BaseStudentAssessmentInspection.class);
|
|
BaseStudentAssessmentInspection inspection = BeanUtil.toBean(dto, BaseStudentAssessmentInspection.class);
|
|
|
inspection.setCreateDate(new Date());
|
|
inspection.setCreateDate(new Date());
|
|
@@ -116,6 +127,7 @@ public class BaseStudentAssessmentInspectionController {
|
|
|
@PutMapping
|
|
@PutMapping
|
|
|
@ApiOperation(value = "修改学生班级巡查考核")
|
|
@ApiOperation(value = "修改学生班级巡查考核")
|
|
|
@SaCheckPermission("basestudentassessmentinspection:edit")
|
|
@SaCheckPermission("basestudentassessmentinspection:edit")
|
|
|
|
|
+ @XjrLog(value = "修改学生班级巡查考核")
|
|
|
public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentAssessmentInspectionDto dto) {
|
|
public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentAssessmentInspectionDto dto) {
|
|
|
|
|
|
|
|
BaseStudentAssessmentInspection baseStudentAssessmentInspection = BeanUtil.toBean(dto, BaseStudentAssessmentInspection.class);
|
|
BaseStudentAssessmentInspection baseStudentAssessmentInspection = BeanUtil.toBean(dto, BaseStudentAssessmentInspection.class);
|
|
@@ -126,6 +138,7 @@ public class BaseStudentAssessmentInspectionController {
|
|
|
@DeleteMapping
|
|
@DeleteMapping
|
|
|
@ApiOperation(value = "删除学生班级巡查考核")
|
|
@ApiOperation(value = "删除学生班级巡查考核")
|
|
|
@SaCheckPermission("basestudentassessmentinspection:delete")
|
|
@SaCheckPermission("basestudentassessmentinspection:delete")
|
|
|
|
|
+ @XjrLog(value = "删除学生班级巡查考核")
|
|
|
public RT<Boolean> delete(@Valid @RequestBody List<Long> ids) {
|
|
public RT<Boolean> delete(@Valid @RequestBody List<Long> ids) {
|
|
|
return RT.ok(inspectionService.removeBatchByIds(ids));
|
|
return RT.ok(inspectionService.removeBatchByIds(ids));
|
|
|
}
|
|
}
|
|
@@ -133,6 +146,7 @@ public class BaseStudentAssessmentInspectionController {
|
|
|
@GetMapping(value = "/calss-quantitative-assessment-page")
|
|
@GetMapping(value = "/calss-quantitative-assessment-page")
|
|
|
@ApiOperation(value = "班级量化考核列表(分页)")
|
|
@ApiOperation(value = "班级量化考核列表(分页)")
|
|
|
@SaCheckPermission("basestudentassessmentinspection:detail")
|
|
@SaCheckPermission("basestudentassessmentinspection:detail")
|
|
|
|
|
+ @XjrLog(value = "班级量化考核列表(分页)")
|
|
|
public RT<PageOutput<CalssQuantitativeAssessmentPageVo>> calssQuantitativeAssessmentPage(@Valid CalssQuantitativeAssessmentPageDto dto) {
|
|
public RT<PageOutput<CalssQuantitativeAssessmentPageVo>> calssQuantitativeAssessmentPage(@Valid CalssQuantitativeAssessmentPageDto dto) {
|
|
|
IPage<CalssQuantitativeAssessmentPageVo> page = inspectionService.getCalssQuantitativeAssessmentPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
IPage<CalssQuantitativeAssessmentPageVo> page = inspectionService.getCalssQuantitativeAssessmentPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
return RT.ok(ConventPage.getPageOutput(page, CalssQuantitativeAssessmentPageVo.class));
|
|
return RT.ok(ConventPage.getPageOutput(page, CalssQuantitativeAssessmentPageVo.class));
|
|
@@ -143,6 +157,8 @@ public class BaseStudentAssessmentInspectionController {
|
|
|
// public ResponseEntity<byte[]> exportDataQuery(@Valid @RequestBody QuantitativeAssessmentExcelDto dto) {
|
|
// public ResponseEntity<byte[]> exportDataQuery(@Valid @RequestBody QuantitativeAssessmentExcelDto dto) {
|
|
|
@PostMapping("/export-query")
|
|
@PostMapping("/export-query")
|
|
|
@ApiOperation(value = "导出")
|
|
@ApiOperation(value = "导出")
|
|
|
|
|
+ @SaCheckPermission("basestudentassessmentinspection:detail")
|
|
|
|
|
+ @XjrLog(value = "导出")
|
|
|
public ResponseEntity<byte[]> exportDataQuery(@Valid @RequestBody CalssQuantitativeAssessmentPageDto dto) throws IOException {
|
|
public ResponseEntity<byte[]> exportDataQuery(@Valid @RequestBody CalssQuantitativeAssessmentPageDto dto) throws IOException {
|
|
|
byte[] bytes = inspectionService.getExcelByte(dto);
|
|
byte[] bytes = inspectionService.getExcelByte(dto);
|
|
|
String fileName = "recordExport" + ExcelTypeEnum.XLSX.getValue();
|
|
String fileName = "recordExport" + ExcelTypeEnum.XLSX.getValue();
|
|
@@ -152,6 +168,8 @@ public class BaseStudentAssessmentInspectionController {
|
|
|
|
|
|
|
|
@PostMapping("/cancel-student")
|
|
@PostMapping("/cancel-student")
|
|
|
@ApiOperation(value = "作废学生")
|
|
@ApiOperation(value = "作废学生")
|
|
|
|
|
+ @SaCheckPermission("basestudentassessmentinspection:detail")
|
|
|
|
|
+ @XjrLog(value = "作废学生")
|
|
|
public RT<Boolean> cancelStudent(@RequestBody CancelStudentDto dto){
|
|
public RT<Boolean> cancelStudent(@RequestBody CancelStudentDto dto){
|
|
|
BaseStudentAssessmentStudentRelation relation = studentRelationService.getById(dto.getId());
|
|
BaseStudentAssessmentStudentRelation relation = studentRelationService.getById(dto.getId());
|
|
|
relation.setEnabledMark(EnabledMark.DISABLED.getCode());
|
|
relation.setEnabledMark(EnabledMark.DISABLED.getCode());
|
|
@@ -173,4 +191,14 @@ public class BaseStudentAssessmentInspectionController {
|
|
|
inspectionService.updateById(inspection);
|
|
inspectionService.updateById(inspection);
|
|
|
return RT.ok(update);
|
|
return RT.ok(update);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("/import")
|
|
|
|
|
+ @ApiOperation(value = "班级考核导入")
|
|
|
|
|
+ @SaCheckPermission("basestudentassessmentinspection:importData")
|
|
|
|
|
+ @XjrLog(value = "班级考核导入")
|
|
|
|
|
+ public RT<Boolean> importData(@RequestParam MultipartFile file) throws IOException {
|
|
|
|
|
+ List<ImportBaseStudentAssessmentInspectionDto> savedDataList = EasyExcel.read(file.getInputStream()).headRowNumber(3).head(ImportBaseStudentAssessmentInspectionDto.class).sheet().doReadSync();
|
|
|
|
|
+ Boolean result = inspectionService.importData(savedDataList);
|
|
|
|
|
+ return RT.ok(result);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|