소스 검색

开奖记录备份采集

dos 2 달 전
부모
커밋
b5ae558501
19개의 변경된 파일533개의 추가작업 그리고 463개의 파일을 삭제
  1. 1 1
      game-business/src/main/java/com/game/business/config/GameEightConfig.java
  2. 1 1
      game-business/src/main/java/com/game/business/config/GameFiveConfig.java
  3. 1 1
      game-business/src/main/java/com/game/business/config/GameFourConfig.java
  4. 1 1
      game-business/src/main/java/com/game/business/config/GameOneConfig.java
  5. 1 1
      game-business/src/main/java/com/game/business/config/GameSevenConfig.java
  6. 1 1
      game-business/src/main/java/com/game/business/config/GameSixConfig.java
  7. 1 1
      game-business/src/main/java/com/game/business/config/GameThreesConfig.java
  8. 1 1
      game-business/src/main/java/com/game/business/config/GameTwoConfig.java
  9. 115 0
      game-business/src/main/java/com/game/business/controller/AppGameLotteryHistoryController.java
  10. 72 0
      game-business/src/main/java/com/game/business/domain/AppGameLotteryHistory.java
  11. 61 0
      game-business/src/main/java/com/game/business/mapper/AppGameLotteryHistoryMapper.java
  12. 65 0
      game-business/src/main/java/com/game/business/service/IAppGameLotteryHistoryService.java
  13. 108 0
      game-business/src/main/java/com/game/business/service/impl/AppGameLotteryHistoryServiceImpl.java
  14. 12 449
      game-business/src/main/java/com/game/business/task/AppGameBettingTask.java
  15. 3 3
      game-business/src/main/java/com/game/business/task/WebSokcetTask.java
  16. 1 1
      game-business/src/main/java/com/game/business/websocket/WebSocketConnent.java
  17. 81 0
      game-business/src/main/resources/mapper/business/AppGameLotteryHistoryMapper.xml
  18. 6 1
      game-common/src/main/java/com/game/common/constant/CacheConstants.java
  19. 1 1
      game-generator/src/main/java/com/game/generator/controller/GenController.java

+ 1 - 1
game-business/src/main/java/com/game/business/config/GameEightConfig.java

@@ -16,7 +16,7 @@ public class GameEightConfig implements CommandLineRunner {
     @Override
     @Async
     public void run(String... args) throws Exception {
-        webSocketConnent = new WebSocketConnent(Common.WS_GAME_EIGHT_URL, Common.WS_GAME_EIGHT_REMARK_URL, Common.GAME_EIGHT_NAME);
+        webSocketConnent = new WebSocketConnent(Common.WS_GAME_EIGHT_REMARK_URL,Common.WS_GAME_EIGHT_URL, Common.GAME_EIGHT_NAME);
         webSocketConnent.connect();
     }
 }

+ 1 - 1
game-business/src/main/java/com/game/business/config/GameFiveConfig.java

@@ -16,7 +16,7 @@ public class GameFiveConfig implements CommandLineRunner {
     @Override
     @Async
     public void run(String... args) throws Exception {
-        webSocketConnent = new WebSocketConnent(Common.WS_GAME_FIVE_URL, Common.WS_GAME_FIVE_REMARK_URL, Common.GAME_FIVE_NAME);
+        webSocketConnent = new WebSocketConnent(Common.WS_GAME_FIVE_REMARK_URL,Common.WS_GAME_FIVE_URL,  Common.GAME_FIVE_NAME);
         webSocketConnent.connect();
     }
 }

+ 1 - 1
game-business/src/main/java/com/game/business/config/GameFourConfig.java

@@ -16,7 +16,7 @@ public class GameFourConfig implements CommandLineRunner {
     @Override
     @Async
     public void run(String... args) throws Exception {
-        webSocketConnent = new WebSocketConnent(Common.WS_GAME_FOUR_URL, Common.WS_GAME_FOUR_REMARK_URL, Common.GAME_FOUR_NAME);
+        webSocketConnent = new WebSocketConnent( Common.WS_GAME_FOUR_REMARK_URL, Common.WS_GAME_FOUR_URL,Common.GAME_FOUR_NAME);
         webSocketConnent.connect();
     }
 }

+ 1 - 1
game-business/src/main/java/com/game/business/config/GameOneConfig.java

@@ -16,7 +16,7 @@ public class GameOneConfig implements CommandLineRunner {
     @Override
     @Async
     public void run(String... args) throws Exception {
-        webSocketConnent = new WebSocketConnent(Common.WS_GAME_ONE_URL, Common.WS_GAME_ONE_REMARK_URL, Common.GANME_ONE_NAME);
+        webSocketConnent = new WebSocketConnent(Common.WS_GAME_ONE_REMARK_URL,Common.WS_GAME_ONE_URL,  Common.GANME_ONE_NAME);
         webSocketConnent.connect();
     }
 }

+ 1 - 1
game-business/src/main/java/com/game/business/config/GameSevenConfig.java

@@ -16,7 +16,7 @@ public class GameSevenConfig implements CommandLineRunner {
     @Override
     @Async
     public void run(String... args) throws Exception {
-        webSocketConnent = new WebSocketConnent(Common.WS_GAME_SEVEN_URL, Common.WS_GAME_SEVEN_REMARK_URL, Common.GAME_SEVEN_NAME);
+        webSocketConnent = new WebSocketConnent( Common.WS_GAME_SEVEN_REMARK_URL,Common.WS_GAME_SEVEN_URL, Common.GAME_SEVEN_NAME);
         webSocketConnent.connect();
     }
 }

+ 1 - 1
game-business/src/main/java/com/game/business/config/GameSixConfig.java

@@ -16,7 +16,7 @@ public class GameSixConfig implements CommandLineRunner {
     @Override
     @Async
     public void run(String... args) throws Exception {
-        webSocketConnent = new WebSocketConnent(Common.WS_GAME_SIX_URL, Common.WS_GAME_SIX_REMARK_URL, Common.GAME_SIX_NAME);
+        webSocketConnent = new WebSocketConnent( Common.WS_GAME_SIX_REMARK_URL, Common.WS_GAME_SIX_URL,Common.GAME_SIX_NAME);
         webSocketConnent.connect();
     }
 }

+ 1 - 1
game-business/src/main/java/com/game/business/config/GameThreesConfig.java

