From b7d136dc298e5234204a1ab239fed833f627b4fe Mon Sep 17 00:00:00 2001 From: tangxiaobao <303826152@qq.com> Date: 星期二, 24 八月 2021 16:26:00 +0800 Subject: [PATCH] 修改测试服下载文件地址 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java index b91f7cd..3df20cb 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java @@ -5,6 +5,8 @@ import javax.annotation.Resource; +import com.panzhihua.service_community.dao.ComActActEvaluateDAO; +import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; import org.apache.commons.lang3.time.DateUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -50,6 +52,8 @@ private ComActActSignDAO comActActSignDAO; @Resource private UserService userService; + @Resource + private ComActActEvaluateDAO comActActEvaluateDAO; /** * 新增社区活动 @@ -263,6 +267,18 @@ public R listActivitySigns(ActivitySignVO activitySignVO) { List<ActivitySignVO> activitySignVOS = comActActSignDAO.listActivitySigns(activitySignVO); return R.ok(activitySignVOS); + } + + @Override + public R pageActivityRegists(ComActActEvaluateVO comActActEvaluateVO) { + IPage<ComActActEvaluateVO> comActActEvaluateVOIPage = comActActEvaluateDAO + .pageActivityRegists(new Page(comActActEvaluateVO.getPageNum(), comActActEvaluateVO.getPageSize()), comActActEvaluateVO); + return R.ok(comActActEvaluateVOIPage); + } + + @Override + public R getEvaluateListsByIds(List<Long> ids) { + return R.ok(comActActEvaluateDAO.getEvaluateListsByIds(ids)); } /** @@ -489,6 +505,16 @@ page.setSize(pageSize); page.setCurrent(pageNum); IPage<ComActActivityVO> iPage = comActActivityDAO.pageActivityCommunityBack(page, comActActivityVO); + iPage.getRecords().forEach(vo ->{ + List<ComActActEvaluateDO> comActActEvaluateDOList = comActActEvaluateDAO + .selectList(new QueryWrapper<ComActActEvaluateDO>().lambda().eq(ComActActEvaluateDO::getActivityId, vo.getId())); + if (comActActEvaluateDOList != null && comActActEvaluateDOList.size() != 0) { + //总星级 + int starNum = comActActEvaluateDOList.stream().mapToInt(ComActActEvaluateDO::getStarLevel).sum(); + //评分星级=总星级/总评价人数 + vo.setEvaluateLevel(Double.valueOf(starNum/comActActEvaluateDOList.size())); + } + }); return R.ok(iPage); } -- Gitblit v1.7.1