| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.TreeSet; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | |
| | | import com.panzhihua.service_community.util.WxDataUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | |
| | | |
| | | @Autowired |
| | | private CommunityService communityService; |
| | | |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | /** |
| | | * 新增社区 |
| | |
| | | public R getScreenStatics() { |
| | | ScreenStatics screenStatics = comActDAO.getScreenStatics(); |
| | | WxDataUtil wxDataUtil=new WxDataUtil(); |
| | | //微信查询较慢 数据时有 时没有 缓存到 redis 里 |
| | | //日 活跃 |
| | | if(null != wxDataUtil.getDayUser()){ |
| | | stringRedisTemplate.opsForValue().set("WxDataUtil_Day",String.valueOf(wxDataUtil.getDayUser())); |
| | | screenStatics.setDayUser(wxDataUtil.getDayUser()); |
| | | }else { |
| | | Object obj = stringRedisTemplate.opsForValue().get("WxDataUtil_Day"); |
| | | screenStatics.setDayUser((Integer)obj); |
| | | } |
| | | //月 活跃 |
| | | if(null != wxDataUtil.getMonthUser()){ |
| | | stringRedisTemplate.opsForValue().set("WxDataUtil_Month",String.valueOf(wxDataUtil.getMonthUser())); |
| | | screenStatics.setCountUser(wxDataUtil.getMonthUser()); |
| | | }else { |
| | | Object obj = stringRedisTemplate.opsForValue().get("WxDataUtil_Day"); |
| | | screenStatics.setCountUser((Integer) obj); |
| | | } |
| | | return R.ok(screenStatics); |
| | | } |
| | | |