Browse Source

Merge remote-tracking branch 'remotes/origin/dev_article_fix' into develop

dev_shibei_match
jianjun 4 years ago
parent
commit
de9683656a
  1. 14
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java
  2. 15
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java
  3. 16
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java
  4. 9
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java
  5. 19
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java
  6. 9
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java
  7. 122
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java
  8. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  9. 2
      epmet-module/gov-voice/gov-voice-server/src/main/resources/logback-spring.xml
  10. 14
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml
  11. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
  12. 6
      epmet-module/resi-group/resi-group-server/pom.xml
  13. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  14. 37
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java

14
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java

@ -2,12 +2,15 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.BizPointTotalDetailDTO;
import com.epmet.dto.InitPointRuleResultDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.feign.fallback.EpmetPointOpenFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -34,4 +37,15 @@ public interface EpmetPointOpenFeignClient {
**/
@PostMapping("/point/opback/initpointrule")
Result<InitPointRuleResultDTO> initPointRule();
/**
* 获取小组积分
* @author zhaoqifeng
* @date 2021/6/24 12:24
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.BizPointTotalDetailDTO>
*/
@PostMapping("/point/group/point/grouppoint")
Result<BizPointTotalDetailDTO> getGroupPoint(@RequestBody GroupPointFormDTO formDTO);
}

15
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java

@ -3,8 +3,10 @@ package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.BizPointTotalDetailDTO;
import com.epmet.dto.InitPointRuleResultDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.feign.EpmetPointOpenFeignClient;
import org.springframework.stereotype.Component;
@ -26,4 +28,17 @@ public class EpmetPointOpenFeignClientFallback implements EpmetPointOpenFeignCli
public Result<InitPointRuleResultDTO> initPointRule() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "initPointRule");
}
/**
* 获取小组积分
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.BizPointTotalDetailDTO>
* @author zhaoqifeng
* @date 2021/6/24 12:24
*/
@Override
public Result<BizPointTotalDetailDTO> getGroupPoint(GroupPointFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "formDTO");
}
}

16
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.BizPointTotalDetailDTO;
import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.dto.result.GroupPointRankingResultDTO;
import com.epmet.dto.result.GroupPointRuleResultDTO;
@ -97,4 +98,19 @@ public class GroupPointController {
result.setGroupSummary(ModuleConstant.GROUP_RULE_SUMMARY);
return new Result<GroupPointRuleResultDTO>().ok(result);
}
/**
* 获取小组积分
* @author zhaoqifeng
* @date 2021/6/24 12:17
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.BizPointTotalDetailDTO>
*/
@PostMapping("grouppoint")
public Result<BizPointTotalDetailDTO> getGroupPoint(@RequestBody GroupPointFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.GroupPoint.class);
BizPointTotalDetailDTO result = bizPointTotalDetailService.getGroupPoint(formDTO);
return new Result<BizPointTotalDetailDTO>().ok(result);
}
}

9
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java

@ -126,4 +126,13 @@ public interface BizPointTotalDetailService extends BaseService<BizPointTotalDet
* @date 2021/4/21 14:05
*/
List<GroupPointRankingResultDTO> groupPointRanking(GroupPointFormDTO formDTO);
/**
* 获取小组积分
* @author zhaoqifeng
* @date 2021/6/24 12:17
* @param formDTO
* @return com.epmet.dto.BizPointTotalDetailDTO
*/
BizPointTotalDetailDTO getGroupPoint(GroupPointFormDTO formDTO);
}

19
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -220,4 +221,22 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
return list;
}
/**
* 获取小组积分
*
* @param formDTO
* @return com.epmet.dto.BizPointTotalDetailDTO
* @author zhaoqifeng
* @date 2021/6/24 12:17
*/
@Override
public BizPointTotalDetailDTO getGroupPoint(GroupPointFormDTO formDTO) {
LambdaQueryWrapper<BizPointTotalDetailEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BizPointTotalDetailEntity :: getBizType, "group")
.eq(BizPointTotalDetailEntity ::getObjectId, formDTO.getGroupId())
.eq(BizPointTotalDetailEntity ::getDelFlag, NumConstant.ZERO_STR);
BizPointTotalDetailEntity entity = baseDao.selectOne(wrapper);
return ConvertUtils.sourceToTarget(entity, BizPointTotalDetailDTO.class);
}
}

