Browse Source

Merge remote-tracking branch 'origin/dev_voice' into dev

master
handaolin 5 years ago
parent
commit
301c05aaf4
  1. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java
  2. 14
      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/java/com/epmet/service/impl/TagServiceImpl.java
  4. 5
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml

2
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java

@ -44,6 +44,8 @@ public interface TagConstant {
String SUCCESS_UPDATE = "更新标签缓存成功... ...";
String FAILURE_UPDATE = "更新标签缓存失败... ...";
String SELECT_GRIDIDLIST_FAILURE = "查询gridId集合数量为0";
}

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

@ -890,7 +890,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
}
/**
* @Description 更新DB的标签使用次数
* @Description 更新DB的标签使用次数 政府端
* @param draftId
* @author zxc
*/
@ -903,7 +903,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
String userId = tokenDto.getUserId();
List<String> tagsList = Arrays.asList(tags.split("\\|"));
List<UpdateTagUseCountsResultDTO> tagsInfo = new ArrayList<>();
//政府端的 标签使用次数 DB和redis更新(zSet)
//政府端的 标签使用次数 DB
for (String tag : tagsList) {
UpdateTagUseCountsResultDTO updateTagUseCount = tagCustomerService.checkTagInfo(tag, customerId, userId);
tagsInfo.add(updateTagUseCount);
@ -915,7 +915,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
}
/**
* @Description 更新redis 标签使用数量 标签级联
* @Description 更新redis 标签使用数量 标签级联 政府端
* @param formDto
* @author zxc
*/
@ -941,7 +941,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
}
/**
* @Description 更新数据库 网格下的标签使用数量
* @Description 更新数据库 网格下的标签使用数量 居民端
* @param draftId
* @param formDto
* @author zxc
@ -953,7 +953,11 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
String customerId = draft.getCustomerId();
List<UpdateTagUseCountsResultDTO> tagsInfo = formDto.getTagsInfo();
String userId = tokenDto.getUserId();
//根据草稿id查询发布范围id集合
List<String> gridIds = articlePublishRangeDao.selectGridIdByDraftId(draftId);
if (gridIds.size() == NumConstant.ZERO){
throw new RenException(TagConstant.SELECT_GRIDIDLIST_FAILURE);
}
List<UpdateGridTagsFormDTO> gridTags = new ArrayList<>();
List<UpdateGridTagCacheDTO> gridTagCache = new ArrayList<>();
for (String gridId : gridIds) {
@ -976,7 +980,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
}
/**
* @Description 更新redis 网格下的 标签使用数量 级联标签
* @Description 更新redis 网格下的 标签使用数量 级联标签 居民端
* @param gridTagCache
* @author zxc
*/

2
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java

@ -43,7 +43,7 @@ public class TagServiceImpl implements TagService {
*/
@Override
public List<TagInfoResultDTO> resiTagList(ResiTagListFormDTO formDto) {
//校验 在本网格是否发布过文章
//校验 客户在本网格是否发布过文章
Integer articleCounts = articleDao.checkPublishArticle(formDto);
if (articleCounts== NumConstant.ZERO){
return new ArrayList<>();

5
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml

@ -34,16 +34,17 @@
ORDER BY
ac.ORDER_NUM ASC
</select>
<!-- 校验 客户在本网格是否发布过文章 -->
<select id="checkPublishArticle" resultType="integer" parameterType="com.epmet.dto.form.ResiTagListFormDTO">
SELECT
COUNT(*) AS articleCounts
FROM
article
article_publish_range
WHERE
del_flag = 0
AND grid_id = #{gridId}
AND customer_id = #{customerId}
AND created_by = #{userId}
</select>
<select id="selectArticleListForAgency" resultType="com.epmet.dto.result.PublishedListResultDTO">

Loading…
Cancel
Save