Переглянути джерело

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

zhimo 9 місяців тому
батько
коміт
c145fab282
20 змінених файлів з 520 додано та 153 видалено
  1. 7 5
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsOrderDetailServiceImpl.java
  2. 17 0
      game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/dao/mapper/game/order/GameServerSonMergeMapper.java
  3. 41 6
      game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/pojo/dto/BigRDTO.java
  4. 149 0
      game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/pojo/entity/game/order/GameServerSonMerge.java
  5. 80 6
      game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/pojo/entity/game/parent/AdsRoleAmountDataParent.java
  6. 39 79
      game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/pojo/vo/BigRVO.java
  7. 19 0
      game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/service/IGameServerSonMergeService.java
  8. 65 53
      game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/service/impl/AdsRoleAmountDataParentServiceImpl.java
  9. 1 1
      game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/service/impl/GameServerServiceImpl.java
  10. 34 0
      game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/service/impl/GameServerSonMergeServiceImpl.java
  11. 10 0
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/Game.java
  12. 1 1
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/SDKApplication.java
  13. 2 1
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/adapter/WebHandlerAdapter.java
  14. 10 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/controller/AppletController.java
  15. 6 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/vo/UserLoginVO.java
  16. 10 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/IGameAppletService.java
  17. 2 1
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/CallBackServiceImpl.java
  18. 24 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GameAppletServiceImpl.java
  19. 2 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/LoginServiceImpl.java
  20. 1 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/PerformOrderServiceImpl.java

+ 7 - 5
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsOrderDetailServiceImpl.java

@@ -475,13 +475,14 @@ public class AdsOrderDetailServiceImpl implements IAdsOrderDetailService {
                 		SELECT
                 			-- 累计充值金额、累计充值次数
                 			role_id,
+                			user_id,
                 			source_system,
                 			SUM(real_amount) as amount ,
                 			COUNT(user_id) as amount_count
                 		FROM dm_game_order.t_game_order
                 		WHERE status =2
-                		GROUP BY role_id , source_system
-                	) k on a.source_system = k.source_system AND a.role_id = k.role_id
+                		GROUP BY role_id , source_system,user_id
+                	) k on a.source_system = k.source_system AND a.role_id = k.role_id and a.user_id = k.user_id
                 	LEFT JOIN (
                 		SELECT
                 			id,
@@ -645,16 +646,17 @@ public class AdsOrderDetailServiceImpl implements IAdsOrderDetailService {
                 		WHERE is_delete = 0
                 	) j on a.source_system = j.source_system AND a.merchant_no = j.merchant_no
                 	LEFT JOIN (
-                		SELECT
+                	SELECT
                 			-- 累计充值金额、累计充值次数
                 			role_id,
+                			user_id,
                 			source_system,
                 			SUM(real_amount) as amount ,
                 			COUNT(user_id) as amount_count
                 		FROM dm_game_order.t_game_order
                 		WHERE status =2
-                		GROUP BY role_id , source_system
-                	) k on a.source_system = k.source_system AND a.role_id = k.role_id
+                		GROUP BY role_id , source_system,user_id
+                	) k on a.source_system = k.source_system AND a.role_id = k.role_id and a.user_id = k.user_id
                 	LEFT JOIN (
                 		SELECT
                 			id,

+ 17 - 0
game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/dao/mapper/game/order/GameServerSonMergeMapper.java

@@ -0,0 +1,17 @@
+package com.zanxiang.game.gs.data.serve.dao.mapper.game.order;
+
+import com.zanxiang.game.gs.data.serve.pojo.entity.game.order.GameServerSonMerge;
+import com.mybatisflex.core.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 游戏区服合服子服记录表 映射层。
+ *
+ * @author shaosong
+ * @since 1.0
+ */
+@Mapper
+public interface GameServerSonMergeMapper extends BaseMapper<GameServerSonMerge> {
+
+
+}

+ 41 - 6
game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/pojo/dto/BigRDTO.java

@@ -4,25 +4,60 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 import java.time.LocalDate;
 import java.util.List;
 
 @EqualsAndHashCode(callSuper = true)
 @Data
 public class BigRDTO extends BaseListDTO {
-    @NotBlank
-    @ApiModelProperty(notes = "SDK来源")
+    @NotNull(message = "SDK来源必填")
+    @ApiModelProperty(notes = "必填:SDK来源;默认ZX_ONE")
     private String sourceSystem;
     @ApiModelProperty("排序字段")
     private String sortFiled;
     @ApiModelProperty("排序类型:升序 true;降序 false")
     private Boolean sortAsc = true;
 
-    @ApiModelProperty("统计日期开始")
+    @ApiModelProperty("充值统计日期开始")
     private LocalDate dtBegin;
-    @ApiModelProperty("统计日期结束")
+    @ApiModelProperty("充值统计日期结束")
     private LocalDate dtEnd;
-    @ApiModelProperty("gs id列表")
+    @ApiModelProperty("gs id 列表")
     private List<Long> gsIdList;
+
+    @ApiModelProperty("父游戏id")
+    private Long parentGameId;
+
+    @ApiModelProperty("角色名称")
+    private String roleName;
+
+    @ApiModelProperty("角色创建日期开始")
+    private LocalDate roleCreateDayBegin;
+    @ApiModelProperty("角色创建日期结束")
+    private LocalDate roleCreateDayEnd;
+
+    @ApiModelProperty("超父游戏id")
+    private Integer superGameId;
+    @ApiModelProperty("角色当前所在区服id列表")
+    private List<String> serverIdList;
+
+    @ApiModelProperty("服务日期开始")
+    private LocalDate serveDayBegin;
+    @ApiModelProperty("服务日期开始")
+    private LocalDate serveDayEnd;
+
+    @ApiModelProperty("服务状态:1:服务中;2:服务完成")
+    private Integer serveStatus;
+
+    @NotNull(message = "角色来源必填")
+    @ApiModelProperty("必填:角色来源:1:区服指派;2:角色指派")
+    private Integer roleSource;
+
+    @ApiModelProperty("人工判断角色退游状态:0:未退游;1:退游")
+    private Integer humanRemoveGameStatus;
+
+    @ApiModelProperty("系统判断角色退游状态:0:未退游;1:退游")
+    private Integer systemRemoveGameStatus;
+
 }

+ 149 - 0
game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/pojo/entity/game/order/GameServerSonMerge.java

@@ -0,0 +1,149 @@
+package com.zanxiang.game.gs.data.serve.pojo.entity.game.order;
+
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.Builder;
+import com.mybatisflex.annotation.Column;
+import com.mybatisflex.annotation.Table;
+
+import java.lang.Long;
+import java.time.LocalDateTime;
+import java.lang.String;
+import java.lang.Integer;
+
+/**
+ * 游戏区服合服子服记录表 实体类。
+ *
+ * @author shaosong
+ * @since 1.0
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(value = "t_game_server_son_merge")
+public class GameServerSonMerge {
+
+    /**
+     * 主键
+     */
+    @Column(value = "id")
+    private Long id;
+
+    /**
+     * SDK来源
+     */
+    @Column(value = "source_system")
+    private String sourceSystem;
+
+    /**
+     * 合服包含的子服列表
+     */
+    @Column(value = "son_server_ids")
+    private String sonServerIds;
+
+    /**
+     * 超父游戏ID
+     */
+    @Column(value = "game_id")
+    private Long gameId;
+
+    /**
+     * 区服id
+     */
+    @Column(value = "server_id")
+    private String serverId;
+
+    /**
+     * 区服名称
+     */
+    @Column(value = "server_name")
+    private String serverName;
+
+    /**
+     * 区服冠名
+     */
+    @Column(value = "nick_name")
+    private String nickName;
+
+    /**
+     * 开服时间
+     */
+    @Column(value = "start_time")
+    private LocalDateTime startTime;
+
+    /**
+     * 0正常1删除
+     */
+    @Column(value = "is_delete")
+    private Integer isDelete;
+
+    /**
+     * 创建者id
+     */
+    @Column(value = "create_by")
+    private Long createBy;
+
+    /**
+     * 创建时间
+     */
+    @Column(value = "create_time")
+    private LocalDateTime createTime;
+
+    /**
+     * 更新者id
+     */
+    @Column(value = "update_by")
+    private Long updateBy;
+
+    /**
+     * 更新时间
+     */
+    @Column(value = "update_time")
+    private LocalDateTime updateTime;
+
+    /**
+     * 是否原始服:1是,0否
+     */
+    @Column(value = "is_source_server")
+    private Integer isSourceServer;
+
+    /**
+     * 合服的主服ID
+     */
+    @Column(value = "main_server_id")
+    private String mainServerId;
+
+    /**
+     * 是否参与过合服:1是,0否
+     */
+    @Column(value = "is_merge")
+    private Integer isMerge;
+
+    /**
+     * 合服包含的原始服列表
+     */
+    @Column(value = "source_server_ids")
+    private String sourceServerIds;
+
+    /**
+     * 合服时间
+     */
+    @Column(value = "merge_time")
+    private LocalDateTime mergeTime;
+
+    /**
+     * gsID
+     */
+    @Column(value = "gs_ids")
+    private String gsIds;
+
+    /**
+     * 客服id
+     */
+    @Column(value = "customer_ids")
+    private String customerIds;
+
+
+}

