Forráskód Böngészése

Merge remote-tracking branch 'origin/package' into package

wcc 1 éve
szülő
commit
0e50830171
74 módosított fájl, 1622 hozzáadás és 406 törlés
  1. 5 0
      game-back/game-back-base/src/main/java/com/zanxiang/game/back/base/tencent/pojo/dto/TencentOrderDTO.java
  2. 5 0
      game-back/game-back-base/src/main/java/com/zanxiang/game/back/base/tencent/pojo/dto/TencentUserDTO.java
  3. 6 0
      game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/dto/GameTencentOrderDTO.java
  4. 3 0
      game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/dto/GameTencentUserDTO.java
  5. 9 1
      game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/entity/GameTencentBackLog.java
  6. 8 0
      game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/entity/GameTencentOrder.java
  7. 8 0
      game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/entity/GameTencentUser.java
  8. 1 1
      game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/vo/GameTencentOrderVO.java
  9. 1 1
      game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/vo/GameTencentUserVO.java
  10. 52 27
      game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/service/impl/GameBackPolicyServiceImpl.java
  11. 20 6
      game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/service/impl/GameTencentOrderServiceImpl.java
  12. 21 10
      game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/service/impl/GameTencentUserServiceImpl.java
  13. 3 3
      game-data/game-data-serve/pom.xml
  14. 1 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/AccountAgentDayController.java
  15. 2 2
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/RankingController.java
  16. 1 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataDayDTO.java
  17. 1 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataTotalDTO.java
  18. 1 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GamePromoteDayDTO.java
  19. 1 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GamePromoteTotalDTO.java
  20. 1 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/RechargeRankingDTO.java
  21. 38 0
      game-module/game-module-base/src/main/java/com/zanxiang/game/module/base/pojo/dto/H5GameConfigDTO.java
  22. 44 0
      game-module/game-module-base/src/main/java/com/zanxiang/game/module/base/pojo/enums/H5SignShowEnum.java
  23. 8 8
      game-module/game-module-base/src/main/java/com/zanxiang/game/module/base/pojo/enums/HttpStatusEnum.java
  24. 16 2
      game-module/game-module-base/src/main/java/com/zanxiang/game/module/base/pojo/enums/PayDeviceEnum.java
  25. 44 0
      game-module/game-module-base/src/main/java/com/zanxiang/game/module/base/pojo/enums/ShellControlEnum.java
  26. 1 1
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java
  27. 51 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/GameAppletShellController.java
  28. 7 12
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameAddParam.java
  29. 68 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameAppletShellAddUpdateParam.java
  30. 21 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameAppletShellListParam.java
  31. 11 3
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/PayMerchantAddUpdateParam.java
  32. 105 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameAppletShellListVO.java
  33. 61 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameAppletShellVO.java
  34. 7 12
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameListVO.java
  35. 138 42
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/OrderVO.java
  36. 7 1
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/PayMerchantListVO.java
  37. 6 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/UserVO.java
  38. 32 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameAppletShellService.java
  39. 0 7
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IPayDeviceService.java
  40. 2 2
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameAppletServiceImpl.java
  41. 141 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameAppletShellServiceImpl.java
  42. 12 4
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameServiceImpl.java
  43. 1 1
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserRoleServiceImpl.java
  44. 5 2
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserServiceImpl.java
  45. 32 57
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/OrderServiceImpl.java
  46. 0 11
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/PayDeviceServiceImpl.java
  47. 89 84
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/PayMerchantServiceImpl.java
  48. 2 1
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserCardServiceImpl.java
  49. 5 3
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserServiceImpl.java
  50. 5 10
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/Game.java
  51. 97 0
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameAppletShell.java
  52. 0 5
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameExt.java
  53. 14 4
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/PayMerchant.java
  54. 12 0
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/mapper/GameAppletShellMapper.java
  55. 1 1
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/SDKApplication.java
  56. 12 7
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/controller/InitController.java
  57. 40 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/enums/ShellSwitchEnum.java
  58. 57 4
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/result/CardCheckResult.java
  59. 4 9
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/vo/GameInitVO.java
  60. 6 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/vo/UserLoginVO.java
  61. 0 8
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/IGameAppletService.java
  62. 31 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/IGameAppletShellService.java
  63. 35 9
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/AgentServiceImpl.java
  64. 9 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/CallBackServiceImpl.java
  65. 4 11
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GameAppletServiceImpl.java
  66. 117 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GameAppletShellServiceImpl.java
  67. 11 2
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/LoginServiceImpl.java
  68. 1 1
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/OrderPayServiceImpl.java
  69. 46 6
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/UserCardServiceImpl.java
  70. 3 1
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/UserServiceImpl.java
  71. 9 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/UserTokenServiceImpl.java
  72. 0 2
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/pay/AliPayService.java
  73. 1 13
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/pay/WxPayService.java
  74. 3 3
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/util/RegisterUtil.java

+ 5 - 0
game-back/game-back-base/src/main/java/com/zanxiang/game/back/base/tencent/pojo/dto/TencentOrderDTO.java

@@ -77,4 +77,9 @@ public class TencentOrderDTO implements Serializable {
      * 支付时间
      */
     private LocalDateTime payTime;
+
+    /**
+     * 数据源ID
+     */
+    private Long userActionSetId;
 }

+ 5 - 0
game-back/game-back-base/src/main/java/com/zanxiang/game/back/base/tencent/pojo/dto/TencentUserDTO.java

@@ -51,4 +51,9 @@ public class TencentUserDTO implements Serializable {
      * appid
      */
     private String wechatAppId;
+
+    /**
+     * 数据源ID
+     */
+    private Long userActionSetId;
 }

+ 6 - 0
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/dto/GameTencentOrderDTO.java

@@ -68,4 +68,10 @@ public class GameTencentOrderDTO extends BaseListDTO<GameTencentOrder> {
      */
     @ApiModelProperty("支付状态,0 : 预下单, 1 : 待支付,2 : 支付成功,-1 : 已取消")
     private Integer orderStatus;
+
+    /**
+     * 数据源ID
+     */
+    @ApiModelProperty("数据源ID")
+    private Long userActionSetId;
 }

+ 3 - 0
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/dto/GameTencentUserDTO.java

@@ -36,4 +36,7 @@ public class GameTencentUserDTO extends BaseListDTO<GameTencentUser> {
 
     @ApiModelProperty("回传状态")
     private Integer isBack;
+
+    @ApiModelProperty("数据源ID")
+    private Long userActionSetId;
 }

+ 9 - 1
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/entity/GameTencentBackLog.java

@@ -1,5 +1,7 @@
 package com.zanxiang.game.back.serve.pojo.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 import java.time.LocalDateTime;
@@ -24,6 +26,7 @@ public class GameTencentBackLog implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
 
     /**
@@ -39,7 +42,7 @@ public class GameTencentBackLog implements Serializable {
     /**
      * 数据源ID
      */
-    private String userActionSetId;
+    private Long userActionSetId;
 
     /**
      * 行为发生时,客户端的时间点
@@ -61,6 +64,11 @@ public class GameTencentBackLog implements Serializable {
      */
     private String actionType;
 
+    /**
+     * 行为参数
+     */
+    private String actionParam;
+
     /**
      * 订单ID
      */

+ 8 - 0
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/entity/GameTencentOrder.java

@@ -1,5 +1,7 @@
 package com.zanxiang.game.back.serve.pojo.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 import java.time.LocalDateTime;
@@ -24,6 +26,7 @@ public class GameTencentOrder implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
     /**
      * 回传策略ID
@@ -89,6 +92,11 @@ public class GameTencentOrder implements Serializable {
      */
     private Integer orderStatus;
 
+    /**
+     * 数据源ID
+     */
+    private Long userActionSetId;
+
     /**
      * 支付时间
      */

+ 8 - 0
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/entity/GameTencentUser.java

@@ -1,5 +1,7 @@
 package com.zanxiang.game.back.serve.pojo.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 import java.time.LocalDateTime;
@@ -24,6 +26,7 @@ public class GameTencentUser implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
     /**
      * 回传策略ID
@@ -65,6 +68,11 @@ public class GameTencentUser implements Serializable {
      */
     private String wechatAppId;
 
+    /**
+     * 数据源ID
+     */
+    private Long userActionSetId;
+
     /**
      * 0:未回传;1:回传
      */

+ 1 - 1
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/vo/GameTencentOrderVO.java

@@ -88,7 +88,7 @@ public class GameTencentOrderVO {
     /**
      * 0:未回传;1:回传
      */
-    @ApiModelProperty("回传状态 -1:回传失败;0:未回传;1:回传")
+    @ApiModelProperty("回传状态 -1:回传失败;0:未回传;1:回传")
     private Integer isBack;
 
     /**

+ 1 - 1
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/pojo/vo/GameTencentUserVO.java

@@ -70,7 +70,7 @@ public class GameTencentUserVO {
     /**
      * 0:未回传;1:回传
      */
-    @ApiModelProperty("回传状态:-1:回传失败;0:未回传;1:回传")
+    @ApiModelProperty("回传状态:-1:回传失败;0:未回传;1:回传")
     private Integer isBack;
 
     @ApiModelProperty("创建时间")

+ 52 - 27
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/service/impl/GameBackPolicyServiceImpl.java

@@ -1,5 +1,6 @@
 package com.zanxiang.game.back.serve.service.impl;
 
+import cn.hutool.http.HttpStatus;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -28,6 +29,7 @@ import com.zanxiang.module.util.JsonUtil;
 import com.zanxiang.module.util.NumberUtil;
 import com.zanxiang.module.util.bean.BeanUtil;
 import com.zanxiang.module.util.exception.BaseException;
+import com.zanxiang.module.util.pojo.ResultVO;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.dubbo.config.annotation.DubboReference;
@@ -37,7 +39,9 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -75,6 +79,8 @@ public class GameBackPolicyServiceImpl extends ServiceImpl<GameBackPolicyMapper,
         log.error("回传腾讯订单开始,dto:{}", JsonUtil.toString(dto));
         //订单保存
         GameTencentOrder gameTencentOrder = GameTencentOrder.builder()
+                .adAccountId(dto.getAdAccountId())
+                .gameId(dto.getGameId())
                 .orderId(dto.getOrderId())
                 .channel(dto.getChannel())
                 .rechargeMoney(dto.getRechargeMoney())
@@ -85,8 +91,10 @@ public class GameBackPolicyServiceImpl extends ServiceImpl<GameBackPolicyMapper,
                 .wechatOpenid(dto.getWechatOpenid())
                 .orderStatus(dto.getOrderStatus())
                 .payTime(dto.getPayTime())
+                .createTime(LocalDateTime.now())
                 .isBack(BackStatusEnum.NO.getBackStatus())
                 .backPolicyId(dto.getBackPolicyId())
+                .userActionSetId(dto.getUserActionSetId())
                 .build();
         gameTencentOrderService.save(gameTencentOrder);
         if (!dto.getOrderStatus().equals(COMPLETE_ORDER) && !dto.getOrderStatus().equals(PURCHASE)) {
@@ -95,8 +103,12 @@ public class GameBackPolicyServiceImpl extends ServiceImpl<GameBackPolicyMapper,
 
         String actionType = gameTencentOrder.getOrderStatus().equals(PURCHASE) ?
                 ActionTypeEnum.PURCHASE.getActionType() : ActionTypeEnum.COMPLETE_ORDER.getActionType();
+        Map<String, Object> actionParam = new HashMap<>(2);
+        actionParam.put("claim_type", 0);
+        actionParam.put("value", dto.getRechargeMoney());
         DataReportOfAppIdRpcDTO dataReportOfAppIdRpcDTO = DataReportOfAppIdRpcDTO.builder()
                 .appId(dto.getWechatAppId())
+                .userActionSetId(dto.getUserActionSetId())
                 .action(UserActionRpcDTO.builder()
                         .actionTime(dto.getOrderStatus().equals(PURCHASE) ? dto.getPayTime() : dto.getRechargeTime())
                         .actionType(actionType)
@@ -104,6 +116,7 @@ public class GameBackPolicyServiceImpl extends ServiceImpl<GameBackPolicyMapper,
                                 .wechatAppId(dto.getWechatAppId())
                                 .wechatOpenid(dto.getWechatOpenid())
                                 .build())
+                        .actionParam(actionParam)
                         .build())
                 .build();
 
@@ -116,6 +129,8 @@ public class GameBackPolicyServiceImpl extends ServiceImpl<GameBackPolicyMapper,
                 .orderId(dto.getOrderId())
                 .wechatAppId(dto.getWechatAppId())
                 .wechatOpenid(dto.getWechatOpenid())
+                .userActionSetId(dto.getUserActionSetId())
+                .actionParam(actionParam.toString())
                 .build();
 
         boolean doBack;
@@ -141,24 +156,25 @@ public class GameBackPolicyServiceImpl extends ServiceImpl<GameBackPolicyMapper,
                             .orderByDesc(GameTencentOrder::getCreateTime)
                     )).intValue());
         }
+        if (dto.getOrderStatus().equals(COMPLETE_ORDER) || doBack) {
+            ResultVO<Boolean> result = userActionSetRpc.reportByAppId(dataReportOfAppIdRpcDTO);
+            if (result.getCode() == HttpStatus.HTTP_OK) {
+                gameTencentOrder.setIsBack(BackStatusEnum.SUCCESS.getBackStatus());
+                gameTencentOrder.setBackLog("回传成功");
+                gameTencentOrderService.updateById(gameTencentOrder);
 
-        try {
-            if (dto.getOrderStatus().equals(COMPLETE_ORDER) || doBack) {
-                userActionSetRpc.reportByAppId(dataReportOfAppIdRpcDTO);
+                gameTencentBackLog.setBackLog("回传成功");
+                gameTencentBackLogService.save(gameTencentBackLog);
+            } else {
+                log.error("回传腾讯订单失败,失败原因:{}", result.getMsg());
+                gameTencentOrder.setBackLog(result.getMsg());
                 gameTencentOrder.setIsBack(BackStatusEnum.FAILED.getBackStatus());
                 gameTencentOrderService.updateById(gameTencentOrder);
 
-                gameTencentBackLogService.save(gameTencentBackLog);
+                gameTencentBackLog.setBackLog(result.getMsg());
+                gameTencentBackLogService.saveOrUpdate(gameTencentBackLog);
+                return false;
             }
-        } catch (Exception e) {
-            log.error("回传腾讯订单失败,失败原因:{}", e.getMessage());
-            gameTencentOrder.setBackLog(e.getMessage());
-            gameTencentOrder.setIsBack(BackStatusEnum.FAILED.getBackStatus());
-            gameTencentOrderService.updateById(gameTencentOrder);
-
-            gameTencentBackLog.setBackLog(e.getMessage());
-            gameTencentBackLogService.saveOrUpdate(gameTencentBackLog);
-            return false;
         }
         return true;
     }
@@ -185,12 +201,17 @@ public class GameBackPolicyServiceImpl extends ServiceImpl<GameBackPolicyMapper,
                     .wechatAppId(dto.getWechatAppId())
                     .wechatOpenid(dto.getWechatOpenid())
                     .isBack(BackStatusEnum.NO.getBackStatus())
+                    .userActionSetId(dto.getUserActionSetId())
+                    .createTime(LocalDateTime.now())
                     .build();
             gameTencentUserService.save(gameTencentUser);
         }
+        Map<String, Object> actionParam = new HashMap<>(2);
+        actionParam.put("claim_type", 0);
 
         DataReportOfAppIdRpcDTO dataReportOfAppIdRpcDTO = DataReportOfAppIdRpcDTO.builder()
                 .appId(dto.getWechatAppId())
+                .userActionSetId(dto.getUserActionSetId())
                 .action(UserActionRpcDTO.builder()
                         .actionTime(dto.getRegisterTime())
                         .actionType(ActionTypeEnum.REGISTER.getActionType())
@@ -198,6 +219,7 @@ public class GameBackPolicyServiceImpl extends ServiceImpl<GameBackPolicyMapper,
                                 .wechatAppId(dto.getWechatAppId())
                                 .wechatOpenid(dto.getWechatOpenid())
                                 .build())
+                        .actionParam(actionParam)
                         .build())
                 .build();
 
@@ -209,23 +231,26 @@ public class GameBackPolicyServiceImpl extends ServiceImpl<GameBackPolicyMapper,
                 .actionType(ActionTypeEnum.REGISTER.getActionType())
                 .wechatAppId(dto.getWechatAppId())
                 .wechatOpenid(dto.getWechatOpenid())
+                .userActionSetId(dto.getUserActionSetId())
+                .actionParam(actionParam.toString())
                 .build();
