Joburgess 4 лет назад
Родитель
Сommit
74c2fb959e

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupManageDetailDto.java

@@ -38,6 +38,16 @@ public class VipGroupManageDetailDto extends VipGroup {
 
     private BigDecimal offlineTeacherSalary;
 
+    private Boolean musicTheory;
+
+    public Boolean getMusicTheory() {
+        return musicTheory;
+    }
+
+    public void setMusicTheory(Boolean musicTheory) {
+        this.musicTheory = musicTheory;
+    }
+
     public BigDecimal getOnlineTeacherSalary() {
         return onlineTeacherSalary;
     }

+ 10 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -803,12 +803,15 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			dataList = vipGroupDao.findHaveCourseBalanceStudents(params);
 
 			List<VipGroupStudentCoursePrice> vipGroupStudentCoursePrices = vipGroupStudentCoursePriceDao.getVipGroupStudentCoursePrice(queryInfo.getVipGroupId(), null);
-			Map<Integer, VipGroupStudentCoursePrice> userPriceMap = vipGroupStudentCoursePrices.stream().collect(Collectors.toMap(VipGroupStudentCoursePrice::getStudentId, v -> v, (v1, v2) -> v1));
+			Map<Integer, VipGroupStudentCoursePrice> userPriceMap = new HashMap<>();
+			if(!CollectionUtils.isEmpty(vipGroupStudentCoursePrices)){
+				userPriceMap = vipGroupStudentCoursePrices.stream().collect(Collectors.toMap(VipGroupStudentCoursePrice::getStudentId, v -> v, (v1, v2) -> v1));
+			}
 			for (VipGroupStudentDto vipGroupStudentDto : dataList) {
-				if(!userPriceMap.containsKey(vipGroupStudentDto.getId())){
+				if(!userPriceMap.containsKey(Integer.valueOf(vipGroupStudentDto.getId().toString()))){
 					continue;
 				}
-				VipGroupStudentCoursePrice vipGroupStudentCoursePrice = userPriceMap.get(vipGroupStudentDto.getId());
+				VipGroupStudentCoursePrice vipGroupStudentCoursePrice = userPriceMap.get(Integer.valueOf(vipGroupStudentDto.getId().toString()));
 				vipGroupStudentDto.setOnlineClassesUnitPrice(vipGroupStudentCoursePrice.getOnlineClassesUnitPrice());
 				vipGroupStudentDto.setOfflineClassesUnitPrice(vipGroupStudentCoursePrice.getOfflineClassesUnitPrice());
 			}
@@ -1120,14 +1123,16 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 			results.put("onlineTeacherSalary", ots);
 			results.put("offlineTeacherSalary", ofts);
+		}else{
+
 		}
 
 		if(Objects.isNull(vipGroupActivity)||vipGroupCategory.getMusicTheory()){
 			BigDecimal ots = teacherDefaultVipGroupSalary.getOfflineClassesSalary();
 			BigDecimal ofts = teacherDefaultVipGroupSalary.getOfflineClassesSalary();
 			if(Objects.nonNull(vipGroup.getStatus())&&vipGroupCategory.getMusicTheory()){
-				ots = ots.multiply(new BigDecimal(normalStudentNum)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
-				ofts = ofts.multiply(new BigDecimal(normalStudentNum>5?5:normalStudentNum)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
+				ots = ots.multiply(new BigDecimal(normalStudentNum>5?5:normalStudentNum)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
+				ofts = ofts.multiply(new BigDecimal(normalStudentNum)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
 			}
 			results.put("totalPrice",vipGroup.getTotalPrice());
 			results.put("onlineTeacherSalary",ots);

+ 3 - 1
mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -88,6 +88,7 @@
         <result property="subjectIdList" column="subject_id_list_"/>
         <result property="categoryName" column="category_name_"/>
         <result column="teacher_school_name_" property="teacherSchoolName"/>
+        <result column="music_theory_" property="musicTheory"/>
         <!--<collection property="students" ofType="com.ym.mec.auth.api.entity.SysUser" column="student_id_">-->
         <!--<result property="id" column="student_id_"/>-->
         <!--<result property="username" column="username_"/>-->
@@ -419,7 +420,8 @@
                cg.total_class_times_,
                cg.current_class_times_,
                vgc.name_     category_name_,
-               s.name_       teacher_school_name_
+               s.name_       teacher_school_name_,
+               vgc.music_theory_
         FROM vip_group vg
                  LEFT JOIN sys_user su ON vg.user_id_ = su.id_
                  LEFT JOIN class_group cg ON vg.id_ = cg.music_group_id_ AND cg.group_type_ = 'VIP'