赵士淞
2023-03-21 7c73d4b482e10ae495b7d61a443d052a48fad57b
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/impl/ProjectServiceImpl.java
@@ -245,19 +245,22 @@
        for (int i = 0; i < projectDtoList.size(); i ++) {
            // 项目
            ProjectDto projectDto = projectDtoList.get(i);
            // 负责人ID列表
            List<Long> liableUserIdList = new ArrayList<>();
            // 负责人ID
            String handleLiableUserId = projectDto.getLiableUserId().replace("-", "");
            // 负责人ID列表
            String[] handleLiableUserIdList = handleLiableUserId.split(",");
            // 循环负责人ID列表
            for (String liableUserId : handleLiableUserIdList) {
            if (projectDto.getLiableUserId() != null && !"".equals(projectDto.getLiableUserId())) {
                // 负责人ID列表
                liableUserIdList.add(Long.valueOf(liableUserId));
                List<Long> liableUserIdList = new ArrayList<>();
                // 负责人ID
                String handleLiableUserId = projectDto.getLiableUserId().replace("-", "");
                // 负责人ID列表
                String[] handleLiableUserIdList = handleLiableUserId.split(",");
                // 循环负责人ID列表
                for (String liableUserId : handleLiableUserIdList) {
                    // 负责人ID列表
                    liableUserIdList.add(Long.valueOf(liableUserId));
                }
                // 负责人ID列表
                projectDto.setLiableUserIdList(liableUserIdList);
            }
            // 负责人ID列表
            projectDto.setLiableUserIdList(liableUserIdList);
        }
        return projectDtoList;
    }
@@ -380,16 +383,19 @@
            String unitCurrency = project.getUnitCurrency() != null ? dictDetailRepository.findByDictNameAndValue(Constant.STANDARD_UNIT_CURRENCY, project.getUnitCurrency()).getLabel() : "";
            // 负责人名称
            String liableUserName = null;
            // 处理后负责人ID
            String handleLiableUserId = project.getLiableUserId().replace("-", "");
            // 处理后负责人ID列表
            String[] handleLiableUserIdList = handleLiableUserId.split(",");
            // 循环处理后负责人ID列表
            for (String liableUserId : handleLiableUserIdList) {
                // 根据负责人ID查询用户信息
                User user = userRepository.findById(Long.valueOf(liableUserId)).orElseGet(User::new);
                // 判断负责人名称
                liableUserName = liableUserName == null ? user.getNickName() : liableUserName + "," + user.getNickName();
            if (project.getLiableUserId() != null && !"".equals(project.getLiableUserId())) {
                // 处理后负责人ID
                String handleLiableUserId = project.getLiableUserId().replace("-", "");
                // 处理后负责人ID列表
                String[] handleLiableUserIdList = handleLiableUserId.split(",");
                // 循环处理后负责人ID列表
                for (String liableUserId : handleLiableUserIdList) {
                    // 根据负责人ID查询用户信息
                    User user = userRepository.findById(Long.valueOf(liableUserId)).orElseGet(User::new);
                    // 判断负责人名称
                    liableUserName = liableUserName == null ? user.getNickName() : liableUserName + "," + user.getNickName();
                }
            }
            Map<String,Object> map = new LinkedHashMap<>();