|
|
@@ -0,0 +1,97 @@
|
|
|
+package com.xjrsoft.module.student.controller;
|
|
|
+
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+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.student.dto.AddBaseStudentScholarshipReleaseDto;
|
|
|
+import com.xjrsoft.module.student.dto.BaseStudentScholarshipReleasePageDto;
|
|
|
+import com.xjrsoft.module.student.dto.UpdateBaseStudentScholarshipReleaseDto;
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentScholarshipRelease;
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentScholarshipReleaseService;
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentScholarshipReleasePageVo;
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentScholarshipReleaseVo;
|
|
|
+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: 2024-07-25
|
|
|
+* @Version 1.0
|
|
|
+*/
|
|
|
+@RestController
|
|
|
+@RequestMapping("/student" + "/baseStudentScholarshipRelease")
|
|
|
+@Api(value = "/student" + "/baseStudentScholarshipRelease",tags = "奖学金发放记录表代码")
|
|
|
+@AllArgsConstructor
|
|
|
+public class BaseStudentScholarshipReleaseController {
|
|
|
+
|
|
|
+
|
|
|
+ private final IBaseStudentScholarshipReleaseService releaseService;
|
|
|
+
|
|
|
+ @GetMapping(value = "/page")
|
|
|
+ @ApiOperation(value="奖学金发放记录表列表(分页)")
|
|
|
+ @SaCheckPermission("basestudentscholarshiprelease:detail")
|
|
|
+ public RT<PageOutput<BaseStudentScholarshipReleasePageVo>> page(@Valid BaseStudentScholarshipReleasePageDto dto){
|
|
|
+
|
|
|
+ Page<BaseStudentScholarshipReleasePageVo> page = releaseService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
+ PageOutput<BaseStudentScholarshipReleasePageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentScholarshipReleasePageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/info")
|
|
|
+ @ApiOperation(value="根据id查询奖学金发放记录表信息")
|
|
|
+ @SaCheckPermission("basestudentscholarshiprelease:detail")
|
|
|
+ public RT<BaseStudentScholarshipReleaseVo> info(@RequestParam Long id){
|
|
|
+ BaseStudentScholarshipRelease baseStudentScholarshipRelease = releaseService.getById(id);
|
|
|
+ if (baseStudentScholarshipRelease == null) {
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
+ }
|
|
|
+ return RT.ok(BeanUtil.toBean(baseStudentScholarshipRelease, BaseStudentScholarshipReleaseVo.class));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation(value = "新增奖学金发放记录表")
|
|
|
+ @SaCheckPermission("basestudentscholarshiprelease:add")
|
|
|
+ public RT<Boolean> add(@Valid @RequestBody AddBaseStudentScholarshipReleaseDto dto){
|
|
|
+ BaseStudentScholarshipRelease baseStudentScholarshipRelease = BeanUtil.toBean(dto, BaseStudentScholarshipRelease.class);
|
|
|
+ boolean isSuccess = releaseService.save(baseStudentScholarshipRelease);
|
|
|
+ return RT.ok(isSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation(value = "修改奖学金发放记录表")
|
|
|
+ @SaCheckPermission("basestudentscholarshiprelease:edit")
|
|
|
+ public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentScholarshipReleaseDto dto){
|
|
|
+
|
|
|
+ BaseStudentScholarshipRelease baseStudentScholarshipRelease = BeanUtil.toBean(dto, BaseStudentScholarshipRelease.class);
|
|
|
+ return RT.ok(releaseService.updateById(baseStudentScholarshipRelease));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping
|
|
|
+ @ApiOperation(value = "删除奖学金发放记录表")
|
|
|
+ @SaCheckPermission("basestudentscholarshiprelease:delete")
|
|
|
+ public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
+ return RT.ok(releaseService.removeBatchByIds(ids));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|