|
|
@@ -4,21 +4,19 @@ import com.goafanti.admin.bo.AdminStatisticsBo;
|
|
|
import com.goafanti.admin.service.AdminStatisticsService;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.dao.AdminMapper;
|
|
|
+import com.goafanti.common.model.AdminUserCount;
|
|
|
import com.goafanti.common.utils.DateUtils;
|
|
|
import com.goafanti.common.utils.LoggerUtils;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
|
-import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
public class AdminStatisticsServiceImpl implements AdminStatisticsService {
|
|
|
- private static final Integer TYPE_PRIVATE=0;
|
|
|
- private static final Integer TYPE_SIGN=2;
|
|
|
- private static final Integer TYPE_CHANNEL=3;
|
|
|
+
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
@@ -51,28 +49,48 @@ public class AdminStatisticsServiceImpl implements AdminStatisticsService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Cacheable(value = "adminStatisticeLists#300", key = "'key:'+#aid")
|
|
|
+// @Cacheable(value = "adminStatisticeLists#300", key = "'key:'+#aid")
|
|
|
public Object lists(String aid) {
|
|
|
//获取当月的列表
|
|
|
Map<String,Object> map=new HashMap<>();
|
|
|
Days days = new Days();
|
|
|
List thisMonth = getThisMonth(days);
|
|
|
- List<Integer> signList = adminMapper.thisMonthUserByType(thisMonth,days.firstDay,days.endDay, aid,TYPE_SIGN);
|
|
|
+ List<AdminUserCount> userList = adminMapper.thisMonthUser(days.firstDay,days.endDay, aid);
|
|
|
+ List<Integer> signList=new ArrayList<>();
|
|
|
+ List<Integer> privateList=new ArrayList<>();
|
|
|
+ List<Integer> channelList=new ArrayList<>();
|
|
|
+ List<Integer> userFollowList=new ArrayList<>();
|
|
|
+ List<Integer> orderList=new ArrayList<>();
|
|
|
+ int signCount=0,privateCount=0,channelCount=0,followCount=0,orderCount=0;
|
|
|
+ for (AdminUserCount e : userList) {
|
|
|
+ signCount=signCount+e.getSignCount();
|
|
|
+ int newSign=signCount;
|
|
|
+ signList.add(newSign);
|
|
|
+ privateCount=privateCount+e.getPrivateCount();
|
|
|
+ int newPrivate=privateCount;
|
|
|
+ privateList.add(newPrivate);
|
|
|
+ channelCount=channelCount+e.getChannelCount();
|
|
|
+ int newChannel=channelCount;
|
|
|
+ channelList.add(newChannel);
|
|
|
+ followCount=followCount+e.getFollowCount();
|
|
|
+ int newFollow=followCount;
|
|
|
+ channelList.add(newFollow);
|
|
|
+ orderCount=orderCount+e.getOrderCount();
|
|
|
+ int newOrder=orderCount;
|
|
|
+ channelList.add(newOrder);
|
|
|
+ }
|
|
|
map.put("dates",thisMonth);
|
|
|
map.put("signList",signList);
|
|
|
- List<Integer> privateList = adminMapper.thisMonthUserByType(thisMonth,days.firstDay,days.endDay, aid,TYPE_PRIVATE);
|
|
|
map.put("privateList",privateList);
|
|
|
- List<Integer> channelList = adminMapper.thisMonthUserByType(thisMonth,days.firstDay,days.endDay, aid,TYPE_CHANNEL);
|
|
|
map.put("channelList",channelList);
|
|
|
- //公出企业数
|
|
|
- List<Integer> publicReleaseList = adminMapper.thisMonthPublicRelease(thisMonth,days.firstDay, aid);
|
|
|
- map.put("publicReleaseList",publicReleaseList);
|
|
|
//跟进数
|
|
|
- List<Integer> userFollowList = adminMapper.thisMonthUserFollow(thisMonth, days.firstDay, aid);
|
|
|
map.put("userFollowList",userFollowList);
|
|
|
//订单数
|
|
|
- List<Integer> orderList = adminMapper.thisMonthOrderSum(thisMonth, days.firstDay, aid);
|
|
|
map.put("orderList",orderList);
|
|
|
+ //公出企业数
|
|
|
+ List<Integer> publicReleaseList = adminMapper.thisMonthPublicRelease(thisMonth,days.firstDay, aid);
|
|
|
+ map.put("publicReleaseList",publicReleaseList);
|
|
|
+
|
|
|
return map;
|
|
|
}
|
|
|
|