44323
2023-11-14 ddbb38c54db9c3670e5ff53f4bf713525de1099d
cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackagePaymentServiceImpl.java
@@ -163,15 +163,6 @@
        List<Map<String, Object>> studentTotal = this.baseMapper.getStudentTotal(studentQeryDto);
        for (Map<String, Object> student : studentTotal) {
            BigDecimal cashPayment = (BigDecimal) student.get("cashPayment");
            BigDecimal totalClassHours = (BigDecimal) student.get("totalClassHours");
            BigDecimal hasHours = (BigDecimal) student.get("hasHours");
            BigDecimal hasPayment = cashPayment.divide(totalClassHours, 2, RoundingMode.HALF_UP)
                    .multiply(hasHours).setScale(2, RoundingMode.HALF_UP);
            student.put("hasPayment", hasPayment);
            Integer appUserId = (Integer) student.get("appUserId");
            AppUser appUser = appuClient.queryAppUser(appUserId);
            student.put("province", appUser.getProvince());
@@ -182,8 +173,18 @@
            Student studentId = studentClient.queryStudentById((Integer) student.get("studentId"));
            student.put("studentName", studentId.getName());
            BigDecimal cashPayment = (BigDecimal) student.get("cashPayment");
            BigDecimal totalClassHours = (BigDecimal) student.get("totalClassHours");
            BigDecimal hasHours = (BigDecimal) student.get("hasHours");
            if (cashPayment==null){
                continue;
            }
            if (totalClassHours.compareTo(BigDecimal.ZERO)==0){
                totalClassHours = totalClassHours.add(new BigDecimal("1"));
            }
            BigDecimal hasPayment = cashPayment.divide(totalClassHours, 2, RoundingMode.HALF_UP)
                    .multiply(hasHours).setScale(2, RoundingMode.HALF_UP);
            student.put("hasPayment", hasPayment);
        }
        if (studentQeryDto.getCityCode()!=null&&studentQeryDto.getCityCode()!="") {