Explorar el Código

解绑渠道销售数据

zoujiajian hace 2 años
padre
commit
358099631c

+ 20 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GroupsDataStatisticsView.java

@@ -25,6 +25,11 @@ public class GroupsDataStatisticsView {
 
 	private BigDecimal channelMoney;
 
+	/**
+	 * 解绑渠道销售金额
+	 */
+	private BigDecimal unBindChannelMoney;
+
 	/**
 	 * 个人销售金额
 	 */
@@ -71,4 +76,19 @@ public class GroupsDataStatisticsView {
 	 * 非续费金额
 	 */
 	private BigDecimal newBuyOrderMoney;
+
+	/**
+	 * 解绑渠道销售金额
+	 */
+	private BigDecimal unBIndGroupsStreamingMoney;
+
+	/**
+	 * 解绑渠道 Ai销售金额
+	 */
+	private BigDecimal unBIndGroupsAiOrderMoney;
+
+	/**
+	 * 解绑渠道 设备销售金额
+	 */
+	private BigDecimal unBIndGroupsEpOrderMoney;
 }

+ 6 - 2
netflix-dao/src/main/resources/mapper/StatisticsExportMapper.xml

@@ -374,8 +374,11 @@
             <when test="type == 1">
                 us.id is null
             </when>
+            <when test="type == 4">
+                us.id is not null and us.is_bind = 0
+            </when>
             <otherwise>
-                us.id is not null
+                us.id is not null and us.is_bind = 1
             </otherwise>
         </choose>
         <if test="startDate != null">
@@ -466,7 +469,8 @@
         (case
         when us.id is null then 1
         when us.id is not null and ud.id is null then 2
-        when ud.id is not null then 3
+        when ud.id is not null and us.is_bind = 1 then 3
+        when ud.id is not null and us.is_bind = 0 then 4
         else 1
         end) as `type`
         from `order_don` o

+ 20 - 0
netflix-service/src/main/java/com/cyksj/service/mange/statistics/impl/StatisticsDataServiceImpl.java

@@ -426,12 +426,28 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 			case 4:
 				getRenewOrderData(groupsDataStatisticsView, startDate, endDate);
 				break;
+			case 5:
+				getUnbindChannelOrderData(groupsDataStatisticsView, startDate, endDate);
+				break;
 			default:
 				getSynthesisData(groupsDataStatisticsView, startDate, endDate);
 		}
 		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) {
 		List<NatureOrderDataDto> orderDataList = statisticsExportMapper.getGroupsOrderData(startDate, endDate);
 		orderDataList.forEach(data -> {
@@ -447,6 +463,9 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 			if (data.getType() == 3) {
 				groupsDataStatisticsView.setChannelMoney(money);
 			}
+			if (data.getType() == 4) {
+				groupsDataStatisticsView.setUnBindChannelMoney(money);
+			}
 		});
 		if (groupsDataStatisticsView.getNatureMoney() == null) {
 			groupsDataStatisticsView.setNatureMoney(BigDecimal.ZERO);
@@ -505,6 +524,7 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 			try {
 				getGroupsOrderCategoryData(groupsDataStatisticsView, startDate, endDate);
 				getRenewOrderData(groupsDataStatisticsView, startDate, endDate);
+				getUnbindChannelOrderData(groupsDataStatisticsView, startDate, endDate);
 			} finally {
 				latch.countDown();
 			}