yonge преди 4 години
родител
ревизия
2b897f7e2f

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationCourseUnitPriceSettingsDao.java

@@ -14,10 +14,12 @@ public interface OrganizationCourseUnitPriceSettingsDao extends BaseDAO<Integer,
 	 * 根据分部编号以及课程类型查询对象
 	 * @param organId 分部编号
 	 * @param courseType 课程类型
+	 * @param chargeTypeId 收费类型编号
 	 * @return
 	 */
-	OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseType(@Param("organId") Integer organId, @Param("courseScheduleType") CourseScheduleType courseType);
-	
+	OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseTypeAndChargeType(@Param("organId") Integer organId,
+			@Param("courseScheduleType") CourseScheduleType courseType, @Param("chargeTypeId") Integer chargeTypeId);
+
 	/**
 	 * 批量新增
 	 * @param organizationCourseUnitPriceSettingsList

+ 12 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/page/OrganizationCourseUnitPriceSettingsQueryInfo.java

@@ -9,10 +9,13 @@ public class OrganizationCourseUnitPriceSettingsQueryInfo extends QueryInfo {
 
 	@ApiModelProperty(value = "分部编号", required = false)
 	private Integer organId;
-	
+
 	@ApiModelProperty(value = "课程类型", required = false)
 	private CourseScheduleType courseScheduleType;
 
+	@ApiModelProperty(value = "乐团收费类型编号", required = false)
+	private Integer chargeTypeId;
+
 	public Integer getOrganId() {
 		return organId;
 	}
@@ -28,4 +31,12 @@ public class OrganizationCourseUnitPriceSettingsQueryInfo extends QueryInfo {
 	public void setCourseScheduleType(CourseScheduleType courseScheduleType) {
 		this.courseScheduleType = courseScheduleType;
 	}
+
+	public Integer getChargeTypeId() {
+		return chargeTypeId;
+	}
+
+	public void setChargeTypeId(Integer chargeTypeId) {
+		this.chargeTypeId = chargeTypeId;
+	}
 }

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

@@ -28,7 +28,7 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	/**
 	 * 更新缴费信息
 	 */
-	int update(MusicGroupPaymentCalender musicGroupPaymentCalender);
+	Long merge(MusicGroupPaymentCalender musicGroupPaymentCalender);
 	
 	/**
 	 * 自动更新付款日历记录状态

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

@@ -19,7 +19,8 @@ public interface OrganizationCourseUnitPriceSettingsService extends BaseService<
 	 * 根据分部编号以及课程类型查询对象
 	 * @param organId 分部编号
 	 * @param courseType 课程类型
+	 * @param chargeTypeId 收费类型编号
 	 * @return
 	 */
-	OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseType(Integer organId, CourseScheduleType courseType);
+	OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseTypeAndChargeType(Integer organId, CourseScheduleType courseType, Integer chargeTypeId);
 }

+ 130 - 113
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -10,6 +10,7 @@ import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
@@ -26,6 +27,7 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -60,6 +62,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	private MusicGroupOrganizationCourseSettingsDao musicGroupOrganizationCourseSettingsDao;
 	
 	@Autowired
+	private OrganizationCourseUnitPriceSettingsDao organizationCourseUnitPriceSettingsDao;
+	
+	@Autowired
 	private IdGeneratorService idGeneratorService;
 	
 	@Autowired
