| | |
| | | if(StrUtil.isNotEmpty(title)){ |
| | | articleEntity.setTitle(title); |
| | | } |
| | | Integer contentType = adminArticleDto.getContentType() == null ? 0 : adminArticleDto.getContentType(); |
| | | if(contentType != 0){ |
| | | QueryWrapper<ColumnEntity> objectQueryWrapper = new QueryWrapper<>(); |
| | | objectQueryWrapper.eq("content_type",contentType); |
| | | List<ColumnEntity> columnEntities = columnMapper.selectList(objectQueryWrapper); |
| | | if(CollUtil.isNotEmpty(columnEntities)){ |
| | | List<Long> columIds = new ArrayList<>(); |
| | | for(ColumnEntity columnEntity : columnEntities){ |
| | | Long id = columnEntity.getId(); |
| | | columIds.add(id); |
| | | } |
| | | articleEntity.setColumnIds(columIds); |
| | | } |
| | | } |
| | | |
| | | if(UserEntity.USER_BELONG_TOP != companyId){ |
| | | articleEntity.setCompanyId(companyId); |
| | | } |
| | | IPage<AdminArticleVo> list = this.baseMapper.selectAdminArticleInPage(page,articleEntity); |
| | | if (CollUtil.isNotEmpty(list.getRecords())) { |
| | | for (AdminArticleVo record : list.getRecords()) { |
| | | // 站内 |
| | | if (record.getType() == 1) { |
| | | record.setArticleUrl(record.getBaseUrl() + record.getPath() + "/" + record.getId() + ".html"); |
| | | } |
| | | } |
| | | } |
| | | return Result.ok(list); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public Result updateStatusOn(Long id) { |
| | | Long companyId = LoginUserUtil.getCompanyId(); |
| | | ArticleEntity articleEntity = this.baseMapper.selectById(id); |
| | | if(ObjectUtil.isEmpty(articleEntity)){ |
| | | return Result.fail("文章不存在"); |
| | |
| | | articleEntity.setReleaseStatus(ArticleEntity.RELEASE_STATUS_YES); |
| | | this.baseMapper.updateById(articleEntity); |
| | | |
| | | releaseService.releaseArticle(articleEntity.getId()); |
| | | releaseService.releaseArticle(articleEntity.getId(), companyId); |
| | | return Result.ok("操作成功"); |
| | | } |
| | | |