| | |
| | | log.info("文章列表解析"); |
| | | Long companyId = (Long) node.getSystemDataValue("companyId"); |
| | | Articles param = (Articles) node.getParam(); |
| | | |
| | | ArticleEntity article = new ArticleEntity(); |
| | | Page<ArticleEntity> page = new Page<>(Integer.parseInt(param.getPage()), Integer.parseInt(param.getLimit())); |
| | | if (StrUtil.isEmpty(param.getColId())) { |
| | | Page<ArticleEntity> page = new Page<>(Integer.parseInt(param.getPage()), Integer.parseInt(param.getLimit())); |
| | | |
| | | ArticleEntity article = new ArticleEntity(); |
| | | article.setColumnCode(param.getCode()); |
| | | article.setCompanyId(companyId); |
| | | IPage<ArticleEntity> listPage = articleMapper.selectArticleInPage(page, article); |
| | | |
| | | List<ArticleData> list = new ArrayList<>(); |
| | | for (ArticleEntity record : listPage.getRecords()) { |
| | | ArticleData articleData = entityToData(record); |
| | | list.add(articleData); |
| | | } |
| | | |
| | | node.setData(list); |
| | | } else { |
| | | List<String> colIdsStr = StrUtil.split(param.getColId(), ','); |
| | | List<Long> colIds = new ArrayList<>(); |
| | | colIdsStr.forEach(item -> { |
| | | colIds.add(Long.parseLong(item)); |
| | | }); |
| | | |
| | | article.setColumnIds(colIds); |
| | | } |
| | | article.setCompanyId(companyId); |
| | | |
| | | Integer releaseType = (Integer) node.getSystemDataValue("releaseType"); |
| | | if (releaseType == null) { |
| | | article.setReleaseType(2); |
| | | } else { |
| | | article.setReleaseType(releaseType); |
| | | } |
| | | |
| | | IPage<ArticleEntity> listPage = articleMapper.selectArticleInPage(page, article); |
| | | |
| | | List<ArticleData> list = new ArrayList<>(); |
| | | for (ArticleEntity record : listPage.getRecords()) { |
| | | ArticleData articleData = entityToData(record); |
| | | list.add(articleData); |
| | | } |
| | | |
| | | node.setData(list); |
| | | } |
| | | |
| | | public ArticleData entityToData(ArticleEntity article) { |