+ 80 - 6
game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/pojo/entity/game/parent/AdsRoleAmountDataParent.java

@@ -9,6 +9,7 @@ import com.mybatisflex.annotation.Table;
 
 import java.math.BigDecimal;
 import java.lang.Long;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.lang.String;
 import java.lang.Integer;
@@ -25,8 +26,6 @@ import java.lang.Integer;
 @AllArgsConstructor
 @Table(value = "ads_role_amount_data_parent")
 public class AdsRoleAmountDataParent {
-    @Column(value = "game_id")
-    private String gameId;
 
     /**
      * 角色ID
@@ -34,6 +33,24 @@ public class AdsRoleAmountDataParent {
     @Column(value = "role_id")
     private String roleId;
 
+    /**
+     * gs_id
+     */
+    @Column(value = "gs_id")
+    private Long gsId;
+
+    /**
+     * gs 开始服务时间
+     */
+    @Column(value = "gs_start_time")
+    private LocalDate gsStartTime;
+
+    /**
+     * 子游戏ID
+     */
+    @Column(value = "game_id")
+    private Long gameId;
+
     /**
      * 角色名称
      */
@@ -50,7 +67,7 @@ public class AdsRoleAmountDataParent {
      * 父游戏ID
      */
     @Column(value = "parent_game_id")
-    private Integer parentGameId;
+    private Long parentGameId;
 
     /**
      * 父用户ID
@@ -148,10 +165,67 @@ public class AdsRoleAmountDataParent {
     @Column(value = "proportion")
     private BigDecimal proportion;
 
-
+    /**
+     * 角色ID拼接游戏ID
+     */
     @Column(value = "concat_game")
     private String concatGame;
 
-    @Column(value = "gs_id")
-    private Long gsId;
+    /**
+     * 每个gs的充值
+     */
+    @Column(value = "gs_amount")
+    private BigDecimal gsAmount;
+
+    /**
+     * 每个gs的充值次数
+     */
+    @Column(value = "gs_count")
+    private Integer gsCount;
+
+    /**
+     * gs服务结束时间
+     */
+    @Column(value = "gs_end_time")
+    private LocalDate gsEndTime;
+
+    /**
+     * 原始区服ID
+     */
+    @Column(value = "source_server_id")
+    private String sourceServerId;
+
+    /**
+     * 当前区服ID
+     */
+    @Column(value = "end_server_id")
+    private String endServerId;
+
+    /**
+     * 超父游戏ID
+     */
+    @Column(value = "super_game_id")
+    private Long superGameId;
+
+    /**
+     * 区服指派GS
+     */
+    @Column(value = "gs_id_server")
+    private String gsIdServer;
+
+    /**
+     * 区服指派GS充值金额
+     */
+    @Column(value = "server_amount")
+    private BigDecimal serverAmount;
+
+    /**
+     * 区服指派GS充值次数
+     */
+    @Column(value = "server_count")
+    private Integer serverCount;
+
+    @Column(value = "is_remove_game")
+    private Integer isRemoveGame;
+
 }

+ 39 - 79
game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/pojo/vo/BigRVO.java

@@ -1,9 +1,11 @@
 package com.zanxiang.game.gs.data.serve.pojo.vo;
 
+import com.mybatisflex.annotation.Column;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.List;
 
@@ -14,62 +16,36 @@ public class BigRVO {
     @ApiModelProperty("角色ID")
     private String roleId;
 
-    /**
-     * 角色名称
-     */
     @ApiModelProperty("角色名称")
     private String roleName;
+    @ApiModelProperty("超父游戏id")
+    private Long superGameId;
+    @ApiModelProperty("当前区服ID")
+    private String endServerId;
 
-    /**
-     * 区服ID
-     */
-    @ApiModelProperty("区服ID")
-    private String serverId;
+    @ApiModelProperty("当前区服名称")
+    private String endServerName;
 
-    @ApiModelProperty("区服名称")
-    private String serverName;
-
-    /**
-     * 父游戏ID
-     */
     @ApiModelProperty("父游戏ID")
     private Integer parentGameId;
     @ApiModelProperty("父游戏名称")
     private String parentGameName;
 
-    /**
-     * 父用户ID
-     */
     @ApiModelProperty("父用户ID")
     private Long associationUserId;
 
-    /**
-     * 角色vip
-     */
     @ApiModelProperty("角色vip")
     private Integer roleVip;
 
-    /**
-     * 角色等级
-     */
     @ApiModelProperty("角色等级")
     private Integer roleLevel;
 
-    /**
-     * 角色攻击力
-     */
     @ApiModelProperty("角色攻击力")
     private Long combatNum;
 
-    /**
-     * 国家
-     */
     @ApiModelProperty("国家")
     private String country;
 
-    /**
-     * 角色创建时间
-     */
     @ApiModelProperty("角色创建时间")
     private LocalDateTime roleTime;
     @ApiModelProperty("角色创角天数")
@@ -79,87 +55,42 @@ public class BigRVO {
     @ApiModelProperty("角色最近活跃时间距今")
     private Long roleActiveDayDiff;
 
-    /**
-     * 角色首充金额
-     */
     @ApiModelProperty("角色首充金额")
     private BigDecimal firstAmount;
 
-    /**
-     * 创角24小时付费金额
-     */
     @ApiModelProperty("创角24小时付费金额")
     private BigDecimal roleHourAmount;
 
-    /**
-     * 角色最近充值金额
-     */
     @ApiModelProperty("角色最近充值金额")
     private BigDecimal lastAmount;
 
-    /**
-     * 角色最近充值时间
-     */
     @ApiModelProperty("角色最近充值时间")
     private LocalDateTime lastOrderTime;
 
-    /**
-     * 角色最近充值产品
-     */
     @ApiModelProperty("角色最近充值产品")
     private String productName;
 
-    /**
-     * 角色累计充值金额
-     */
     @ApiModelProperty("角色累计充值金额")
     private BigDecimal totalAmount;
 
-    /**
-     * 角色累计充值次数
-     */
     @ApiModelProperty("角色累计充值次数")
     private Integer totalCnt;
 
-    /**
-     * 角色最近活跃时间
-     */
     @ApiModelProperty("角色最近活跃时间")
     private LocalDateTime activeTime;
 
-    /**
-     * 小程序充值金额
-     */
     @ApiModelProperty("小程序充值金额")
     private BigDecimal appAmount;
 
-    /**
-     * 角色转端充值比
-     */
     @ApiModelProperty("角色转端充值比")
     private BigDecimal proportion;
 
-    /**
-     * 角色当天充值金额
-     */
     @ApiModelProperty("角色当天充值金额")
     private BigDecimal todayAmount;
-
-    /**
-     * 角色当天充值次数
-     */
     @ApiModelProperty("角色当天充值次数")
     private Integer todayCount;
-
-    /**
-     * 游戏充值比
-     */
     @ApiModelProperty("游戏充值比")
     private BigDecimal gameProportion;
-
-    /**
-     * 区服充值比
-     */
     @ApiModelProperty("区服充值比")
     private BigDecimal serverProportion;
 
@@ -168,6 +99,35 @@ public class BigRVO {
     @ApiModelProperty("GS ID")
     private Long gsId;
 
-    @ApiModelProperty("GS组名称")
-    private List<String> gsGroupName;
+    @ApiModelProperty("GS服务中的付费金额")
+    private BigDecimal gsAmount;
+
+    @ApiModelProperty("GS服务中的付费次数")
+    private Long gsCount;
+
+    @ApiModelProperty("区服指派GS充值金额")
+    private BigDecimal serverAmount;
+
+    @ApiModelProperty("区服指派GS充值次数")
+    private Integer serverCount;
+
+    @ApiModelProperty("GS服务时间-开始")
+    private LocalDate gsStartTime;
+    @ApiModelProperty("GS服务时间-结束")
+    private LocalDate gsEndTime;
+
+    @ApiModelProperty("GS服务天数")
+    private Long gsServeDays;
+
+    @ApiModelProperty("服务状态:0:服务中;1:服务完成")
+    private Boolean serveStatus;
+
+    @ApiModelProperty("角色来源:1:区服指派;2:角色指派")
+    private Integer roleSource;
+
+    @ApiModelProperty("角色人工判断退游状态:0:未退游;1:退游")
+    private Integer humanRemoveGameStatus;
+
+    @ApiModelProperty("角色系统判断退游状态:0:未退游;1:退游")
+    private Integer systemRemoveGameStatus;
 }

+ 19 - 0
game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/service/IGameServerSonMergeService.java

@@ -0,0 +1,19 @@
+package com.zanxiang.game.gs.data.serve.service;
+
+
+import com.zanxiang.game.gs.data.serve.pojo.entity.game.order.GameServerSonMerge;
+import com.mybatisflex.core.service.IService;
+
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * 游戏区服合服子服记录表 服务层。
+ *
+ * @author shaosong
+ * @since 1.0
+ */
+public interface IGameServerSonMergeService extends IService<GameServerSonMerge> {
+    Map<Long, Map<String, String>> gameServerMap(String sourceSystem, Collection<String> serverIdList);
+
+}

+ 65 - 53
game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/service/impl/AdsRoleAmountDataParentServiceImpl.java

@@ -8,12 +8,12 @@ import com.mybatisflex.core.row.Row;
 import com.mybatisflex.spring.service.impl.ServiceImpl;
 import com.zanxiang.game.gs.data.serve.dao.mapper.game.parent.AdsRoleAmountDataParentMapper;
 import com.zanxiang.game.gs.data.serve.pojo.dto.BigRDTO;
-import com.zanxiang.game.gs.data.serve.pojo.entity.game.order.RoleOperate;
 import com.zanxiang.game.gs.data.serve.pojo.entity.game.parent.AdsRoleAmountDataParent;
 import com.zanxiang.game.gs.data.serve.pojo.entity.game.parent.AdsRoleAmountDataTodayParent;
 import com.zanxiang.game.gs.data.serve.pojo.vo.BigRVO;
 import com.zanxiang.game.gs.data.serve.pojo.vo.PageVO;
 import com.zanxiang.game.gs.data.serve.service.*;
+import com.zanxiang.module.util.DateUtil;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Service;
@@ -22,7 +22,6 @@ import javax.annotation.Resource;
 import java.time.LocalDate;
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
 
@@ -47,6 +46,8 @@ public class AdsRoleAmountDataParentServiceImpl extends ServiceImpl<AdsRoleAmoun
     @Resource
     private IGameService gameService;
     @Resource
+    private IGameServerSonMergeService serverSonMergeService;
+    @Resource
     private IGameServerService gameServerService;
     @Resource
     private IGameAuthRoleGroupService authRoleGroupService;
@@ -74,59 +75,77 @@ public class AdsRoleAmountDataParentServiceImpl extends ServiceImpl<AdsRoleAmoun
             return PageVO.empty(dto);
         }
         List<BigRVO> records = paginate.getRecords();
-        Set<String> serverIdList = records.stream().map(BigRVO::getServerId).collect(Collectors.toSet());
+        Set<String> serverIdList = records.stream().map(BigRVO::getEndServerId).collect(Collectors.toSet());
         Set<Integer> parentGameIdList = records.stream().map(BigRVO::getParentGameId).collect(Collectors.toSet());
         Set<Long> gsIdList = records.stream().map(BigRVO::getGsId).collect(Collectors.toSet());
         //父游戏名称
         Map<Integer, String> parentGameMap = gameService.gameNameMap(dto.getSourceSystem(), parentGameIdList);
         //区服名称
-        Map<Integer, Map<String, String>> serverMap = gameServerService.gameServerMap(dto.getSourceSystem(), serverIdList);
+        Map<Long, Map<String, String>> serverMap = serverSonMergeService.gameServerMap(dto.getSourceSystem(), serverIdList);
         //GS名称查询
         Map<Long, String> sysUserMap = CollectionUtils.isEmpty(gsIdList) ? null : sysUserService.getSysUserMap(gsIdList);
         //GS组名称
-        Map<Long, List<String>> gsGroupMap = authRoleGroupService.getGsGroupMap(dto.getSourceSystem(), gsIdList);
+//        Map<Long, List<String>> gsGroupMap = authRoleGroupService.getGsGroupMap(dto.getSourceSystem(), gsIdList);
         records.forEach(record -> {
             Long gsId = record.getGsId();
-            record.setGsName(null == gsId ? null : sysUserMap != null ? sysUserMap.get(gsId) : null);
-            record.setGsGroupName(null == gsId ? null : gsGroupMap.get(gsId));
+            record.setGsName(0 == gsId ? null : sysUserMap != null ? sysUserMap.get(gsId) : null);
+//            record.setGsGroupName(null == gsId ? null : gsGroupMap.get(gsId));
             record.setParentGameName(parentGameMap.get(record.getParentGameId()));
-            record.setServerName(null == serverMap.get(record.getGameId()) ? null : serverMap.get(record.getGameId()).get(record.getServerId()));
+            record.setEndServerName(null == serverMap.get(record.getSuperGameId()) ? null : serverMap.get(record.getSuperGameId()).get(record.getEndServerId()));
+            if (null != record.getGsStartTime()) {
+                record.setGsServeDays(record.getGsEndTime().isBefore(LocalDate.now()) ? DateUtil.intervalOfDays(record.getGsStartTime(), record.getGsEndTime())
+                        : DateUtil.intervalOfDays(record.getGsStartTime(), LocalDate.now()));
+                record.setServeStatus(record.getGsEndTime().isBefore(LocalDate.now()));
+            }
+            record.setRoleSource(0 == record.getGsId() ? 1 : 2);
         });
         return new PageVO<>(paginate);
     }
 
     private static QueryWrapper getBigRWrapper(BigRDTO dto) {
         return QueryWrapper.create()
+                .select(ADS_ROLE_AMOUNT_DATA_PARENT.GS_ID)
                 .select(ADS_ROLE_AMOUNT_DATA_PARENT.GAME_ID)
                 .select(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_ID)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_NAME)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.SERVER_ID)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.PARENT_GAME_ID)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.ASSOCIATION_USER_ID)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_LEVEL)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_VIP)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.COMBAT_NUM)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.COUNTRY)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_TIME)
