Joburgess před 5 roky
rodič
revize
afe3763f1d

+ 17 - 12
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -273,6 +273,8 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 complainsGroupByStudent = courseStudentComplaints.stream().collect(Collectors.groupingBy(CourseScheduleComplaints::getUserId));
             }
 
+            BigDecimal zero=new BigDecimal(0);
+
             //计算学生当前课程应缴费用
             for (CourseScheduleStudentPayment studentPayment : studentPaymentsWithCourse) {
                 //当前课程学生应缴费用
@@ -306,18 +308,21 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 courseScheduleStudentPaymentDao.update(studentPayment);
                 updateStudentPayments.add(studentPayment);
 
-                //生成学生账户资金变动记录
-                sysUserCashAccountService.updateBalance(studentPayment.getUserId(), returnPrice);
-                SysUserCashAccount studentCashAccount = sysUserCashAccountService.get(studentPayment.getUserId().intValue());
-                SysUserCashAccountDetail studentAccountDetail = new SysUserCashAccountDetail();
-                studentAccountDetail.setUserId(studentPayment.getUserId());
-                studentAccountDetail.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
-                studentAccountDetail.setStatus(DealStatusEnum.SUCCESS);
-                studentAccountDetail.setAmount(returnPrice);
-                studentAccountDetail.setBalance(studentCashAccount.getBalance());
-                studentAccountDetail.setAttribute(courseScheduleTeacherSalary.getCourseScheduleId().toString());
-
-                userCashAccountDetails.add(studentAccountDetail);
+
+                if(returnPrice.compareTo(zero)!=0){
+                    //生成学生账户资金变动记录
+                    sysUserCashAccountService.updateBalance(studentPayment.getUserId(), returnPrice);
+                    SysUserCashAccount studentCashAccount = sysUserCashAccountService.get(studentPayment.getUserId().intValue());
+                    SysUserCashAccountDetail studentAccountDetail = new SysUserCashAccountDetail();
+                    studentAccountDetail.setUserId(studentPayment.getUserId());
+                    studentAccountDetail.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
+                    studentAccountDetail.setStatus(DealStatusEnum.SUCCESS);
+                    studentAccountDetail.setAmount(returnPrice);
+                    studentAccountDetail.setBalance(studentCashAccount.getBalance());
+                    studentAccountDetail.setAttribute(courseScheduleTeacherSalary.getCourseScheduleId().toString());
+
+                    userCashAccountDetails.add(studentAccountDetail);
+                }
             }
 
         });