Parcourir la source

1、收费统计:就读方式的统计
2、收费统计:班级欠费排序

dzx il y a 9 mois
Parent
commit
075c978e23

+ 29 - 1
src/main/java/com/xjrsoft/module/student/controller/ConsumptionController.java

@@ -24,7 +24,9 @@ import com.xjrsoft.module.student.service.IPbVXssfdetailService;
 import com.xjrsoft.module.student.service.IPbVXsxxsfytbService;
 import com.xjrsoft.module.student.vo.BaseClassQfCountVo;
 import com.xjrsoft.module.student.vo.BaseClassTreeVo;
+import com.xjrsoft.module.student.vo.ClassQfPageVo;
 import com.xjrsoft.module.student.vo.FeeDetailListVo;
+import com.xjrsoft.module.student.vo.PbStduyStatusVo;
 import com.xjrsoft.module.student.vo.PbStudentCategoryVo;
 import com.xjrsoft.module.student.vo.PbVXssfdetailPageVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbExcelVo;
@@ -162,9 +164,35 @@ public class ConsumptionController {
     }
 
     @GetMapping(value = "/student-category-stat")
-    @ApiOperation(value="学生缴费的详情")
+    @ApiOperation(value="学生类别的人数统计")
     @SaCheckPermission("consumption:detail")
     public RT<PbStudentCategoryVo> studentCategory(@Valid PbVXsxxsfytbStatDto dto){
         return RT.ok(pbVXsxxsfytbService.studentCategoryStat(dto));
     }
