Przeglądaj źródła

Merge branch 'tag_func' into pre

# Conflicts:
#	netflix-dao/src/main/java/com/cyksj/mapper/OrderDonMapper.java
#	netflix-dao/src/main/java/com/cyksj/mapper/corp/CorpUserTagMapper.java
#	netflix-dao/src/main/resources/mapper/CorpUserTagMapper.xml
#	netflix-dao/src/main/resources/mapper/OrderDonMapper.xml
#	netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpEventActionServiceImpl.java
#	netflix-web/src/main/java/com/cyksj/web/controller/manage/CmsOrderController.java
#	netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/WxCorpController.java
zoujiajian 2 lat temu
rodzic
commit
cfe04b416d
19 zmienionych plików z 301 dodań i 96 usunięć
  1. 4 2
      netflix-dao/src/main/java/com/cyksj/mapper/OrderDonMapper.java
  2. 1 2
      netflix-dao/src/main/java/com/cyksj/mapper/corp/CorpUserTagMapper.java
  3. 6 0
      netflix-dao/src/main/java/com/cyksj/mapper/manage/statistics/StatisticsExportMapper.java
  4. 27 0
      netflix-dao/src/main/java/com/cyksj/model/excel/ExcelMonthOrderData.java
  5. 9 1
      netflix-dao/src/main/java/com/cyksj/model/views/UserOrderDetailView.java
  6. 7 6
      netflix-dao/src/main/resources/mapper/CorpUserTagMapper.xml
  7. 77 46
      netflix-dao/src/main/resources/mapper/OrderDonMapper.xml
  8. 65 0
      netflix-dao/src/main/resources/mapper/StatisticsExportMapper.xml
  9. 5 1
      netflix-service/src/main/java/com/cyksj/service/corp/CorpTagService.java
  10. 1 1
      netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpEventActionServiceImpl.java
  11. 19 16
      netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpTagServiceImpl.java
  12. 34 0
      netflix-service/src/main/java/com/cyksj/service/mange/statistics/impl/StatisticsDataServiceImpl.java
  13. 1 1
      netflix-service/src/main/java/com/cyksj/service/relation/GroupRelationFrontService.java
  14. 9 7
      netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java
  15. 2 2
      netflix-web/src/main/java/com/cyksj/web/controller/group/GroupRelationController.java
  16. 2 2
      netflix-web/src/main/java/com/cyksj/web/controller/manage/CmsOrderController.java
  17. 25 6
      netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpTagController.java
  18. 4 2
      netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/WxCorpController.java
  19. 3 1
      netflix-web/src/main/java/com/cyksj/web/controller/manage/distribute/DistributeController.java

+ 4 - 2
netflix-dao/src/main/java/com/cyksj/mapper/OrderDonMapper.java