-                .select(dateDiff(currentDate(), ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_TIME).as("role_create_day_diff"))
-                .select(dateDiff(currentDate(), ADS_ROLE_AMOUNT_DATA_PARENT.ACTIVE_TIME).as("role_active_day_diff"))
-                .select(dateDiff(currentDate(), ADS_ROLE_AMOUNT_DATA_PARENT.LAST_ORDER_TIME).as("last_order_day_diff"))
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.FIRST_AMOUNT)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_HOUR_AMOUNT)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.LAST_AMOUNT)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.LAST_ORDER_TIME)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.PRODUCT_NAME)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.TOTAL_AMOUNT)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.TOTAL_CNT)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.ACTIVE_TIME)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.APP_AMOUNT)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.PROPORTION)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.GS_ID)
-                .select(ADS_ROLE_AMOUNT_DATA_PARENT.CONCAT_GAME)
+                .select(ADS_ROLE_AMOUNT_DATA_PARENT.GS_START_TIME)
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_NAME).as(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_NAME.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.SERVER_ID).as(ADS_ROLE_AMOUNT_DATA_PARENT.SERVER_ID.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.PARENT_GAME_ID).as(ADS_ROLE_AMOUNT_DATA_PARENT.PARENT_GAME_ID.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.ASSOCIATION_USER_ID).as(ADS_ROLE_AMOUNT_DATA_PARENT.ASSOCIATION_USER_ID.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_LEVEL).as(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_LEVEL.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_VIP).as(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_VIP.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.COMBAT_NUM).as(ADS_ROLE_AMOUNT_DATA_PARENT.COMBAT_NUM.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.COUNTRY).as(ADS_ROLE_AMOUNT_DATA_PARENT.COUNTRY.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_TIME).as(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_TIME.getName()))
+                .select(dateDiff(currentDate(), max(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_TIME)).as("role_create_day_diff"))
+                .select(dateDiff(currentDate(), max(ADS_ROLE_AMOUNT_DATA_PARENT.ACTIVE_TIME)).as("role_active_day_diff"))
+                .select(dateDiff(currentDate(), max(ADS_ROLE_AMOUNT_DATA_PARENT.LAST_ORDER_TIME)).as("last_order_day_diff"))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.FIRST_AMOUNT).as(ADS_ROLE_AMOUNT_DATA_PARENT.FIRST_AMOUNT.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_HOUR_AMOUNT).as(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_HOUR_AMOUNT.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.LAST_AMOUNT).as(ADS_ROLE_AMOUNT_DATA_PARENT.LAST_AMOUNT.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.LAST_ORDER_TIME).as(ADS_ROLE_AMOUNT_DATA_PARENT.LAST_ORDER_TIME.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.PRODUCT_NAME).as(ADS_ROLE_AMOUNT_DATA_PARENT.PRODUCT_NAME.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.TOTAL_AMOUNT).as(ADS_ROLE_AMOUNT_DATA_PARENT.TOTAL_AMOUNT.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.TOTAL_CNT).as(ADS_ROLE_AMOUNT_DATA_PARENT.TOTAL_CNT.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.ACTIVE_TIME).as(ADS_ROLE_AMOUNT_DATA_PARENT.ACTIVE_TIME.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.APP_AMOUNT).as(ADS_ROLE_AMOUNT_DATA_PARENT.APP_AMOUNT.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.PROPORTION).as(ADS_ROLE_AMOUNT_DATA_PARENT.PROPORTION.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.CONCAT_GAME).as(ADS_ROLE_AMOUNT_DATA_PARENT.CONCAT_GAME.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.GS_AMOUNT).as(ADS_ROLE_AMOUNT_DATA_PARENT.GS_AMOUNT.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.GS_COUNT).as(ADS_ROLE_AMOUNT_DATA_PARENT.GS_COUNT.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.GS_END_TIME).as(ADS_ROLE_AMOUNT_DATA_PARENT.GS_END_TIME.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.SOURCE_SERVER_ID).as(ADS_ROLE_AMOUNT_DATA_PARENT.SOURCE_SERVER_ID.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.END_SERVER_ID).as(ADS_ROLE_AMOUNT_DATA_PARENT.END_SERVER_ID.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.SUPER_GAME_ID).as(ADS_ROLE_AMOUNT_DATA_PARENT.SUPER_GAME_ID.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.IS_REMOVE_GAME).as("human_remove_game_status"))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.GS_ID_SERVER).as(ADS_ROLE_AMOUNT_DATA_PARENT.GS_ID_SERVER.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.SERVER_AMOUNT).as(ADS_ROLE_AMOUNT_DATA_PARENT.SERVER_AMOUNT.getName()))
+                .select(max(ADS_ROLE_AMOUNT_DATA_PARENT.SERVER_COUNT).as(ADS_ROLE_AMOUNT_DATA_PARENT.SERVER_COUNT.getName()))
                 .select(sum(ADS_ROLE_AMOUNT_DATA_TODAY_PARENT.TODAY_COUNT).as(ADS_ROLE_AMOUNT_DATA_TODAY_PARENT.TODAY_COUNT.getName()))
                 .select(sum(ADS_ROLE_AMOUNT_DATA_TODAY_PARENT.TODAY_AMOUNT).as(ADS_ROLE_AMOUNT_DATA_TODAY_PARENT.TODAY_AMOUNT.getName()))
                 .select(sum(ADS_ROLE_AMOUNT_DATA_TODAY_PARENT.TODAY_AMOUNT).divide(sum(ADS_ROLE_AMOUNT_DATA_TODAY_PARENT.SERVER_AMOUNT)).as(ADS_ROLE_AMOUNT_DATA_TODAY_PARENT.SERVER_PROPORTION.getName()))
                 .select(sum(ADS_ROLE_AMOUNT_DATA_TODAY_PARENT.TODAY_AMOUNT).divide(sum(ADS_ROLE_AMOUNT_DATA_TODAY_PARENT.GAME_AMOUNT)).as(ADS_ROLE_AMOUNT_DATA_TODAY_PARENT.GAME_PROPORTION.getName()))
