|
@@ -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)));
|
|
|
}
|
|
|
}
|