|  | @@ -7,16 +7,19 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
	
		
			
				|  |  |  import com.zanxiang.erp.security.util.SecurityUtil;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.base.pojo.enums.BanStatusEnum;
 | 
	
		
			
				|  |  | +import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.manage.pojo.params.IpBanAddParam;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.manage.pojo.params.IpBanListParam;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.manage.pojo.params.IpBanUpdateParam;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.manage.pojo.vo.IpBanVO;
 | 
	
		
			
				|  |  | +import com.zanxiang.game.module.manage.service.IGameService;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.manage.service.IIpBanService;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.mybatis.entity.IpBan;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.mybatis.mapper.IpBanMapper;
 | 
	
		
			
				|  |  |  import com.zanxiang.module.util.bean.BeanUtil;
 | 
	
		
			
				|  |  |  import lombok.extern.slf4j.Slf4j;
 | 
	
		
			
				|  |  |  import org.apache.logging.log4j.util.Strings;
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  |  import org.springframework.transaction.annotation.Transactional;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -35,10 +38,14 @@ import java.util.Objects;
 | 
	
		
			
				|  |  |  @Service
 | 
	
		
			
				|  |  |  public class IpBanServiceImpl extends ServiceImpl<IpBanMapper, IpBan> implements IIpBanService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private IGameService gameService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public IPage<IpBanVO> list(IpBanListParam param) {
 | 
	
		
			
				|  |  |          return page(param.toPage(), new QueryWrapper<IpBan>().lambda()
 | 
	
		
			
				|  |  |                  .eq(Strings.isNotBlank(param.getIp()), IpBan::getIp, param.getIp())
 | 
	
		
			
				|  |  | +                .eq(param.getGameId() != null, IpBan::getGameId, param.getGameId())
 | 
	
		
			
				|  |  |                  .eq(param.getStatus() != null, IpBan::getStatus, param.getStatus())
 | 
	
		
			
				|  |  |                  .ge(param.getBeginDate() != null, IpBan::getBanTime, param.getBeginDate() == null ? null : LocalDateTime.of(param.getBeginDate(), LocalTime.MIN))
 | 
	
		
			
				|  |  |                  .le(param.getEndDate() != null, IpBan::getBanTime, param.getEndDate() == null ? null : LocalDateTime.of(param.getEndDate(), LocalTime.MAX))
 | 
	
	
		
			
				|  | @@ -50,7 +57,10 @@ public class IpBanServiceImpl extends ServiceImpl<IpBanMapper, IpBan> implements
 | 
	
		
			
				|  |  |          if (Objects.isNull(ipBan)) {
 | 
	
		
			
				|  |  |              return null;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        return BeanUtil.copy(ipBan, IpBanVO.class);
 | 
	
		
			
				|  |  | +        IpBanVO ipBanVO = BeanUtil.copy(ipBan, IpBanVO.class);
 | 
	
		
			
				|  |  | +        GameDTO gameDTO = gameService.getById(ipBanVO.getGameId());
 | 
	
		
			
				|  |  | +        ipBanVO.setGameName(gameDTO == null ? null : gameDTO.getName());
 | 
	
		
			
				|  |  | +        return ipBanVO;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
	
		
			
				|  | @@ -63,6 +73,7 @@ public class IpBanServiceImpl extends ServiceImpl<IpBanMapper, IpBan> implements
 | 
	
		
			
				|  |  |              if (ipBan == null) {
 | 
	
		
			
				|  |  |                  ipBan = IpBan.builder()
 | 
	
		
			
				|  |  |                          .ip(ip)
 | 
	
		
			
				|  |  | +                        .gameId(param.getGameId())
 | 
	
		
			
				|  |  |                          .banTime(LocalDateTime.now())
 | 
	
		
			
				|  |  |                          .status(BanStatusEnum.BAN_STATUS.getStatus())
 | 
	
		
			
				|  |  |                          .operateId(SecurityUtil.getUserId())
 |