+                .select("IF(TIMESTAMPDIFF(HOUR, max(ads_role_amount_data_parent.active_time), NOW()) > 72,IF(TIMESTAMPDIFF(HOUR, max(ads_role_amount_data_parent.last_order_time), NOW()) < 72 , 0, 1) , 0) as system_remove_game_status")
                 .from(ADS_ROLE_AMOUNT_DATA_PARENT)
                 .leftJoin(ADS_ROLE_AMOUNT_DATA_TODAY_PARENT)
                 .on(ADS_ROLE_AMOUNT_DATA_PARENT.GAME_ID.eq(ADS_ROLE_AMOUNT_DATA_TODAY_PARENT.GAME_ID)
@@ -135,29 +154,22 @@ public class AdsRoleAmountDataParentServiceImpl extends ServiceImpl<AdsRoleAmoun
                 .ge(AdsRoleAmountDataTodayParent::getDay, dto.getDtBegin())
                 .le(AdsRoleAmountDataTodayParent::getDay, dto.getDtBegin())
                 .in(AdsRoleAmountDataParent::getGsId, dto.getGsIdList(), CollectionUtils.isNotEmpty(dto.getGsIdList()))
+                .eq(AdsRoleAmountDataParent::getParentGameId, dto.getParentGameId(), null != dto.getParentGameId())
+                .like(AdsRoleAmountDataParent::getRoleName, dto.getRoleName(), StringUtils.isNotBlank(dto.getRoleName()))
+                .eq(AdsRoleAmountDataParent::getSuperGameId, dto.getSuperGameId(), null != dto.getSuperGameId())
+                .in(AdsRoleAmountDataParent::getEndServerId, dto.getServerIdList(), CollectionUtils.isNotEmpty(dto.getServerIdList()))
+                .ge(AdsRoleAmountDataParent::getGsStartTime, dto.getServeDayBegin(), null != dto.getServeDayBegin())
+                .le(AdsRoleAmountDataParent::getGsEndTime, dto.getServeDayEnd(), null != dto.getServeDayEnd())
+                .ge(AdsRoleAmountDataParent::getGsEndTime, LocalDate.now(), null != dto.getServeStatus() && 1 == dto.getServeStatus())
+                .le(AdsRoleAmountDataParent::getGsEndTime, LocalDate.now(), null != dto.getServeStatus() && 2 == dto.getServeStatus())
+                .ne(AdsRoleAmountDataParent::getGsId, 0, null != dto.getRoleSource() && 2 == dto.getRoleSource())
+                .isNotNull(AdsRoleAmountDataParent::getGsIdServer, null != dto.getRoleSource() && 1 == dto.getRoleSource())
+                .eq(AdsRoleAmountDataParent::getIsRemoveGame, dto.getHumanRemoveGameStatus(), null != dto.getHumanRemoveGameStatus())
+                .and(wrapper -> wrapper.and("'system_remove_game_status' = ?", dto.getSystemRemoveGameStatus()), null != dto.getSystemRemoveGameStatus())
                 .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.GAME_ID)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_ID)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_NAME)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.SERVER_ID)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.PARENT_GAME_ID)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.ASSOCIATION_USER_ID)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_LEVEL)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_VIP)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.COMBAT_NUM)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.COUNTRY)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_TIME)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.FIRST_AMOUNT)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_HOUR_AMOUNT)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.LAST_AMOUNT)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.LAST_ORDER_TIME)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.PRODUCT_NAME)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.TOTAL_AMOUNT)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.TOTAL_CNT)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.ACTIVE_TIME)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.APP_AMOUNT)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.PROPORTION)
                 .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.GS_ID)
