Helius
2022-07-07 13e6ab361c22eafb9556a847e28f8deaba5335c3
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java
@@ -15,6 +15,7 @@
import com.xcong.farmer.cms.modules.system.mapper.ColumnMapper;
import com.xcong.farmer.cms.modules.system.mapper.CompanyMapper;
import com.xcong.farmer.cms.modules.system.service.IArticleService;
import com.xcong.farmer.cms.modules.system.service.IReleaseService;
import com.xcong.farmer.cms.modules.system.util.LoginUserUtil;
import com.xcong.farmer.cms.modules.system.vo.AdminArticleVo;
import com.xcong.farmer.cms.modules.system.vo.AdminSeeArticleInfoVo;
@@ -46,7 +47,7 @@
    private CompanyMapper companyMapper;
    @Autowired
    private ICmsCoreService cmsCoreService;
    private IReleaseService releaseService;
    @Override
    public Result getArticleInPage(AdminArticleDto adminArticleDto) {
@@ -54,14 +55,14 @@
        long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
        Page<AdminArticleVo> page = new Page<>(adminArticleDto.getPageNum(), adminArticleDto.getPageSize());
        ArticleEntity articleEntity = new ArticleEntity();
        String columnIdStr = adminArticleDto.getColumnId();
        if(StrUtil.isNotEmpty(columnIdStr)){
            long[] columnIdLongs = StrUtil.splitToLong(columnIdStr, StrUtil.COMMA);
        String columnIdStrs = adminArticleDto.getColumnIdStr();
        if(StrUtil.isNotEmpty(columnIdStrs)){
            String[] columnIdStr = columnIdStrs.split(StringPool.COMMA);
            List<Long> columnList = new ArrayList<>();
            for(long columnIdLong : columnIdLongs){
                columnList.add(columnIdLong);
            for(String columnIdString : columnIdStr){
                columnList.add(Long.valueOf(columnIdString));
            }
            articleEntity.setColumnlist(columnList);
            articleEntity.setColumnList(columnList);
        }
        String title = adminArticleDto.getTitle();
        if(StrUtil.isNotEmpty(title)){
@@ -298,6 +299,8 @@
        articleEntity.setReleaseStatus(ArticleEntity.RELEASE_STATUS_YES);
        articleEntity.setReleaseTime(new Date());
        this.baseMapper.updateById(articleEntity);
        releaseService.releaseArticle(articleEntity.getId());
        return Result.ok("操作成功");
    }