liu 1 рік тому
батько
коміт
4c37bff972

+ 34 - 20
src/main/java/com/template/controller/WelcomeStudentController.java

@@ -47,6 +47,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStream;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.math.BigInteger;
+import java.math.RoundingMode;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeFormatter;
@@ -1469,36 +1470,49 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
     @Override
     @Override
     public CommonResult studentOverview() {
     public CommonResult studentOverview() {
 
 
-        QueryWrapper<WelcomeStudent> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("iden_type", 1);
-        queryWrapper.eq("fill_status", "已填报");
-//        报到总数
-        int studentTotal = welcomeStudentService.count(queryWrapper);
-//        寝室总数
-        int dormitoryTotal = welcomeDormitoryService.count(new QueryWrapper<>());
+//        录取总数
+        LambdaQueryWrapper<WelcomeStudent> queryWrapper=new LambdaQueryWrapper<>();
+        queryWrapper.eq(WelcomeStudent::getIdenType,1);
+        int enrollmentTotal = welcomeStudentService.count(queryWrapper);
 
 
+//        缴费人数
         int payCount = welcomeStudentService.payCount();
         int payCount = welcomeStudentService.payCount();
+
+
 //        已入住寝室数
 //        已入住寝室数
-        LambdaQueryWrapper<WelcomeDormitory> wrapper = new LambdaQueryWrapper<>();
-        wrapper.ne(WelcomeDormitory::getStatus, 2);
-        int count = welcomeDormitoryService.count(wrapper);
+        LambdaQueryWrapper<WelcomeBed> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(WelcomeBed::getIsCheck, 1)
+                .eq(WelcomeBed::getRetentionState,1);
+        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 registrationRate = bigDecimal.doubleValue();
+
 
 
         LocalDateTime start = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
         LocalDateTime start = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
         LocalDateTime end = start.plusDays(1);
         LocalDateTime end = start.plusDays(1);
-        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-        Integer visitorTotal = welcomeVisitorService.countTotal(start, end);
+        Integer mVisitorTotal = welcomeVisitorService.countTotal(start, end,1);
+        Integer hVisitorTotal = welcomeVisitorService.countTotal(start, end,2);
+
+
         List<WelcomeSetting> wss = welcomeSettingService.list(null);
         List<WelcomeSetting> wss = welcomeSettingService.list(null);
-        Integer carTotal = wss != null && wss.size() > 0 ? (wss.get(0).getMxhCarNum() == null ? 0 : wss.get(0).getMxhCarNum()) : 0;
+//        墨轩湖总车辆数
+        Integer mCarTotal = wss != null && wss.size() > 0 ? (wss.get(0).getMxhCarNum() == null ? 0 : wss.get(0).getMxhCarNum()) : 0;
+//        黄家湖总车辆数
+        Integer hCarTotal = wss != null && wss.size() > 0 ? (wss.get(0).getHjhCarNum() == null ? 0 : wss.get(0).getHjhCarNum()) : 0;
 
 
         StudentOverviewVo vo = new StudentOverviewVo();
         StudentOverviewVo vo = new StudentOverviewVo();
-        vo.setEnrollmentTotal(6532);
-        vo.setStudentTotal(studentTotal);
+        vo.setEnrollmentTotal(enrollmentTotal);
         vo.setPayCount(payCount);
         vo.setPayCount(payCount);
-        vo.setDormitoryTotal(dormitoryTotal);
-        vo.setCheckInTotal(count);
-        vo.setVisitorTotal(visitorTotal);
-        vo.setCarTotal(carTotal);
-
+        vo.setCheckInBedTotal(checkInBedTotal);
+        vo.setRegistrationRate(registrationRate);
+        vo.setHCarTotal(hCarTotal);
+        vo.setHVisitorTotal(hVisitorTotal);
+        vo.setMCarTotal(mCarTotal);
+        vo.setMVisitorTotal(mVisitorTotal);
         return CommonResult.ok(vo);
         return CommonResult.ok(vo);
     }
     }
 
 

+ 15 - 13
src/main/java/com/template/model/vo/StudentOverviewVo.java

@@ -5,25 +5,27 @@ import lombok.Data;
 @Data
 @Data
 public class StudentOverviewVo {
 public class StudentOverviewVo {
     //录取人数
     //录取人数
-    private Integer EnrollmentTotal;
+    private Integer enrollmentTotal;
 
 
-    //预学生报到
-    private Integer studentTotal;
+    //已缴费人
+    private Integer payCount;
 
 
-    //寝室总数
-    private Integer dormitoryTotal;
+    //入住床位总数
+    private Integer checkInBedTotal;
 
 
-    //已交付
-    private Integer payCount;
+    //报到率
+    private Double registrationRate;
 
 
-    //入住总
-    private Integer checkInTotal;
+    //当天墨轩湖车牌
+    private Integer mVisitorTotal;
 
 
-    //当天车牌数
-    private Integer visitorTotal;
+    //当天墨轩湖车牌数
+    private Integer mCarTotal;
 
 
-    //当天车牌数
-    private Integer carTotal;
+    //当天黄家湖车牌数
+    private Integer hVisitorTotal;
 
 
+    //当天黄家湖车牌数
+    private Integer hCarTotal;
 
 
 }
 }

+ 1 - 1
src/main/java/com/template/services/WelcomeVisitorService.java

@@ -67,7 +67,7 @@ public interface WelcomeVisitorService extends IService<WelcomeVisitor> {
      */
      */
     void export();
     void export();
 
 
-    Integer countTotal(LocalDateTime start, LocalDateTime end);
+    Integer countTotal(LocalDateTime start, LocalDateTime end,Integer schoolId);
 
 
     Integer carTotal();
     Integer carTotal();
 
 

+ 3 - 2
src/main/java/com/template/services/impl/WelcomeVisitorServiceImpl.java

@@ -254,10 +254,11 @@ public class WelcomeVisitorServiceImpl extends ServiceImpl<WelcomeVisitorMapper,
     }
     }
 
 
     @Override
     @Override
-    public Integer countTotal(LocalDateTime start, LocalDateTime end) {
+    public Integer countTotal(LocalDateTime start, LocalDateTime end,Integer schoolId) {
         LambdaQueryWrapper<WelcomeVisitor> queryWrapper = new LambdaQueryWrapper<>();
         LambdaQueryWrapper<WelcomeVisitor> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.ge(WelcomeVisitor::getStartTime, start)
         queryWrapper.ge(WelcomeVisitor::getStartTime, start)
-                        .le(WelcomeVisitor::getEndTime,end);
+                        .le(WelcomeVisitor::getEndTime,end)
+                .eq(WelcomeVisitor::getSchoolId,schoolId);
         int count = this.count(queryWrapper);
         int count = this.count(queryWrapper);
         return count;
         return count;
     }
     }