|
@@ -11,9 +11,7 @@ import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.common.util.DictAnnotationUtil;
|
|
|
import org.jeecg.modules.app.service.IGameService;
|
|
|
import org.jeecg.modules.app.vo.game.*;
|
|
|
-import org.jeecg.modules.system.app.entity.AppGame;
|
|
|
-import org.jeecg.modules.system.app.entity.AppInsure;
|
|
|
-import org.jeecg.modules.system.app.entity.InsurePrice;
|
|
|
+import org.jeecg.modules.system.app.entity.*;
|
|
|
import org.jeecg.modules.system.app.mapper.*;
|
|
|
import org.jeecg.modules.system.app.utils.StringMasker;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -38,6 +36,9 @@ public class GameServiceImpl implements IGameService {
|
|
|
@Autowired
|
|
|
private AppGamePriceRulesMapper appGamePriceRulesMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AppGameScheduleMapper appGameScheduleMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
private AppInsureMapper appInsureMapper;
|
|
|
@Autowired
|
|
@@ -164,8 +165,12 @@ public class GameServiceImpl implements IGameService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result<AppGame> findScoreByGameId(String id) {
|
|
|
- AppGame appGame = appGameMapper.selectById(id);
|
|
|
+ public Result<AppGame> findScoreByGameId(String orderId) {
|
|
|
+ Result<String> result = findGetGameId(orderId);
|
|
|
+ if (!result.isSuccess()){
|
|
|
+ return Result.error(result.getMessage());
|
|
|
+ }
|
|
|
+ AppGame appGame = appGameMapper.selectById(result.getMessage());
|
|
|
if (appGame==null){
|
|
|
return Result.error("请确认所查询需要的数据是否存在");
|
|
|
}
|
|
@@ -175,5 +180,34 @@ public class GameServiceImpl implements IGameService {
|
|
|
return Result.ok(appGame);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Result<String> findGetGameId(String orderId) {
|
|
|
+ AppOrder appOrder = appOrderMapper.selectById(orderId);
|
|
|
+ if (appOrder==null){
|
|
|
+ return Result.error("该订单不存在");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(appOrder.getProductIds())||appOrder.getType()!=1){
|
|
|
+ return Result.error("该订单不存在赛事商品");
|
|
|
+ }
|
|
|
+ AppGamePriceRules appGamePriceRules = appGamePriceRulesMapper.selectById(appOrder.getProductIds());
|
|
|
+ if (appGamePriceRules==null){
|
|
|
+ return Result.error("该商品不存在,订单号:"+appOrder.getOrderCode());
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(appGamePriceRules.getGameId())){
|
|
|
+ return Result.error("该商品未关联赛事,订单号:"+appOrder.getOrderCode());
|
|
|
+ }
|
|
|
+ return Result.ok(appGamePriceRules.getGameId());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Result<List<GameScheduleVO>> findScheduleByOrderId(String orderId) {
|
|
|
+ Result<String> result = findGetGameId(orderId);
|
|
|
+ if (!result.isSuccess()){
|
|
|
+ return Result.error(result.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return Result.ok(appGameScheduleMapper.findByGameId(result.getMessage()));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|