@@ -83,20 +88,27 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public Long create(MusicGroupPaymentCalender musicGroupPaymentCalender) {
-		
+
 		String musicGroupId = musicGroupPaymentCalender.getMusicGroupId();
 
 		MusicGroup musicGroup = musicGroupDao.getLocked(musicGroupId);
-		
-		if(musicGroup == null){
+
+		if (musicGroup == null) {
 			throw new BizException("乐团查询失败,请检查参数");
 		}
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if(sysUser == null){
+		if (sysUser == null) {
 			throw new BizException("请登录");
 		}
+		//不是进行中,只能创建一次缴费
+		if(musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS){
+			List<MusicGroupPaymentCalender> list = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
+			if(list.size() > 0){
+				throw new BizException("创建失败,已经存在缴费信息");
+			}
+		}
+		
 		Date date = new Date();
-		Map<Integer, String> pushUserMap = new HashMap<>();
 		List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = new ArrayList<>();
 		musicGroupPaymentCalender.setOperator(sysUser.getId());
 		musicGroupPaymentCalender.setCreateTime(date);
@@ -111,29 +123,52 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (count > 0) {
 			throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
 		}
-		//获取设置的课程
-		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalender.getMusicGroupPaymentCalenderCourseSettingsList();
-		if(musicGroupPaymentCalenderCourseSettingsList == null){
+		// 获取设置的课程
+		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalender
+				.getMusicGroupPaymentCalenderCourseSettingsList();
+		if (musicGroupPaymentCalenderCourseSettingsList == null) {
 			musicGroupPaymentCalenderCourseSettingsList = new ArrayList<>();
 		}
-		//当前缴费的课程费用
-		Map<CourseScheduleType,BigDecimal> currentCoursePrice = musicGroupPaymentCalenderCourseSettingsList.stream().
-				collect(Collectors.toMap(MusicGroupPaymentCalenderCourseSettings :: getCourseType, MusicGroupPaymentCalenderCourseSettings :: getCourseCurrentPrice));
-
-		if(musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY || musicGroupPaymentCalender.getPaymentType() == MUSIC_RENEW){
-			//查询默认课程费用
-			Integer musicGroupOrganizationCourseSettingId = musicGroupPaymentCalender.getMusicGroupOrganizationCourseSettingId();
-			Map<CourseScheduleType, BigDecimal> defaultCoursePrice = musicGroupOrganizationCourseSettingsDetailDao.queryByMusicGroupOrganizationCourseSettingsId(musicGroupOrganizationCourseSettingId).stream().
-					collect(Collectors.toMap(MusicGroupOrganizationCourseSettingsDetail :: getCourseType, MusicGroupOrganizationCourseSettingsDetail :: getCourseCurrentPrice));
-
-			//相同类型的课程如果修改了课程费用,需要走审批
-			for(Entry<CourseScheduleType, BigDecimal> entry : currentCoursePrice.entrySet()){
-				if(defaultCoursePrice.get(entry.getKey()).compareTo(entry.getValue()) != 0){
-					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
+		if (musicGroupPaymentCalender.getPayUserType() == PayUserType.SCHOOL) {
+			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
+		} else {
+			if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY || musicGroupPaymentCalender.getPaymentType() == MUSIC_RENEW) {
+				// 当前缴费的课程费用
+				Map<CourseScheduleType, BigDecimal> currentCoursePrice = musicGroupPaymentCalenderCourseSettingsList.stream().collect(
+						Collectors
+								.toMap(MusicGroupPaymentCalenderCourseSettings::getCourseType, MusicGroupPaymentCalenderCourseSettings::getCourseCurrentPrice));
+
+				// 查询默认课程费用
+				Integer musicGroupOrganizationCourseSettingId = musicGroupPaymentCalender.getMusicGroupOrganizationCourseSettingId();
+				Map<CourseScheduleType, BigDecimal> defaultCoursePrice = musicGroupOrganizationCourseSettingsDetailDao
+						.queryByMusicGroupOrganizationCourseSettingsId(musicGroupOrganizationCourseSettingId)
+						.stream()
+						.collect(
+								Collectors.toMap(MusicGroupOrganizationCourseSettingsDetail::getCourseType,
+										MusicGroupOrganizationCourseSettingsDetail::getCourseCurrentPrice));
+
+				// 相同类型的课程如果修改了课程费用,需要走审批
+				for (Entry<CourseScheduleType, BigDecimal> entry : currentCoursePrice.entrySet()) {
+					if (defaultCoursePrice.get(entry.getKey()).compareTo(entry.getValue()) != 0) {
+						musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
+						break;
+					}
+				}
+			} else if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_COURSE) {
+				// 如果是临时加课,是否审核是根据单价判断
+				for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
+					OrganizationCourseUnitPriceSettings defaultUnitPrice = organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseTypeAndChargeType(
+							musicGroup.getOrganId(), courseSettings.getCourseType(), musicGroup.getChargeTypeId());
+					if (defaultUnitPrice == null) {
+						throw new BizException("请先设置分部课程类型单价");
+					}
+					if (courseSettings.getCourseCurrentPrice().divide(new BigDecimal(courseSettings.getCourseTotalMinuties()))
+							.compareTo(defaultUnitPrice.getUnitPrice()) != 0) {
+						musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
+						break;
+					}
 				}
 			}
-		}else {
-			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
 		}
 
 		if (musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING) {
@@ -144,28 +179,29 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			} else {
 				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
 			}
-			
-			//如果是报名,需要修改乐团状态
+
+			// 如果是报名,需要修改乐团状态
 			if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
-				if(musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT){
+				if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT) {
 					throw new BizException("创建失败:缴费项目类型不匹配");
 				}
 				musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 				musicGroup.setUpdateTime(date);
-				//记录操作日志
+				// 记录操作日志
 				musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 审核中)", sysUser.getId(), ""));
 				musicGroupDao.update(musicGroup);
 			}
 		}
 
 		musicGroupPaymentCalender.setExpectNum(0);
-		//设置批次号
-		musicGroupPaymentCalender.setBatchNo(idGeneratorService.generatorId()+"");
+		// 设置批次号
+		musicGroupPaymentCalender.setBatchNo(idGeneratorService.generatorId() + "");
 		musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
 
-		if(musicGroupPaymentCalenderCourseSettingsList.size() > 0){
-			MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsDao.get(musicGroupPaymentCalender.getMusicGroupOrganizationCourseSettingId());
-			for(MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList){
+		if (musicGroupPaymentCalenderCourseSettingsList.size() > 0) {
+			MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsDao.get(musicGroupPaymentCalender
+					.getMusicGroupOrganizationCourseSettingId());
+			for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList) {
 				musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
 				musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
 			}
@@ -175,14 +211,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (musicGroupPaymentCalenderDetailList.size() > 0) {
 			musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
 		}
-		// 发送续费通知
-		if (pushUserMap.size() > 0) {
-			String configValue = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-			String memo = "4?" + configValue + "/#/renew?musicGroupId=" + musicGroup.getId();
-
-			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE,
-					pushUserMap, null, 0, memo, "STUDENT", musicGroup.getName());
-		}
 		return musicGroupPaymentCalender.getId();
 	}
 
@@ -202,14 +230,18 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public int update(MusicGroupPaymentCalender musicGroupPaymentCalender) {
+	public Long merge(MusicGroupPaymentCalender musicGroupPaymentCalender) {
 		
-		MusicGroupPaymentCalender orginMusicGroupPaymentCalender = musicGroupPaymentCalenderDao.get(musicGroupPaymentCalender.getId());
-		if(orginMusicGroupPaymentCalender == null){
+		MusicGroupPaymentCalender originMusicGroupPaymentCalender = musicGroupPaymentCalenderDao.get(musicGroupPaymentCalender.getId());
+		if(originMusicGroupPaymentCalender == null){
 			throw new BizException("查询不到缴费记录");
 		}
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			throw new BizException("请登录");
+		}
 		//只有“拒绝”才能修改
-		if(orginMusicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.REJECT){
+		if(originMusicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.REJECT){
 			throw new BizException("缴费记录只有被“审核拒绝”才能修改");
 		}
 		
@@ -224,7 +256,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		Date date = new Date();
 		
 		musicGroupPaymentCalender.setUpdateTime(date);
-		if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null) {
+		if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && musicGroupPaymentCalender.getPayUserType() == PayUserType.STUDENT) {
 			musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 		}
 		int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPaymentValidStartDate(),
@@ -234,27 +266,53 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		}
 		
 		//获取设置的课程
-		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalender.getMusicGroupPaymentCalenderCourseSettingsList();
-		if(musicGroupPaymentCalenderCourseSettingsList == null){
-			musicGroupPaymentCalenderCourseSettingsList = new ArrayList<MusicGroupPaymentCalenderCourseSettings>();
+		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalender
+				.getMusicGroupPaymentCalenderCourseSettingsList();
+		if (musicGroupPaymentCalenderCourseSettingsList == null) {
+			musicGroupPaymentCalenderCourseSettingsList = new ArrayList<>();
 		}
-		
-		//查询默认课程费用
-		Integer musicGroupOrganizationCourseSettingId = musicGroupPaymentCalender.getMusicGroupOrganizationCourseSettingId();
-		Map<CourseScheduleType, BigDecimal> defaultCoursePrice = musicGroupOrganizationCourseSettingsDetailDao.queryByMusicGroupOrganizationCourseSettingsId(musicGroupOrganizationCourseSettingId).stream().collect(Collectors.toMap(MusicGroupOrganizationCourseSettingsDetail :: getCourseType, MusicGroupOrganizationCourseSettingsDetail :: getCourseCurrentPrice));
-		
-		//当前缴费的课程费用
-		Map<CourseScheduleType,BigDecimal> currentCoursePrice = musicGroupPaymentCalenderCourseSettingsList.stream().collect(Collectors.toMap(MusicGroupPaymentCalenderCourseSettings :: getCourseType, MusicGroupPaymentCalenderCourseSettings :: getCourseCurrentPrice));
-		
-		BigDecimal totalPrice = new BigDecimal(0);
-		//相同类型的课程如果修改了课程费用,需要走审批
-		for(Entry<CourseScheduleType, BigDecimal> entry : currentCoursePrice.entrySet()){
-			if(defaultCoursePrice.get(entry.getKey()).compareTo(entry.getValue()) != 0){
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
+		if (musicGroupPaymentCalender.getPayUserType() == PayUserType.SCHOOL) {
+			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
+		} else {
+			if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY || musicGroupPaymentCalender.getPaymentType() == MUSIC_RENEW) {
+				// 当前缴费的课程费用
+				Map<CourseScheduleType, BigDecimal> currentCoursePrice = musicGroupPaymentCalenderCourseSettingsList.stream().collect(
+						Collectors
+								.toMap(MusicGroupPaymentCalenderCourseSettings::getCourseType, MusicGroupPaymentCalenderCourseSettings::getCourseCurrentPrice));
+
+				// 查询默认课程费用
+				Integer musicGroupOrganizationCourseSettingId = musicGroupPaymentCalender.getMusicGroupOrganizationCourseSettingId();
+				Map<CourseScheduleType, BigDecimal> defaultCoursePrice = musicGroupOrganizationCourseSettingsDetailDao
+						.queryByMusicGroupOrganizationCourseSettingsId(musicGroupOrganizationCourseSettingId)
+						.stream()
+						.collect(
+								Collectors.toMap(MusicGroupOrganizationCourseSettingsDetail::getCourseType,
+										MusicGroupOrganizationCourseSettingsDetail::getCourseCurrentPrice));
+
+				// 相同类型的课程如果修改了课程费用,需要走审批
+				for (Entry<CourseScheduleType, BigDecimal> entry : currentCoursePrice.entrySet()) {
+					if (defaultCoursePrice.get(entry.getKey()).compareTo(entry.getValue()) != 0) {
+						musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
+						break;
+					}
+				}
+			} else if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_COURSE) {
+				// 如果是临时加课,是否审核是根据单价判断
+				for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
+					OrganizationCourseUnitPriceSettings defaultUnitPrice = organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseTypeAndChargeType(
+							musicGroup.getOrganId(), courseSettings.getCourseType(), musicGroup.getChargeTypeId());
+					if (defaultUnitPrice == null) {
+						throw new BizException("请先设置分部课程类型单价");
+					}
+					if (courseSettings.getCourseCurrentPrice().divide(new BigDecimal(courseSettings.getCourseTotalMinuties()))
+							.compareTo(defaultUnitPrice.getUnitPrice()) != 0) {
+						musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
+						break;
+					}
+				}
 			}
-			totalPrice.add(entry.getValue());
 		}
-		
+
 		if (musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING) {
 			if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
 				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
@@ -263,70 +321,29 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			} else {
 				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
 			}
-			
-			//如果是报名,需要修改乐团状态
+
+			// 如果是报名,需要修改乐团状态
 			if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
+				if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT) {
+					throw new BizException("创建失败:缴费项目类型不匹配");
+				}
 				musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 				musicGroup.setUpdateTime(date);
+				// 记录操作日志
+				musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 审核中)", sysUser.getId(), ""));
 				musicGroupDao.update(musicGroup);
 			}
 		}
