|
@@ -1508,7 +1508,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
vipGroup.setStatus(VipGroupStatusEnum.DELETE);
|
|
|
vipGroupDao.update(vipGroup);
|
|
|
- groupClassService.hideGroupInfo(vipGroupId.toString(), GroupType.VIP);
|
|
|
+ groupClassService.hideGroupInfo(vipGroupId.toString(), "VIP".equals(vipGroup.getGroupType())?GroupType.VIP:GroupType.LIVE);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -2745,7 +2745,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
Long vipGroupId = returnFeeDto.getVipGroupId();
|
|
|
Integer studentId = returnFeeDto.getStudentId();
|
|
|
if (Objects.isNull(vipGroupId) || Objects.isNull(studentId)) {
|
|
|
- throw new BizException("请指定小课与学生");
|
|
|
+ throw new BizException("请指定课程与学生");
|
|
|
}
|
|
|
VipGroup vipGroup = vipGroupDao.get(vipGroupId);
|
|
|
if (Objects.isNull(vipGroup)) {
|
|
@@ -2760,7 +2760,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
VipGroupCategory vipGroupCategory = vipGroupCategoryService.get(vipGroup.getVipGroupCategoryId());
|
|
|
|
|
|
- List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsDao.findByGroupAndUser(vipGroupId.toString(), GroupType.VIP.getCode(), studentId);
|
|
|
+ List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsDao.findByGroupAndUser(vipGroupId.toString(), vipGroup.getGroupType(), studentId);
|
|
|
if (!CollectionUtils.isEmpty(studentApplyRefunds)) {
|
|
|
throw new BizException("此学生存在退课申请,请到系统日志中查看");
|
|
|
}
|
|
@@ -2788,36 +2788,38 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("学员最大可退费金额为{}元", suplusCourseFee.toString());
|
|
|
}
|
|
|
}
|
|
|
- //退还活动购买
|
|
|
-// groupClassService.quitActivityGive(activityUserMapperService.findByStudentId(vipGroup.getId(), studentId));
|
|
|
+ GroupType groupType = GroupType.VIP;
|
|
|
+ ReturnFeeEnum returnFeeEnum = ReturnFeeEnum.VIP;
|
|
|
+ if("LIVE".equals(vipGroup.getGroupType())){
|
|
|
+ groupType = GroupType.LIVE;
|
|
|
+ returnFeeEnum = ReturnFeeEnum.LIVE;
|
|
|
+ }
|
|
|
|
|
|
if (classStudentMapperByUserIdAndClassGroupId.getStatus().equals(ClassGroupStudentStatusEnum.QUIT_SCHOOL)) {
|
|
|
classStudentMapperByUserIdAndClassGroupId.setStatus(ClassGroupStudentStatusEnum.QUIT);
|
|
|
classGroupStudentMapperDao.update(classStudentMapperByUserIdAndClassGroupId);
|
|
|
- studentPauseInfoDao.deleteUserPauseInfoWithGroup(GroupType.VIP, vipGroupId.toString(), studentId);
|
|
|
+ studentPauseInfoDao.deleteUserPauseInfoWithGroup(groupType, vipGroupId.toString(), studentId);
|
|
|
|
|
|
classGroup.setStudentNum(classGroup.getStudentNum() - 1);
|
|
|
classGroupDao.update(classGroup);
|
|
|
return BaseController.succeed();
|
|
|
}
|
|
|
|
|
|
-// sysUserCashAccountService.updateBalance(studentId, amount);
|
|
|
-// SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(studentId);
|
|
|
//记录日志
|
|
|
SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
|
|
|
sysUserCashAccountLog.setUserId(studentId);
|
|
|
- sysUserCashAccountLog.setGroupType(VIP);
|
|
|
+ sysUserCashAccountLog.setGroupType(groupType);
|
|
|
sysUserCashAccountLog.setOrganId(vipGroup.getOrganId());
|
|
|
sysUserCashAccountLog.setGroupId(vipGroupId.toString());
|
|
|
sysUserCashAccountLog.setAmount(amount);
|
|
|
- sysUserCashAccountLog.setReturnFeeType(ReturnFeeEnum.VIP);
|
|
|
- sysUserCashAccountLog.setComment("VIP退课");
|
|
|
+ sysUserCashAccountLog.setReturnFeeType(returnFeeEnum);
|
|
|
+ sysUserCashAccountLog.setComment(groupType.getDesc() + "退学");
|
|
|
sysUserCashAccountLogDao.insert(sysUserCashAccountLog);
|
|
|
|
|
|
classStudentMapperByUserIdAndClassGroupId.setStatus(ClassGroupStudentStatusEnum.QUIT);
|
|
|
classGroupStudentMapperDao.update(classStudentMapperByUserIdAndClassGroupId);
|
|
|
|
|
|
- courseScheduleService.batchDeleteMusicGroupCourseWithStudent(vipGroupId.toString(), studentId, GroupType.VIP);
|
|
|
+ courseScheduleService.batchDeleteMusicGroupCourseWithStudent(vipGroupId.toString(), studentId, groupType);
|
|
|
|
|
|
List<Integer> studentPaymentIds = courseScheduleStudentPaymentDao.findNotStartCourseStudentPaymentIdsWithClassGroupAndStudent(classGroup.getId(), studentId);
|
|
|
if (!CollectionUtils.isEmpty(studentPaymentIds)) {
|
|
@@ -2993,7 +2995,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void pauseForStudent(Long vipGroupId, Integer studentId) {
|
|
|
if (Objects.isNull(vipGroupId) || Objects.isNull(studentId)) {
|
|
|
- throw new BizException("请指定小课与学生");
|
|
|
+ throw new BizException("请指定课程与学生");
|
|
|
}
|
|
|
VipGroup vipGroup = vipGroupDao.get(vipGroupId);
|
|
|
if (Objects.isNull(vipGroup)) {
|
|
@@ -3002,7 +3004,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
if (!VipGroupStatusEnum.PROGRESS.equals(vipGroup.getStatus())) {
|
|
|
throw new BizException("当前课程组状态非进行中,无法进行该操作");
|
|
|
}
|
|
|
- List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsDao.findByGroupAndUser(vipGroupId.toString(), GroupType.VIP.getCode(), studentId);
|
|
|
+ List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsDao.findByGroupAndUser(vipGroupId.toString(), vipGroup.getGroupType(), studentId);
|
|
|
if (!CollectionUtils.isEmpty(studentApplyRefunds)) {
|
|
|
throw new BizException("此学生存在退课申请,请到系统日志中查看");
|
|
|
}
|
|
@@ -3024,11 +3026,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("当前学生已是休学状态");
|
|
|
}
|
|
|
|
|
|
- BigDecimal surplusCourseFee = courseScheduleStudentPaymentDao.countSurplusCourseFee(classGroup.getId(), studentId);
|
|
|
-
|
|
|
- if (Objects.isNull(surplusCourseFee)) {
|
|
|
- surplusCourseFee = new BigDecimal(0);
|
|
|
- }
|
|
|
|
|
|
Map<String, Object> pauseInfos = new HashMap<>();
|
|
|
//学生剩余课时
|
|
@@ -3224,7 +3221,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("剩余课时不足,无法与现有课时对齐");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
CourseSchedule lastCourseSchedule = surplusCourseWithGroup.stream().max(Comparator.comparing(CourseSchedule::getClassDate)).get();
|
|
|
if (vipGroup.getCoursesExpireDate().compareTo(lastCourseSchedule.getEndClassTime()) <= 0 && !DateUtil.isSameDay(vipGroup.getCoursesExpireDate(), lastCourseSchedule.getEndClassTime())) {
|
|
|
throw new BizException("排课时间不可超过{}", DateUtil.dateToString(vipGroup.getCoursesExpireDate(), "yyyy年MM月dd日"));
|
|
@@ -3405,7 +3401,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public HttpResponseResult applyRefundAudit(Long id, StudentApplyRefundsStatus status, String remark, BigDecimal amount, boolean confirmReturnActivityGive) {
|
|
|
-
|
|
|
StudentApplyRefunds studentApplyRefunds = studentApplyRefundsDao.get(id);
|
|
|
if (studentApplyRefunds == null) {
|
|
|
throw new BizException("退课申请记录不存在");
|
|
@@ -3422,33 +3417,30 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
VipGroup vipGroup = vipGroupDao.get(id);
|
|
|
studentApplyRefunds.setStatus(status);
|
|
|
if (studentApplyRefunds.getStatus() == StudentApplyRefundsStatus.DONE) {
|
|
|
- //退还活动购买
|
|
|
-
|
|
|
-// ActivityUserMapper activityUserMapper = activityUserMapperService.findByStudentId(vipGroup.getId(), studentPaymentOrder.getUserId());
|
|
|
-// HttpResponseResult result = groupClassService.quitActivityGive(activityUserMapper, confirmReturnActivityGive, id, VIP);
|
|
|
-// if (result.getCode() != 200) {
|
|
|
-// return result;
|
|
|
-// }
|
|
|
studentApplyRefunds.setActualAmount(amount);
|
|
|
} else {
|
|
|
studentApplyRefunds.setActualAmount(new BigDecimal(0));
|
|
|
}
|
|
|
+ GroupType groupType = GroupType.VIP;
|
|
|
+ ReturnFeeEnum returnFeeEnum = ReturnFeeEnum.VIP;
|
|
|
+ if("LIVE".equals(vipGroup.getGroupType())){
|
|
|
+ groupType = GroupType.LIVE;
|
|
|
+ returnFeeEnum = ReturnFeeEnum.LIVE;
|
|
|
+ }
|
|
|
studentApplyRefunds.setRemark(remark);
|
|
|
studentApplyRefunds.setUpdateTime(new Date());
|
|
|
studentApplyRefundsDao.update(studentApplyRefunds);
|
|
|
switch (studentApplyRefunds.getStatus()) {
|
|
|
case DONE:
|
|
|
-// sysUserCashAccountService.updateBalance(studentApplyRefunds.getUserId(), studentApplyRefunds.getActualAmount());
|
|
|
-// SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(studentApplyRefunds.getUserId().intValue());
|
|
|
//记录日志
|
|
|
SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
|
|
|
sysUserCashAccountLog.setGroupId(vipGroup.getId().toString());
|
|
|
sysUserCashAccountLog.setUserId(studentApplyRefunds.getUserId());
|
|
|
- sysUserCashAccountLog.setGroupType(VIP);
|
|
|
+ sysUserCashAccountLog.setGroupType(groupType);
|
|
|
sysUserCashAccountLog.setOrganId(vipGroup.getOrganId());
|
|
|
sysUserCashAccountLog.setAmount(amount);
|
|
|
- sysUserCashAccountLog.setReturnFeeType(ReturnFeeEnum.VIP);
|
|
|
- sysUserCashAccountLog.setComment("VIP退课审核");
|
|
|
+ sysUserCashAccountLog.setReturnFeeType(returnFeeEnum);
|
|
|
+ sysUserCashAccountLog.setComment(groupType.getDesc() + "退费审核");
|
|
|
sysUserCashAccountLogDao.insert(sysUserCashAccountLog);
|
|
|
|
|
|
ClassGroupStudentMapper classStudentMapperByUserIdAndClassGroupId = classGroupStudentMapperDao.query(studentPaymentOrder.getClassGroupId(),
|
|
@@ -3461,17 +3453,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
classStudentMapperByUserIdAndClassGroupId.setStatus(ClassGroupStudentStatusEnum.QUIT);
|
|
|
classGroupStudentMapperDao.update(classStudentMapperByUserIdAndClassGroupId);
|
|
|
|
|
|
-// ClassGroup classGroup=new ClassGroup();
|
|
|
-// classGroup.setId(classStudentMapperByUserIdAndClassGroupId.getClassGroupId());
|
|
|
-// classGroup.setStudentNum(classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId()));
|
|
|
-// classGroupDao.update(classGroup);
|
|
|
-
|
|
|
List<Integer> studentPaymentIds = courseScheduleStudentPaymentDao.findNotStartCourseStudentPaymentIdsWithClassGroupAndStudent(classStudentMapperByUserIdAndClassGroupId.getClassGroupId(), studentApplyRefunds.getUserId());
|
|
|
if (!CollectionUtils.isEmpty(studentPaymentIds)) {
|
|
|
courseScheduleStudentPaymentDao.batchDeleteWithID(studentPaymentIds);
|
|
|
}
|
|
|
|
|
|
- courseScheduleService.batchDeleteMusicGroupCourseWithStudent(studentPaymentOrder.getMusicGroupId(), studentApplyRefunds.getUserId(), GroupType.VIP);
|
|
|
+ courseScheduleService.batchDeleteMusicGroupCourseWithStudent(studentPaymentOrder.getMusicGroupId(), studentApplyRefunds.getUserId(), groupType);
|
|
|
|
|
|
|
|
|
courseScheduleTeacherSalaryService.updateVipGroupCourseTeacherSalary(Integer.parseInt(studentPaymentOrder.getMusicGroupId()), null);
|
|
@@ -3638,9 +3625,19 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
// stopVipPush(vipGroup.getId(),vipGroup.getName());
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ String orderType = "SMALL_CLASS_TO_BUY";
|
|
|
+ GroupType groupType = VIP;
|
|
|
+ ReturnFeeEnum returnFeeEnum = ReturnFeeEnum.VIP;
|
|
|
+ if("LIVE".equals(vipGroup.getGroupType())){
|
|
|
+ orderType = "LIVE_GROUP_BUY";
|
|
|
+ groupType = GroupType.LIVE;
|
|
|
+ returnFeeEnum = ReturnFeeEnum.LIVE;
|
|
|
+ }
|
|
|
Map<Integer, BigDecimal> studentSurplusClassFees = MapUtil.convertIntegerMap(maps);
|
|
|
for (Integer userId : studentSurplusClassFees.keySet()) {
|
|
|
- StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId, userId, DealStatusEnum.SUCCESS.getCode(),"VIP".equals(vipGroup.getGroupType())?"SMALL_CLASS_TO_BUY":"LIVE_GROUP_BUY");
|
|
|
+ StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId, userId,
|
|
|
+ DealStatusEnum.SUCCESS.getCode(),orderType);
|
|
|
if (null == studentPaymentOrder) {
|
|
|
throw new BizException("无法停止课程,需要全部学员退学后,才能停止,请先操作学员退学。");
|
|
|
}
|
|
@@ -3649,11 +3646,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
|
|
|
sysUserCashAccountLog.setGroupId(vipGroupId.toString());
|
|
|
sysUserCashAccountLog.setUserId(userId);
|
|
|
- sysUserCashAccountLog.setGroupType(VIP);
|
|
|
+ sysUserCashAccountLog.setGroupType(groupType);
|
|
|
sysUserCashAccountLog.setOrganId(vipGroup.getOrganId());
|
|
|
sysUserCashAccountLog.setAmount(studentSurplusClassFees.get(userId));
|
|
|
- sysUserCashAccountLog.setReturnFeeType(ReturnFeeEnum.VIP);
|
|
|
- sysUserCashAccountLog.setComment("VIP课关闭");
|
|
|
+ sysUserCashAccountLog.setReturnFeeType(returnFeeEnum);
|
|
|
+ sysUserCashAccountLog.setComment(groupType.getDesc() + "关闭");
|
|
|
sysUserCashAccountLogDao.insert(sysUserCashAccountLog);
|
|
|
}
|
|
|
|
|
@@ -3666,20 +3663,17 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(courseScheduleIds);
|
|
|
courseScheduleStudentPaymentDao.deleteByCourseSchedule(courseScheduleIds);
|
|
|
teacherAttendanceDao.batchDeleteByCourseSchedules(courseScheduleIds);
|
|
|
- //vip课停止通知
|
|
|
-// Teacher teacher = teacherDao.get(vipGroup.getUserId());
|
|
|
-// Map<Integer,String> map = new HashMap<>(1);
|
|
|
-// map.put(vipGroup.getUserId(),vipGroup.getUserId().toString());
|
|
|
-// sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,MessageTypeEnum.TEACHER_PUSH_VIP_COURSE_STOP,
|
|
|
-// map,null,0,"1",vipGroup.getName());
|
|
|
teacherPush(vipGroup);
|
|
|
-// stopVipPush(vipGroup.getId(),vipGroup.getName());
|
|
|
}
|
|
|
|
|
|
private void teacherPush(VipGroup vipGroup) {
|
|
|
+ MessageTypeEnum messageTypeEnum = MessageTypeEnum.TEACHER_PUSH_VIP_COURSE_STOP;
|
|
|
+ if("LIVE".equals(vipGroup.getGroupType())){
|
|
|
+ messageTypeEnum = MessageTypeEnum.TEACHER_PUSH_LIVE_COURSE_STOP;
|
|
|
+ }
|
|
|
Map<Integer, String> map = new HashMap<>(1);
|
|
|
map.put(vipGroup.getUserId(), vipGroup.getUserId().toString());
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.TEACHER_PUSH_VIP_COURSE_STOP,
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, messageTypeEnum,
|
|
|
map, null, 0, "1", "TEACHER", vipGroup.getName());
|
|
|
}
|
|
|
|