Browse Source

Merge branch 'dev_voice' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev

dev_shibei_match
jianjun 5 years ago
parent
commit
ed9c22b7a9
  1. 3
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.java
  2. 34
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  3. 2
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml

3
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.java

@ -18,7 +18,6 @@
package com.epmet.dao; package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.DraftPublishRangeDTO;
import com.epmet.entity.DraftPublishRangeEntity; import com.epmet.entity.DraftPublishRangeEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -41,7 +40,7 @@ public interface DraftPublishRangeDao extends BaseDao<DraftPublishRangeEntity> {
* @author wangc * @author wangc
* @date 2020.06.05 10:28 * @date 2020.06.05 10:28
**/ **/
List<DraftPublishRangeDTO> selectByDraftId(@Param("draftId")String draftId); List<DraftPublishRangeEntity> selectByDraftId(@Param("draftId")String draftId);
/** /**
* @Description 根据草稿id查询发布范围id集合 * @Description 根据草稿id查询发布范围id集合

34
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -415,7 +415,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
if (!CollectionUtils.isEmpty(gridList)&&!CollectionUtils.isEmpty(gridIdList)) { if (!CollectionUtils.isEmpty(gridList)&&!CollectionUtils.isEmpty(gridIdList)) {
gridList.forEach(grid -> { gridList.forEach(grid -> {
if (gridIdList.contains(grid.getGridId())) { if (gridIdList.contains(grid.getGridId())) {
String agencyGridName = articleGridResultDTO.getAgencyName().concat("_").concat(grid.getGridName()); String agencyGridName = articleGridResultDTO.getAgencyName().concat("-").concat(grid.getGridName());
agencyGridNameList.add(agencyGridName); agencyGridNameList.add(agencyGridName);
DraftPublishRangeEntity draftPublishRangeEntity = new DraftPublishRangeEntity(); DraftPublishRangeEntity draftPublishRangeEntity = new DraftPublishRangeEntity();
draftPublishRangeEntity.setCustomerId(tokenDto.getCustomerId()); draftPublishRangeEntity.setCustomerId(tokenDto.getCustomerId());
@ -843,7 +843,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
//直接查询改草稿的 封面及内容 //直接查询改草稿的 封面及内容
List<DraftContentEntity> draftContents = draftContentDao.selectByDraftId(draftId,null); List<DraftContentEntity> draftContents = draftContentDao.selectByDraftId(draftId,null);
DraftCoverEntity draftCover = draftCoverDao.selectByDraftId(draftId,null); DraftCoverEntity draftCover = draftCoverDao.selectByDraftId(draftId,null);
List<DraftPublishRangeDTO> draftPublishRange = draftPublishRangeDao.selectByDraftId(draftId); List<DraftPublishRangeEntity> draftPublishRange = draftPublishRangeDao.selectByDraftId(draftId);
//3.生成文章以及相关记录 //3.生成文章以及相关记录
ArticleEntity article = ConvertUtils.sourceToTarget(draft,ArticleEntity.class); ArticleEntity article = ConvertUtils.sourceToTarget(draft,ArticleEntity.class);
@ -865,10 +865,12 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
} }
if(null != draftPublishRange && draftPublishRange.size() > NumConstant.ZERO){ if(null != draftPublishRange && draftPublishRange.size() > NumConstant.ZERO){
draftPublishRange.forEach(range -> { draftPublishRange.forEach(range -> {
range.setPublishStatus(DraftConstant.PUBLISHED);
ArticlePublishRangeEntity rangeToInsert = ConvertUtils.sourceToTarget(range,ArticlePublishRangeEntity.class); ArticlePublishRangeEntity rangeToInsert = ConvertUtils.sourceToTarget(range,ArticlePublishRangeEntity.class);
rangeToInsert.setArticleId(article.getId()); rangeToInsert.setArticleId(article.getId());
rangeToInsert.setId(null); rangeToInsert.setId(null);
articlePublishRangeDao.insert(rangeToInsert); articlePublishRangeDao.insert(rangeToInsert);
draftPublishRangeDao.updateById(range);
}); });
if(null != draftCover){ if(null != draftCover){
//draftCover.setAuditStatus(ModuleConstant.AUDIT_STATUS_PASS); //draftCover.setAuditStatus(ModuleConstant.AUDIT_STATUS_PASS);
@ -1005,6 +1007,9 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
updateAuditStatusFailById(draftId, syncScanResult); updateAuditStatusFailById(draftId, syncScanResult);
this.publishDraftToArticle(draft); this.publishDraftToArticle(draft);
UpdateCustomerTagCacheDTO updateCustomerTagCacheDTO = this.updateCustomerTag(tokenDto, draftId); UpdateCustomerTagCacheDTO updateCustomerTagCacheDTO = this.updateCustomerTag(tokenDto, draftId);
if (updateCustomerTagCacheDTO == null){
return;
}
List<UpdateGridTagCacheDTO> updateGridTagCacheDTOS = this.updateGridTag(tokenDto, draftId, updateCustomerTagCacheDTO); List<UpdateGridTagCacheDTO> updateGridTagCacheDTOS = this.updateGridTag(tokenDto, draftId, updateCustomerTagCacheDTO);
this.addArticleTags(updateCustomerTagCacheDTO, draftId, tokenDto); this.addArticleTags(updateCustomerTagCacheDTO, draftId, tokenDto);
@ -1089,16 +1094,21 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
String tags = draft.getTags(); String tags = draft.getTags();
String customerId = draft.getCustomerId(); String customerId = draft.getCustomerId();
String userId = tokenDto.getUserId(); String userId = tokenDto.getUserId();
List<String> tagsList = Arrays.asList(tags.split("\\|")); UpdateCustomerTagCacheDTO result = null;
List<UpdateTagUseCountsResultDTO> tagsInfo = new ArrayList<>(); if (StringUtils.isNotBlank(tags)){
//政府端的 标签使用次数 DB result = new UpdateCustomerTagCacheDTO();
tagsList.forEach(tag -> { List<String> tagsList = Arrays.asList(tags.split("\\|"));
UpdateTagUseCountsResultDTO updateTagUseCount = tagCustomerService.checkTagInfo(tag, customerId, userId); List<UpdateTagUseCountsResultDTO> tagsInfo = new ArrayList<>();
tagsInfo.add(updateTagUseCount); //政府端的 标签使用次数 DB
}); tagsList.forEach(tag -> {
UpdateCustomerTagCacheDTO result = new UpdateCustomerTagCacheDTO(); UpdateTagUseCountsResultDTO updateTagUseCount = tagCustomerService.checkTagInfo(tag, customerId, userId);
result.setCustomerId(customerId); tagsInfo.add(updateTagUseCount);
result.setTagsInfo(tagsInfo); });
result.setCustomerId(customerId);
result.setTagsInfo(tagsInfo);
}
return result; return result;
} }

2
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml

@ -4,7 +4,7 @@
<mapper namespace="com.epmet.dao.DraftPublishRangeDao"> <mapper namespace="com.epmet.dao.DraftPublishRangeDao">
<!-- 通过草稿Id获取草稿发布范围 --> <!-- 通过草稿Id获取草稿发布范围 -->
<select id="selectByDraftId" resultType="com.epmet.dto.DraftPublishRangeDTO"> <select id="selectByDraftId" resultType="com.epmet.entity.DraftPublishRangeEntity">
SELECT SELECT
CUSTOMER_ID, CUSTOMER_ID,
GRID_ID, GRID_ID,

Loading…
Cancel
Save