فهرست منبع

收费统计:学生类别统计接口

dzx 9 ماه پیش
والد
کامیت
33743863b6

+ 11 - 2
src/main/java/com/xjrsoft/module/student/controller/ConsumptionController.java

@@ -17,6 +17,7 @@ import com.xjrsoft.module.base.service.IBaseGradeService;
 import com.xjrsoft.module.student.dto.PbVXssfdetailPageDto;
 import com.xjrsoft.module.student.dto.PbVXsxxsfytbExcelDto;
 import com.xjrsoft.module.student.dto.PbVXsxxsfytbPageDto;
+import com.xjrsoft.module.student.dto.PbVXsxxsfytbStatDto;
 import com.xjrsoft.module.student.dto.PersonalInfoDto;
 import com.xjrsoft.module.student.dto.PersonalPortraitFeeInformationDto;
 import com.xjrsoft.module.student.service.IPbVXssfdetailService;
@@ -24,6 +25,7 @@ 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.FeeDetailListVo;
+import com.xjrsoft.module.student.vo.PbStudentCategoryVo;
 import com.xjrsoft.module.student.vo.PbVXssfdetailPageVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbExcelVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbPageVo;
@@ -48,9 +50,9 @@ import java.util.List;
 import java.util.Map;
 
 /**
-* @title: 学生职务设置
+* @title: 学生消费管理
 * @Author dzx
-* @Date: 2023-11-13
+* @Date: 2024年6月3日
 * @Version 1.0
 */
 @RestController
@@ -158,4 +160,11 @@ public class ConsumptionController {
     public RT<List<FeeDetailListVo>> feeDetail(@RequestParam String studentcode){
         return RT.ok(pbVXsxxsfytbService.getFeeDetail(studentcode));
     }
+
+    @GetMapping(value = "/student-category-stat")
+    @ApiOperation(value="学生缴费的详情")
+    @SaCheckPermission("consumption:detail")
+    public RT<PbStudentCategoryVo> studentCategory(@Valid PbVXsxxsfytbStatDto dto){
+        return RT.ok(pbVXsxxsfytbService.studentCategoryStat(dto));
+    }
 }

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

@@ -0,0 +1,22 @@
+package com.xjrsoft.module.student.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+* @title: 收费统计
+* @Author dzx
+* @Date: 2024年6月3日
+* @Version 1.0
+*/
+@Data
+public class PbVXsxxsfytbStatDto implements Serializable {
+
+    @ApiModelProperty("年级id")
+    private Long gradeId;
+
+}

+ 4 - 0
src/main/java/com/xjrsoft/module/student/mapper/PbVXsxxsfytbMapper.java

@@ -4,12 +4,14 @@ import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.student.dto.BaseStudentInfoDetailDto;
 import com.xjrsoft.module.student.dto.EnrollmentStatisticsInfoDto;
 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.FeeDetailListVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbFeeitemVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbSpecnameCountVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbVo;
+import com.xjrsoft.module.student.vo.StringCountVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -32,4 +34,6 @@ public interface PbVXsxxsfytbMapper extends MPJBaseMapper<PbVXsxxsfytb> {
     PbVXsxxsfytbFeeitemVo getStudentFeeInfo(@Param("dto") BaseStudentInfoDetailDto dto);
 
     List<FeeDetailListVo> getFeeDetail(@Param("studentcode") String studentcode);
+
+    List<StringCountVo> studentCategoryStat(PbVXsxxsfytbStatDto dto);
 }

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

@@ -37,4 +37,6 @@ public interface IPbVXsxxsfytbService extends MPJBaseService<PbVXsxxsfytb> {
      * @return 1:是,0:否
      */
     Long getIsArrears(String credentialNumber);
+
+    PbStudentCategoryVo studentCategoryStat(PbVXsxxsfytbStatDto dto);
 }

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

@@ -12,6 +12,7 @@ import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.student.dto.BaseStudentInfoDetailDto;
 import com.xjrsoft.module.student.dto.PbVXsxxsfytbExcelDto;
 import com.xjrsoft.module.student.dto.PbVXsxxsfytbPageDto;
+import com.xjrsoft.module.student.dto.PbVXsxxsfytbStatDto;
 import com.xjrsoft.module.student.dto.PersonalPortraitFeeInformationDto;
 import com.xjrsoft.module.student.entity.BaseStudent;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
