|
|
@@ -1,25 +1,16 @@
|
|
|
package com.xjrsoft.module.student.controller;
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
-import cn.hutool.core.bean.BeanUtil;
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
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.BaseStudentInfoPageDto;
|
|
|
-import com.xjrsoft.module.student.dto.UpdateBaseStudentInfoDto;
|
|
|
-import com.xjrsoft.module.student.service.impl.IBaseStudentSchoolRollService;
|
|
|
-import com.xjrsoft.module.student.vo.BaseStudentInfoDetailVo;
|
|
|
-import com.xjrsoft.module.student.vo.BaseStudentInfoPageDataVo;
|
|
|
-import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
|
|
|
+import com.xjrsoft.module.student.service.IStudentManagerService;
|
|
|
+import com.xjrsoft.module.student.vo.StudentPersonalInfoVo;
|
|
|
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.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;
|
|
|
@@ -35,44 +26,13 @@ import javax.validation.Valid;
|
|
|
@Api(value = "/student" + "/consumption",tags = "学生消费管理")
|
|
|
@AllArgsConstructor
|
|
|
public class ConsumptionController {
|
|
|
-
|
|
|
-
|
|
|
- private final IBaseStudentSchoolRollService baseStudentSchoolRollService;
|
|
|
-
|
|
|
- @GetMapping(value = "/mobile-page")
|
|
|
- @ApiOperation(value="学生列表(分页)")
|
|
|
- @SaCheckPermission("basestudentpost:detail")
|
|
|
- public RT<PageOutput<BaseStudentInfoPageVo>> mobilePage(@Valid BaseStudentInfoPageDto dto){
|
|
|
- Page<BaseStudentInfoPageVo> mobilePage = baseStudentSchoolRollService.getMobilePage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
- PageOutput<BaseStudentInfoPageVo> pageOutput = ConventPage.getPageOutput(mobilePage, BaseStudentInfoPageVo.class);
|
|
|
- return RT.ok(pageOutput);
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping(value = "/mobile-page-statistics")
|
|
|
- @ApiOperation(value="学生列表人数统计")
|
|
|
- @SaCheckPermission("basestudentpost:detail")
|
|
|
- public RT<BaseStudentInfoPageDataVo> mobilePageStatistics(@Valid BaseStudentInfoPageDto dto){
|
|
|
- BaseStudentInfoPageDataVo result = baseStudentSchoolRollService.getMobilePageStatistics(dto);
|
|
|
- return RT.ok(result);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @PutMapping
|
|
|
- @ApiOperation(value = "修改学生信息")
|
|
|
- @SaCheckPermission("basestudentpost:edit")
|
|
|
- public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentInfoDto dto){
|
|
|
- return RT.ok(baseStudentSchoolRollService.updateInfo(dto));
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping(value = "/info")
|
|
|
- @ApiOperation(value="根据id查询详情信息")
|
|
|
- @SaCheckPermission("room:detail")
|
|
|
- public RT<BaseStudentInfoDetailVo> info(@RequestParam Long id){
|
|
|
- BaseStudentInfoDetailVo detailVo = baseStudentSchoolRollService.getInfoById(id);
|
|
|
- if (detailVo == null) {
|
|
|
- return RT.error("找不到此数据!");
|
|
|
- }
|
|
|
- return RT.ok(BeanUtil.toBean(detailVo, BaseStudentInfoDetailVo.class));
|
|
|
+ private final IStudentManagerService studentManagerService;
|
|
|
+ @GetMapping(value = "/personal-info")
|
|
|
+ @ApiOperation(value="学生个人信息")
|
|
|
+ @SaCheckPermission("consumption:detail")
|
|
|
+ public RT<StudentPersonalInfoVo> personalInfo(@Valid BaseStudentInfoPageDto dto){
|
|
|
+ StudentPersonalInfoVo info = studentManagerService.getPersonalInfo(StpUtil.getLoginIdAsLong());
|
|
|
+ return RT.ok(info);
|
|
|
}
|
|
|
|
|
|
|