|
@@ -1,34 +1,37 @@
|
|
package com.xjrsoft.module.student.controller;
|
|
package com.xjrsoft.module.student.controller;
|
|
|
|
|
|
|
|
+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.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
-import com.xjrsoft.common.constant.GlobalConstant;
|
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
|
|
|
|
+import com.github.yulichang.toolkit.MPJWrappers;
|
|
|
|
+import com.xjrsoft.common.model.result.RT;
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
-import com.xjrsoft.common.model.result.RT;
|
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
|
+import com.xjrsoft.module.base.entity.BaseSemester;
|
|
import com.xjrsoft.module.student.dto.AddBaseStudentScholarshipApplicantDto;
|
|
import com.xjrsoft.module.student.dto.AddBaseStudentScholarshipApplicantDto;
|
|
-import com.xjrsoft.module.student.dto.UpdateBaseStudentScholarshipApplicantDto;
|
|
|
|
-import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
|
-
|
|
|
|
import com.xjrsoft.module.student.dto.BaseStudentScholarshipApplicantPageDto;
|
|
import com.xjrsoft.module.student.dto.BaseStudentScholarshipApplicantPageDto;
|
|
|
|
+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.service.IBaseStudentScholarshipApplicantService;
|
|
import com.xjrsoft.module.student.service.IBaseStudentScholarshipApplicantService;
|
|
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 io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+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 javax.validation.Valid;
|
|
-import javax.validation.constraints.NotNull;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -50,12 +53,20 @@ public class BaseStudentScholarshipApplicantController {
|
|
@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){
|
|
-
|
|
|
|
- LambdaQueryWrapper<BaseStudentScholarshipApplicant> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
- queryWrapper
|
|
|
|
- .orderByDesc(BaseStudentScholarshipApplicant::getId)
|
|
|
|
- .select(BaseStudentScholarshipApplicant.class,x -> VoToColumnUtil.fieldsToColumns(BaseStudentScholarshipApplicantPageVo.class).contains(x.getProperty()));
|
|
|
|
- IPage<BaseStudentScholarshipApplicant> page = baseStudentScholarshipApplicantService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
|
|
|
+ IPage<BaseStudentScholarshipApplicantPageVo> page = baseStudentScholarshipApplicantService.selectJoinListPage(ConventPage.getPage(dto), BaseStudentScholarshipApplicantPageVo.class,
|
|
|
|
+ MPJWrappers.<BaseStudentScholarshipApplicant>lambdaJoin()
|
|
|
|
+ .like(StrUtil.isNotEmpty(dto.getName()), BaseStudentScholarshipApplicant::getName, dto.getName())
|
|
|
|
+ .eq(ObjectUtil.isNotNull(dto.getSemesterId()), BaseStudentScholarshipCategory::getBaseSemesterId, dto.getSemesterId())
|
|
|
|
+ .eq(ObjectUtil.isNotNull(dto.getReleaseStatus()), BaseStudentScholarshipApplicant::getReleaseStatus, dto.getReleaseStatus())
|
|
|
|
+ .eq(BaseStudentScholarshipApplicant::getStatus, 1)
|
|
|
|
+ .between(ObjectUtil.isNotNull(dto.getStartDate()) && ObjectUtil.isNotNull(dto.getEndDate()), BaseStudentScholarshipApplicant::getAwardDate,dto.getStartDate(),dto.getEndDate())
|
|
|
|
+ .eq(BaseStudentScholarshipApplicant::getBaseStudentScholarshipCategoryId,dto.getBaseStudentScholarshipCategoryId())
|
|
|
|
+ .orderByAsc(BaseStudentScholarshipApplicant::getSortCode)
|
|
|
|
+ .selectAs(BaseSemester::getName, BaseStudentScholarshipApplicantPageVo::getSemesterName)
|
|
|
|
+ .select(BaseStudentScholarshipApplicant.class,x -> VoToColumnUtil.fieldsToColumns(BaseStudentScholarshipApplicantPageVo.class).contains(x.getProperty()))
|
|
|
|
+ .innerJoin(BaseStudentScholarshipCategory.class, BaseStudentScholarshipCategory::getId, BaseStudentScholarshipApplicant::getBaseStudentScholarshipCategoryId)
|
|
|
|
+ .leftJoin(BaseSemester.class, BaseSemester::getId, BaseStudentScholarshipApplicant::getBaseSemesterId)
|
|
|
|
+ );
|
|
PageOutput<BaseStudentScholarshipApplicantPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentScholarshipApplicantPageVo.class);
|
|
PageOutput<BaseStudentScholarshipApplicantPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentScholarshipApplicantPageVo.class);
|
|
return RT.ok(pageOutput);
|
|
return RT.ok(pageOutput);
|
|
}
|
|
}
|