-        try {
-            userActionSetRpc.reportByAppId(dataReportOfAppIdRpcDTO);
-            gameTencentUser.setIsBack(BackStatusEnum.SUCCESS.getBackStatus());
-            gameTencentUserService.updateById(gameTencentUser);
+            ResultVO<Boolean> result = userActionSetRpc.reportByAppId(dataReportOfAppIdRpcDTO);
+            if (result.getCode() == HttpStatus.HTTP_OK) {
+                gameTencentUser.setIsBack(BackStatusEnum.SUCCESS.getBackStatus());
+                gameTencentUser.setBackLog("回传成功");
+                gameTencentUserService.updateById(gameTencentUser);
 
-            gameTencentBackLogService.save(gameTencentBackLog);
-        } catch (Exception e) {
-            log.error("回传腾讯用户失败,失败原因:{}", e.getMessage());
-            gameTencentUser.setBackLog(e.getMessage());
-            gameTencentUser.setIsBack(BackStatusEnum.FAILED.getBackStatus());
-            gameTencentUserService.updateById(gameTencentUser);
+                gameTencentBackLog.setBackLog("回传成功");
+                gameTencentBackLogService.save(gameTencentBackLog);
+            } else {
+                log.error("回传腾讯用户失败,失败原因:{}", result.getMsg());
+                gameTencentUser.setBackLog(result.getMsg());
+                gameTencentUser.setIsBack(BackStatusEnum.FAILED.getBackStatus());
+                gameTencentUserService.updateById(gameTencentUser);
 
-            gameTencentBackLog.setBackLog(e.getMessage());
-            gameTencentBackLogService.saveOrUpdate(gameTencentBackLog);
-            return false;
-        }
+                gameTencentBackLog.setBackLog(result.getMsg());
+                gameTencentBackLogService.saveOrUpdate(gameTencentBackLog);
+            }
         return true;
 
     }

+ 20 - 6
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/service/impl/GameTencentOrderServiceImpl.java

@@ -1,5 +1,6 @@
 package com.zanxiang.game.back.serve.service.impl;
 
+import cn.hutool.http.HttpStatus;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.zanxiang.advertising.tencent.base.AdvertisingTencentServer;
@@ -22,6 +23,7 @@ import com.zanxiang.game.back.serve.service.IGameTencentBackLogService;
 import com.zanxiang.game.back.serve.service.IGameTencentOrderService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.module.util.bean.BeanUtil;
+import com.zanxiang.module.util.pojo.ResultVO;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.dubbo.config.annotation.DubboReference;
@@ -29,7 +31,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 import static com.zanxiang.game.back.serve.pojo.enums.ActionTypeEnum.PURCHASE;
@@ -84,8 +88,12 @@ public class GameTencentOrderServiceImpl extends ServiceImpl<GameTencentOrderMap
                 .forEach(gameTencentOrder -> {
                     String actionType = gameTencentOrder.getOrderStatus().equals(PURCHASE) ?
                             ActionTypeEnum.PURCHASE.getActionType() : ActionTypeEnum.COMPLETE_ORDER.getActionType();
+                    Map<String, Object> actionParam = new HashMap<>(2);
+                    actionParam.put("claim_type", 0);
+                    actionParam.put("value", gameTencentOrder.getRechargeMoney());
                     DataReportOfAppIdRpcDTO dataReportOfAppIdRpcDTO = DataReportOfAppIdRpcDTO.builder()
                             .appId(gameTencentOrder.getWechatAppId())
+                            .userActionSetId(gameTencentOrder.getUserActionSetId())
                             .action(UserActionRpcDTO.builder()
                                     .actionTime(gameTencentOrder.getOrderStatus().equals(PURCHASE) ? gameTencentOrder.getPayTime() : gameTencentOrder.getRechargeTime())
                                     .actionType(actionType)
@@ -93,6 +101,7 @@ public class GameTencentOrderServiceImpl extends ServiceImpl<GameTencentOrderMap
                                             .wechatAppId(gameTencentOrder.getWechatAppId())
                                             .wechatOpenid(gameTencentOrder.getWechatOpenid())
                                             .build())
+                                    .actionParam(actionParam)
                                     .build())
                             .build();
 
@@ -105,22 +114,27 @@ public class GameTencentOrderServiceImpl extends ServiceImpl<GameTencentOrderMap
                             .orderId(gameTencentOrder.getOrderId())
                             .wechatAppId(gameTencentOrder.getWechatAppId())
                             .wechatOpenid(gameTencentOrder.getWechatOpenid())
+                            .userActionSetId(gameTencentOrder.getUserActionSetId())
+                            .actionParam(actionParam.toString())
                             .build();
                     gameTencentOrder.setUpdateTime(LocalDateTime.now());
                     gameTencentOrder.setUpdateBy(SecurityUtil.getUserId());
-                    try {
-                        userActionSetRpc.reportByAppId(dataReportOfAppIdRpcDTO);
+
+                    ResultVO<Boolean> result = userActionSetRpc.reportByAppId(dataReportOfAppIdRpcDTO);
+                    if (result.getCode() == HttpStatus.HTTP_OK) {
                         gameTencentOrder.setIsBack(BackStatusEnum.SUCCESS.getBackStatus());
+                        gameTencentOrder.setBackLog("回传成功");
                         updateById(gameTencentOrder);
 
+                        gameTencentBackLog.setBackLog("回传成功");
                         gameTencentBackLogService.save(gameTencentBackLog);
-                    } catch (Exception e) {
-                        log.error("回传腾讯订单失败,失败原因:{}", e.getMessage());
-                        gameTencentOrder.setBackLog(e.getMessage());
+                    } else {
+                        log.error("回传腾讯订单失败,失败原因:{}", result.getMsg());
+                        gameTencentOrder.setBackLog(result.getMsg());
                         gameTencentOrder.setIsBack(BackStatusEnum.FAILED.getBackStatus());
                         updateById(gameTencentOrder);
 
-                        gameTencentBackLog.setBackLog(e.getMessage());
+                        gameTencentBackLog.setBackLog(result.getMsg());
                         gameTencentBackLogService.saveOrUpdate(gameTencentBackLog);
                     }
                 });

+ 21 - 10
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/service/impl/GameTencentUserServiceImpl.java

@@ -1,7 +1,9 @@
 package com.zanxiang.game.back.serve.service.impl;
 
+import cn.hutool.http.HttpStatus;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.advertising.tencent.base.AdvertisingTencentServer;
 import com.zanxiang.advertising.tencent.base.pojo.dto.DataReportOfAppIdRpcDTO;
 import com.zanxiang.advertising.tencent.base.pojo.dto.UserActionRpcDTO;
@@ -9,19 +11,17 @@ import com.zanxiang.advertising.tencent.base.rpc.IUserActionSetRpc;
 import com.zanxiang.erp.base.ErpServer;
 import com.zanxiang.erp.base.rpc.ISysUserRpc;
 import com.zanxiang.erp.security.util.SecurityUtil;
+import com.zanxiang.game.back.serve.dao.mapper.GameTencentUserMapper;
 import com.zanxiang.game.back.serve.pojo.dto.GameTencentUserDTO;
 import com.zanxiang.game.back.serve.pojo.entity.GameTencentBackLog;
 import com.zanxiang.game.back.serve.pojo.entity.GameTencentUser;
-import com.zanxiang.game.back.serve.pojo.entity.GameTencentUser;
-import com.zanxiang.game.back.serve.dao.mapper.GameTencentUserMapper;
 import com.zanxiang.game.back.serve.pojo.enums.ActionTypeEnum;
 import com.zanxiang.game.back.serve.pojo.enums.BackStatusEnum;
-import com.zanxiang.game.back.serve.pojo.vo.GameTencentOrderVO;
 import com.zanxiang.game.back.serve.pojo.vo.GameTencentUserVO;
 import com.zanxiang.game.back.serve.service.IGameTencentBackLogService;
 import com.zanxiang.game.back.serve.service.IGameTencentUserService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.module.util.bean.BeanUtil;
+import com.zanxiang.module.util.pojo.ResultVO;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.dubbo.config.annotation.DubboReference;
@@ -29,7 +29,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -71,8 +73,11 @@ public class GameTencentUserServiceImpl extends ServiceImpl<GameTencentUserMappe
                 .filter(item -> !item.getIsBack().equals(BackStatusEnum.SUCCESS.getBackStatus()))
                 .forEach(gameTencentUser -> {
                     String actionType = ActionTypeEnum.REGISTER.getActionType();
+                    Map<String, Object> actionParam = new HashMap<>(2);
+                    actionParam.put("claim_type", 0);
                     DataReportOfAppIdRpcDTO dataReportOfAppIdRpcDTO = DataReportOfAppIdRpcDTO.builder()
                             .appId(gameTencentUser.getWechatAppId())
+                            .userActionSetId(gameTencentUser.getUserActionSetId())
                             .action(UserActionRpcDTO.builder()
                                     .actionTime(gameTencentUser.getRegisterTime())
                                     .actionType(actionType)
@@ -80,6 +85,7 @@ public class GameTencentUserServiceImpl extends ServiceImpl<GameTencentUserMappe
                                             .wechatAppId(gameTencentUser.getWechatAppId())
                                             .wechatOpenid(gameTencentUser.getWechatOpenid())
                                             .build())
+                                    .actionParam(actionParam)
                                     .build())
                             .build();
 
@@ -91,24 +97,29 @@ public class GameTencentUserServiceImpl extends ServiceImpl<GameTencentUserMappe
                             .actionType(actionType)
                             .wechatAppId(gameTencentUser.getWechatAppId())
                             .wechatOpenid(gameTencentUser.getWechatOpenid())
+                            .userActionSetId(gameTencentUser.getUserActionSetId())
+                            .actionParam(actionParam.toString())
                             .build();
                     gameTencentUser.setUpdateTime(LocalDateTime.now());
                     gameTencentUser.setUpdateBy(SecurityUtil.getUserId());
-                    try {
-                        userActionSetRpc.reportByAppId(dataReportOfAppIdRpcDTO);
+                    ResultVO<Boolean> result = userActionSetRpc.reportByAppId(dataReportOfAppIdRpcDTO);
+                    if (result.getCode() == HttpStatus.HTTP_OK) {
                         gameTencentUser.setIsBack(BackStatusEnum.SUCCESS.getBackStatus());
+                        gameTencentUser.setBackLog("回传成功");
                         updateById(gameTencentUser);
 
+                        gameTencentBackLog.setBackLog("回传成功");
                         gameTencentBackLogService.save(gameTencentBackLog);
-                    } catch (Exception e) {
-                        log.error("回传腾讯用户失败,失败原因:{}", e.getMessage());
-                        gameTencentUser.setBackLog(e.getMessage());
+                    } else {
+                        log.error("回传腾讯用户失败,失败原因:{}", result.getMsg());
+                        gameTencentUser.setBackLog(result.getMsg());
                         gameTencentUser.setIsBack(BackStatusEnum.FAILED.getBackStatus());
                         updateById(gameTencentUser);
 
-                        gameTencentBackLog.setBackLog(e.getMessage());
+                        gameTencentBackLog.setBackLog(result.getMsg());
                         gameTencentBackLogService.saveOrUpdate(gameTencentBackLog);
                     }
+
                 });
         return true;
     }

+ 3 - 3
game-data/game-data-serve/pom.xml

@@ -135,10 +135,10 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
+                <version>3.10.1</version>
                 <configuration>
-                    <source>8</source>
-                    <target>8</target>
+                    <source>17</source>
+                    <target>17</target>
                     <encoding>${project.build.sourceEncoding}</encoding>
                 </configuration>
             </plugin>

+ 1 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/AccountAgentDayController.java

@@ -37,7 +37,7 @@ public class AccountAgentDayController {
     }
 
     @ApiOperation(value = "推广总数据")
