|
@ -45,21 +45,15 @@ import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.result.*; |
|
|
import com.epmet.dto.result.*; |
|
|
import com.epmet.entity.*; |
|
|
import com.epmet.entity.*; |
|
|
import com.epmet.feign.EpmetUserSelfFeignClient; |
|
|
import com.epmet.feign.EpmetUserSelfFeignClient; |
|
|
import com.epmet.dto.form.ArticlePageFormDTO; |
|
|
|
|
|
import com.epmet.dto.form.CommonArticleListFormDTO; |
|
|
|
|
|
import com.epmet.dto.result.ArticleBannerResultDTO; |
|
|
|
|
|
import com.epmet.dto.result.ArticleLatestResultDTO; |
|
|
|
|
|
import com.epmet.dto.result.ArticleListResultDTO; |
|
|
|
|
|
import com.epmet.entity.ArticleEntity; |
|
|
|
|
|
import com.epmet.redis.ArticleRedis; |
|
|
import com.epmet.redis.ArticleRedis; |
|
|
import com.epmet.service.ArticleOperateRecordService; |
|
|
import com.epmet.service.ArticleOperateRecordService; |
|
|
import com.epmet.service.ArticlePublishRangeService; |
|
|
import com.epmet.service.ArticlePublishRangeService; |
|
|
import com.epmet.service.ArticleService; |
|
|
import com.epmet.service.ArticleService; |
|
|
import com.epmet.utils.ModuleConstant; |
|
|
import com.epmet.utils.ModuleConstant; |
|
|
|
|
|
import com.epmet.service.ArticleVisitRecordService; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import com.epmet.service.ArticleVisitRecordService; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
@ -205,20 +199,12 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
draftEntity = new DraftEntity(); |
|
|
draftEntity = new DraftEntity(); |
|
|
draftEntity.setTitle(fromDTO.getTitle()); |
|
|
draftEntity.setTitle(fromDTO.getTitle()); |
|
|
draftEntity.setCustomerId(tokenDto.getCustomerId()); |
|
|
draftEntity.setCustomerId(tokenDto.getCustomerId()); |
|
|
draftEntity.setPreviewContent(""); |
|
|
draftEntity.setIsTop(DraftConstant.UN_TOP); |
|
|
draftEntity.setIsTop(0); |
|
|
draftEntity.setStatusFlag(DraftConstant.UNPUBLISH); |
|
|
draftEntity.setPublishRangeDesc(""); |
|
|
|
|
|
draftEntity.setPublisherId(""); |
|
|
|
|
|
draftEntity.setPublisherName(""); |
|
|
|
|
|
draftEntity.setPublisherType(""); |
|
|
|
|
|
draftEntity.setPublishDate(new Date()); |
|
|
|
|
|
draftEntity.setStatusFlag(""); |
|
|
|
|
|
draftEntity.setTags(""); |
|
|
|
|
|
draftEntity.setOrgId(""); |
|
|
draftEntity.setOrgId(""); |
|
|
draftEntity.setOrgIdPath(""); |
|
|
draftEntity.setOrgIdPath(""); |
|
|
draftEntity.setGridId(""); |
|
|
draftEntity.setGridId(""); |
|
|
draftEntity.setDepartmentId(""); |
|
|
draftEntity.setDepartmentId(""); |
|
|
draftEntity.setRevision(0); |
|
|
|
|
|
draftEntity.setDelFlag(NumConstant.ZERO_STR); |
|
|
draftEntity.setDelFlag(NumConstant.ZERO_STR); |
|
|
|
|
|
|
|
|
draftDao.insert(draftEntity); |
|
|
draftDao.insert(draftEntity); |
|
@ -266,16 +252,21 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
} |
|
|
} |
|
|
draftEntity.setIsTop(fromDTO.getIsTop()); |
|
|
draftEntity.setIsTop(fromDTO.getIsTop()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//发布单位
|
|
|
//发布单位
|
|
|
String publisher = fromDTO.getPublisher(); |
|
|
if (StringUtils.isNotBlank(fromDTO.getPublisher())){ |
|
|
String publisherType = fromDTO.getPublisherType(); |
|
|
String publisherType = fromDTO.getPublisherType(); |
|
|
//TODO 根据发布类型 获取对应的名称
|
|
|
String publisherName = fromDTO.getPublisherName(); |
|
|
|
|
|
if (StringUtils.isBlank(publisherType) || StringUtils.isBlank(publisherName)) { |
|
|
if(StringUtils.isNotBlank(fromDTO.getPublishDate())){ |
|
|
log.warn("saveDraftAttr publisher info is illegal,publisher:{},publisherType:{},publisherName:{}",fromDTO.getPublisher(),publisherType,publisherName); |
|
|
draftEntity.setPublishDate(DateUtils.stringToDate(fromDTO.getPublishDate(),DateUtils.DATE_PATTERN)); |
|
|
throw new RenException("发布单位不能为空"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
draftEntity.setPublisherName(fromDTO.getPublisherName()); |
|
|
|
|
|
draftEntity.setPublisherId(fromDTO.getPublisher()); |
|
|
|
|
|
draftEntity.setPublisherType(fromDTO.getPublisher()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draftEntity.setPublishDate(DateUtils.stringToDate(fromDTO.getPublishDate(),DateUtils.DATE_PATTERN)); |
|
|
|
|
|
|
|
|
//封面
|
|
|
//封面
|
|
|
DraftCoverEntity coverEntity = buildCoverEntity(tokenDto, fromDTO); |
|
|
DraftCoverEntity coverEntity = buildCoverEntity(tokenDto, fromDTO); |
|
@ -345,10 +336,6 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
draftPublishRangeDao.deleteByMap(draftIdMap); |
|
|
draftPublishRangeDao.deleteByMap(draftIdMap); |
|
|
if (CollectionUtils.isEmpty(publishRangeEntityList)){ |
|
|
|
|
|
log.warn("saveOrUpdateAttr publishRangeEntityList is empty"); |
|
|
|
|
|
throw new RenException("参数错误"); |
|
|
|
|
|
} |
|
|
|
|
|
if (!CollectionUtils.isEmpty(publishRangeEntityList)){ |
|
|
if (!CollectionUtils.isEmpty(publishRangeEntityList)){ |
|
|
publishRangeEntityList.forEach(publishRange->draftPublishRangeDao.insert(publishRange)); |
|
|
publishRangeEntityList.forEach(publishRange->draftPublishRangeDao.insert(publishRange)); |
|
|
} |
|
|
} |
|
|