-		List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = new ArrayList<MusicGroupPaymentCalenderDetail>();
-		Map<Integer, String> pushUserMap = new HashMap<Integer, String>();
-
-		musicGroupPaymentCalender.setExpectNum(0);
-		if(StringUtils.isNoneBlank(musicGroupPaymentCalender.getStudentIds())){
-			String[] sutdentIdList = musicGroupPaymentCalender.getStudentIds().split(",");
-			musicGroupPaymentCalender.setExpectNum(sutdentIdList.length);
-			
-			if (musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.OPEN) {
-				for(String studentId : sutdentIdList){
-					pushUserMap.put(Integer.parseInt(studentId), studentId);
-				}
-			}
-			
-			//删除历史数据
-			musicGroupPaymentCalenderDetailDao.deleteByCalenderId(musicGroupPaymentCalender.getId());
-			
-			//创建缴费明细
-			MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
-			for(String studentId : sutdentIdList){
-				musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
-				musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-				musicGroupPaymentCalenderDetail.setCreateTime(date);
-				musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice);
-				musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
-				musicGroupPaymentCalenderDetail.setUpdateTime(date);
-				musicGroupPaymentCalenderDetail.setUserId(Integer.parseInt(studentId));
-				musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
-				musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
-				
-				musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
-			}
-		}
 		
 		musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
 