-//    @PreAuthorize(permissionKey = "gameData:accountAgent:total")
+    @PreAuthorize(permissionKey = "gameData:accountAgent:total")
     @PostMapping("/total")
     public ResultVO<Page<GamePromoteTotalVO>> accountAgentTotal(@RequestBody GamePromoteTotalDTO dto) {
         return ResultVO.ok(accountAgentDayService.accountAgentTotal(dto));

+ 2 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/RankingController.java

@@ -24,14 +24,14 @@ public class RankingController {
     private IRankingService rankingService;
 
     @ApiOperation(value = "游戏充值排行榜")
-//    @PreAuthorize(permissionKey = "gameData:ranking:game")
+    @PreAuthorize(permissionKey = "gameData:ranking:game")
     @PostMapping("/game")
     public ResultVO<Page<GameRechargeRankingVO>> gameRanking(@RequestBody RechargeRankingDTO dto) {
         return ResultVO.ok(rankingService.gameRanking(dto));
     }
 
     @ApiOperation(value = "玩家充值排行榜")
-//    @PreAuthorize(permissionKey = "gameData:ranking:player")
+    @PreAuthorize(permissionKey = "gameData:ranking:player")
     @PostMapping("/player")
     public ResultVO<Page<PlayerRechargeRankingVO>> userRanking(@RequestBody RechargeRankingDTO dto) {
         return ResultVO.ok(rankingService.playerRanking(dto));

+ 1 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataDayDTO.java

@@ -20,7 +20,7 @@ import java.time.LocalDate;
 @NoArgsConstructor
 @AllArgsConstructor
 @Builder
-public class GameDataDayDTO extends BasePage<AdsGameDay> {
+public class GameDataDayDTO extends BasePage {
 
     /**
      * 推广游戏名称

+ 1 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataTotalDTO.java

@@ -20,7 +20,7 @@ import java.time.LocalDate;
 @NoArgsConstructor
 @AllArgsConstructor
 @Builder
-public class GameDataTotalDTO extends BasePage<AdsGameDay> {
+public class GameDataTotalDTO extends BasePage {
 
     /**
      * 推广游戏名称

+ 1 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GamePromoteDayDTO.java

@@ -15,7 +15,7 @@ import java.time.LocalDate;
 @NoArgsConstructor
 @AllArgsConstructor
 @Builder
-public class GamePromoteDayDTO extends BasePage<AdsAccountAgentDay> {
+public class GamePromoteDayDTO extends BasePage {
     @ApiModelProperty(notes = "投手id")
     private Long sysUserId;
     @ApiModelProperty(notes = "推广账号ID")

+ 1 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GamePromoteTotalDTO.java

@@ -14,7 +14,7 @@ import java.time.LocalDate;
 @NoArgsConstructor
 @AllArgsConstructor
 @Builder
-public class GamePromoteTotalDTO extends BasePage<AdsAccountAgentDay> {
+public class GamePromoteTotalDTO extends BasePage {
     @ApiModelProperty(notes = "投手id")
     private Long sysUserId;
     @ApiModelProperty(notes = "推广账号ID")

+ 1 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/RechargeRankingDTO.java

@@ -15,7 +15,7 @@ import java.time.LocalDate;
 @NoArgsConstructor
 @AllArgsConstructor
 @Builder
-public class RechargeRankingDTO extends BasePage<AdsGameRechargeRanking> {
+public class RechargeRankingDTO extends BasePage{
     @ApiModelProperty(notes = "充值开始日期")
     private LocalDate beginDay;
     @ApiModelProperty(notes = "充值结束日期")

+ 38 - 0
game-module/game-module-base/src/main/java/com/zanxiang/game/module/base/pojo/dto/H5GameConfigDTO.java

@@ -0,0 +1,38 @@
+package com.zanxiang.game.module.base.pojo.dto;
+
+import com.zanxiang.game.module.base.pojo.enums.H5SignShowEnum;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-07
+ * @description : H5游戏配置对象
+ */
+@Data
+public class H5GameConfigDTO {
+
+    /**
+     * H5游戏地址
+     */
+    @ApiModelProperty(notes = "H5游戏地址")
+    private String h5GameUrl;
+
+    /**
+     * H5游戏登录窗Logo图片
+     */
+    @ApiModelProperty(notes = "H5游戏登录窗Logo图片")
+    private String h5LoginLogo;
+
+    /**
+     * H5侧边栏Logo图片
+     */
+    @ApiModelProperty(notes = "H5侧边栏Logo图片")
+    private String h5SignLogo;
+
+    /**
+     * H5侧边栏暂时类型枚举
+     */
+    @ApiModelProperty(notes = "H5侧边栏暂时类型枚举")
+    private H5SignShowEnum h5SignShow;
+}

+ 44 - 0
game-module/game-module-base/src/main/java/com/zanxiang/game/module/base/pojo/enums/H5SignShowEnum.java

@@ -0,0 +1,44 @@
+package com.zanxiang.game.module.base.pojo.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-07
+ * @description : H5侧边栏暂时类型枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum H5SignShowEnum {
+
+    /**
+     * 全部显示
+     */
+    SIGN_SHOW_ALL("SIGN_SHOW_ALL", "全部显示"),
+
+    /**
+     * 全部不显示
+     */
+    SIGN_SHOW_NONE("SIGN_SHOW_ALL", "全部不显示"),
+
+    /**
+     * 微信浏览器不显示
+     */
+    SIGN_SHOW_WX_NONE("SIGN_SHOW_WX_NONE", "微信浏览器不显示"),
+
+    /**
+     * 所有H5不显示
+     */
+    SIGN_SHOW_H5_NONE("SIGN_SHOW_H5_NONE", "所有H5不显示");
+
+    /**
+     * 展示类型
+     */
+    private String value;
+
+    /**
+     * 描述
+     */
+    private String describe;
+}

+ 8 - 8
game-module/game-module-base/src/main/java/com/zanxiang/game/module/base/pojo/enums/HttpStatusEnum.java

@@ -65,27 +65,27 @@ public enum HttpStatusEnum {
     /**
      * 用户名太短
      */
-    USERNAME_TOO_SHORT(41105, "用户名太短"),
+    USERNAME_TOO_SHORT(41105, "用户名太短, 用户名需数字与字母组合,长度为:8-16"),
 
     /**
      * 用户名太长
      */
-    USERNAME_TOO_LONG(41106, "用户名太长"),
+    USERNAME_TOO_LONG(41106, "用户名太长, 用户名需数字与字母组合,长度为:8-16"),
 
     /**
      * 用户名必须为数字字母组合
      */
-    USERNAME_BAD_CHAR(41107, "用户名必须为数字字母组合"),
+    USERNAME_BAD_CHAR(41107, "用户名必须为数字字母组合,长度为:8-16"),
 
     /**
      * 账号停用
      */
-    ACCOUNT_HALT(41108, "账号停用"),
+    ACCOUNT_HALT(41108, "账号停用, 请联系客服"),
 
     /**
      * ip封禁
      */
-    IP_HALT(41109, "ip封禁"),
+    IP_HALT(41109, "ip封禁, 请联系客服"),
 
     /**
      * 账户未绑定手机
@@ -105,17 +105,17 @@ public enum HttpStatusEnum {
     /**
      * 密码必须为数字字母组合
      */
-    PASSWORD_BAD_CHAR(41202, "密码必须为数字字母组合"),
+    PASSWORD_BAD_CHAR(41202, "密码必须为数字字母组合,长度为:6-24"),
 
     /**
      * 密码太长
      */
-    PASSWORD_TOO_LONG(41203, "密码太长"),
+    PASSWORD_TOO_LONG(41203, "密码太长, 密码需数字与字母组合,长度为:6-24"),
 
     /**
      * 密码太短
      */
-    PASSWORD_TOO_SHORT(41204, "密码太短"),
+    PASSWORD_TOO_SHORT(41204, "密码太短, 密码需数字与字母组合,长度为:6-24"),
 
     /**
      * 密码错误

+ 16 - 2
game-module/game-module-base/src/main/java/com/zanxiang/game/module/base/pojo/enums/PayDeviceEnum.java

@@ -78,12 +78,26 @@ public enum PayDeviceEnum {
         if (payDeviceId == null) {
             return Strings.EMPTY;
         }
+        PayDeviceEnum payDeviceEnum = PayDeviceEnum.getPayDeviceEnum(payDeviceId);
+        return payDeviceEnum == null ? Strings.EMPTY : payDeviceEnum.getPayDeviceName();
+    }
+
+    /**
+     * 得到支付设备枚举
+     *
+     * @param payDeviceId 支付设备id
+     * @return {@link PayDeviceEnum}
+     */
+    public static PayDeviceEnum getPayDeviceEnum(Long payDeviceId) {
+        if (payDeviceId == null) {
+            return null;
+        }
         for (PayDeviceEnum payDeviceEnum : PayDeviceEnum.values()) {
             if (Objects.equals(payDeviceId, payDeviceEnum.getPayDeviceId())) {
-                return payDeviceEnum.getPayDeviceName();
+                return payDeviceEnum;
             }
         }
-        return Strings.EMPTY;
+        return null;
     }
 
     /**

+ 44 - 0
game-module/game-module-base/src/main/java/com/zanxiang/game/module/base/pojo/enums/ShellControlEnum.java

@@ -0,0 +1,44 @@
+package com.zanxiang.game.module.base.pojo.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-06
+ * @description : 壳包控制类型枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum ShellControlEnum {
+
+    /**
+     * 关闭
+     */
+    SHELL_CONTROL_CLOSE(0, "关闭"),
+
+    /**
+     * 开启
+     */
+    SHELL_CONTROL_OPEN(1, "开启"),
+
+    /**
+     * 新用户开启, 老用户关闭
+     */
+    SHELL_CONTROL_NEW_USER_OPEN(2, "新用户开启, 老用户关闭"),
+
+    /**
+     * 角色等级控制开启
+     */
+    SHELL_CONTROL_LOW_LEVEL_OPEN(3, "角色等级控制开启");
+
+    /**
+     * 壳包控制类型
+     */
+    private Integer shellControl;
+
+    /**
+     * 描述
+     */
+    private String name;
+}

+ 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) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功0043 ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功001 ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 51 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/GameAppletShellController.java

@@ -0,0 +1,51 @@
+package com.zanxiang.game.module.manage.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.zanxiang.erp.security.annotation.PreAuthorize;
+import com.zanxiang.game.module.manage.pojo.params.GameAppletShellAddUpdateParam;
+import com.zanxiang.game.module.manage.pojo.params.GameAppletShellListParam;
+import com.zanxiang.game.module.manage.pojo.vo.GameAppletShellListVO;
+import com.zanxiang.game.module.manage.service.IGameAppletShellService;
+import com.zanxiang.module.util.pojo.ResultVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-10
+ * @description : 壳包控制接口
+ */
+@Api(tags = {"壳包控制接口"})
+@RestController
+@RequestMapping("/applet/shell")
+@Slf4j
+public class GameAppletShellController {
+
+    @Autowired
+    private IGameAppletShellService gameAppletShellService;
+
+    @ApiOperation(value = "壳包配置更新或者添加")
+    @PostMapping(value = "/add/or/update")
+    @PreAuthorize(permissionKey = "manage:appletShell:addOrUpdate")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)})
+    public ResultVO<Boolean> addOrUpdate(@Validated @RequestBody GameAppletShellAddUpdateParam param) {
+        return ResultVO.ok(gameAppletShellService.addOrUpdate(param));
+    }
+
+    @ApiOperation(value = "壳包配置列表查询")
+    @PostMapping(value = "/list")
+    @PreAuthorize(permissionKey = "manage:appletShell:list")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameAppletShellListVO.class)})
+    public ResultVO<IPage<GameAppletShellListVO>> list(@Validated @RequestBody GameAppletShellListParam param) {
+        return ResultVO.ok(gameAppletShellService.listOfPage(param));
+    }
+}

+ 7 - 12
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameAddParam.java

@@ -1,5 +1,6 @@
 package com.zanxiang.game.module.manage.pojo.params;
 
