dos 1 ماه پیش
والد
کامیت
9e951ef61f

+ 3 - 2
game-business/src/main/java/com/game/business/controller/AppGameLotteryController.java

@@ -205,12 +205,13 @@ public class AppGameLotteryController extends BaseController{
         }
 
         appGameLottery.setIsLottery(1);
-        String time = DateUtil.format(new Date(),"yyyy-").concat(appGameLottery.getGameDate());
+        /*String time = DateUtil.format(new Date(),"yyyy-").concat(appGameLottery.getGameDate());
         if(time.split("\\:").length > 2){
             appGameLottery.setGameRecordDate(DateUtil.parse(time,"yyyy-MM-dd HH:mm:ss"));
         }else{
             appGameLottery.setGameRecordDate(DateUtil.parse(time,"yyyy-MM-dd HH:mm"));
-        }
+        }*/
+        appGameLottery.setGameRecordDate(appGameLotteryService.getLeakDate(appGameLottery.getGameId(),appGameLottery.getGameDate()));
 
         boolean flg = false;
         if(dbAppGameLottery == null){

+ 7 - 0
game-business/src/main/java/com/game/business/service/IAppGameLotteryService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.game.business.domain.AppGameLottery;
 
 import java.util.List;
+import java.util.Date;
 
 /**
  * 游戏开奖记录业务接口
@@ -75,4 +76,10 @@ public interface IAppGameLotteryService extends IService<AppGameLottery> {
      * 查询漏奖数据
      * */
     public AppGameLottery leakInfo(Long id);
+
+
+    /**
+     * 查询备库开奖日期
+     * */
+    public Date getLeakDate(Long gameId,String gameDate);
 }

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

@@ -4,9 +4,11 @@ import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.game.business.domain.AppGame;
 import com.game.business.domain.AppGameLottery;
 import com.game.business.mapper.AppGameLotteryMapper;
 import com.game.business.service.IAppGameLotteryService;
+import com.game.business.service.IAppGameService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -21,6 +23,9 @@ public class AppGameLotteryServiceImpl extends ServiceImpl<AppGameLotteryMapper,
     @Autowired
     private AppGameLotteryMapper appGameLotteryMapper;
 
+    @Autowired
+    private IAppGameService gameService;
+
     @Override
     public long selectCount(Long classId, Long gameId, String gameDate) {
         LambdaQueryWrapper<AppGameLottery> queryLotteryWrapper = Wrappers.lambdaQuery();;
@@ -180,4 +185,30 @@ public class AppGameLotteryServiceImpl extends ServiceImpl<AppGameLotteryMapper,
         }
         return reslut;
     }
+
+    @Override
+    public Date getLeakDate(Long gameId, String gameDate) {
+        Date curGameDate = null;
+        AppGameLottery history = appGameLotteryMapper.leakInfo(gameId,gameDate);
+        if(null != history && history.getIsLottery().intValue() != 0){
+            curGameDate = history.getGameRecordDate();
+        }else{
+            AppGameLottery history2 = appGameLotteryMapper.leakInfo2(gameId,gameDate);
+            if(null != history2 && history2.getIsLottery().intValue() != 0){
+                curGameDate = history2.getGameRecordDate();
+            }else{
+                String time = DateUtil.format(new Date(),"yyyy-").concat(gameDate);
+                if(time.split("\\:").length > 2){
+                    curGameDate = DateUtil.parse(time,"yyyy-MM-dd HH:mm:ss");
+                }else{
+                    curGameDate = DateUtil.parse(time,"yyyy-MM-dd HH:mm");
+                }
+                AppGame game = gameService.selectAppGameById(gameId);
+                if(null != game && StringUtils.isNotBlank(game.getGameExpand1())){
+                    curGameDate = DateUtil.offsetSecond(curGameDate,Integer.parseInt(game.getGameExpand1()));
+                }
+            }
+        }
+        return curGameDate;
+    }
 }

+ 4 - 0
game-ui/src/views/business/game/index.vue

@@ -121,6 +121,7 @@
         </template>
       </el-table-column>
       <el-table-column label="排序" align="center" prop="orderno" />
+      <el-table-column label="开奖间隔时间(秒)" align="center" prop="gameExpand1" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
 <!--          <el-button
@@ -213,6 +214,9 @@
         <el-form-item label="排序" prop="orderno">
           <el-input v-model="form.orderno" placeholder="请输入排序" />
         </el-form-item>
+        <el-form-item label="开奖间隔时间(秒,勿动)" prop="gameExpand1">
+          <el-input v-model="form.gameExpand1" placeholder="请输入开奖间隔时间" />
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>