|
|
@@ -78,6 +78,9 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
@Autowired
|
|
|
private TaskToUserDao taskToUserDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TechnicalArticlesDao technicalarticlesDao;
|
|
|
+
|
|
|
@Value("${agency}")
|
|
|
private String agencyId;
|
|
|
|
|
|
@@ -95,16 +98,16 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
public IndexDTO renderIndex() {
|
|
|
|
|
|
Pageable pageable = PageRequest.of(0, 10);
|
|
|
- //获取用户排名
|
|
|
- List<UserVO> userRanks = projectDao.findTotalPriceOfUser(pageable).stream().map(rankInfo -> {
|
|
|
- Optional<UserPO> userPO = userDao.findById(rankInfo.getEntityId());
|
|
|
- if (userPO.isPresent()) {
|
|
|
- UserVO userVO = new UserVO();
|
|
|
- userVO.setName(userPO.get().getName());
|
|
|
- userVO.setUserName(userPO.get().getUserName());
|
|
|
- userVO.setAllProjectPrice(rankInfo.getTotalPrice());
|
|
|
- return userVO;
|
|
|
- }
|
|
|
+ //获取用户排名
|
|
|
+ List<UserVO> userRanks = projectDao.findTotalPriceOfUser(pageable).stream().map(rankInfo -> {
|
|
|
+ Optional<UserPO> userPO = userDao.findById(rankInfo.getEntityId());
|
|
|
+ if (userPO.isPresent()) {
|
|
|
+ UserVO userVO = new UserVO();
|
|
|
+ userVO.setName(userPO.get().getName());
|
|
|
+ userVO.setUserName(userPO.get().getUserName());
|
|
|
+ userVO.setAllProjectPrice(rankInfo.getTotalPrice());
|
|
|
+ return userVO;
|
|
|
+ }
|
|
|
return null;
|
|
|
}).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
//获取机构排名
|
|
|
@@ -524,6 +527,26 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
}).collect(Collectors.toList()));
|
|
|
authingList.sort(Comparator.comparing(BaseAuthVO::getApplytime).reversed());
|
|
|
return authingList;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<TechnicalArticlesVO> technicalArticles(Pageable pageable) {
|
|
|
+ List<TechnicalArticlesVO> technicalArticlesVOList = new ArrayList<>();
|
|
|
+ technicalarticlesDao.findAll(pageable).forEach(technicalArticlesPO -> {
|
|
|
+ TechnicalArticlesVO technicalArticlesVO = new TechnicalArticlesVO();
|
|
|
+ technicalArticlesVO.setId(technicalArticlesPO.getId());
|
|
|
+ technicalArticlesVO.setName(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getName());
|
|
|
+ technicalArticlesVO.setPhotoUrl(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getPhotoUrl());
|
|
|
+ technicalArticlesVO.setArticlesUrl(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getArticlesUrl());
|
|
|
+ technicalArticlesVO.setAuthor(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getAuthor());
|
|
|
+ technicalArticlesVO.setSource(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getSource());
|
|
|
+ technicalArticlesVO.setReading(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getReading());
|
|
|
+ technicalArticlesVO.setCreateTime(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getCreateTime());
|
|
|
+ technicalArticlesVOList.add(technicalArticlesVO);
|
|
|
+ });
|
|
|
+ List<TechnicalArticlesVO> results = technicalArticlesVOList.stream().distinct().collect(Collectors.toList());
|
|
|
+ return results;
|
|
|
}
|
|
|
|
|
|
private ProjectOperationControl initProjectPermission(CrowdTestProject project, User user){
|