|
@@ -1,5 +1,6 @@
|
|
|
package com.cyksj.task;
|
|
package com.cyksj.task;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
@@ -10,12 +11,10 @@ import com.cyksj.mapper.GoodsDonMapper;
|
|
|
import com.cyksj.mapper.RegisterAccountDataMapper;
|
|
import com.cyksj.mapper.RegisterAccountDataMapper;
|
|
|
import com.cyksj.mapper.RegisterOrderDonMapper;
|
|
import com.cyksj.mapper.RegisterOrderDonMapper;
|
|
|
import com.cyksj.mapper.corp.CorpUserAuthMapper;
|
|
import com.cyksj.mapper.corp.CorpUserAuthMapper;
|
|
|
-import com.cyksj.mapper.manage.statistics.AppleOneDataMapper;
|
|
|
|
|
-import com.cyksj.mapper.manage.statistics.RealGoodsDataMapper;
|
|
|
|
|
-import com.cyksj.mapper.manage.statistics.StatisticsUserDataMapper;
|
|
|
|
|
-import com.cyksj.mapper.manage.statistics.StreamingAccountDataMapper;
|
|
|
|
|
|
|
+import com.cyksj.mapper.manage.statistics.*;
|
|
|
import com.cyksj.model.entity.*;
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.views.CorpUserTagView;
|
|
import com.cyksj.model.views.CorpUserTagView;
|
|
|
|
|
+import com.cyksj.model.views.StatisticsGoodsDataView;
|
|
|
import com.cyksj.service.mange.CmsAccountService;
|
|
import com.cyksj.service.mange.CmsAccountService;
|
|
|
import com.cyksj.service.mange.CmsGoodsDonSkuService;
|
|
import com.cyksj.service.mange.CmsGoodsDonSkuService;
|
|
|
import com.cyksj.service.order.OrderDonService;
|
|
import com.cyksj.service.order.OrderDonService;
|
|
@@ -70,6 +69,8 @@ public class StatisticsDataScheduler {
|
|
|
|
|
|
|
|
private final StatisticsUserDataMapper statisticsUserDataMapper;
|
|
private final StatisticsUserDataMapper statisticsUserDataMapper;
|
|
|
|
|
|
|
|
|
|
+ private final StatisticsFashionGoodsDataMapper statisticsFashionGoodsDataMapper;
|
|
|
|
|
+
|
|
|
private final BeanSearcher beanSearcher;
|
|
private final BeanSearcher beanSearcher;
|
|
|
|
|
|
|
|
private final CorpUserAuthMapper corpUserAuthMapper;
|
|
private final CorpUserAuthMapper corpUserAuthMapper;
|
|
@@ -91,7 +92,36 @@ public class StatisticsDataScheduler {
|
|
|
TASK_POOL.execute(() -> statisticsRegisterAccountData(yesZeroDate, thisZeroDate, false));
|
|
TASK_POOL.execute(() -> statisticsRegisterAccountData(yesZeroDate, thisZeroDate, false));
|
|
|
//用户数据统计
|
|
//用户数据统计
|
|
|
statisticsUserData(yesZeroDate, thisZeroDate);
|
|
statisticsUserData(yesZeroDate, thisZeroDate);
|
|
|
|
|
+ //潮玩好物数据统计
|
|
|
|
|
+ statisticsFashionGoodsData(yesZeroDate, thisZeroDate, false);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ public List<StatisticsFashionGoodsData> statisticsFashionGoodsData(Date yesZeroDate, Date thisZeroDate, Boolean today) {
|
|
|
|
|
+ //潮玩好物
|
|
|
|
|
+ List<GoodsDon> goodsDons = goodsDonMapper.selectList(Wrappers.lambdaQuery(GoodsDon.class).eq(GoodsDon::getType, Constant.realGoodsType.get(1)));
|
|
|
|
|
+ List<StatisticsFashionGoodsData> fashionGoodsData = new ArrayList<>();
|
|
|
|
|
+ goodsDons.forEach(goods->{
|
|
|
|
|
+ List<StatisticsGoodsDataView> goodsDataViews = beanSearcher.searchAll(StatisticsGoodsDataView.class, MapUtils.builder()
|
|
|
|
|
+ .field(StatisticsGoodsDataView::getGoodsId, goods.getId())
|
|
|
|
|
+ .put("time", String.format("od.created_time between '%s' and '%s'", yesZeroDate, thisZeroDate))
|
|
|
|
|
+ .build());
|
|
|
|
|
+ goodsDataViews.forEach(goodsDataView->{
|
|
|
|
|
+ StatisticsFashionGoodsData statisticsFashionGoodsData = new StatisticsFashionGoodsData();
|
|
|
|
|
+ BeanUtil.copyProperties(goodsDataView, statisticsFashionGoodsData);
|
|
|
|
|
+ fashionGoodsData.add(statisticsFashionGoodsData);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ if (today) {
|
|
|
|
|
+ return fashionGoodsData;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!fashionGoodsData.isEmpty()) {
|
|
|
|
|
+ fashionGoodsData.forEach(data -> {
|
|
|
|
|
+ data.setStatisticsDate(yesZeroDate);
|
|
|
|
|
+ statisticsFashionGoodsDataMapper.insert(data);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -252,7 +282,7 @@ public class StatisticsDataScheduler {
|
|
|
* 统计实物数据
|
|
* 统计实物数据
|
|
|
*/
|
|
*/
|
|
|
public List<RealGoodsData> statisticsRealGoodsData(Date yesZeroDate, Date thisZeroDate, Boolean today) {
|
|
public List<RealGoodsData> statisticsRealGoodsData(Date yesZeroDate, Date thisZeroDate, Boolean today) {
|
|
|
- List<GoodsDon> goodsDons = goodsDonMapper.selectList(Wrappers.lambdaQuery(GoodsDon.class).eq(GoodsDon::getType, 2));
|
|
|
|
|
|
|
+ List<GoodsDon> goodsDons = goodsDonMapper.selectList(Wrappers.lambdaQuery(GoodsDon.class).eq(GoodsDon::getType, Constant.realGoodsType.get(0)));
|
|
|
List<RealGoodsData> realGoodsDataList = new ArrayList<>();
|
|
List<RealGoodsData> realGoodsDataList = new ArrayList<>();
|
|
|
if (!goodsDons.isEmpty()) {
|
|
if (!goodsDons.isEmpty()) {
|
|
|
goodsDons.forEach(goods -> {
|
|
goodsDons.forEach(goods -> {
|