-                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.CONCAT_GAME)
+                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.GS_START_TIME)
+                .groupBy(ADS_ROLE_AMOUNT_DATA_PARENT.ROLE_ID)
                 .orderBy(dto.getSortFiled(), dto.getSortAsc());
     }
 }

+ 1 - 1
game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/service/impl/GameServerServiceImpl.java

@@ -26,6 +26,6 @@ public class GameServerServiceImpl extends ServiceImpl<GameServerMapper, GameSer
                 .eq(GameServer::getSourceSystem, sourceSystem)
                 .in(GameServer::getServerId, serverIdList))
                 .stream()
-                .collect(Collectors.groupingBy(GameServer::getGameId, Collectors.toMap(GameServer::getServerId, GameServer::getServerName)));
+                .collect(Collectors.groupingBy(GameServer::getSupperGameId, Collectors.toMap(GameServer::getServerId, GameServer::getServerName)));
     }
 }

+ 34 - 0
game-gs-data/game-gs-data-serve/src/main/java/com/zanxiang/game/gs/data/serve/service/impl/GameServerSonMergeServiceImpl.java

@@ -0,0 +1,34 @@
+package com.zanxiang.game.gs.data.serve.service.impl;
+
+
+import com.mybatisflex.core.query.QueryWrapper;
+import com.zanxiang.game.gs.data.serve.pojo.entity.game.order.GameServer;
+import org.springframework.stereotype.Service;
+import com.zanxiang.game.gs.data.serve.service.IGameServerSonMergeService;
+import com.zanxiang.game.gs.data.serve.pojo.entity.game.order.GameServerSonMerge;
+import com.zanxiang.game.gs.data.serve.dao.mapper.game.order.GameServerSonMergeMapper;
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 游戏区服合服子服记录表 服务层实现。
+ *
+ * @author shaosong
+ * @since 1.0
+ */
+@Service
+public class GameServerSonMergeServiceImpl extends ServiceImpl<GameServerSonMergeMapper, GameServerSonMerge> implements IGameServerSonMergeService {
+
+    @Override
+    public Map<Long, Map<String, String>> gameServerMap(String sourceSystem, Collection<String> serverIdList) {
+        return list(new QueryWrapper()
+                .eq(GameServerSonMerge::getSourceSystem, sourceSystem)
+                .in(GameServerSonMerge::getServerId, serverIdList)
+                .and("main_server_id = son_server_ids"))
+                .stream()
+                .collect(Collectors.groupingBy(GameServerSonMerge::getGameId, Collectors.toMap(GameServerSonMerge::getServerId, GameServerSonMerge::getServerName)));
+    }
+}

