ソースを参照

奖学金申请名单查询

dzx 1 年間 前
コミット
8c544298ef

+ 28 - 17
src/main/java/com/xjrsoft/module/student/controller/BaseStudentScholarshipApplicantController.java

@@ -1,34 +1,37 @@
 package com.xjrsoft.module.student.controller;
 
+import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
 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.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.PageOutput;
-import com.xjrsoft.common.model.result.RT;
 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.UpdateBaseStudentScholarshipApplicantDto;
-import cn.dev33.satoken.annotation.SaCheckPermission;
-
 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.BaseStudentScholarshipCategory;
 import com.xjrsoft.module.student.service.IBaseStudentScholarshipApplicantService;
 import com.xjrsoft.module.student.vo.BaseStudentScholarshipApplicantPageVo;
-
 import com.xjrsoft.module.student.vo.BaseStudentScholarshipApplicantVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 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.constraints.NotNull;
 import java.util.List;
 
 /**
@@ -50,12 +53,20 @@ public class BaseStudentScholarshipApplicantController {
     @ApiOperation(value="奖学金申请列表(分页)")
     @SaCheckPermission("basestudentscholarshipapplicant:detail")
     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);
         return RT.ok(pageOutput);
     }

+ 22 - 0
src/main/java/com/xjrsoft/module/student/dto/BaseStudentScholarshipApplicantPageDto.java

@@ -1,11 +1,13 @@
 package com.xjrsoft.module.student.dto;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springframework.format.annotation.DateTimeFormat;
 
+import javax.validation.constraints.NotNull;
 import java.time.LocalTime;
 import java.time.LocalDateTime;
 import java.math.BigDecimal;
@@ -22,5 +24,25 @@ import java.util.Date;
 @EqualsAndHashCode(callSuper = false)
 public class BaseStudentScholarshipApplicantPageDto extends PageInput {
 
+    @NotNull(message = "奖学金类别id不能为空!")
+    @ApiModelProperty("奖学金类别id")
+    private Long baseStudentScholarshipCategoryId;
+
+    @ApiModelProperty("发放状态(1:已发放 0:未发放)")
+    private Integer releaseStatus;
+
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+
+    @ApiModelProperty("学生姓名")
+    private String name;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty("发放日期-开始")
+    private String startDate;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty("发放日期-结束")
+    private String endDate;
 
 }

+ 2 - 2
src/main/java/com/xjrsoft/module/student/entity/BaseStudentScholarshipApplicant.java

@@ -91,8 +91,8 @@ public class BaseStudentScholarshipApplicant implements Serializable {
     /**
     * 学期名称
     */
-    @ApiModelProperty("学期名称")
-    private String semesterName;
+    @ApiModelProperty("学期Id")
+    private String baseSemesterId;
     /**
     * 入学名称
     */