9
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java

@ -31,4 +31,13 @@ public class CommonArticleListFormDTO implements Serializable {
* */
private Integer num;
/**
* 标签名称(高级配置里的参数)
* */
private String tagName;
/**
* 排除的标签名称(高级配置里的参数)
* */
private String excludeTagName;
}

122
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java

@ -23,7 +23,6 @@ import com.epmet.dto.result.GovArticleDetailResultDTO;
import com.epmet.dto.result.ArticleBannerResultDTO;
import com.epmet.dto.result.ArticleDetailResultDTO;
import com.epmet.dto.result.ArticleLatestResultDTO;
import com.epmet.dto.result.ArticleWithTagsResultDTO;
import com.epmet.entity.ArticleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -41,107 +40,110 @@ import java.util.Set;
public interface ArticleDao extends BaseDao<ArticleEntity> {
/**
* 政府端查询文章详情
*
* @param articleId
* 文章id
*/
* 政府端查询文章详情
*
* @param articleId 文章id
*/
GovArticleDetailResultDTO queryGovArticleDetail(String articleId);
/**
* 政府端查询文章详情-内容
*
* @param articleId
* 文章id
*/
* 政府端查询文章详情-内容
*
* @param articleId 文章id
*/
List<GovArticleContentDTO> queryGovArticleContent(String articleId);
/**
* @Description
* @param formDto
* @author zxc
*/
* @param formDto
* @Description
* @author zxc
*/
Integer checkPublishArticle(ResiTagListFormDTO formDto);
/**
* 已发布列表---组织工作人员
* @author zhaoqifeng
* @date 2020/6/2 16:59
*
* @param customerId
* @param tagIdList
* @return java.util.List<com.epmet.dto.result.PublishedListResultDTO>
* @author zhaoqifeng
* @date 2020/6/2 16:59
*/
@DataFilter(tableAliases = "a", gridIdsArgName = "gridList")
List<PublishedListResultDTO> selectArticleListForAgency(@Param("customerId") String customerId, @Param("tagIdList") List<String> tagIdList, Set<String> gridList);
/**
* 已发布列表---网格工作人员
* @author zhaoqifeng
* @date 2020/6/5 16:35
*
* @param customerId
* @param tagIdList
* @param gridList
* @return java.util.List<com.epmet.dto.result.PublishedListResultDTO>
* @author zhaoqifeng
* @date 2020/6/5 16:35
*/
List<PublishedListResultDTO> selectArticleListForGrid(@Param("customerId") String customerId,
@Param("tagIdList") List<String> tagIdList,
@Param("gridList")Set<String> gridList);
@Param("gridList") Set<String> gridList);
/**
* 已下线文章列表
* @author zhaoqifeng
* @date 2020/6/3 15:16
*
* @param gridList
* @return java.util.List<com.epmet.dto.result.OfflineListResultDTO>
* @author zhaoqifeng
* @date 2020/6/3 15:16
*/
@DataFilter(tableAliases = "a", gridIdsArgName = "gridList")
List<OfflineListResultDTO> selectOfflineList(Set<String> gridList);
/**
* @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播
* @param gridId
* @param num
* @return List<ArticleBannerResultDTO>
* @author wangc
* @date 2020.06.02 16:04
**/
List<ArticleBannerResultDTO> selectTopArticleMsg (@Param("gridId")String gridId,@Param("num")Integer num);
* @param gridId
* @param num
* @return List<ArticleBannerResultDTO>
* @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播
* @author wangc
* @date 2020.06.02 16:04
**/
List<ArticleBannerResultDTO> selectTopArticleMsg(@Param("gridId") String gridId, @Param("num") Integer num);
/**
* @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端最新文章列表
* @param gridId
* @param num
* @return List<ArticleBannerResultDTO>
* @author wangc
* @date 2020.06.02 16:04
**/
List<ArticleLatestResultDTO> selectLatestArticleMsg(@Param("gridId")String gridId,@Param("num")Integer num);
* @param gridId
* @param tagName
* @param excludeTagName
* @param num
* @return List<ArticleBannerResultDTO>
* @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端最新文章列表
* @author wangc
* @date 2020.06.02 16:04
**/
List<ArticleLatestResultDTO> selectLatestArticleMsg(@Param("gridId") String gridId, @Param("tagName") String tagName, @Param("excludeTagName") String excludeTagName, @Param("num") Integer num);
/**
* @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表
* @param gridId
* @param tagIdList
* @return List<ArticleListResultDTO>
* @author wangc
* @date 2020.06.03 14:19
**/
List<ArticleListResultDTO> selectArticleList(@Param("gridId") String gridId, @Param("tagIdList")List<String> tagIdList);
* @param gridId
* @param tagIdList
* @return List<ArticleListResultDTO>
* @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表
* @author wangc
* @date 2020.06.03 14:19
**/
List<ArticleListResultDTO> selectArticleList(@Param("gridId") String gridId, @Param("tagIdList") List<String> tagIdList);
/**
* @Description 根绝文章Id查询出文章的内容封面等相关信息如果居民端传入的网格Id不在该文章的发布范围内则返回NULL
* @param gridId
* @param articleId
* @return ArticleDetailResultDTO
* @author wangc
* @date 2020.06.03 18:28
**/
ArticleDetailResultDTO selectArticleDetail(@Param("gridId")String gridId,@Param("articleId")String articleId);
* @param gridId
* @param articleId
* @return ArticleDetailResultDTO
* @Description 根绝文章Id查询出文章的内容封面等相关信息如果居民端传入的网格Id不在该文章的发布范围内则返回NULL
* @author wangc
* @date 2020.06.03 18:28
**/
ArticleDetailResultDTO selectArticleDetail(@Param("gridId") String gridId, @Param("articleId") String articleId);
/**
* @Description 根据draftId获取文章id
* @param draftId
* @author zxc
*/
String getArticleIdByDraftId(@Param("draftId")String draftId);
}
* @param draftId
* @Description 根据draftId获取文章id
* @author zxc
*/
String getArticleIdByDraftId(@Param("draftId") String draftId);
}

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

