Bladeren bron

修改学生总览接口接口

liu 2 maanden geleden
bovenliggende
commit
ea43ee4e01

+ 76 - 12
src/main/java/com/template/controller/WelcomeStudentController.java

@@ -1760,21 +1760,30 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
         String nstartTime = null;
         String nendTime = null;
         boolean lastYear = TimeExchange.CompareDate(TimeExchange.getDate(), TimeExchange.getYear() + "-07-01", "yyyy-MM-dd");
+
+//        获取年份
+        String yearStr="";
+
         if (yearId == null) {
             Integer yearInt = Integer.valueOf(TimeExchange.getYear());
             //当前时间小于本年度的7月1日 说明要查去年的数据
             if (lastYear) {
+                yearStr=(yearInt - 1) +"级新生";
                 nstartTime = (yearInt - 1) + "-06-01";
                 nendTime = yearInt + "-06-01";
             } else {
+                yearStr=yearInt +"级新生";
                 nstartTime = yearInt + "-06-01";
                 nendTime = (yearInt + 1) + "-06-01";
             }
         } else {
+            yearStr=yearId +"级新生";
             nstartTime = yearId + "-06-01";
             nendTime = (yearId + 1) + "-06-01";
         }
 
+
+
         //获取学生总数
         int enrollmentTotal = welcomeStudentService.studentTotalCount(collegeId, nstartTime, nendTime);
         //录取总数
@@ -1782,27 +1791,57 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
         //queryWrapper.eq(WelcomeStudent::getIdenType,1);
         //int enrollmentTotal = 8085;//welcomeStudentService.count(queryWrapper);
 
-        //缴费人数
+        //全部缴费人数
         int payCount = welcomeStudentService.payCount(collegeId, nstartTime, nendTime);
-        //缴费率
+
+        //全部缴费率
         Double rate = enrollmentTotal <= 0 ? 0 : ((double) payCount / enrollmentTotal) * 100;
         String payRate = String.format("%.2f", rate);
 
+//        部分缴费人数,支付状态未缴费,并且实付金额大于0
+        int portionPayCount = welcomeStudentService.payPortionCount(collegeId, nstartTime, nendTime);
+
+        //        部分缴费率
+        Double portionRate = enrollmentTotal <= 0 ? 0 : ((double) portionPayCount / enrollmentTotal) * 100;
+        String portionPayRate = String.format("%.2f", portionRate);
+
+//        总缴费人数(包括部分缴费人数)
+        int totalPayCount =payCount+portionPayCount;
+
+//      总缴费率(包括部分缴费)
+        Double totalRate=enrollmentTotal <= 0 ? 0 : ((double) totalPayCount / enrollmentTotal) * 100;
+        String totalPayRate = String.format("%.2f", totalRate);
+
+
+//        现场报到总人数
+        int registrationCount = welcomeStudentService.registrationCount(collegeId, nstartTime, nendTime);
+        Double result = enrollmentTotal <= 0 ? 0 : ((double) registrationCount / enrollmentTotal) * 100;
+        String registrationRate = String.format("%.2f", result);
+
+//        未报道人数
+        int notRegistrationCount=enrollmentTotal-registrationCount;
+
+//        已缴费但未现场报到人数
+        int payNotRegistrationCount=welcomeStudentService.payNotRegistrationCount(collegeId, nstartTime, nendTime);
+
+//        已缴费但未现场报到比率
+        Double payNotReportCountRate = enrollmentTotal <= 0 ? 0 : ((double) payNotRegistrationCount / enrollmentTotal) * 100;
+        String payNotRegistrationRate = String.format("%.2f", payNotReportCountRate);
 
         //已入住寝室数