@@ -16,7 +16,7 @@ public class GameThreesConfig implements CommandLineRunner {
     @Override
     @Async
     public void run(String... args) throws Exception {
-        webSocketConnent = new WebSocketConnent(Common.WS_GAME_THREES_URL, Common.WS_GAME_THREES_REMARK_URL, Common.GAME_THREES_NAME);
+        webSocketConnent = new WebSocketConnent( Common.WS_GAME_THREES_REMARK_URL,Common.WS_GAME_THREES_URL, Common.GAME_THREES_NAME);
         webSocketConnent.connect();
     }
 }

+ 1 - 1
game-business/src/main/java/com/game/business/config/GameTwoConfig.java

@@ -16,7 +16,7 @@ public class GameTwoConfig implements CommandLineRunner {
     @Override
     @Async
     public void run(String... args) throws Exception {
-        webSocketConnent = new WebSocketConnent(Common.WS_GAME_TWO_URL, Common.WS_GAME_TWO_REMARK_URL, Common.GANME_TWO_NAME);
+        webSocketConnent = new WebSocketConnent(Common.WS_GAME_TWO_REMARK_URL,Common.WS_GAME_TWO_URL,  Common.GANME_TWO_NAME);
         webSocketConnent.connect();
     }
 }

+ 115 - 0
game-business/src/main/java/com/game/business/controller/AppGameLotteryHistoryController.java

@@ -0,0 +1,115 @@
+package com.game.business.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.game.common.core.domain.R;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.game.common.annotation.Log;
+import com.game.common.core.controller.BaseController;
+import com.game.common.core.domain.AjaxResult;
+import com.game.common.enums.BusinessType;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import com.game.business.domain.AppGameLotteryHistory;
+import com.game.business.service.IAppGameLotteryHistoryService;
+import com.game.common.utils.poi.ExcelUtil;
+import com.game.common.core.page.TableDataInfo;
+
+/**
+ * 游戏开奖记录(备份)Controller
+ * 
+ * @author game
+ * @date 2025-01-09
+ */
+@RestController
+@RequestMapping("/business/appGameLotteryHistory")
+@Api(value = "AppGameLotteryHistoryController", description = "游戏开奖记录(备份)接口", tags = {"游戏开奖记录(备份)"})
+public class AppGameLotteryHistoryController extends BaseController
+{
+    @Autowired
+    private IAppGameLotteryHistoryService appGameLotteryHistoryService;
+
+    /**
+     * 查询游戏开奖记录(备份)列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:appGameLotteryHistory:list')")
+    @GetMapping("/list")
+    @ApiOperation(value = "查询游戏开奖记录(备份)列表", notes = "获取游戏开奖记录(备份)列表")
+    public TableDataInfo<AppGameLotteryHistory> list(AppGameLotteryHistory appGameLotteryHistory)
+    {
+        startPage();
+        List<AppGameLotteryHistory> list = appGameLotteryHistoryService.selectAppGameLotteryHistoryList(appGameLotteryHistory);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出游戏开奖记录(备份)列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:appGameLotteryHistory:export')")
+    @Log(title = "游戏开奖记录(备份)", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ApiOperation(value = "导出游戏开奖记录(备份)列表", notes = "导出游戏开奖记录(备份)列表")
+    public void export(HttpServletResponse response, AppGameLotteryHistory appGameLotteryHistory)
+    {
+        List<AppGameLotteryHistory> list = appGameLotteryHistoryService.selectAppGameLotteryHistoryList(appGameLotteryHistory);
+        ExcelUtil<AppGameLotteryHistory> util = new ExcelUtil<AppGameLotteryHistory>(AppGameLotteryHistory.class);
+        util.exportExcel(response, list, "游戏开奖记录(备份)数据");
+    }
+
+    /**
+     * 获取游戏开奖记录(备份)详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:appGameLotteryHistory:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation(value = "获取游戏开奖记录(备份)详细信息", notes = "获取游戏开奖记录(备份)详细信息")
+    public R<AppGameLotteryHistory> getInfo(@PathVariable("id") Long id)
+    {
+        return R.ok(appGameLotteryHistoryService.selectAppGameLotteryHistoryById(id));
+    }
+
+    /**
+     * 新增游戏开奖记录(备份)
+     */
+    @PreAuthorize("@ss.hasPermi('business:appGameLotteryHistory:add')")
+    @Log(title = "游戏开奖记录(备份)", businessType = BusinessType.INSERT)
+    @ApiOperation(value = "新增游戏开奖记录(备份)", notes = "新增游戏开奖记录(备份)")
+    @PostMapping
+    public R add(@RequestBody AppGameLotteryHistory appGameLotteryHistory)
+    {
+        return R.ok(appGameLotteryHistoryService.insertAppGameLotteryHistory(appGameLotteryHistory));
+    }
+
+    /**
+     * 修改游戏开奖记录(备份)
+     */
+    @PreAuthorize("@ss.hasPermi('business:appGameLotteryHistory:edit')")
+    @Log(title = "游戏开奖记录(备份)", businessType = BusinessType.UPDATE)
+    @ApiOperation(value = "修改游戏开奖记录(备份)", notes = "修改游戏开奖记录(备份)")
+    @PutMapping
+    public R edit(@RequestBody AppGameLotteryHistory appGameLotteryHistory)
+    {
+        return R.ok(appGameLotteryHistoryService.updateAppGameLotteryHistory(appGameLotteryHistory));
+    }
+
+    /**
+     * 删除游戏开奖记录(备份)
+     */
+    @PreAuthorize("@ss.hasPermi('business:appGameLotteryHistory:remove')")
+    @Log(title = "游戏开奖记录(备份)", businessType = BusinessType.DELETE)
+    @ApiOperation(value = "删除游戏开奖记录(备份)", notes = "删除游戏开奖记录(备份)")
+	@DeleteMapping("/{ids}")
+    public R remove(@PathVariable Long[] ids)
+    {
+        return R.ok(appGameLotteryHistoryService.deleteAppGameLotteryHistoryByIds(ids));
+    }
+}

+ 72 - 0
game-business/src/main/java/com/game/business/domain/AppGameLotteryHistory.java