@ -688,7 +688,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
**/
@Override
public List<ArticleLatestResultDTO> getLatestArticleList(CommonArticleListFormDTO commonArticleListFormDTO) {
return baseDao.selectLatestArticleMsg(commonArticleListFormDTO.getGridId(),
return baseDao.selectLatestArticleMsg(commonArticleListFormDTO.getGridId(),commonArticleListFormDTO.getTagName(),commonArticleListFormDTO.getExcludeTagName(),
null == commonArticleListFormDTO.getNum() || commonArticleListFormDTO.getNum() <= NumConstant.ZERO ?
NumConstant.FIVE : commonArticleListFormDTO.getNum());
}

2
epmet-module/gov-voice/gov-voice-server/src/main/resources/logback-spring.xml

@ -139,7 +139,7 @@
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<springProfile name="local,dev,test">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>

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

@ -193,9 +193,11 @@
art.TITLE AS articleTitle ,
IFNULL(artcover.IMG_URL,'') AS articleCoverImg,
art.PUBLISHER_NAME AS publishName,
art.PUBLISH_DATE AS publishDate
art.PUBLISH_DATE AS publishDate,
group_concat(tag.TAG_NAME) tags #条件筛选用
FROM
ARTICLE art
LEFT JOIN article_tags tag ON tag.ARTICLE_ID = art.ID AND tag.DEL_FLAG = '0'
LEFT JOIN (
SELECT
@ -222,7 +224,17 @@
art.DEL_FLAG = '0'
AND
art.STATUS_FLAG = 'published'
<if test="(tagName != null and tagName != '') or (excludeTagName != null and excludeTagName != '')">
GROUP BY art.ID
HAVING
<if test="tagName != null and tagName != ''">
FIND_IN_SET(#{tagName},tags)
</if>
<if test="excludeTagName != null and excludeTagName != ''">
AND !FIND_IN_SET(#{excludeTagName},tags)
</if>
</if>
ORDER BY art.PUBLISH_DATE DESC , art.CREATED_TIME DESC
LIMIT #{num}
</select>

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java

@ -204,7 +204,7 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien
* @date 2021/4/21 16:30
*/
@Override
public Result<GroupPointDetailResultDTO> groupPointDetail(@RequestBody GroupPointDetailFormDTO formDTO) {
public Result<GroupPointDetailResultDTO> groupPointDetail(GroupPointDetailFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "groupPointDetail", formDTO);
}

6
epmet-module/resi-group/resi-group-server/pom.xml

@ -124,6 +124,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-point-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java

@ -560,7 +560,7 @@ public class ResiGroupController {
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO>
*/
@PostMapping("groupPointDetail/{groupId}")
@PostMapping("groupPointDetail")
public Result<GroupPointDetailResultDTO> groupPointDetail(@RequestBody GroupPointDetailFormDTO formDTO) {
return new Result<GroupPointDetailResultDTO>().ok(resiGroupService.groupPointDetail(formDTO));
}

37
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java

@ -19,15 +19,20 @@ package com.epmet.modules.group.redis;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.BizPointTotalDetailDTO;
import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.feign.EpmetPointOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.constant.ResiGroupRedisKeys;
import com.epmet.modules.group.service.ResiGroupService;
import com.epmet.modules.group.service.ResiGroupStatisticalService;
import com.epmet.modules.support.GroupLevelUtils;
import com.epmet.modules.utils.ModuleConstant;
import com.epmet.resi.group.constant.TopicConstant;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
@ -64,6 +69,8 @@ public class ResiGroupRedis {
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private EpmetPointOpenFeignClient epmetPointOpenFeignClient;
public void delete(Object[] ids) {
@ -92,16 +99,37 @@ public class ResiGroupRedis {
public ResiGroupInfoRedisDTO get(String groupId){
if(StringUtils.isNotBlank(groupId)){
GroupPointFormDTO groupPointFormDTO = new GroupPointFormDTO();
groupPointFormDTO.setGroupId(groupId);
Result<BizPointTotalDetailDTO> bizPointTotalDetailResult = epmetPointOpenFeignClient.getGroupPoint(groupPointFormDTO);
if (!bizPointTotalDetailResult.success()) {
throw new RenException(bizPointTotalDetailResult.getCode(), bizPointTotalDetailResult.getMsg());
}
Integer level = 1;
if (null != bizPointTotalDetailResult.getData()) {
level = GroupLevelUtils.getLevel(bizPointTotalDetailResult.getData().getTotalPoint());
if (null == level) {
level = 1;
}
}
ResiGroupDTO groupMySql = groupService.get(groupId);
if (!level.equals(groupMySql.getLevel())) {
ResiGroupDTO dto = new ResiGroupDTO();
dto.setId(groupMySql.getId());
dto.setLevel(level);
groupService.update(dto);
}
ResiGroupInfoRedisDTO groupCache = (ResiGroupInfoRedisDTO)
redisUtils.get(ResiGroupRedisKeys.getResiGroupInfoKey(groupId));
if(null == groupCache || StringUtils.isBlank(groupCache.getGroupId()) || null == groupCache.getGroupStatisticalInfo()){
//如果缓存中没有该组信息,从数据库中查询并放入缓存
ResiGroupDTO groupMySql = groupService.get(groupId);
if(null != groupMySql && StringUtils.isNotBlank(groupMySql.getId())){
if(StringUtils.isNotBlank(groupMySql.getId())){
ResiGroupInfoRedisDTO groupRedis = ConvertUtils.sourceToTarget(groupMySql,ResiGroupInfoRedisDTO.class);
groupRedis.setGroupId(groupMySql.getId());
groupRedis.setGroupState(groupMySql.getState());
groupRedis.setLevel("LV" + groupMySql.getLevel());
groupRedis.setLevel("LV" + level);
Map<String,Object> param = new HashMap<>();
param.put(TopicConstant.RESI_GROUP_ID,groupId);
param.put(FieldConstant.DEL_FLAG, NumConstant.ZERO_STR);
@ -127,6 +155,9 @@ public class ResiGroupRedis {
//返回数据
return groupRedis;
}
} else {
groupCache.setLevel("LV" + level);
set(groupCache);
}
return groupCache;
}

Loading…
Cancel
Save