+import com.zanxiang.game.module.base.pojo.dto.H5GameConfigDTO;
 import com.zanxiang.game.module.manage.pojo.dto.GameAppletConfigDTO;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -64,18 +65,6 @@ public class GameAddParam {
     @ApiModelProperty(notes = "游戏应用类型")
     private Long category;
 
-    /**
-     * H5游戏跳转地址
-     */
-    @ApiModelProperty(notes = "H5游戏跳转地址, 游戏类型为H5时必填")
-    private String h5GameUrl;
-
-    /**
-     * H5游戏登录logo图片
-     */
-    @ApiModelProperty(notes = "H5游戏登录logo图片, 游戏类型为H5时必填")
-    private String h5LoginLogo;
-
     /**
      * 游戏是否投放
      */
@@ -111,4 +100,10 @@ public class GameAddParam {
      */
     @ApiModelProperty(notes = "小游戏/公众号应用信息 (微信小游戏和H5游戏必填, 其他游戏不填)")
     private GameAppletConfigDTO gameAppletConfigDTO;
+
+    /**
+     * H5游戏配置对象
+     */
+    @ApiModelProperty(notes = "H5游戏配置对象 (H5游戏必填, 其他游戏不填)")
+    private H5GameConfigDTO h5GameConfigDTO;
 }

+ 68 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameAppletShellAddUpdateParam.java

@@ -0,0 +1,68 @@
+package com.zanxiang.game.module.manage.pojo.params;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-10
+ * @description : 客保控制
+ */
+@Data
+public class GameAppletShellAddUpdateParam {
+
+    /**
+     * 主键
+     */
+    @ApiModelProperty(notes = "主键id, 不传为创建, 传则更新")
+    private Long id;
+
+    /**
+     * 游戏id
+     */
+    @NotNull(message = "游戏id不可为空")
+    @ApiModelProperty(notes = "游戏id, 必传")
+    private Long gameId;
+
+    /**
+     * 是否在申诉
+     */
+    @NotNull(message = "申诉状态不可为空")
+    @ApiModelProperty(notes = "是否在申诉, 必传, 非申诉中proControlType字段只能选择 0 和 1, 申诉只则没有限制")
+    private Boolean isAppeal;
+
+    /**
+     * 线上版本号
+     */
+    @NotBlank(message = "线上版本号不可为空")
+    @ApiModelProperty(notes = "线上版本号, 必传")
+    private String proVersion;
+
+    /**
+     * 提审版本号
+     */
+    @ApiModelProperty(notes = "提审版本号")
+    private String arraignVersion;
+
+    /**
+     * 壳包控制类型, 0:关闭, 1:开启, 2:新用户开启, 老用户关闭, 3:角色等级控制开启
+     */
+    @NotNull(message = "壳包控制类型不可为空")
+    @ApiModelProperty(notes = "壳包控制类型, 0:关闭, 1:开启, 2:新用户开启, 老用户关闭, 3:角色等级控制开启, 必传")
+    private Integer proControlType;
+
+    /**
+     * 壳包控制等级, 类型为3时, 必填
+     */
+    @ApiModelProperty(notes = "壳包控制等级, proControlType类型为3时, 必填")
+    private Long proControlLevel;
+
+    /**
+     * 壳跳出按钮开关
+     */
+    @ApiModelProperty(notes = "壳跳出按钮开关, 非必填")
+    private Boolean isSkipSwitch;
+}

+ 21 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameAppletShellListParam.java

@@ -0,0 +1,21 @@
+package com.zanxiang.game.module.manage.pojo.params;
+
+import com.zanxiang.game.module.mybatis.entity.GameAppletShell;
+import com.zanxiang.module.web.pojo.BaseListDTO;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-10
+ * @description : 壳包配置查询参数
+ */
+@Data
+public class GameAppletShellListParam extends BaseListDTO<GameAppletShell> {
+
+    /**
+     * 游戏id
+     */
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+}

+ 11 - 3
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/PayMerchantAddUpdateParam.java

@@ -3,6 +3,7 @@ package com.zanxiang.game.module.manage.pojo.params;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import java.util.List;
 
@@ -30,16 +31,23 @@ public class PayMerchantAddUpdateParam {
     /**
      * 商户号
      */
-    @NotNull(message = "商户号不可为空")
+    @NotBlank(message = "商户号不可为空")
     @ApiModelProperty(notes = "商户号")
     private String merchantNo;
 
+    /**
+     * 商户名称
+     */
+    @NotBlank(message = "商户名称不可为空")
+    @ApiModelProperty(notes = "商户名称")
+    private String merchantName;
+
     /**
      * 商户主体
      */
-    @NotNull(message = "商户主体不可为空")
+    @NotBlank(message = "商户主体不可为空")
     @ApiModelProperty(notes = "商户主体")
-    private String merchantName;
+    private String merchantCompany;
 
     /**
      * 支付类型id列表

+ 105 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameAppletShellListVO.java

@@ -0,0 +1,105 @@
+package com.zanxiang.game.module.manage.pojo.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-10
+ * @description : 壳包控制配置
+ */
+@Data
+public class GameAppletShellListVO {
+
+    /**
+     * 主键
+     */
+    @ApiModelProperty(notes = "主键")
+    private Long id;
+
+    /**
+     * 游戏id
+     */
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
+    /**
+     * 游戏名称
+     */
+    @ApiModelProperty(notes = "游戏名称")
+    private String gameName;
+
+    /**
+     * 是否在申诉
+     */
+    @ApiModelProperty(notes = "是否在申诉")
+    private Boolean isAppeal;
+
+    /**
+     * 线上版本号
+     */
+    @ApiModelProperty(notes = "线上版本号")
+    private String proVersion;
+
+    /**
+     * 提审版本号
+     */
+    @ApiModelProperty(notes = "提审版本号")
+    private String arraignVersion;
+
+    /**
+     * 壳包控制类型, 0:关闭, 1:开启, 2:新用户开启, 老用户关闭, 3:角色等级控制开启
+     */
+    @ApiModelProperty(notes = "壳包控制类型, 0:关闭, 1:开启, 2:新用户开启, 老用户关闭, 3:角色等级控制开启")
+    private Integer proControlType;
+
+    /**
+     * 壳包控制等级, 类型为3时, 必填
+     */
+    @ApiModelProperty(notes = "壳包控制等级, 类型为3时, 必填")
+    private Long proControlLevel;
+
+    /**
+     * 壳跳出按钮开关
+     */
+    @ApiModelProperty(notes = "壳跳出按钮开关")
+    private Boolean isSkipSwitch;
+
+    /**
+     * 创建人id
+     */
+    @ApiModelProperty(notes = "创建人id")
+    private Long createBy;
+
+    /**
+     * 创建人名字
+     */
+    @ApiModelProperty(notes = "创建人名字")
+    private String createByName;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(notes = "创建时间")
+    private LocalDateTime createTime;
+
+    /**
+     * 更新操作人
+     */
+    @ApiModelProperty(notes = "更新操作人id")
+    private Long updateBy;
+
+    /**
+     * 更新操作人名字
+     */
+    @ApiModelProperty(notes = "更新操作人名字")
+    private String updateByName;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty(notes = "更新时间")
+    private LocalDateTime updateTime;
+}

+ 61 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameAppletShellVO.java

@@ -0,0 +1,61 @@
+package com.zanxiang.game.module.manage.pojo.vo;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-07
+ * @description : 客包控制
+ */
+public class GameAppletShellVO {
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 游戏id
+     */
+    private Long gameId;
+
+    /**
+     * 是否在申诉
+     */
+    private Boolean isAppeal;
+
+    /**
+     * 线上版本号
+     */
+    private String proVersion;
+
+    /**
+     * 提审版本号
+     */
+    private String arraignVersion;
+
+    /**
+     * 壳包控制类型, 0:关闭, 1:开启, 2:新用户开启, 老用户关闭, 3:角色等级控制开启
+     */
+    private Integer proControlType;
+
+    /**
+     * 壳包控制等级, 类型为3时, 必填
+     */
+    private Long proControlLevel;
+
+    /**
+     * 壳跳出按钮开关
+     */
+    private Boolean isSkipSwitch;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+}

+ 7 - 12
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameListVO.java

@@ -1,5 +1,6 @@
 package com.zanxiang.game.module.manage.pojo.vo;
 
+import com.zanxiang.game.module.base.pojo.dto.H5GameConfigDTO;
 import com.zanxiang.game.module.manage.pojo.dto.GameAppletConfigDTO;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -116,18 +117,6 @@ public class GameListVO {
     @ApiModelProperty(notes = "支付方式列表")
     private List<GamePayWayVO> gamePayWayList;
 
-    /**
-     * H5游戏跳转地址
-     */
-    @ApiModelProperty(notes = "H5游戏跳转地址")
-    private String h5GameUrl;
-
-    /**
-     * H5游戏登录logo图片
-     */
-    @ApiModelProperty(notes = "H5游戏登录logo图片")
-    private String h5LoginLogo;
-
     /**
      * 游戏是否投放
      */
@@ -151,4 +140,10 @@ public class GameListVO {
      */
     @ApiModelProperty(notes = "小游戏/公众号应用信息 (微信小游戏和H5游戏才有值)")
     private GameAppletConfigDTO gameAppletConfigDTO;
+
+    /**
+     * H5游戏配置对象
+     */
+    @ApiModelProperty(notes = "H5游戏配置对象 (H5游戏必填, 其他游戏不填)")
+    private H5GameConfigDTO h5GameConfigDTO;
 }

+ 138 - 42
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/OrderVO.java

@@ -15,153 +15,249 @@ import java.time.LocalDateTime;
 @Data
 public class OrderVO {
 
+    /**
+     * 主键id
+     */
     @ApiModelProperty(notes = "主键id")
     private Long id;
 
+    /**
+     * 日期
+     */
     @ApiModelProperty(notes = "日期")
     private LocalDate dateTime;
 
-    @ApiModelProperty(notes = "订单ID:订单号")
+    /**
+     * 游戏订单号
+     */
+    @ApiModelProperty(notes = "游戏订单号")
     private String orderId;
 
-    @ApiModelProperty(notes = "cp订单号")
+    /**
+     * cp订单号
+     */
+    @ApiModelProperty(notes = "CP订单号")
     private String cpOrderId;
 
-    @ApiModelProperty(notes = "第三方支付订单号")
+    /**
+     * 商户订单号
+     */
+    @ApiModelProperty(notes = "商户订单号")
     private String merchantOrderNo;
 
-    @ApiModelProperty(notes = "玩家id")
+    /**
+     * 玩家ID
+     */
+    @ApiModelProperty(notes = "玩家ID")
     private Long userId;
 
+    /**
+     * 玩家账号
+     */
     @ApiModelProperty(notes = "玩家账号")
     private String username;
 
+    /**
+     * 注册时间
+     */
     @ApiModelProperty(notes = "注册时间")
     private LocalDateTime regTime;
 
-    @ApiModelProperty(notes = "充值渠道id")
+    /**
+     * 渠道ID
+     */
+    @ApiModelProperty(notes = "渠道ID")
     private Long agentId;
 
-    @ApiModelProperty(notes = "充值渠道名称")
+    /**
+     * 渠道名称
+     */
+    @ApiModelProperty(notes = "渠道名称")
     private String agentName;
 
-    @ApiModelProperty(notes = "注册渠道id")
-    private Long regAgentId;
-
-    @ApiModelProperty(notes = "注册渠道名称")
-    private String regAgentName;
-
-    @ApiModelProperty(notes = "注册游戏id")
-    private Long regGameId;
-
-    @ApiModelProperty(notes = "注册游戏名称")
-    private String regGameName;
-
+    /**
+     * cpId
+     */
     @ApiModelProperty(notes = "cpId")
     private Long cpId;
 
-    @ApiModelProperty(notes = "cp名称")
+    /**
+     * cp名称
+     */
+    @ApiModelProperty(notes = "CP名称")
     private String cpName;
 
-    @ApiModelProperty(notes = "游戏应用类型id")
-    private Long regGameCategoryId;
-
-    @ApiModelProperty(notes = "游戏应用类型名称")
-    private String regGameCategoryName;
-
+    /**
+     * 归因投放人员id
+     */
     @ApiModelProperty(notes = "归因投放人员id")
     private Long pitcherId;
 
+    /**
+     * 归因投放人员名字
+     */
     @ApiModelProperty(notes = "归因投放人员名字")
     private String pitcherName;
 
+    /**
+     * 归因推广账号id
+     */
     @ApiModelProperty(notes = "归因推广账号id")
     private Long accountId;
 
+    /**
+     * 推广账号类型(1:腾讯、2:头条)
+     */
     @ApiModelProperty(notes = "推广账号类型(1:腾讯、2:头条)")
     private Integer accountType;
 
-    @ApiModelProperty(notes = "充值游戏id")
+    /**
+     * 游戏id
+     */
+    @ApiModelProperty(notes = "游戏ID")
     private Long gameId;
 
-    @ApiModelProperty(notes = "充值游戏名称")
+    /**
+     * 游戏名称
+     */
+    @ApiModelProperty(notes = "游戏名称")
     private String gameName;
 
-    @ApiModelProperty(notes = "充值游戏类型")
+    /**
+     * 游戏类型
+     */
+    @ApiModelProperty(notes = "游戏类型ID")
     private Long gameCategoryId;
 
-    @ApiModelProperty(notes = "充值游戏类型")
-    private String gameCategory;
+    /**
+     * 游戏类型
+     */
+    @ApiModelProperty(notes = "游戏类型名称")
+    private String gameCategoryName;
 
+    /**
+     * 游戏商品ID
+     */
     @ApiModelProperty(notes = "游戏商品ID")
     private String productId;
 
+    /**
+     * 产品名称
+     */
     @ApiModelProperty(notes = "产品名称")
     private String productName;
 
+    /**
+     * 订单金额
+     */
     @ApiModelProperty(notes = "订单金额")
     private BigDecimal amount;
 
+    /**
+     * 订单实付金额
+     */
     @ApiModelProperty(notes = "订单实付金额")
     private BigDecimal realAmount;
 
+    /**
+     * 支付方式id
+     */
     @ApiModelProperty(notes = "支付方式id")
     private Long payWayId;
 
-    @ApiModelProperty(notes = "支付方式")
-    private String payWay;
+    /**
+     * 支付方式
+     */
+    @ApiModelProperty(notes = "支付方式名称")
+    private String payWayName;
 
+    /**
+     * 支付场景id
+     */
     @ApiModelProperty(notes = "支付场景id")
     private Long payDeviceId;
 
-    @ApiModelProperty(notes = "支付场景")
+    /**
+     * 支付场景
+     */
+    @ApiModelProperty(notes = "支付场景名称")
     private String payDeviceName;
 
+    /**
+     * 商户号
+     */
     @ApiModelProperty(notes = "商户号")
     private String merchantNo;
 
+    /**
+     * 商户名称
+     */
     @ApiModelProperty(notes = "商户名称")
     private String merchantName;
 
+    /**
+     * 所在服务器名称
+     */
     @ApiModelProperty(notes = "所在服务器名称")
     private String serverName;
 
+    /**
+     * 角色名称
+     */
     @ApiModelProperty(notes = "角色名称")
     private String roleName;
 
+    /**
+     * 角色等级
+     */
     @ApiModelProperty(notes = "角色等级")
     private Long roleLevel;
 
+    /**
+     * 角色VIP
+     */
     @ApiModelProperty(notes = "角色VIP")
     private Long roleVipLevel;
 
+    /**
+     * 客户端操作系统, android, ios, windows, mac
+     */
     @ApiModelProperty(notes = "客户端操作系统, android, ios, windows, mac")
     private String deviceSystem;
 
-    @ApiModelProperty(notes = "是否切量  0 否 1 是")
-    private Boolean isSwitch;
-
+    /**
+     * 创建时间
+     */
     @ApiModelProperty(notes = "创建时间")
     private LocalDateTime createTime;
 
+    /**
+     * 支付时间
+     */
     @ApiModelProperty(notes = "支付时间")
     private LocalDateTime payTime;
 
-    @ApiModelProperty(notes = "订单结束时间")
-    private LocalDateTime endTime;
-
+    /**
+     * cp最后通知时间
+     */
     @ApiModelProperty(notes = "cp最后通知时间")
     private LocalDateTime lastCpNotifyTime;
 
+    /**
+     * 支付状态,1待支付,2 支付成功,-1 已取消
+     */
     @ApiModelProperty(notes = "支付状态,1待支付,2 支付成功,-1 已取消")
     private Integer status;
 
+    /**
+     * CP通知状态,1为待处理,2为成功,-1为失败
+     */
     @ApiModelProperty(notes = "CP通知状态,1为待处理,2为成功,-1为失败")
     private Integer cpStatus;
 
+    /**
+     * 是否首充 0 否 1 是
+     */
     @ApiModelProperty(notes = "是否首充 0 否 1 是")
     private Integer isFirstRecharge;
-
-    @ApiModelProperty(notes = "广告上报状态, 0 : 未上报, 1 : 上报成功, 2 : 上报失败")
-    private Integer callBackStatus;
 }

+ 7 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/PayMerchantListVO.java

@@ -30,11 +30,17 @@ public class PayMerchantListVO {
     @ApiModelProperty(notes = "商户号")
     private String merchantNo;
 
+    /**
+     * 商户名称
+     */
+    @ApiModelProperty(notes = "商户名称")
+    private String merchantName;
+
     /**
      * 商户主体
      */
     @ApiModelProperty(notes = "商户主体")
-    private String merchantName;
+    private String merchantCompany;
 
     /**
      * 商户平台id

+ 6 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/UserVO.java

@@ -111,6 +111,12 @@ public class UserVO {
     @ApiModelProperty(notes = "注册游戏")
     private String regGame;
 
+    /**
+     * 游戏类型名称
+     */
+    @ApiModelProperty(notes = "游戏类型名称")
+    private String categoryName;
+
     /**
      * 用户状态, 0 : 为正常状态, 1 : 为冻结状态
      */

+ 32 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameAppletShellService.java

@@ -0,0 +1,32 @@
+package com.zanxiang.game.module.manage.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.game.module.manage.pojo.params.GameAppletShellAddUpdateParam;
+import com.zanxiang.game.module.manage.pojo.params.GameAppletShellListParam;
+import com.zanxiang.game.module.manage.pojo.vo.GameAppletShellListVO;
+import com.zanxiang.game.module.mybatis.entity.GameAppletShell;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-06
+ * @description : 壳包控制
+ */
+public interface IGameAppletShellService extends IService<GameAppletShell> {
+
+    /**
+     * 添加或更新
+     *
+     * @param param 参数
+     * @return {@link Boolean}
+     */
+    Boolean addOrUpdate(GameAppletShellAddUpdateParam param);
+
+    /**
+     * 列表页面
+     *
+     * @param param 参数
+     * @return {@link IPage}<{@link GameAppletShellListVO}>
+     */
+    IPage<GameAppletShellListVO> listOfPage(GameAppletShellListParam param);
+}

+ 0 - 7
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IPayDeviceService.java

@@ -28,11 +28,4 @@ public interface IPayDeviceService extends IService<PayDevice> {
      * @return {@link Map}<{@link Long}, {@link PayDeviceDTO}>
      */
     Map<Long, PayDeviceDTO> payDeviceMap();
-
-    /**
-     * 支付方式选择列表
-     *
-     * @return {@link Map}<{@link Long}, {@link PayDeviceChoiceVO}>
-     */
-    Map<Long, PayDeviceChoiceVO> payDeviceChoiceMap();
 }

+ 2 - 2
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameAppletServiceImpl.java

@@ -62,7 +62,6 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
                 .eq(GameApplet::getGameId, game.getId())
         );
         if (gameApplet == null) {
-            this.createActionSet(game.getCategory(), game.getIsPut(), gameAppletConfigDTO.getAppId(), game.getName());
             gameApplet = GameApplet.builder()
                     .gameId(game.getId())
                     .appId(gameAppletConfigDTO.getAppId())
@@ -95,6 +94,7 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
             gameApplet.setManager(gameAppletConfigDTO.getManager());
             gameApplet.setUpdateTime(LocalDateTime.now());
         }
+        this.createActionSet(game.getCategory(), game.getIsPut(), gameAppletConfigDTO.getAppId(), game.getName());
         return super.saveOrUpdate(gameApplet);
     }
 
@@ -112,7 +112,7 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
 
     private Boolean createActionSet(Long gameCategory, Boolean isPut, String appId, String gameName) {
         CreateUserActionSetRpcDTO actionSetRpcDTO = CreateUserActionSetRpcDTO.builder()
-                .appId(appId).type("WEB").name(gameName + "Web数据源").build();
+                .appId(appId).type("WEB").name(gameName + "Web数据源").unique(Boolean.TRUE).build();
         //小游戏和H5的类型才需要创建数据源
         List<Long> categoryList = Arrays.asList(GameCategoryEnum.CATEGORY_WX_APPLET.getId(), GameCategoryEnum.CATEGORY_H5.getId());
         //投放的游戏才需要设置数据源

+ 141 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameAppletShellServiceImpl.java

@@ -0,0 +1,141 @@
+package com.zanxiang.game.module.manage.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.erp.base.ErpServer;
+import com.zanxiang.erp.base.rpc.ISysUserRpc;
+import com.zanxiang.erp.security.util.SecurityUtil;
+import com.zanxiang.game.module.base.pojo.enums.DeleteEnum;
+import com.zanxiang.game.module.base.pojo.enums.ShellControlEnum;
+import com.zanxiang.game.module.base.pojo.enums.StatusEnum;
+import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
+import com.zanxiang.game.module.manage.pojo.params.GameAppletShellAddUpdateParam;
+import com.zanxiang.game.module.manage.pojo.params.GameAppletShellListParam;
+import com.zanxiang.game.module.manage.pojo.vo.GameAppletShellListVO;
+import com.zanxiang.game.module.manage.service.IGameAppletShellService;
+import com.zanxiang.game.module.manage.service.IGameService;
+import com.zanxiang.game.module.mybatis.entity.GameAppletShell;
+import com.zanxiang.game.module.mybatis.mapper.GameAppletShellMapper;
+import com.zanxiang.module.util.bean.BeanUtil;
+import com.zanxiang.module.util.exception.BaseException;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-06
+ * @description : 壳包控制
+ */
+@Slf4j
+@Service
+public class GameAppletShellServiceImpl extends ServiceImpl<GameAppletShellMapper, GameAppletShell> implements IGameAppletShellService {
+
+    @Autowired
+    private IGameService gameService;
+
+    @Lazy
+    @DubboReference(providedBy = ErpServer.SERVER_DUBBO_NAME)
+    private ISysUserRpc sysUserRpc;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean addOrUpdate(GameAppletShellAddUpdateParam param) {
+        //参数判断
+        if (Objects.equals(ShellControlEnum.SHELL_CONTROL_LOW_LEVEL_OPEN.getShellControl(), param.getProControlType())
+                && param.getProControlLevel() == null) {
+            throw new BaseException("参数错误, 控制低等级开启壳, 等级限制不可为空");
+        }
+        //非申诉中, 类型限制
+        if (!param.getIsAppeal() && !ShellControlEnum.SHELL_CONTROL_CLOSE.getShellControl().equals(param.getProControlType())
+                && !ShellControlEnum.SHELL_CONTROL_OPEN.getShellControl().equals(param.getProControlType())) {
+            throw new BaseException("参数错误, 非申诉中状态, 控制类型只能选开启/关闭");
+        }
+        Long id = param.getId();
+        //创建
+        if (id == null) {
+            GameAppletShell gameAppletShell = super.getOne(new LambdaQueryWrapper<GameAppletShell>()
+                    .eq(GameAppletShell::getGameId, param.getGameId()));
+            if (gameAppletShell != null) {
+                throw new BaseException("该游戏已经存在壳包配置, 禁止重复添加");
+            }
+            return super.save(this.transform(param));
+        }
+        //更新
+        GameAppletShell gameAppletShell = super.getById(id);
+        if (gameAppletShell == null) {
+            throw new BaseException("参数错误, 游戏壳包配置信息不存在");
+        }
+        gameAppletShell.setIsAppeal(param.getIsAppeal());
+        gameAppletShell.setProVersion(param.getProVersion());
+        gameAppletShell.setArraignVersion(param.getArraignVersion());
+        gameAppletShell.setProControlType(param.getProControlType());
+        gameAppletShell.setProControlLevel(param.getProControlLevel());
+        gameAppletShell.setIsSkipSwitch(param.getIsSkipSwitch());
+        gameAppletShell.setUpdateBy(SecurityUtil.getUserId());
+        gameAppletShell.setUpdateTime(LocalDateTime.now());
+        return super.updateById(gameAppletShell);
+    }
+
+    private GameAppletShell transform(GameAppletShellAddUpdateParam param) {
+        return GameAppletShell.builder()
+                .gameId(param.getGameId())
+                .isAppeal(param.getIsAppeal())
+                .proVersion(param.getProVersion())
+                .arraignVersion(param.getArraignVersion())
+                .proControlType(param.getProControlType())
+                .proControlLevel(param.getProControlLevel())
+                .isSkipSwitch(param.getIsSkipSwitch())
+                .status(StatusEnum.YES.getCode())
+                .isDelete(DeleteEnum.NO.getCode())
+                .createBy(SecurityUtil.getUserId())
+                .createTime(LocalDateTime.now())
+                .createBy(SecurityUtil.getUserId())
+                .updateTime(LocalDateTime.now())
+                .build();
+    }
+
+    @Override
+    public IPage<GameAppletShellListVO> listOfPage(GameAppletShellListParam param) {
+        return super.page(param.toPage(), new QueryWrapper<GameAppletShell>().lambda()
+                .eq(param.getGameId() != null, GameAppletShell::getGameId, param.getGameId())
+                .orderByDesc(GameAppletShell::getCreateTime)
+        ).convert(this::toVO);
+    }
+
+    private GameAppletShellListVO toVO(GameAppletShell gameAppletShell) {
+        if (gameAppletShell == null) {
+            return null;
+        }
+        GameAppletShellListVO gameAppletShellListVO = BeanUtil.copy(gameAppletShell, GameAppletShellListVO.class);
+        GameDTO gameDTO = gameService.getById(gameAppletShellListVO.getGameId());
+        if (gameDTO != null) {
+            gameAppletShellListVO.setGameName(gameDTO.getName());
+        }
+        Map<Long, String> userNameMap = null;
+        List<Long> userIds = Arrays.asList(gameAppletShellListVO.getCreateBy(), gameAppletShellListVO.getUpdateBy());
+        try {
+            userNameMap = sysUserRpc.getUserNameByIds(userIds).getData();
+        } catch (Exception e) {
+            log.error("获取投手名字信息异常, userIds : {}, e : {}", userIds, e.getMessage());
+        }
+        if (CollectionUtils.isNotEmpty(userNameMap)) {
+            gameAppletShellListVO.setCreateByName(userNameMap.get(gameAppletShellListVO.getCreateBy()));
+            gameAppletShellListVO.setUpdateByName(userNameMap.get(gameAppletShellListVO.getUpdateBy()));
+        }
+        return gameAppletShellListVO;
+    }
+
+}

+ 12 - 4
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameServiceImpl.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.game.module.base.pojo.dto.H5GameConfigDTO;
 import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.manage.enums.GameStatusEnum;
 import com.zanxiang.game.module.manage.pojo.dto.GameAppletConfigDTO;
@@ -20,6 +21,7 @@ import com.zanxiang.game.module.mybatis.entity.Cp;
 import com.zanxiang.game.module.mybatis.entity.Game;
 import com.zanxiang.game.module.mybatis.entity.GameTag;
 import com.zanxiang.game.module.mybatis.mapper.GameMapper;
+import com.zanxiang.module.util.JsonUtil;
 import com.zanxiang.module.util.bean.BeanUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -74,8 +76,7 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
                     .h5GameId(param.getH5GameId())
                     .guideGameId(param.getGuideGameId())
                     .remark(param.getRemark())
-                    .h5GameUrl(param.getH5GameUrl())
-                    .h5LoginLogo(param.getH5LoginLogo())
+                    .h5GameConfig(JsonUtil.toString(param.getH5GameConfigDTO()))
                     .isPut(param.getIsPut())
                     .createTime(LocalDateTime.now())
                     .updateTime(LocalDateTime.now())
@@ -89,8 +90,7 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
             game.setH5GameId(param.getH5GameId());
             game.setGuideGameId(param.getGuideGameId());
             game.setRemark(param.getRemark());
-            game.setH5GameUrl(param.getH5GameUrl());
-            game.setH5LoginLogo(param.getH5LoginLogo());
+            game.setH5GameConfig(JsonUtil.toString(param.getH5GameConfigDTO()));
             game.setIsPut(param.getIsPut());
             game.setUpdateTime(LocalDateTime.now());
         }
@@ -98,6 +98,10 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
             game.setParentId(param.getParentGameId());
         }
         super.saveOrUpdate(game);
+        //APP游戏不需要配置应用信息
+        if (Objects.equals(param.getCategory(), GameCategoryEnum.CATEGORY_APP.getId())) {
+            return Boolean.TRUE;
+        }
         return gameAppletService.addOrUpdate(game, param.getGameAppletConfigDTO());
     }
 
