瀏覽代碼

Merge branch 'dev' of GameCenter/game-center into master

zhimo 1 年之前
父節點
當前提交
3cdac13797

+ 12 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsAccountRechargeRankingServiceImpl.java

@@ -21,6 +21,7 @@ import org.nutz.dao.util.cri.SimpleCriteria;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.math.RoundingMode;
 import java.util.List;
 import java.util.List;
 
 
@@ -102,12 +103,23 @@ public class AdsAccountRechargeRankingServiceImpl implements IAdsAccountRecharge
             result.forEach(vo -> {
             result.forEach(vo -> {
                 if (vo.getClickRate() != null) {
                 if (vo.getClickRate() != null) {
                     vo.setClickRate(NumberUtil.multiply100(vo.getClickRate()).setScale(2, RoundingMode.HALF_UP));
                     vo.setClickRate(NumberUtil.multiply100(vo.getClickRate()).setScale(2, RoundingMode.HALF_UP));
+                } else {
+                    vo.setClickRate(BigDecimal.ZERO);
                 }
                 }
                 if (vo.getAvgAmount() != null) {
                 if (vo.getAvgAmount() != null) {
                     vo.setAvgAmount(vo.getAvgAmount().setScale(2, RoundingMode.HALF_UP));
                     vo.setAvgAmount(vo.getAvgAmount().setScale(2, RoundingMode.HALF_UP));
+                } else {
+                    vo.setAvgAmount(BigDecimal.ZERO);
+                }
+                if (vo.getFirstRoi() != null) {
+                    vo.setFirstRoi(NumberUtil.multiply100(vo.getFirstRoi()).setScale(2, RoundingMode.HALF_UP));
+                } else {
+                    vo.setFirstRoi(BigDecimal.ZERO);
                 }
                 }
                 if (vo.getRoi() != null) {
                 if (vo.getRoi() != null) {
                     vo.setRoi(NumberUtil.multiply100(vo.getRoi()).setScale(2, RoundingMode.HALF_UP));
                     vo.setRoi(NumberUtil.multiply100(vo.getRoi()).setScale(2, RoundingMode.HALF_UP));
+                } else {
+                    vo.setRoi(BigDecimal.ZERO);
                 }
                 }
             });
             });
             int beginIndex = (dto.getPageNum() - 1) * dto.getPageSize();
             int beginIndex = (dto.getPageNum() - 1) * dto.getPageSize();

+ 5 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsAgentRechargeRankingServiceImpl.java

@@ -52,7 +52,7 @@ public class AdsAgentRechargeRankingServiceImpl implements IAdsAgentRechargeRank
                 max(total_recharge_count) as total_recharge_count,
                 max(total_recharge_count) as total_recharge_count,
                 max(total_cost) as total_cost,
                 max(total_cost) as total_cost,
                 max(total_recharge_amount) / max(total_recharge_count) as avg_amount,
                 max(total_recharge_amount) / max(total_recharge_count) as avg_amount,
-                if (sum(total_cost) > 0, max(total_recharge_amount) / sum(total_cost), '0') as roi
+                if (max(total_cost) > 0, max(total_recharge_amount) / max(total_cost), '0') as roi
                 from ads_agent_recharge_ranking
                 from ads_agent_recharge_ranking
                 """;
                 """;
         Criteria cri = Cnd.cri();
         Criteria cri = Cnd.cri();
@@ -88,9 +88,13 @@ public class AdsAgentRechargeRankingServiceImpl implements IAdsAgentRechargeRank
             result.forEach(vo -> {
             result.forEach(vo -> {
                 if (vo.getAvgAmount() != null) {
                 if (vo.getAvgAmount() != null) {
                     vo.setAvgAmount(vo.getAvgAmount().setScale(2, RoundingMode.HALF_UP));
                     vo.setAvgAmount(vo.getAvgAmount().setScale(2, RoundingMode.HALF_UP));
+                } else {
+                    vo.setAvgAmount(BigDecimal.ZERO);
                 }
                 }
                 if (vo.getRoi() != null) {
                 if (vo.getRoi() != null) {
                     vo.setRoi(NumberUtil.multiply100(vo.getRoi()).setScale(2, RoundingMode.HALF_UP));
                     vo.setRoi(NumberUtil.multiply100(vo.getRoi()).setScale(2, RoundingMode.HALF_UP));
+                } else {
+                    vo.setRoi(BigDecimal.ZERO);
                 }
                 }
             });
             });
             int beginIndex = (dto.getPageNum() - 1) * dto.getPageSize();
             int beginIndex = (dto.getPageNum() - 1) * dto.getPageSize();

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

