|
@@ -4,6 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
+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.github.yulichang.toolkit.MPJWrappers;
|
|
import com.github.yulichang.toolkit.MPJWrappers;
|
|
@@ -19,10 +20,10 @@ import com.xjrsoft.module.student.dto.UpdateBaseStudentScholarshipApplicantDto;
|
|
import com.xjrsoft.module.student.entity.BaseStudentScholarshipApplicant;
|
|
import com.xjrsoft.module.student.entity.BaseStudentScholarshipApplicant;
|
|
import com.xjrsoft.module.student.entity.BaseStudentScholarshipCategory;
|
|
import com.xjrsoft.module.student.entity.BaseStudentScholarshipCategory;
|
|
import com.xjrsoft.module.student.service.IBaseStudentScholarshipApplicantService;
|
|
import com.xjrsoft.module.student.service.IBaseStudentScholarshipApplicantService;
|
|
-import com.xjrsoft.module.student.service.IBaseStudentScholarshipCategoryService;
|
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentScholarshipApplicantCategoryPageVo;
|
|
import com.xjrsoft.module.student.vo.BaseStudentScholarshipApplicantCategoryPageVo;
|
|
import com.xjrsoft.module.student.vo.BaseStudentScholarshipApplicantPageVo;
|
|
import com.xjrsoft.module.student.vo.BaseStudentScholarshipApplicantPageVo;
|
|
import com.xjrsoft.module.student.vo.BaseStudentScholarshipApplicantVo;
|
|
import com.xjrsoft.module.student.vo.BaseStudentScholarshipApplicantVo;
|
|
|
|
+import com.xjrsoft.module.student.vo.ScholarshipApplicantOptionVo;
|
|
import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -52,14 +53,13 @@ import java.util.List;
|
|
public class BaseStudentScholarshipApplicantController {
|
|
public class BaseStudentScholarshipApplicantController {
|
|
|
|
|
|
|
|
|
|
- private final IBaseStudentScholarshipApplicantService baseStudentScholarshipApplicantService;
|
|
|
|
- private final IBaseStudentScholarshipCategoryService baseStudentScholarshipCategoryService;
|
|
|
|
|
|
+ private final IBaseStudentScholarshipApplicantService applicantService;
|
|
|
|
|
|
@GetMapping(value = "/page")
|
|
@GetMapping(value = "/page")
|
|
@ApiOperation(value="奖学金申请列表(分页)")
|
|
@ApiOperation(value="奖学金申请列表(分页)")
|
|
@SaCheckPermission("basestudentscholarshipapplicant:detail")
|
|
@SaCheckPermission("basestudentscholarshipapplicant:detail")
|
|
public RT<PageOutput<BaseStudentScholarshipApplicantPageVo>> page(@Valid BaseStudentScholarshipApplicantPageDto dto){
|
|
public RT<PageOutput<BaseStudentScholarshipApplicantPageVo>> page(@Valid BaseStudentScholarshipApplicantPageDto dto){
|
|
- IPage<BaseStudentScholarshipApplicantPageVo> page = baseStudentScholarshipApplicantService.selectJoinListPage(ConventPage.getPage(dto), BaseStudentScholarshipApplicantPageVo.class,
|
|
|
|
|
|
+ IPage<BaseStudentScholarshipApplicantPageVo> page = applicantService.selectJoinListPage(ConventPage.getPage(dto), BaseStudentScholarshipApplicantPageVo.class,
|
|
MPJWrappers.<BaseStudentScholarshipApplicant>lambdaJoin()
|
|
MPJWrappers.<BaseStudentScholarshipApplicant>lambdaJoin()
|
|
.like(StrUtil.isNotEmpty(dto.getName()), BaseStudentScholarshipApplicant::getName, dto.getName())
|
|
.like(StrUtil.isNotEmpty(dto.getName()), BaseStudentScholarshipApplicant::getName, dto.getName())
|
|
.eq(ObjectUtil.isNotNull(dto.getSemesterId()), BaseStudentScholarshipCategory::getBaseSemesterId, dto.getSemesterId())
|
|
.eq(ObjectUtil.isNotNull(dto.getSemesterId()), BaseStudentScholarshipCategory::getBaseSemesterId, dto.getSemesterId())
|
|
@@ -69,12 +69,14 @@ public class BaseStudentScholarshipApplicantController {
|
|
.eq(BaseStudentScholarshipApplicant::getBaseStudentScholarshipCategoryId,dto.getBaseStudentScholarshipCategoryId())
|
|
.eq(BaseStudentScholarshipApplicant::getBaseStudentScholarshipCategoryId,dto.getBaseStudentScholarshipCategoryId())
|
|
.orderByAsc(BaseStudentScholarshipApplicant::getSortCode)
|
|
.orderByAsc(BaseStudentScholarshipApplicant::getSortCode)
|
|
.selectAs(BaseStudentScholarshipApplicant::getId, BaseStudentScholarshipApplicantPageVo::getId)
|
|
.selectAs(BaseStudentScholarshipApplicant::getId, BaseStudentScholarshipApplicantPageVo::getId)
|
|
- .selectAs(DictionaryDetail::getName, BaseStudentScholarshipApplicantPageVo::getBankTypeCn)
|
|
|
|
|
|
+ .select(" t4.name as bank_type_cn")
|
|
.selectAs(BaseSemester::getName, BaseStudentScholarshipApplicantPageVo::getSemesterName)
|
|
.selectAs(BaseSemester::getName, BaseStudentScholarshipApplicantPageVo::getSemesterName)
|
|
|
|
+ .select(" t5.name as category_cn")
|
|
.select(BaseStudentScholarshipApplicant.class,x -> VoToColumnUtil.fieldsToColumns(BaseStudentScholarshipApplicantPageVo.class).contains(x.getProperty()))
|
|
.select(BaseStudentScholarshipApplicant.class,x -> VoToColumnUtil.fieldsToColumns(BaseStudentScholarshipApplicantPageVo.class).contains(x.getProperty()))
|
|
.innerJoin(BaseStudentScholarshipCategory.class, BaseStudentScholarshipCategory::getId, BaseStudentScholarshipApplicant::getBaseStudentScholarshipCategoryId)
|
|
.innerJoin(BaseStudentScholarshipCategory.class, BaseStudentScholarshipCategory::getId, BaseStudentScholarshipApplicant::getBaseStudentScholarshipCategoryId)
|
|
.leftJoin(BaseSemester.class, BaseSemester::getId, BaseStudentScholarshipApplicant::getBaseSemesterId)
|
|
.leftJoin(BaseSemester.class, BaseSemester::getId, BaseStudentScholarshipApplicant::getBaseSemesterId)
|
|
.leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, BaseStudentScholarshipApplicant::getBankType)
|
|
.leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, BaseStudentScholarshipApplicant::getBankType)
|
|
|
|
+ .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, BaseStudentScholarshipCategory::getCategory)
|
|
);
|
|
);
|
|
PageOutput<BaseStudentScholarshipApplicantPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentScholarshipApplicantPageVo.class);
|
|
PageOutput<BaseStudentScholarshipApplicantPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentScholarshipApplicantPageVo.class);
|
|
return RT.ok(pageOutput);
|
|
return RT.ok(pageOutput);
|
|
@@ -84,7 +86,7 @@ public class BaseStudentScholarshipApplicantController {
|
|
@ApiOperation(value="奖学金名称表(分页)")
|
|
@ApiOperation(value="奖学金名称表(分页)")
|
|
@SaCheckPermission("basestudentscholarshipapplicant:detail")
|
|
@SaCheckPermission("basestudentscholarshipapplicant:detail")
|
|
public RT<PageOutput<BaseStudentScholarshipApplicantCategoryPageVo>> scholarshiPage(@Valid BaseStudentScholarshipApplicantCategoryPageDto dto){
|
|
public RT<PageOutput<BaseStudentScholarshipApplicantCategoryPageVo>> scholarshiPage(@Valid BaseStudentScholarshipApplicantCategoryPageDto dto){
|
|
- IPage<BaseStudentScholarshipApplicantCategoryPageVo> page = baseStudentScholarshipApplicantService.getScholarshiPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
|
|
|
+ IPage<BaseStudentScholarshipApplicantCategoryPageVo> page = applicantService.getScholarshiPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
PageOutput<BaseStudentScholarshipApplicantCategoryPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentScholarshipApplicantCategoryPageVo.class);
|
|
PageOutput<BaseStudentScholarshipApplicantCategoryPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentScholarshipApplicantCategoryPageVo.class);
|
|
return RT.ok(pageOutput);
|
|
return RT.ok(pageOutput);
|
|
}
|
|
}
|
|
@@ -93,7 +95,7 @@ public class BaseStudentScholarshipApplicantController {
|
|
@ApiOperation(value="根据id查询奖学金申请信息")
|
|
@ApiOperation(value="根据id查询奖学金申请信息")
|
|
@SaCheckPermission("basestudentscholarshipapplicant:detail")
|
|
@SaCheckPermission("basestudentscholarshipapplicant:detail")
|
|
public RT<BaseStudentScholarshipApplicantVo> info(@RequestParam Long id){
|
|
public RT<BaseStudentScholarshipApplicantVo> info(@RequestParam Long id){
|
|
- BaseStudentScholarshipApplicant baseStudentScholarshipApplicant = baseStudentScholarshipApplicantService.getById(id);
|
|
|
|
|
|
+ BaseStudentScholarshipApplicant baseStudentScholarshipApplicant = applicantService.getById(id);
|
|
if (baseStudentScholarshipApplicant == null) {
|
|
if (baseStudentScholarshipApplicant == null) {
|
|
return RT.error("找不到此数据!");
|
|
return RT.error("找不到此数据!");
|
|
}
|
|
}
|
|
@@ -106,8 +108,8 @@ public class BaseStudentScholarshipApplicantController {
|
|
@SaCheckPermission("basestudentscholarshipapplicant:add")
|
|
@SaCheckPermission("basestudentscholarshipapplicant:add")
|
|
public RT<Boolean> add(@Valid @RequestBody AddBaseStudentScholarshipApplicantDto dto){
|
|
public RT<Boolean> add(@Valid @RequestBody AddBaseStudentScholarshipApplicantDto dto){
|
|
BaseStudentScholarshipApplicant baseStudentScholarshipApplicant = BeanUtil.toBean(dto, BaseStudentScholarshipApplicant.class);
|
|
BaseStudentScholarshipApplicant baseStudentScholarshipApplicant = BeanUtil.toBean(dto, BaseStudentScholarshipApplicant.class);
|
|
- boolean isSuccess = baseStudentScholarshipApplicantService.save(baseStudentScholarshipApplicant);
|
|
|
|
- return RT.ok(isSuccess);
|
|
|
|
|
|
+ boolean isSuccess = applicantService.save(baseStudentScholarshipApplicant);
|
|
|
|
+ return RT.ok(isSuccess);
|
|
}
|
|
}
|
|
|
|
|
|
@PutMapping
|
|
@PutMapping
|
|
@@ -116,16 +118,31 @@ public class BaseStudentScholarshipApplicantController {
|
|
public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentScholarshipApplicantDto dto){
|
|
public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentScholarshipApplicantDto dto){
|
|
|
|
|
|
BaseStudentScholarshipApplicant baseStudentScholarshipApplicant = BeanUtil.toBean(dto, BaseStudentScholarshipApplicant.class);
|
|
BaseStudentScholarshipApplicant baseStudentScholarshipApplicant = BeanUtil.toBean(dto, BaseStudentScholarshipApplicant.class);
|
|
- return RT.ok(baseStudentScholarshipApplicantService.updateById(baseStudentScholarshipApplicant));
|
|
|
|
-
|
|
|
|
|
|
+ return RT.ok(applicantService.updateById(baseStudentScholarshipApplicant));
|
|
}
|
|
}
|
|
|
|
|
|
@DeleteMapping
|
|
@DeleteMapping
|
|
@ApiOperation(value = "删除奖学金申请")
|
|
@ApiOperation(value = "删除奖学金申请")
|
|
@SaCheckPermission("basestudentscholarshipapplicant:delete")
|
|
@SaCheckPermission("basestudentscholarshipapplicant:delete")
|
|
public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
- return RT.ok(baseStudentScholarshipApplicantService.removeBatchByIds(ids));
|
|
|
|
|
|
+ return RT.ok(applicantService.removeBatchByIds(ids));
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ @GetMapping(value = "/option-select")
|
|
|
|
+ @ApiOperation(value="申请人下拉列表")
|
|
|
|
+ @SaCheckPermission("basestudentscholarshipapplicant:detail")
|
|
|
|
+ public RT<List<ScholarshipApplicantOptionVo>> optionSelect(@Valid BaseStudentScholarshipApplicantPageDto dto){
|
|
|
|
+ List<BaseStudentScholarshipApplicant> applicantList = applicantService.list(
|
|
|
|
+ new QueryWrapper<BaseStudentScholarshipApplicant>().lambda()
|
|
|
|
+ .select(BaseStudentScholarshipApplicant::getId)
|
|
|
|
+ .select(BaseStudentScholarshipApplicant.class,x -> VoToColumnUtil.fieldsToColumns(BaseStudentScholarshipApplicantPageVo.class).contains(x.getProperty()))
|
|
|
|
+ .eq(ObjectUtil.isNotNull(dto.getBaseStudentScholarshipCategoryId()),BaseStudentScholarshipApplicant::getBaseStudentScholarshipCategoryId, dto.getBaseStudentScholarshipCategoryId())
|
|
|
|
+ .eq(ObjectUtil.isNotNull(dto.getSemesterId()), BaseStudentScholarshipApplicant::getBaseSemesterId, dto.getSemesterId())
|
|
|
|
+ .eq(BaseStudentScholarshipApplicant::getStatus, 1)
|
|
|
|
+ .eq(BaseStudentScholarshipApplicant::getReviewStatus, 0)
|
|
|
|
+ );
|
|
|
|
+ List<ScholarshipApplicantOptionVo> voList = BeanUtil.copyToList(applicantList, ScholarshipApplicantOptionVo.class);
|
|
|
|
+ return RT.ok(voList);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|