|
@@ -27,6 +27,7 @@ import com.jeeplus.sys.feign.IPostApi;
|
|
|
import com.jeeplus.sys.feign.IRoleApi;
|
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
|
import com.jeeplus.sys.service.dto.*;
|
|
|
+import javafx.geometry.Pos;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -35,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author 王强
|
|
@@ -108,6 +110,44 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
queryWrapper.like("a.name",projectReportData.getName());
|
|
|
}
|
|
|
IPage<ExportDTO> list = mapper.exportList(page, queryWrapper);
|
|
|
+ for (ExportDTO record : list.getRecords()) {
|
|
|
+ //根据用户查询岗位和角色信息
|
|
|
+ if (ObjectUtil.isNotEmpty(record)){
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getById(record.getUserId());
|
|
|
+ if (userDTO != null){
|
|
|
+ if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())){
|
|
|
+ StringBuilder roleBuilder = new StringBuilder();
|
|
|
+ for (RoleDTO roleDTO : userDTO.getRoleDTOList()) {
|
|
|
+ RoleDTO dto = SpringUtil.getBean(IRoleApi.class).getRoleDTOByIdForApp(roleDTO.getId());
|
|
|
+ if (ObjectUtil.isNotEmpty(dto)){
|
|
|
+ roleBuilder.append(dto.getName()).append(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 去掉最后一个多余的逗号
|
|
|
+ if (roleBuilder.length() > 0) {
|
|
|
+ roleBuilder.setLength(roleBuilder.length() - 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ record.setRole(roleBuilder.toString());
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(userDTO.getPostDTOList())){
|
|
|
+ StringBuilder postBuilder = new StringBuilder();
|
|
|
+ for (PostDTO postDTO : userDTO.getPostDTOList()) {
|
|
|
+ PostDTO dto = SpringUtil.getBean(IPostApi.class).getPostDTOById(postDTO.getId());
|
|
|
+ if (ObjectUtil.isNotEmpty(dto)){
|
|
|
+ postBuilder.append(dto.getName()).append(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 去掉最后一个多余的逗号
|
|
|
+ if (postBuilder.length() > 0) {
|
|
|
+ postBuilder.setLength(postBuilder.length() - 1);
|
|
|
+ }
|
|
|
+ record.setPost(postBuilder.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return list;
|
|
|
|
|
|
}
|