|
@@ -5,6 +5,7 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.yulichang.toolkit.MPJWrappers;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
@@ -12,10 +13,12 @@ import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.student.dto.AddBaseStudentScholarshipCategoryDto;
|
|
|
import com.xjrsoft.module.student.dto.BaseStudentScholarshipCategoryPageDto;
|
|
|
+import com.xjrsoft.module.student.dto.BaseStudentScholarshipReleasePageDto;
|
|
|
import com.xjrsoft.module.student.dto.UpdateBaseStudentScholarshipCategoryDto;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentScholarshipCategory;
|
|
|
import com.xjrsoft.module.student.service.IBaseStudentScholarshipCategoryService;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentScholarshipCategoryPageVo;
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentScholarshipCategoryStatisticPageVo;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentScholarshipCategoryVo;
|
|
|
import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -46,13 +49,13 @@ import java.util.List;
|
|
|
public class BaseStudentScholarshipCategoryController {
|
|
|
|
|
|
|
|
|
- private final IBaseStudentScholarshipCategoryService baseStudentScholarshipCategoryService;
|
|
|
+ private final IBaseStudentScholarshipCategoryService categoryService;
|
|
|
|
|
|
@GetMapping(value = "/page")
|
|
|
@ApiOperation(value="奖学金类别列表(分页)")
|
|
|
@SaCheckPermission("basestudentscholarshipcategory:detail")
|
|
|
public RT<PageOutput<BaseStudentScholarshipCategoryPageVo>> page(@Valid BaseStudentScholarshipCategoryPageDto dto){
|
|
|
- IPage<BaseStudentScholarshipCategoryPageVo> page = baseStudentScholarshipCategoryService.selectJoinListPage(ConventPage.getPage(dto), BaseStudentScholarshipCategoryPageVo.class,
|
|
|
+ IPage<BaseStudentScholarshipCategoryPageVo> page = categoryService.selectJoinListPage(ConventPage.getPage(dto), BaseStudentScholarshipCategoryPageVo.class,
|
|
|
MPJWrappers.<BaseStudentScholarshipCategory>lambdaJoin().disableSubLogicDel()
|
|
|
.like(StrUtil.isNotEmpty(dto.getScholarshipName()), BaseStudentScholarshipCategory::getName, dto.getScholarshipName())
|
|
|
.like(StrUtil.isNotEmpty(dto.getScholarshipSource()), DictionaryDetail::getName, dto.getScholarshipSource())
|
|
@@ -73,7 +76,7 @@ public class BaseStudentScholarshipCategoryController {
|
|
|
@ApiOperation(value="根据id查询奖学金类别信息")
|
|
|
@SaCheckPermission("basestudentscholarshipcategory:detail")
|
|
|
public RT<BaseStudentScholarshipCategoryVo> info(@RequestParam Long id){
|
|
|
- BaseStudentScholarshipCategory baseStudentScholarshipCategory = baseStudentScholarshipCategoryService.getByIdDeep(id);
|
|
|
+ BaseStudentScholarshipCategory baseStudentScholarshipCategory = categoryService.getByIdDeep(id);
|
|
|
if (baseStudentScholarshipCategory == null) {
|
|
|
return RT.error("找不到此数据!");
|
|
|
}
|
|
@@ -86,7 +89,7 @@ public class BaseStudentScholarshipCategoryController {
|
|
|
@SaCheckPermission("basestudentscholarshipcategory:add")
|
|
|
public RT<Boolean> add(@Valid @RequestBody AddBaseStudentScholarshipCategoryDto dto){
|
|
|
BaseStudentScholarshipCategory baseStudentScholarshipCategory = BeanUtil.toBean(dto, BaseStudentScholarshipCategory.class);
|
|
|
- boolean isSuccess = baseStudentScholarshipCategoryService.add(baseStudentScholarshipCategory);
|
|
|
+ boolean isSuccess = categoryService.add(baseStudentScholarshipCategory);
|
|
|
return RT.ok(isSuccess);
|
|
|
}
|
|
|
|
|
@@ -96,7 +99,7 @@ public class BaseStudentScholarshipCategoryController {
|
|
|
public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentScholarshipCategoryDto dto){
|
|
|
|
|
|
BaseStudentScholarshipCategory baseStudentScholarshipCategory = BeanUtil.toBean(dto, BaseStudentScholarshipCategory.class);
|
|
|
- return RT.ok(baseStudentScholarshipCategoryService.update(baseStudentScholarshipCategory));
|
|
|
+ return RT.ok(categoryService.update(baseStudentScholarshipCategory));
|
|
|
|
|
|
}
|
|
|
|
|
@@ -104,8 +107,18 @@ public class BaseStudentScholarshipCategoryController {
|
|
|
@ApiOperation(value = "删除奖学金类别")
|
|
|
@SaCheckPermission("basestudentscholarshipcategory:delete")
|
|
|
public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
- return RT.ok(baseStudentScholarshipCategoryService.delete(ids));
|
|
|
+ return RT.ok(categoryService.delete(ids));
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @GetMapping(value = "/statistics-page")
|
|
|
+ @ApiOperation(value="奖学金统计(分页)")
|
|
|
+ @SaCheckPermission("basestudentscholarshipcategory:detail")
|
|
|
+ public RT<PageOutput<BaseStudentScholarshipCategoryStatisticPageVo>> statisticsPage(@Valid BaseStudentScholarshipReleasePageDto dto){
|
|
|
+ Page<BaseStudentScholarshipCategoryStatisticPageVo> page = categoryService.getStatisticsPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
+
|
|
|
+ PageOutput<BaseStudentScholarshipCategoryStatisticPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentScholarshipCategoryStatisticPageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
}
|