@@ -0,0 +1,72 @@
+package com.game.business.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.game.common.annotation.Excel;
+import com.game.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+ * 游戏开奖记录(备份)对象 app_game_lottery_history
+ *
+ * @author game
+ * @date 2025-01-09
+ */
+@ApiModel(value = "app_game_lottery_history", description = "游戏开奖记录(备份)")
+@TableName(value= "app_game_lottery_history")
+@Data
+public class AppGameLotteryHistory
+        {
+private static final long serialVersionUID=1L;
+
+    /** 主键ID */
+    @ApiModelProperty(value = "主键ID")
+    @TableId(value = "id" , type = IdType.AUTO)
+    private Long id;
+
+    /** 游戏类型ID */
+    @ApiModelProperty(value = "游戏类型ID")
+    @Excel(name = "游戏类型ID")
+    @TableField(value = "class_id")
+    private Long classId;
+
+    /** 游戏ID */
+    @ApiModelProperty(value = "游戏ID")
+    @Excel(name = "游戏ID")
+    @TableField(value = "game_id")
+    private Long gameId;
+
+    /** 游戏期号 */
+    @ApiModelProperty(value = "游戏期号")
+    @Excel(name = "游戏期号")
+    @TableField(value = "game_date")
+    private String gameDate;
+
+    /** 是否开奖 0 否 1 是 */
+    @ApiModelProperty(value = "是否开奖 0 否 1 是")
+    @Excel(name = "是否开奖 0 否 1 是")
+    @TableField(value = "is_lottery")
+    private Integer isLottery;
+
+    /** 开奖选项 */
+    @ApiModelProperty(value = "开奖选项")
+    @Excel(name = "开奖选项")
+    @TableField(value = "game_lottery_succ")
+    private String gameLotterySucc;
+
+    /** 记录时间 */
+    @ApiModelProperty(value = "记录时间")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "记录时间" , width = 30, dateFormat = "yyyy-MM-dd")
+    @TableField(value = "game_record_date")
+    private Date gameRecordDate;
+
+}

+ 61 - 0
game-business/src/main/java/com/game/business/mapper/AppGameLotteryHistoryMapper.java

