Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

Joburgess 4 tahun lalu
induk
melakukan
690024af87

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderStudentDetail.java

@@ -168,14 +168,14 @@ public class MusicGroupPaymentCalenderStudentDetail {
 		if (o == null || getClass() != o.getClass()) return false;
 		MusicGroupPaymentCalenderStudentDetail that = (MusicGroupPaymentCalenderStudentDetail) o;
 		return userId.equals(that.userId) &&
-				courseOriginalPrice.equals(that.courseOriginalPrice) &&
-				courseCurrentPrice.equals(that.courseCurrentPrice) &&
+				courseOriginalPrice.doubleValue()==(that.courseOriginalPrice.doubleValue()) &&
+				courseCurrentPrice.doubleValue()==(that.courseCurrentPrice.doubleValue()) &&
 				courseType.equals(that.courseType) &&
 				classGroupId.equals(that.classGroupId);
 	}
 
 	@Override
 	public int hashCode() {
-		return Objects.hash(userId, courseOriginalPrice, courseCurrentPrice, courseType, classGroupId);
+		return Objects.hash(userId, courseOriginalPrice.doubleValue(), courseCurrentPrice.doubleValue(), courseType, classGroupId);
 	}
 }

+ 0 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -141,7 +141,6 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
      * @param studentIds 学员列表
      * @param oldMusicGroupId 原乐团
      * @param newMusicGroupId 主乐团
-     * @param masterTotalPrice 主乐团剩余课程价值
      * @return
      */
     void insertStudent(String studentIds,String oldMusicGroupId,String newMusicGroupId,Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect);

+ 9 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -32,6 +32,7 @@ import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.service.*;
+import com.ym.mec.util.collection.ListUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -3723,21 +3724,22 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         MusicGroup musicGroup = musicGroupDao.findByClassGroupId(masterClassGroupId);
         BigDecimal masterTotalPrice = getMasterTotalPrice(masterClassGroupId);
         //是否有需要审核的缴费项目
-        //将学员加入新乐团、扣除原乐团剩余课程余额、补充到现有乐团
-        Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect = musicGroupPaymentCalenderStudentDetails.stream().collect(Collectors.groupingBy(e -> e.getUserId()));
-        for (Map<Integer, String> classGroupStudent : classGroupStudents) {
-            Integer classGroupId = classGroupStudent.keySet().iterator().next();
-            studentRegistrationService.insertStudent(classGroupStudent.get(classGroupId),musicGroupDao.findByClassGroupId(classGroupId).getId(),musicGroup.getId(),collect);
-        }
+        List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = paymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails();
 
         paymentCalenderDto.setMusicGroupId(musicGroup.getId());
-        List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = paymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails();
         boolean containsAll = musicGroupPaymentCalenderStudentDetails.containsAll(calenderStudentDetails);
         if(!containsAll){
             paymentCalenderDto.setStatus(AUDITING);
         }else {
             paymentCalenderDto.setStatus(NO);
         }
+
+        //将学员加入新乐团、扣除原乐团剩余课程余额、补充到现有乐团
+        Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect = calenderStudentDetails.stream().collect(Collectors.groupingBy(e -> e.getUserId()));
+        for (Map<Integer, String> classGroupStudent : classGroupStudents) {
+            Integer classGroupId = classGroupStudent.keySet().iterator().next();
+            studentRegistrationService.insertStudent(classGroupStudent.get(classGroupId),musicGroupDao.findByClassGroupId(classGroupId).getId(),musicGroup.getId(),collect);
+        }
         paymentCalenderDto.setPayUserType(MusicGroupPaymentCalender.PayUserType.STUDENT);
         paymentCalenderDto.setPaymentType(SPAN_GROUP_CLASS_ADJUST);
         //生成缴费项目

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -4654,12 +4654,12 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 		ClassGroup classGroup = classGroupDao.findByMusicGroupAndType(practiceGroupId, PRACTICE.getCode());
         if(Objects.nonNull(educationalTeacherId)&&!educationalTeacherId.equals(practiceGroup.getEducationalTeacherId())){
-			if(Objects.nonNull(practiceGroup.getEducationalTeacherId())){
-				imGroupMemberService.quit(classGroup.getId().longValue(), practiceGroup.getEducationalTeacherId());
-			}
+//			if(Objects.nonNull(practiceGroup.getEducationalTeacherId())){
+//				imGroupMemberService.quit(classGroup.getId().longValue(), practiceGroup.getEducationalTeacherId());
+//			}
 
 			practiceGroup.setEducationalTeacherId(educationalTeacherId);
-			imGroupMemberService.join(classGroup.getId().longValue(), educationalTeacherId, "", false);
+//			imGroupMemberService.join(classGroup.getId().longValue(), educationalTeacherId, "", false);
 		}
 		if(Objects.nonNull(subjectId)&&!subjectId.equals(practiceGroup.getSubjectId())){
 			Subject subject = subjectDao.get(subjectId);

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

@@ -23,6 +23,7 @@ import java.util.stream.Collectors;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.util.collection.ListUtil;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -560,6 +561,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails = classGroupService.queryStudentPaymentCalenders(adjust.getMasterClassGroupId(),
 						adjust.getClassGroupStudents(),studentIds);
 				List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = musicGroupPaymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails();
+
 				boolean containsAll = musicGroupPaymentCalenderStudentDetails.containsAll(calenderStudentDetails);
 				if(!containsAll){
 					status = AUDITING;

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

@@ -785,7 +785,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         List<StudentCourseFeeDetail> studentCourseFeeDetails = new ArrayList<>();
         BigDecimal amount = BigDecimal.ZERO;
         for (StudentRegistration studentRegistration : studentRegistrations) {
-            BigDecimal masterTotalPrice = collect.get(studentRegistration.getUserId()).stream().map(e->e.getCutAmount()).reduce(BigDecimal.ZERO, BigDecimal::add);
+            List<MusicGroupPaymentCalenderStudentDetail> details = collect.get(studentRegistration.getUserId());
+            BigDecimal masterTotalPrice = details.stream().map(e->e.getCutAmount()).reduce(BigDecimal.ZERO, BigDecimal::add);
             if(masterTotalPrice.doubleValue() > studentRegistration.getSurplusCourseFee().doubleValue()){
                 throw new BizException("用户信息发生变动,请重新提交");
             }