|
@@ -545,12 +545,28 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
Map<String, Object> params = new HashMap<String, Object>();
|
|
|
MapUtil.populateMap(params, queryInfo);
|
|
|
|
|
|
- List dataList = null;
|
|
|
+ List<VipGroupStudentDto> dataList = null;
|
|
|
int count = vipGroupDao.countVipGroupStudents(params);
|
|
|
if (count > 0) {
|
|
|
pageInfo.setTotal(count);
|
|
|
params.put("offset", pageInfo.getOffset());
|
|
|
dataList = vipGroupDao.findVipGroupStudents(params);
|
|
|
+ List<StudentApplyRefunds> applyRefunds = studentApplyRefundsDao.findByGroupAndType(queryInfo.getVipGroupId().toString(), GroupType.VIP.getCode());
|
|
|
+ Map<Integer, List<StudentApplyRefunds>> studentApplyRefundsMap = applyRefunds.stream()
|
|
|
+ .collect(Collectors.groupingBy(StudentApplyRefunds::getUserId));
|
|
|
+ dataList.forEach(data->{
|
|
|
+ List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsMap.get(data.getId());
|
|
|
+ if(!CollectionUtils.isEmpty(studentApplyRefunds)){
|
|
|
+ StudentApplyRefunds studentApplyRefund = studentApplyRefunds.get(0);
|
|
|
+ if(data.getStudentStatus()==0&&studentApplyRefund.getStatus().equals(StudentApplyRefundsStatus.ING)){
|
|
|
+ data.setStudentStatus(2);
|
|
|
+ data.setRefundDate(studentApplyRefund.getUpdateTime());
|
|
|
+ }
|
|
|
+ if(data.getStudentStatus()==0){
|
|
|
+ data.setRefundDate(studentApplyRefund.getUpdateTime());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
if (count == 0) {
|
|
|
dataList = new ArrayList<>();
|
|
@@ -1169,6 +1185,18 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("不能已进行的课程进行此操作");
|
|
|
}
|
|
|
ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
+
|
|
|
+ ClassGroupStudentMapper classStudentMapperByUserIdAndClassGroupId = classGroupStudentMapperDao.query(classGroup.getId(),
|
|
|
+ studentId);
|
|
|
+
|
|
|
+ if(Objects.isNull(classStudentMapperByUserIdAndClassGroupId)){
|
|
|
+ throw new BizException("指定学生不在此课程中");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(classStudentMapperByUserIdAndClassGroupId.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)){
|
|
|
+ throw new BizException("当前学生已经是退学状态");
|
|
|
+ }
|
|
|
+
|
|
|
sysUserCashAccountService.updateBalance(studentId, amount);
|
|
|
SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(studentId);
|
|
|
SysUserCashAccountDetail sysUserCashAccountDetail = new SysUserCashAccountDetail();
|
|
@@ -1180,13 +1208,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
sysUserCashAccountDetail.setAttribute(studentId.toString());
|
|
|
sysUserCashAccountDetailDao.insert(sysUserCashAccountDetail);
|
|
|
|
|
|
- ClassGroupStudentMapper classStudentMapperByUserIdAndClassGroupId = classGroupStudentMapperDao.query(classGroup.getId(),
|
|
|
- studentId);
|
|
|
-
|
|
|
- if(Objects.isNull(classStudentMapperByUserIdAndClassGroupId)){
|
|
|
- throw new BizException("指定学生不在此课程中");
|
|
|
- }
|
|
|
-
|
|
|
classStudentMapperByUserIdAndClassGroupId.setStatus(ClassGroupStudentStatusEnum.QUIT);
|
|
|
classGroupStudentMapperDao.update(classStudentMapperByUserIdAndClassGroupId);
|
|
|
|
|
@@ -1695,6 +1716,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
List<ImGroupMember> imGroupMemberList = new ArrayList<>();
|
|
|
List<ClassGroupStudentMapper> classGroupStudentMappers=new ArrayList<>();
|
|
|
+
|
|
|
+ List<ClassGroupStudentMapper> classGroupStudentsList = classGroupStudentMapperDao.findByClassGroupAndStudent(classGroup.getId(), studentIds);
|
|
|
+ Map<Integer, List<ClassGroupStudentMapper>> classGroupStudentsMap = classGroupStudentsList.stream()
|
|
|
+ .collect(Collectors.groupingBy(ClassGroupStudentMapper::getUserId));
|
|
|
+
|
|
|
//生成学生单课缴费信息
|
|
|
for (Integer studentId:studentIds) {
|
|
|
SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(studentId);
|
|
@@ -1721,13 +1747,22 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
sysUserCashAccountService.updateCourseBalance(studentId,sysUserCashAccount.getCourseBalance().subtract(surplusCoursesPrice));
|
|
|
|
|
|
//创建班级学生关联记录
|
|
|
- ClassGroupStudentMapper classGroupStudentMapper=new ClassGroupStudentMapper();
|
|
|
- classGroupStudentMapper.setGroupType(classGroup.getGroupType());
|
|
|
- classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
- classGroupStudentMapper.setClassGroupId(classGroup.getId());
|
|
|
- classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
- classGroupStudentMapper.setUserId(studentId);
|
|
|
- classGroupStudentMappers.add(classGroupStudentMapper);
|
|
|
+ ClassGroupStudentMapper classGroupStudentMapper;
|
|
|
+
|
|
|
+ List<ClassGroupStudentMapper> classGroupStudents = classGroupStudentsMap.get(studentId);
|
|
|
+ if(!CollectionUtils.isEmpty(classGroupStudents)){
|
|
|
+ classGroupStudentMapper = classGroupStudents.get(0);
|
|
|
+ classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
+ classGroupStudentMapperDao.update(classGroupStudentMapper);
|
|
|
+ }else{
|
|
|
+ classGroupStudentMapper=new ClassGroupStudentMapper();
|
|
|
+ classGroupStudentMapper.setGroupType(classGroup.getGroupType());
|
|
|
+ classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
+ classGroupStudentMapper.setClassGroupId(classGroup.getId());
|
|
|
+ classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
+ classGroupStudentMapper.setUserId(studentId);
|
|
|
+ classGroupStudentMappers.add(classGroupStudentMapper);
|
|
|
+ }
|
|
|
|
|
|
imGroupMemberList.add(new ImGroupMember(studentId.toString()));
|
|
|
}
|