|  | @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
	
		
			
				|  |  |  import com.zanxiang.erp.base.ErpServer;
 | 
	
		
			
				|  |  | +import com.zanxiang.erp.base.rpc.IDingTalkMsgRpc;
 | 
	
		
			
				|  |  |  import com.zanxiang.erp.base.rpc.ISysUserRpc;
 | 
	
		
			
				|  |  |  import com.zanxiang.erp.security.util.SecurityUtil;
 | 
	
		
			
				|  |  |  import com.zanxiang.game.module.base.pojo.enums.DeleteEnum;
 | 
	
	
		
			
				|  | @@ -44,9 +45,48 @@ public class GameAuthRoleServiceImpl extends ServiceImpl<GameAuthRoleMapper, Gam
 | 
	
		
			
				|  |  |      @DubboReference(providedBy = ErpServer.SERVER_DUBBO_NAME)
 | 
	
		
			
				|  |  |      private ISysUserRpc sysUserRpc;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @DubboReference(providedBy = ErpServer.SERVER_DUBBO_NAME)
 | 
	
		
			
				|  |  | +    private IDingTalkMsgRpc dingTalkMsgRpc;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private IGameAuthService gameAuthService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public void dingTalkCustomer(Long gameId, String gameName, String msg) {
 | 
	
		
			
				|  |  | +        Set<Long> customerIdSet = super.list(new LambdaQueryWrapper<GameAuthRole>()
 | 
	
		
			
				|  |  | +                .eq(GameAuthRole::getAuthType, GameAuthEnum.CUSTOMER.getValue())
 | 
	
		
			
				|  |  | +        ).stream().map(GameAuthRole::getUserId).collect(Collectors.toSet());
 | 
	
		
			
				|  |  | +        if (CollectionUtils.isEmpty(customerIdSet)) {
 | 
	
		
			
				|  |  | +            return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        Set<Long> gameCustomerIdSet = gameAuthService.list(new LambdaQueryWrapper<GameAuth>()
 | 
	
		
			
				|  |  | +                .eq(GameAuth::getGameId, gameId)
 | 
	
		
			
				|  |  | +                .in(GameAuth::getUserId, customerIdSet)
 | 
	
		
			
				|  |  | +        ).stream().map(GameAuth::getUserId).collect(Collectors.toSet());
 | 
	
		
			
				|  |  | +        if (CollectionUtils.isEmpty(gameCustomerIdSet)) {
 | 
	
		
			
				|  |  | +            return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        gameCustomerIdSet.forEach(customerId -> {
 | 
	
		
			
				|  |  | +            try {
 | 
	
		
			
				|  |  | +                dingTalkMsgRpc.sendByUserId(customerId, msgStr(gameName, msg));
 | 
	
		
			
				|  |  | +            } catch (Exception ignored) {
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    private String msgStr(String gameName, String msg) {
 | 
	
		
			
				|  |  | +        return "客服系统关键词监测: " +
 | 
	
		
			
				|  |  | +                "\n" +
 | 
	
		
			
				|  |  | +                "时间: " +
 | 
	
		
			
				|  |  | +                LocalDateTime.now() +
 | 
	
		
			
				|  |  | +                "\n" +
 | 
	
		
			
				|  |  | +                "游戏名称: " +
 | 
	
		
			
				|  |  | +                gameName +
 | 
	
		
			
				|  |  | +                "\n" +
 | 
	
		
			
				|  |  | +                "玩家发送内容: " +
 | 
	
		
			
				|  |  | +                msg;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public boolean isCustomer() {
 | 
	
		
			
				|  |  |          return super.count(new LambdaQueryWrapper<GameAuthRole>()
 |