+ 10 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/Game.java

@@ -48,6 +48,11 @@ public class Game implements Serializable {
      */
     private Boolean isPut;
 
+    /**
+     * 投放类型, 0 : 导量APP, 1 : 头条直投APP,  2 : 腾讯直投APP, 3 : 头条私域投APP, 4 : 腾讯私域投APP
+     */
+    private Integer putType;
+
     /**
      * 游戏标签
      */
@@ -153,4 +158,9 @@ public class Game implements Serializable {
      */
     private BigDecimal rechargeRebate;
 
+    /**
+     * 是否使用监测链接
+     */
+    private Boolean isMonitorLink;
+
 }

+ 1 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/SDKApplication.java

@@ -23,7 +23,7 @@ public class SDKApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(SDKApplication.class, args);
-        System.out.println("赞象SDK服务启动成功 <斗罗归因判断问题解决01> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象SDK服务启动成功 <游戏表新增字段> ( ´・・)ノ(._.`) \n" +
                 " ___________ _   __\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "\\ `--.| | | | |/ / \n" +

+ 2 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/adapter/WebHandlerAdapter.java

@@ -70,7 +70,8 @@ public class WebHandlerAdapter implements HandlerInterceptor {
         //签名验证
         GameExt gameExt = gameExtService.getByGameAppId(gameId);
         if (gameExt == null || Strings.isBlank(gameExt.getAppKey())) {
-            log.error("非法参数, 游戏id对应的前端密钥appKey不存在");
+            log.error("非法参数, 游戏id对应的前端密钥appKey不存在, gameId : {}, sign : {}, timestamp : {}, os : {}, deviceType : {}",
+                    gameId, sign, timestamp, os, deviceType);
             throw new BaseException(HttpStatusEnum.INVALID_PARAMS.getMsg());
         }
         String str = "appKey=" + gameExt.getAppKey() + "&gameId=" + gameId + "&timestamp=" + timestamp;

+ 10 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/controller/AppletController.java

@@ -1,5 +1,6 @@
 package com.zanxiang.game.module.sdk.controller;
 
+import com.zanxiang.game.module.sdk.annotation.PushDataCheck;
 import com.zanxiang.game.module.sdk.annotation.UnSignCheck;
 import com.zanxiang.game.module.sdk.pojo.param.MiniAppPayParam;
 import com.zanxiang.game.module.sdk.pojo.param.UserData;
@@ -43,6 +44,15 @@ public class AppletController {
     @Autowired
     private IPayApplicationService payApplicationService;
 
+    @UnSignCheck
+    @PushDataCheck
+    @ApiOperation(value = "获取微信小游戏token")
+    @GetMapping("/get/applet/accessToken")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = String.class)})
+    public ResultVO<Map<String, String>> getAppletToken(@RequestParam String gameId) {
+        return ResultVO.ok(gameAppletService.getAppletToken(gameId));
+    }
+
     @UnSignCheck
     @ApiOperation(value = "小程序客服消息认证")
     @GetMapping("/applet/custom/msg/{appId}")

+ 6 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/vo/UserLoginVO.java

@@ -94,4 +94,10 @@ public class UserLoginVO {
      */
     @ApiModelProperty(notes = "是否注册用户")
     private Boolean regUser;
+
+    /**
+     * 微信小游戏的accessToken
+     */
+    @ApiModelProperty(notes = "微信小游戏的accessToken")
+    private String accessToken;
 }

+ 10 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/IGameAppletService.java

@@ -6,6 +6,8 @@ import com.zanxiang.game.module.sdk.pojo.dto.GameAppletDTO;
 import com.zanxiang.game.module.sdk.pojo.param.UserData;
 import com.zanxiang.game.module.sdk.pojo.vo.GameInitVO;
 
+import java.util.Map;
+
 /**
  * @author : lingfeng
  * @time : 2022-07-08
@@ -13,6 +15,14 @@ import com.zanxiang.game.module.sdk.pojo.vo.GameInitVO;
  */
 public interface IGameAppletService extends IService<GameApplet> {
 
+    /**
+     * 根据游戏外部唯一标志获取微信小游戏token
+     *
+     * @param gameAppId : CP游戏包唯一标识
+     * @return : 微信小游戏 appId, token
+     */
+    Map<String, String> getAppletToken(String gameAppId);
+
     /**
      * applet味精检查
      *

+ 2 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/CallBackServiceImpl.java

@@ -26,6 +26,7 @@ import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
@@ -477,7 +478,7 @@ public class CallBackServiceImpl implements ICallBackService {
                 .orderId(platformOrderDTO.getOrderId())
                 .agentKey(agent.getAgentKey())
                 .backPolicyId(agent.getBackPolicyId())
-                .rechargeMoney(platformOrderDTO.getAmount().longValue() * 100)
+                .rechargeMoney(platformOrderDTO.getAmount().multiply(new BigDecimal(100)).longValue())
                 .orderStatus(platformOrderDTO.getStatus())
                 .regTime(user.getCreateTime())
                 .createTime(platformOrderDTO.getCreateTime())

+ 24 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GameAppletServiceImpl.java

@@ -17,6 +17,7 @@ import com.zanxiang.game.module.sdk.pojo.vo.GameInitVO;
 import com.zanxiang.game.module.sdk.service.IGameAppletService;
 import com.zanxiang.game.module.sdk.service.IGameExtService;
 import com.zanxiang.game.module.sdk.service.IGameService;
+import com.zanxiang.game.module.sdk.service.api.WxApiService;
 import com.zanxiang.game.module.sdk.service.pay.MiPayService;
 import com.zanxiang.game.module.sdk.util.SignUtil;
 import com.zanxiang.module.util.JsonUtil;
@@ -58,6 +59,29 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
     @Autowired
     private MiPayService miPayService;
 
+    @Autowired
+    private WxApiService wxApiService;
+
+    @Autowired
+    private IGameAppletService gameAppletService;
+
+    @Override
+    public Map<String, String> getAppletToken(String gameAppId) {
+        GameExt gameExt = gameExtService.getByGameAppId(gameAppId);
+        if (gameExt == null) {
+            throw new BaseException("参数错误, 游戏配置信息不存在");
+        }
+        GameAppletDTO gameAppletDTO = gameAppletService.getByGameId(gameExt.getGameId());
+        if (gameAppletDTO == null) {
+            throw new BaseException("参数错误, 微信小游戏配置信息不存在");
+        }
+        String accessToken = wxApiService.getAccessToken(gameAppletDTO.getAppId(), gameAppletDTO.getAppSecret());
+        Map<String, String> resultMap = new HashMap<>(2);
+        resultMap.put("appId", gameAppletDTO.getAppId());
+        resultMap.put("accessToken", accessToken);
+        return resultMap;
+    }
+
     @Override
     public String appletMsgCheck(String appId, String signature, String timestamp, String nonce, String echoStr) throws Exception {
         log.error("appId : {}, signature : {}, timestamp : {}, nonce : {}, echoStr : {}", appId, signature, timestamp, nonce, echoStr);

+ 2 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/LoginServiceImpl.java

@@ -145,6 +145,7 @@ public class LoginServiceImpl implements IRegisterLoginService {
             //返回登录信息
             UserLoginVO userLoginVO = this.createUserLoginVO(user, userData);
             userLoginVO.setAppletShellSwitch(gameAppletShellService.getUserShellSwitch(user, Boolean.FALSE, request));
+            userLoginVO.setAccessToken(wxApiService.getAccessToken(gameAppletDTO.getAppId(), gameAppletDTO.getAppSecret()));
             log.error("返回用户登录信息, userLoginVO : {}", JsonUtil.toString(userLoginVO));
             return ResultVO.ok(userLoginVO);
         }
@@ -153,6 +154,7 @@ public class LoginServiceImpl implements IRegisterLoginService {
         //返回登录信息
         UserLoginVO userLoginVO = this.createUserLoginVO(user, userData);
         userLoginVO.setAppletShellSwitch(gameAppletShellService.getUserShellSwitch(user, Boolean.TRUE, request));
+        userLoginVO.setAccessToken(wxApiService.getAccessToken(gameAppletDTO.getAppId(), gameAppletDTO.getAppSecret()));
         log.error("返回用户登录信息, userLoginVO : {}", JsonUtil.toString(userLoginVO));
         return ResultVO.ok(userLoginVO);
     }

+ 1 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/PerformOrderServiceImpl.java

@@ -113,6 +113,7 @@ public class PerformOrderServiceImpl implements IPerformOrderService {
         map.put("orderId", orderInfo.getCpOrderId());
         map.put("ext", URIUtil.encodeURIComponent(orderInfo.getExt()));
         map.put("sign", this.paySign(orderInfo.getGameId(), map));
+        map.put("orderId2", orderInfo.getOrderId());
         //url
         String url = URIUtil.fillUrlParams(cpPaybackUrl, map, false);
         String resultStr;