-        LambdaQueryWrapper<WelcomeBed> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(WelcomeBed::getIsCheck, 1)
-                .eq(WelcomeBed::getRetentionState, 1)
-                .eq(ObjectUtils.isNotEmpty(collegeId), WelcomeBed::getCollegeId, collegeId);
-        wrapper.between(WelcomeBed::getCreateTime, nstartTime, nendTime);
-        int checkInBedTotal = welcomeBedService.count(wrapper);
+//        LambdaQueryWrapper<WelcomeBed> wrapper = new LambdaQueryWrapper<>();
+//        wrapper.eq(WelcomeBed::getIsCheck, 1)
+//                .eq(WelcomeBed::getRetentionState, 1)
+//                .eq(ObjectUtils.isNotEmpty(collegeId), WelcomeBed::getCollegeId, collegeId);
+//        wrapper.between(WelcomeBed::getCreateTime, nstartTime, nendTime);
+//        int checkInBedTotal = welcomeBedService.count(wrapper);
 
         //报到率
         //BigDecimal total = new BigDecimal(enrollmentTotal);
         //BigDecimal bedTotal = new BigDecimal(checkInBedTotal);
         //BigDecimal bigDecimal = bedTotal.divide(total).setScale(4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
-        Double result = enrollmentTotal <= 0 ? 0 : ((double) checkInBedTotal / enrollmentTotal) * 100;
-        String registrationRate = String.format("%.2f", result);
+//        Double result = enrollmentTotal <= 0 ? 0 : ((double) checkInBedTotal / enrollmentTotal) * 100;
+//        String registrationRate = String.format("%.2f", result);
 
 
         LocalDateTime start = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
@@ -1821,14 +1860,39 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
         Integer hCarTotal = wss != null && wss.size() > 0 ? (wss.get(0).getHjhCarNum() == null ? 0 : wss.get(0).getHjhCarNum()) : 0;
 
         StudentOverviewVo vo = new StudentOverviewVo();
+//        总人数
         vo.setEnrollmentTotal(enrollmentTotal);
+//        年份字段
+        vo.setYearStr(yearStr);
+//        现场报到人数
+        vo.setRegistrationCount(registrationCount);
+//        现场报到率
+        vo.setRegistrationRate(registrationRate);
+//        未报到人数
+        vo.setNotRegistrationCount(notRegistrationCount);
+//        总缴费人数(包括部分缴费)
+        vo.setTotalPayCount(totalPayCount);
+//        总缴费率(包括部分缴费)
+        vo.setTotalPayRate(totalPayRate);
+//        全部缴费人数
         vo.setPayCount(payCount);
+//        全部缴费率
         vo.setPayRate(payRate);
-        vo.setCheckInBedTotal(checkInBedTotal);
-        vo.setRegistrationRate(registrationRate);
+//        部分缴费人数
+        vo.setPortionPayCount(portionPayCount);
+//        部分缴费率
+        vo.setPortionPayRate(portionPayRate);
+//        已缴费未报到人数
+        vo.setPayNotRegistrationCount(payNotRegistrationCount);
+//        已缴费未报到率
+        vo.setPayNotRegistrationRate(payNotRegistrationRate);
+//        黄家湖当日剩余总数
         vo.setHCarTotal(hCarTotal - hVisitorTotal);
+//        黄家湖当日预定数
         vo.setHVisitorTotal(hVisitorTotal);
+//        墨轩湖当日剩余数
         vo.setMCarTotal(mCarTotal - mVisitorTotal);
+//        墨轩湖当日预定数
         vo.setMVisitorTotal(mVisitorTotal);
         return CommonResult.ok(vo);
     }

+ 31 - 6
src/main/java/com/template/model/vo/StudentOverviewVo.java

