| | |
| | | package com.xcong.farmer.cms.modules.system.service.Impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringPool; |
| | |
| | | } |
| | | Integer contentType = adminArticleDto.getContentType() == null ? 0 : adminArticleDto.getContentType(); |
| | | if(contentType != 0){ |
| | | articleEntity.setContentType(adminArticleDto.getContentType()); |
| | | 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); |