@@ -0,0 +1,61 @@
+package com.game.business.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.game.business.domain.AppGameLotteryHistory;
+
+/**
+ * 游戏开奖记录(备份)Mapper接口
+ *
+ * @author game
+ * @date 2025-01-09
+ */
+public interface AppGameLotteryHistoryMapper extends BaseMapper<AppGameLotteryHistory> {
+    /**
+     * 查询游戏开奖记录(备份)
+     *
+     * @param id 游戏开奖记录(备份)主键
+     * @return 游戏开奖记录(备份)
+     */
+    public AppGameLotteryHistory selectAppGameLotteryHistoryById(Long id);
+
+    /**
+     * 查询游戏开奖记录(备份)列表
+     *
+     * @param appGameLotteryHistory 游戏开奖记录(备份)
+     * @return 游戏开奖记录(备份)集合
+     */
+    public List<AppGameLotteryHistory> selectAppGameLotteryHistoryList(AppGameLotteryHistory appGameLotteryHistory);
+
+    /**
+     * 新增游戏开奖记录(备份)
+     *
+     * @param appGameLotteryHistory 游戏开奖记录(备份)
+     * @return 结果
+     */
+    public int insertAppGameLotteryHistory(AppGameLotteryHistory appGameLotteryHistory);
+
+    /**
+     * 修改游戏开奖记录(备份)
+     *
+     * @param appGameLotteryHistory 游戏开奖记录(备份)
+     * @return 结果
+     */
+    public int updateAppGameLotteryHistory(AppGameLotteryHistory appGameLotteryHistory);
+
+    /**
+     * 删除游戏开奖记录(备份)
+     *
+     * @param id 游戏开奖记录(备份)主键
+     * @return 结果
+     */
+    public int deleteAppGameLotteryHistoryById(Long id);
+
+    /**
+     * 批量删除游戏开奖记录(备份)
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAppGameLotteryHistoryByIds(Long[] ids);
+}

+ 65 - 0
game-business/src/main/java/com/game/business/service/IAppGameLotteryHistoryService.java

@@ -0,0 +1,65 @@
+package com.game.business.service;
+
+import java.util.List;
+
+import com.game.business.domain.AppGameLottery;
+import com.game.business.domain.AppGameLotteryHistory;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 游戏开奖记录(备份)Service接口
+ *
+ * @author game
+ * @date 2025-01-09
+ */
+public interface IAppGameLotteryHistoryService extends IService<AppGameLotteryHistory> {
+    /**
+     * 查询游戏开奖记录(备份)
+     *
+     * @param id 游戏开奖记录(备份)主键
+     * @return 游戏开奖记录(备份)
+     */
+    public AppGameLotteryHistory selectAppGameLotteryHistoryById(Long id);
+
+    /**
+     * 查询游戏开奖记录(备份)列表
+     *
+     * @param appGameLotteryHistory 游戏开奖记录(备份)
+     * @return 游戏开奖记录(备份)集合
+     */
+    public List<AppGameLotteryHistory> selectAppGameLotteryHistoryList(AppGameLotteryHistory appGameLotteryHistory);
+
+    /**
+     * 新增游戏开奖记录(备份)
+     *
+     * @param appGameLotteryHistory 游戏开奖记录(备份)
+     * @return 结果
+     */
+    public int insertAppGameLotteryHistory(AppGameLotteryHistory appGameLotteryHistory);
+
+    /**
+     * 修改游戏开奖记录(备份)
+     *
+     * @param appGameLotteryHistory 游戏开奖记录(备份)
+     * @return 结果
+     */
+    public int updateAppGameLotteryHistory(AppGameLotteryHistory appGameLotteryHistory);
+
+    /**
+     * 批量删除游戏开奖记录(备份)
+     *
+     * @param ids 需要删除的游戏开奖记录(备份)主键集合
+     * @return 结果
+     */
+    public int deleteAppGameLotteryHistoryByIds(Long[] ids);
+
+    /**
+     * 删除游戏开奖记录(备份)信息
+     *
+     * @param id 游戏开奖记录(备份)主键
+     * @return 结果
+     */
+    public int deleteAppGameLotteryHistoryById(Long id);
+
+    AppGameLotteryHistory selectLottery(Long classId, Long gameId, String gameDate);
+}

+ 108 - 0
game-business/src/main/java/com/game/business/service/impl/AppGameLotteryHistoryServiceImpl.java

@@ -0,0 +1,108 @@
+package com.game.business.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import java.util.List;
+
+import com.game.business.domain.AppGameLottery;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.game.business.mapper.AppGameLotteryHistoryMapper;
+import com.game.business.domain.AppGameLotteryHistory;
+import com.game.business.service.IAppGameLotteryHistoryService;
+import com.game.common.annotation.DataSource;
+import com.game.common.enums.DataSourceType;
+
+/**
+ * 游戏开奖记录(备份)Service业务层处理
+ *
+ * @author game
+ * @date 2025-01-09
+ */
+@Service
+public class AppGameLotteryHistoryServiceImpl extends ServiceImpl<AppGameLotteryHistoryMapper, AppGameLotteryHistory> implements IAppGameLotteryHistoryService {
+    @Autowired
+    private AppGameLotteryHistoryMapper appGameLotteryHistoryMapper;
+
+    /**
+     * 查询游戏开奖记录(备份)
+     *
+     * @param id 游戏开奖记录(备份)主键
+     * @return 游戏开奖记录(备份)
+     */
+    @Override
+    @DataSource(DataSourceType.SLAVE)
+    public AppGameLotteryHistory selectAppGameLotteryHistoryById(Long id) {
+        return appGameLotteryHistoryMapper.selectAppGameLotteryHistoryById(id);
+    }
+
+    /**
+     * 查询游戏开奖记录(备份)列表
+     *
+     * @param appGameLotteryHistory 游戏开奖记录(备份)
+     * @return 游戏开奖记录(备份)
+     */
+    @Override
+    @DataSource(DataSourceType.SLAVE)
+    public List<AppGameLotteryHistory> selectAppGameLotteryHistoryList(AppGameLotteryHistory appGameLotteryHistory) {
+        return appGameLotteryHistoryMapper.selectAppGameLotteryHistoryList(appGameLotteryHistory);
+    }
+
+    /**
+     * 新增游戏开奖记录(备份)
+     *
+     * @param appGameLotteryHistory 游戏开奖记录(备份)
+     * @return 结果
+     */
+    @Override
+    @DataSource(DataSourceType.SLAVE)
+    public int insertAppGameLotteryHistory(AppGameLotteryHistory appGameLotteryHistory) {
+            return appGameLotteryHistoryMapper.insertAppGameLotteryHistory(appGameLotteryHistory);
+    }
+
+    /**
+     * 修改游戏开奖记录(备份)
+     *
+     * @param appGameLotteryHistory 游戏开奖记录(备份)
+     * @return 结果
+     */
+    @Override
+    @DataSource(DataSourceType.SLAVE)
+    public int updateAppGameLotteryHistory(AppGameLotteryHistory appGameLotteryHistory) {
+        return appGameLotteryHistoryMapper.updateAppGameLotteryHistory(appGameLotteryHistory);
+    }
+
+    /**
+     * 批量删除游戏开奖记录(备份)
+     *
+     * @param ids 需要删除的游戏开奖记录(备份)主键
+     * @return 结果
+     */
+    @Override
+    @DataSource(DataSourceType.SLAVE)
+    public int deleteAppGameLotteryHistoryByIds(Long[] ids) {
+        return appGameLotteryHistoryMapper.deleteAppGameLotteryHistoryByIds(ids);
+    }
+
+    /**
+     * 删除游戏开奖记录(备份)信息
+     *
+     * @param id 游戏开奖记录(备份)主键
+     * @return 结果
+     */
+    @Override
+    @DataSource(DataSourceType.SLAVE)
+    public int deleteAppGameLotteryHistoryById(Long id) {
+        return appGameLotteryHistoryMapper.deleteAppGameLotteryHistoryById(id);
+    }
+
+    @Override
+    public AppGameLotteryHistory selectLottery(Long classId, Long gameId, String gameDate) {
+        LambdaQueryWrapper<AppGameLotteryHistory> queryLotteryWrapper = Wrappers.lambdaQuery();;
+        queryLotteryWrapper.eq(AppGameLotteryHistory::getClassId, classId);
+        queryLotteryWrapper.eq(AppGameLotteryHistory::getGameId, gameId);
+        queryLotteryWrapper.eq(AppGameLotteryHistory::getGameDate, gameDate);
+        return appGameLotteryHistoryMapper.selectOne(queryLotteryWrapper);
+    }
+}

+ 12 - 449
game-business/src/main/java/com/game/business/task/AppGameBettingTask.java

@@ -30,16 +30,7 @@ import java.util.stream.Collectors;
 public class AppGameBettingTask {
 
     @Autowired
-    private IAppGameBettingService appGameBettingService;
-
-    @Autowired
-    private IAppUserService appUserService;
-
-    @Autowired
-    private IFinTranRecordService finTranRecordService;
-
-    @Autowired
-    private IAppGameLotteryService appGameLotteryService;
+    private IAppGameLotteryHistoryService appGameLotteryHistoryService;
 
     @Autowired
     private IAppGameService appGameService;
@@ -47,24 +38,9 @@ public class AppGameBettingTask {
     @Autowired
     private IAppGameClassifyService appGameClassifyService;
 
-    @Autowired
-    private IAppGameItemService appGameItemService;
-
     @Autowired
     private RedisCache redisCache;
 
-    @Autowired
-    private IAppUserCountService appUserCountService;
-
-    @Autowired
-    private AppUserCountTask appUserCountTask;
-
-    @Autowired
-    private IAppGameItemMultipleService appGameItemMultipleService;
-
-    @Autowired
-    private AppGameLotteryAutoTask appGameLotteryAutoTask;
-
     @Async("asyncExecutor")
     public void gameDataTask(String message, String gameCodeFinal) throws Exception {
 
@@ -85,170 +61,6 @@ public class AppGameBettingTask {
             return;
         }
 
-        // 修改倍数
-        if(type == 4){
-
-            String gameCode = null;
-            String gameDate = null;
-            String gameLotteryBet = null;
-            for (int i = 0; i < dataArry.size(); i++) {
-                JSONObject jsonObject = dataArry.getJSONObject(i);
-                if(jsonObject.containsKey("id")){
-                    gameCode = jsonObject.getString("id");
-                }
-                if(jsonObject.containsKey("gameDate")){
-                    gameDate = jsonObject.getString("gameDate");
-                }
-                if(jsonObject.containsKey("gameLotteryBet")){
-                    gameLotteryBet = jsonObject.getString("gameLotteryBet");
-                }
-            }
-
-            if(StringUtils.isBlank(gameCode)){
-                return;
-            }
-
-            if(StringUtils.isBlank(gameDate)){
-                return;
-            }
-
-            if(StringUtils.isBlank(gameLotteryBet)){
-                return;
-            }
-
-            AppGame appGame = appGameService.selectAppGameByCode(gameCode);
-            if(appGame == null){
-                return;
-            }
-
-            String redisKey = CacheConstants.GAME_LOTTERY_ITEM_MULTIPLE.concat(appGame.getId() + ":" + gameCode);
-            if(!redisCache.redisTemplate.opsForValue().setIfAbsent(redisKey, 1)){
-                return;
-            }
-            try {
-
-                gameLotteryBet = gameLotteryBet.replace(" ", "").trim();
-                JSONArray items = JSONArray.parseArray(gameLotteryBet);
-                if(items == null || items.isEmpty()){
-                    return;
-                }
-
-                AppGameItem appGameItem = new AppGameItem();
-                appGameItem.setGameId(appGame.getId());
-                List<AppGameItem> itemList = appGameItemService.selectAppGameItemList(appGameItem);
-
-                if(itemList == null || itemList.isEmpty()){
-                    return;
-                }
-
-                if(itemList.size() != items.size()){
-                    return;
-                }
-
-                AppGameItemMultiple appGameItemMultiple = appGameItemMultipleService.getAppGameItemMultiple(appGame.getId(), gameDate);
-
-                if(appGameItemMultiple != null){
-                    appGameItemMultiple.setItemMultiple(gameLotteryBet.substring(1, gameLotteryBet.length() - 1));
-                    appGameItemMultipleService.updateById(appGameItemMultiple);
-                }else{
-                    appGameItemMultiple = new AppGameItemMultiple();
-                    appGameItemMultiple.setGameId(appGame.getId());
-                    appGameItemMultiple.setGameDate(gameDate);
-                    appGameItemMultiple.setItemMultiple(gameLotteryBet.substring(1, gameLotteryBet.length() - 1));
-                    appGameItemMultiple.setCreateTime(new Date());
-                    appGameItemMultipleService.save(appGameItemMultiple);
-                }
-
-                for (int j = 0; j < itemList.size(); j++) {
-                    AppGameItem gameItem = itemList.get(j);
-                    gameItem.setItemMultiple(items.getDouble(j));
-                    appGameItemService.updateAppGameItem(gameItem);
-                }
-            }catch (Exception e){
-                e.printStackTrace();
-            }finally {
-                redisCache.redisTemplate.delete(redisKey);
-            }
-            return;
-        }
-
-        // 更新倒计时
-        if(type == 1){
-
-//            JSONArray gameDataArry = null;
-            String gameCode = null;
-            String time = null;
-            String classCode = null;
-            Integer state = null;
-            for (int i = 0; i < dataArry.size(); i++) {
-                JSONObject jsonObject = dataArry.getJSONObject(i);
-                if(jsonObject.containsKey("data")){
-                    gameCode = jsonObject.getString("id");
-                }
-                if(jsonObject.containsKey("time")){
-                    time = jsonObject.getString("time");
-                }
-                if(jsonObject.containsKey("id")){
-                    classCode = jsonObject.getString("id");
-                }
-                if(jsonObject.containsKey("state")){
-                    state = jsonObject.getInteger("state");
-                }
-            }
-
-            if(classCode == null){
-//                System.out.println("游戏socket推送倒计时,平台ID为空。");
-                return;
-            }
-
-            if(gameCode == null){
-//                System.out.println("游戏socket推送倒计时,data对象为空。");
-                return;
-            }
-
-            if(time == null || time.trim().isEmpty()){
-//                System.out.println("游戏socket推送倒计时,time为空。");
-                return;
-            }
-
-            if(gameCode.equals(Common.GAME_FOUR_CODE)){
-                if(state == null || state != 0){
-                    return;
-                }
-            }
-
-            if(gameCode.equals(Common.GAME_FIVE_CODE)){
-                if(state == null || state != 1){
-                    return;
-                }
-            }
-
-            AppGameClassify appGameClassify = appGameClassifyService.getByCode(classCode);
-            if(appGameClassify == null){
-//                System.out.println("开奖游戏平台不存在:" + classCode);
-                return;
-            }
-
-            List<AppGame> appGameList = appGameService.selectAppGameByClassId(appGameClassify.getId());
-            if(appGameList == null || appGameList.isEmpty()){
-//                System.out.println("开奖游戏平台没有游戏:" + classCode);
-                return;
-            }
-            Map<String, List<AppGame>> codeGameMap = appGameList.stream().collect(Collectors.groupingBy(AppGame::getCode));
-
-            if(!gameCodeFinal.equals(gameCode)){
-                return;
-            }
-            if(!codeGameMap.containsKey(gameCode)){
-//                    System.out.println("开奖游戏不存在:" + gameCode);
-                return;
-            }
-
-            AppGame appGame = codeGameMap.get(gameCode).get(0);
-            appGame.setGameTime(time);
-            appGameService.updateAppGame(appGame);
-            return;
-        }
 
         JSONArray gameArry = null;
         String classCode = null;
@@ -311,26 +123,24 @@ public class AppGameBettingTask {
 
             if(type == 3){
 
-                String redisKey = CacheConstants.GAME_LOTTERY_TASK_CREATE.concat(appGame.getId() + ":" + gameCode);
+                String redisKey = CacheConstants.GAME_LOTTERY_TASK_CREATE_NEW.concat(appGame.getId() + ":" + gameCode);
                 if(!redisCache.redisTemplate.opsForValue().setIfAbsent(redisKey, 1)){
                     continue;
                 }
 
                 try {
 
-                    AppGameLottery appGameLottery = appGameLotteryService.selectLottery(appGame.getClassifyId(), appGame.getId(), gameDate);
+                    AppGameLotteryHistory appGameLottery = appGameLotteryHistoryService.selectLottery(appGame.getClassifyId(), appGame.getId(), gameDate);
 
                     if(appGameLottery == null){
-                        appGame.setGameDate(gameDate);
-                        appGameService.updateAppGame(appGame);
 
-                        appGameLottery = new AppGameLottery();
+                        appGameLottery = new AppGameLotteryHistory();
                         appGameLottery.setGameId(appGame.getId());
                         appGameLottery.setClassId(appGame.getClassifyId());
                         appGameLottery.setGameDate(gameDate);
                         appGameLottery.setIsLottery(0);
                         appGameLottery.setGameRecordDate(new Date());
-                        appGameLotteryService.save(appGameLottery);
+                        appGameLotteryHistoryService.save(appGameLottery);
                     }
                 }catch (Exception e){
                     e.printStackTrace();
@@ -352,14 +162,14 @@ public class AppGameBettingTask {
                 continue;
             }
 
-            String redisKey = CacheConstants.GAME_LOTTERY_TASK.concat(appGame.getId() + ":" + gameDate);
+            String redisKey = CacheConstants.GAME_LOTTERY_TASK_NEW.concat(appGame.getId() + ":" + gameDate);
             if(!redisCache.redisTemplate.opsForValue().setIfAbsent(redisKey, 1)){
                 continue;
             }
 
             try {
 
-                AppGameLottery appGameLottery = appGameLotteryService.selectLottery(appGame.getClassifyId(), appGame.getId(), gameDate);
+                AppGameLotteryHistory appGameLottery = appGameLotteryHistoryService.selectLottery(appGame.getClassifyId(), appGame.getId(), gameDate);
 
 //                if(gameCode.equals("6")){
 //                    gameLotterySucc = appGameLotteryAutoTask.autoTask(appGame, gameDate);
@@ -367,14 +177,14 @@ public class AppGameBettingTask {
 
                 if(appGameLottery == null){
                     // 保存开奖记录
-                    appGameLottery = new AppGameLottery();
+                    appGameLottery = new AppGameLotteryHistory();
                     appGameLottery.setGameId(appGame.getId());
                     appGameLottery.setClassId(appGame.getClassifyId());
                     appGameLottery.setGameDate(gameDate);
                     appGameLottery.setIsLottery(isLottery);
                     appGameLottery.setGameRecordDate(new Date());
                     appGameLottery.setGameLotterySucc(gameLotterySucc);
-                    appGameLotteryService.save(appGameLottery);
+                    appGameLotteryHistoryService.save(appGameLottery);
                 }else{
                     if(appGameLottery.getIsLottery() == 1){
 //                      redisCache.redisTemplate.delete(redisKey);
@@ -382,16 +192,14 @@ public class AppGameBettingTask {
                         continue;
                     }
 
-                    AppGameLottery updateAppGameLottery = new AppGameLottery();
+                    AppGameLotteryHistory updateAppGameLottery = new AppGameLotteryHistory();
                     updateAppGameLottery.setId(appGameLottery.getId());
                     updateAppGameLottery.setIsLottery(isLottery);
                     updateAppGameLottery.setGameRecordDate(new Date());
                     updateAppGameLottery.setGameLotterySucc(gameLotterySucc);
-                    appGameLotteryService.updateById(updateAppGameLottery);
+                    appGameLotteryHistoryService.updateById(updateAppGameLottery);
                 }
-
-                lotteryTask(appGame, appGameClassify, gameLotterySucc, gameDate);
-
+//                lotteryTask(appGame, appGameClassify, gameLotterySucc, gameDate);
             }catch (Exception e){
                 e.printStackTrace();
             }finally {
@@ -399,249 +207,4 @@ public class AppGameBettingTask {
             }
         }
     }
-
-    public void lotteryTask(AppGame appGame, AppGameClassify appGameClassify, String gameLotterySucc, String gameDate) throws Exception {
-
-        this.updateItme(appGame.getId(), gameLotterySucc);
-
-        List<String> userIds = this.gameBettingTask(appGameClassify.getId(), appGame.getId(), gameDate, gameLotterySucc);
-
-        appUserCountService.staticsUserCount(appGame.getId(),null, appGame.getGameDate());
-
-        // 给中奖人发送刷新余额通知
-        sendMsg(userIds);
-
-        //更新可提现余额
-        for(String userId : userIds) {
-            appUserCountTask.updateWithdrawAble(Long.parseLong(userId));
-        }
-    }
-
-    public void updateItme(Long gameId, String gameLotterySucc){
-
-        // 获取上次开奖结果
-        List<AppItemCountDTO> itemCountList = new ArrayList<>();
-        String gameLotterySuccCache =  redisCache.getCacheObject("G:GameCount:" + gameId);
-        if(gameLotterySuccCache != null && !gameLotterySuccCache.trim().isEmpty()){
-            itemCountList = JSONArray.parseArray(gameLotterySuccCache, AppItemCountDTO.class);
-        }
-
-        // 修改游戏选项
-        String [] bettingItems = gameLotterySucc.split(",");
-        List<AppItemCountDTO> nowItemCountList = new ArrayList<>();
-        for(int j = 0; j < bettingItems.length; j++) {
-            String bettingItemStr = bettingItems[j];
-
-            AppItemCountDTO appItemCountDTO = new AppItemCountDTO();
-            appItemCountDTO.setGameId(gameId);
-            appItemCountDTO.setItemLocation(bettingItemStr);
-            appItemCountDTO.setConsecutive(1);
-
-            AppGameItem appGameItem = new AppGameItem();
-            appGameItem.setGameId(gameId);
-            appGameItem.setItemLocation(bettingItemStr);
-            // 开奖次数
-            appGameItemService.updateLotteryCount(appGameItem);
-
-            if(!itemCountList.isEmpty()){
-                for (AppItemCountDTO appItemCount : itemCountList){
-                    if(appItemCount.getItemLocation().equals(bettingItemStr)){
-                        appItemCountDTO.setConsecutive(appItemCount.getConsecutive() + 1);
-                    }
-                }
-            }
-
-            // 更新连中
-            appGameItemService.updateConsecutive(appItemCountDTO);
-            nowItemCountList.add(appItemCountDTO);
-        }
-
-        redisCache.setCacheObject("G:GameCount:" + gameId, JSON.toJSONString(nowItemCountList));
-    }
-
-    @DSTransactional
-    public List<String> gameBettingTask(Long classId, Long gameId, String gameDate, String bettingItem) throws Exception {
-        List<String> userIds = new ArrayList<>();
-        List<AppGameBetting> list = appGameBettingService.getIsWinning(classId, gameId, gameDate, 0);
-
-        if(list == null || list.isEmpty()){
-            return userIds;
-        }
-
-        for (int i = 0; i < list.size(); i++) {
-            AppGameBetting appGameBetting = list.get(i);
-            appGameBetting.setUpdateTime(new Date());
-
-            String [] bettingItems = bettingItem.split(",");
-            List<String> bettingItemsList = Arrays.asList(bettingItems);
-
-            double bettingAmount = appGameBetting.getBettingAmount() * appGameBetting.getBettingMultiple();
-            bettingAmount = new BigDecimal(bettingAmount + "").setScale(4, RoundingMode.DOWN).doubleValue();
-
-            if(appGameBetting.getBettingGameType() == 0){
-                if(!bettingItemsList.contains(appGameBetting.getBettingItem())){
-                    appGameBetting.setIsWinning(2);
-                    appGameBettingService.updateById(appGameBetting);
-                    continue;
-                }
-            }else if(appGameBetting.getBettingGameType() == 1 || appGameBetting.getBettingGameType() == 2){
-                List<AppGameItemBettingVO> itemList = JSON.parseArray(appGameBetting.getBettingItem(), AppGameItemBettingVO.class);
-                if(itemList == null || itemList.isEmpty()){
-                    appGameBetting.setIsWinning(2);
-                    appGameBettingService.updateById(appGameBetting);
-                    continue;
-                }
-                List<String> bettingItemList = itemList.stream().map(AppGameItemBettingVO::getBettingItem).collect(Collectors.toList());
-                boolean isWinning = false;
-                for (int j = 0; j < bettingItemList.size(); j++) {
-                    String bettingItemStr = bettingItemList.get(j);
-                    if(bettingItemsList.contains(bettingItemStr)){
-                        isWinning = true;
-                        break;
-                    }
-                }
-
-                if(!isWinning){
-                    appGameBetting.setIsWinning(2);
-                    appGameBettingService.updateById(appGameBetting);
-                    continue;
-                }
-
-                if(appGameBetting.getBettingGameType() == 2){
-                    for (int k = 0; k < itemList.size(); k++) {
-                        AppGameItemBettingVO appGameItemBettingVO = itemList.get(k);
-                        if(bettingItemsList.contains(appGameItemBettingVO.getBettingItem())){
-                            bettingAmount = appGameBetting.getBettingAmount() * appGameItemBettingVO.getBettingMultiple();
-                            bettingAmount = new BigDecimal(bettingAmount + "").setScale(4, RoundingMode.DOWN).doubleValue();
-                            break;
-                        }
-                    }
-                }
-            }
-
-            AppUser appUser = appUserService.selectAppUserByUserid(appGameBetting.getUserId());
-            if(appUser == null){
-                appGameBetting.setIsWinning(1);
-                appGameBettingService.updateById(appGameBetting);
-                continue;
-            }
-
-            // 添加推送消息用户
-            String userId = appUser.getUserid() + "";
-            if(!userIds.contains(userId)){
-                userIds.add(userId);
-            }
-
-            // 更新用户余额
-            //if(appGameBetting.getBettingType() == 0){
-            //    appUser.setDiamondCoin(appUser.getDiamondCoin() + bettingAmount );
-            //    appUser.setDiamondCoinTotal(appUser.getDiamondCoinCashTotal() + bettingAmount);
-            //    appUser.setDiamondCoinCash(appUser.getDiamondCoinCash() + bettingAmount);
-            // 更新用户金币
-            //}else{
-            //    appUser.setCoin(appUser.getCoin() + bettingAmount);
-            //        if(appUser.getRole() == 1){
-            //            appUser.setCoinCash(appUser.getCoinCash() + bettingAmount);
-            //        }
-            //}
-
-            //appUserService.updateAppUser(appUser);
-
-            //redisCache.deleteObject("U:UserInfo:" + appUser.getUserid());
-
-            appGameBetting.setIsWinning(1);
-            appGameBettingService.updateById(appGameBetting);
-
-            FinTranRecord finTranRecord = new FinTranRecord();
-
-            //finTranRecord.setAfterCoin(appUser.getCoin());
-            //finTranRecord.setAfterDiamondCoin(appUser.getDiamondCoin());
-
-            if(appGameBetting.getBettingType() == 0){
-                finTranRecord.setCurrencyType(4);
-                finTranRecord.setDiamondCoinChange(bettingAmount);
-                finTranRecord.setCoinChange(0.00);
-            }else{
-                finTranRecord.setCurrencyType(2);
-                finTranRecord.setCoinChange(bettingAmount);
-                finTranRecord.setDiamondCoinChange(0.00);
-            }
-
-            finTranRecord.setAfterMoney(0.00);
-            finTranRecord.setMoneyChange(0.00);
-
-            finTranRecord.setAfterTicket(0.00);
-            finTranRecord.setTicketChange(0.00);
-
-            finTranRecord.setToUid(appUser.getUserid());
-            finTranRecord.setUid(appUser.getUserid());
-
-            finTranRecord.setSceneId1(0L);
-            finTranRecord.setSceneId2(null);
-            finTranRecord.setSceneType(0L);
-
-            finTranRecord.setTranGroupId(appGameBetting.getId());
-
-            if(appGameBetting.getBettingType() == 0){
-                finTranRecord.setTranType1(FinTranType1.U_Income_Coin_Balance.getType());
-            }else{
-                finTranRecord.setTranType1(FinTranType1.U_Income_Coin.getType());
-            }
-
-            finTranRecord.setTranType2(FinTranType2.GAME_REWARD.getType());
-            finTranRecord.setTranType3(FinTranType3.CHARGE_WIN_GAME.getType());
-
-            finTranRecord.setRemarks(gameDate + "期,游戏中奖");
-
-            finTranRecord.setConsumptionCoin(appGameBetting.getBettingAmount());
-            finTranRecord.setConsumptionMoney(0.00);
-            finTranRecord.setCommissionRelatedUid(0L);
-            finTranRecord.setAgentId(appUser.getAgentId());
-
-            finTranRecord.setCreateTime(new Date());
-
-            finTranRecord.setFromUid(appGameBetting.getUserId());
-            finTranRecord.setGoodsId(0L);
-            finTranRecord.setGuildId(0L);
-            finTranRecord.setManagerCoId(0L);
-            finTranRecord.setManagerId(0L);
-
-            finTranRecord.setPerc(0.00);
-            finTranRecord.setProId(0L);
-            finTranRecord.setProCount(0L);
-
-            finTranRecord.setOrderId(appGameBetting.getId());
-            //finTranRecordService.insertFinTranRecord(finTranRecord);
-            appUserService.updateUserAmount(finTranRecord,false);
-        }
-        return userIds;
-    }
-
-    public void sendMsg(List<String> userIdList){
-        if(userIdList == null || userIdList.isEmpty()){
-            return;
-        }
-
-        JSONObject paramJson = new JSONObject();
-        paramJson.put("type", "UserSystemNotify");
-        paramJson.put("subType", "UserRefreshBalance");
-        paramJson.put("content", JSONObject.parseObject("{'msg':'刷新余额'}"));
-
-        List<String> sendUsers = new ArrayList<>();
-        if(userIdList.size() > 500){
-            for(String userId : userIdList){
-                if(sendUsers.size() >= 500){
-                    TencentCloudImUtil.imPushBatchSendMsg(sendUsers, paramJson.toString());
-                    sendUsers.clear();
-                }
-                sendUsers.add(userId);
-            }
-            // 剩余不超过500
-            if(!sendUsers.isEmpty()){
-                TencentCloudImUtil.imPushBatchSendMsg(sendUsers, paramJson.toString());
-            }
-        }else{
-            TencentCloudImUtil.imPushBatchSendMsg(userIdList, paramJson.toString());
-        }
-    }
 }

+ 3 - 3
game-business/src/main/java/com/game/business/task/WebSokcetTask.java

@@ -16,9 +16,9 @@ public class WebSokcetTask {
 
     @Scheduled(cron = "0/5 * * * * ? ")
     public void liveDividedTask() throws IOException {
-        if(!taskSwitch){
-            return;
-        }
+//        if(!taskSwitch){
+//            return;
+//        }
 
         if(Common.sessionMap.containsKey(Common.GAME_ONE_CODE)){
             Session session = Common.sessionMap.get(Common.GAME_ONE_CODE);

+ 1 - 1
game-business/src/main/java/com/game/business/websocket/WebSocketConnent.java

@@ -35,7 +35,7 @@ public class WebSocketConnent {
 
     public void connect() throws Exception{
         Environment environment = SpringUtils.getBean(Environment.class);
-        while (environment.getProperty("websocket.switch",boolean.class)){
+        while (true){
             try {
                 System.out.println("正在" + (this.WS_CONNENT_NUM == 0 ? "" : ("第" + this.WS_CONNENT_NUM + "次")) + "连接WebSocket[" + this.WS_URL_NAME + "]......");
 

+ 81 - 0
game-business/src/main/resources/mapper/business/AppGameLotteryHistoryMapper.xml

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.game.business.mapper.AppGameLotteryHistoryMapper">
+    
+    <resultMap type="com.game.business.domain.AppGameLotteryHistory" id="AppGameLotteryHistoryResult">
+        <result property="id"    column="id"    />
+        <result property="classId"    column="class_id"    />
+        <result property="gameId"    column="game_id"    />
+        <result property="gameDate"    column="game_date"    />
+        <result property="isLottery"    column="is_lottery"    />
+        <result property="gameLotterySucc"    column="game_lottery_succ"    />
+        <result property="gameRecordDate"    column="game_record_date"    />
+    </resultMap>
+
+    <sql id="selectAppGameLotteryHistoryVo">
+        select id, class_id, game_id, game_date, is_lottery, game_lottery_succ, game_record_date from app_game_lottery_history
+    </sql>
+
+    <select id="selectAppGameLotteryHistoryList" parameterType="com.game.business.domain.AppGameLotteryHistory" resultMap="AppGameLotteryHistoryResult">
+        <include refid="selectAppGameLotteryHistoryVo"/>
+        <where>  
+            <if test="classId != null "> and class_id = #{classId}</if>
+            <if test="gameId != null "> and game_id = #{gameId}</if>
+            <if test="gameDate != null  and gameDate != ''"> and game_date = #{gameDate}</if>
+            <if test="isLottery != null  and isLottery != ''"> and is_lottery = #{isLottery}</if>
+            <if test="gameLotterySucc != null  and gameLotterySucc != ''"> and game_lottery_succ = #{gameLotterySucc}</if>
+            <if test="gameRecordDate != null "> and game_record_date = #{gameRecordDate}</if>
+        </where>
+    </select>
+    
+    <select id="selectAppGameLotteryHistoryById" parameterType="Long" resultMap="AppGameLotteryHistoryResult">
+        <include refid="selectAppGameLotteryHistoryVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertAppGameLotteryHistory" parameterType="com.game.business.domain.AppGameLotteryHistory" useGeneratedKeys="true" keyProperty="id">
+        insert into app_game_lottery_history
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="classId != null">class_id,</if>
+            <if test="gameId != null">game_id,</if>
+            <if test="gameDate != null">game_date,</if>
+            <if test="isLottery != null">is_lottery,</if>
+            <if test="gameLotterySucc != null">game_lottery_succ,</if>
+            <if test="gameRecordDate != null">game_record_date,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="classId != null">#{classId},</if>
+            <if test="gameId != null">#{gameId},</if>
+            <if test="gameDate != null">#{gameDate},</if>
+            <if test="isLottery != null">#{isLottery},</if>
+            <if test="gameLotterySucc != null">#{gameLotterySucc},</if>
+            <if test="gameRecordDate != null">#{gameRecordDate},</if>
+         </trim>
+    </insert>
+
+    <update id="updateAppGameLotteryHistory" parameterType="com.game.business.domain.AppGameLotteryHistory">
+        update app_game_lottery_history
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="classId != null">class_id = #{classId},</if>
+            <if test="gameId != null">game_id = #{gameId},</if>
+            <if test="gameDate != null">game_date = #{gameDate},</if>
+            <if test="isLottery != null">is_lottery = #{isLottery},</if>
+            <if test="gameLotterySucc != null">game_lottery_succ = #{gameLotterySucc},</if>
+            <if test="gameRecordDate != null">game_record_date = #{gameRecordDate},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAppGameLotteryHistoryById" parameterType="Long">
+        delete from app_game_lottery_history where id = #{id}
+    </delete>
+
+    <delete id="deleteAppGameLotteryHistoryByIds" parameterType="String">
+        delete from app_game_lottery_history where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 6 - 1
game-common/src/main/java/com/game/common/constant/CacheConstants.java

@@ -60,13 +60,18 @@ public class CacheConstants
     /**
      * 开奖任务锁
      */
-    public static final String GAME_LOTTERY_TASK = "game_lottery_task:";
+    public static final String GAME_LOTTERY_TASK_NEW = "game_lottery_task_new:";
 
     /**
      * 创建开奖任务锁
      */
     public static final String GAME_LOTTERY_TASK_CREATE = "game_lottery_task_create:";
 
+    /**
+     * 创建开奖任务锁
+     */
+    public static final String GAME_LOTTERY_TASK_CREATE_NEW = "game_lottery_task_create_new:";
+
     /**
      * 倍数记录锁
      */

+ 1 - 1
game-generator/src/main/java/com/game/generator/controller/GenController.java

@@ -45,7 +45,7 @@ import com.game.generator.service.IGenTableService;
  */
 @RestController
 @RequestMapping("/tool/gen")
-@DataSource(DataSourceType.SLAVE)
+//@DataSource(DataSourceType.SLAVE)
 public class GenController extends BaseController
 {
     @Autowired