@@ -7,17 +7,42 @@ public class StudentOverviewVo {
     //录取人数
     private Integer enrollmentTotal;
 
-    //已缴费人数
+//    年份
+    private String yearStr;
+
+//    现场报到人数
+    private Integer registrationCount;
+
+//    现场报到率
+    private String registrationRate;
+
+//    未报到人数
+    private Integer notRegistrationCount;
+
+
+//    总缴费人数(包括部分缴费)
+    private Integer totalPayCount;
+
+//    总缴费率(包括部分缴费)
+    private String totalPayRate;
+
+    //全部缴费人数
     private Integer payCount;
 
-    //缴费率
+    //全部缴费率
     private String payRate;
 
-    //入住床位总数
-    private Integer checkInBedTotal;
+//    部分缴费人
+    private Integer portionPayCount;
 
-    //报到率
-    private String registrationRate;
+//    部分缴费率
+    private  String portionPayRate;
+
+//    已缴费未报到人数
+    private Integer payNotRegistrationCount;
+
+//    已缴费未报到率
+    private String payNotRegistrationRate;
 
     //当天墨轩湖预定车牌数
     private Integer mVisitorTotal;

+ 6 - 0
src/main/java/com/template/services/WelcomeStudentService.java

@@ -88,4 +88,10 @@ public interface WelcomeStudentService extends IService<WelcomeStudent> {
     int updateStudents(List<Integer> ids);
 
     List<WelcomeStudent> queryStudents(List<Integer> ids);
+
+    int payPortionCount(Integer collegeId, String startTime, String endTime);
+
+    int registrationCount(Integer collegeId, String startTime, String endTime);
+
+    int payNotRegistrationCount(Integer collegeId, String startTime, String endTime);
 }

+ 40 - 1
src/main/java/com/template/services/impl/WelcomeStudentServiceImpl.java

@@ -155,7 +155,8 @@ public class WelcomeStudentServiceImpl extends ServiceImpl<WelcomeStudentMapper,
     public int payCount(Integer collegeId, String startTime, String endTime) {
         QueryWrapper<WelcomeStudent> wss = new QueryWrapper<>();
 //        wss.gt("pay_amount",0);//交了钱就算已交付
-        wss.eq("is_pay", 1)
+        wss.eq("iden_type", 1)
+                .eq("is_pay", 1)
                 .eq(ObjectUtils.isNotEmpty(collegeId), "college_id", collegeId);//
         wss.between("create_time", startTime, endTime);
         Integer count = welcomeStudentMapper.selectCount(wss);
@@ -279,4 +280,42 @@ public class WelcomeStudentServiceImpl extends ServiceImpl<WelcomeStudentMapper,
         List<WelcomeStudent> result = welcomeStudentMapper.selectList(queryWrapper);
         return result;
     }
+
+    @Override
+    public int payPortionCount(Integer collegeId, String startTime, String endTime) {
+        QueryWrapper<WelcomeStudent> wss = new QueryWrapper<>();
+//        未支付,但实缴金额>0
+        wss.eq("iden_type",1)
+                .eq("is_pay", 0)
+                .gt("amount_payable", 0)
+                .eq(ObjectUtils.isNotEmpty(collegeId), "college_id", collegeId);//
+        wss.between("create_time", startTime, endTime);
+        Integer count = welcomeStudentMapper.selectCount(wss);
+        return count;
+    }
+
+    @Override
+    public int registrationCount(Integer collegeId, String startTime, String endTime) {
+        QueryWrapper<WelcomeStudent> wss = new QueryWrapper<>();
+//        已报道人数
+        wss.eq("iden_type",1)
+                .eq("is_registered", 1)
+                .eq(ObjectUtils.isNotEmpty(collegeId), "college_id", collegeId);//
+        wss.between("create_time", startTime, endTime);
+        Integer count = welcomeStudentMapper.selectCount(wss);
+        return count;
+    }
+
+    @Override
+    public int payNotRegistrationCount(Integer collegeId, String startTime, String endTime) {
+        QueryWrapper<WelcomeStudent> wss = new QueryWrapper<>();
+//         已缴费,但未报到人数
+        wss.eq("iden_type",1)
+                .eq("is_pay", 1)
+                .and(wrapper -> wrapper.eq("is_registered", 2).or().isNull("is_registered"))
+                .eq(ObjectUtils.isNotEmpty(collegeId), "college_id", collegeId);//
+        wss.between("create_time", startTime, endTime);
+        Integer count = welcomeStudentMapper.selectCount(wss);
+        return count;
+    }
 }