Sfoglia il codice sorgente

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

root 1 anno fa
parent
commit
26fbd86fcd
13 ha cambiato i file con 591 aggiunte e 12 eliminazioni
  1. 6 6
      game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/service/impl/GameBackPolicyServiceImpl.java
  2. 12 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/RoleRechargeRankingDTO.java
  3. 5 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/PlayerRoleDataVO.java
  4. 9 2
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/PlayerDataServiceImpl.java
  5. 23 4
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/RoleManageServiceImpl.java
  6. 55 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/GameVipController.java
  7. 60 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameVipAddParam.java
  8. 38 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameVipListParam.java
  9. 104 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameVipListVO.java
  10. 26 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameVipService.java
  11. 160 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameVipServiceImpl.java
  12. 86 0
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameVip.java
  13. 7 0
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/mapper/GameVipMapper.java

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

@@ -113,10 +113,10 @@ public class GameBackPolicyServiceImpl extends ServiceImpl<GameBackPolicyMapper,
                 .markUpOrderMinMoneyType(dto.getMarkUpOrderMinMoneyType())
                 .markUpOrderMinMoneyRate(dto.getMarkUpOrderMinMoneyRate())
                 .markUpOrderMaxMoney(dto.getMarkUpOrderMaxMoney() == null ? null : NumberUtil.multiply100(dto.getMarkUpOrderMaxMoney()).longValue())
-                .markUpOrderMaxMoneyType(dto.getFirstMaxMoneyType())
+                .markUpOrderMaxMoneyType(dto.getMarkUpOrderMaxMoneyType())
                 .markUpOrderMaxMoneyRate(dto.getMarkUpOrderMaxMoneyRate())
-                .markUpOrderOtherMoneyType(dto.getFirstOtherMoneyType())
-                .markUpOrderOtherMoneyRate(dto.getMarkUpOrderMaxMoneyRate())
+                .markUpOrderOtherMoneyType(dto.getMarkUpOrderOtherMoneyType())
+                .markUpOrderOtherMoneyRate(dto.getMarkUpOrderOtherMoneyRate())
                 .markUpDownLevel(downLevelToString(dto.getMarkUpDownLevel()))
                 .markUpBackCountOfUser(dto.getMarkUpBackCountOfUser())
                 .build();
@@ -163,10 +163,10 @@ public class GameBackPolicyServiceImpl extends ServiceImpl<GameBackPolicyMapper,
                 .markUpOrderMinMoneyType(dto.getMarkUpOrderMinMoneyType())
                 .markUpOrderMinMoneyRate(dto.getMarkUpOrderMinMoneyRate())
                 .markUpOrderMaxMoney(dto.getMarkUpOrderMaxMoney() == null ? null : NumberUtil.multiply100(dto.getMarkUpOrderMaxMoney()).longValue())
-                .markUpOrderMaxMoneyType(dto.getFirstMaxMoneyType())
+                .markUpOrderMaxMoneyType(dto.getMarkUpOrderMaxMoneyType())
                 .markUpOrderMaxMoneyRate(dto.getMarkUpOrderMaxMoneyRate())
-                .markUpOrderOtherMoneyType(dto.getFirstOtherMoneyType())
-                .markUpOrderOtherMoneyRate(dto.getMarkUpOrderMaxMoneyRate())
+                .markUpOrderOtherMoneyType(dto.getMarkUpOrderOtherMoneyType())
+                .markUpOrderOtherMoneyRate(dto.getMarkUpOrderOtherMoneyRate())
                 .markUpDownLevel(downLevelToString(dto.getMarkUpDownLevel()))
                 .markUpBackCountOfUser(dto.getMarkUpBackCountOfUser())
                 .build();

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

@@ -177,4 +177,16 @@ public class RoleRechargeRankingDTO extends BasePage {
     @ApiModelProperty(notes = "是否退游:1->退游;0->未退游(系统判定)")
     private Integer isRemoveGameForSystem;
 
+    /**
+     * 是否添加企微 1-是; 0-否
+     */
+    @ApiModelProperty(notes = "是否添加企微 1-是; 0-否")
+    private Integer isAddCorpWechat;
+
+    /**
+     * 是否唤醒 1-是;0-否
+     */
+    @ApiModelProperty(notes = "是否唤醒 1-是;0-否")
+    private Integer isWakeUp;
+
 }

+ 5 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/PlayerRoleDataVO.java