@@ -210,6 +214,10 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
         if (gameAppletDTO != null) {
             gameListVO.setGameAppletConfigDTO(BeanUtil.copy(gameAppletDTO, GameAppletConfigDTO.class));
         }
+        //H5游戏配置
+        if (Strings.isNotBlank(game.getH5GameConfig())) {
+            gameListVO.setH5GameConfigDTO(JsonUtil.toObj(game.getH5GameConfig(), H5GameConfigDTO.class));
+        }
         return gameListVO;
     }
 

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserRoleServiceImpl.java

@@ -107,7 +107,7 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         //渠道id
         List<Long> agentIdList = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
         //管理员可见自然量数据
-        if (SecurityUtil.isManager()) {
+        if (SecurityUtil.isManager() && param.getChannelId() == null) {
             agentIdList.add(Agent.DEFAULT_AGENT);
         }
         //玩家条件处理

+ 5 - 2
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserServiceImpl.java

@@ -15,10 +15,12 @@ import com.zanxiang.game.module.manage.pojo.params.GameUserListParam;
 import com.zanxiang.game.module.manage.pojo.vo.GameUserListVO;
 import com.zanxiang.game.module.manage.pojo.vo.GameUserVO;
 import com.zanxiang.game.module.manage.service.*;
+import com.zanxiang.game.module.mybatis.entity.Agent;
 import com.zanxiang.game.module.mybatis.entity.GameUser;
 import com.zanxiang.game.module.mybatis.mapper.GameUserMapper;
 import com.zanxiang.module.util.bean.BeanUtil;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -69,8 +71,9 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
         //渠道id
         List<Long> agentIdList = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
         //管理员可见自然量数据
-        if (SecurityUtil.isManager()) {
-            agentIdList.add(0L);
+        if (SecurityUtil.isManager() && Strings.isBlank(param.getAccountId())
+                && Strings.isBlank(param.getPitcherId()) && param.getChannelId() == null) {
+            agentIdList.add(Agent.DEFAULT_AGENT);
         }
         //玩家条件处理
         Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), agentIdList, param.getUserName(),

+ 32 - 57
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/OrderServiceImpl.java

@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.erp.security.util.SecurityUtil;
 import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
+import com.zanxiang.game.module.base.pojo.enums.PayDeviceEnum;
+import com.zanxiang.game.module.base.pojo.enums.PayWayEnum;
 import com.zanxiang.game.module.manage.pojo.dto.*;
 import com.zanxiang.game.module.manage.pojo.params.OrderParam;
 import com.zanxiang.game.module.manage.pojo.params.UserOrderListParam;
@@ -14,6 +16,7 @@ import com.zanxiang.game.module.manage.pojo.vo.OrderListVO;
 import com.zanxiang.game.module.manage.pojo.vo.OrderVO;
 import com.zanxiang.game.module.manage.pojo.vo.UserOrderListVO;
 import com.zanxiang.game.module.manage.service.*;
+import com.zanxiang.game.module.mybatis.entity.Agent;
 import com.zanxiang.game.module.mybatis.entity.Order;
 import com.zanxiang.game.module.mybatis.entity.User;
 import com.zanxiang.game.module.mybatis.mapper.OrderMapper;
@@ -26,7 +29,10 @@ import org.springframework.stereotype.Service;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
-import java.util.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -52,13 +58,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
     private IUserService userService;
 
     @Autowired
-    private IPayWayService payWayService;
-
-    @Autowired
-    private IPayDeviceService payDeviceService;
+    private IAgentService agentService;
 
     @Autowired
-    private IAgentService agentService;
+    private IPayMerchantService payMerchantService;
 
     @Override
     public IPage<UserOrderListVO> orderList(UserOrderListParam param) {
@@ -102,8 +105,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         //渠道id列表
         List<Long> agentIds = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
         //管理员可见自然量数据
-        if (SecurityUtil.isManager()) {
-            agentIds.add(0L);
+        if (SecurityUtil.isManager() && Strings.isBlank(param.getAccountId())
+                && Strings.isBlank(param.getPitcherId()) && param.getChannelId() == null) {
+            agentIds.add(Agent.DEFAULT_AGENT);
         }
         //查询用户id和名字条件
         List<Long> userIds = null;
@@ -138,15 +142,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         Map<Long, AgentDTO> agentMap = agentDTOList.stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
         //游戏信息
         Map<Long, GameDTO> gameMap = gameService.gameMap(orderListVOList.stream()
-                .map(orderVO -> Arrays.asList(orderVO.getGameId(), orderVO.getRegGameId()))
-                .flatMap(List::stream).collect(Collectors.toSet()));
-        //支付渠道列表
-        Map<Long, PayWayDTO> payWayMap = payWayService.payWayMap();
-        //支付方式列表
-        Map<Long, PayDeviceDTO> payDeviceMap = payDeviceService.payDeviceMap();
+                .map(OrderVO::getGameId).collect(Collectors.toSet()));
+        //商户列表
+        Map<String, PayMerchantDTO> payMerchantMap = payMerchantService.payMerchantMap();
         //字段信息补充更新
-        orderListVOList.forEach(vo -> this.update(vo, userMap, gameMap, cpMap,
-                payWayMap, payDeviceMap, agentMap));
+        orderListVOList.forEach(vo -> this.toVO(vo, userMap, gameMap, cpMap, agentMap, payMerchantMap));
         //设置返回
         OrderListVO orderListVO = new OrderListVO();
         orderListVO.setSize(page.getSize());
@@ -158,62 +158,38 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         return orderListVO;
     }
 
-    private void update(OrderVO orderVO, Map<Long, UserDTO> userMap, Map<Long, GameDTO> gameMap, Map<Long, CpDTO> cpMap,
-                        Map<Long, PayWayDTO> payWayMap, Map<Long, PayDeviceDTO> payDeviceMap, Map<Long, AgentDTO> agentMap) {
+    private void toVO(OrderVO orderVO, Map<Long, UserDTO> userMap, Map<Long, GameDTO> gameMap, Map<Long, CpDTO> cpMap,
+                      Map<Long, AgentDTO> agentMap, Map<String, PayMerchantDTO> payMerchantMap) {
         orderVO.setDateTime(orderVO.getCreateTime().toLocalDate());
         //用户信息补充
         UserDTO userDTO = userMap.get(orderVO.getUserId());
-        if (userDTO != null) {
-            //注册渠道
-            AgentDTO agentDTO = agentMap.get(userDTO.getRegAgentId());
-            if (agentDTO != null) {
-                orderVO.setRegAgentId(agentDTO.getId());
-                orderVO.setRegAgentName(agentDTO.getAgentName());
-            }
-        }
-        //充值渠道
+        orderVO.setUsername(userDTO == null ? null : userDTO.getUsername());
+        //渠道账号
         AgentDTO agentDTO = agentMap.get(orderVO.getAgentId());
         if (agentDTO != null) {
             orderVO.setAccountId(agentDTO.getId());
             orderVO.setPitcherId(agentDTO.getCreateBy());
             orderVO.setPitcherName(agentDTO.getCreateByName());
             orderVO.setAccountType(agentDTO.getAccountType());
+            orderVO.setAgentName(agentDTO.getAgentName());
         }
-        //注册游戏
-        GameDTO regGameDTO = gameMap.get(orderVO.getRegGameId());
-        if (regGameDTO != null) {
-            orderVO.setRegGameName(regGameDTO.getName());
-            //注册游戏应用类型
-            GameCategoryEnum gameCategoryEnum = GameCategoryEnum.getGameCategory(regGameDTO.getCategory());
-            if (gameCategoryEnum != null) {
-                orderVO.setRegGameCategoryId(gameCategoryEnum.getId());
-                orderVO.setRegGameCategoryName(gameCategoryEnum.getName());
-            }
-        }
-        //CP
+        //CP名称
         CpDTO cpDTO = cpMap.get(orderVO.getCpId());
-        if (cpDTO != null) {
-            orderVO.setCpName(cpDTO.getCpName());
-        }
-        //充值游戏
+        orderVO.setCpName(cpDTO == null ? null : cpDTO.getCpName());
+        //商户名称
+        PayMerchantDTO payMerchantDTO = payMerchantMap.get(orderVO.getMerchantNo());
+        orderVO.setMerchantName(payMerchantDTO == null ? null : payMerchantDTO.getMerchantName());
+        //游戏信息
         GameDTO gameDTO = gameMap.get(orderVO.getGameId());
         if (gameDTO != null) {
             orderVO.setGameName(gameDTO.getName());
-            //注册游戏应用类型
             GameCategoryEnum gameCategoryEnum = GameCategoryEnum.getGameCategory(gameDTO.getCategory());
-            if (gameCategoryEnum != null) {
-                orderVO.setGameCategory(gameCategoryEnum.getName());
-                orderVO.setGameCategoryId(gameCategoryEnum.getId());
-            }
-        }
-        //支付渠道
-        if (payWayMap.get(orderVO.getPayWayId()) != null) {
-            orderVO.setPayWay(payWayMap.get(orderVO.getPayWayId()).getPayWayName());
-        }
-        //支付场景
-        if (payDeviceMap.get(orderVO.getPayDeviceId()) != null) {
-            orderVO.setPayDeviceName(payDeviceMap.get(orderVO.getPayDeviceId()).getPayDeviceName());
+            orderVO.setGameCategoryId(gameCategoryEnum == null ? null : gameCategoryEnum.getId());
+            orderVO.setGameCategoryName(gameCategoryEnum == null ? null : gameCategoryEnum.getName());
         }
+        //支付渠道, 场景
+        orderVO.setPayWayName(PayWayEnum.getByPayWayId(orderVO.getPayWayId()));
+        orderVO.setPayDeviceName(PayDeviceEnum.getByPayWayId(orderVO.getPayDeviceId()));
     }
 
     private LambdaQueryWrapper<Order> getListWrapper(OrderParam param, List<Long> agentIdList, List<Long> userIdList, String select) {
@@ -243,7 +219,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 .orderByDesc(Order::getCreateTime);
     }
 
-
     private OrderVO orderToVo(Order order) {
         if (Objects.isNull(order)) {
             return null;

+ 0 - 11
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/PayDeviceServiceImpl.java

@@ -45,15 +45,4 @@ public class PayDeviceServiceImpl extends ServiceImpl<PayDeviceMapper, PayDevice
         return payDeviceList.stream().map(payDevice -> BeanUtil.copy(payDevice, PayDeviceDTO.class))
                 .collect(Collectors.toMap(PayDeviceDTO::getId, Function.identity()));
     }
-
-    @Override
-    public Map<Long, PayDeviceChoiceVO> payDeviceChoiceMap() {
-        List<PayDevice> payDeviceList = super.list();
-        if (CollectionUtils.isEmpty(payDeviceList)) {
-            return Collections.emptyMap();
-        }
-        return payDeviceList.stream()
-                .map(payDevice -> BeanUtil.copy(payDevice, PayDeviceChoiceVO.class))
-                .collect(Collectors.toMap(PayDeviceChoiceVO::getId, Function.identity()));
-    }
 }

+ 89 - 84
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/PayMerchantServiceImpl.java

@@ -5,29 +5,28 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.erp.security.util.SecurityUtil;
 import com.zanxiang.game.module.base.pojo.enums.DeleteEnum;
+import com.zanxiang.game.module.base.pojo.enums.PayDeviceEnum;
 import com.zanxiang.game.module.base.pojo.enums.PayWayEnum;
 import com.zanxiang.game.module.base.pojo.enums.StatusEnum;
+import com.zanxiang.game.module.base.util.DateUtils;
 import com.zanxiang.game.module.manage.pojo.dto.PayMerchantDTO;
-import com.zanxiang.game.module.manage.pojo.dto.PayWayDTO;
 import com.zanxiang.game.module.manage.pojo.params.PayMerchantAddUpdateParam;
 import com.zanxiang.game.module.manage.pojo.params.PayMerchantListParam;
-import com.zanxiang.game.module.manage.pojo.vo.PayDeviceChoiceVO;
 import com.zanxiang.game.module.manage.pojo.vo.PayMerchantChoiceVO;
 import com.zanxiang.game.module.manage.pojo.vo.PayMerchantListVO;
-import com.zanxiang.game.module.manage.service.IPayDeviceService;
 import com.zanxiang.game.module.manage.service.IPayMerchantService;
-import com.zanxiang.game.module.manage.service.IPayWayService;
 import com.zanxiang.game.module.mybatis.entity.PayMerchant;
 import com.zanxiang.game.module.mybatis.mapper.PayMerchantMapper;
 import com.zanxiang.module.util.JsonUtil;
 import com.zanxiang.module.util.bean.BeanUtil;
 import com.zanxiang.module.util.exception.BaseException;
 import org.apache.logging.log4j.util.Strings;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.util.*;
 import java.util.function.Function;
@@ -41,31 +40,23 @@ import java.util.stream.Collectors;
 @Service
 public class PayMerchantServiceImpl extends ServiceImpl<PayMerchantMapper, PayMerchant> implements IPayMerchantService {
 
-    @Autowired
-    private IPayDeviceService payDeviceService;
-
-    @Autowired
-    private IPayWayService payWayService;
-
     @Override
     public boolean addOrUpdate(PayMerchantAddUpdateParam param) {
-        Map<Long, PayWayDTO> payWayMap = payWayService.payWayMap();
         String payDeviceIds = null;
         if (CollectionUtils.isNotEmpty(param.getPayDeviceIdList())) {
             payDeviceIds = param.getPayDeviceIdList().stream()
                     .map(String::valueOf).collect(Collectors.joining(","));
         }
-        Long payWayId = param.getPayWayId();
         String payConfig = null;
         if (Strings.isNotBlank(param.getSecretKey())) {
             Map<String, String> configMap = new HashMap<>(4);
-            if (Objects.equals(payWayId.intValue(), PayWayEnum.ALI_PAY.getPayWayId())) {
+            if (Objects.equals(param.getPayWayId().intValue(), PayWayEnum.ALI_PAY.getPayWayId())) {
                 configMap.put("protocol", "https");
                 configMap.put("gatewayHost", "openapi.alipay.com");
                 configMap.put("signType", "RSA2");
                 configMap.put("alipayPublicKey", param.getSecretKey());
             }
-            if (Objects.equals(payWayId.intValue(), PayWayEnum.WX_PAY.getPayWayId())) {
+            if (Objects.equals(param.getPayWayId().intValue(), PayWayEnum.WX_PAY.getPayWayId())) {
                 configMap.put("mchId", param.getMerchantNo());
                 configMap.put("apiKey", param.getSecretKey());
                 configMap.put("signType", "MD5");
@@ -73,55 +64,58 @@ public class PayMerchantServiceImpl extends ServiceImpl<PayMerchantMapper, PayMe
             payConfig = JsonUtil.toString(configMap);
         }
         Long id = param.getId();
-        PayMerchant payMerchant;
         if (id == null) {
-            payMerchant = PayMerchant.builder()
-                    .merchantNo(param.getMerchantNo())
-                    .merchantName(param.getMerchantName())
-                    .payWayId(param.getPayWayId())
-                    .payWayName(payWayMap.get(payWayId) == null ? null : payWayMap.get(payWayId).getPayWayName())
-                    .account(param.getAccount())
-                    .password(param.getPassword())
-                    .manager(param.getManager())
-                    .mobile(param.getMobile())
-                    .email(param.getEmail())
-                    .payConfig(payConfig)
-                    .maxPayLock(StatusEnum.YES.getCode())
-                    .remark(param.getRemark())
-                    .status(StatusEnum.YES.getCode())
-                    .isDelete(DeleteEnum.NO.getCode())
-                    .createTime(LocalDateTime.now())
-                    .updateTime(LocalDateTime.now())
-                    .payDeviceIds(payDeviceIds)
-                    .build();
-        } else {
-            payMerchant = super.getById(id);
-            if (payMerchant == null) {
-                throw new BaseException("参数错误, 商户信息不存在");
-            }
-            //商户号更新, 判断是否已经存在商户号
-            if (!Objects.equals(payMerchant.getMerchantNo(), param.getMerchantNo())) {
-                int count = super.count(new LambdaQueryWrapper<PayMerchant>()
-                        .eq(PayMerchant::getMerchantNo, param.getMerchantNo()));
-                if (count > 0) {
-                    throw new BaseException("参数错误, 商户号已经存在, 不可更新为该商户号");
-                }
-            }
-            payMerchant.setMerchantNo(param.getMerchantNo());
-            payMerchant.setMerchantName(param.getMerchantName());
-            payMerchant.setPayWayId(param.getPayWayId());
-            payMerchant.setPayWayName(payWayMap.get(payWayId) == null ? null : payWayMap.get(payWayId).getPayWayName());
-            payMerchant.setAccount(param.getAccount());
-            payMerchant.setPassword(param.getPassword());
-            payMerchant.setManager(param.getManager());
-            payMerchant.setMobile(param.getMobile());
-            payMerchant.setEmail(param.getEmail());
-            payMerchant.setPayConfig(payConfig);
-            payMerchant.setRemark(param.getRemark());
-            payMerchant.setUpdateTime(LocalDateTime.now());
-            payMerchant.setPayDeviceIds(payDeviceIds);
+            return super.save(this.transform(param, payConfig, payDeviceIds));
+        }
+        PayMerchant payMerchant = super.getById(id);
+        if (payMerchant == null) {
+            throw new BaseException("参数错误, 商户信息不存在");
+        }
+        //商户号更新, 判断是否已经存在商户号
+        if (!Objects.equals(payMerchant.getMerchantNo(), param.getMerchantNo())
+                && super.count(new LambdaQueryWrapper<PayMerchant>()
+                .eq(PayMerchant::getMerchantNo, param.getMerchantNo())) > 0) {
+            throw new BaseException("参数错误, 商户号已经存在, 不可更新为该商户号");
         }
-        return super.saveOrUpdate(payMerchant);
+        payMerchant.setMerchantNo(param.getMerchantNo());
+        payMerchant.setMerchantName(param.getMerchantName());
+        payMerchant.setMerchantCompany(param.getMerchantCompany());
+        payMerchant.setPayWayId(param.getPayWayId());
+        payMerchant.setAccount(param.getAccount());
+        payMerchant.setPassword(param.getPassword());
+        payMerchant.setManager(param.getManager());
+        payMerchant.setMobile(param.getMobile());
+        payMerchant.setEmail(param.getEmail());
+        payMerchant.setPayConfig(payConfig);
+        payMerchant.setRemark(param.getRemark());
+        payMerchant.setPayDeviceIds(payDeviceIds);
+        payMerchant.setUpdateById(SecurityUtil.getUserId());
+        payMerchant.setUpdateTime(LocalDateTime.now());
+        return super.updateById(payMerchant);
+    }
+
+    private PayMerchant transform(PayMerchantAddUpdateParam param, String payConfig, String payDeviceIds) {
+        return PayMerchant.builder()
+                .merchantNo(param.getMerchantNo())
+                .merchantName(param.getMerchantName())
+                .merchantCompany(param.getMerchantCompany())
+                .payWayId(param.getPayWayId())
+                .account(param.getAccount())
+                .password(param.getPassword())
+                .manager(param.getManager())
+                .mobile(param.getMobile())
+                .email(param.getEmail())
+                .payConfig(payConfig)
+                .maxPayLock(StatusEnum.YES.getCode())
+                .remark(param.getRemark())
+                .status(StatusEnum.YES.getCode())
+                .isDelete(DeleteEnum.NO.getCode())
+                .createById(SecurityUtil.getUserId())
+                .createTime(LocalDateTime.now())
+                .updateById(SecurityUtil.getUserId())
+                .updateTime(LocalDateTime.now())
+                .payDeviceIds(payDeviceIds)
+                .build();
     }
 
     @Override
@@ -135,12 +129,6 @@ public class PayMerchantServiceImpl extends ServiceImpl<PayMerchantMapper, PayMe
 
     @Override
     public IPage<PayMerchantListVO> pageList(PayMerchantListParam param) {
-        //米大师商户与微信商户同类型
-        if (Objects.equals(param.getPayWayId(), PayWayEnum.MI_PAY.getPayWayId())) {
-            param.setPayWayId(PayWayEnum.WX_PAY.getPayWayId());
-        }
-        //支付方式
-        Map<Long, PayDeviceChoiceVO> payDeviceMap = payDeviceService.payDeviceChoiceMap();
         //查询
         return page(param.toPage(), new LambdaQueryWrapper<PayMerchant>()
                 .eq(param.getMerchantNo() != null, PayMerchant::getMerchantNo, param.getMerchantNo())
@@ -148,29 +136,29 @@ public class PayMerchantServiceImpl extends ServiceImpl<PayMerchantMapper, PayMe
                 .eq(param.getStatus() != null, PayMerchant::getStatus, param.getStatus())
                 .like(Strings.isNotBlank(param.getMerchantName()), PayMerchant::getMerchantName, param.getMerchantName())
                 .orderByDesc(PayMerchant::getCreateTime))
-                .convert(payMerchant -> this.toVo(payMerchant, payDeviceMap));
+                .convert(this::toVo);
     }
 
-    private PayMerchantListVO toVo(PayMerchant payMerchant, Map<Long, PayDeviceChoiceVO> payDeviceMap) {
+    private PayMerchantListVO toVo(PayMerchant payMerchant) {
         PayMerchantListVO payMerchantListVO = BeanUtil.copy(payMerchant, PayMerchantListVO.class);
         if (payMerchantListVO == null) {
             return null;
         }
-        List<Long> payDeviceIdList = new ArrayList<>();
-        List<String> payDeviceNameList = new ArrayList<>();
-        String payDeviceIds = payMerchant.getPayDeviceIds();
-        if (Strings.isNotBlank(payDeviceIds)) {
-            String[] deviceIdArray = payDeviceIds.split(",");
-            for (String deviceId : deviceIdArray) {
-                PayDeviceChoiceVO payDeviceChoiceVO = payDeviceMap.get(Long.valueOf(deviceId));
-                if (payDeviceChoiceVO != null) {
-                    payDeviceIdList.add(payDeviceChoiceVO.getId());
-                    payDeviceNameList.add(payDeviceChoiceVO.getPayDeviceName());
-                }
-            }
+        //判断月更新日期是否为本月
+        if (!DateUtils.isThisMonth(payMerchant.getMouthUpdateDate())) {
+            //月已用额度归零
+            payMerchantListVO.setMouthPayAmount(BigDecimal.ZERO);
+        }
+        //判断日更新日期是否为今天
+        if (!DateUtils.isToday(payMerchant.getDayUpdateDate())) {
+            //日已用额度归零
+            payMerchantListVO.setDayPayAmount(BigDecimal.ZERO);
+        }
+        //判断周更新日期是否为本周
+        if (!DateUtils.isThisWeek(payMerchant.getMouthUpdateDate())) {
+            //周已用额度归零
+            payMerchantListVO.setWeakerPayAmount(BigDecimal.ZERO);
         }
-        payMerchantListVO.setPayDeviceIdList(payDeviceIdList);
-        payMerchantListVO.setPayDeviceNameList(payDeviceNameList);
         //密钥
         if (Strings.isNotBlank(payMerchant.getPayConfig())) {
             Map<String, String> payConfigMap = JsonUtil.toMap(payMerchant.getPayConfig(), Map.class, String.class);
@@ -181,6 +169,23 @@ public class PayMerchantServiceImpl extends ServiceImpl<PayMerchantMapper, PayMe
                 payMerchantListVO.setSecretKey(payConfigMap.get("apiKey"));
             }
         }
+        //支付渠道
+        payMerchantListVO.setPayWayName(PayWayEnum.getByPayWayId(payMerchantListVO.getPayWayId()));
+        //支付方式
+        String payDeviceIds = payMerchant.getPayDeviceIds();
+        if (Strings.isBlank(payDeviceIds)) {
+            return payMerchantListVO;
+        }
+        payMerchantListVO.setPayDeviceIdList(new ArrayList<>());
+        payMerchantListVO.setPayDeviceNameList(new ArrayList<>());
+        String[] deviceIdArray = payDeviceIds.split(",");
+        for (String deviceId : deviceIdArray) {
+            PayDeviceEnum payDeviceEnum = PayDeviceEnum.getPayDeviceEnum(Long.valueOf(deviceId));
+            if (payDeviceEnum != null) {
+                payMerchantListVO.getPayDeviceIdList().add(payDeviceEnum.getPayDeviceId());
+                payMerchantListVO.getPayDeviceNameList().add(payDeviceEnum.getPayDeviceName());
+            }
+        }
         return payMerchantListVO;
     }
 

+ 2 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserCardServiceImpl.java

@@ -14,6 +14,7 @@ import com.zanxiang.game.module.manage.pojo.vo.UserCardVO;
 import com.zanxiang.game.module.manage.service.IAgentService;
 import com.zanxiang.game.module.manage.service.IUserCardService;
 import com.zanxiang.game.module.manage.service.IUserService;
+import com.zanxiang.game.module.mybatis.entity.Agent;
 import com.zanxiang.game.module.mybatis.entity.UserCard;
 import com.zanxiang.game.module.mybatis.mapper.UserCardMapper;
 import com.zanxiang.module.util.bean.BeanUtil;
@@ -57,7 +58,7 @@ public class UserCardServiceImpl extends ServiceImpl<UserCardMapper, UserCard> i
         List<Long> agentIdList = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
         //管理员可见自然量数据
         if (SecurityUtil.isManager()) {
-            agentIdList.add(0L);
+            agentIdList.add(Agent.DEFAULT_AGENT);
         }
         //玩家条件处理
         Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), agentIdList, param.getUserName(),

+ 5 - 3
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserServiceImpl.java

@@ -78,8 +78,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         //渠道id列表
         List<Long> agentIdList = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
         //管理员可见自然量数据
-        if (SecurityUtil.isManager()) {
-            agentIdList.add(0L);
+        if (SecurityUtil.isManager() && Strings.isBlank(param.getAccountId())
+                && Strings.isBlank(param.getPitcherId()) && param.getChannelId() == null) {
+            agentIdList.add(Agent.DEFAULT_AGENT);
         }
         Map<Long, CpDTO> cpMap = cpService.cpMap();
         Map<Long, AgentDTO> agentMap = agentDTOList.stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
@@ -119,7 +120,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         AgentDTO agentDTO = agentMap.get(userListVO.getAgentId());
         if (agentDTO != null) {
             userListVO.setAgentName(agentDTO.getAgentName());
-            userListVO.setAccountId(agentDTO.getId());
+            userListVO.setAccountId(agentDTO.getAccountId());
             userListVO.setPitcherId(agentDTO.getCreateBy());
             userListVO.setPitcherName(agentDTO.getCreateByName());
             userListVO.setAccountType(agentDTO.getAccountType());
@@ -181,6 +182,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         GameDTO gameDTO = gameService.getById(user.getGameId());
         if (gameDTO != null) {
             userVO.setRegGame(gameDTO.getName());
+            userVO.setCategoryName(GameCategoryEnum.getNameByCategory(gameDTO.getCategory()));
         }
         //渠道
         Agent agent = agentService.getById(user.getAgentId());

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

@@ -42,16 +42,6 @@ public class Game implements Serializable {
      */
     private Long category;
 
-    /**
-     * H5游戏跳转地址
-     */
-    private String h5GameUrl;
-
-    /**
-     * H5游戏登录logo图片
-     */
-    private String h5LoginLogo;
-
     /**
      * 游戏是否投放
      */
@@ -111,4 +101,9 @@ public class Game implements Serializable {
      * 更新时间
      */
     private LocalDateTime updateTime;
+
+    /**
+     * H5游戏相关配置
+     */
+    private String h5GameConfig;
 }

+ 97 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameAppletShell.java

@@ -0,0 +1,97 @@
+package com.zanxiang.game.module.mybatis.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.*;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-06
+ * @description : 小游戏壳包控制
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+@Builder
+@TableName("t_game_applet_shell")
+public class GameAppletShell implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 游戏id
+     */
+    private Long gameId;
+
+    /**
+     * 是否在申诉
+     */
+    private Boolean isAppeal;
+
+    /**
+     * 线上版本号
+     */
+    private String proVersion;
+
+    /**
+     * 提审版本号
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private String arraignVersion;
+
+    /**
+     * 壳包控制类型, 0:关闭, 1:开启, 2:新用户开启, 老用户关闭, 3:角色等级控制开启
+     */
+    private Integer proControlType;
+
+    /**
+     * 壳包控制等级, 类型为3时, 必填
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private Long proControlLevel;
+
+    /**
+     * 壳跳出按钮开关
+     */
+    private Boolean isSkipSwitch;
+
+    /**
+     * 状态 0正常 1 不可用
+     */
+    private Integer status;
+
+    /**
+     * 0正常,1 删除
+     */
+    private Integer isDelete;
+
+    /**
+     * 创建人
+     */
+    private Long createBy;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新操作人
+     */
+    private Long updateBy;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+
+}

+ 0 - 5
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameExt.java

@@ -69,11 +69,6 @@ public class GameExt implements Serializable {
      */
     private Boolean adCallBackSwitch;
 
-    /**
-     * 小游戏壳包控制开关
-     */
-    private Boolean appletShellSwitch;
-
     /**
      * 客服手机
      */

+ 14 - 4
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/PayMerchant.java

@@ -45,14 +45,14 @@ public class PayMerchant implements Serializable {
     private String merchantName;
 
     /**
-     * 支付渠道id
+     * 商户主体
      */
-    private Long payWayId;
+    private String merchantCompany;
 
     /**
-     * 支付渠道名称
+     * 支付渠道id
      */
-    private String payWayName;
+    private Long payWayId;
 
     /**
      * 商户号登录账号
@@ -145,11 +145,21 @@ public class PayMerchant implements Serializable {
     @TableLogic
     private Integer isDelete;
 
+    /**
+     * 创建者id
+     */
+    private Long createById;
+
     /**
      * 创建时间
      */
     private LocalDateTime createTime;
 
+    /**
+     * 更新者id
+     */
+    private Long updateById;
+
     /**
      * 更新时间
      */

+ 12 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/mapper/GameAppletShellMapper.java

@@ -0,0 +1,12 @@
+package com.zanxiang.game.module.mybatis.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zanxiang.game.module.mybatis.entity.GameAppletShell;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-06
+ * @description : 壳包控制
+ */
+public interface GameAppletShellMapper extends BaseMapper<GameAppletShell> {
+}

+ 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服务启动成功002 ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象SDK服务启动成功003 ( ´・・)ノ(._.`) \n" +
                 " ___________ _   __\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "\\ `--.| | | | |/ / \n" +

+ 12 - 7
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/controller/InitController.java

@@ -4,16 +4,15 @@ import com.zanxiang.game.module.sdk.annotation.UnSignCheck;
 import com.zanxiang.game.module.sdk.pojo.param.UserData;
 import com.zanxiang.game.module.sdk.pojo.vo.GameInitVO;
 import com.zanxiang.game.module.sdk.service.IGameAppletService;
+import com.zanxiang.game.module.sdk.service.IGameAppletShellService;
 import com.zanxiang.module.util.pojo.ResultVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author : lingfeng
@@ -22,12 +21,16 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @Api(tags = "sdk初始化接口")
 @RestController
+@Slf4j
 @RequestMapping(value = "/api/init")
 public class InitController {
 
     @Autowired
     private IGameAppletService gameAppletService;
 
+    @Autowired
+    private IGameAppletShellService gameAppletShellService;
+
     @UnSignCheck
     @ApiOperation(value = "(H5和微信小游戏)SDK参数初始化")
     @PostMapping("/applet")
@@ -38,9 +41,11 @@ public class InitController {
 
     @UnSignCheck
     @ApiOperation(value = "微信小游戏壳包控制开关")
-    @PostMapping("/shell/switch")
+    @GetMapping("/shell/switch")
     @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)})
-    public ResultVO<Boolean> appletShellSwitch(@RequestParam String appId) {
-        return ResultVO.ok(gameAppletService.appletShellSwitch(appId));
+    public ResultVO<Integer> getShellSwitch(@RequestParam String appId, @RequestParam String version) {
+        Integer shellSwitch = gameAppletShellService.getShellSwitch(appId, version);
+        log.error("客保控制开关返回值, shellSwitch : {}", shellSwitch);
+        return ResultVO.ok(shellSwitch);
     }
 }

+ 40 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/enums/ShellSwitchEnum.java

@@ -0,0 +1,40 @@
+package com.zanxiang.game.module.sdk.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-06
+ * @description : 壳包控制枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum ShellSwitchEnum {
+
+    /**
+     * 开启壳包
+     */
+    SHELL_SWITCH_OPEN(1, "开启壳包"),
+
+    /**
+     * 关闭壳包
+     */
+    SHELL_SWITCH_CLOSE(2, "关闭壳包"),
+
+    /**
+     * 申诉状态
+     */
+    SHELL_SWITCH_APPEAL(3, "申诉中");
+
+    /**
+     * 壳包控制
+     */
+    private Integer shellSwitch;
+
+    /**
+     * 描述
+     */
+    private String name;
+
+}

+ 57 - 4
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/result/CardCheckResult.java

@@ -13,20 +13,64 @@ import java.util.Objects;
 public class CardCheckResult {
 
     /**
-     * 消息
+     * 返回码
      */
-    private String message;
+    private String code;
 
     /**
-     * 返回码
+     * 消息
      */
-    private String code;
+    private String message;
 
     /**
      * 结果
      */
     private String data;
 
+    /**
+     * 结果数据
+     */
+    private ResultBean result;
+
+    @Data
+    public static class ResultBean {
+
+        /**
+         * 名字
+         */
+        private String name;
+
+        /**
+         * 身份证号
+         */
+        private String idcard;
+
+        /**
+         * 核验结果状态码,1 一致;2 不一致;3 无记录
+         */
+        private String res;
+
+        /**
+         * 核验结果状态描述
+         */
+        private String description;
+
+        /**
+         * 性别
+         */
+        private String sex;
+
+        /**
+         * 生日
+         */
+        private String birthday;
+
+        /**
+         * 地址
+         */
+        private String address;
+    }
+
     public boolean isSuccess() {
         return Objects.equals(this.code, "0000");
     }
@@ -34,4 +78,13 @@ public class CardCheckResult {
     public boolean isPast() {
         return Objects.equals(this.data, "一致");
     }
+
+    public boolean isFail() {
+        return !Objects.equals(this.code, "0");
+    }
+
+    public boolean past() {
+        return this.result != null && Objects.equals(this.result.getRes(), "1");
+    }
+
 }

+ 4 - 9
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/vo/GameInitVO.java

@@ -1,5 +1,6 @@
 package com.zanxiang.game.module.sdk.pojo.vo;
 
+import com.zanxiang.game.module.base.pojo.dto.H5GameConfigDTO;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
@@ -42,14 +43,8 @@ public class GameInitVO {
     private Boolean isPut;
 
     /**
-     * H5游戏跳转地址
+     * H5游戏配置
      */
-    @ApiModelProperty(notes = "H5游戏跳转地址")
-    private String h5GameUrl;
-
-    /**
-     * H5游戏登录logo图片
-     */
-    @ApiModelProperty(notes = "H5游戏跳转地址")
-    private String h5LoginLogo;
+    @ApiModelProperty(notes = "H5游戏配置")
+    private H5GameConfigDTO h5GameConfigDTO;
 }

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

@@ -82,4 +82,10 @@ public class UserLoginVO {
      */
     @ApiModelProperty(notes = "是否需要强制实名, true : 是, false : 否")
     private Boolean checkSwitch;
+
+    /**
+     * 小游戏壳包控制开关
+     */
+    @ApiModelProperty(notes = "小游戏壳包控制开关")
+    private Integer appletShellSwitch;
 }

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

@@ -62,12 +62,4 @@ public interface IGameAppletService extends IService<GameApplet> {
      * @return {@link GameInitVO}
      */
     GameInitVO h5AndAppletInit(UserData userData);
-
-    /**
-     * 小游戏壳包控制开关
-     *
-     * @param appId 应用程序id
-     * @return boolean
-     */
-    boolean appletShellSwitch(String appId);
 }

+ 31 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/IGameAppletShellService.java

@@ -0,0 +1,31 @@
+package com.zanxiang.game.module.sdk.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.game.module.mybatis.entity.GameAppletShell;
+import com.zanxiang.game.module.mybatis.entity.User;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-06
+ * @description : 壳包控制
+ */
+public interface IGameAppletShellService extends IService<GameAppletShell> {
+
+    /**
+     * 获取壳开关
+     *
+     * @param appId   应用程序id
+     * @param version 版本
+     * @return {@link Integer}
+     */
+    Integer getShellSwitch(String appId, String version);
+
+    /**
+     * 获取用户壳开关
+     *
+     * @param user     用户
+     * @param register 注册
+     * @return {@link Integer}
+     */
+    Integer getUserShellSwitch(User user, boolean register);
+}

+ 35 - 9
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/AgentServiceImpl.java

@@ -1,5 +1,6 @@
 package com.zanxiang.game.module.sdk.service.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@@ -44,11 +45,11 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 
     @Override
     public void userAgentUpdate(User user, String channel) {
-        //渠道为空
+        log.error("用户登录接收到的渠道参数 userId : {}, channel : {}", user.getId(), channel);
+        //渠道参数为空
         if (Strings.isBlank(channel)) {
             return;
         }
-        log.error("接收到的渠道参数 user : {}, channel : {}", JsonUtil.toString(user), channel);
         //判断用户是否超过30天未登录
         List<UserLoginLog> userLoginLogList = userLoginLogService.list(new LambdaQueryWrapper<UserLoginLog>()
                 .eq(UserLoginLog::getUserId, user.getId())
@@ -66,15 +67,14 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         //30天未登录, 更新渠道
         Map<String, String> urlParamMap = this.channelTransform(channel);
         //查询渠道
-        String state = urlParamMap.get("state");
-        Agent agent = super.getOne(new LambdaQueryWrapper<Agent>()
-                .eq(Agent::getAgentKey, state));
+        Agent agent = this.getAgentByKey(urlParamMap);
         if (agent == null) {
             return;
         }
         //更新用户信息
         userService.update(new LambdaUpdateWrapper<User>()
                 .set(User::getAgentId, agent.getId())
+                .set(User::getChannel, channel)
                 .set(User::getUpdateTime, LocalDateTime.now())
                 .eq(User::getId, user.getId()));
         //回传用户信息
@@ -83,6 +83,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 
     @Override
     public Tuple2<Long, Map<String, String>> getUserAgentId(String channel, Long shareUserId) {
+        log.error("用户注册接收到的渠道参数 channel : {}", channel);
         if (Strings.isBlank(channel) && shareUserId != null) {
             User user = userService.getById(shareUserId);
             return Tuples.of(user.getAgentId(), Collections.emptyMap());
@@ -90,20 +91,35 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         if (Strings.isBlank(channel)) {
             return Tuples.of(0L, Collections.emptyMap());
         }
-        log.error("接收到的渠道参数 channel : {}", channel);
         //数据解析
         Map<String, String> urlParamMap = this.channelTransform(channel);
         //查询渠道
-        String state = urlParamMap.get("state");
-        Agent agent = super.getOne(new LambdaQueryWrapper<Agent>()
-                .eq(Agent::getAgentKey, state));
+        Agent agent = this.getAgentByKey(urlParamMap);
         if (agent == null) {
             return Tuples.of(0L, Collections.emptyMap());
         }
         return Tuples.of(agent.getId(), urlParamMap);
     }
 
+    private Agent getAgentByKey(Map<String, String> urlParamMap) {
+        //参数不存在
+        if (CollectionUtils.isEmpty(urlParamMap)) {
+            return null;
+        }
+        //判断渠道标识
+        String state = urlParamMap.get("agentKey");
+        if (Strings.isBlank(state)) {
+            state = urlParamMap.get("state");
+        }
+        return super.getOne(new LambdaQueryWrapper<Agent>().eq(Agent::getAgentKey, state));
+    }
+
     private Map<String, String> channelTransform(String channel) {
+        //判断是否是json, 是就直接转成map
+        if (this.isJsonStr(channel)) {
+            return JsonUtil.toMap(channel, Map.class, String.class);
+        }
+        //非json, 自己解析
         Map<String, String> paramMap = new HashMap<>(11);
         String[] params = channel.split("&");
         for (String param : params) {
@@ -116,4 +132,14 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         }
         return paramMap;
     }
+
+    private boolean isJsonStr(String str) {
+        boolean result = false;
+        try {
+            JSON.parse(str);
+            result = true;
+        } catch (Exception ignored) {
+        }
+        return result;
+    }
 }

+ 9 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/CallBackServiceImpl.java

@@ -14,6 +14,7 @@ import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.mybatis.entity.*;
 import com.zanxiang.game.module.sdk.pojo.dto.PlatformOrderDTO;
 import com.zanxiang.game.module.sdk.service.*;
+import com.zanxiang.module.util.JsonUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -75,10 +76,12 @@ public class CallBackServiceImpl implements ICallBackService {
         //查询小游戏信息或者H5游戏相关公众号信息
         GameApplet gameApplet = gameAppletService.getOne(new LambdaQueryWrapper<GameApplet>()
                 .eq(GameApplet::getGameId, user.getGameId()));
+        log.error("用户注册回传, userId : {}", user.getId());
         try {
             //腾讯回传
             if (Objects.equals(agent.getAccountType(), Agent.ACCOUNT_TYPE_TENCENT)) {
                 TencentUserDTO tencentUserDTO = this.transform(user, agent, gameApplet);
+                log.error("用户注册 --> 腾讯回传提交, tencentUserDTO : {}", JsonUtil.toString(tencentUserDTO));
                 gameBackTencentRpc.backUser(tencentUserDTO);
             }
             //头条回传
@@ -87,6 +90,7 @@ public class CallBackServiceImpl implements ICallBackService {
                 //判断是微信小游戏
                 if (Objects.equals(game.getCategory(), GameCategoryEnum.CATEGORY_WX_APPLET.getId())) {
                     UserActiveReportRpcDTO activeReportRpcDTO = this.transform(user, agent, gameApplet, urlParamMap);
+                    log.error("用户注册 --> 头条回传提交, activeReportRpcDTO : {}", JsonUtil.toString(activeReportRpcDTO));
                     wechatMiniGameDataReportRpc.userActiveReport(activeReportRpcDTO);
                 }
             }
@@ -112,10 +116,12 @@ public class CallBackServiceImpl implements ICallBackService {
         //查询小游戏信息或者H5游戏相关公众号信息
         GameApplet gameApplet = gameAppletService.getOne(new LambdaQueryWrapper<GameApplet>()
                 .eq(GameApplet::getGameId, user.getGameId()));
+        log.error("用户订单回传, orderId : {}", platformOrderDTO.getOrderId());
         try {
             //腾讯回传
             if (Objects.equals(agent.getAccountType(), Agent.ACCOUNT_TYPE_TENCENT)) {
                 TencentOrderDTO tencentOrderDTO = this.transform(platformOrderDTO, user, agent, gameApplet);
+                log.error("用户下单 --> 腾讯回传提交, tencentOrderDTO : {}", JsonUtil.toString(tencentOrderDTO));
                 gameBackTencentRpc.backOrder(tencentOrderDTO);
             }
             //头条回传
@@ -124,6 +130,7 @@ public class CallBackServiceImpl implements ICallBackService {
                 Game game = gameService.getById(platformOrderDTO.getGameId());
                 if (Objects.equals(game.getCategory(), GameCategoryEnum.CATEGORY_WX_APPLET.getId())) {
                     OrderReportRpcDTO orderReportRpcDTO = this.transform(platformOrderDTO, user.getOpenId(), agent, gameApplet);
+                    log.error("用户下单 --> 头条回传提交, orderReportRpcDTO : {}", JsonUtil.toString(orderReportRpcDTO));
                     wechatMiniGameDataReportRpc.orderReport(orderReportRpcDTO);
                 }
             }
@@ -140,6 +147,7 @@ public class CallBackServiceImpl implements ICallBackService {
                 .channel(agent.getAgentKey())
                 .wechatOpenid(user.getOpenId())
                 .wechatAppId(gameApplet == null ? null : gameApplet.getAppId())
+                .userActionSetId(agent.getUserActionSetId())
                 .build();
     }
 
@@ -178,6 +186,7 @@ public class CallBackServiceImpl implements ICallBackService {
                 .wechatAppId(gameApplet == null ? null : gameApplet.getAppId())
                 .orderStatus(platformOrderDTO.getStatus())
                 .payTime(platformOrderDTO.getPayTime())
+                .userActionSetId(agent.getUserActionSetId())
                 .build();
     }
 

+ 4 - 11
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GameAppletServiceImpl.java

@@ -2,6 +2,7 @@ package com.zanxiang.game.module.sdk.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.game.module.base.pojo.dto.H5GameConfigDTO;
 import com.zanxiang.game.module.base.pojo.enums.HttpStatusEnum;
 import com.zanxiang.game.module.mybatis.entity.Game;
 import com.zanxiang.game.module.mybatis.entity.GameApplet;
@@ -194,6 +195,8 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
         if (game == null) {
             throw new BaseException("参数错误, 游戏信息不存在");
         }
+        //H5游戏配置
+        String h5GameConfig = game.getH5GameConfig();
         //游戏应用信息
         GameApplet gameApplet = super.getOne(new LambdaQueryWrapper<GameApplet>()
                 .eq(GameApplet::getGameId, userData.getGameId()));
@@ -204,17 +207,7 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
                 .appKey(gameExt == null ? null : gameExt.getAppKey())
                 .gameName(game.getName())
                 .isPut(game.getIsPut())
-                .h5GameUrl(game.getH5GameUrl())
-                .h5LoginLogo(game.getH5LoginLogo())
+                .h5GameConfigDTO(Strings.isBlank(h5GameConfig) ? null : JsonUtil.toObj(h5GameConfig, H5GameConfigDTO.class))
                 .build();
     }
-
-    @Override
-    public boolean appletShellSwitch(String appId) {
-        GameExt gameExt = gameExtService.getByGameAppId(appId);
-        if (gameExt == null || gameExt.getAppletShellSwitch() == null) {
-            return false;
-        }
-        return gameExt.getAppletShellSwitch();
-    }
 }

+ 117 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GameAppletShellServiceImpl.java

@@ -0,0 +1,117 @@
+package com.zanxiang.game.module.sdk.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.game.module.base.pojo.enums.ShellControlEnum;
+import com.zanxiang.game.module.mybatis.entity.GameAppletShell;
+import com.zanxiang.game.module.mybatis.entity.GameExt;
+import com.zanxiang.game.module.mybatis.entity.GameUserRole;
+import com.zanxiang.game.module.mybatis.entity.User;
+import com.zanxiang.game.module.mybatis.mapper.GameAppletShellMapper;
+import com.zanxiang.game.module.sdk.enums.ShellSwitchEnum;
+import com.zanxiang.game.module.sdk.service.IGameAppletShellService;
+import com.zanxiang.game.module.sdk.service.IGameExtService;
+import com.zanxiang.game.module.sdk.service.IGameUserRoleService;
+import com.zanxiang.module.util.JsonUtil;
+import com.zanxiang.module.util.exception.BaseException;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Comparator;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-06
+ * @description : 壳包控制
+ */
+@Slf4j
+@Service
+public class GameAppletShellServiceImpl extends ServiceImpl<GameAppletShellMapper, GameAppletShell> implements IGameAppletShellService {
+
+    @Autowired
+    private IGameExtService gameExtService;
+
+    @Autowired
+    private IGameUserRoleService gameUserRoleService;
+
+    @Override
+    public Integer getShellSwitch(String appId, String version) {
+        log.error("壳包接口收到请求, appId : {}, version : {}", appId, version);
+        GameExt gameExt = gameExtService.getByGameAppId(appId);
+        if (gameExt == null) {
+            throw new BaseException("游戏参数设置错误, 游戏信息不存在");
+        }
+        GameAppletShell gameAppletShell = super.getOne(new LambdaQueryWrapper<GameAppletShell>()
+                .eq(GameAppletShell::getGameId, gameExt.getGameId()));
+        if (gameAppletShell == null) {
+            throw new BaseException("游戏参数设置错误, 游戏设置信息不存在");
+        }
+        //版本为提审版本
+        if (Objects.equals(gameAppletShell.getArraignVersion(), version)) {
+            return ShellSwitchEnum.SHELL_SWITCH_OPEN.getShellSwitch();
+        }
+        //线上版本
+        if (Objects.equals(gameAppletShell.getProVersion(), version)) {
+            //申诉中, 返回申诉状态
+            if (Objects.equals(gameAppletShell.getIsAppeal(), Boolean.TRUE)) {
+                return ShellSwitchEnum.SHELL_SWITCH_APPEAL.getShellSwitch();
+            }
+            //开启
+            if (Objects.equals(gameAppletShell.getProControlType(), ShellControlEnum.SHELL_CONTROL_OPEN.getShellControl())) {
+                return ShellSwitchEnum.SHELL_SWITCH_OPEN.getShellSwitch();
+            }
+            //返回关闭
+            return ShellSwitchEnum.SHELL_SWITCH_CLOSE.getShellSwitch();
+        }
+        log.error("版本信息不存在, 默认进壳包, appId : {}, version : {}", appId, version);
+        return ShellSwitchEnum.SHELL_SWITCH_OPEN.getShellSwitch();
+    }
+
+    @Override
+    public Integer getUserShellSwitch(User user, boolean register) {
+        GameAppletShell gameAppletShell = super.getOne(new LambdaQueryWrapper<GameAppletShell>()
+                .eq(GameAppletShell::getGameId, user.getGameId()));
+        //未设置, 统一返回关闭
+        if (gameAppletShell == null) {
+            return ShellSwitchEnum.SHELL_SWITCH_CLOSE.getShellSwitch();
+        }
+        //控制类型
+        Integer proControlType = gameAppletShell.getProControlType();
+        //关闭
+        if (Objects.equals(proControlType, ShellControlEnum.SHELL_CONTROL_CLOSE.getShellControl())) {
+            return ShellSwitchEnum.SHELL_SWITCH_CLOSE.getShellSwitch();
+        }
+        //开启
+        if (Objects.equals(proControlType, ShellControlEnum.SHELL_CONTROL_OPEN.getShellControl())) {
+            return ShellSwitchEnum.SHELL_SWITCH_OPEN.getShellSwitch();
+        }
+        //新用户开启
+        if (Objects.equals(proControlType, ShellControlEnum.SHELL_CONTROL_NEW_USER_OPEN.getShellControl())) {
+            return register ? ShellSwitchEnum.SHELL_SWITCH_OPEN.getShellSwitch() : ShellSwitchEnum.SHELL_SWITCH_CLOSE.getShellSwitch();
+        }
+        //等级控制开启
+        if (Objects.equals(proControlType, ShellControlEnum.SHELL_CONTROL_LOW_LEVEL_OPEN.getShellControl())) {
+            //查询用户角色等级
+            List<GameUserRole> gameUserRoleList = gameUserRoleService.list(new LambdaQueryWrapper<GameUserRole>()
+                    .eq(GameUserRole::getUserId, user.getId())
+                    .eq(GameUserRole::getGameId, user.getGameId()));
+            //不存在角色的新用户, 开启
+            if (CollectionUtils.isEmpty(gameUserRoleList)) {
+                return ShellSwitchEnum.SHELL_SWITCH_OPEN.getShellSwitch();
+            }
+            //获取用户等级最好的角色
+            GameUserRole gameUserRole = gameUserRoleList.stream().max(Comparator.comparing(GameUserRole::getRoleLevel)).orElse(null);
+            //角色不存在, 或者等级小于等于控制等级
+            if (gameUserRole == null || gameUserRole.getRoleLevel() <= gameAppletShell.getProControlLevel()) {
+                return ShellSwitchEnum.SHELL_SWITCH_OPEN.getShellSwitch();
+            }
+            return ShellSwitchEnum.SHELL_SWITCH_CLOSE.getShellSwitch();
+        }
+        log.error("壳包控制配置不存在, 默认进壳包, userId : {}, gameAppletShell : {}", user.getId(), JsonUtil.toString(gameAppletShell));
+        return ShellSwitchEnum.SHELL_SWITCH_OPEN.getShellSwitch();
+    }
+}

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

@@ -84,6 +84,9 @@ public class LoginServiceImpl implements IRegisterLoginService {
     @Autowired
     private IAgentService agentService;
 
+    @Autowired
+    private IGameAppletShellService gameAppletShellService;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public ResultVO<UserLoginVO> loginWxCode(LoginVxCodeParam param, UserData userData) {
@@ -119,12 +122,18 @@ public class LoginServiceImpl implements IRegisterLoginService {
             //渠道更新和回传判断
             agentService.userAgentUpdate(user, userData.getChannel());
             //返回登录信息
-            return ResultVO.ok(this.createUserLoginVO(user, userData));
+            UserLoginVO userLoginVO = this.createUserLoginVO(user, userData);
+            userLoginVO.setAppletShellSwitch(gameAppletShellService.getUserShellSwitch(user, Boolean.FALSE));
+            log.error("返回用户登录信息, userLoginVO : {}", JsonUtil.toString(userLoginVO));
+            return ResultVO.ok(userLoginVO);
         }
         //用户注册
         user = userCreateSave(userData, openId, null, null, openId, sessionKey, param.getShareUserId());
         //返回登录信息
-        return ResultVO.ok(this.createUserLoginVO(user, userData));
+        UserLoginVO userLoginVO = this.createUserLoginVO(user, userData);
+        userLoginVO.setAppletShellSwitch(gameAppletShellService.getUserShellSwitch(user, Boolean.TRUE));
+        log.error("返回用户登录信息, userLoginVO : {}", JsonUtil.toString(userLoginVO));
+        return ResultVO.ok(userLoginVO);
     }
 
     @Override

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

@@ -180,7 +180,7 @@ public class OrderPayServiceImpl implements IOrderPayService {
             paramMap.put("payH5Url", this.customH5Url);
             paramMap.put("openId", user.getOpenId());
             paramMap.put("description", "购买" + product.getAmount() + "元档充值");
-            paramMap.put("serverUrl", this.serverUrl.contains("84game") ? this.serverUrl + "/sdk" : this.serverUrl + "/api/sdk");
+            paramMap.put("serverUrl", this.serverUrl.contains("test") ? this.serverUrl + "/api/sdk" : this.serverUrl + "/sdk");
             log.error("下单参数返回, paramMap : {}", JsonUtil.toString(paramMap));
             return paramMap;
         }

+ 46 - 6
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/UserCardServiceImpl.java

@@ -21,8 +21,12 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
 import org.springframework.web.client.RestTemplate;
 
 import java.text.SimpleDateFormat;
@@ -50,8 +54,11 @@ public class UserCardServiceImpl extends ServiceImpl<UserCardMapper, UserCard> i
     @Autowired
     private RestTemplate restTemplate;
 
-    @Value("${authentication.appCode}")
-    private String appCode;
+    /**
+     * 服务器域名
+     */
+    @Value("${server.domain}")
+    private String serverUrl;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -78,7 +85,12 @@ public class UserCardServiceImpl extends ServiceImpl<UserCardMapper, UserCard> i
             return ResultVO.fail(HttpStatusEnum.CARD_ID_ERROR.getMsg());
         }
         //阿里实名认证
-        boolean authenticationCheck = this.authenticationCheck(cardName, cardId);
+        boolean authenticationCheck;
+        if (this.serverUrl.contains("test")) {
+            authenticationCheck = this.authenticationCheck(cardName, cardId);
+        } else {
+            authenticationCheck = this.userCardCheck(cardName, cardId);
+        }
         //实名认证失败
         if (!authenticationCheck) {
             return ResultVO.fail(HttpStatusEnum.AUTHENTICATION_FAIL.getMsg());
@@ -162,9 +174,10 @@ public class UserCardServiceImpl extends ServiceImpl<UserCardMapper, UserCard> i
 
     private boolean authenticationCheck(String cardName, String cardId) {
         String host = "https://dskj.market.alicloudapi.com/platform/check/verified";
+        String appCode = "f395b1587fc04a49a975f908660fb1e9";
         String url = host + "?certCode=" + cardId + "&realName=" + cardName;
         HttpHeaders headers = new HttpHeaders();
-        headers.set("Authorization", "APPCODE " + this.appCode);
+        headers.set("Authorization", "APPCODE " + appCode);
         headers.set("X-Ca-Nonce", UUID.randomUUID().toString());
         HttpEntity httpEntity = new HttpEntity<>(headers);
         CardCheckResult result;
@@ -172,13 +185,40 @@ public class UserCardServiceImpl extends ServiceImpl<UserCardMapper, UserCard> i
             String resultStr = restTemplate.postForObject(url, httpEntity, String.class);
             result = JsonUtil.toObj(resultStr, CardCheckResult.class);
         } catch (Exception e) {
-            log.error("请求阿里实名认证接口异常, cardName : {}, cardId : {}, e : {}", cardName, cardId, e.getMessage());
+            log.error("请求阿里实名认证接口异常(OLD), cardName : {}, cardId : {}, e : {}", cardName, cardId, e.getMessage());
             throw new BaseException("请求阿里实名认证接口异常");
         }
         if (result == null || !result.isSuccess()) {
-            log.error("请求阿里实名认证接口返回值为空, cardName : {}, cardId : {}", cardName, cardId);
+            log.error("请求阿里实名认证接口返回值为空(OLD), cardName : {}, cardId : {}, result : {}", cardName, cardId, JsonUtil.toString(result));
             throw new BaseException("实名认证失败");
         }
         return result.isPast();
     }
+
+    private boolean userCardCheck(String cardName, String cardId) {
+        String url = "https://eid.shumaidata.com/eid/check";
+        String appCode = "f395b1587fc04a49a975f908660fb1e9";
+        //请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.add("Authorization", "APPCODE " + appCode);
+        MultiValueMap<String, String> requestParams = new LinkedMultiValueMap<>();
+        requestParams.add("name", cardName);
+        requestParams.add("idcard", cardId);
+        CardCheckResult result;
+        try {
+            ResponseEntity<String> responseEntity = restTemplate.exchange(url, HttpMethod.POST,
+                    new HttpEntity<>(requestParams, headers), String.class);
+            String body = responseEntity.getBody();
+            result = JsonUtil.toObj(body, CardCheckResult.class);
+        } catch (Exception e) {
+            log.error("请求阿里实名认证接口异常(NEW), cardName : {}, cardId : {}, e : {}", cardName, cardId, e.getMessage());
+            throw new BaseException("请求阿里实名认证接口异常");
+        }
+        if (result == null || result.isFail()) {
+            log.error("请求阿里实名认证接口返回值为空(NEW),cardName : {},cardId : {}, result : {}", cardName, cardId, JsonUtil.toString(result));
+            throw new BaseException("实名认证失败");
+        }
+        log.error("实名认证结果, result : {}", JsonUtil.toString(result));
+        return result.past();
+    }
 }

+ 3 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/UserServiceImpl.java

@@ -146,7 +146,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
             return ResultVO.fail(HttpStatusEnum.PHONE_IS_BIND.getMsg());
         }
         //校验手机号是否已经绑定了其他账号
-        int count = super.count(new LambdaQueryWrapper<User>().eq(User::getMobile, mobile));
+        int count = super.count(new LambdaQueryWrapper<User>()
+                .eq(User::getGameId, userData.getGameId())
+                .eq(User::getMobile, mobile));
         if (count > 0) {
             return ResultVO.fail(HttpStatusEnum.PHONE_BIND_TOO_MUCH.getMsg());
         }

+ 9 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/UserTokenServiceImpl.java

@@ -98,10 +98,19 @@ public class UserTokenServiceImpl extends ServiceImpl<UserTokenMapper, UserToken
 
     @Override
     public Boolean userTokenExpireTimeCheck(UserData userData) {
+        log.error("缓存token验证请求 userData : {}", JsonUtil.toString(userData));
         //判断是否存在用户id或者token是否存在
         if (userData.getUserId() == null || Strings.isBlank(userData.getToken())) {
             return Boolean.FALSE;
         }
+        //判断token在数据库是否存在
+        UserToken userToken = super.getOne(new LambdaQueryWrapper<UserToken>()
+                .eq(UserToken::getToken, userData.getToken())
+                .eq(UserToken::getDeviceType, userData.getDeviceType()));
+        //token已经更新, 返回失效
+        if (userToken == null) {
+            return Boolean.FALSE;
+        }
         //判断是否ip封禁
         if (ipBanService.checkIpBan(userData.getIp())) {
             return Boolean.FALSE;

+ 0 - 2
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/pay/AliPayService.java

@@ -133,7 +133,6 @@ public class AliPayService extends PayBaseService {
 
     @Override
     public String notify(HttpServletRequest request, HttpServletResponse response) {
-        log.error("支付宝异步回调 -------start----->");
         //解密回调参数
         Map<String, String> params = new HashMap<>(26);
         Enumeration<String> parameterNames = request.getParameterNames();
@@ -174,7 +173,6 @@ public class AliPayService extends PayBaseService {
                     .eq(Order::getOrderId, orderNo));
         }
         //返回消息接收成功
-        log.error("支付宝异步回调 -------end----->");
         return HttpStatusEnum.SUCCESS.getMsg();
     }
 

+ 1 - 13
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/pay/WxPayService.java

@@ -144,10 +144,7 @@ public class WxPayService extends PayBaseService {
         String requestStr = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
         // 解析xml成map
         Map<String, String> packageParams = XmlUtil.xmlToMap(requestStr);
-
-        log.error("微信支付回调参数, packageParams : {}", JsonUtil.toString(packageParams));
-
-
+        log.error("微信支付回调参数, packageParams : {}, config : {}", JsonUtil.toString(packageParams), JsonUtil.toString(config));
         //获取订单信息
         String attachStr = packageParams.get("attach");
         ProductPayAttachParamDTO attachBO = JsonUtil.toObj(attachStr, ProductPayAttachParamDTO.class);
@@ -159,11 +156,6 @@ public class WxPayService extends PayBaseService {
             return null;
         }
         configInit(gamePayWayService.getById(attachBO.getGamePayWayId()));
-
-
-        log.error("微信支付回调参数, config : {}", JsonUtil.toString(config));
-
-
         // 账号信息
         String key = config.getApiKey();
         // 判断签名是否正确
@@ -250,10 +242,6 @@ public class WxPayService extends PayBaseService {
             }
             //下单
             Map<String, String> successMap = this.unifiedOrder(product, WX_PAY_JSAPI, openId);
-
-
-            log.error("-------------- 1111 --------------> ");
-
             // 支付参数
             String prepayId = successMap.get("prepay_id");
             // 随机字符串

+ 3 - 3
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/util/RegisterUtil.java

@@ -19,12 +19,12 @@ public class RegisterUtil {
     /**
      * 用户名最小长度
      */
-    private static final int USER_NAME_LENGTH_MIN = 4;
+    private static final int USER_NAME_LENGTH_MIN = 8;
 
     /**
      * 用户名最大长度
      */
-    private static final int USER_NAME_LENGTH_MAX = 32;
+    private static final int USER_NAME_LENGTH_MAX = 16;
 
     /**
      * 密码最小长度
@@ -34,7 +34,7 @@ public class RegisterUtil {
     /**
      * 密码最大长度
      */
-    private static final int PASSWORD_LENGTH_MAX = 32;
+    private static final int PASSWORD_LENGTH_MAX = 24;
 
     /**
      * 用户名合规检测