浏览代码

系统收费

zouxuan 4 年之前
父节点
当前提交
c20e708cb1

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexErrorType.java

@@ -17,6 +17,8 @@ public enum IndexErrorType implements BaseEnum<String, IndexErrorType> {
     STUDENT_NOT_PAYMENT("STUDENT_NOT_PAYMENT", "未缴费学员数"),
     STUDENT_ERROR_LEAVE("STUDENT_ERROR_LEAVE", "学员异常请假"),
     STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP("STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP", "申请退团学员数"),
+    NO_MEMBER_STUDENT_INFO("NO_MEMBER_STUDENT_INFO", "当前共有{0}个乐团共{1}名学员会员已过期"),
+    MEMBER_STUDENT_INFO("MEMBER_STUDENT_INFO", "当前共有{0}个乐团共{1}名学员会员即将过期"),
     WAIT_CREATE_PAYMENT_CALENDER("WAIT_CREATE_PAYMENT_CALENDER", "待创建缴费项目"),
     ATTENDANCE_ERR_STUDENT_NUM("COURSE_TRUANT_STUDENT_NUM", "学员考勤异常"),
     COURSE_TRUANT_STUDENT_NUM("COURSE_TRUANT_STUDENT_NUM", "学员旷课"),

+ 8 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -2807,23 +2807,26 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             if(classGroup4MixDto.getCourseType() == SINGLE || classGroup4MixDto.getCourseType() == MIX ||
                     classGroup4MixDto.getCourseType() == TRAINING_SINGLE || classGroup4MixDto.getCourseType() == TRAINING_MIX){
                 //单技课和合奏课最大的排课时长不能超过44 * 45 分钟
-                if(totalCourseMinutes > 44 * 45){
-                    throw new BizException("操作失败:单技课和合奏课课时长已超过最大限制(1980分钟)");
-                }
                 if(classGroup4MixDto.getCourseType() == SINGLE || classGroup4MixDto.getCourseType() == TRAINING_SINGLE){
+                    if(totalCourseMinutes > 44 * 45){
+                        throw new BizException("声部类型总时长不能超过最大限制(1980分钟)");
+                    }
                     singleCourseMinutes = totalCourseMinutes;
                     //获取所选学员最大的已消耗的单技课时长
                     int maxSingleCourseMinutes = musicGroupSchoolTermStudentCourseDetailDao.getMaxSingleCourseMinutes(musicGroupSchoolTermCourseDetailId,studentIds);
                     if(44 * 45 - maxSingleCourseMinutes < totalCourseMinutes){
 //                        throw new BizException("操作失败:所选学员可排单技课时长已不足{}分钟",totalCourseMinutes);
-                        throw new BizException("操作失败:所选学员可排单技课时长已不足");
+                        throw new BizException("声部类型总时长不能超过最大限制(1980分钟)");
                     }
                 } else {
+                    if(totalCourseMinutes > 44 * 45){
+                        throw new BizException("声部类型总时长不能超过最大限制(1980分钟)");
+                    }
                     totalMixCourseMinutes = totalCourseMinutes;
                     int maxMixCourseMinutes = musicGroupSchoolTermStudentCourseDetailDao.getMaxMixCourseMinutes(musicGroupSchoolTermCourseDetailId,studentIds);
                     if(44 * 45 - maxMixCourseMinutes < totalCourseMinutes){
 //                        throw new BizException("操作失败:所选学员可排合奏课时长已不足{}分钟",totalCourseMinutes);
-                        throw new BizException("操作失败:所选学员可排合奏课时长已不足");
+                        throw new BizException("合奏类型总时长不能超过最大限制(1980分钟)");
                     }
                 }
             }

+ 22 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -532,7 +532,15 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(),  quitGroupNum));
 
 			//乐团学员会员到期首页提醒