+
+    @GetMapping(value = "/stduy-status-stat")
+    @ApiOperation(value="就读方式的统计")
+    @SaCheckPermission("consumption:detail")
+    public RT<PbStduyStatusVo> stduyStatus(@Valid PbVXsxxsfytbStatDto dto){
+        return RT.ok(pbVXsxxsfytbService.stduyStatusStat(dto));
+    }
+
+
+    @GetMapping(value = "/class-qf-page")
+    @ApiOperation(value="班级欠费排序")
+    @SaCheckPermission("consumption:detail")
+    public RT<PageOutput<ClassQfPageVo>> classQfPage(@Valid PbVXsxxsfytbStatDto dto){
+        Page<ClassQfPageVo> classQfPage = pbVXsxxsfytbService.getClassQfPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<ClassQfPageVo> pageOutput = ConventPage.getPageOutput(classQfPage, ClassQfPageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/class-qf-expert")
+    @ApiOperation(value="班级欠费排序-导出")
+    @SaCheckPermission("consumption:detail")
+    public RT<PageOutput<ClassQfPageVo>> classQfExpert(@Valid PbVXsxxsfytbStatDto dto){
+        Page<ClassQfPageVo> classQfPage = pbVXsxxsfytbService.getClassQfPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<ClassQfPageVo> pageOutput = ConventPage.getPageOutput(classQfPage, ClassQfPageVo.class);
+        return RT.ok(pageOutput);
+    }
 }

+ 2 - 1
src/main/java/com/xjrsoft/module/student/dto/PbVXsxxsfytbStatDto.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.student.dto;
 
+import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -14,7 +15,7 @@ import java.util.List;
 * @Version 1.0
 */
 @Data
-public class PbVXsxxsfytbStatDto implements Serializable {
+public class PbVXsxxsfytbStatDto extends PageInput {
 
     @ApiModelProperty("年级id")
     private Long gradeId;

+ 8 - 1
src/main/java/com/xjrsoft/module/student/mapper/PbVXsxxsfytbMapper.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.student.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.student.dto.BaseStudentInfoDetailDto;
 import com.xjrsoft.module.student.dto.EnrollmentStatisticsInfoDto;
@@ -7,6 +8,7 @@ import com.xjrsoft.module.student.dto.PbVXsxxsfytbDto;
 import com.xjrsoft.module.student.dto.PbVXsxxsfytbStatDto;
 import com.xjrsoft.module.student.entity.PbVXsxxsfytb;
 import com.xjrsoft.module.student.vo.BaseClassQfCountVo;
+import com.xjrsoft.module.student.vo.ClassQfPageVo;
 import com.xjrsoft.module.student.vo.FeeDetailListVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbFeeitemVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbSpecnameCountVo;
@@ -35,5 +37,10 @@ public interface PbVXsxxsfytbMapper extends MPJBaseMapper<PbVXsxxsfytb> {
 
     List<FeeDetailListVo> getFeeDetail(@Param("studentcode") String studentcode);
 
-    List<StringCountVo> studentCategoryStat(PbVXsxxsfytbStatDto dto);
+    List<StringCountVo> studentCategoryStat(@Param("dto") PbVXsxxsfytbStatDto dto);
+
+
+    List<StringCountVo> stduyStatusStat(@Param("dto") PbVXsxxsfytbStatDto dto);
+
+    Page<ClassQfPageVo> getClassQfPage(Page<ClassQfPageVo> page, @Param("dto") PbVXsxxsfytbStatDto dto);
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/student/service/IPbVXsxxsfytbService.java

@@ -39,4 +39,8 @@ public interface IPbVXsxxsfytbService extends MPJBaseService<PbVXsxxsfytb> {
     Long getIsArrears(String credentialNumber);
 
     PbStudentCategoryVo studentCategoryStat(PbVXsxxsfytbStatDto dto);
+
+    PbStduyStatusVo stduyStatusStat(PbVXsxxsfytbStatDto dto);
+
+    Page<ClassQfPageVo> getClassQfPage(Page<ClassQfPageVo> page, PbVXsxxsfytbStatDto dto);
 }

+ 31 - 0
src/main/java/com/xjrsoft/module/student/service/impl/PbVXsxxsfytbServiceImpl.java

@@ -3,6 +3,7 @@ package com.xjrsoft.module.student.service.impl;
 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.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.page.ConventPage;
@@ -22,7 +23,9 @@ import com.xjrsoft.module.student.mapper.PbSemesterConfigMapper;
 import com.xjrsoft.module.student.mapper.PbVXsxxsfytbMapper;
 import com.xjrsoft.module.student.service.IPbVXsxxsfytbService;
 import com.xjrsoft.module.student.vo.BaseClassQfCountVo;
+import com.xjrsoft.module.student.vo.ClassQfPageVo;
 import com.xjrsoft.module.student.vo.FeeDetailListVo;
+import com.xjrsoft.module.student.vo.PbStduyStatusVo;
 import com.xjrsoft.module.student.vo.PbStudentCategoryVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbExcelVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbFeeitemVo;
@@ -293,4 +296,32 @@ public class PbVXsxxsfytbServiceImpl extends MPJBaseServiceImpl<PbVXsxxsfytbMapp
         result.setInclusiveRatio(divide.doubleValue());
         return result;
     }
+
+    @Override
+    public PbStduyStatusVo stduyStatusStat(PbVXsxxsfytbStatDto dto) {
+        List<StringCountVo> countVoList = pbVXsxxsfytbMapper.stduyStatusStat(dto);
+        PbStduyStatusVo result = new PbStduyStatusVo();
+        for (StringCountVo stringCountVo : countVoList) {
+            if("住宿".equals(stringCountVo.getName())){
+                result.setStayCount(stringCountVo.getCount());
+            }else if("走读".equals(stringCountVo.getName())){
+                result.setNotStayCount(stringCountVo.getCount());
+            }
+        }
+
+        Integer allCount = (result.getStayCount() == null?0:result.getStayCount())
+                + (result.getNotStayCount() == null?0:result.getNotStayCount());
+        BigDecimal divide = BigDecimal.ZERO;
+        if(allCount != 0){
+            divide = BigDecimal.valueOf(result.getStayCount()).divide(BigDecimal.valueOf(allCount), 4, RoundingMode.HALF_UP);
+        }
+        result.setStayRatio(divide.doubleValue());
+
+        return result;
+    }
+
+    @Override
+    public Page<ClassQfPageVo> getClassQfPage(Page<ClassQfPageVo> page, PbVXsxxsfytbStatDto dto) {
+        return pbVXsxxsfytbMapper.getClassQfPage(page, dto);
+    }
 }

+ 36 - 0
src/main/java/com/xjrsoft/module/student/vo/ClassQfPageVo.java

@@ -0,0 +1,36 @@
+package com.xjrsoft.module.student.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 班级欠费排名
+* @Author dzx
+* @Date: 2024年6月3日
+* @Version 1.0
+*/
+@Data
+public class ClassQfPageVo {
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("班级名称")
+    @ApiModelProperty("班级名称")
+    private String className;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("年级名称")
+    @ApiModelProperty("年级名称")
+    private String gradeName;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("班主任名称")
+    @ApiModelProperty("班主任名称")
+    private String teacherName;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("欠费总金额")
+    @ApiModelProperty("欠费总金额")
+    private Double qfzje;
+}

+ 26 - 0
src/main/java/com/xjrsoft/module/student/vo/PbStduyStatusVo.java

@@ -0,0 +1,26 @@
+package com.xjrsoft.module.student.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 学生贫困类型统计
+* @Author dzx
+* @Date: 2024-04-03
+* @Version 1.0
+*/
+@Data
+public class PbStduyStatusVo {
+
+
+    @ApiModelProperty("住读学生数量")
+    private Integer stayCount;
+
+    @ApiModelProperty("走读学生数量")
+    private Integer notStayCount;
+
+    @ApiModelProperty("住读学生占比")
+    private Double stayRatio;
+
+
+}

+ 37 - 0
src/main/resources/mapper/student/PbVXsxxsfytbMapper.xml

@@ -51,4 +51,41 @@
         </if>
         GROUP BY t1.resourcename
     </select>
+    <select id="stduyStatusStat" parameterType="com.xjrsoft.module.student.dto.PbVXsxxsfytbStatDto" resultType="com.xjrsoft.module.student.vo.StringCountVo">
+        SELECT t1.quartername as name,COUNT(t1.studentcode) as count FROM pb_cse_feeobjupdate t1
+        INNER JOIN xjr_user t2 ON t1.studentcode = t2.credential_number
+        INNER JOIN base_student_school_roll t3 ON t2.id = t3.user_id
+        WHERE t2.delete_mark = 0 AND t3.delete_mark = 0
+        <if test="dto.gradeId != null">
+            and t3.grade_id = #{dto.gradeId}
+        </if>
+        GROUP BY t1.quartername
+    </select>
+    <select id="stduyStatusStat" parameterType="com.xjrsoft.module.student.dto.PbVXsxxsfytbStatDto" resultType="com.xjrsoft.module.student.vo.StringCountVo">
+        SELECT t1.quartername as name,COUNT(t1.studentcode) as count FROM pb_cse_feeobjupdate t1
+        INNER JOIN xjr_user t2 ON t1.studentcode = t2.credential_number
+        INNER JOIN base_student_school_roll t3 ON t2.id = t3.user_id
+        WHERE t2.delete_mark = 0 AND t3.delete_mark = 0
+        <if test="dto.gradeId != null">
+            and t3.grade_id = #{dto.gradeId}
+        </if>
+        GROUP BY t1.quartername
+    </select>
+
+    <select id="getClassQfPage" parameterType="com.xjrsoft.module.student.dto.PbVXsxxsfytbStatDto" resultType="com.xjrsoft.module.student.vo.ClassQfPageVo">
+        SELECT t1.id, t2.name AS grade_name,t2.name AS class_name,t3.name AS teacher_name,
+        (
+        SELECT SUM(qfje) FROM pb_v_xsxxsfytb a1
+        INNER JOIN xjr_user a2 ON a1.studentcode = a2.credential_number
+        INNER JOIN base_student_school_roll a3 ON a2.id = a3.user_id
+        WHERE a2.delete_mark = 0 AND a3.delete_mark = 0 AND a3.class_id = t1.id
+        ) AS qfzje FROM base_class t1
+        INNER JOIN base_grade t2 ON t1.grade_id = t2.id
+        LEFT JOIN xjr_user t3 ON t1.teacher_id = t3.id
+        WHERE t1.delete_mark = 0
+        <if test="dto.gradeId != null">
+            and t1.grade_id = #{dto.gradeId}
+        </if>
+        ORDER BY qfzje DESC
+    </select>
 </mapper>