@@ -22,17 +23,20 @@ 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.FeeDetailListVo;
+import com.xjrsoft.module.student.vo.PbStudentCategoryVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbExcelVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbFeeitemVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbPageVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbPersonal;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbPersonalMap;
 import com.xjrsoft.module.student.vo.PersonalPortraitFeeInformationVo;
+import com.xjrsoft.module.student.vo.StringCountVo;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -262,4 +266,31 @@ public class PbVXsxxsfytbServiceImpl extends MPJBaseServiceImpl<PbVXsxxsfytbMapp
         }
         return l;
     }
+
+    @Override
+    public PbStudentCategoryVo studentCategoryStat(PbVXsxxsfytbStatDto dto) {
+        List<StringCountVo> countVoList = pbVXsxxsfytbMapper.studentCategoryStat(dto);
+        PbStudentCategoryVo result = new PbStudentCategoryVo();
+        for (StringCountVo stringCountVo : countVoList) {
+            if("其他类型贫困".equals(stringCountVo.getName())){
+                result.setOtherPoorCount(stringCountVo.getCount());
+            }else if("普通学生(非贫困)".equals(stringCountVo.getName())){
+                result.setInclusiveCount(stringCountVo.getCount());
+            }else if("贫困生(建卡、低保、特困)".equals(stringCountVo.getName())){
+                result.setPoorCount(stringCountVo.getCount());
+            }
+        }
+        if(result.getInclusiveCount() == null){
+            result.setInclusiveCount(0);
+        }
+        Integer allCount = (result.getInclusiveCount() == null?0:result.getInclusiveCount())
+                + (result.getOtherPoorCount() == null?0:result.getOtherPoorCount())
+                + (result.getPoorCount() == null?0:result.getPoorCount()) ;
+        BigDecimal divide = BigDecimal.ZERO;
+        if(allCount != 0){
+            divide = BigDecimal.valueOf(result.getInclusiveCount()).divide(BigDecimal.valueOf(allCount), 4, RoundingMode.HALF_UP);
+        }
+        result.setInclusiveRatio(divide.doubleValue());
+        return result;
+    }
 }

+ 1 - 0
src/main/java/com/xjrsoft/module/student/service/impl/StudentLeaveServiceImpl.java

@@ -75,6 +75,7 @@ public class StudentLeaveServiceImpl extends MPJBaseServiceImpl<StudentLeaveMapp
         //调用接口获取到返回内容,并将其存到数据库中
         String result = apiUtil.doPost(apiPath, paramJson.toString(), null, header);
         studentLeave.setHikvisionResult(result);
+        studentLeave.setStatus(1);
         this.updateById(studentLeave);
         return true;
     }

+ 28 - 0
src/main/java/com/xjrsoft/module/student/vo/PbStudentCategoryVo.java

@@ -0,0 +1,28 @@
+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 PbStudentCategoryVo {
+
+
+    @ApiModelProperty("普惠制学生数量")
+    private Integer inclusiveCount;
+
+    @ApiModelProperty("贫困学生数量")
+    private Integer poorCount;
+
+    @ApiModelProperty("其它贫困学生数量")
+    private Integer otherPoorCount;
+
+    @ApiModelProperty("普惠制学生占比")
+    private Double inclusiveRatio;
+
+}

+ 22 - 0
src/main/java/com/xjrsoft/module/student/vo/StringCountVo.java

@@ -0,0 +1,22 @@
+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 StringCountVo {
+
+
+    @ApiModelProperty("名称")
+    private String name;
+
+    @ApiModelProperty("数量")
+    private Integer count;
+
+}

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

@@ -39,4 +39,16 @@
         LEFT JOIN pb_cse_feeitem2 t4 ON t1.feeitemcode = t4.feeitemcode
         WHERE t1.Studentcode = #{studentcode}
     </select>
+
+
+    <select id="studentCategoryStat" parameterType="com.xjrsoft.module.student.dto.PbVXsxxsfytbStatDto" resultType="com.xjrsoft.module.student.vo.StringCountVo">
+        SELECT t1.resourcename 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.resourcename
+    </select>
 </mapper>