|
@@ -2,8 +2,10 @@ package com.dayou.service.impl;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.dayou.dto.MajorStatisticalSelectDTO;
|
|
|
+import com.dayou.entity.User;
|
|
|
import com.dayou.mapper.MajorStatisticalStatementMapper;
|
|
|
import com.dayou.service.IUserService;
|
|
|
import com.dayou.service.IMajorStatisticalStatementService;
|
|
@@ -53,16 +55,23 @@ public class MajorStatisticalStatementServiceImpl implements IMajorStatisticalSt
|
|
|
* @return List<MajorLedgerVO>
|
|
|
*/
|
|
|
public List<MajorLedgerVO> setMembers(List<MajorLedgerVO> majorLedgerVOList){
|
|
|
+ // 获取用户信息
|
|
|
+ LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper<User>()
|
|
|
+ .select(User::getId, User::getName)
|
|
|
+ .eq(User::getDeleted, false);
|
|
|
+ List<User> userList = userService.list(lambdaQueryWrapper);
|
|
|
for (MajorLedgerVO majorLedgerVO : majorLedgerVOList){
|
|
|
if (ObjectUtil.isNotNull(majorLedgerVO.getMembers())) {
|
|
|
JSONArray jsonArray = JSONArray.parseArray(majorLedgerVO.getMembers());
|
|
|
List<Long> membersId = jsonArray.toJavaList(Long.class);
|
|
|
String names = null;
|
|
|
- for (Long id : membersId) {
|
|
|
- if (ObjectUtil.isNull(names)) {
|
|
|
- names = userService.getById(id).getName() + ';';
|
|
|
- } else {
|
|
|
- names += userService.getById(id).getName() + ';';
|
|
|
+ for (User user : userList) {
|
|
|
+ if (membersId.contains(user.getId())) {
|
|
|
+ if (ObjectUtil.isNull(names)) {
|
|
|
+ names = user.getName() + ';';
|
|
|
+ } else {
|
|
|
+ names += user.getName() + ';';
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
majorLedgerVO.setMembers(names);
|