|
@@ -12,6 +12,7 @@ import com.cyksj.enums.GatewayResponse;
|
|
|
import com.cyksj.mapper.*;
|
|
import com.cyksj.mapper.*;
|
|
|
import com.cyksj.mapper.manage.statistics.*;
|
|
import com.cyksj.mapper.manage.statistics.*;
|
|
|
import com.cyksj.mapper.shop.YhShopMapper;
|
|
import com.cyksj.mapper.shop.YhShopMapper;
|
|
|
|
|
+import com.cyksj.model.dto.MonthlyUserOrderDetailDto;
|
|
|
import com.cyksj.model.dto.NatureOrderDataDto;
|
|
import com.cyksj.model.dto.NatureOrderDataDto;
|
|
|
import com.cyksj.model.entity.*;
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.excel.ExcelAccountData;
|
|
import com.cyksj.model.excel.ExcelAccountData;
|
|
@@ -426,12 +427,28 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
|
|
|
case 4:
|
|
case 4:
|
|
|
getRenewOrderData(groupsDataStatisticsView, startDate, endDate);
|
|
getRenewOrderData(groupsDataStatisticsView, startDate, endDate);
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case 5:
|
|
|
|
|
+ getUnbindChannelOrderData(groupsDataStatisticsView, startDate, endDate);
|
|
|
|
|
+ break;
|
|
|
default:
|
|
default:
|
|
|
getSynthesisData(groupsDataStatisticsView, startDate, endDate);
|
|
getSynthesisData(groupsDataStatisticsView, startDate, endDate);
|
|
|
}
|
|
}
|
|
|
return groupsDataStatisticsView;
|
|
return groupsDataStatisticsView;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void getUnbindChannelOrderData(GroupsDataStatisticsView groupsDataStatisticsView, String startDate, String endDate) {
|
|
|
|
|
+ //解绑渠道
|
|
|
|
|
+ //流媒体
|
|
|
|
|
+ BigDecimal unBIndGroupsStreamingMoney = Optional.ofNullable(statisticsExportMapper.getMonthGoodsTypeAmountOfOrderByType(4, null, 2l, startDate, endDate)).orElse(BigDecimal.ZERO);
|
|
|
|
|
+ // AI销售金额
|
|
|
|
|
+ BigDecimal unBIndGroupsAiOrderMoney = Optional.ofNullable(statisticsExportMapper.getMonthGoodsTypeAmountOfOrderByType(4, null, 1l, startDate, endDate)).orElse(BigDecimal.ZERO);
|
|
|
|
|
+ //设备销售金额
|
|
|
|
|
+ BigDecimal unBIndGroupsEpOrderMoney = Optional.ofNullable(statisticsExportMapper.getMonthGoodsTypeAmountOfOrderByType(4, 2, null, startDate, endDate)).orElse(BigDecimal.ZERO);
|
|
|
|
|
+ groupsDataStatisticsView.setUnBIndGroupsStreamingMoney(unBIndGroupsStreamingMoney);
|
|
|
|
|
+ groupsDataStatisticsView.setUnBIndGroupsAiOrderMoney(unBIndGroupsAiOrderMoney);
|
|
|
|
|
+ groupsDataStatisticsView.setUnBIndGroupsEpOrderMoney(unBIndGroupsEpOrderMoney);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public void getNatureOrderData(GroupsDataStatisticsView groupsDataStatisticsView, String startDate, String endDate) {
|
|
public void getNatureOrderData(GroupsDataStatisticsView groupsDataStatisticsView, String startDate, String endDate) {
|
|
|
List<NatureOrderDataDto> orderDataList = statisticsExportMapper.getGroupsOrderData(startDate, endDate);
|
|
List<NatureOrderDataDto> orderDataList = statisticsExportMapper.getGroupsOrderData(startDate, endDate);
|
|
|
orderDataList.forEach(data -> {
|
|
orderDataList.forEach(data -> {
|
|
@@ -447,6 +464,9 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
|
|
|
if (data.getType() == 3) {
|
|
if (data.getType() == 3) {
|
|
|
groupsDataStatisticsView.setChannelMoney(money);
|
|
groupsDataStatisticsView.setChannelMoney(money);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (data.getType() == 4) {
|
|
|
|
|
+ groupsDataStatisticsView.setUnBindChannelMoney(money);
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
if (groupsDataStatisticsView.getNatureMoney() == null) {
|
|
if (groupsDataStatisticsView.getNatureMoney() == null) {
|
|
|
groupsDataStatisticsView.setNatureMoney(BigDecimal.ZERO);
|
|
groupsDataStatisticsView.setNatureMoney(BigDecimal.ZERO);
|
|
@@ -505,6 +525,7 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
|
|
|
try {
|
|
try {
|
|
|
getGroupsOrderCategoryData(groupsDataStatisticsView, startDate, endDate);
|
|
getGroupsOrderCategoryData(groupsDataStatisticsView, startDate, endDate);
|
|
|
getRenewOrderData(groupsDataStatisticsView, startDate, endDate);
|
|
getRenewOrderData(groupsDataStatisticsView, startDate, endDate);
|
|
|
|
|
+ getUnbindChannelOrderData(groupsDataStatisticsView, startDate, endDate);
|
|
|
} finally {
|
|
} finally {
|
|
|
latch.countDown();
|
|
latch.countDown();
|
|
|
}
|
|
}
|
|
@@ -578,6 +599,25 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
|
|
|
//Ai A中第二单 为流媒体
|
|
//Ai A中第二单 为流媒体
|
|
|
Integer monthAiNewPayStreamingNumOfUser = statisticsExportMapper.getMonthAiNewPayStreamingNumOfUser(thisMonth, nextMonth);
|
|
Integer monthAiNewPayStreamingNumOfUser = statisticsExportMapper.getMonthAiNewPayStreamingNumOfUser(thisMonth, nextMonth);
|
|
|
|
|
|
|
|
|
|
+ //用户维度 订单数据
|
|
|
|
|
+ List<MonthlyUserOrderDetailDto> monthlyUserOrderDetails = statisticsExportMapper.getMonthlyUserOrderDetail(thisMonth, nextMonth);
|
|
|
|
|
+ Integer monthlyNewUserOrders = 0;
|
|
|
|
|
+ BigDecimal monthlyNewUserOrdersMoney = BigDecimal.ZERO;
|
|
|
|
|
+ Integer monthlyBeforeUserOrders = 0;
|
|
|
|
|
+ BigDecimal monthlyBeforeUserOrdersMoney = BigDecimal.ZERO;
|
|
|
|
|
+ for (MonthlyUserOrderDetailDto monthlyUserOrderDetail : monthlyUserOrderDetails) {
|
|
|
|
|
+ BigDecimal money = monthlyUserOrderDetail.getMoney();
|
|
|
|
|
+ Integer orders = monthlyUserOrderDetail.getOrders();
|
|
|
|
|
+ //上月
|
|
|
|
|
+ if (monthlyUserOrderDetail.getType() == 1) {
|
|
|
|
|
+ monthlyBeforeUserOrders = orders;
|
|
|
|
|
+ monthlyBeforeUserOrdersMoney = money;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ monthlyNewUserOrders = orders;
|
|
|
|
|
+ monthlyNewUserOrdersMoney = money;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// //历史复购 AI、奈飞车票人数 以及交叉
|
|
// //历史复购 AI、奈飞车票人数 以及交叉
|
|
|
// Integer nfTicketNumOfUser = statisticsExportMapper.getNfTicketNumOfUser(1l);
|
|
// Integer nfTicketNumOfUser = statisticsExportMapper.getNfTicketNumOfUser(1l);
|
|
|
//
|
|
//
|
|
@@ -609,7 +649,12 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
|
|
|
.setMonthStreamingNewPayAiNumOfUser(monthStreamingNewPayAiNumOfUser)
|
|
.setMonthStreamingNewPayAiNumOfUser(monthStreamingNewPayAiNumOfUser)
|
|
|
.setMonthAiNewNumOfUser(monthAiNewNumOfUser)
|
|
.setMonthAiNewNumOfUser(monthAiNewNumOfUser)
|
|
|
.setMonthAiNewPayOtherNumOfUser(monthAiNewPayOtherNumOfUser)
|
|
.setMonthAiNewPayOtherNumOfUser(monthAiNewPayOtherNumOfUser)
|
|
|
- .setMonthAiNewPayStreamingNumOfUser(monthAiNewPayStreamingNumOfUser);
|
|
|
|
|
|
|
+ .setMonthAiNewPayStreamingNumOfUser(monthAiNewPayStreamingNumOfUser)
|
|
|
|
|
+ .setMonthlyNewUserOrders(monthlyNewUserOrders)
|
|
|
|
|
+ .setMonthlyNewUserOrdersMoney(monthlyNewUserOrdersMoney)
|
|
|
|
|
+ .setMonthlyBeforeUserOrders(monthlyBeforeUserOrders)
|
|
|
|
|
+ .setMonthlyBeforeUserOrdersMoney(monthlyBeforeUserOrdersMoney)
|
|
|
|
|
+ ;
|
|
|
// .setNfTicketNumOfUser(nfTicketNumOfUser)
|
|
// .setNfTicketNumOfUser(nfTicketNumOfUser)
|
|
|
// .setAiTicketNumOfUser(aiTicketNumOfUser)
|
|
// .setAiTicketNumOfUser(aiTicketNumOfUser)
|
|
|
// .setNfAiTicketNumOfUser(nfAiTicketNumOfUser)
|
|
// .setNfAiTicketNumOfUser(nfAiTicketNumOfUser)
|