|
|
@ -1587,10 +1587,10 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
// 1.草稿
|
|
|
|
DraftEntity draft = ConvertUtils.sourceToTarget(formDTO, DraftEntity.class); |
|
|
|
draft.setDepartmentId(customerId); |
|
|
|
draft.setPreviewContent(getPreviewContent(formDTO.getContent()).length() > DraftConstant.PREVIEW_CONTENT_MAX_LENGTH ? getPreviewContent(formDTO.getContent()).substring(NumConstant.ZERO,DraftConstant.PREVIEW_CONTENT_MAX_LENGTH) : getPreviewContent(formDTO.getContent())); |
|
|
|
draft.setPreviewContent(StringUtils.isBlank(formDTO.getContent()) ? "" : getPreviewContent(formDTO.getContent()).length() > DraftConstant.PREVIEW_CONTENT_MAX_LENGTH ? getPreviewContent(formDTO.getContent()).substring(NumConstant.ZERO,DraftConstant.PREVIEW_CONTENT_MAX_LENGTH) : getPreviewContent(formDTO.getContent())); |
|
|
|
draft.setPublishRangeDesc(CollectionUtils.isEmpty(formDTO.getPublishRangeDesc()) ? "" : formDTO.getPublishRangeDesc().stream().collect(Collectors.joining("、"))); |
|
|
|
draft.setPublisherId(formDTO.getPublisher()); |
|
|
|
draft.setPublishDate(DateUtils.stringToDate(formDTO.getPublishDate(),DateUtils.DATE_PATTERN)); |
|
|
|
draft.setPublisherId(StringUtils.isBlank(formDTO.getPublisher()) ? "" : formDTO.getPublisher()); |
|
|
|
draft.setPublishDate(StringUtils.isBlank(formDTO.getPublishDate()) ? null : DateUtils.stringToDate(formDTO.getPublishDate(),DateUtils.DATE_PATTERN)); |
|
|
|
draft.setTags(CollectionUtils.isEmpty(formDTO.getTagNameList()) ? "" : formDTO.getTagNameList().stream().collect(Collectors.joining("|"))); |
|
|
|
draft.setOrgId(staffInfo.getAgencyId()); |
|
|
|
draft.setOrgIdPath(StringUtils.isBlank(agencyInfo.getPids()) || agencyInfo.getPids().equals(NumConstant.ZERO_STR) ? agencyInfo.getId() : agencyInfo.getPids().concat(":").concat(agencyInfo.getId())); |
|
|
@ -1601,13 +1601,15 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
draft.setRichTextFlag(NumConstant.ONE_STR); |
|
|
|
draftDao.insert(draft); |
|
|
|
// 2.内容
|
|
|
|
DraftContentEntity draftContent = ConvertUtils.sourceToTarget(draft, DraftContentEntity.class); |
|
|
|
draftContent.setCustomerId(customerId); |
|
|
|
draftContent.setDraftId(draft.getId()); |
|
|
|
draftContent.setContent(formDTO.getContent()); |
|
|
|
draftContent.setContentType("rich_text"); |
|
|
|
draftContent.setOrderNum(NumConstant.ZERO); |
|
|
|
draftContentDao.insert(draftContent); |
|
|
|
if (StringUtils.isNotBlank(formDTO.getContent())){ |
|
|
|
DraftContentEntity draftContent = ConvertUtils.sourceToTarget(draft, DraftContentEntity.class); |
|
|
|
draftContent.setCustomerId(customerId); |
|
|
|
draftContent.setDraftId(draft.getId()); |
|
|
|
draftContent.setContent(formDTO.getContent()); |
|
|
|
draftContent.setContentType("rich_text"); |
|
|
|
draftContent.setOrderNum(NumConstant.ZERO); |
|
|
|
draftContentDao.insert(draftContent); |
|
|
|
} |
|
|
|
// 3.发布范围
|
|
|
|
if (!CollectionUtils.isEmpty(formDTO.getGridIdList())){ |
|
|
|
List<DraftPublishRangeEntity> rangeList = new ArrayList<>(); |
|
|
|