From 886c5c2cf1379adb23ba9880d4d54f4a669befaa Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 24 Jun 2021 12:46:34 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E6=9B=B4=E6=96=B0bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/EpmetPointOpenFeignClient.java | 14 +++++++ .../EpmetPointOpenFeignClientFallback.java | 15 ++++++++ .../controller/GroupPointController.java | 16 ++++++++ .../service/BizPointTotalDetailService.java | 9 +++++ .../impl/BizPointTotalDetailServiceImpl.java | 19 ++++++++++ .../ResiGroupOpenFeignClientFallback.java | 2 +- .../resi-group/resi-group-server/pom.xml | 6 +++ .../modules/group/redis/ResiGroupRedis.java | 37 +++++++++++++++++-- 8 files changed, 114 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java index 63ffc6a3c0..ac882ae2e2 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java +++ b/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 initPointRule(); + + /** + * 获取小组积分 + * @author zhaoqifeng + * @date 2021/6/24 12:24 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("/point/group/point/pointdetail") + Result getGroupPoint(@RequestBody GroupPointFormDTO formDTO); + } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java index ab0688e134..a54f0b5eab 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java +++ b/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 initPointRule() { return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "initPointRule"); } + + /** + * 获取小组积分 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2021/6/24 12:24 + */ + @Override + public Result getGroupPoint(GroupPointFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "formDTO"); + } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java index eed49d25d6..6c2d36a7a3 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java +++ b/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().ok(result); } + + /** + * 获取小组积分 + * @author zhaoqifeng + * @date 2021/6/24 12:17 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("pointdetail") + public Result getGroupPoint(@RequestBody GroupPointFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.GroupPoint.class); + BizPointTotalDetailDTO result = bizPointTotalDetailService.getGroupPoint(formDTO); + return new Result().ok(result); + } + } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java index f72e49ba39..8a81ff5ffb 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java @@ -126,4 +126,13 @@ public interface BizPointTotalDetailService extends BaseService groupPointRanking(GroupPointFormDTO formDTO); + + /** + * 获取小组积分 + * @author zhaoqifeng + * @date 2021/6/24 12:17 + * @param formDTO + * @return com.epmet.dto.BizPointTotalDetailDTO + */ + BizPointTotalDetailDTO getGroupPoint(GroupPointFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java index d2398b4b00..c1a7dbe14b 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java +++ b/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 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); + } + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index 2db52e0d76..a5e3eb06fe 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -197,7 +197,7 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien * @date 2021/4/21 16:30 */ @Override - public Result groupPointDetail(@RequestBody GroupPointDetailFormDTO formDTO) { + public Result groupPointDetail(GroupPointDetailFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "groupPointDetail", formDTO); } diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index 018f200219..856b79afc0 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -124,6 +124,12 @@ 2.0.0 compile + + com.epmet + epmet-point-client + 2.0.0 + compile + diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java index 9d52a420b1..5cb1b48027 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java +++ b/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 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 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; } From 08ee589f3ab7055454850a628cac70a62c9c63ce Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 24 Jun 2021 12:54:03 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E6=9B=B4=E6=96=B0bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/modules/group/controller/ResiGroupController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index 2bf8988434..e3d5565f29 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java @@ -561,7 +561,7 @@ public class ResiGroupController { * @param formDTO * @return com.epmet.commons.tools.utils.Result */ - @PostMapping("groupPointDetail/{groupId}") + @PostMapping("groupPointDetail") public Result groupPointDetail(@RequestBody GroupPointDetailFormDTO formDTO) { return new Result().ok(resiGroupService.groupPointDetail(formDTO)); } From 6c222ff7b315cda29653f3b7bbc06d61af80a470 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 24 Jun 2021 13:07:12 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E6=9B=B4=E6=96=B0bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/feign/EpmetPointOpenFeignClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java index ac882ae2e2..55d2970a5e 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java @@ -45,7 +45,7 @@ public interface EpmetPointOpenFeignClient { * @param formDTO * @return com.epmet.commons.tools.utils.Result */ - @PostMapping("/point/group/point/pointdetail") + @PostMapping("/point/group/point/grouppoint") Result getGroupPoint(@RequestBody GroupPointFormDTO formDTO); } From 9edcd2e361219daeb29c0c4deef6459446cfeff0 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 24 Jun 2021 13:12:48 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E6=9B=B4=E6=96=B0bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/GroupPointController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java index 6c2d36a7a3..9fd48f00a1 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java @@ -106,7 +106,7 @@ public class GroupPointController { * @param formDTO * @return com.epmet.commons.tools.utils.Result */ - @PostMapping("pointdetail") + @PostMapping("grouppoint") public Result getGroupPoint(@RequestBody GroupPointFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.GroupPoint.class); BizPointTotalDetailDTO result = bizPointTotalDetailService.getGroupPoint(formDTO); From 72497851b4de0e6912d5249a23d49f8beda0990f Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 24 Jun 2021 19:59:02 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=88=97=E8=A1=A8=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8F=82=E6=95=B0=20=E5=8C=85=E5=90=AB=E5=92=8C=E4=B8=8D?= =?UTF-8?q?=E5=8C=85=E5=90=AB=E7=9A=84=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/CommonArticleListFormDTO.java | 9 ++ .../main/java/com/epmet/dao/ArticleDao.java | 122 +++++++++--------- .../service/impl/ArticleServiceImpl.java | 2 +- .../src/main/resources/logback-spring.xml | 2 +- .../src/main/resources/mapper/ArticleDao.xml | 14 +- 5 files changed, 86 insertions(+), 63 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java index 5602cabf48..e86357966e 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java +++ b/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; + } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java index 39109fbc0b..b0c4af6252 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java +++ b/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 { /** - * 政府端查询文章详情 - * - * @param articleId - * 文章id - */ + * 政府端查询文章详情 + * + * @param articleId 文章id + */ GovArticleDetailResultDTO queryGovArticleDetail(String articleId); /** - * 政府端查询文章详情-内容 - * - * @param articleId - * 文章id - */ + * 政府端查询文章详情-内容 + * + * @param articleId 文章id + */ List 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 + * @author zhaoqifeng + * @date 2020/6/2 16:59 */ @DataFilter(tableAliases = "a", gridIdsArgName = "gridList") List selectArticleListForAgency(@Param("customerId") String customerId, @Param("tagIdList") List tagIdList, Set gridList); /** * 已发布列表---网格工作人员 - * @author zhaoqifeng - * @date 2020/6/5 16:35 + * * @param customerId * @param tagIdList * @param gridList * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/5 16:35 */ List selectArticleListForGrid(@Param("customerId") String customerId, @Param("tagIdList") List tagIdList, - @Param("gridList")Set gridList); + @Param("gridList") Set gridList); /** * 已下线文章列表 - * @author zhaoqifeng - * @date 2020/6/3 15:16 + * * @param gridList * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/3 15:16 */ @DataFilter(tableAliases = "a", gridIdsArgName = "gridList") List selectOfflineList(Set gridList); /** - * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 - * @param gridId - * @param num - * @return List - * @author wangc - * @date 2020.06.02 16:04 - **/ - List selectTopArticleMsg (@Param("gridId")String gridId,@Param("num")Integer num); + * @param gridId + * @param num + * @return List + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @author wangc + * @date 2020.06.02 16:04 + **/ + List selectTopArticleMsg(@Param("gridId") String gridId, @Param("num") Integer num); /** - * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端最新文章列表 - * @param gridId - * @param num - * @return List - * @author wangc - * @date 2020.06.02 16:04 - **/ - List selectLatestArticleMsg(@Param("gridId")String gridId,@Param("num")Integer num); + * @param gridId + * @param tagName + * @param excludeTagName + * @param num + * @return List + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端最新文章列表 + * @author wangc + * @date 2020.06.02 16:04 + **/ + List 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 - * @author wangc - * @date 2020.06.03 14:19 - **/ - List selectArticleList(@Param("gridId") String gridId, @Param("tagIdList")List tagIdList); + * @param gridId + * @param tagIdList + * @return List + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @author wangc + * @date 2020.06.03 14:19 + **/ + List selectArticleList(@Param("gridId") String gridId, @Param("tagIdList") List 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); -} \ No newline at end of file + * @param draftId + * @Description 根据draftId获取文章id + * @author zxc + */ + String getArticleIdByDraftId(@Param("draftId") String draftId); +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index d00baf70d3..d7786573ff 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/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 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()); } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/logback-spring.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/logback-spring.xml index da83651e0c..a2d26ca0d7 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/logback-spring.xml @@ -139,7 +139,7 @@ - + diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index 924f52a59f..d039eb85d8 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/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' + + GROUP BY art.ID + HAVING + + FIND_IN_SET(#{tagName},tags) + + + AND !FIND_IN_SET(#{excludeTagName},tags) + + ORDER BY art.PUBLISH_DATE DESC , art.CREATED_TIME DESC LIMIT #{num}