Explorar el Código

修改内容:订单添加广告ID、计划ID筛选

lth hace 1 año
padre
commit
8cccb6cc5e

+ 13 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/AdsOrderDetailListDTO.java

@@ -209,4 +209,17 @@ public class AdsOrderDetailListDTO extends BasePage {
      */
     @ApiModelProperty("排序方式")
     private String sortType;
+
+    /**
+     * 计划ID
+     */
+    @ApiModelProperty(notes = "计划ID")
+    private String promotionId;
+
+    /**
+     * 广告ID
+     */
+    @ApiModelProperty(notes = "广告ID")
+    private String projectId;
+
 }

+ 12 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/AdsOrderDetailTotalDTO.java

@@ -197,4 +197,16 @@ public class AdsOrderDetailTotalDTO {
     @ApiModelProperty("SDK来源")
     private String sourceSystem;
 
+    /**
+     * 计划ID
+     */
+    @ApiModelProperty(notes = "计划ID")
+    private String promotionId;
+
+    /**
+     * 广告ID
+     */
+    @ApiModelProperty(notes = "广告ID")
+    private String projectId;
+
 }

+ 12 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/AdsOrderDetailVO.java

@@ -166,4 +166,16 @@ public class AdsOrderDetailVO {
     @ApiModelProperty(notes = "最近充值时间距今(秒)")
     private Long payUntilNow;
 
+    /**
+     * 计划ID
+     */
+    @ApiModelProperty(notes = "计划ID")
+    private String promotionId;
+
+    /**
+     * 广告ID
+     */
+    @ApiModelProperty(notes = "广告ID")
+    private String projectId;
+
 }

+ 33 - 12
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsOrderDetailService.java

@@ -1,6 +1,5 @@
 package com.zanxiang.game.data.serve.service.impl;
 
-import com.github.sd4324530.jtuple.Tuple2;
 import com.google.common.base.CaseFormat;
 import com.zanxiang.erp.security.util.SecurityUtil;
 import com.zanxiang.game.data.serve.component.DataPowerComponent;