@@ -212,4 +212,9 @@ public class PlayerRoleDataVO {
     @ApiModelProperty(notes = "注册充值时间差(秒)")
     private Long regPayTimeDiff;
 
+    /**
+     * 角色国家属性
+     */
+    @ApiModelProperty(notes = "角色国家属性")
+    private String country;
 }

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

@@ -251,7 +251,7 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
             //推广账号ID
             cri.where().andEquals("account_id", dto.getAccountId());
         }
-        if (dto.getChannelId() != null) {
+        if (CollectionUtils.isNotEmpty(dto.getChannelId())) {
             //渠道ID
             cri.where().andIn("agent_id", dto.getChannelId().toArray(String[]::new));
         }
@@ -337,6 +337,10 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
             if (StringUtils.isNotBlank(gameClassify)) {
                 vo.setGameCategoryName(gameClassify);
             }
+            //“null”字符串处理
+            if ("null".equals(vo.getCountry())) {
+                vo.setCountry(null);
+            }
         return vo;
         }).collect(Collectors.toList());
 
@@ -391,7 +395,7 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
             //推广账号ID
             cri.where().andEquals("account_id", dto.getAccountId());
         }
-        if (dto.getChannelId() != null) {
+        if (CollectionUtils.isNotEmpty(dto.getChannelId())) {
             //渠道ID
             cri.where().andIn("agent_id", dto.getChannelId().toArray(String[]::new));
         }
@@ -849,6 +853,7 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
                 		a.role_id , -- 角色ID
                 		a.role_name , -- 角色名
                 		a.role_level , -- 角色等级
+                		a.country, -- 国家属性
                 		a.combat_num as role_power, -- 角色攻击力
                 		a.role_vip as role_vip_level, -- 角色vip
                 		a.os , -- 角色操作系统
@@ -974,6 +979,7 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
                 		a.role_id , -- 角色ID
                 		a.role_name , -- 角色名
                 		a.role_level , -- 角色等级
+                		a.country, -- 国家属性
                 		a.combat_num as role_power, -- 角色攻击力
                 		a.role_vip as role_vip_level, -- 角色vip
                 		a.os , -- 角色操作系统
@@ -1100,6 +1106,7 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
                 		a.role_id , -- 角色ID
                 		a.role_name , -- 角色名
                 		a.role_level , -- 角色等级
+                		a.country, -- 国家属性
                 		a.combat_num as role_power, -- 角色攻击力
                 		a.role_vip as role_vip_level, -- 角色vip
                 		a.os , -- 角色操作系统

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

@@ -132,9 +132,17 @@ public class RoleManageServiceImpl implements IRoleManageService {
             criA.where().andEquals("is_remove_game", dto.getIsRemoveGame());
         }
         if (dto.getIsRemoveGameForSystem() != null) {
-            //是否退游
+            //是否退游(系统判定)
             criA.where().andEquals("is_remove_game_for_system", dto.getIsRemoveGameForSystem());
         }
+        if (dto.getIsWakeUp() != null) {
+            //是否唤醒
+            criA.where().andEquals("is_wake_up", dto.getIsWakeUp());
+        }
+        if (dto.getIsAddCorpWechat() != null) {
+            //是否添加企微
+            criA.where().andEquals("is_add_corp_wechat", dto.getIsAddCorpWechat());
+        }
         //给充值时间查询条件
         Criteria criTodayAmount = Cnd.cri();
         //查询充值成功的
@@ -179,6 +187,9 @@ public class RoleManageServiceImpl implements IRoleManageService {
             if ("null".equals(map.get("user_phone"))) {
                 map.put("user_phone", null);
             }
+            if ("null".equals(map.get("country"))) {
+                map.put("country", null);
+            }
             return map;
         }).collect(Collectors.toList());
 
