| | |
| | | |
| | | import static java.util.stream.Collectors.toList; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActActivityTypeVO; |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.*; |
| | |
| | | comActActivityVO.setComActActEvaluateVOList(comActActEvaluatePage.getRecords()); |
| | | //活动评价总数 |
| | | comActActivityVO.setEvaluateAmount(comActActEvaluatePage.getTotal()); |
| | | List<ComActActEvaluateDO> comActActEvaluateList = comActActEvaluateDAO |
| | | .selectList(new QueryWrapper<ComActActEvaluateDO>().lambda().eq(ComActActEvaluateDO::getActivityId, id)); |
| | | if (comActActEvaluateList != null && comActActEvaluateList.size() > 0) { |
| | | BigDecimal starNum = BigDecimal.ZERO; |
| | | //总星级 |
| | | for (ComActActEvaluateDO evaluate:comActActEvaluateList) { |
| | | starNum = starNum.add(BigDecimal.valueOf(evaluate.getStarLevel()==null?0:evaluate.getStarLevel())); |
| | | } |
| | | //评分星级(如果无评分默认5分)=总星级/总评价人数 |
| | | if(starNum.compareTo(BigDecimal.ZERO) == 0){ |
| | | comActActivityVO.setEvaluateLevel(BigDecimal.valueOf(5)); |
| | | }else{ |
| | | comActActivityVO.setEvaluateLevel(starNum.divide(BigDecimal.valueOf(comActActEvaluateList.size()),2, RoundingMode.HALF_UP)); |
| | | } |
| | | }else{ |
| | | comActActivityVO.setEvaluateLevel(BigDecimal.valueOf(5)); |
| | | } |
| | | //当前用户对活动的评分 |
| | | ComActActEvaluateVO userActEvaluateVO = comActActEvaluateDAO.getEvaluateListByUserId(id,userId); |
| | | if(userActEvaluateVO != null){ |
| | |
| | | //活动报名名单 |
| | | ActivitySignVO activitySignVO = new ActivitySignVO(); |
| | | activitySignVO.setActivityId(activityId); |
| | | activitySignVO.setStatus(1); |
| | | R r = comActActivityService.listActivitySigns(activitySignVO); |
| | | if (R.isOk(r)) { |
| | | List<ActivitySignVO> activitySignVOS = |
| | |
| | | * @return 社区集合 按照创建顺序倒序排列 |
| | | */ |
| | | @PostMapping("listcommunityall") |
| | | public R listCommunityAll() { |
| | | return comActService.listCommunityAll(); |
| | | public R listCommunityAll(@RequestParam("areaCode") String areaCode) { |
| | | return comActService.listCommunityAll(areaCode); |
| | | } |
| | | |
| | | /** |
| | |
| | | String openid = map.get("openid"); |
| | | try { |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(eldersAuthFeedbackAddDTO.getAreaCode(),5); |
| | | String accessToken = util.getAppAccessToken(); |
| | | WxUtil.sendSubscribeRZSH(openid, accessToken, "高龄认证", |
| | | DateUtils.format(eldersAuthDO.getCreateAt(), DateUtils.ymdhms_format), |
| | | eldersAuthFeedbackAddDTO.getFeedBack()); |
| | | eldersAuthFeedbackAddDTO.getFeedBack(),sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("推送审核状态订阅消息失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | * @return 社区列表 |
| | | */ |
| | | @GetMapping("/eventgrid/community/westList") |
| | | public R getWestCommunityLists() { |
| | | return comActService.getWestCommunityLists(); |
| | | public R getWestCommunityLists(String areaCode) { |
| | | return comActService.getWestCommunityLists(areaCode); |
| | | } |
| | | |
| | | /** |