/** * 反解赛事串集合到比赛ID * * @param weiboMsg * @return */ protected List<MatchIdInfo> reversionMatchId(List<String> matchStrList) { List<MatchIdInfo> matchIdList = new ArrayList<MatchIdInfo>(); for (String matchStr : matchStrList) { MatchIdInfo matchIdInfo = new MatchIdInfo(); String matchId = null; if (matchStr.startsWith(LotteryLetter.JZ.name())) { matchId = prefix + matchStr.substring(2); matchIdInfo.setLottery(LotteryId.JCZQ.name()); } else if (matchStr.startsWith(LotteryLetter.JL.name())) { matchId = prefix + matchStr.substring(2); matchIdInfo.setLottery(LotteryId.JCLQ.name()); } else if (matchStr.startsWith(LotteryLetter.CZ.name())) { matchId = split14MatchStr(matchStr); matchIdInfo.setLottery(LotteryId.CTZC.name()); } matchIdInfo.setMatchId(matchId); matchIdList.add(matchIdInfo); } return matchIdList; }
@Transactional @Override public List<MatchIdInfo> reversionAndCheckMatchId(WeiboMsg weiboMsg) { List<String> matchStrList = analyzeMatchIdBaseWeiboMsg(weiboMsg); List<MatchIdInfo> matchInfoList = reversionMatchId(matchStrList); List<MatchIdInfo> rs = new ArrayList<MatchIdInfo>(); // 查询数据库通过大V彩赛事ID获取球探赛事ID if (null != matchInfoList) { for (MatchIdInfo idInfo : matchInfoList) { String lcMatchId = idInfo.getMatchId(); if (StringUtils.isBlank(lcMatchId)) { continue; } long qtMatchId = qtMatchidDao.findQTMatchId(lcMatchId); if (qtMatchId > 0) { idInfo.setQtMatchId(qtMatchId); rs.add(idInfo); } } } return rs; }