Browse Source

系统收费优化

zouxuan 4 năm trước cách đây
mục cha
commit
d6e0df1434

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

@@ -52,6 +52,16 @@ public class MusicGroupPaymentCalenderDto {
 	//会员等级编号
 	private Integer memberRankSettingId;
 
+	private Boolean autoCreate = false;
+
+	public Boolean getAutoCreate() {
+		return autoCreate;
+	}
+
+	public void setAutoCreate(Boolean autoCreate) {
+		this.autoCreate = autoCreate;
+	}
+
 	public Integer getMemberValidDate() {
 		return memberValidDate;
 	}

+ 8 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -204,11 +204,14 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE && musicGroupPaymentDateRangeList.size() > 1) {
 			throw new BizException("创建缴费失败:会员收费乐团不支持多周期缴费");
 		}
-		// 所有缴费项目已完成排课才能创建下一个缴费项目
-		String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null,musicGroupPaymentCalenderDto.getIgnoreBatchNoList());
-		if (StringUtils.isNoneBlank(orignBatchNo)) {
-			if(StringUtils.isEmpty(musicGroupPaymentCalenderDto.getBatchNo()) || !musicGroupPaymentCalenderDto.getBatchNo().equals(orignBatchNo)){
-				throw new BizException("当前乐团存在未排课的缴费项目,请先完成排课再操作");
+		//是否自动创建
+		if(!musicGroupPaymentCalenderDto.getAutoCreate()){
+			// 所有缴费项目已完成排课才能创建下一个缴费项目
+			String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null,musicGroupPaymentCalenderDto.getIgnoreBatchNoList());
+			if (StringUtils.isNoneBlank(orignBatchNo)) {
+				if(StringUtils.isEmpty(musicGroupPaymentCalenderDto.getBatchNo()) || !musicGroupPaymentCalenderDto.getBatchNo().equals(orignBatchNo)){
+					throw new BizException("当前乐团存在未排课的缴费项目,请先完成排课再操作");
+				}
 			}
 		}
 

+ 6 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSchoolTermCourseDetailServiceImpl.java

@@ -279,11 +279,11 @@ public class MusicGroupSchoolTermCourseDetailServiceImpl extends BaseServiceImpl
 			for (String musicGroupId : studentMusicMap.keySet()) {
 				MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 				// 所有缴费项目已完成排课才能创建下一个缴费项目
-				String orignBatchNo = musicGroupPaymentStudentCourseDetailService.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null,null);
-				if (StringUtils.isNoneBlank(orignBatchNo)) {
-					logger.error("自动创建缴费项目失败,{} 乐团存在未排课的缴费项目",musicGroup.getName());
-					continue;
-				}
+//				String orignBatchNo = musicGroupPaymentStudentCourseDetailService.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null,null);
+//				if (StringUtils.isNoneBlank(orignBatchNo)) {
+//					logger.error("自动创建缴费项目失败,{} 乐团存在未排课的缴费项目",musicGroup.getName());
+//					continue;
+//				}
 				MemberFeeSetting memberFee = memberFeeSettingDao.findByRankIdAndOrganId(musicGroup.getOrganId(), memberRankSetting.getId());
 				if(memberFee == null){
 					Organization organization = organizationDao.get(musicGroup.getOrganId());
@@ -300,6 +300,7 @@ public class MusicGroupSchoolTermCourseDetailServiceImpl extends BaseServiceImpl
 				musicGroupPaymentCalenderDto.setPaymentType(MusicGroupPaymentCalender.PaymentType.MUSIC_RENEW);
 				musicGroupPaymentCalenderDto.setPaymentPattern(1);
 				musicGroupPaymentCalenderDto.setMemberPaymentAmount(memberFee.getCurrentHalfYearFee().setScale(0, BigDecimal.ROUND_HALF_UP));
+				musicGroupPaymentCalenderDto.setAutoCreate(true);
 				List<MusicGroupPaymentCalenderDto.MusicGroupPaymentDateRange> musicGroupPaymentDateRangeList = new ArrayList<>();
 				MusicGroupPaymentCalenderDto.MusicGroupPaymentDateRange range = new MusicGroupPaymentCalenderDto().new MusicGroupPaymentDateRange();
 				range.setStartPaymentDate(date);