@@ -66,9 +66,9 @@ public interface OrderDonMapper extends BaseMapper<OrderDon> {
 
 	BrokenLineObjView selectDsPlatBrokenLineMoney(@Param("sharedId") Long sharedId, @Param("first") String first, @Param("end") String end);
 
-	UserOrderDetailView getTagUserData(@Param("tagIdStr") String tagIdStr, @Param("startTime") String startTime, @Param("endTime") String endTime);
+	UserOrderDetailView getTagUserData(@Param("tagIdStr") String tagIdStr, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("consumeStTime") String consumeStTime, @Param("consumeEtTime") String consumeEtTime);
 
-	Page<UserOrderDetailView> getTagUserDataPage(@Param("page") Page<UserOrderDetailView> page, @Param("tagIdStr") String tagIdStr, @Param("startTime") String startTime, @Param("endTime") String endTime);
+	Page<UserOrderDetailView> getTagUserDataPage(@Param("page") Page<UserOrderDetailView> page, @Param("tagIdStr") String tagIdStr, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("consumeStTime") String consumeStTime, @Param("consumeEtTime") String consumeEtTime);
 
 	Page<CorpTagUserOrderDataView> getTagUserTimeOrderData(@Param("page") Page<Object> objectPage, @Param("tagIdStr") String tagIdStr, @Param("toDate") String toDate, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
@@ -79,4 +79,6 @@ public interface OrderDonMapper extends BaseMapper<OrderDon> {
 	BigDecimal selectSubChannelOrderMoney(@Param("sharedId") Long sharedId, @Param("limitTime") Date limitTime);
 
 	OrderDonCustomerServiceRelate selectOrderRelate(Long orderId);
+
+	Page<UserOrderDetailView> getPastRecord(@Param("objectPage") Page<Object> objectPage, @Param("tagIdStr") String tagIdStr, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("consumeStTime") String consumeStTime, @Param("consumeEtTime") String consumeEtTime);
 }

+ 1 - 2
netflix-dao/src/main/java/com/cyksj/mapper/corp/CorpUserTagMapper.java

@@ -7,7 +7,6 @@ import com.cyksj.model.excel.CorpUserTagExcelData;
 import com.cyksj.model.views.CorpUserIntentionView;
 import com.cyksj.model.views.CorpUserView;
 import com.cyksj.model.views.UserIntentionPieView;
-import com.cyksj.model.views.UserOrderDetailView;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -22,7 +21,7 @@ public interface CorpUserTagMapper extends BaseMapper<CorpUserTag> {
 
 	List<CorpUserTagExcelData> exportUserTagDetail(@Param("tagIds") String[] tagIds, @Param("groupIds") String[] groupIds, @Param("wxCorpId") Long wxCorpId);
 
-	UserOrderDetailView countTagUser(@Param("tagIdStr") String tagIdStr, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("thisDate") String thisDate);
+	Integer getDelCorpUserNum(@Param("tagIdStr") String tagIdStr, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
 	List<Long> getTagIdByCorpUserId(Long corpUserId);
 

+ 6 - 0
netflix-dao/src/main/java/com/cyksj/mapper/manage/statistics/StatisticsExportMapper.java

@@ -76,4 +76,10 @@ public interface StatisticsExportMapper{
 	List<MonthlyUserOrderDetailDto> getMonthlyUserOrderDetail(@Param("thisMonth") DateTime thisMonth, @Param("nextMonth") DateTime nextMonth);
 
 	Map<String, Long> getEpOrderNumsGroupSource(@Param("startDate") String startDate, @Param("endDate") String endDate);
+
+	Integer getOverPayByGoodsId(@Param("goodsId") Long goodsId, @Param("skuIds") List<Long> skuIds, @Param("lastMonth") String lastMonth, @Param("thisMonth") DateTime thisMonth, @Param("nextMonth") DateTime nextMonth);
+
+	Integer getYearNumOfRenewalsByGoodsId(@Param("goodsId") Long goodsId, @Param("lastElevMonth") String lastElevMonth, @Param("lastYearMonth") String lastYearMonth);
+
+	Integer getActualNumberOfRenewalsByGoodsId(@Param("goodsId") Long goodsId, @Param("lastElevMonth") String lastElevMonth, @Param("lastYearMonth") String lastYearMonth);
 }

+ 27 - 0
netflix-dao/src/main/java/com/cyksj/model/excel/ExcelMonthOrderData.java

@@ -29,6 +29,9 @@ public class ExcelMonthOrderData {
 	@ExcelProperty({"品类数据类", "奈飞续费数据", "D.非当月到期,但续费的用户数"})
 	private Integer monthNfNoExRenewNumOfUser;
 
+	@ExcelProperty({"品类数据类", "奈飞续费数据", "E.超期购买"})
+	private Integer overNfPayNumOfUser;
+
 	@ExcelProperty({"品类数据类", "AI类续费(gptplus月付)", "A.月付当月到期的所有用户数"})
 	private Integer monthAiGptExNumOfUser;
 
@@ -41,6 +44,9 @@ public class ExcelMonthOrderData {
 	@ExcelProperty({"品类数据类", "AI类续费(gptplus月付)", "D.非当月到期,但续费的用户数"})
 	private Integer monthAiGptNoExRenewNumOfUser;
 
+	@ExcelProperty({"品类数据类", "AI类续费(gptplus月付)", "E.超期购买"})
+	private Integer overGptPayNumOfUser;
+
 	@ExcelProperty({"品类数据类", "AI类续费(midjourney月付)", "A.月付当月到期的所有用户数"})
 	private Integer monthAiMidExNumOfUser;
 
@@ -53,6 +59,9 @@ public class ExcelMonthOrderData {
 	@ExcelProperty({"品类数据类", "AI类续费(midjourney月付)", "D.非当月到期,但续费的用户数"})
 	private Integer monthAiMidNoExRenewNumOfUser;
 
+	@ExcelProperty({"品类数据类", "AI类续费(midjourney月付)", "E.超期购买"})
+	private Integer overMidPayNumOfUser;
+
 	@ExcelProperty({"品类数据类", "流媒类复购数据", "A.购买流媒体类产品为首单的当月新用户"})
 	private Integer monthStreamingNewNumOfUser;
 
@@ -71,6 +80,24 @@ public class ExcelMonthOrderData {
 	@ExcelProperty({"品类数据类", "AI类复购数据", "C.A用户中购买第二单流媒体产品的用户数"})
 	private Integer monthAiNewPayStreamingNumOfUser;
 
+	@ExcelProperty({"品类数据类", "油管年付", "A.应续费人数"})
+	private Integer youtubeNumOfRenewals;
+
+	@ExcelProperty({"品类数据类", "油管年付", "B.实际续费人数"})
+	private Integer youtubeActualNumberOfRenewals;
+
+	@ExcelProperty({"品类数据类", "声破天年付", "A.应续费人数"})
+	private Integer spotifyNumOfRenewals;
+
+	@ExcelProperty({"品类数据类", "声破天年付", "B.实际续费人数"})
+	private Integer spotifyActualNumberOfRenewals;
+
+	@ExcelProperty({"品类数据类", "迪士尼年付", "A.应续费人数"})
+	private Integer disneyNumOfRenewals;
+
+	@ExcelProperty({"品类数据类", "迪士尼年付", "B.实际续费人数"})
+	private Integer disneyActualNumberOfRenewals;
+
 	@ExcelProperty({"用户维度", "当月新用户", "订单量"})
 	private Integer monthlyNewUserOrders;
 

+ 9 - 1
netflix-dao/src/main/java/com/cyksj/model/views/UserOrderDetailView.java

@@ -31,5 +31,13 @@ public class UserOrderDetailView {
 
 	private String date;
 
-	Page<UserOrderDetailView> records;
+	/**
+	 * 进粉记录
+	 */
+	Page<UserOrderDetailView> fansRecords;
+
+	/**
+	 * 往期标签用户订单记录
+	 */
+	Page<UserOrderDetailView> pastRecords;
 }

+ 7 - 6
netflix-dao/src/main/resources/mapper/CorpUserTagMapper.xml

@@ -61,9 +61,8 @@
         group by cu.id, cu.unionid)s order by s.tagTime desc, s.userId asc
     </select>
 
-    <select id="countTagUser" resultType="com.cyksj.model.views.UserOrderDetailView">
-        select count(distinct ca.corp_user_id) as numOfUser,
-        count(distinct if(cufr.status = 0,ca.corp_user_id,NULL)) as delNumOfUser
+    <select id="getDelCorpUserNum" resultType="java.lang.Integer">
+        select count(distinct if(cufr.status = 0,ca.corp_user_id,NULL)) as delNumOfUser
         from (select relation_id
         from `corp_user_tag` ct
         where tag_id = #{tagIdStr}
@@ -94,8 +93,9 @@
         from (select relation_id
         from `corp_user_tag` ct
         where tag_id = #{tagIdStr}
+        group by relation_id
         <if test="thisDate != null">
-            and date_format(ct.created_time,'%Y-%m-%d') = #{thisDate}
+            having date_format(min(ct.created_time),'%Y-%m-%d') = #{thisDate}
         </if>) s
         left join corp_user_follow_relation cufr on cufr.id = s.relation_id
         left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
@@ -105,12 +105,13 @@
     </select>
 
     <select id="getCorpUserIntentionView" resultType="com.cyksj.model.views.CorpUserIntentionView">
-        select cu.user_id,cu.name,cu.created_time,ccc.id as intentionId,ccc.intention
+        select cu.user_id,cu.name as nickname,cu.created_time,ccc.id as intentionId,ccc.intention
         from (select relation_id
         from `corp_user_tag` ct
         where tag_id = #{tagIdStr}
+        group by relation_id
         <if test="thisDate != null">
-            and date_format(ct.created_time,'%Y-%m-%d') = #{thisDate}
+            and date_format(min(ct.created_time),'%Y-%m-%d') = #{thisDate}
         </if>) s
         left join corp_user_follow_relation cufr on cufr.id = s.relation_id
         left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id

+ 77 - 46
netflix-dao/src/main/resources/mapper/OrderDonMapper.xml

@@ -320,56 +320,62 @@
     </select>
 
     <select id="getTagUserData" resultType="com.cyksj.model.views.UserOrderDetailView">
-        select count(if(status != 'refund', 1, NULL)) as numOfOrder, (sum(money) - sum(ifnull(refund_money, 0))) / 100
-        as orderMoney,
-        count(if(status != 'refund' and o.goods_id = 15,1,NULL)) as numOfEpOrder,
-        (sum(if(o.goods_id = 15,money,0)) - sum(ifnull(if(o.goods_id = 15,refund_money,0), 0))) / 100 as epOrderMoney
-        from (select cu.user_id
-        from (select relation_id
+        select count(if(status != 'refund', 1, NULL)) as numOfOrder,
+               (sum(money) - sum(ifnull(refund_money, 0))) / 100 as orderMoney,
+               count(if(status != 'refund' and o.goods_id = 15,1,NULL)) as numOfEpOrder,
+               (sum(if(o.goods_id = 15,money,0)) - sum(ifnull(if(o.goods_id = 15,refund_money,0), 0))) / 100 as epOrderMoney,
+               count(distinct corpUserId) as numOfUser
+        from (select cu.id as corpUserId,
+        cu.user_id,
+        s.created_time
+        from (select relation_id,
+        min(ct.created_time) as created_time
         from `corp_user_tag` ct
         where tag_id = #{tagIdStr}
+        group by ct.relation_id
         <if test="startTime != null">
-            and ct.created_time >= #{startTime}
+            having min(ct.created_time) >= #{startTime}
         </if>
         <if test="endTime != null">
-            and ct.created_time &lt; #{endTime}
+            and min(ct.created_time) &lt; #{endTime}
         </if>) s
         left join corp_user_follow_relation cufr on cufr.id = s.relation_id
         left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
-        left join corp_user cu on cu.id = ca.corp_user_id where cu.user_id != 0) s inner join order_don o on o.user_id =
-        s.user_id
+        left join corp_user cu on cu.id = ca.corp_user_id) s
+        left join order_don o on o.user_id = s.user_id and o.user_id != 0
         and o.status not in ('close', 'noPayment')
         and o.money > 0
-        and o.money > ifnull(o.refund_money,0)
-        <if test="startTime != null">
-            and o.created_time >= #{startTime}
+        and o.created_time > s.created_time
+        <if test="consumeStTime != null">
+            and o.created_time >= #{consumeStTime}
+        </if>
+        <if test="consumeEtTime != null">
+            and o.created_time &lt; #{consumeEtTime}
         </if>
     </select>
 
     <select id="getTagUserDataPage" resultType="com.cyksj.model.views.UserOrderDetailView">
-        select count(if(status != 'refund', 1, NULL)) as numOfOrder, (sum(money) - sum(ifnull(refund_money, 0))) / 100
-        as orderMoney,date_format(o.created_time,'%Y-%m-%d') as date from (select cu.user_id
-        from (select relation_id
-        from `corp_user_tag` ct
-        where tag_id = #{tagIdStr}
-        <if test="startTime != null">
-            and ct.created_time >= #{startTime}
-        </if>
-        <if test="endTime != null">
-            and ct.created_time &lt; #{endTime}
-        </if>) s
-        left join corp_user_follow_relation cufr on cufr.id = s.relation_id
-        left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
-        left join corp_user cu on cu.id = ca.corp_user_id where cu.user_id != 0) s inner join order_don o on o.user_id =
-        s.user_id
-        and o.status not in ('close', 'noPayment')
+        select joinTime                               as `date`,
+               count(DISTINCT corpUserId)             as numOfUser,
+               count(if(status != 'refund', 1, NULL)) as numOfOrder,
+               (ifnull(sum(money), 0) - sum(ifnull(refund_money, 0))) / 100
+        from (select cu.id as                                corpUserId,
+                     cu.user_id,
+                     date_format(s.created_time, '%Y-%m-%d') joinTime
+              from (select relation_id,
+                           min(ct.created_time) as created_time
+                    from `corp_user_tag` ct
+                    where tag_id = #{tagIdStr}
+                    group by ct.relation_id) s
+                       left join corp_user_follow_relation cufr on cufr.id = s.relation_id
+                       left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
+                       left join corp_user cu on cu.id = ca.corp_user_id) s
+                 left join order_don o on o.user_id = s.user_id and o.user_id != 0
+        and o.status not in ('close','noPayment')
+        and date_format(o.created_time, '%Y-%m-%d') = joinTime
         and o.money > 0
-        and o.money > ifnull(o.refund_money,0)
-        <if test="startTime != null">
-            and o.created_time >= #{startTime}
-        </if>
-        group by date_format(o.created_time,'%Y-%m-%d')
-        order by date_format(o.created_time,'%Y-%m-%d') desc
+        group by joinTime
+        order by joinTime desc
     </select>
 
     <select id="getTagUserTimeOrderData" resultType="com.cyksj.model.views.CorpTagUserOrderDataView">
@@ -377,22 +383,20 @@
         (select nickname from user u where u.id = o.user_id limit 1),
         o.order_no,o.goods_id,g.title,o.sku_id,sku.spec_val,
         o.money/100 as money,o.created_time
-        from (select
-        cu.user_id
-        from (select relation_id
+        from (select cu.id as corpUserId,
+        cu.user_id,
+        date_format(s.created_time, '%Y-%m-%d') joinTime
+        from (select relation_id,
+        min(ct.created_time) as created_time
         from `corp_user_tag` ct
         where tag_id = #{tagIdStr}
-        <if test="startTime != null">
-            and ct.created_time >= #{startTime}
-        </if>
-        <if test="endTime != null">
-            and ct.created_time &lt; #{endTime}
-        </if>) s
+        group by ct.relation_id) s
         left join corp_user_follow_relation cufr on cufr.id = s.relation_id
         left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
-        left join corp_user cu on cu.id = ca.corp_user_id where cu.user_id != 0) s inner join order_don o on o.user_id =
-        s.user_id
+        left join corp_user cu on cu.id = ca.corp_user_id) s
+        inner join order_don o on o.user_id = s.user_id and o.user_id != 0
         and o.status not in ('close', 'noPayment','refund')
+        and date_format(o.created_time, '%Y-%m-%d') = joinTime
         and o.money > 0
         <if test="toDate != null and toDate != ''">
             and date_format(o.created_time,'%Y-%m-%d') = #{toDate}
@@ -454,4 +458,31 @@
         from order_don_customer_service_relate odr
         where order_id = #{orderId} limit 1
     </select>
+
+    <select id="getPastRecord" resultType="com.cyksj.model.views.UserOrderDetailView">
+        select date_format(o.created_time,'%Y-%m-%d') as `date`,
+        count(if(status != 'refund', 1, NULL)) as numOfOrder,
+        (ifnull(sum(money),0) - sum(ifnull(refund_money, 0))) / 100 as orderMoney
+        from (select cu.id as corpUserId,
+        cu.user_id,
+        date_format(s.created_time, '%Y-%m-%d') joinTime
+        from (select relation_id,
+        min(ct.created_time) as created_time
+        from `corp_user_tag` ct
+        where tag_id = #{tagIdStr}) s
+        left join corp_user_follow_relation cufr on cufr.id = s.relation_id
+        left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
+        left join corp_user cu on cu.id = ca.corp_user_id where cu.user_id != 0)s
+        inner join order_don o on o.user_id = s.user_id
+        and o.status not in ('close','noPayment')
+        and date_format(o.created_time, '%Y-%m-%d') > joinTime
+        <if test="consumeStTime != null">
+            and o.created_time >= #{consumeStTime}
+        </if>
+        <if test="consumeEtTime != null">
+            and o.created_time &lt; #{consumeEtTime}
+        </if>
+        group by date_format(o.created_time,'%Y-%m-%d')
+        order by date_format(o.created_time,'%Y-%m-%d') desc
+    </select>
 </mapper>

+ 65 - 0
netflix-dao/src/main/resources/mapper/StatisticsExportMapper.xml

@@ -529,4 +529,69 @@
         </if>
         group by DATE_FORMAT(created_time, '%Y-%m')
     </select>
+
+    <select id="getOverPayByGoodsId" resultType="java.lang.Integer">
+        select count(DISTINCT user_id)
+        from order_don o
+        where created_time &lt; #{lastMonth}
+        <if test="goodsId !=null">
+            and goods_id = #{goodsId}
+        </if>
+        <if test="skuIds!=null">
+            and sku_id in
+            <foreach collection="skuIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        and `status` not in ('close', 'noPayment', 'refund')
+        and NOT EXISTS (select 1
+        from order_don
+        where created_time BETWEEN #{lastMonth} and #{thisMonth}
+        and `status` not in ('close', 'noPayment', 'refund')
+        AND user_id = o.user_id
+        <if test="goodsId !=null">
+            and goods_id = #{goodsId}
+        </if>
+        <if test="skuIds!=null">
+            and sku_id in
+            <foreach collection="skuIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        )
+        and EXISTS (select 1
+        from order_don
+        where created_time BETWEEN #{thisMonth} and #{nextMonth}
+        and `status` not in ('close', 'noPayment', 'refund')
+        and user_id = o.user_id
+        <if test="goodsId !=null">
+            and goods_id = #{goodsId}
+        </if>
+        <if test="skuIds!=null">
+            and sku_id in
+            <foreach collection="skuIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        )
+    </select>
+
+    <select id="getYearNumOfRenewalsByGoodsId" resultType="java.lang.Integer">
+        select count(distinct user_id)
+        from order_don
+        where created_time BETWEEN #{lastYearMonth} and #{lastElevMonth}
+          and `status` not in ('close', 'noPayment', 'refund')
+          and goods_id = #{goodsId}
+    </select>
+
+    <select id="getActualNumberOfRenewalsByGoodsId" resultType="java.lang.Integer">
+        select count(distinct user_id)
+        from order_don o
+        where created_time BETWEEN #{lastYearMonth} and #{lastElevMonth}
+          and `status` not in ('close', 'noPayment', 'refund')
+          and goods_id = #{goodsId}
+        and exists (select 1 from order_don where created_time > #{lastElevMonth}
+            and `status` not in ('close', 'noPayment', 'refund')
+            and goods_id = #{goodsId} and user_id = o.user_id limit 1)
+    </select>
 </mapper>

+ 5 - 1
netflix-service/src/main/java/com/cyksj/service/corp/CorpTagService.java

@@ -45,7 +45,11 @@ public interface CorpTagService {
 	 */
 	CorpTagGroupView addGroup(CorpTagGroupView tagGroup) throws Exception;
 
-	UserOrderDetailView getTagUserData(Integer start, Integer limit, String tagIdStr, String startTime, String endTime);
+	Page<UserOrderDetailView>  getTagUserData(Integer start, Integer limit, String tagIdStr, String startTime, String endTime, String consumeStTime, String consumeEtTime);
 
 	Page<CorpTagUserOrderDataView> getTagUserTimeOrderData(Integer start, Integer limit, String tagIdStr, String toDate, String startTime, String endTime);
+
+	Page<UserOrderDetailView> getTagUserPastRecord(Integer start, Integer limit, String tagIdStr, String startTime, String endTime, String consumeStTime, String consumeEtTime);
+
+	UserOrderDetailView tagUserHeadData(String tagIdStr, String startTime, String endTime, String consumeStTime, String consumeEtTime);
 }

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpEventActionServiceImpl.java

@@ -1120,7 +1120,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 							corpCustomerAcquistionCallback = new CorpCustomerAcquistionCallback();
 						}
 						corpCustomerAcquistionCallback.setCallback(callback);
-						corpCustomerAcquistionCallback.setEvent(corpCustomerAcquistionCallback.getEvent());
+						corpCustomerAcquistionCallback.setEvent(corpCustomerAcquisitionLinkPopularize.getEvent());
 						corpCustomerAcquistionCallback.setUnionId(unionId);
 						if(corpCustomerAcquistionCallback.getId() != null){
 							corpCustomerAcquistionCallbackMapper.updateById(corpCustomerAcquistionCallback);

+ 19 - 16
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpTagServiceImpl.java

@@ -421,23 +421,15 @@ public class CorpTagServiceImpl implements CorpTagService {
 	}
 
 	@Override
-	public UserOrderDetailView getTagUserData(Integer start, Integer limit, String tagIdStr, String startTime, String endTime) {
-		UserOrderDetailView u = orderDonMapper.getTagUserData(tagIdStr, startTime, endTime);
-
-		UserOrderDetailView u2 = corpUserTagMapper.countTagUser(tagIdStr, startTime, endTime,null);
-
-		u.setNumOfUser(u2.getNumOfUser());
-		u.setDelNumOfUser(u2.getDelNumOfUser());
-		u.setOrderRate(u.getNumOfUser() == 0 ? BigDecimal.ZERO : BigDecimal.valueOf(u.getNumOfEpOrder()).divide(BigDecimal.valueOf(u.getNumOfUser()), 2, RoundingMode.HALF_DOWN));
-		Page<UserOrderDetailView> records = orderDonMapper.getTagUserDataPage(new Page<>(start, limit), tagIdStr, startTime, endTime);
-		records.getRecords().forEach(e->{
-			String date = e.getDate();
-			UserOrderDetailView userOrderDetailView = corpUserTagMapper.countTagUser(tagIdStr, null, null, date);
-			e.setNumOfUser(userOrderDetailView.getNumOfUser());
-		});
+	public Page<UserOrderDetailView> getTagUserData(Integer start, Integer limit, String tagIdStr, String startTime, String endTime, String consumeStTime, String consumeEtTime) {
+		Page<UserOrderDetailView> fansRecords = orderDonMapper.getTagUserDataPage(new Page<>(start, limit), tagIdStr, startTime, endTime, consumeStTime, consumeEtTime);
+		return fansRecords;
+	}
 
-		u.setRecords(records);
-		return u;
+	@Override
+	public Page<UserOrderDetailView>  getTagUserPastRecord(Integer start, Integer limit, String tagIdStr, String startTime, String endTime, String consumeStTime, String consumeEtTime) {
+		Page<UserOrderDetailView> pastRecords = orderDonMapper.getPastRecord(new Page<>(start, limit), tagIdStr, startTime, endTime, consumeStTime, consumeEtTime);
+		return pastRecords;
 	}
 
 	@Override
@@ -445,4 +437,15 @@ public class CorpTagServiceImpl implements CorpTagService {
 		Page<CorpTagUserOrderDataView> records = orderDonMapper.getTagUserTimeOrderData(new Page<>(start, limit), tagIdStr, toDate, startTime, endTime);
 		return records;
 	}
+
+	@Override
+	public UserOrderDetailView tagUserHeadData(String tagIdStr, String startTime, String endTime, String consumeStTime, String consumeEtTime) {
+		UserOrderDetailView u = orderDonMapper.getTagUserData(tagIdStr, startTime, endTime, consumeStTime, consumeEtTime);
+		//被删除用户数
+		Integer delNumOfUser = corpUserTagMapper.getDelCorpUserNum(tagIdStr, startTime, endTime);
+		u.setDelNumOfUser(delNumOfUser);
+
+		u.setOrderRate(u.getNumOfUser() == 0 ? BigDecimal.ZERO : BigDecimal.valueOf(u.getNumOfEpOrder()).divide(BigDecimal.valueOf(u.getNumOfUser()), 2, RoundingMode.HALF_DOWN));
+		return u;
+	}
 }

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

@@ -559,6 +559,8 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 	private void exportBusinessMonthlyData(List<ExcelSheetAndData> excelSheetDataList, Long startTime, Long endTime) {
 		//月付、季付、年付
 		Long nf_goodsId = 1l;
+		Long gpt_goodsId = 18l;
+		Long mj_goodsId = 26l;
 		DateTime thisMonth = DateTime.of(startTime);
 		DateTime nextMonth = DateUtil.offsetMonth(thisMonth, 1);
 		String lastMonth = DateUtil.offsetMonth(thisMonth, -1).toDateStr();
@@ -581,6 +583,9 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 		Integer monthNfRenewNumOfUser = statisticsExportMapper.getMonthNfRenewNumOfUser(nf_goodsId, thisMonth, nextMonth);
 		Integer monthNfNoExRenewNumOfUser = monthNfRenewNumOfUser - monthNfExRenewNumOfUser;
 
+		//奈飞超期购买 中间隔断一个月购买的用户数
+		Integer overNfPayNumOfUser = statisticsExportMapper.getOverPayByGoodsId(nf_goodsId, null, lastMonth, thisMonth, nextMonth);
+
 		//Ai Gpt月付
 		List<Long> gptMonthSkuId = statisticsExportMapper.getAiMonthPlus(18l);
 		//Ai类gptplus当月到期用户数
@@ -593,6 +598,8 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 		Integer monthAiGptRenewNumOfUser = statisticsExportMapper.getMonthAiRenewNumOfUser(gptMonthSkuId, thisMonth, nextMonth);
 		//非当月 续费人数
 		Integer monthAiGptNoExRenewNumOfUser = monthAiGptRenewNumOfUser - monthAiGptExRenewNumOfUser;
+		//超期购买 中间隔断一个月购买的用户数
+		Integer overGptPayNumOfUser = statisticsExportMapper.getOverPayByGoodsId(null, gptMonthSkuId, lastMonth, thisMonth, nextMonth);
 
 		//Ai midjourney 月付
 		List<Long> midJourneyMonthSkuId = statisticsExportMapper.getAiMonthPlus(26l);
@@ -605,6 +612,24 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 		Integer monthAiMidRenewNumOfUser = statisticsExportMapper.getMonthAiRenewNumOfUser(midJourneyMonthSkuId, thisMonth, nextMonth);
 		//非当月 midjourney续费人数
 		Integer monthAiMidNoExRenewNumOfUser = monthAiMidRenewNumOfUser - monthAiMidExRenewNumOfUser;
+		//超期购买 中间隔断一个月购买的用户数
+		Integer overMjPayNumOfUser = statisticsExportMapper.getOverPayByGoodsId(null, midJourneyMonthSkuId, lastMonth, thisMonth, nextMonth);
+
+		//油管年付
+		Long ybGoodsId = 5l;
+		Integer youtubeNumOfRenewals = statisticsExportMapper.getYearNumOfRenewalsByGoodsId(ybGoodsId, lastElevMonth, lastYearMonth);
+		//实际续费人数
+		Integer youtubeActualNumberOfRenewals = statisticsExportMapper.getActualNumberOfRenewalsByGoodsId(ybGoodsId, lastElevMonth, lastYearMonth);
+		//声破天 续费数据
+		Long spGoodsId = 4l;
+		Integer spotifyNumOfRenewals = statisticsExportMapper.getYearNumOfRenewalsByGoodsId(spGoodsId, lastElevMonth, lastYearMonth);
+		//实际续费人数
+		Integer spotifyActualNumberOfRenewals = statisticsExportMapper.getActualNumberOfRenewalsByGoodsId(spGoodsId, lastElevMonth, lastYearMonth);
+		//迪士尼年付
+		Long dsGoodsId = 3l;
+		Integer disneyNumOfRenewals = statisticsExportMapper.getYearNumOfRenewalsByGoodsId(dsGoodsId, lastElevMonth, lastYearMonth);
+		//实际续费人数
+		Integer disneyActualNumberOfRenewals = statisticsExportMapper.getActualNumberOfRenewalsByGoodsId(dsGoodsId, lastElevMonth, lastYearMonth);
 
 		//流媒体当月首单
 		Integer monthStreamingNewNumOfUser = statisticsExportMapper.getMonthStreamingNewNumOfUser(thisMonth, nextMonth);
@@ -659,14 +684,17 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 				.setMonthNfExRenewNumOfUser(monthNfExRenewNumOfUser)
 				.setMonthNfExRePayNumOfUser(monthNfExRePayNumOfUser)
 				.setMonthNfNoExRenewNumOfUser(monthNfNoExRenewNumOfUser)
+				.setOverNfPayNumOfUser(overNfPayNumOfUser)
 				.setMonthAiGptExNumOfUser(monthAiGptExNumOfUser)
 				.setMonthAiGptExRenewNumOfUser(monthAiGptExRenewNumOfUser)
 				.setMonthAiGptExRePayNumOfUser(monthAiGptExRePayNumOfUser)
 				.setMonthAiGptNoExRenewNumOfUser(monthAiGptNoExRenewNumOfUser)
+				.setOverGptPayNumOfUser(overGptPayNumOfUser)
 				.setMonthAiMidExNumOfUser(monthAiMidExNumOfUser)
 				.setMonthAiMidExRenewNumOfUser(monthAiMidExRenewNumOfUser)
 				.setMonthAiMidExRePayNumOfUser(monthAiMidExRePayNumOfUser)
 				.setMonthAiMidNoExRenewNumOfUser(monthAiMidNoExRenewNumOfUser)
+				.setOverMidPayNumOfUser(overMjPayNumOfUser)
 				.setMonthStreamingNewNumOfUser(monthStreamingNewNumOfUser)
 				.setMonthStreamingNewPayOtherNumOfUser(monthStreamingNewPayOtherNumOfUser)
 				.setMonthStreamingNewPayAiNumOfUser(monthStreamingNewPayAiNumOfUser)
@@ -677,6 +705,12 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 				.setMonthlyNewUserOrdersMoney(monthlyNewUserOrdersMoney)
 				.setMonthlyBeforeUserOrders(monthlyBeforeUserOrders)
 				.setMonthlyBeforeUserOrdersMoney(monthlyBeforeUserOrdersMoney)
+				.setYoutubeNumOfRenewals(youtubeNumOfRenewals)
+				.setYoutubeActualNumberOfRenewals(youtubeActualNumberOfRenewals)
+				.setSpotifyNumOfRenewals(spotifyNumOfRenewals)
+				.setSpotifyActualNumberOfRenewals(spotifyActualNumberOfRenewals)
+				.setDisneyNumOfRenewals(disneyNumOfRenewals)
+				.setDisneyActualNumberOfRenewals(disneyActualNumberOfRenewals)
 				;
 //				.setNfTicketNumOfUser(nfTicketNumOfUser)
 //				.setAiTicketNumOfUser(aiTicketNumOfUser)

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/relation/GroupRelationFrontService.java

@@ -37,7 +37,7 @@ public interface GroupRelationFrontService {
 	/**
 	 * 获取车票账号登录 验证码
 	 */
-	String getAiVerifyCode(Long userId, Long relationId) throws Exception;
+	String getAiVerifyCode(Long userId, Long relationId, Integer type) throws Exception;
 
 
 	void checkGroupsAvailParkingNum(Long skuId, Long groupsId, Integer availableParkingNum, Integer maxNum);

+ 9 - 7
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -441,7 +441,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 	}
 
 	@Override
-	public String getAiVerifyCode(Long userId, Long relationId) throws Exception {
+	public String getAiVerifyCode(Long userId, Long relationId, Integer type) throws Exception {
 		List<Long> relationUserIdList = userBindRelationService.getRelationUserIdList(userId, null);
 		RenewalView renewalView = beanSearcher.searchFirst(RenewalView.class, MapUtils.builder().field(RenewalView::getUserId, relationUserIdList).op(Operator.InList)
 				.field(RenewalView::getRelationId, relationId).build());
@@ -465,7 +465,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 			throw BusinessRuntimeException.getInstance("获取账号验证码异常,请联系客服...");
 		}
 		String url = "http://yinhelx.com/api/controller.php";
-		Map<String,Object> params = new HashMap<>();
+		Map<String, Object> params = new HashMap<>();
 
 		params.put("imap_key", "imap_56568niua@@");
 		params.put("fun", "imap_read");
@@ -482,7 +482,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		if (execute.getStatus() != HttpStatus.HTTP_OK) {
 			throw BusinessRuntimeException.getInstance("获取验证码异常,请联系客服...");
 		}
-		String code = getDifferentGoodsCode(renewalView.getGoodsId(), execute.body());
+		String code = getDifferentGoodsCode(renewalView.getGoodsId(), execute.body(), type);
 		GroupsRelationLoginCodeRecord record = new GroupsRelationLoginCodeRecord();
 		record.setUserId(userId);
 		record.setRelationId(relationId);
@@ -604,7 +604,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		return num;
 	}
 
-	public String getDifferentGoodsCode(Long goodsId, String body) {
+	public String getDifferentGoodsCode(Long goodsId, String body, Integer type) {
 		String code = null;
 		//奈飞
 		if (goodsId == 1) {
@@ -616,13 +616,15 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				if (StrUtil.isEmpty(code)) {
 					urlPref = "https://www.netflix.com/account/travel/verify";
 					code = StrUtil.subBetween(body, "[" + urlPref, "]");
-					if (StrUtil.isEmpty(code)) {
+					if (StrUtil.isEmpty(code) && type == null) {
 						throw BusinessRuntimeException.getInstance("获取认证链接失败,请重新获取");
 					}
 				}
-				return urlPref + code;
+				if (StrUtil.isNotBlank(code)) {
+					return urlPref + code;
+				}
 			}
-			if (StrUtil.isEmpty(code)) {
+			if (type != null && type == 1) {
 				throw BusinessRuntimeException.getInstance("查询失败,请检查是否发送了登陆码..");
 			}
 		}

+ 2 - 2
netflix-web/src/main/java/com/cyksj/web/controller/group/GroupRelationController.java

@@ -591,9 +591,9 @@ public class GroupRelationController {
      * 读取车票账号登录验证码
      */
     @GetMapping("/get/verifyCode/{relationId}")
-    public Result<String> getAiVerifyCode(@PathVariable Long relationId) throws Exception {
+    public Result<String> getAiVerifyCode(@PathVariable Long relationId, Integer type) throws Exception {
         long userId = StpUserUtil.getLoginIdAsLong();
-        return GatewayResponse.SUCCESS.newBuilder().toResult(groupRelationFrontService.getAiVerifyCode(userId, relationId));
+        return GatewayResponse.SUCCESS.newBuilder().toResult(groupRelationFrontService.getAiVerifyCode(userId, relationId, type));
     }
 
     /**

+ 2 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/CmsOrderController.java

@@ -213,9 +213,9 @@ public class CmsOrderController {
 				data.setRegister(StrUtil.isNotEmpty(user.getUnionid()) ? "wechat" : StrUtil.isNotEmpty(user.getLoginPhone()) ? "phone" : "email");
 
 			}
-			if (data.getGoodsDonType() == 1) {
+			if (data.getGoodsDonType() != null && data.getGoodsDonType() == 1) {
 				//获取订单关联客服
-				Optional.ofNullable(orderDonMapper.selectOrderRelate(data.getId())).ifPresent(e->{
+				Optional.ofNullable(orderDonMapper.selectOrderRelate(data.getId())).ifPresent(e -> {
 					data.setCmsUserId(e.getCmsUserId());
 					data.setNickname(e.getNickname());
 				});

+ 25 - 6
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpTagController.java

@@ -170,17 +170,36 @@ public class CorpTagController {
 	}
 
 	/**
-	 * 通过标签 查找对应用户订单数据
+	 * 按照标签时间,消费时间 查看用户总览
 	 */
-	@GetMapping("/get/tagUser/data")
-	public Result<UserOrderDetailView> getTagUserData(@RequestParam(defaultValue = "1") Integer start, @RequestParam(defaultValue = "10") Integer limit, @RequestParam(required = true) String tagIdStr, String startTime, String endTime) {
+	@GetMapping("/get/tagUser/headData")
+	public Result<UserOrderDetailView> tagUserHeadData(@RequestParam(required = true) String tagIdStr, String startTime, String endTime, String consumeStTime, String consumeEtTime) {
 		Assert.notEmpty(tagIdStr, "请输入对应标签");
-		UserOrderDetailView userOrderDetailView = corpTagService.getTagUserData(start, limit, tagIdStr, startTime, endTime);
-		return GatewayResponse.SUCCESS.newBuilder().toResult(userOrderDetailView);
+		return GatewayResponse.SUCCESS.newBuilder().toResult(corpTagService.tagUserHeadData(tagIdStr,startTime,endTime,consumeStTime,consumeEtTime));
 	}
 
 	/**
-	 * 标签用户订单详情
+	 * 通过标签 查找进粉订单记录
+	 */
+	@GetMapping("/get/tagUser/fansData")
+	public Result<Page<UserOrderDetailView> > getTagUserData(@RequestParam(defaultValue = "1") Integer start, @RequestParam(defaultValue = "10") Integer limit, @RequestParam(required = true) String tagIdStr, String startTime, String endTime, String consumeStTime, String consumeEtTime) {
+		Assert.notEmpty(tagIdStr, "请输入对应标签");
+		Page<UserOrderDetailView>  page = corpTagService.getTagUserData(start, limit, tagIdStr, startTime, endTime, consumeStTime, consumeEtTime);
+		return GatewayResponse.SUCCESS.newBuilder().toResult(page);
+	}
+
+	/**
+	 * 通过标签 查找标签用户历史订单记录
+	 */
+	@GetMapping("/get/tagUser/pastData")
+	public Result<Page<UserOrderDetailView>> getTagUserPastRecord(@RequestParam(defaultValue = "1") Integer start, @RequestParam(defaultValue = "10") Integer limit, @RequestParam(required = true) String tagIdStr, String startTime, String endTime, String consumeStTime, String consumeEtTime) {
+		Assert.notEmpty(tagIdStr, "请输入对应标签");
+		Page<UserOrderDetailView> page = corpTagService.getTagUserPastRecord(start, limit, tagIdStr, startTime, endTime, consumeStTime, consumeEtTime);
+		return GatewayResponse.SUCCESS.newBuilder().toResult(page);
+	}
+
+	/**
+	 * 当日进粉户订单详情
 	 */
 	@GetMapping("/get/tagUser/time/orderData")
 	public Result<Page<CorpTagUserOrderDataView>> getTagUserTimeOrderData(@RequestParam(defaultValue = "1") Integer start, @RequestParam(defaultValue = "10") Integer limit, @RequestParam(required = true) String tagIdStr, String toDate, String startTime, String endTime) {

+ 4 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/WxCorpController.java

@@ -324,9 +324,11 @@ public class WxCorpController {
 			if (user != null && StrUtil.isNotBlank(user.getUnionid())) {
 				builder.field(CorpCustomerAcquistionCallback::getUnionId, user.getUnionid());
 			}
+
+			CorpCustomerAcquistionCallback corpCustomerAcquistionCallback = beanSearcher.searchFirst(CorpCustomerAcquistionCallback.class, builder.build());
+			return GatewayResponse.SUCCESS.newBuilder().toResult(corpCustomerAcquistionCallback);
 		}
-		CorpCustomerAcquistionCallback corpCustomerAcquistionCallback = beanSearcher.searchFirst(CorpCustomerAcquistionCallback.class, builder.build());
-		return GatewayResponse.SUCCESS.newBuilder().toResult(corpCustomerAcquistionCallback);
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}
 
 	/**

+ 3 - 1
netflix-web/src/main/java/com/cyksj/web/controller/manage/distribute/DistributeController.java

@@ -278,7 +278,9 @@ public class DistributeController {
 		}
 		if (StrUtil.isNotBlank(nickname)) {
 			List<Long> userIds = userMapper.selectListByNickname(nickname);
-			builder.field(UserDistributeViews::getUserId, userIds).op(Operator.InList);
+			if (CollUtil.isNotEmpty(userIds)) {
+				builder.field(UserDistributeViews::getUserId, userIds).op(Operator.InList);
+			}
 		}
 		String timeSql = StrUtil.EMPTY;
 		if (StrUtil.isNotBlank(startTime)) {