@@ -195,13 +206,13 @@ public class RoleManageServiceImpl implements IRoleManageService {
     public Page<Map> getRoleCombatRanking(RoleCombatRankingDTO dto) {
 
         //是否查询合服数据(默认查询合服数据)
-        Boolean isQueryMerge = true;
+        boolean isQueryMerge = true;
         //如果不传值,查看的是原始服数据
-        if (dto.getIsMergeServer() == null || dto.getIsMergeServer() == Boolean.FALSE) {
+        if (dto.getIsMergeServer() == null || Boolean.FALSE.equals(dto.getIsMergeServer())) {
             isQueryMerge = false;
         }
         //是否查询超父游戏数据(默认查询超父游戏数据)
-        Boolean isSuperParentGame = true;
+        boolean isSuperParentGame = true;
         if (dto.getParentGameId() != null) {
             isSuperParentGame = false;
         }
@@ -794,6 +805,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
                 		a.os as os, -- 角色操作系统
                 		b.role_level as role_level, -- 角色等级
                 		b.combat_num as combat_num, -- 角色攻击力
+                		a.country as country, -- 国家属性
                 		IFNULL(c.amount, 0) as amount, -- 角色累计充值金额
                 		IFNULL(c.amount_count, 0) as amount_count, -- 角色累计充值次数
                 		ROUND(IF(c.amount_count > 0, c.amount / c.amount_count, 0), 2) as avg_amount, -- 平均单价
@@ -882,6 +894,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
                 				a.role_name,
                 				a.create_time,
                 				a.os,
+                				a.country,
                 				ROW_NUMBER()over(partition by a.role_id , a.source_system order by a.create_time asc, a.user_id asc) as num
                 			FROM dm_game_order.t_game_user_role a
                 			LEFT JOIN dm_game_order.t_game_user b on a.source_system = b.source_system AND a.user_id = b.id
@@ -1189,6 +1202,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
                         a.os as os, -- 角色操作系统
                         b.role_level as role_level, -- 角色等级
                         b.combat_num as combat_num, -- 角色攻击力
+                        a.country as country, -- 国家属性
                         IFNULL(c.amount, 0) as amount, -- 角色累计充值金额
                         IFNULL(c.amount_count, 0) as amount_count, -- 角色累计充值次数
                         ROUND(IF(c.amount_count > 0, c.amount / c.amount_count, 0), 2) as avg_amount, -- 平均单价
@@ -1277,6 +1291,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
                                 a.role_name,
                                 a.create_time,
                                 a.os,
+                                a.country,
                                 ROW_NUMBER()over(partition by a.role_id , a.source_system order by a.create_time asc, a.user_id asc) as num
                             FROM dm_game_order.t_game_user_role a
                             LEFT JOIN dm_game_order.t_game_user b on a.source_system = b.source_system AND a.user_id = b.id
@@ -3197,6 +3212,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
                 		a.role_id ,
                 		b.role_name,
                 		a.role_level ,
+                		IF(b.country = 'null',NULL,b.country) as country,
                 		a.role_vip ,
                 		a.total_amount ,
                 		a.combat_num ,
@@ -3232,6 +3248,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
                 			a.role_id,
                 			a.role_name,
                 			a.role_level,
+                			a.country,
                 			a.combat_num ,
                 			a.game_id ,
                 			b.parent_game_id,
@@ -3271,6 +3288,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
                 		a.role_vip ,
                 		a.total_amount ,
                 		a.combat_num ,
+                		IF(b.country = 'null',NULL,b.country) as country,
                 		ROW_NUMBER()over(partition by a.source_system ,a.boss_server_id ,a.super_game_id order by a.combat_num desc) as rank_num
                 	FROM (
                 		SELECT
@@ -3293,6 +3311,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
                 			a.role_name,
                 			a.role_level,
                 			a.combat_num ,
+                			a.country,
                 			a.game_id ,
                 			b.parent_game_id,
                 			b.super_game_id ,

+ 55 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/GameVipController.java

@@ -0,0 +1,55 @@
+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.GameVipAddParam;
+import com.zanxiang.game.module.manage.pojo.params.GameVipListParam;
+import com.zanxiang.game.module.manage.pojo.vo.GameVipListVO;
+import com.zanxiang.game.module.manage.service.IGameVipService;
+import com.zanxiang.module.util.pojo.ResultVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description: TODO
+ * @date 2023/11/20 14:27
+ */
+@Api(tags = {"游戏vip档位"})
+@RestController
+@RequestMapping("/game/vip")
+@Slf4j
+public class GameVipController {
+
+    @Autowired
+    private IGameVipService gameVipService;
+
+    @ApiOperation(value = "档位修改或新增")
+    @PostMapping("/add/or/update")
+    @PreAuthorize(permissionKey = "manage:gameVip:addOrUpdate")
+    public ResultVO<Boolean> addOrUpdate(@Validated @RequestBody GameVipAddParam param) {
+        return ResultVO.ok(gameVipService.addOrUpdate(param));
+    }
+
+    @ApiOperation(value = "删除vip档位")
+    @DeleteMapping("/delete/{ids}")
+    @PreAuthorize(permissionKey = "manage:gameVip:delete")
+    public ResultVO<Boolean> deleteById(@PathVariable("ids") List<Long> ids) {
+        return ResultVO.ok(gameVipService.deleteById(ids));
+    }
+
+    @ApiOperation(value = "游戏VIP档位列表")
+    @PostMapping("/list")
+    @PreAuthorize(permissionKey = "manage:gameVip:list")
+    public ResultVO<IPage<GameVipListVO>> gameVipList(@RequestBody GameVipListParam param) {
+        return ResultVO.ok(gameVipService.gameVipList(param));
+    }
+
+}

+ 60 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameVipAddParam.java

@@ -0,0 +1,60 @@
+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.math.BigDecimal;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description: TODO
+ * @date 2023/11/20 14:23
+ */
+@Data
+public class GameVipAddParam {
+
+    /**
+     * 传id为修改, 不传id为新增
+     */
+    @ApiModelProperty("传id为修改, 不传id为新增")
+    private Long id;
+
+    /**
+     * 游戏id
+     */
+    @NotNull(message = "超父游戏id不能为空")
+    @ApiModelProperty("超父游戏id")
+    private Long superGameId;
+
+    /**
+     * 游戏id
+     */
+    @NotNull(message = "父游戏id不能为空")
+    @ApiModelProperty("父游戏id")
+    private Long parentGameId;
+
+    /**
+     * 充值金额最小
+     */
+    @NotNull(message = "充值金额最小不能为空")
+    @ApiModelProperty("充值金额最小")
+    private BigDecimal rechargeMoneyMin;
+
+    /**
+     * 充值金额最大
+     */
+    @NotNull(message = "充值金额最大不能为空")
+    @ApiModelProperty("充值金额最大")
+    private BigDecimal rechargeMoneyMax;
+
+    /**
+     * vip档位
+     */
+    @NotNull(message = "vip档位不能为空")
+    @ApiModelProperty("vip档位")
+    private Integer vipLevel;
+
+}

+ 38 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameVipListParam.java

@@ -0,0 +1,38 @@
+package com.zanxiang.game.module.manage.pojo.params;
+
+import com.zanxiang.game.module.mybatis.entity.GameVip;
+import com.zanxiang.module.web.pojo.BaseListDTO;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description: 查询游戏vip档位参数
+ * @date 2023/11/20 14:23
+ */
+@Data
+public class GameVipListParam extends BaseListDTO<GameVip> {
+
+    /**
+     * 游戏id
+     */
+    @ApiModelProperty("超父游戏id")
+    private Long superGameId;
+
+    /**
+     * 游戏id
+     */
+    @ApiModelProperty("父游戏id")
+    private Long parentGameId;
+
+    /**
+     * vip档位
+     */
+    @ApiModelProperty("vip档位")
+    private Integer vipLevel;
+
+}

+ 104 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameVipListVO.java

@@ -0,0 +1,104 @@
+package com.zanxiang.game.module.manage.pojo.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Builder;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description: TODO
+ * @date 2023/11/20 14:17
+ */
+@Data
+@Builder
+public class GameVipListVO {
+
+    /**
+     * 主键id
+     */
+    @ApiModelProperty(notes = "主键id")
+    private Long id;
+
+    /**
+     * 超父游戏id
+     */
+    @ApiModelProperty("超父游戏id")
+    private Long superGameId;
+
+    /**
+     * 超父游戏名称
+     */
+    @ApiModelProperty("超父游戏名称")
+    private String superGameName;
+
+    /**
+     * 父游戏id
+     */
+    @ApiModelProperty("父游戏id")
+    private Long parentGameId;
+
+    /**
+     * 父游戏名称
+     */
+    @ApiModelProperty("父游戏名称")
+    private String parentGameName;
+
+    /**
+     * 充值金额最小
+     */
+    @ApiModelProperty("充值金额最小")
+    private BigDecimal rechargeMoneyMin;
+
+    /**
+     * 充值金额最大
+     */
+    @ApiModelProperty("充值金额最大")
+    private BigDecimal rechargeMoneyMax;
+
+    /**
+     * vip档位
+     */
+    @ApiModelProperty("vip档位")
+    private Integer vipLevel;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    /**
+     * 创建者
+     */
+    @ApiModelProperty("创建者")
+    private Long createBy;
+
+    /**
+     * 创建者名称
+     */
+    @ApiModelProperty("创建者名称")
+    private String createName;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty("更新时间")
+    private LocalDateTime updateTime;
+
+    /**
+     * 更新者
+     */
+    @ApiModelProperty("更新者")
+    private Long updateBy;
+
+    /**
+     * 更新者名称
+     */
+    @ApiModelProperty("更新者名称")
+    private String updateName;
+
+}

+ 26 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameVipService.java

@@ -0,0 +1,26 @@
+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.GameVipAddParam;
+import com.zanxiang.game.module.manage.pojo.params.GameVipListParam;
+import com.zanxiang.game.module.manage.pojo.vo.GameVipListVO;
+import com.zanxiang.game.module.mybatis.entity.GameVip;
+
+import java.util.List;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description: 游戏vip档位
+ * @date 2023/11/20 14:28
+ */
+public interface IGameVipService extends IService<GameVip> {
+
+    boolean addOrUpdate(GameVipAddParam param);
+
+    boolean deleteById(List<Long> ids);
+
+    IPage<GameVipListVO> gameVipList(GameVipListParam param);
+
+}

+ 160 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameVipServiceImpl.java

@@ -0,0 +1,160 @@
+package com.zanxiang.game.module.manage.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+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.erp.base.ErpServer;
+import com.zanxiang.erp.base.rpc.ISysUserRpc;
+import com.zanxiang.erp.security.util.SecurityUtil;
+import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
+import com.zanxiang.game.module.manage.pojo.params.GameVipAddParam;
+import com.zanxiang.game.module.manage.pojo.params.GameVipListParam;
+import com.zanxiang.game.module.manage.pojo.vo.GameVipListVO;
+import com.zanxiang.game.module.manage.service.IGameService;
+import com.zanxiang.game.module.manage.service.IGameSupperService;
+import com.zanxiang.game.module.manage.service.IGameVipService;
+import com.zanxiang.game.module.mybatis.entity.GameSupper;
+import com.zanxiang.game.module.mybatis.entity.GameVip;
+import com.zanxiang.game.module.mybatis.mapper.GameVipMapper;
+import com.zanxiang.module.util.exception.BaseException;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description: 游戏档位服务实现层
+ * @date 2023/11/20 14:31
+ */
+@Service
+public class GameVipServiceImpl extends ServiceImpl<GameVipMapper, GameVip> implements IGameVipService {
+
+    @Autowired
+    private IGameService gameService;
+    @Autowired
+    private IGameSupperService gameSupperService;
+    @DubboReference(providedBy = ErpServer.SERVER_DUBBO_NAME)
+    private ISysUserRpc sysUserRpc;
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean addOrUpdate(GameVipAddParam param) {
+        //获取当前操作者id
+        Long sysUserId = SecurityUtil.getUserId();
+
+        if (param.getRechargeMoneyMax().compareTo(param.getRechargeMoneyMin()) <= 0) {
+            throw new BaseException("档位参数设置有误,请重新输入。");
+        }
+
+        //当前操作时间
+        LocalDateTime now = LocalDateTime.now();
+        if (null == param.getId()) {
+            //不传入id,说明是新增档位
+            int count = count(new LambdaQueryWrapper<GameVip>()
+                    .eq(GameVip::getSuperGameId, param.getSuperGameId())
+                    .eq(GameVip::getParentGameId, param.getParentGameId())
+                    .and(qw -> qw.eq(GameVip::getRechargeMoneyMin, param.getRechargeMoneyMin())
+                            .eq(GameVip::getRechargeMoneyMax, param.getRechargeMoneyMax())
+                            .or().eq(GameVip::getVipLevel, param.getVipLevel()))
+                    .eq(GameVip::getIsDelete, 0)
+            );
+            if (count > 0) {
+                throw new BaseException("该游戏的该档位区间或vip等级已经设置过,请勿重复设置");
+            }
+
+            //GameVip实体
+            GameVip gameVip = GameVip.builder()
+                    .parentGameId(param.getParentGameId())
+                    .superGameId(param.getSuperGameId())
+                    .rechargeMoneyMin(param.getRechargeMoneyMin())
+                    .rechargeMoneyMax(param.getRechargeMoneyMax())
+                    .vipLevel(param.getVipLevel())
+                    .createTime(now)
+                    .createBy(sysUserId)
+                    .updateTime(now)
+                    .updateBy(sysUserId)
+                    .build();
+            return save(gameVip);
+        } else {
+            //传入id,说明需要修改
+            int count = count(new LambdaQueryWrapper<GameVip>()
+                    .ne(GameVip::getId, param.getId())
+                    .eq(GameVip::getSuperGameId, param.getSuperGameId())
+                    .eq(GameVip::getParentGameId, param.getParentGameId())
+                    .and(qw -> qw.eq(GameVip::getRechargeMoneyMin, param.getRechargeMoneyMin())
+                            .eq(GameVip::getRechargeMoneyMax, param.getRechargeMoneyMax())
+                            .or().eq(GameVip::getVipLevel, param.getVipLevel()))
+                    .eq(GameVip::getIsDelete, 0)
+            );
+            if (count > 0) {
+                throw new BaseException("该游戏的该档位区间或vip等级已经设置过,请勿重复设置");
+            }
+
+            //GameVip实体
+            GameVip gameVip = GameVip.builder()
+                    .id(param.getId())
+                    .parentGameId(param.getParentGameId())
+                    .superGameId(param.getSuperGameId())
+                    .rechargeMoneyMin(param.getRechargeMoneyMin())
+                    .rechargeMoneyMax(param.getRechargeMoneyMax())
+                    .vipLevel(param.getVipLevel())
+                    .updateBy(sysUserId)
+                    .updateTime(now)
+                    .build();
+
+            return updateById(gameVip);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean deleteById(List<Long> ids) {
+        Long sysUserId = SecurityUtil.getUserId();
+        return update(new LambdaUpdateWrapper<GameVip>()
+                        .set(GameVip::getIsDelete, 1)
+                        .set(GameVip::getUpdateBy, sysUserId)
+                        .set(GameVip::getUpdateTime, LocalDateTime.now())
+                        .in(GameVip::getId, ids)
+        );
+    }
+
+    @Override
+    public IPage<GameVipListVO> gameVipList(GameVipListParam param) {
+        return page(param.toPage(), new LambdaQueryWrapper<GameVip>()
+                .eq(null != param.getSuperGameId() , GameVip::getSuperGameId, param.getSuperGameId())
+                .eq(null != param.getParentGameId(), GameVip::getParentGameId, param.getParentGameId())
+                .eq(null != param.getVipLevel(), GameVip::getVipLevel, param.getVipLevel())
+                .eq(GameVip::getIsDelete, 0))
+                .convert(this::toVO);
+    }
+
+
+    private GameVipListVO toVO(GameVip vo) {
+        GameDTO game = gameService.getById(vo.getParentGameId());
+        GameSupper gameSupper = gameSupperService.getById(vo.getSuperGameId());
+        return GameVipListVO.builder()
+                .id(vo.getId())
+                .superGameId(vo.getSuperGameId())
+                .superGameName(null == gameSupper ? null : gameSupper.getName())
+                .parentGameId(vo.getParentGameId())
+                .parentGameName(null == game ? null : game.getName())
+                .rechargeMoneyMin(vo.getRechargeMoneyMin())
+                .rechargeMoneyMax(vo.getRechargeMoneyMax())
+                .vipLevel(vo.getVipLevel())
+                .createTime(vo.getCreateTime())
+                .createBy(vo.getCreateBy())
+                .createName(sysUserRpc.getById(vo.getCreateBy()).getData().getNickname())
+                .updateTime(vo.getUpdateTime())
+                .updateBy(vo.getUpdateBy())
+                .updateName(sysUserRpc.getById(vo.getUpdateBy()).getData().getNickname())
+                .build();
+    }
+
+}

+ 86 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameVip.java

@@ -0,0 +1,86 @@
+package com.zanxiang.game.module.mybatis.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+import java.io.Serializable;
+
+/**
+ * 游戏vip档位表(TGameVip)实体类
+ *
+ * @author makejava
+ * @since 2023-11-20 14:12:05
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+@Builder
+@TableName("t_game_vip")
+public class GameVip implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 超父游戏ID
+     */
+    private Long superGameId;
+
+    /**
+     * 父游戏ID
+     */
+    private Long parentGameId;
+
+    /**
+     * 充值金额最小
+     */
+    private BigDecimal rechargeMoneyMin;
+
+    /**
+     * 充值金额最大
+     */
+    private BigDecimal rechargeMoneyMax;
+
+    /**
+     * vip档位
+     */
+    private Integer vipLevel;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 创建者
+     */
+    private Long createBy;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+
+    /**
+     * 更新者
+     */
+    private Long updateBy;
+
+    /**
+     * 1 删除  0正常
+     */
+    private Integer isDelete;
+
+}
+

+ 7 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/mapper/GameVipMapper.java

@@ -0,0 +1,7 @@
+package com.zanxiang.game.module.mybatis.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zanxiang.game.module.mybatis.entity.GameVip;
+
+public interface GameVipMapper extends BaseMapper<GameVip> {
+}