|
@@ -1,11 +1,9 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
-import com.ym.mec.biz.dal.dao.ClassGroupDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentManageDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
|
|
|
-import com.ym.mec.biz.dal.dao.VipGroupDao;
|
|
|
+import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
+import com.ym.mec.biz.dal.entity.SysUserCashAccount;
|
|
|
import com.ym.mec.biz.dal.page.*;
|
|
|
import com.ym.mec.biz.service.StudentManageService;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
@@ -19,6 +17,7 @@ import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Author Joburgess
|
|
@@ -35,6 +34,8 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
private StudentPaymentOrderDao studentPaymentOrderDao;
|
|
|
@Autowired
|
|
|
private VipGroupDao vipGroupDao;
|
|
|
+ @Autowired
|
|
|
+ private SysUserCashAccountDao sysUserCashAccountDao;
|
|
|
|
|
|
@Override
|
|
|
public PageInfo findStudentsByOrganId(StudentManageQueryInfo queryInfo) {
|
|
@@ -48,6 +49,14 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
pageInfo.setTotal(count);
|
|
|
params.put("offset", pageInfo.getOffset());
|
|
|
dataList = studentManageDao.findStudentsByOrganId(params);
|
|
|
+ List<Integer> userIds = dataList.stream()
|
|
|
+ .map(StudentManageListDto::getUserId).collect(Collectors.toList());
|
|
|
+ List<SysUserCashAccount> byUserIds = sysUserCashAccountDao.findByUserIds(userIds);
|
|
|
+ Map<Integer, SysUserCashAccount> collect = byUserIds.stream()
|
|
|
+ .collect(Collectors.toMap(SysUserCashAccount::getUserId, sysUserCashAccount -> sysUserCashAccount));
|
|
|
+ dataList.forEach(studentManageListDto -> {
|
|
|
+ studentManageListDto.setCourseBalance(collect.get(studentManageListDto.getUserId()).getCourseBalance());
|
|
|
+ });
|
|
|
}
|
|
|
if (count == 0) {
|
|
|
dataList = new ArrayList<>();
|