dos il y a 2 mois
Parent
commit
cf56a23688

+ 10 - 0
game-business/src/main/java/com/game/business/mapper/AppGameLotteryMapper.java

@@ -61,9 +61,19 @@ public interface AppGameLotteryMapper extends BaseMapper<AppGameLottery> {
      * */
     public List<AppGameLottery> selectLeakLottery(@Param("time") String time);
 
+    /**
+     * 查询遗漏数据2
+     * */
+    public List<AppGameLottery> selectLeakLottery2(@Param("time") String time);
+
     /**
      * 查询遗漏数据
      * */
     public AppGameLottery leakInfo(@Param("gameId") Long gameId, @Param("gameDate") String gameDate);
 
+    /**
+     * 查询遗漏数据
+     * */
+    public AppGameLottery leakInfo2(@Param("gameId") Long gameId, @Param("gameDate") String gameDate);
+
 }

+ 22 - 0
game-business/src/main/java/com/game/business/service/impl/AppGameLotteryServiceImpl.java

@@ -141,6 +141,23 @@ public class AppGameLotteryServiceImpl extends ServiceImpl<AppGameLotteryMapper,
                 }
             });
         }
+        List<AppGameLottery> list2 = appGameLotteryMapper.selectLeakLottery2(time);
+        if(null != list2 && list2.size() > 0) {
+            list2.forEach(e->{
+                if(null != e.getGameId() && StringUtils.isNotBlank( e.getGameDate())){
+                    LambdaQueryWrapper<AppGameLottery> queryWrapper = new LambdaQueryWrapper<>();
+                    queryWrapper.eq(AppGameLottery::getGameId, e.getGameId());
+                    queryWrapper.eq(AppGameLottery::getGameDate, e.getGameDate());
+                    if(null == appGameLotteryMapper.selectOne(queryWrapper)){
+                        AppGameLottery insert = new AppGameLottery();
+                        BeanUtils.copyProperties(e,insert);
+                        insert.setId(null);
+                        insert.setIsLottery(0);//设置为未开奖
+                        insertAppGameLottery(insert);
+                    }
+                }
+            });
+        }
     }
 
     @Override
@@ -155,6 +172,11 @@ public class AppGameLotteryServiceImpl extends ServiceImpl<AppGameLotteryMapper,
         AppGameLottery history = appGameLotteryMapper.leakInfo(reslut.getGameId(),reslut.getGameDate());
         if(null != history){
             reslut.setGameLotterySucc(history.getGameLotterySucc());
+        }else{
+            AppGameLottery history2 = appGameLotteryMapper.leakInfo2(reslut.getGameId(),reslut.getGameDate());
+            if(null != history2){
+                reslut.setGameLotterySucc(history2.getGameLotterySucc());
+            }
         }
         return reslut;
     }

+ 12 - 0
game-business/src/main/resources/mapper/business/AppGameLotteryMapper.xml

@@ -87,8 +87,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                  and game_record_date &lt;= #{time}
     </select>
 
+    <select id="selectLeakLottery2" resultMap="AppGameLotteryResult">
+        select * from app_game_lottery_history2
+                 where is_lottery != 0
+                 and  CONCAT(game_id,'_',game_date) in (select CONCAT(game_id,'_',game_date) from app_game_lottery where is_lottery = 0)
+                 and game_record_date &lt;= #{time}
+    </select>
+
     <select id="leakInfo" resultMap="AppGameLotteryResult">
         select * from app_game_lottery_history
                  where game_id = #{gameId} and game_date = #{gameDate}
     </select>
+
+    <select id="leakInfo2" resultMap="AppGameLotteryResult">
+        select * from app_game_lottery_history2
+                 where game_id = #{gameId} and game_date = #{gameDate}
+    </select>
 </mapper>