|
@@ -12,10 +12,7 @@ import org.jeecg.modules.system.app.dto.*;
|
|
|
import org.jeecg.modules.system.app.entity.AppGame;
|
|
|
import org.jeecg.modules.system.app.entity.AppGamePriceRules;
|
|
|
import org.jeecg.modules.system.app.entity.AppGameSchedule;
|
|
|
-import org.jeecg.modules.system.app.mapper.AppGameMapper;
|
|
|
-import org.jeecg.modules.system.app.mapper.AppGamePriceRulesMapper;
|
|
|
-import org.jeecg.modules.system.app.mapper.AppGameScheduleMapper;
|
|
|
-import org.jeecg.modules.system.app.mapper.AppSiteMapper;
|
|
|
+import org.jeecg.modules.system.app.mapper.*;
|
|
|
import org.jeecg.modules.system.app.service.IAppGameService;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -52,6 +49,8 @@ public class AppGameServiceImpl extends ServiceImpl<AppGameMapper, AppGame> impl
|
|
|
|
|
|
@Autowired
|
|
|
RedisTemplate<String, String> redisTemplate;
|
|
|
+ @Autowired
|
|
|
+ private AppOrderMapper appOrderMapper;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -104,6 +103,13 @@ public class AppGameServiceImpl extends ServiceImpl<AppGameMapper, AppGame> impl
|
|
|
BeanUtils.copyProperties(gameCuDTO, game);
|
|
|
AppGame dbGame = baseMapper.selectById(game.getId());
|
|
|
if (null == dbGame) throw new JeecgBootException("未找到对应数据", SC_INTERNAL_SERVER_ERROR_500);
|
|
|
+
|
|
|
+ List<AppGameRuleDTO> byGameId = rulesMapper.findByGameId(dbGame.getId());
|
|
|
+ Long orderNum= appOrderMapper.findByProductIds(byGameId);
|
|
|
+ if (orderNum>0){
|
|
|
+ throw new JeecgBootException("该赛事已存在报名不允许修改", SC_INTERNAL_SERVER_ERROR_500);
|
|
|
+ }
|
|
|
+
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
// checkPermission(sysUser,dbGame);
|
|
|
game.setOrgCode(sysUser.getOrgCode());
|