-		if (musicGroupPaymentCalenderDetailList.size() > 0) {
-			musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
-		}
-		
 		musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
 		
 		if(musicGroupPaymentCalenderCourseSettingsList.size() > 0){
 			musicGroupPaymentCalenderCourseSettingsDao.batchInsert(musicGroupPaymentCalenderCourseSettingsList);
 		}
 		
-		// 发送续费通知
-		if (pushUserMap.size() > 0) {
-			String configValue = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-			String memo = "4?" + configValue + "/#/renew?musicGroupId=" + musicGroup.getId();
-
-			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE,
-					pushUserMap, null, 0, memo, "STUDENT", musicGroup.getName());
-		}
-		
-		return 1;
+		return musicGroupPaymentCalender.getId();
 	}
 
 	@Override

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

@@ -30,8 +30,8 @@ public class OrganizationCourseUnitPriceSettingsServiceImpl extends BaseServiceI
 	}
 
 	@Override
-	public OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseType(Integer organId, CourseScheduleType courseType) {
-		return organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseType(organId, courseType);
+	public OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseTypeAndChargeType(Integer organId, CourseScheduleType courseType, Integer chargeTypeId) {
+		return organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseTypeAndChargeType(organId, courseType, chargeTypeId);
 	}
 	
 }

