|  | @@ -5,10 +5,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.base.pojo.enums.PayWayEnum;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.mybatis.entity.GameExt;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.mybatis.entity.GameRemitLog;
 | 
	
		
			
				|  |  | +import com.zanxiang.game.module.mybatis.entity.User;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.mybatis.mapper.GameRemitLogMapper;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.sdk.pojo.param.GameRemitLogParam;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.sdk.service.IGameExtService;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.sdk.service.IGameRemitLogService;
 | 
	
		
			
				|  |  | +import com.zanxiang.game.module.sdk.service.IUserService;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.sdk.util.SignUtil;
 | 
	
		
			
				|  |  |  import com.zanxiang.module.util.DateUtil;
 | 
	
		
			
				|  |  |  import com.zanxiang.module.util.exception.BaseException;
 | 
	
	
		
			
				|  | @@ -31,6 +33,9 @@ public class GameRemitLogServiceImpl extends ServiceImpl<GameRemitLogMapper, Gam
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private IGameExtService gameExtService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private IUserService userService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public boolean addOrUpdate(GameRemitLogParam param) {
 | 
	
		
			
				|  |  |          GameExt gameExt = gameExtService.getByGameAppId(param.getAppId());
 | 
	
	
		
			
				|  | @@ -40,9 +45,6 @@ public class GameRemitLogServiceImpl extends ServiceImpl<GameRemitLogMapper, Gam
 | 
	
		
			
				|  |  |          sb.append("&userId=").append(param.getUserId());
 | 
	
		
			
				|  |  |          sb.append("&merchantOrderNo=").append(param.getMerchantOrderNo());
 | 
	
		
			
				|  |  |          sb.append("&createdTime=").append(param.getCreatedTime());
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        log.error("加密签名字符串, str : {}", sb.toString());
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          String mySign;
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  |              mySign = SignUtil.MD5(sb.toString());
 | 
	
	
		
			
				|  | @@ -55,12 +57,14 @@ public class GameRemitLogServiceImpl extends ServiceImpl<GameRemitLogMapper, Gam
 | 
	
		
			
				|  |  |              log.error("游戏提现签名验证失败, mySign : {}, sign : {}", mySign, param.getSign());
 | 
	
		
			
				|  |  |              throw new BaseException("签名验证失败");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        User user = userService.getById(param.getUserId());
 | 
	
		
			
				|  |  |          GameRemitLog gameRemitLog = super.getOne(new LambdaQueryWrapper<GameRemitLog>()
 | 
	
		
			
				|  |  |                  .eq(GameRemitLog::getMerchantOrderNo, param.getMerchantOrderNo()));
 | 
	
		
			
				|  |  |          if (gameRemitLog == null) {
 | 
	
		
			
				|  |  | -            gameRemitLog = this.transform(param, gameExt.getGameId());
 | 
	
		
			
				|  |  | +            gameRemitLog = this.transform(param, user, gameExt.getGameId());
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |              gameRemitLog.setUserId(param.getUserId());
 | 
	
		
			
				|  |  | +            gameRemitLog.setAgentId(user == null ? null : user.getAgentId());
 | 
	
		
			
				|  |  |              gameRemitLog.setGameId(gameExt.getGameId());
 | 
	
		
			
				|  |  |              gameRemitLog.setAmount(param.getAmount());
 | 
	
		
			
				|  |  |              gameRemitLog.setPayPlatform(PayWayEnum.getKeyByPayWayId(param.getPayPlatform()));
 | 
	
	
		
			
				|  | @@ -71,9 +75,10 @@ public class GameRemitLogServiceImpl extends ServiceImpl<GameRemitLogMapper, Gam
 | 
	
		
			
				|  |  |          return super.saveOrUpdate(gameRemitLog);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    private GameRemitLog transform(GameRemitLogParam param, Long gameId) {
 | 
	
		
			
				|  |  | +    private GameRemitLog transform(GameRemitLogParam param, User user, Long gameId) {
 | 
	
		
			
				|  |  |          return GameRemitLog.builder()
 | 
	
		
			
				|  |  |                  .userId(param.getUserId())
 | 
	
		
			
				|  |  | +                .agentId(user == null ? null : user.getAgentId())
 | 
	
		
			
				|  |  |                  .gameId(gameId)
 | 
	
		
			
				|  |  |                  .merchantOrderNo(param.getMerchantOrderNo())
 | 
	
		
			
				|  |  |                  .amount(param.getAmount())
 |