-//			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic("1",null);
+			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic("1",null);
+			IndexErrInfoDto noClassMusicGroupStudentInfo = new IndexErrInfoDto();
+			Set<String> musicGroupIds = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
+			Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
+			noClassMusicGroupStudentInfo.setErrorType(IndexErrorType.NO_MEMBER_STUDENT_INFO);
+			noClassMusicGroupStudentInfo.setNum(musicGroupIds.size());
+			noClassMusicGroupStudentInfo.setNum2(userIds.size());
+			noClassMusicGroupStudentInfo.setDesc(IndexErrorType.NO_MEMBER_STUDENT_INFO.getMsg());
+			twoChild.add(noClassMusicGroupStudentInfo);
 
 //			int attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode(),startTime);
 //			twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), attendanceInfo, null));
@@ -898,12 +906,19 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		result.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary, null));
 
 		//乐团学员会员即将到期首页提醒
-//		String configValue = sysConfigDao.findConfigValue(SysConfigService.PUSH_MEMBER_RENEW_QUIT);
-//		if(StringUtils.isEmpty(configValue)){
-//			configValue = "5";
-//		}
-//		List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,0);
-
+		String configValue = sysConfigDao.findConfigValue(SysConfigService.PUSH_MEMBER_RENEW_QUIT);
+		if(StringUtils.isEmpty(configValue)){
+			configValue = "15";
+		}
+		List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,0);
+		Set<String> musicGroupIdList = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
+		Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
+		IndexErrInfoDto infoDto = new IndexErrInfoDto();
+		infoDto.setErrorType(IndexErrorType.MEMBER_STUDENT_INFO);
+		infoDto.setNum(musicGroupIdList.size());
+		infoDto.setNum2(userIds.size());
+		infoDto.setDesc(IndexErrorType.MEMBER_STUDENT_INFO.getMsg());
+		result.add(infoDto);
 		return result;
 	}
 

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderDetailServiceImpl.java

@@ -57,6 +57,9 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
 
     @Override
     public int batchAdd(List<StudentPaymentOrderDetail> studentPaymentOrderDetailList) {
+        if(studentPaymentOrderDetailList == null || studentPaymentOrderDetailList.size() == 0){
+            return 0;
+        }
         return studentPaymentOrderDetailDao.batchAdd(studentPaymentOrderDetailList);
     }
 

+ 3 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -1089,17 +1089,12 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 
             List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.getOrderDetail(studentPaymentOrder.getId());
 
-            //云教练费用
             List<StudentPaymentOrderDetail> allDetails = studentPaymentOrderDetailDao.getOrderDetailByOrderId(studentPaymentOrder.getId());
-//            BigDecimal cloudTeacher = allDetails.stream()
-//                    .filter(o -> !o.getType().getCode().equals("CLOUD_TEACHER"))
-//                    .filter(o -> !o.getType().getCode().equals("CLOUD_TEACHER_PLUS"))
-//                    .map(o -> o.getPrice().subtract(o.getRemitFee() == null ? BigDecimal.ZERO : o.getRemitFee()))
-//                    .reduce(BigDecimal.ZERO, BigDecimal::add);
-            //云教练费用
             BigDecimal courseFee = allDetails.stream().filter(o -> !o.getType().getCode().equals("MUSICAL"))
                     .filter(o -> !o.getType().getCode().equals("ACCESSORIES"))
                     .filter(o -> !o.getType().getCode().equals("MAINTENANCE"))
+                    .filter(o -> !o.getType().getCode().equals("CLOUD_TEACHER"))
+                    .filter(o -> !o.getType().getCode().equals("CLOUD_TEACHER_PLUS"))
                     .map(o -> o.getPrice().subtract(o.getRemitFee() == null ? BigDecimal.ZERO : o.getRemitFee()))
                     .reduce(BigDecimal.ZERO, BigDecimal::add);
 
@@ -1110,7 +1105,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             //添加日志
             StudentCourseFeeDetail studentCourseFeeDetail = new StudentCourseFeeDetail();
             studentCourseFeeDetail.setStudentRegistrationId(studentRegistration.getId());
-            studentCourseFeeDetail.setAmount(studentPaymentOrder.getExpectAmount());
+            studentCourseFeeDetail.setAmount(courseFee);
             studentCourseFeeDetail.setSurplusCourseFee(studentRegistration.getSurplusCourseFee());
             studentCourseFeeDetail.setMemo("充值");
             studentCourseFeeDetail.setOperator(studentPaymentOrder.getUserId());