|
@@ -270,11 +270,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
studentRegistrationDao.batchInsert(studentRegistrationList);
|
|
|
}
|
|
|
musicGroupDao.update(musicGroup);
|
|
|
- List<MusicGroupStudentFee> musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
|
|
|
- if(musicGroupStudentFees != null && musicGroupStudentFees.size() > 0){
|
|
|
- Date nextPaymentDate = musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, null);
|
|
|
- musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees,nextPaymentDate,"PAID_COMPLETED");
|
|
|
- }
|
|
|
+// List<MusicGroupStudentFee> musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
|
|
|
+// if(musicGroupStudentFees != null && musicGroupStudentFees.size() > 0){
|
|
|
+// Date nextPaymentDate = musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, null,null);
|
|
|
+// musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees,nextPaymentDate,"PAID_COMPLETED");
|
|
|
+// }
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "跨团调整", sysUser.getId(),""));
|
|
|
}
|
|
|
|
|
@@ -323,7 +323,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if(userCashAccount == null){
|
|
|
throw new BizException("用户账户找不到");
|
|
|
}
|
|
|
- if(userCashAccount.getBalance().subtract(amount).doubleValue() > 0){
|
|
|
+ if(userCashAccount.getBalance().subtract(amount).doubleValue() >= 0){
|
|
|
// 更新订单信息
|
|
|
studentPaymentOrder.setActualAmount(new BigDecimal(0));
|
|
|
studentPaymentOrder.setBalancePaymentAmount(amount);
|
|
@@ -371,7 +371,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
amount,
|
|
|
orderNo,
|
|
|
baseApiUrl+"/api-student/studentOrder/notify",
|
|
|
- baseApiUrl+"/#/paymentresult?orderNo=" + orderNo,
|
|
|
+ baseApiUrl+"/api-student/studentOrder/paymentResult?orderNo=" + orderNo,
|
|
|
chargeInfo.getTitle(),
|
|
|
chargeInfo.getTitle(),
|
|
|
userId,
|
|
@@ -507,12 +507,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if(userCashAccount == null){
|
|
|
throw new BizException("用户账户找不到");
|
|
|
}
|
|
|
- if(userCashAccount.getBalance().subtract(amount).doubleValue() > 0){
|
|
|
+ if(userCashAccount.getBalance().subtract(amount).doubleValue() >= 0){
|
|
|
// 更新订单信息
|
|
|
studentPaymentOrder.setBalancePaymentAmount(amount);
|
|
|
studentPaymentOrder.setOrganId(musicGroup.getOrganId());
|
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
|
- sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
|
|
|
+ sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团报名");
|
|
|
amount = BigDecimal.ZERO;
|
|
|
}else{
|
|
|
if (userCashAccount.getBalance().doubleValue() > 0) {
|
|
@@ -564,7 +564,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
amount,
|
|
|
orderNo,
|
|
|
baseApiUrl+"/api-student/studentOrder/notify",
|
|
|
- baseApiUrl+"/#/paymentresult?orderNo=" + orderNo,
|
|
|
+ baseApiUrl+"/api-student/studentOrder/paymentResult?orderNo=" + orderNo,
|
|
|
"乐团报名缴费",
|
|
|
"乐团报名缴费",
|
|
|
userId,
|
|
@@ -705,12 +705,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
throw new BizException("用户账户找不到");
|
|
|
}
|
|
|
studentPaymentOrder.setPaymentChannel("BALANCE");
|
|
|
- if(userCashAccount.getBalance().subtract(amount).doubleValue() > 0){
|
|
|
+ if(userCashAccount.getBalance().subtract(amount).doubleValue() >= 0){
|
|
|
// 更新订单信息
|
|
|
studentPaymentOrder.setBalancePaymentAmount(amount);
|
|
|
studentPaymentOrder.setOrganId(musicGroup.getOrganId());
|
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
|
- sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
|
|
|
+ sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团报名");
|
|
|
amount = BigDecimal.ZERO;
|
|
|
}else{
|
|
|
if (userCashAccount.getBalance().doubleValue() > 0) {
|
|
@@ -761,7 +761,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
amount,
|
|
|
orderNo,
|
|
|
baseApiUrl+"/api-student/studentOrder/notify",
|
|
|
- baseApiUrl+"/#/paymentresult?orderNo=" + orderNo,
|
|
|
+ baseApiUrl+"/api-student/studentOrder/paymentResult?orderNo=" + orderNo,
|
|
|
"乐团报名缴费",
|
|
|
"乐团报名缴费",
|
|
|
userId,
|
|
@@ -806,13 +806,13 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
//删除原有的声部商品组合
|
|
|
musicGroupSubjectGoodsGroupDao.delByMusicGroupId(subFeeSettingDto.getMusicGroupId());
|
|
|
//如果是进行中,补充缴费信息
|
|
|
- if(musicGroup.getStatus() == MusicGroupStatusEnum.PROGRESS){
|
|
|
- List<MusicGroupStudentFee> musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
|
|
|
- if(musicGroupStudentFees != null && musicGroupStudentFees.size() > 0){
|
|
|
- Date nextPaymentDate = musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, null);
|
|
|
- musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees,nextPaymentDate,"PAID_COMPLETED");
|
|
|
- }
|
|
|
- }
|
|
|
+// if(musicGroup.getStatus() == MusicGroupStatusEnum.PROGRESS){
|
|
|
+// List<MusicGroupStudentFee> musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
|
|
|
+// if(musicGroupStudentFees != null && musicGroupStudentFees.size() > 0){
|
|
|
+// Date nextPaymentDate = musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, null,null);
|
|
|
+// musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees,nextPaymentDate,"PAID_COMPLETED");
|
|
|
+// }
|
|
|
+// }
|
|
|
List<MusicGroupSubjectPlan> musicGroupSubjectPlans = subFeeSettingDto.getMusicGroupSubjectPlans();
|
|
|
if (musicGroupSubjectPlans != null && musicGroupSubjectPlans.size() > 0) {
|
|
|
musicGroupSubjectPlans.forEach(e->{
|
|
@@ -864,8 +864,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
//生成学员费用表
|
|
|
List<MusicGroupStudentFee> musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
|
|
|
if(musicGroupStudentFees != null && musicGroupStudentFees.size() > 0){
|
|
|
- musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees,musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, null),"PAID_COMPLETED");
|
|
|
+ musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees,musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, null,null),"PAID_COMPLETED");
|
|
|
}
|
|
|
+ musicGroupStudentFeeDao.batchUpdateCalenders(musicGroupId);
|
|
|
//记录操作日志
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"确认开团(筹备中 -> 进行中)",sysUser.getId(),""));
|
|
|
musicGroup.setStatus(MusicGroupStatusEnum.PROGRESS);
|
|
@@ -972,18 +973,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void musicGroupStudentFeePatch(List<String> musicGroupIds) {
|
|
|
- if(musicGroupIds != null && musicGroupIds.size() > 0){
|
|
|
- List<MusicGroupStudentFee> musicGroupStudentFees = null;
|
|
|
- for (String musicGroupId: musicGroupIds) {
|
|
|
- musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
|
|
|
- if(musicGroupStudentFees != null && musicGroupStudentFees.size() > 0){
|
|
|
- musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees,musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, null),"PAID_COMPLETED");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// @Override
|
|
|
+// public void musicGroupStudentFeePatch(List<String> musicGroupIds) {
|
|
|
+// if(musicGroupIds != null && musicGroupIds.size() > 0){
|
|
|
+// List<MusicGroupStudentFee> musicGroupStudentFees = null;
|
|
|
+// for (String musicGroupId: musicGroupIds) {
|
|
|
+// musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
|
|
|
+// if(musicGroupStudentFees != null && musicGroupStudentFees.size() > 0){
|
|
|
+// musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees,musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, null,null),"PAID_COMPLETED");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
@Override
|
|
|
public List<MusicCardDto> queryUserMusicGroups(Integer userId) {
|
|
@@ -1046,7 +1047,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
//删除续费记录
|
|
|
- musicGroupStudentFeeDao.deleteByMusicGroupId(musicGroupId);
|
|
|
+ musicGroupStudentFeeDao.deleteByMusicGroupId(musicGroupId,null);
|
|
|
|
|
|
// 删除课表
|
|
|
courseScheduleDao.deleteCourseSchedulesByMusicGroupID(musicGroupId, GroupType.MUSIC);
|
|
@@ -1138,7 +1139,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
musicGroupDao.update(musicGroup);
|
|
|
|
|
|
// 重新设置下次缴费时间
|
|
|
- musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId, musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, null));
|
|
|
+ List<MusicGroupStudentFee> fees = musicGroupStudentFeeDao.queryByMusicGroupId(musicGroupId);
|
|
|
+ Date date = new Date();
|
|
|
+ fees.forEach(e->{
|
|
|
+ e.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, null,e));
|
|
|
+ e.setUpdateTime(date);
|
|
|
+ });
|
|
|
+ musicGroupStudentFeeDao.batchUpdate(fees);
|
|
|
+// musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId, musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, null));
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"恢复乐团",sysUser.getId(),""));
|
|
|
|
|
|
//恢复课表
|
|
@@ -1437,7 +1445,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
|
|
|
|
|
|
if (musicGroupStudentFee == null) {
|
|
|
- throw new BizException("个人信息不存在");
|
|
|
+ throw new BizException("个人续费信息错误");
|
|
|
}
|
|
|
//判断是否是续费
|
|
|
/*List<StudentPaymentOrder> orderList = studentPaymentOrderDao.queryByCondition(GroupType.MUSIC, musicGroupId, userId, DealStatusEnum.SUCCESS);
|
|
@@ -1450,7 +1458,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
throw new BizException("已缴费");
|
|
|
}
|
|
|
|
|
|
- BigDecimal amount = musicGroupStudentFee.getTemporaryCourseFee();
|
|
|
+ BigDecimal amount = musicGroupStudentFee.getCourseFee();
|
|
|
if (amount == null || amount.doubleValue() == 0) {
|
|
|
amount = musicGroupStudentFee.getCourseFee();
|
|
|
}
|
|
@@ -1502,7 +1510,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
musicGroupStudentFee.setLatestPaidTime(date);
|
|
|
musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
|
|
|
- musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, musicGroupStudentFee.getNextPaymentDate()));
|
|
|
+ musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, musicGroupStudentFee.getNextPaymentDate(),musicGroupStudentFee));
|
|
|
musicGroupStudentFeeDao.update(musicGroupStudentFee);
|
|
|
return null;
|
|
|
}else{
|
|
@@ -1528,7 +1536,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
Map<String, Object> payMap = payService.getPayMap(amount, studentPaymentOrder.getOrderNo(),
|
|
|
baseApiUrl+"/api-student/studentOrder/notify",
|
|
|
- baseApiUrl+"/#/paymentresult?orderNo=" + studentPaymentOrder.getOrderNo(),
|
|
|
+ baseApiUrl+"/api-student/studentOrder/paymentResult?orderNo=" + studentPaymentOrder.getOrderNo(),
|
|
|
"续费",
|
|
|
"乐团续费",
|
|
|
userId,
|
|
@@ -1577,7 +1585,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
musicGroupStudentFee.setLatestPaidTime(date);
|
|
|
musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
|
|
|
- musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, musicGroupStudentFee.getNextPaymentDate()));
|
|
|
+ musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, musicGroupStudentFee.getNextPaymentDate(),musicGroupStudentFee));
|
|
|
musicGroupStudentFeeDao.update(musicGroupStudentFee);
|
|
|
|
|
|
//插入交易明细
|
|
@@ -1621,6 +1629,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
sysMessageService.batchSendMessage(MessageSender.YIMEI, MessageTypeEnum.STUDENT_SMS_MUSIC_GROUP_RENEW_SUCCESS, yimei, null, 0, "1",
|
|
|
studentRegistration.getParentsName(),studentPaymentOrder.getActualAmount());
|
|
|
return true;
|
|
|
+ } else {
|
|
|
+ if (studentPaymentOrder.getBalancePaymentAmount() != null && studentPaymentOrder.getBalancePaymentAmount().doubleValue() > 0) {
|
|
|
+ sysUserCashAccountService.updateBalance(userId, studentPaymentOrder.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS,
|
|
|
+ "乐团续费失败");
|
|
|
+ }
|
|
|
}
|
|
|
if(studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED){
|
|
|
String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
|
|
@@ -1761,8 +1774,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
//如果已生成课表,那么修改未上课时教学点
|
|
|
courseScheduleDao.updateCourseScheduleSchool("MUSIC",musicGroupId,musicGroup.getSchoolId());
|
|
|
}
|
|
|
-
|
|
|
- Date date = new Date();
|
|
|
List<Integer> months = subFeeSettingDto.getMonths();
|
|
|
|
|
|
//判断缴费日历是否修改
|
|
@@ -1781,7 +1792,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
if (isModifiedOfCalender) {
|
|
|
-
|
|
|
Integer num = musicGroupStudentFeeDao.countStudentNoPayNum(musicGroupId);
|
|
|
if (num > 0) {
|
|
|
throw new BizException("缴费周期更新失败,当前乐团有未缴费的学员");
|
|
@@ -1789,18 +1799,26 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
// 删除乐团相关付费周期
|
|
|
musicGroupPaymentCalenderDao.delByGroupId(musicGroupId);
|
|
|
- musicGroupStudentFeeDao.deleteByMusicGroupId(musicGroupId);
|
|
|
if (months != null && months.size() > 0) {
|
|
|
// 批量插入
|
|
|
musicGroupPaymentCalenderDao.batchAdd(months, musicGroupId);
|
|
|
}
|
|
|
-
|
|
|
- //生成学员费用表
|
|
|
- List<MusicGroupStudentFee> musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
|
|
|
- if(musicGroupStudentFees != null && musicGroupStudentFees.size() > 0){
|
|
|
- musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees,musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, null),"PAID_COMPLETED");
|
|
|
- }
|
|
|
}
|
|
|
+ if(musicGroup.getStatus() == MusicGroupStatusEnum.PROGRESS){
|
|
|
+ //修改未锁定学员缴费周期
|
|
|
+ String join = null;
|
|
|
+ if (months != null && months.size() > 0) {
|
|
|
+ join = StringUtils.join(months,",");
|
|
|
+ }
|
|
|
+ musicGroupStudentFeeDao.batchUpdateCalender(join,musicGroupId);
|
|
|
+ List<MusicGroupStudentFee> fees = musicGroupStudentFeeDao.queryByMusicGroupId(musicGroupId);
|
|
|
+ Date date = new Date();
|
|
|
+ fees.forEach(e->{
|
|
|
+ e.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, null,e));
|
|
|
+ e.setUpdateTime(date);
|
|
|
+ });
|
|
|
+ musicGroupStudentFeeDao.batchUpdate(fees);
|
|
|
+ }
|
|
|
musicGroupDao.update(musicGroup);
|
|
|
//修改课程里面的教学点
|
|
|
if(!musicGroup.getSchoolId().equals(musicGroup.getSchoolId())){
|