@@ -43,9 +42,11 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
 
     @Override
     public Page<AdsOrderDetailVO> listOfPage(AdsOrderDetailListDTO dto) {
-        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        /*Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
         List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(Long.parseLong(dto.getPitcherId()));
-        List<Long> gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? poerInfo.second : dto.getGameId();
+        List<Long> gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? poerInfo.second : dto.getGameId();*/
+        List<Long> userIds = dto.getPitcherId() == null ? dataPowerComponent.getSubUserIdList(): Collections.singletonList(Long.parseLong(dto.getPitcherId()));
+        List<Long> gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? dataPowerComponent.getSubGameIdList() : dto.getGameId();
         if (StringUtils.isBlank(dto.getPitcherId()) && !SecurityUtil.isManager()) {
             // 只有管理员才能查看全部数据
             dto.setPitcherId(SecurityUtil.getUserId().toString());
@@ -129,6 +130,14 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
         if (StringUtils.isNotBlank(dto.getRoleName())) {
             cri.where().andLike("role_name", dto.getRoleName());
         }
+        if (StringUtils.isNotBlank(dto.getPromotionId())) {
+            //计划ID
+            cri.where().andEquals("promotion_id", dto.getPromotionId());
+        }
+        if (StringUtils.isNotBlank(dto.getProjectId())) {
+            //广告ID
+            cri.where().andEquals("project_id", dto.getProjectId());
+        }
 
         //pager
         Pager pager = dto.toPage();
@@ -168,13 +177,11 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
 
     @Override
     public AdsOrderDetailTotalVO orderTotal(AdsOrderDetailTotalDTO dto) {
-        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        /*Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
         List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(Long.parseLong(dto.getPitcherId()));
-        List<Long> gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? poerInfo.second : dto.getGameId();
-        /*if (StringUtils.isBlank(dto.getPitcherId()) && !SecurityUtil.isManager()) {
-            // 只有管理员才能查看全部数据
-            dto.setPitcherId(SecurityUtil.getUserId().toString());
-        }*/
+        List<Long> gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? poerInfo.second : dto.getGameId();*/
+        List<Long> userIds = dto.getPitcherId() == null ? dataPowerComponent.getSubUserIdList(): Collections.singletonList(Long.parseLong(dto.getPitcherId()));
+        List<Long> gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? dataPowerComponent.getSubGameIdList() : dto.getGameId();
         Criteria cri = Cnd.cri();
         if (StringUtils.isNotBlank(dto.getSourceSystem())) {
             cri.where().andEquals("source_system", dto.getSourceSystem());
@@ -254,6 +261,14 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
         if (StringUtils.isNotBlank(dto.getRoleName())) {
             cri.where().andLike("role_name", dto.getRoleName());
         }
+        if (StringUtils.isNotBlank(dto.getPromotionId())) {
+            //计划ID
+            cri.where().andEquals("promotion_id", dto.getPromotionId());
+        }
+        if (StringUtils.isNotBlank(dto.getProjectId())) {
+            //广告ID
+            cri.where().andEquals("project_id", dto.getProjectId());
+        }
 
         Sql sql = Sqls.create(getOrderDetailTotalSql() + cri);
         sql.setCallback(Sqls.callback.entity());
@@ -366,7 +381,9 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
                 		a.pay_time,  -- 支付时间
                 		TIMESTAMPDIFF(SECOND, b.create_time, a.pay_time) as reg_until_pay, -- 注册充值时间差
                 		TIMESTAMPDIFF(SECOND, a.pay_time, NOW()) as pay_until_now, -- 最近充值时间距今(秒)
-                		IF(a.status = 2, IF(a.create_time = i.create_time, 1, 0), 0) as is_first_recharge -- 是否首充
+                		IF(a.status = 2, IF(a.create_time = i.create_time, 1, 0), 0) as is_first_recharge, -- 是否首充
+                		IF(a.promotion_id = 'null', NULL, a.promotion_id) as promotion_id , -- 计划ID
+                  		IF(a.project_id = 'null' , NULL, a.project_id) as project_id -- 项目ID(广告ID)
                 	FROM dm_game_order.t_game_order a
                 	LEFT JOIN dm_game_order.t_game_user b on a.source_system = b.source_system AND a.user_id = b.id
                 	LEFT JOIN dm_game_order.t_pitcher_agent c on a.source_system = c.source_system AND a.agent_id = c.id
@@ -445,7 +462,9 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
                 		a.pay_time,  -- 支付时间
                 		TIMESTAMPDIFF(SECOND, b.create_time, a.pay_time) as reg_until_pay, -- 注册充值时间差
                 		TIMESTAMPDIFF(SECOND, a.pay_time, NOW()) as pay_until_now, -- 最近充值时间距今(秒)
-                		IF(a.status = 2, IF(a.create_time = i.create_time, 1, 0), 0) as is_first_recharge -- 是否首充
+                		IF(a.status = 2, IF(a.create_time = i.create_time, 1, 0), 0) as is_first_recharge, -- 是否首充
+                		IF(a.promotion_id = 'null', NULL, a.promotion_id) as promotion_id , -- 计划ID
+                  		IF(a.project_id = 'null' , NULL, a.project_id) as project_id -- 项目ID(广告ID)
                 	FROM dm_game_order.t_game_order a
                 	LEFT JOIN dm_game_order.t_game_user b on a.source_system = b.source_system AND a.user_id = b.id
                 	LEFT JOIN dm_game_order.t_pitcher_agent c on a.source_system = c.source_system AND a.agent_id = c.id
@@ -525,7 +544,9 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
                 		a.pay_time,  -- 支付时间
                 		TIMESTAMPDIFF(SECOND, b.create_time, a.pay_time) as reg_until_pay, -- 注册充值时间差
                 		TIMESTAMPDIFF(SECOND, a.pay_time, NOW()) as pay_until_now, -- 最近充值时间距今(秒)
-                		IF(a.status = 2, IF(a.create_time = i.create_time, 1, 0), 0) as is_first_recharge -- 是否首充
+                		IF(a.status = 2, IF(a.create_time = i.create_time, 1, 0), 0) as is_first_recharge, -- 是否首充
+                		IF(a.promotion_id = 'null', NULL, a.promotion_id) as promotion_id , -- 计划ID
+                  		IF(a.project_id = 'null' , NULL, a.project_id) as project_id -- 项目ID(广告ID)
                 	FROM dm_game_order.t_game_order a
                 	LEFT JOIN dm_game_order.t_game_user b on a.source_system = b.source_system AND a.user_id = b.id
                 	LEFT JOIN dm_game_order.t_pitcher_agent c on a.source_system = c.source_system AND a.agent_id = c.id