Просмотр исходного кода

修改权限-布谷数据使用

Letianhua 1 год назад
Родитель
Сommit
11593e25de

+ 4 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/component/DataPowerComponent.java

@@ -12,6 +12,7 @@ import com.zanxiang.module.util.JsonUtil;
 import com.zanxiang.module.util.exception.BaseException;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.stereotype.Component;
 
@@ -42,6 +43,9 @@ public class DataPowerComponent {
      * 3:管理员/超管:所有数据
      */
     public Tuple2<List<Long>, List<Long>> getPowerInfo(String sdk) {
+        if (StringUtils.isBlank(sdk)) {
+            sdk = "ZX_ONE";
+        }
         if (SecurityUtil.isAdmin()) {
             return Tuple2.with(null, null);
         }

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

@@ -222,4 +222,10 @@ public class AdsOrderDetailListDTO extends BasePage {
     @ApiModelProperty(notes = "广告ID")
     private String projectId;
 
+    /**
+     * 订单渠道类型
+     */
+    @ApiModelProperty(notes = "订单渠道类型:买量 -> buy ; 自然量 -> nature")
+    private String orderAgentType;
+
 }

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

@@ -209,4 +209,10 @@ public class AdsOrderDetailTotalDTO {
     @ApiModelProperty(notes = "广告ID")
     private String projectId;
 
+    /**
+     * 订单渠道类型
+     */
+    @ApiModelProperty(notes = "订单渠道类型:买量 -> buy ; 自然量 -> nature")
+    private String orderAgentType;
+
 }

+ 4 - 4
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AccountAgentDayServiceImpl.java

@@ -51,7 +51,7 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 
     @Override
     public Page<GamePromoteDayVO> accountAgentDay(GamePromoteDayDTO dto) {
-        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getSysUserId() == null ? poerInfo.first : Collections.singletonList(dto.getSysUserId());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
 
@@ -246,7 +246,7 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 
     @Override
     public GamePromoteDayTotalVO accountAgentDayTotal(GamePromoteDayTotalDTO dto) {
-        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getSysUserId() == null ? poerInfo.first : Collections.singletonList(dto.getSysUserId());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
 
@@ -454,7 +454,7 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 
     @Override
     public Page<GamePromoteTotalVO> accountAgentTotal(GamePromoteTotalDTO dto) {
-        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getSysUserId() == null ? poerInfo.first : Collections.singletonList(dto.getSysUserId());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
         /*Long sysUserId = SecurityUtil.isAdmin() ? null : SecurityUtil.getUserId();
@@ -854,7 +854,7 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 
     @Override
     public GamePromoteTotalSumVO accountAgentTotalSum(GamePromoteTotalSumDTO dto) {
-        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getSysUserId() == null ? poerInfo.first : Collections.singletonList(dto.getSysUserId());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
         /*Long sysUserId = SecurityUtil.isAdmin() ? null : SecurityUtil.getUserId();

+ 20 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsOrderDetailService.java

@@ -43,7 +43,7 @@ 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(dto.getSourceSystem());
         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();
 
@@ -138,6 +138,15 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
             //广告ID
             cri.where().andEquals("project_id", dto.getProjectId());
         }
+        if (StringUtils.isNotBlank(dto.getOrderAgentType())) {
+            if ("buy".equals(dto.getOrderAgentType())) {
+                //查询买量数据
+                cri.where().andNotEquals("agent_id", 0);
+            } else if ("nature".equals(dto.getOrderAgentType())) {
+                //查询自然量数据
+                cri.where().andEquals("agent_id", 0);
+            }
+        }
         //添加判断,除去BG的数据 BG的数据在我们这找不到用户以及渠道
         cri.where().andNotIsNull("agent_name");
         cri.where().andNotIsNull("username");
@@ -180,7 +189,7 @@ 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(dto.getSourceSystem());
         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();
         Criteria cri = Cnd.cri();
@@ -270,6 +279,15 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
             //广告ID
             cri.where().andEquals("project_id", dto.getProjectId());
         }
+        if (StringUtils.isNotBlank(dto.getOrderAgentType())) {
+            if ("buy".equals(dto.getOrderAgentType())) {
+                //查询买量数据
+                cri.where().andNotEquals("agent_id", 0);
+            } else if ("nature".equals(dto.getOrderAgentType())) {
+                //查询自然量数据
+                cri.where().andEquals("agent_id", 0);
+            }
+        }
         //添加判断,除去BG的数据 BG的数据在我们这找不到用户以及渠道
         cri.where().andNotIsNull("agent_name");
         cri.where().andNotIsNull("username");

+ 4 - 4
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameDataServiceImpl.java

@@ -195,7 +195,7 @@ public class GameDataServiceImpl implements IGameDataService {
      */
     @Override
     public Page<GameDataDayVO> getGameDataDay(GameDataDayDTO dto) {
-        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
 
         //默认查询 total 总量数据
@@ -264,7 +264,7 @@ public class GameDataServiceImpl implements IGameDataService {
      * @return 返回给前端的总计数据实体
      */
     public GameDataDayTotalVO getGameDataDayTotal(GameDataDayTotalDTO dto) {
-        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
 
         //默认查询 total 总量数据
@@ -316,7 +316,7 @@ public class GameDataServiceImpl implements IGameDataService {
      */
     @Override
     public Page<GameDataTotalVO> getGameDataTotal(GameDataTotalDTO dto) {
-        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
         //如果注册时间参数为空,默认设置查询当天数据
         if (dto.getRegisteredBeginDate() == null || dto.getRegisteredEndDate() == null) {
@@ -438,7 +438,7 @@ public class GameDataServiceImpl implements IGameDataService {
      * @return 返回给前端额数据
      */
     public GameDataTotalTotalVO getGameDataTotalTotal(GameDataTotalTotalDTO dto) {
-        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
         //如果注册时间参数为空,默认设置查询当天数据
         if (dto.getRegisteredBeginDate() == null || dto.getRegisteredEndDate() == null) {

+ 2 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/OverallSummaryServiceImpl.java

@@ -47,7 +47,7 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
      */
     @Override
     public OverallSummaryVO getOverallSummaryTotalData(OverallSummaryDTO dto) {
-        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
 
@@ -189,7 +189,7 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
      */
     @Override
     public Map<String, List> getOverallSummaryLineData(OverallSummaryDTO dto) {
-        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
 

+ 8 - 8
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/PitcherDataServiceImpl.java

@@ -202,7 +202,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public Page<PitcherDataDayVO> getPitcherDataDay(PitcherDataDayDTO dto) {
-        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         //不传递时间,默认查询当天
         if (dto.getBeginDate() == null || dto.getEndDate() == null) {
@@ -261,7 +261,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public PitcherDataDayTotalVO getPitcherDataDayTotal(PitcherDataDayTotalDTO dto) {
-        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         //不传递时间,默认查询当天
         if (dto.getBeginDate() == null || dto.getEndDate() == null) {
@@ -303,7 +303,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public Page<PitcherDataTotalVO> getPitcherDataTotal(PitcherDataTotalDTO dto) {
-        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         //如果注册时间参数为空,默认设置查询当天数据
         if (dto.getBeginDate() == null || dto.getEndDate() == null) {
@@ -395,7 +395,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public PitcherDataTotalSumVO getPitcherDataTotalSum(PitcherDataTotalSumDTO dto) {
-        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         //如果注册时间参数为空,默认设置查询当天数据
         if (dto.getBeginDate() == null || dto.getEndDate() == null) {
@@ -486,7 +486,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public Page<PitcherGameDataDayVO> getPitcherGameDataDay(PitcherGameDataDayDTO dto) {
-        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(Long.parseLong(dto.getGameId()));
         //不传递时间,默认查询当天
@@ -556,7 +556,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public PitcherGameDataDayTotalVO getPitcherGameDataDayTotal(PitcherGameDataDayTotalDTO dto) {
-        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(Long.parseLong(dto.getGameId()));
         //不传递时间,默认查询当天
@@ -608,7 +608,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public Page<PitcherGameDataTotalVO> getPitcherGameDataTotal(PitcherGameDataTotalDTO dto) {
-        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(Long.parseLong(dto.getGameId()));
         //如果注册时间参数为空,默认设置查询当天数据
@@ -707,7 +707,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public PitcherGameDataTotalSumVO getPitcherGameDataTotalSum(PitcherGameDataTotalSumDTO dto) {
-        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
         List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(Long.parseLong(dto.getGameId()));
         //如果注册时间参数为空,默认设置查询当天数据