Browse Source

/student/consumption/detail-page 消费管理入参班级id
/student/consumption/tree 学生年级班级树

大数据与最优化研究所 1 năm trước cách đây
mục cha
commit
73973b4497

+ 2 - 0
src/main/java/com/xjrsoft/module/base/entity/BaseGrade.java

@@ -50,4 +50,6 @@ public class BaseGrade implements Serializable {
     @ApiModelProperty("年份")
     private String title;
 
+    @ApiModelProperty("在读状态(1:在读 0:毕业)")
+    private Integer status;
 }

+ 56 - 0
src/main/java/com/xjrsoft/module/student/controller/ConsumptionController.java

@@ -8,12 +8,16 @@ 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.common.utils.TreeUtil;
+import com.xjrsoft.module.base.service.IBaseClassService;
+import com.xjrsoft.module.base.service.IBaseGradeService;
 import com.xjrsoft.module.student.dto.BaseStudentInfoPageDto;
 import com.xjrsoft.module.student.dto.PbVXssfdetailExcelDto;
 import com.xjrsoft.module.student.dto.PbVXssfdetailPageDto;
 import com.xjrsoft.module.student.dto.PersonalInfoDto;
 import com.xjrsoft.module.student.service.IPbVXssfdetailService;
 import com.xjrsoft.module.student.service.IStudentManagerService;
+import com.xjrsoft.module.student.vo.BaseStudentTreeVo;
 import com.xjrsoft.module.student.vo.PbVXssfdetailExcelVo;
 import com.xjrsoft.module.student.vo.PbVXssfdetailPageVo;
 import com.xjrsoft.module.student.vo.StudentPersonalInfoVo;
@@ -29,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -44,6 +49,57 @@ import java.util.List;
 public class ConsumptionController {
     private final IStudentManagerService studentManagerService;
     private final IPbVXssfdetailService pbVXssfdetailService;
+    private final IBaseGradeService baseGradeService;
+    private final IBaseClassService baseClassService;
+
+    @GetMapping(value = "/tree")
+    @ApiOperation(value = "学生在读毕业年级班级树")
+    @SaCheckPermission("studentmanager:detail")
+    public RT<List<BaseStudentTreeVo>> tree() {
+        List<BaseStudentTreeVo> voList = new ArrayList<>();
+
+        voList.add(new BaseStudentTreeVo(){{
+            setId(6L);
+            setName("在读年级");
+        }});
+
+        voList.add(new BaseStudentTreeVo(){{
+            setId(8L);
+            setName("毕业年级");
+        }});
+
+
+
+        baseGradeService.list().forEach((node) -> {
+            if(node.getStatus() == 1){
+                voList.add(new BaseStudentTreeVo(){{
+                    setId(node.getId());
+                    setName(node.getName());
+                    setParentId(6L);
+                }});
+            }
+            if(node.getStatus() == 0){
+                voList.add(new BaseStudentTreeVo(){{
+                    setId(node.getId());
+                    setName(node.getName());
+                    setParentId(8L);
+                }});
+            }
+        });
+
+        baseClassService.list().forEach((node)->{
+            voList.add(new BaseStudentTreeVo(){{
+                setId(node.getId());
+                setName(node.getName());
+                setParentId(node.getGradeId());
+            }});
+        });
+
+        List<BaseStudentTreeVo> treeVoList = TreeUtil.build(voList);
+
+        return RT.ok(treeVoList);
+    }
+
     @GetMapping(value = "/personal-info")
     @ApiOperation(value="学生个人信息")
     @SaCheckPermission("consumption:detail")

+ 8 - 0
src/main/java/com/xjrsoft/module/student/dto/PbVXssfdetailPageDto.java

@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.List;
+
 
 /**
 * @title: 分页查询入参
@@ -39,4 +41,10 @@ public class PbVXssfdetailPageDto extends PageInput {
 
     @ApiModelProperty("缴费类型(-1:退费 1:缴费)")
     private Integer category;
+
+    @ApiModelProperty("班级Id")
+    private String classIds;
+
+    @ApiModelProperty("班级Id")
+    private List<String> classIdList;
 }

+ 7 - 0
src/main/java/com/xjrsoft/module/student/service/impl/PbVXssfdetailServiceImpl.java

@@ -12,6 +12,7 @@ import com.xjrsoft.module.student.vo.PbVXssfdetailPageVo;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -28,6 +29,12 @@ public class PbVXssfdetailServiceImpl extends MPJBaseServiceImpl<PbVXssfdetailMa
 
     @Override
     public Page<PbVXssfdetailPageVo> getPage(Page<PbVXssfdetailPageVo> page, PbVXssfdetailPageDto dto) {
+        if(dto.getClassIds() != null && !dto.getClassIds().equals("")){
+            String[] strArray = dto.getClassIds().split(",");
+            List<String> strList = Arrays.asList(strArray);
+            dto.setClassIdList(strList);
+        }
+
         Page<PbVXssfdetailPageVo> voPage = pbVXssfdetailMapper.getPage(page, dto);
         for (PbVXssfdetailPageVo record : voPage.getRecords()) {
             if(record.getMny() > 0){

+ 7 - 0
src/main/resources/mapper/student/PbVXssfdetailMapper.xml

@@ -10,6 +10,7 @@
         LEFT JOIN xjr_dictionary_detail t4 ON t1.gender = t4.code AND t4.item_id = 2023000000000000004
         LEFT JOIN pb_semester_config t5 ON t3.beltcode = t5.beltcode AND t5.delete_mark = 0
         LEFT JOIN base_semester t6 ON t6.id = t5.base_semester_id
+        LEFT JOIN base_student_school_roll t7 ON t7.user_id = t1.id
         WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
         <if test="dto.name != null and dto.name != ''">
             and t1.name like concat('%', #{dto.name},'%')
@@ -37,6 +38,12 @@
                 and 0 > t3.mny
             </if>
         </if>
+        <if test="dto.classIdList != null and !dto.classIdList.isEmpty()">
+            and t7.class_id in
+            <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")" separator=",">
+                #{classId}
+            </foreach>
+        </if>
     </select>
     <select id="getList" parameterType="com.xjrsoft.module.student.dto.PbVXssfdetailExcelDto" resultType="com.xjrsoft.module.student.vo.PbVXssfdetailExcelVo">
         SELECT t2.user_id,t2.student_id,t1.name,t4.name AS gender_cn,t6.name AS semester_name,t3.feeitemname,t3.paytype,t3.paydate,t3.payorder,t3.mny FROM xjr_user t1