浏览代码

Merge remote-tracking branch 'origin/master'

Joburgess 4 年之前
父节点
当前提交
a277cffe27
共有 22 个文件被更改,包括 286 次插入156 次删除
  1. 9 4
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupOrganizationCourseSettingsDetailDao.java
  2. 2 10
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderCourseSettingsDao.java
  3. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderDto.java
  4. 5 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderCourseSettings.java
  5. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java
  6. 0 9
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderCourseSettingsService.java
  7. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderService.java
  8. 26 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  9. 0 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderCourseSettingsServiceImpl.java
  10. 190 92
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  11. 4 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  12. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  13. 3 3
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  14. 8 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupOrganizationCourseSettingsDetailMapper.xml
  15. 4 8
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderCourseSettingsMapper.xml
  16. 3 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  17. 4 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentStudentCourseDetailMapper.xml
  18. 3 1
      mec-im/src/main/java/com/ym/controller/RoomController.java
  19. 1 1
      mec-im/src/main/java/com/ym/pojo/DeviceTypeEnum.java
  20. 6 2
      mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java
  21. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  22. 3 4
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java

+ 9 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupOrganizationCourseSettingsDetailDao.java

@@ -8,13 +8,18 @@ import java.util.List;
 
 public interface MusicGroupOrganizationCourseSettingsDetailDao extends BaseDAO<Integer, MusicGroupOrganizationCourseSettingsDetail> {
 
-    static MusicGroupOrganizationCourseSettingsDetail getClassLastSetting(Integer classGroupId, String courseType) {
-        return null;
-    }
-
     int batchInsert(@Param("settingDetails") List<MusicGroupOrganizationCourseSettingsDetail> settingDetails);
 
     int deleteBySettingId(@Param("settingId") Integer settingId);
     
     List<MusicGroupOrganizationCourseSettingsDetail> queryByMusicGroupOrganizationCourseSettingsId(Integer musicGroupOrganizationCourseSettingsId);
+
+    /**
+     * 获取当前班级对应课程类型的价格
+     * @author zouxuan
+     * @param classGroupId
+     * @param courseType
+     * @return
+     */
+    MusicGroupOrganizationCourseSettingsDetail getClassLastSetting(@Param("classGroupId") Integer classGroupId, @Param("courseType") String courseType);
 }

+ 2 - 10
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderCourseSettingsDao.java

@@ -4,6 +4,7 @@ import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 import com.ym.mec.common.dal.BaseDAO;
+
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -34,7 +35,7 @@ public interface MusicGroupPaymentCalenderCourseSettingsDao extends BaseDAO<Inte
 	List<MusicGroupPaymentCalenderCourseSettings> getWithPaymentCalendersAndCourseType(@Param("calenderIds") Set<Long> calenderIds,
 																				@Param("courseType") CourseSchedule.CourseScheduleType courseType);
 
-	int deleteByMusicGroupPaymentCalenderId(Long musicGroupPaymentCalenderId);
+	int deleteByMusicGroupPaymentCalenderId(@Param("calenderIds") List<Long> calenderIds);
 
 	/**
 	 * 获取乐团的缴费课程
@@ -81,13 +82,4 @@ public interface MusicGroupPaymentCalenderCourseSettingsDao extends BaseDAO<Inte
 	 * @time 16:04
 	 */
 	List<MusicGroupPaymentCalenderCourseSettings> queryCalenderCourseSettingsByBatchNo(String batchNo);
-
-	/**
-	 * 获取当前班级对应课程类型的价格
-	 * @author zouxuan
-	 * @param classGroupId
-	 * @param courseType
-	 * @return
-	 */
-    MusicGroupOrganizationCourseSettingsDetail getClassLastSetting(@Param("classGroupId") Integer classGroupId, @Param("courseType") String courseType);
 }

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

