fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -147,7 +147,7 @@ text = text.trim(); try { TokenVO tokenVO = tokenRecordService.discernToken(text, uid); TokenVO tokenVO = tokenRecordService.discernToken(text, uid, acceptData); out.print(JsonUtil.loadTrueResult(tokenVO)); return; } catch (TokenRecordException e) { @@ -506,7 +506,7 @@ @RequestMapping(value = "tokenReceive", method = RequestMethod.POST) public void tokenReceive(AcceptData acceptData, Long uid, String token, PrintWriter out) { try { String msg = tokenRecordService.receiveToken(token, uid); String msg = tokenRecordService.receiveToken(token, uid, acceptData); out.print(JsonUtil.loadTrueResult(msg)); } catch (TokenRecordException e) { out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg())); fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackWinInviteServiceImpl.java
@@ -12,7 +12,6 @@ import com.google.gson.Gson; import com.yeshi.fanli.dao.mybatis.redpack.RedPackWinInviteMapper; import com.yeshi.fanli.dto.mq.user.body.UserAccountBindingMQMsg; import com.yeshi.fanli.dto.msg.MsgRedPackAddContentDTO; import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum; import com.yeshi.fanli.entity.bus.user.UserActiveLog; @@ -103,13 +102,13 @@ UserInfo boss = threeSaleSerivce.getBoss(uid); if(boss != null) { UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(boss.getId()); if (activeLog != null) { // 小于2.0.2版本不增加积分 if (activeLog == null) return; // 小于2.0.2版本不增加 if (!VersionUtil.greaterThan_2_0_2("appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android", activeLog.getVersionCode())) return; } bossReward(boss.getId(), uid, source, orderNo); } @@ -256,13 +255,13 @@ return; UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(boss.getId()); if (activeLog != null) { // 小于2.0.2版本不增加积分 if (activeLog == null) return; // 小于2.0.2版本不增加 if (!VersionUtil.greaterThan_2_0_2("appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android", activeLog.getVersionCode())) return; } // 同一队员奖励一次 long totalReward = redPackWinInviteMapper.countByUidAndTeamUidAndType(boss.getId(), uid, RedPackWinInviteTypeEnum.inviteSucceed.name()); fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java
@@ -16,6 +16,7 @@ import com.yeshi.fanli.dto.msg.MsgInviteContentDTO; import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO; import com.yeshi.fanli.dto.msg.MsgRedPackGiveContentDTO; import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum; import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord; import com.yeshi.fanli.entity.bus.user.TokenRecord; @@ -48,6 +49,7 @@ import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.StringUtil; import com.yeshi.fanli.util.TokenUtil; import com.yeshi.fanli.util.VersionUtil; import com.yeshi.fanli.vo.msg.TokenVO; @Service @@ -117,7 +119,7 @@ } @Override public TokenVO discernToken(String token, Long uid) throws TokenRecordException { public TokenVO discernToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException { // 解析口令 String parseToken = TokenUtil.parseToken(token); if (StringUtil.isNullOrEmpty(parseToken)) @@ -218,6 +220,10 @@ throw new TokenRecordException(1, "口令已失效"); } } else if (tokenType == TokenTypeEnum.redPack) { if(!VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) throw new TokenRecordException(1, "请升级到最新版"); type = 13; RedPackGiveRecord giveRecord = redPackGiveRecordService.selectByPrimaryKey(Long.parseLong(identify)); if (giveRecord == null) @@ -288,7 +294,7 @@ @Override public String receiveToken(String token, Long uid) throws TokenRecordException { public String receiveToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException { if (uid == null || uid <= 0) throw new TokenRecordException(1, "用户未登录"); @@ -504,6 +510,9 @@ } }); } else if (tokenType == TokenTypeEnum.redPack) { if(!VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) throw new TokenRecordException(1, "请升级到最新版"); try { msg = "领取红包成功,请到[我的-红包]中查看"; // 领取红包、更新记录 fanli/src/main/java/com/yeshi/fanli/service/inter/user/TokenRecordService.java
@@ -2,6 +2,7 @@ import java.util.List; import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.bus.user.TokenRecord; import com.yeshi.fanli.exception.user.TokenRecordException; import com.yeshi.fanli.vo.msg.TokenVO; @@ -25,7 +26,7 @@ * @return * @throws TokenRecordException */ public TokenVO discernToken(String token, Long uid) throws TokenRecordException; public TokenVO discernToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException; /** @@ -34,7 +35,7 @@ * @param uid * @throws TokenRecordException */ public String receiveToken(String token, Long uid) throws TokenRecordException; public String receiveToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException; public void updateByPrimaryKeySelective(TokenRecord record);