2 Commits 26f7de6fee ... 82bd73c4fb

Author SHA1 Message Date
  zouxuan 82bd73c4fb Merge remote-tracking branch 'origin/feature/1022_vip' into feature/1022_vip 4 days ago
  zouxuan 8cbe2d4824 会员拆分 4 days ago

+ 11 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ActivityUserMapperServiceImpl.java

@@ -318,7 +318,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
     public void addOrderDetail2Activity(StudentPaymentOrder studentPaymentOrder, List<StudentPaymentOrderDetail> activity) {
 		List<VipGroupActivity> vipGroupActivities = vipGroupActivityDao.queryByIds(activity.stream().
 				map(e -> e.getStudentInstrumentId().toString()).distinct().collect(Collectors.joining(",")));
-		Map<Integer, VipGroupActivity> collect = vipGroupActivities.stream().collect(Collectors.groupingBy(e -> e.getId(),
+		Map<Integer, VipGroupActivity> collect = vipGroupActivities.stream().collect(Collectors.groupingBy(VipGroupActivity::getId,
 				Collectors.collectingAndThen(Collectors.toList(), value -> value.get(0))));
 		List<ActivityUserMapper> activityUserMapperList = new ArrayList<>();
 		Long calenderId = null;
@@ -326,7 +326,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
 		MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderDao.get(studentPaymentOrder.getCalenderId());
 		if(musicGroupPaymentCalender.getCloudTeacherPaymentFlag()){
 			List<MusicGroupPaymentCalenderActivity> activities = musicGroupPaymentCalenderActivityDao.findByCalenderId(musicGroupPaymentCalender.getId());
-			BigDecimal reduce = activities.stream().map(e -> e.getActualAmount()).reduce(ZERO, BigDecimal::add);
+			BigDecimal reduce = activities.stream().map(MusicGroupPaymentCalenderBase::getActualAmount).reduce(ZERO, BigDecimal::add);
 			if(reduce.compareTo(ZERO) == 0){
 				calenderId = studentPaymentOrder.getCalenderId();
 			}
@@ -344,6 +344,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
 			activityUserMapper.setPaymentOrderId(studentPaymentOrder.getId());
 			activityUserMapper.setCalenderId(calenderId);
 			activityUserMapper.setOrganId(studentPaymentOrder.getOrganId());
+			activityUserMapper.setAddMemo(vipGroupActivity.getName());
 			if(orderDetail.getType() == OrderDetailTypeEnum.VIP){
 				activityUserMapper.setVipFlag(1);
 			}else {
@@ -477,7 +478,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
 		if (StringUtils.isBlank(applyBaseInfo.getSubjectIdList())) {
 			throw new BizException("请选择声部");
 		}
-		List<Integer> studentIdList = Arrays.stream(studentIds.split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toList());
+		List<Integer> studentIdList = Arrays.stream(studentIds.split(",")).map(Integer::valueOf).collect(Collectors.toList());
 		if (!vipGroupCategory.getMusicTheory()) {
 			if (studentIdList.size() != vipGroupCategory.getStudentNum()) {
 				throw new BizException("学员数量异常");
@@ -486,7 +487,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
 			throw new BizException("{}课程最多支持{}人", vipGroupCategory.getName(), vipGroupCategory.getStudentNum());
 		}
 
-		List<Integer> canBuyStudentIds = Arrays.stream(applyBaseInfo.getStudentIdList().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
+		List<Integer> canBuyStudentIds = Arrays.stream(applyBaseInfo.getStudentIdList().split(",")).map(Integer::valueOf).collect(Collectors.toList());
 
 		int repeatVipGroups = vipGroupDao.countUserRepeatVipGroupInCourseStartEndTime(applyBaseInfo.getUserId(), firstCourseSchedule.getStartClassTime(), latestCourseSchedule.getEndClassTime());
 		if (repeatVipGroups > 0) {
@@ -498,7 +499,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
 
 		//生成vip课信息
 		List<String> bySubIds = subjectDao.findBySubIds(applyBaseInfo.getSubjectIdList());
-		StringBuffer className = new StringBuffer();
+		StringBuilder className = new StringBuilder();
 		if (Objects.isNull(vipGroupCategory.getMusicTheory()) || !vipGroupCategory.getMusicTheory()) {
 			className.append(StringUtils.join(bySubIds, ","));
 			className.append(vipGroupCategory.getName());
@@ -618,10 +619,10 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
 		//如果是1V1的课程,需要处理老师课酬
 		Map<Integer, String> settlementMap = new HashMap<>();
 		if (vipGroupCategory.getStudentNum() == 1){
-			List<Integer> activityUserMapperIds = courseScheduleStudentPayments.stream().map(e -> e.getActivityUserMapperId()).distinct().collect(Collectors.toList());
+			List<Integer> activityUserMapperIds = courseScheduleStudentPayments.stream().map(CourseScheduleStudentPayment::getActivityUserMapperId).distinct().collect(Collectors.toList());
 			if(CollectionUtils.isNotEmpty(activityUserMapperIds)){
 				List<ActivityUserMapperSettlementDto> activityUserMapperSettlementDtos = activityUserMapperDao.querySettlementByIds(activityUserMapperIds);
-				settlementMap = activityUserMapperSettlementDtos.stream().collect(Collectors.groupingBy(e -> e.getActivityId(),
+				settlementMap = activityUserMapperSettlementDtos.stream().collect(Collectors.groupingBy(ActivityUserMapperSettlementDto::getActivityId,
 						Collectors.collectingAndThen(Collectors.toList(), v -> v.get(0).getSalarySettlementJson())));
 			}
 		}
@@ -681,7 +682,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
 			}
 		}
 		//处理老师课酬
-		if (courseScheduleTeacherSalaries.size() > 0) {
+		if (CollectionUtils.isNotEmpty(courseScheduleTeacherSalaries)) {
 			if(settlementMap.size() > 0){
 				Map<Long,CourseScheduleStudentPayment> courseActivityUserMap = courseScheduleStudentPayments.stream().collect(Collectors.groupingBy(CourseScheduleStudentPayment::getCourseScheduleId,
 						Collectors.collectingAndThen(Collectors.toList(),value->value.get(0))));
@@ -707,7 +708,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
 			courseScheduleTeacherSalaryService.batchInsert(courseScheduleTeacherSalaries);
 		}
 
-		if (courseScheduleStudentPayments.size() > 0) {
+		if (CollectionUtils.isNotEmpty(courseScheduleStudentPayments)) {
 			List<CourseScheduleStudentPayment> payments = courseScheduleStudentPayments.stream().filter(e -> e.getCalenderId() != null).collect(Collectors.toList());
 			if(CollectionUtils.isNotEmpty(payments)){
 				//更新课程预收
@@ -715,7 +716,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
 				for (Long calenderId : map.keySet()) {
 					List<CourseScheduleStudentPayment> studentPayments = map.get(calenderId);
 					Map<Integer,List<Long>> userMap = studentPayments.stream().collect(Collectors.groupingBy(CourseScheduleStudentPayment::getUserId,
-							Collectors.collectingAndThen(Collectors.toList(),value->value.stream().map(e->e.getCourseScheduleId()).collect(Collectors.toList()))));
+							Collectors.collectingAndThen(Collectors.toList(),value->value.stream().map(CourseScheduleStudentPayment::getCourseScheduleId).collect(Collectors.toList()))));
 					userMap.keySet().stream().forEach(e-> operatingReportCloudService.updateSet(calenderId,userMap.get(e)));
 				}
 			}

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java

@@ -1806,7 +1806,7 @@ public class ExportServiceImpl implements ExportService {
         if (StringUtils.isNotBlank(queryInfo.getSearch())) {
             List<BasicUserDto> users = studentPaymentOrderService.getDao().getUsers(queryInfo.getSearch());
             List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
-            if (userIds.size() <= 0) {
+            if (CollectionUtils.isEmpty(userIds)) {
                 userIds.add(0);
             }
             queryInfo.setUserIds(userIds);
@@ -2167,7 +2167,7 @@ public class ExportServiceImpl implements ExportService {
                             break;
                         case CLOUD_TEACHER:
                         case CLOUD_TEACHER_PLUS:
-                            row.setCloudTeacherFee(getActualAmount(orderDetail.getPrice(), row));
+                            row.setCloudTeacherFee(row.getCloudTeacherFee().add(getActualAmount(orderDetail.getPrice(), row)));
                             break;
                         case DEGREE_REGISTRATION:
                             row.setDegreeFee(getActualAmount(orderDetail.getPrice(), row));

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

@@ -705,7 +705,7 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
 
         imUserFriendService.refreshGroupImUserFriend(studentRegistration.getMusicGroupId(), null);
         //缴费项目详情
-        MusicGroupPaymentCalenderDetail paymentCalenderDetail = musicGroupPaymentCalenderDetailService.addCalenderDetail(studentPaymentOrder);
+//        MusicGroupPaymentCalenderDetail paymentCalenderDetail = musicGroupPaymentCalenderDetailService.addCalenderDetail(studentPaymentOrder);
 
         //销售订单详情
         if (allDetails.size() > 0 && (detailTypeEnums.contains(MUSICAL) || detailTypeEnums.contains(ACCESSORIES) || detailTypeEnums.contains(TEACHING))) {