|
|
@ -131,6 +131,9 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
@Autowired |
|
|
|
private DraftPublishRangeService draftPublishRangeService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private CategoryDictDao categoryDictDao; |
|
|
|
|
|
|
|
@Value("${openapi.scan.server.url}") |
|
|
|
private String scanApiUrl; |
|
|
|
@Value("${openapi.scan.method.imgSyncScan}") |
|
|
@ -1558,6 +1561,21 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
articleContent.setContentType("rich_text"); |
|
|
|
articleContent.setOrderNum(NumConstant.ONE); |
|
|
|
articleContentDao.insert(articleContent); |
|
|
|
// 2.1 附件
|
|
|
|
if(!CollectionUtils.isEmpty(formDTO.getFileList())){ |
|
|
|
int orderNum=2; |
|
|
|
for(AddOrSaveDraftFormDTO.ContentDTO file:formDTO.getFileList()){ |
|
|
|
ArticleContentEntity fileDto=new ArticleContentEntity(); |
|
|
|
fileDto.setCustomerId(formDTO.getCustomerId()); |
|
|
|
fileDto.setArticleId(article.getId()); |
|
|
|
fileDto.setContent(file.getContent()); |
|
|
|
fileDto.setFileName(file.getFileName()); |
|
|
|
fileDto.setContentType("file"); |
|
|
|
fileDto.setOrderNum(orderNum); |
|
|
|
articleContentDao.insert(fileDto); |
|
|
|
orderNum++; |
|
|
|
} |
|
|
|
} |
|
|
|
// 3.操作记录
|
|
|
|
ArticleOperateRecordEntity articleOperateRecord = new ArticleOperateRecordEntity(); |
|
|
|
articleOperateRecord.setCustomerId(customerId); |
|
|
@ -1644,6 +1662,22 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
draftContent.setOrderNum(NumConstant.ZERO); |
|
|
|
draftContentDao.insert(draftContent); |
|
|
|
} |
|
|
|
// 2.1 附件
|
|
|
|
if(!CollectionUtils.isEmpty(formDTO.getFileList())){ |
|
|
|
int orderNum=2; |
|
|
|
for(AddOrSaveDraftFormDTO.ContentDTO file:formDTO.getFileList()){ |
|
|
|
DraftContentEntity fileDto=new DraftContentEntity(); |
|
|
|
fileDto.setCustomerId(formDTO.getCustomerId()); |
|
|
|
fileDto.setDraftId(draft.getId()); |
|
|
|
fileDto.setContent(file.getContent()); |
|
|
|
fileDto.setFileName(file.getFileName()); |
|
|
|
fileDto.setContentType("file"); |
|
|
|
fileDto.setOrderNum(orderNum); |
|
|
|
draftContentDao.insert(fileDto); |
|
|
|
orderNum++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 3.发布范围
|
|
|
|
if (!CollectionUtils.isEmpty(formDTO.getGridIdList())){ |
|
|
|
List<DraftPublishRangeEntity> rangeList = new ArrayList<>(); |
|
|
@ -1728,6 +1762,20 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
formDTO.setAgencyId(staffInfo.getAgencyId()); |
|
|
|
//列表查询
|
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); |
|
|
|
|
|
|
|
// 查询子栏目
|
|
|
|
String categoryId; |
|
|
|
List<String> subCategories; |
|
|
|
if (StringUtils.isNotBlank(categoryId = formDTO.getCategory())) { |
|
|
|
LambdaQueryWrapper<CategoryDictEntity> cq = new LambdaQueryWrapper<>(); |
|
|
|
cq.eq(CategoryDictEntity::getPid, categoryId); |
|
|
|
List<CategoryDictEntity> subCtgs = categoryDictDao.selectList(cq); |
|
|
|
if (! CollectionUtils.isEmpty(subCtgs)) { |
|
|
|
subCategories = subCtgs.stream().map(CategoryDictEntity::getId).collect(Collectors.toList()); |
|
|
|
formDTO.setSubCategories(subCategories); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<PublishedListResultDTO> list = baseDao.selectAllArticle(formDTO); |
|
|
|
PageInfo<PublishedListResultDTO> pageInfo = new PageInfo<>(list); |
|
|
|
|
|
|
@ -1790,6 +1838,12 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
resultDTO.setTagIdList(contentList); |
|
|
|
} |
|
|
|
|
|
|
|
// 栏目
|
|
|
|
CategoryDictEntity categoryDict = categoryDictDao.selectById(resultDTO.getCategory()); |
|
|
|
if (categoryDict != null) { |
|
|
|
resultDTO.setCategoryName(categoryDict.getCategoryName()); |
|
|
|
} |
|
|
|
|
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
@ -1871,6 +1925,32 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
articleContent1.setOrderNum(NumConstant.ONE); |
|
|
|
articleContentDao.insert(articleContent1); |
|
|
|
} |
|
|
|
// 2.1 附件
|
|
|
|
if(!CollectionUtils.isEmpty(formDTO.getFileList())){ |
|
|
|
int orderNum=2; |
|
|
|
for(UpdateArticleFormDTO.ContentDTO file:formDTO.getFileList()){ |
|
|
|
if(StringUtils.isNotBlank(file.getFileId())){ |
|
|
|
LambdaUpdateWrapper<ArticleContentEntity> updateWrapper=new LambdaUpdateWrapper<>(); |
|
|
|
updateWrapper.set(ArticleContentEntity::getContent,file.getContent()) |
|
|
|
.set(ArticleContentEntity::getFileName,file.getFileName()) |
|
|
|
.set(ArticleContentEntity::getUpdatedBy,EpmetRequestHolder.getLoginUserId()) |
|
|
|
.set(ArticleContentEntity::getUpdatedTime,new Date()) |
|
|
|
.set(ArticleContentEntity::getOrderNum,orderNum) |
|
|
|
.eq(ArticleContentEntity::getId,file.getFileId()); |
|
|
|
articleContentDao.update(null,updateWrapper); |
|
|
|
}else{ |
|
|
|
ArticleContentEntity fileDto=new ArticleContentEntity(); |
|
|
|
fileDto.setCustomerId(formDTO.getCustomerId()); |
|
|
|
fileDto.setArticleId(formDTO.getArticleId()); |
|
|
|
fileDto.setContent(file.getContent()); |
|
|
|
fileDto.setFileName(file.getFileName()); |
|
|
|
fileDto.setContentType("file"); |
|
|
|
fileDto.setOrderNum(orderNum); |
|
|
|
articleContentDao.insert(fileDto); |
|
|
|
} |
|
|
|
orderNum++; |
|
|
|
} |
|
|
|
} |
|
|
|
// 3.操作记录
|
|
|
|
ArticleOperateRecordEntity articleOperateRecord = new ArticleOperateRecordEntity(); |
|
|
|
articleOperateRecord.setCustomerId(formDTO.getCustomerId()); |
|
|
|