@@ -29,6 +29,8 @@ public class MusicGroupPaymentCalenderDto {
 	private String attribute2;
 
 	private String studentIds;
+	
+	private String batchNo;
 
 	private List<MusicGroupPaymentDateRange> musicGroupPaymentDateRangeList = new ArrayList<MusicGroupPaymentDateRange>();
 
@@ -130,6 +132,14 @@ public class MusicGroupPaymentCalenderDto {
 		this.musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalenderCourseSettingsList;
 	}
 
+	public String getBatchNo() {
+		return batchNo;
+	}
+
+	public void setBatchNo(String batchNo) {
+		this.batchNo = batchNo;
+	}
+
 	public class MusicGroupPaymentDateRange {
 
 		private java.util.Date startPaymentDate;

+ 5 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderCourseSettings.java

@@ -1,7 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
-
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 
 /**
@@ -34,7 +33,7 @@ public class MusicGroupPaymentCalenderCourseSettings {
 	private java.math.BigDecimal courseCurrentPrice;
 	
 	/** 是否学生可选 */
-	private boolean isStudentOptional;
+	private boolean isStudentOptional = false;
 	
 	/**  */
 	private java.util.Date createTime;
@@ -42,6 +41,10 @@ public class MusicGroupPaymentCalenderCourseSettings {
 	/**  */
 	private java.util.Date updateTime;
 
+	public void setStudentOptional(boolean studentOptional) {
+		isStudentOptional = studentOptional;
+	}
+
 	public String getName() {
 		return name;
 	}

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

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.ClassGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
@@ -470,5 +471,5 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @param classGroupIds
      * @return
      */
-    List<MusicGroupPaymentCalender> getDefaultPaymentCalender(List<Integer> classGroupIds);
+    Map<Integer,Map<String, MusicGroupOrganizationCourseSettingsDetail>> getDefaultPaymentCalender(List<Integer> classGroupIds);
 }

+ 0 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderCourseSettingsService.java

@@ -18,13 +18,4 @@ public interface MusicGroupPaymentCalenderCourseSettingsService extends BaseServ
      * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings>
      */
     Map<String, Integer> getMusicCourseSettingsWithStudents(String musicGroupId, List<Integer> studentIds);
-
-    /**
-     * 获取当前班级对应课程类型的价格
-     * @author zouxuan
-     * @param classGroupId
-     * @param courseType
-     * @return
-     */
-    MusicGroupOrganizationCourseSettingsDetail getClassLastSetting(Integer classGroupId, String courseType);
 }

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

@@ -31,7 +31,7 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	/**
 	 * 更新缴费信息
 	 */
-	Long merge(MusicGroupPaymentCalender musicGroupPaymentCalender);
+	String merge(MusicGroupPaymentCalenderDto musicGroupPaymentCalenderDto);
 	
 	/**
 	 * 

+ 26 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -25,6 +25,7 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.alibaba.fastjson.JSONArray;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.entity.*;
 import org.apache.commons.lang3.StringUtils;
@@ -182,6 +183,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Autowired
     private MusicGroupPaymentCalenderCourseSettingsService musicGroupPaymentCalenderCourseSettingsService;
     @Autowired
+    private MusicGroupOrganizationCourseSettingsDetailDao musicGroupOrganizationCourseSettingsDetailDao;
+    @Autowired
     private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
 
     @Override
@@ -3243,30 +3246,43 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     @Override
-    public List<MusicGroupPaymentCalender> getDefaultPaymentCalender(List<Integer> classGroupIds) {
+    public Map<Integer,Map<String,MusicGroupOrganizationCourseSettingsDetail>> getDefaultPaymentCalender(List<Integer> classGroupIds) {
         if(classGroupIds == null || classGroupIds.size() == 0){
             throw new BizException("参数校验失败");
         }
+        Map<Integer,Map<String,MusicGroupOrganizationCourseSettingsDetail>> resultMap = new HashMap<>();
+        //获取默认的排课时长
+        String courseDefaultMinutes = sysConfigDao.findConfigValue("music_course_default_minutes");
+        JSONObject jsonObject = JSON.parseObject(courseDefaultMinutes);
         //获取所选班级最大剩余课时
-        Map<String,Integer> map = MapUtil.convertIntegerMap(courseScheduleDao.findClassMaxCourseNumMap(classGroupIds));
+        Map<String,Long> map = MapUtil.convertIntegerMap(courseScheduleDao.findClassMaxCourseNumMap(classGroupIds));
         //获取每个班级对应课程类型最后一节课
         Set<String> courseTypes = map.keySet();
         for (Integer classGroupId : classGroupIds) {
+            Map<String,MusicGroupOrganizationCourseSettingsDetail> courseMap = new HashMap<>();
             //获取当前班级剩余课次
-            Map<String,Integer> subCourseNumMap = MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(classGroupId));
+            Map<String,Long> subCourseNumMap = MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(classGroupId));
             for (String courseType : courseTypes) {
-                Integer currentNum = subCourseNumMap.get(courseType);
-                Integer maxNum = map.get(courseType);
+                Long currentNum = subCourseNumMap.get(courseType);
+                if(currentNum == null){
+                    throw new BizException("所选班级课程类型不一致,请重新选择");
+                }
+                Long maxNum = map.get(courseType);
                 //如果当前课程类型不需要新增缴费项目
-                if(currentNum != null && currentNum >= maxNum){
+                if(currentNum >= maxNum){
                     continue;
                 }
-                MusicGroupOrganizationCourseSettingsDetail settingsDetail = musicGroupPaymentCalenderCourseSettingsService.getClassLastSetting(classGroupId,courseType);
+                Long subNum = maxNum - currentNum;
+                //生成缴费项目
+                MusicGroupOrganizationCourseSettingsDetail settingsDetail = musicGroupOrganizationCourseSettingsDetailDao.getClassLastSetting(classGroupId,courseType);
                 settingsDetail.setCourseType(CourseScheduleType.valueOf(courseType));
+                settingsDetail.setCourseTotalMinuties(Integer.parseInt(jsonObject.get(courseType).toString()) * subNum.intValue());
+                settingsDetail.setCourseCurrentPrice(settingsDetail.getCourseCurrentPrice().multiply(new BigDecimal(subNum)));
+                settingsDetail.setCourseOriginalPrice(settingsDetail.getCourseOriginalPrice().multiply(new BigDecimal(subNum)));
+                courseMap.put(courseType,settingsDetail);
             }
+            resultMap.put(classGroupId,courseMap);
         }
-        //获取最后一节课现价,原价
-        //生成缴费项目
-        return null;
+        return resultMap;
     }
 }

+ 0 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderCourseSettingsServiceImpl.java

@@ -48,9 +48,4 @@ public class MusicGroupPaymentCalenderCourseSettingsServiceImpl extends BaseServ
 		}
 		return result;
 	}
-
-	@Override
-	public MusicGroupOrganizationCourseSettingsDetail getClassLastSetting(Integer classGroupId, String courseType) {
-		return musicGroupPaymentCalenderCourseSettingsDao.getClassLastSetting(classGroupId,courseType);
-	}
 }

+ 190 - 92
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -149,7 +149,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		List<MusicGroupPaymentDateRange> musicGroupPaymentDateRangeList = musicGroupPaymentCalenderDto.getMusicGroupPaymentDateRangeList();
 
 		if ((paymentType == PaymentType.ADD_COURSE || payUserType == PayUserType.SCHOOL) && musicGroupPaymentDateRangeList.size() > 1) {
-			throw new BizException("临时加课和学校缴费不支持多周期缴费");
+			throw new BizException("[临时加课][学校缴费]不支持多周期缴费");
 		}
 
 		MusicGroup musicGroup = musicGroupDao.getLocked(musicGroupId);
@@ -162,9 +162,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			throw new BizException("请登录");
 		}
 		// 所有缴费项目已完成排课才能创建下一个缴费项目
-		List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao
-				.getUnusedPaymentCalenderWithMusicGroup(musicGroupId);
-		if (musicGroupPaymentCalenderDetailList != null && musicGroupPaymentCalenderDetailList.size() > 0) {
+		String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null);
+		if (StringUtils.isNoneBlank(orignBatchNo)) {
 			throw new BizException("当前乐团存在未排课的缴费项目,请先完成排课再操作");
 		}
 
@@ -404,67 +403,77 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public Long merge(MusicGroupPaymentCalender musicGroupPaymentCalender) {
+	public String merge(MusicGroupPaymentCalenderDto musicGroupPaymentCalenderDto) {
+		
+		String batchNo = musicGroupPaymentCalenderDto.getBatchNo();
 		
-		MusicGroupPaymentCalender originMusicGroupPaymentCalender = musicGroupPaymentCalenderDao.get(musicGroupPaymentCalender.getId());
-		if(originMusicGroupPaymentCalender == null){
-			throw new BizException("查询不到缴费记录");
+		List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
+		if(musicGroupPaymentCalenderList == null || musicGroupPaymentCalenderList.size() == 0){
+			throw new BizException("[批次号]参数错误");
 		}
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			throw new BizException("请登录");
+		
+		PaymentCalenderStatusEnum status = musicGroupPaymentCalenderList.get(0).getStatus();
+		if(status != PaymentCalenderStatusEnum.REJECT){
+			throw new BizException("只有[拒绝]状态的缴费才能修改");
 		}
-		//只有“拒绝”才能修改
-		if(originMusicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.REJECT){
-			throw new BizException("缴费记录只有被“审核拒绝”才能修改");
+
+		String musicGroupId = musicGroupPaymentCalenderDto.getMusicGroupId();
+
+		PaymentType paymentType = musicGroupPaymentCalenderDto.getPaymentType();
+
+		PayUserType payUserType = musicGroupPaymentCalenderDto.getPayUserType();
+
+		List<MusicGroupPaymentDateRange> musicGroupPaymentDateRangeList = musicGroupPaymentCalenderDto.getMusicGroupPaymentDateRangeList();
+
+		if ((paymentType == PaymentType.ADD_COURSE || payUserType == PayUserType.SCHOOL) && musicGroupPaymentDateRangeList.size() > 1) {
+			throw new BizException("[临时加课]和[学校缴费]不支持多周期缴费");
 		}
-		
-		String musicGroupId = musicGroupPaymentCalender.getMusicGroupId();
 
 		MusicGroup musicGroup = musicGroupDao.getLocked(musicGroupId);
-		
-		if(musicGroup == null){
+
+		if (musicGroup == null) {
 			throw new BizException("乐团查询失败,请检查参数");
 		}
-		//如果是进行中加学生,查看学员是否在团
-		if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
-			musicGroupPaymentCalender.setStudentIds(originMusicGroupPaymentCalender.getStudentIds());
-			StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(Integer.parseInt(musicGroupPaymentCalender.getStudentIds()),musicGroupId);
-			if(studentRegistration == null){
-				throw new BizException("修改失败:学员不存在或已退团");
-			}
-		}
-		
-		Date date = new Date();
-		
-		musicGroupPaymentCalender.setUpdateTime(date);
-		if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && musicGroupPaymentCalender.getPayUserType() == PayUserType.STUDENT) {
-			musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			throw new BizException("请登录");
 		}
-		if(musicGroupPaymentCalender.getPaymentType() != ADD_STUDENT){
-			int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(), musicGroupPaymentCalender.getPaymentValidStartDate(),
-					musicGroupPaymentCalender.getPaymentValidEndDate(), musicGroupPaymentCalender.getId());
-			if (count > 0) {
-				throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
+
+		// 不是进行中,只能创建一次缴费
+		if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS) {
+			List<MusicGroupPaymentCalender> list = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
+			if (list.size() > 0) {
+				throw new BizException("创建失败,已经存在缴费信息");
 			}
 		}
 		
-		//获取设置的课程
-		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalender.getMusicGroupPaymentCalenderCourseSettingsList();
+		List<Long> calenderIds = musicGroupPaymentCalenderList.stream().map(MusicGroupPaymentCalender :: getId).collect(Collectors.toList());
+		//删除原来数据
+		musicGroupPaymentCalenderDao.delByIds(calenderIds);
+		musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(calenderIds);
+
+		status = PaymentCalenderStatusEnum.NO;
+
+		Date date = new Date();
+
+		// 获取设置的课程
+		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalenderDto
+				.getMusicGroupPaymentCalenderCourseSettingsList();
 		if (musicGroupPaymentCalenderCourseSettingsList == null) {
 			musicGroupPaymentCalenderCourseSettingsList = new ArrayList<>();
 		}
-		if (musicGroupPaymentCalender.getPayUserType() == SCHOOL) {
-			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
+
+		if (payUserType == SCHOOL) {
+			status = PaymentCalenderStatusEnum.AUDITING;
 		} else {
-			if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY || musicGroupPaymentCalender.getPaymentType() == MUSIC_RENEW) {
+			if (paymentType == MUSIC_APPLY || paymentType == MUSIC_RENEW) {
 				// 当前缴费的课程费用
 				Map<CourseScheduleType, BigDecimal> currentCoursePrice = musicGroupPaymentCalenderCourseSettingsList.stream().collect(
 						Collectors
 								.toMap(MusicGroupPaymentCalenderCourseSettings::getCourseType, MusicGroupPaymentCalenderCourseSettings::getCourseCurrentPrice));
 
 				// 查询默认课程费用
-				Integer musicGroupOrganizationCourseSettingId = musicGroupPaymentCalender.getMusicGroupOrganizationCourseSettingId();
+				Integer musicGroupOrganizationCourseSettingId = musicGroupPaymentCalenderDto.getMusicGroupOrganizationCourseSettingId();
 				Map<CourseScheduleType, BigDecimal> defaultCoursePrice = musicGroupOrganizationCourseSettingsDetailDao
 						.queryByMusicGroupOrganizationCourseSettingsId(musicGroupOrganizationCourseSettingId)
 						.stream()
@@ -475,11 +484,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				// 相同类型的课程如果修改了课程费用,需要走审批
 				for (Entry<CourseScheduleType, BigDecimal> entry : currentCoursePrice.entrySet()) {
 					if (defaultCoursePrice.get(entry.getKey()).compareTo(entry.getValue()) != 0) {
-						musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
+						status = PaymentCalenderStatusEnum.AUDITING;
 						break;
 					}
 				}
-			} else if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_COURSE || musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
+			} else if (paymentType == PaymentType.ADD_COURSE || paymentType == PaymentType.ADD_STUDENT) {
 				// 如果是临时加课,是否审核是根据单价判断
 				for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
 					OrganizationCourseUnitPriceSettings defaultUnitPrice = organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseTypeAndChargeType(
@@ -487,54 +496,147 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					if (defaultUnitPrice == null) {
 						throw new BizException("请先设置分部课程类型单价");
 					}
-					if (courseSettings.getCourseCurrentPrice().divide(new BigDecimal(courseSettings.getCourseTotalMinuties()), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN)
+					if (courseSettings.getCourseCurrentPrice()
+							.divide(new BigDecimal(courseSettings.getCourseTotalMinuties()), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN)
 							.compareTo(defaultUnitPrice.getUnitPrice()) != 0) {
-						musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
+						status = PaymentCalenderStatusEnum.AUDITING;
 						break;
 					}
 				}
 			}
 		}
 
-		if (musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING) {
-			if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-			}else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
-			}else {
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
+		int times = musicGroupPaymentDateRangeList.size();
+
+		// 排序
+		Collections.sort(musicGroupPaymentDateRangeList, new Comparator<MusicGroupPaymentDateRange>() {
+
+			@Override
+			public int compare(MusicGroupPaymentDateRange o1, MusicGroupPaymentDateRange o2) {
+				return o1.getPaymentValidStartDate().compareTo(o2.getPaymentValidStartDate());
 			}
-			
-			//如果是进行中加学生
-			if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
-				addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettingsList);
+		});
+
+		for (int i = 0; i < musicGroupPaymentDateRangeList.size(); i++) {
+
+			MusicGroupPaymentDateRange musicGroupPaymentDateRange = musicGroupPaymentDateRangeList.get(i);
+
+			MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
+			musicGroupPaymentCalender.setAttribute1(musicGroupPaymentCalenderDto.getAttribute1());
+			musicGroupPaymentCalender.setAttribute2(musicGroupPaymentCalenderDto.getAttribute2());
+			musicGroupPaymentCalender.setDeadlinePaymentDate(musicGroupPaymentDateRange.getDeadlinePaymentDate());
+			musicGroupPaymentCalender.setIsGiveMusicNetwork(musicGroupPaymentCalenderDto.getIsGiveMusicNetwork());
+			musicGroupPaymentCalender.setMemo(musicGroupPaymentCalenderDto.getMemo());
+			musicGroupPaymentCalender.setMusicGroupId(musicGroupId);
+			musicGroupPaymentCalender.setMusicGroupOrganizationCourseSettingId(musicGroupPaymentCalenderDto.getMusicGroupOrganizationCourseSettingId());
+
+			List<MusicGroupPaymentCalenderCourseSettings> newCSList = new ArrayList<MusicGroupPaymentCalenderCourseSettings>(
+					musicGroupPaymentCalenderCourseSettingsList.size());
+
+			for (MusicGroupPaymentCalenderCourseSettings pccs : musicGroupPaymentCalenderCourseSettingsList) {
+
+				MusicGroupPaymentCalenderCourseSettings tempPccs = new MusicGroupPaymentCalenderCourseSettings();
+				try {
+					BeanUtils.copyProperties(tempPccs, pccs);
+				} catch (Exception e) {
+					throw new BizException("克隆对象出错", e);
+				}
+				if (i == 0) {
+					tempPccs.setCourseCurrentPrice(pccs.getCourseCurrentPrice().subtract(
+							pccs.getCourseCurrentPrice().divide(new BigDecimal(times)).setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(times - 1))));
+					tempPccs.setCourseOriginalPrice(pccs.getCourseOriginalPrice().subtract(
+							pccs.getCourseOriginalPrice().divide(new BigDecimal(times)).setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(times - 1))));
+					tempPccs.setCourseTotalMinuties(pccs.getCourseTotalMinuties() - pccs.getCourseTotalMinuties() / times * (times - 1));
+				} else {
+					tempPccs.setCourseCurrentPrice(pccs.getCourseCurrentPrice().divide(new BigDecimal(times)).setScale(2, BigDecimal.ROUND_DOWN));
+					tempPccs.setCourseOriginalPrice(pccs.getCourseOriginalPrice().divide(new BigDecimal(times)).setScale(2, BigDecimal.ROUND_DOWN));
+					tempPccs.setCourseTotalMinuties(pccs.getCourseTotalMinuties() / times);
+				}
+				newCSList.add(tempPccs);
 			}
+			musicGroupPaymentCalender.setMusicGroupPaymentCalenderCourseSettingsList(newCSList);
 
-		}else {
-			if(musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT){
-				musicGroupPaymentCalender.setExpectNum(1);
+			musicGroupPaymentCalender.setPaymentPattern(musicGroupPaymentCalenderDto.getPaymentPattern());
+			musicGroupPaymentCalender.setPaymentValidEndDate(musicGroupPaymentDateRange.getPaymentValidEndDate());
+			musicGroupPaymentCalender.setPaymentValidStartDate(musicGroupPaymentDateRange.getPaymentValidStartDate());
+			musicGroupPaymentCalender.setPaymentType(musicGroupPaymentCalenderDto.getPaymentType());
+			musicGroupPaymentCalender.setPayUserType(musicGroupPaymentCalenderDto.getPayUserType());
+			musicGroupPaymentCalender.setStartPaymentDate(musicGroupPaymentDateRange.getStartPaymentDate());
+			musicGroupPaymentCalender.setStudentIds(musicGroupPaymentCalenderDto.getStudentIds());
+			musicGroupPaymentCalender.setOperator(sysUser.getId());
+			musicGroupPaymentCalender.setCreateTime(date);
+			musicGroupPaymentCalender.setUpdateTime(date);
+			musicGroupPaymentCalender.setStatus(status);
+
+			if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && payUserType == PayUserType.STUDENT) {
+				musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
+			}
+			if (paymentType != ADD_STUDENT) {
+				int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(),
+						musicGroupPaymentCalender.getPaymentValidStartDate(), musicGroupPaymentCalender.getPaymentValidEndDate(), null);
+				if (count > 0) {
+					throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
+				}
+			}
+
+			if (paymentType == PaymentType.ADD_STUDENT) {
+				musicGroupPaymentCalender.setPayUserType(STUDENT);
+				musicGroupPaymentCalender.setIsGiveMusicNetwork(false);
+				if (musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING) {
+					musicGroupPaymentCalender.setExpectNum(1);
+				}
+			}
+			if (musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING) {
+				if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
+					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
+				} else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
+					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
+				} else {
+					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
+				}
+			}
+
+			status = musicGroupPaymentCalender.getStatus();
+
+			// 设置批次号
+			musicGroupPaymentCalender.setBatchNo(batchNo);
+			musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
+
+			List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
+					.getMusicGroupPaymentCalenderCourseSettingsList();
+
+			if (musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING) {
+				// 如果是进行中加学生
+				if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
+					addStudent(musicGroupPaymentCalender, currentMusicGroupPaymentCalenderCourseSettings);
+				}
 			}
-            Set<Integer> roleIds = new HashSet<>(1);
-            roleIds.add(SysUserRole.ADMINISTRATOR);
-            Organization organization = organizationDao.get(musicGroup.getOrganId());
-            sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, "", organization.getName(),musicGroup.getName());
-        }
+
+			if (currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
+				MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsDao.get(musicGroupPaymentCalender
+						.getMusicGroupOrganizationCourseSettingId());
+				for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : currentMusicGroupPaymentCalenderCourseSettings) {
+					musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
+					if (courseSettings != null) {
+						musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
+					}
+				}
+				musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
+			}
+		}
 
 		// 如果是报名,需要修改乐团状态
-		if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
-			int countAuditReject = musicGroupPaymentCalenderDao.countAuditReject(musicGroupPaymentCalender.getMusicGroupId(),musicGroupPaymentCalender.getId());
-			if(countAuditReject == 0){
-				if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT && musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT_FAILED) {
+		if (paymentType == MUSIC_APPLY) {
+			int countAuditReject = musicGroupPaymentCalenderDao.countAuditReject(musicGroupId, null);
+			if (countAuditReject == 0) {
+				if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT) {
 					throw new BizException("创建失败:缴费项目类型不匹配");
 				}
-				if(musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING){
+				if (status != PaymentCalenderStatusEnum.AUDITING) {
 					musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 					// 记录操作日志
 					musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 基础信息审核中)", sysUser.getId(), ""));
-					Set<Integer> roleIds = new HashSet<>(1);
-					roleIds.add(SysUserRole.SECTION_MANAGER);
-					sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
-				}else{
+				} else {
 					musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT);
 					// 记录操作日志
 					musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 费用审核中)", sysUser.getId(), ""));
@@ -543,24 +645,17 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				musicGroupDao.update(musicGroup);
 			}
 		}
-		
-		musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
 
-		musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-		
-		if(musicGroupPaymentCalenderCourseSettingsList.size() > 0){
-			MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsDao.get(musicGroupPaymentCalender
-					.getMusicGroupOrganizationCourseSettingId());
-			for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList) {
-				musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-				if (courseSettings != null) {
-					musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
-				}
-			}
-			musicGroupPaymentCalenderCourseSettingsDao.batchInsert(musicGroupPaymentCalenderCourseSettingsList);
+		if (status == PaymentCalenderStatusEnum.AUDITING) {
+			// 如果是审核中
+			Set<Integer> roleIds = new HashSet<>(1);
+			roleIds.add(SysUserRole.ADMINISTRATOR);
+			Organization organization = organizationDao.get(musicGroup.getOrganId());
+			sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()),
+					MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, "", organization.getName(), musicGroup.getName());
 		}
-		
-		return musicGroupPaymentCalender.getId();
+
+		return batchNo;
 	}
 
 	@Override
@@ -968,7 +1063,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 		musicGroupPaymentCalenderDao.delete(id);
 		musicGroupPaymentCalenderDetailDao.deleteByCalenderId(id);
-		musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(id);
+		
+		List<Long> calenderIds = new ArrayList<Long>();
+		calenderIds.add(id);
+		musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(calenderIds);
 	}
 
 	@Override

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

@@ -2273,7 +2273,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
             if (regCalender != null) {
                 musicGroupPaymentCalenderDao.delByGroupId(musicGroupId);
-                musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(regCalender.getId());
+                
+                List<Long> calenderIds = new ArrayList<Long>();
+        		calenderIds.add(regCalender.getId());
+                musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(calenderIds);
             }
         }
 

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

@@ -1006,7 +1006,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 
         //缴费详情 calender detail
         MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderService.findByMusicGroupRegCalender(studentRegistration.getMusicGroupId());
-        if (musicGroupRegCalender.getIsGiveMusicNetwork()) {
+        if (musicGroupRegCalender.getIsGiveMusicNetwork() != null && musicGroupRegCalender.getIsGiveMusicNetwork()) {
             //赠送网管课
             musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getRemainNetworkClassTimes() + 1);
         }

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

@@ -3352,12 +3352,12 @@
         SELECT COUNT(id_) FROM course_schedule WHERE new_course_id_=#{courseId}
     </select>
     <select id="querySubCourseNumMap" resultType="java.util.Map">
-        SELECT cs.type_ 'key',COUNT(cs.id_) 'value' FROM course_schedule cs
-        WHERE cs.class_group_id_ = #{classGroupId} AND CONCAT(cs.class_date_," ",cs.start_class_time_) > NOW()
+        SELECT cs.type_ 'key',COUNT(CASE WHEN (CONCAT(cs.class_date_," ",cs.start_class_time_) > NOW()) THEN 1 ELSE NULL END) 'value' FROM course_schedule cs
+        WHERE cs.class_group_id_ = #{classGroupId}
         GROUP BY cs.type_
     </select>
     <select id="findClassMaxCourseNumMap" resultType="java.util.Map">
-        SELECT c.type_ 'key',MAX(c.subCourseNum) 'vslue' FROM (SELECT cs.type_,COUNT(cs.id_) subCourseNum FROM course_schedule cs
+        SELECT c.type_ 'key',MAX(c.subCourseNum) 'value' FROM (SELECT cs.type_,COUNT(cs.id_) subCourseNum FROM course_schedule cs
         WHERE cs.class_group_id_ IN
         <foreach collection="classGroupIds" open="(" close=")" separator="," item="item">
             #{item}

+ 8 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupOrganizationCourseSettingsDetailMapper.xml

@@ -117,4 +117,12 @@
         SELECT * FROM music_group_organization_course_settings_detail
         where music_group_organization_course_settings_id_ = #{musicGroupOrganizationCourseSettingsId}
     </select>
+    <select id="getClassLastSetting" resultMap="MusicGroupOrganizationCourseSettingsDetail">
+        SELECT cssp.original_price_ course_original_price_,cssp.expect_price_ course_current_price_
+		FROM course_schedule cs
+		LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
+		WHERE cs.class_group_id_ = #{classGroupId} AND cs.type_ = #{courseType} AND cssp.original_price_ IS NOT NULL
+		ORDER BY cs.class_date_,cs.start_class_time_ DESC
+		LIMIT 1
+    </select>
 </mapper>

+ 4 - 8
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderCourseSettingsMapper.xml

@@ -123,7 +123,10 @@
 	</select>
 
 	<delete id="deleteByMusicGroupPaymentCalenderId">
-		DELETE FROM music_group_payment_calender_course_settings WHERE music_group_payment_calender_id_ = #{musicGroupPaymentCalenderId}
+		DELETE FROM music_group_payment_calender_course_settings WHERE music_group_payment_calender_id_ in 
+        <foreach collection="calenderIds" item="item" separator="," open="(" close=")">
+            #{item}
+        </foreach>
 	</delete>
 
 	<select id="getMusicGroupRegCalenderCourseSettings" resultMap="MusicGroupPaymentCalenderCourseSettings">
@@ -154,11 +157,4 @@
 		WHERE mgpc.batch_no_ = #{batchNo}
 		GROUP BY mgpccs.course_type_
 	</select>
-    <select id="getClassLastSetting" resultMap="MusicGroupPaymentCalenderCourseSettings">
-		SELECT cssp.original_price_,cssp.expect_price_,0 is_student_optional_ FROM course_schedule cs
-		LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
-		WHERE cs.class_group_id_ = #{classGroupId} AND cs.type_ = #{courseType}
-		ORDER BY cs.class_date_,cs.start_class_time_ DESC
-		LIMIT 1
-	</select>
 </mapper>

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -455,6 +455,9 @@
         SUM(mgpccs.course_total_minuties_) course_total_minuties_,
         SUM(mgpccs.course_original_price_) course_original_price_,SUM(mgpccs.course_current_price_) course_current_price_,
         MAX(mg.name_) music_group_name_,MAX(mg.organ_id_) organ_id_,MAX(mgpc.payment_pattern_)payment_pattern_
+        FROM music_group_payment_calender mgpc
+        LEFT JOIN music_group mg ON mg.id_ = mgpc.music_group_id_
+        LEFT JOIN music_group_payment_calender_course_settings mgpccs ON mgpc.id_ = mgpccs.music_group_payment_calender_id_
         <include refid="MusicGroupPaymentCalenderAuditDtoSql"/>
         GROUP BY mgpc.batch_no_
         ORDER BY create_time_ DESC

+ 4 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentStudentCourseDetailMapper.xml

@@ -153,8 +153,12 @@
             LEFT JOIN music_group_payment_student_course_detail mgpscd ON mgpscd.music_group_payment_calender_id_ = mgpc.id_
         WHERE
             mgpc.music_group_id_ = #{musicGroupId}
+            <if test="studentId != null">
             AND mgpscd.user_id_ = #{studentId}
+            </if>
+            <if test="courseType != null">
             AND mgpscd.course_type_ = #{courseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
         GROUP BY mgpc.batch_no_ HAVING SUM(mgpscd.used_course_minutes_) &lt;=0 ORDER BY MIN(mgpc.id_) LIMIT 1;
     </select>
 

+ 3 - 1
mec-im/src/main/java/com/ym/controller/RoomController.java

@@ -163,7 +163,7 @@ public class RoomController{
         } else if (data.getHandUpOn() != null) {
             result = roomService.controlDevice(data.getRoomId(), data.getUserId(), DeviceTypeEnum.HandUp, data.getHandUpOn());
         }else if (data.getPlaySongOn() != null) {
-            result = roomService.controlDevice(data.getRoomId(), data.getUserId(), DeviceTypeEnum.PlaySong, data.getPlaySongOn());
+            result = roomService.controlDevice(data.getRoomId(), data.getUserId(), DeviceTypeEnum.ExamSong, data.getPlaySongOn());
         } else {
             throw new ApiException(ErrorEnum.ERR_REQUEST_PARA_ERR);
         }
@@ -195,6 +195,8 @@ public class RoomController{
             result = roomService.syncDeviceState(data.getRoomId(), DeviceTypeEnum.MusicMode, data.getMusicModeOn());
         }  else if (data.getHandUpOn() != null) {
             result = roomService.syncDeviceState(data.getRoomId(), DeviceTypeEnum.HandUp, data.getHandUpOn());
+        }  else if (data.getPlaySongOn() != null) {
+            result = roomService.syncDeviceState(data.getRoomId(), DeviceTypeEnum.ExamSong, data.getPlaySongOn());
         } else {
             throw new ApiException(ErrorEnum.ERR_REQUEST_PARA_ERR);
         }

+ 1 - 1
mec-im/src/main/java/com/ym/pojo/DeviceTypeEnum.java

@@ -8,5 +8,5 @@ public enum DeviceTypeEnum {
     Camera,
     MusicMode,
     HandUp,
-    PlaySong,
+    ExamSong,
 }

+ 6 - 2
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -771,7 +771,7 @@ public class RoomServiceImpl implements RoomService {
                 roomMemberDao.updateMicByRidAndUid(roomId, userId, false);
             } else if (typeEnum.equals(DeviceTypeEnum.HandUp)){
                 roomMemberDao.updateHandByRidAndUid(roomId, userId, false);
-            } else if (typeEnum.equals(DeviceTypeEnum.PlaySong)){
+            } else if (typeEnum.equals(DeviceTypeEnum.ExamSong)){
                 long scheduleId = Long.parseLong(roomId.substring(1));
                 ExamSongDownloadData msg;
                 String examJson = courseScheduleStudentPaymentDao.getExamJsonByCourseIdAndUserId(scheduleId, authUser.getId());
@@ -825,6 +825,10 @@ public class RoomServiceImpl implements RoomService {
             for (RoomMember e:roomMembers) {
                 controlDevice(data.getRoomId(), e.getUid(), DeviceTypeEnum.MusicMode, data.getMusicModeOn());
             }
+        } else if (data.getPlaySongOn() != null) {
+            for (RoomMember e:roomMembers) {
+                controlDevice(data.getRoomId(), e.getUid(), DeviceTypeEnum.ExamSong, data.getMusicModeOn());
+            }
         } else {
             throw new ApiException(ErrorEnum.ERR_REQUEST_PARA_ERR);
         }
@@ -889,7 +893,7 @@ public class RoomServiceImpl implements RoomService {
             result = roomMemberDao.updateMicByRidAndUid(roomId, userId, enable);
         } else if (type.equals(DeviceTypeEnum.HandUp)){
             result = roomMemberDao.updateHandByRidAndUid(roomId, userId, enable);
-        } else if (type.equals(DeviceTypeEnum.PlaySong)){
+        } else if (type.equals(DeviceTypeEnum.ExamSong)){
             long scheduleId = Long.parseLong(roomId.substring(1));
             ExamSongDownloadData msg;
             String examJson = courseScheduleStudentPaymentDao.getExamJsonByCourseIdAndUserId(scheduleId, authUser.getId());

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -344,7 +344,7 @@ public class ClassGroupController extends BaseController {
     @ApiOperation(value = "进行中乐团-修改-班级详情-学员班级调整-生成默认缴费信息")
     @GetMapping("/getDefaultPaymentCalender")
     @PreAuthorize("@pcs.hasPermissions('classGroup/getDefaultPaymentCalender')")
-    public HttpResponseResult studentClassAuditDetail(List<Integer> classGroupIds){
+    public HttpResponseResult studentClassAuditDetail(@RequestBody List<Integer> classGroupIds){
         return succeed(classGroupService.getDefaultPaymentCalender(classGroupIds));
     }
 }

+ 3 - 4
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java

@@ -28,7 +28,6 @@ import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto;
 import com.ym.mec.biz.dal.entity.Employee;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
@@ -89,10 +88,10 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     @ApiOperation(value = "修改乐团缴费时间")
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/update')")
-    public Object update(@RequestBody MusicGroupPaymentCalender paymentCalender) {
-    	Long musicGroupPaymentCalenderId = musicGroupPaymentCalenderService.merge(paymentCalender);
+    public Object update(@RequestBody MusicGroupPaymentCalenderDto musicGroupPaymentCalenderDto) {
+    	String batchNo = musicGroupPaymentCalenderService.merge(musicGroupPaymentCalenderDto);
         ModelMap map = new ModelMap();
-        map.put("musicGroupPaymentCalenderId", musicGroupPaymentCalenderId);
+        map.put("musicGroupPaymentCalenderBatchNo", batchNo);
         return succeed();
     }