@@ -186,9 +186,9 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
         }
         }
 
 
         Map<String, List> resMap = new HashMap<>(3);
         Map<String, List> resMap = new HashMap<>(3);
-        resMap.put("消耗折线数据", checkAllDateData("costList", costLineList, dto));
-        resMap.put("充值相关折线数据", checkAllDateData("amountList", amountLineList, dto));
-        resMap.put("新增用户折线数据", checkAllDateData("userList", userLineList, dto));
+        resMap.put("costLineList", checkAllDateData("costList", costLineList, dto));
+        resMap.put("amountLineList", checkAllDateData("amountList", amountLineList, dto));
+        resMap.put("userLineList", checkAllDateData("userList", userLineList, dto));
 
 
         return resMap;
         return resMap;
     }
     }

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java

@@ -21,7 +21,7 @@ public class ManageApplication {
 
 
     public static void main(String[] args) {
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 <dubbo升级3.0, SDK后台功能修改优化> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <dubbo升级3.0, SDK后台组长权限修改> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 9 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/AgentServiceImpl.java

@@ -217,6 +217,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         //渠道列表
         //渠道列表
         List<Agent> agentList;
         List<Agent> agentList;
         List<AgentDTO> agentDTOList = new ArrayList<>();
         List<AgentDTO> agentDTOList = new ArrayList<>();
+        boolean groupLeader = false;
         //超管权限
         //超管权限
         if (SecurityUtil.isManager()) {
         if (SecurityUtil.isManager()) {
             agentList = super.list(new LambdaQueryWrapper<Agent>()
             agentList = super.list(new LambdaQueryWrapper<Agent>()
@@ -228,6 +229,10 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
             List<Long> memberUserIdList = sysUserGroupRpc.memberUserId(SecurityUtil.getCompanyId(), SecurityUtil.getUserId()).getData();
             List<Long> memberUserIdList = sysUserGroupRpc.memberUserId(SecurityUtil.getCompanyId(), SecurityUtil.getUserId()).getData();
             //组长, 可查看自己或者组员数据
             //组长, 可查看自己或者组员数据
             if (CollectionUtils.isNotEmpty(memberUserIdList)) {
             if (CollectionUtils.isNotEmpty(memberUserIdList)) {
+                groupLeader = true;
+                if (!memberUserIdList.contains(SecurityUtil.getUserId())) {
+                    memberUserIdList.add(SecurityUtil.getUserId());
+                }
                 agentList = super.list(new LambdaQueryWrapper<Agent>()
                 agentList = super.list(new LambdaQueryWrapper<Agent>()
                         .eq(Strings.isNotBlank(account), Agent::getAccountId, account)
                         .eq(Strings.isNotBlank(account), Agent::getAccountId, account)
                         .eq(Strings.isNotBlank(pitcherId), Agent::getCreateBy, pitcherId)
                         .eq(Strings.isNotBlank(pitcherId), Agent::getCreateBy, pitcherId)
@@ -261,6 +266,10 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         if (SecurityUtil.isManager() && Strings.isBlank(account) && Strings.isBlank(pitcherId) && agentId == null) {
         if (SecurityUtil.isManager() && Strings.isBlank(account) && Strings.isBlank(pitcherId) && agentId == null) {
             agentIds.add(Agent.DEFAULT_AGENT);
             agentIds.add(Agent.DEFAULT_AGENT);
         }
         }
+        //组长可见自然量
+        if (groupLeader && !agentIds.contains(Agent.DEFAULT_AGENT)) {
+            agentIds.add(Agent.DEFAULT_AGENT);
+        }
         return Tuples.of(agentIds, agentDTOList);
         return Tuples.of(agentIds, agentDTOList);
     }
     }