|
@@ -26,6 +26,7 @@ import org.apache.commons.beanutils.BeanUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.BeanFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Isolation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -50,6 +51,8 @@ import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
@Service
|
|
|
public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalender> implements MusicGroupPaymentCalenderService {
|
|
|
|
|
@@ -59,46 +62,32 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
|
|
|
@Autowired
|
|
|
private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
- private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
|
|
|
-
|
|
|
+ private MusicGroupPaymentCalenderCourseSettingsService musicGroupPaymentCalenderCourseSettingsService;
|
|
|
@Autowired
|
|
|
private MusicGroupOrganizationCourseSettingsDetailDao musicGroupOrganizationCourseSettingsDetailDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
private MusicGroupOrganizationCourseSettingsService musicGroupOrganizationCourseSettingsService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private OrganizationCourseUnitPriceSettingsDao organizationCourseUnitPriceSettingsDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
private MusicGroupSchoolTermCourseDetailDao musicGroupSchoolTermCourseDetailDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
private MusicGroupSchoolTermStudentCourseDetailDao musicGroupSchoolTermStudentCourseDetailDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
private IdGeneratorService idGeneratorService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private ClassGroupService classGroupService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private MusicGroupDao musicGroupDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
private ClassGroupDao classGroupDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
private CourseScheduleDao courseScheduleDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
private TeacherAttendanceDao teacherAttendanceDao;
|
|
|
@Autowired
|
|
@@ -127,7 +116,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
private StudentRegistrationDao studentRegistrationDao;
|
|
|
@Autowired
|
|
|
private GroupEventSource groupEventSource;
|
|
|
-
|
|
|
@Autowired
|
|
|
private StudentPaymentOrderDao studentPaymentOrderDao;
|
|
|
@Autowired
|
|
@@ -138,8 +126,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
private StudentService studentService;
|
|
|
@Autowired
|
|
|
private CloudTeacherOrderDao cloudTeacherOrderDao;
|
|
|
- @Autowired
|
|
|
- private MusicGroupPaymentCalenderBaseService musicGroupPaymentCalenderBaseService;
|
|
|
+ @Resource(name = "musicRepairService")
|
|
|
+ private MusicGroupPaymentCalenderBaseService musicRepairService;
|
|
|
+ @Resource(name = "memberCalenderService")
|
|
|
+ private MusicGroupPaymentCalenderBaseService memberCalenderService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, MusicGroupPaymentCalender> getDAO() {
|
|
@@ -474,7 +464,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
|
|
|
}
|
|
|
}
|
|
|
- musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
|
|
|
+ musicGroupPaymentCalenderCourseSettingsService.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
|
|
|
}
|
|
|
|
|
|
//如果是跨团班级合并,保存用户缴费详情
|
|
@@ -584,95 +574,17 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
Date date = new Date();
|
|
|
String batchNo = idGeneratorService.generatorId() + "";
|
|
|
|
|
|
- // 获取设置的课程收费标准
|
|
|
-// List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList();
|
|
|
-
|
|
|
- //会员原价
|
|
|
-// BigDecimal memberPaymentAmount = BigDecimal.ZERO;
|
|
|
BigDecimal originalMemberPaymentAmount = BigDecimal.ZERO;
|
|
|
if (payUserType == SCHOOL) {
|
|
|
status = AUDITING;
|
|
|
} else {
|
|
|
- status = musicGroupPaymentCalenderBaseService.checkComponentAmount(musicGroupPaymentBaseCalender);
|
|
|
-// if(musicGroupPaymentCalenderCourseSettingsList != null){
|
|
|
-// if (paymentType == MUSIC_APPLY || paymentType == MUSIC_RENEW) {
|
|
|
-// // 当前缴费的课程费用
|
|
|
-// Map<CourseScheduleType, BigDecimal> currentCoursePrice = musicGroupPaymentCalenderCourseSettingsList.stream().collect(
|
|
|
-// Collectors
|
|
|
-// .toMap(MusicGroupPaymentCalenderCourseSettings::getCourseType, MusicGroupPaymentCalenderCourseSettings::getCourseCurrentPrice));
|
|
|
-//
|
|
|
-// // 查询默认课程费用
|
|
|
-// Integer musicGroupOrganizationCourseSettingId = musicGroupPaymentCalenderDto.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) {
|
|
|
-// status = AUDITING;
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// } else if (paymentType == PaymentType.ADD_COURSE || paymentType == PaymentType.ADD_STUDENT) {
|
|
|
-// PaymentCalenderStatusEnum dtoStatus = musicGroupPaymentCalenderDto.getStatus();
|
|
|
-// if(dtoStatus != null && dtoStatus == AUDITING){
|
|
|
-// status = AUDITING;
|
|
|
-// }else {
|
|
|
-// // 如果是课程收费,判断是否审核
|
|
|
-// for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
|
|
|
-// OrganizationCourseUnitPriceSettings defaultUnitPrice = organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseTypeAndChargeType(
|
|
|
-// musicGroup.getOrganId(), courseSettings.getCourseType(), musicGroup.getChargeTypeId());
|
|
|
-// if (defaultUnitPrice == null) {
|
|
|
-// throw new BizException("请先设置分部课程类型单价");
|
|
|
-// }
|
|
|
-// if (courseSettings.getCourseTotalMinuties() != 0) {
|
|
|
-//
|
|
|
-// if (defaultUnitPrice.getUnitPrice().multiply(new BigDecimal(courseSettings.getCourseTotalMinuties())).setScale(0, BigDecimal.ROUND_HALF_UP)
|
|
|
-// .compareTo(courseSettings.getCourseCurrentPrice()) != 0) {
|
|
|
-//
|
|
|
-// status = AUDITING;
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// status = AUDITING;
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }else if(paymentType == SPAN_GROUP_CLASS_ADJUST){
|
|
|
-// status = musicGroupPaymentCalenderDto.getStatus();
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if(musicGroupPaymentCalenderDto.getMemberRankSettingId() != null){
|
|
|
-// //会员价格是否变动
|
|
|
-// MemberFeeSetting memberFee = memberFeeSettingDao.findByRankIdAndOrganId(musicGroup.getOrganId(), musicGroupPaymentCalenderDto.getMemberRankSettingId());
|
|
|
-// if(memberFee == null){
|
|
|
-// throw new BizException("操作失败:请配置当前分部会员收费标准");
|
|
|
-// }
|
|
|
-// switch (musicGroupPaymentCalenderDto.getMemberValidDate()){
|
|
|
-// case 1 :
|
|
|
-// memberPaymentAmount = memberFee.getGroupPurchaseMonthFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
-// originalMemberPaymentAmount = memberFee.getOriginalMonthFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
-// break;
|
|
|
-// case 6 :
|
|
|
-// memberPaymentAmount = memberFee.getGroupPurchaseHalfYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
-// originalMemberPaymentAmount = memberFee.getOriginalHalfYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
-// break;
|
|
|
-// case 12 :
|
|
|
-// memberPaymentAmount = memberFee.getGroupPurchaseYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
-// originalMemberPaymentAmount = memberFee.getOriginalYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
-// break;
|
|
|
-// default:
|
|
|
-// throw new BizException("请选择正确的会员有效期");
|
|
|
-// }
|
|
|
-// if(memberPaymentAmount.compareTo(musicGroupPaymentCalenderDto.getMemberPaymentAmount()) != 0){
|
|
|
-// status = AUDITING;
|
|
|
-// }
|
|
|
-// }
|
|
|
+ status = memberCalenderService.checkComponentAmount(musicGroupPaymentBaseCalender);
|
|
|
+ if(status != AUDITING){
|
|
|
+ status = ((MusicGroupPaymentCalenderCourseSettingsServiceImpl)musicGroupPaymentCalenderCourseSettingsService).checkComponentAmount(musicGroupPaymentBaseCalender);
|
|
|
+ }
|
|
|
+ if(status != AUDITING){
|
|
|
+ status = musicRepairService.checkComponentAmount(musicGroupPaymentBaseCalender);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
|
|
@@ -681,13 +593,14 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
musicGroupPaymentCalender.setMemo(musicGroupPaymentBaseCalender.getMemo());
|
|
|
musicGroupPaymentCalender.setMusicGroupId(musicGroupId);
|
|
|
musicGroupPaymentCalender.setMusicGroupOrganizationCourseSettingId(musicGroupPaymentBaseCalender.getMusicGroupOrganizationCourseSettingId());
|
|
|
- BigDecimal totalPaymentAmount = BigDecimal.ZERO;
|
|
|
musicGroupPaymentCalender.setPayUserType(musicGroupPaymentBaseCalender.getPayUserType());
|
|
|
musicGroupPaymentCalender.setStartPaymentDate(musicGroupPaymentBaseCalender.getStartPaymentDate());
|
|
|
musicGroupPaymentCalender.setOperator(sysUser.getId());
|
|
|
musicGroupPaymentCalender.setCreateTime(date);
|
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
musicGroupPaymentCalender.setStatus(status);
|
|
|
+
|
|
|
+ BigDecimal totalPaymentAmount = BigDecimal.ZERO;
|
|
|
CalenderMemberDto calenderMember = musicGroupPaymentBaseCalender.getCalenderMember();
|
|
|
if(calenderMember != null){
|
|
|
//设置会员缴费金额、级别以及有效期
|
|
@@ -759,7 +672,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
|
|
|
}
|
|
|
}
|
|
|
- musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
|
|
|
+ musicGroupPaymentCalenderCourseSettingsService.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
|
|
|
}
|
|
|
|
|
|
// 如果是报名,需要修改乐团状态
|
|
@@ -797,7 +710,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
BigDecimal sumActualAmount = musicGroupPaymentCalenderDetailDao.sumActualAmount(id);
|
|
|
//收费标准名称
|
|
|
String name = musicGroupPaymentCalenderDao.getCalenderSettingsName(id);
|
|
|
- List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(id);
|
|
|
+ List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettings(id);
|
|
|
Map<String, Object> result = new HashMap<>(4);
|
|
|
result.put("musicGroupPaymentCalenderCourseSettings", musicGroupPaymentCalenderCourseSettings);
|
|
|
if(calender.getMemberRankSettingId() != null){
|
|
@@ -859,7 +772,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
List<Long> calenderIds = musicGroupPaymentCalenderList.stream().map(MusicGroupPaymentCalender :: getId).collect(Collectors.toList());
|
|
|
//删除原来数据
|
|
|
musicGroupPaymentCalenderDao.delByIds(calenderIds);
|
|
|
- musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(calenderIds);
|
|
|
+ musicGroupPaymentCalenderCourseSettingsService.deleteByMusicGroupPaymentCalenderId(calenderIds);
|
|
|
|
|
|
status = PaymentCalenderStatusEnum.NO;
|
|
|
|
|
@@ -1140,7 +1053,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
|
|
|
}
|
|
|
}
|
|
|
- musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
|
|
|
+ musicGroupPaymentCalenderCourseSettingsService.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1457,7 +1370,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
}
|
|
|
//获取收费标准
|
|
|
- calenderAuditDetailDto.setMusicGroupPaymentCalenderCourseSettings(musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
|
|
|
+ calenderAuditDetailDto.setMusicGroupPaymentCalenderCourseSettings(musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettingsByBatchNo(batchNo));
|
|
|
//获取跨团合班学员缴费详情
|
|
|
calenderAuditDetailDto.setMusicGroupPaymentCalenderStudentDetails(musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo));
|
|
|
return calenderAuditDetailDto;
|
|
@@ -1561,7 +1474,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
|
|
|
musicGroupPaymentCalender.setExpectNum(1);
|
|
|
- List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
|
|
|
+ List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
|
|
|
addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings,musicGroup);
|
|
|
}
|
|
|
}
|
|
@@ -1609,7 +1522,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
String classGroupIdStr = calender.getAttribute1();
|
|
|
if (StringUtils.isNotBlank(classGroupIdStr)) {
|
|
|
classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
|
|
|
- musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo),musicGroup);
|
|
|
+ musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettingsByBatchNo(batchNo),musicGroup);
|
|
|
}
|
|
|
MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
|
|
|
if(musicGroupStudentClassAdjust != null){
|
|
@@ -1835,7 +1748,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
List<Long> calenderIds = new ArrayList<Long>();
|
|
|
calenderIds.add(id);
|
|
|
- musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(calenderIds);
|
|
|
+ musicGroupPaymentCalenderCourseSettingsService.deleteByMusicGroupPaymentCalenderId(calenderIds);
|
|
|
|
|
|
//如果乐团是“费用审核”,则需要修改状态
|
|
|
MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|