+ 8 - 1
mec-biz/src/main/resources/config/mybatis/OrganizationCourseUnitPriceSettingsMapper.xml

@@ -88,6 +88,9 @@
 			<if test="courseScheduleType != null">
 				and ups.course_type_ = #{courseScheduleType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
+			<if test="chargeTypeId != null">
+				and ups.charge_type_id_ = #{chargeTypeId}
+			</if>
 		</where>
 		ORDER BY ups.id_ desc
 		<include refid="global.limit" />
@@ -103,10 +106,14 @@
 			<if test="courseScheduleType != null">
 				and ups.course_type_ = #{courseScheduleType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
+			<if test="chargeTypeId != null">
+				and ups.charge_type_id_ = #{chargeTypeId}
+			</if>
 		</where>
 	</select>
 	
-	<select id="queryByOrganIdAndCourseType" resultMap="OrganizationCourseUnitPriceSettings" parameterType="map">
+	<select id="queryByOrganIdAndCourseTypeAndChargeType" resultMap="OrganizationCourseUnitPriceSettings" parameterType="map">
 		SELECT * FROM organization_course_unit_price_settings WHERE organ_id_ = #{organId} and course_type_ = #{courseScheduleType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+		and charge_type_id_ = #{chargeTypeId}
 	</select>
 </mapper>

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

@@ -76,7 +76,9 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/update')")
     public Object update(MusicGroupPaymentCalender paymentCalender) {
-        musicGroupPaymentCalenderService.update(paymentCalender);
+    	Long musicGroupPaymentCalenderId = musicGroupPaymentCalenderService.merge(paymentCalender);
+        ModelMap map = new ModelMap();
+        map.put("musicGroupPaymentCalenderId", musicGroupPaymentCalenderId);
         return succeed();
     }
 

+ 3 - 2
mec-web/src/main/java/com/ym/mec/web/controller/OrganizationCourseUnitPriceSettingsController.java

@@ -42,8 +42,9 @@ public class OrganizationCourseUnitPriceSettingsController extends BaseControlle
 	@PreAuthorize("@pcs.hasPermissions('organizationCourseUnitPriceSettings/insert')")
 	public Object insert(@RequestBody List<OrganizationCourseUnitPriceSettings> organizationCourseUnitPriceSettingsList) {
 		for (OrganizationCourseUnitPriceSettings organizationCourseUnitPriceSettings : organizationCourseUnitPriceSettingsList) {
-			OrganizationCourseUnitPriceSettings originalObj = organizationCourseUnitPriceSettingsService.queryByOrganIdAndCourseType(
-					organizationCourseUnitPriceSettings.getOrganId(), organizationCourseUnitPriceSettings.getCourseType());
+			OrganizationCourseUnitPriceSettings originalObj = organizationCourseUnitPriceSettingsService.queryByOrganIdAndCourseTypeAndChargeType(
+					organizationCourseUnitPriceSettings.getOrganId(), organizationCourseUnitPriceSettings.getCourseType(),
+					organizationCourseUnitPriceSettings.getChargeTypeId());
 			if (originalObj != null) {
 				return failed("当前分部已经存在该课程类型的单价");
 			}