Merge remote-tracking branch 'origin/div' into div
| | |
| | | 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) {
|
| | |
| | | @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()));
|
| | |
| | | * @return |
| | | */ |
| | | BigDecimal countMoneyByUidAndState(@Param("uid") Long uid, @Param("state") Integer state); |
| | | |
| | | /** |
| | | * 统计当日提现次数 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | long countTodayByUid(@Param("uid") Long uid); |
| | | |
| | | } |
| | |
| | | WHERE d.rpe_uid = #{uid} AND d.`rpe_state` = #{state} |
| | | </select> |
| | | |
| | | <select id="countTodayByUid" resultType="Long"> |
| | | SELECT IFNULL(COUNT(d.rpe_id),0) FROM yeshi_ec_red_pack_exchange d |
| | | WHERE d.rpe_uid = #{uid} AND TO_DAYS(d.`rpe_create_time`) = TO_DAYS(NOW()) |
| | | </select> |
| | | </mapper> |
| | |
| | | if (amount.compareTo(new BigDecimal(moneyMin)) < 0 || amount.compareTo(new BigDecimal(moneyMax)) > 0)
|
| | | throw new RedPackExchangeException(1, "提现金额至少" + moneyMin + "元至多" + moneyMax + "元");
|
| | |
|
| | | Date nowDate = new Date();
|
| | |
|
| | | long countToday = redPackExchangeMapper.countTodayByUid(uid);
|
| | | String extractDayMax = redPackConfigService.getValueByKey("extract_day_max");
|
| | | if (!StringUtil.isNullOrEmpty(extractDayMax) && countToday >= Long.parseLong(extractDayMax)) |
| | | throw new RedPackExchangeException(1, "今日红包提现次数超限");
|
| | | |
| | | |
| | | Date nowDate = new Date();
|
| | | // 提现申请
|
| | | RedPackExchange exchange = new RedPackExchange();
|
| | | exchange.setUid(uid);
|
| | |
| | |
|
| | | 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;
|
| | |
| | | UserInfo boss = threeSaleSerivce.getBoss(uid);
|
| | | if(boss != null) {
|
| | | UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(boss.getId());
|
| | | if (activeLog != null) {
|
| | | // 小于2.0.2版本不增加积分
|
| | | if (!VersionUtil.greaterThan_2_0_2("appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android",
|
| | | activeLog.getVersionCode()))
|
| | | return;
|
| | | }
|
| | | 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);
|
| | | }
|
| | |
| | | dto.setTitle("红包增加");
|
| | | dto.setMoney("¥" + money.setScale(2));
|
| | | dto.setBalance("¥" + redPackBalanceService.getBalance(uid).setScale(2));
|
| | | userMoneyMsgNotificationService.redPackMsg(uid, MsgTypeMoneyTypeEnum.redPackFirstSharedOrder, new Gson().toJson(dto), "红包可用于购买会员");
|
| | | userMoneyMsgNotificationService.redPackMsg(uid, MsgTypeMoneyTypeEnum.redPackFirstSharedOrder, |
| | | new Gson().toJson(dto), "请到“我的-红包”中查看");
|
| | | }
|
| | |
|
| | |
|
| | |
| | | dto.setTitle("红包增加");
|
| | | dto.setMoney("¥" + money.setScale(2));
|
| | | dto.setBalance("¥" + redPackBalanceService.getBalance(uid).setScale(2));
|
| | | userMoneyMsgNotificationService.redPackMsg(uid, MsgTypeMoneyTypeEnum.redPackMonthSharedOrder, new Gson().toJson(dto), "红包可用于购买会员");
|
| | | userMoneyMsgNotificationService.redPackMsg(uid, MsgTypeMoneyTypeEnum.redPackMonthSharedOrder,
|
| | | new Gson().toJson(dto), "请到“我的-红包”中查看");
|
| | | }
|
| | |
|
| | |
|
| | |
| | | return;
|
| | |
|
| | | UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(boss.getId());
|
| | | if (activeLog != null) {
|
| | | // 小于2.0.2版本不增加积分
|
| | | if (!VersionUtil.greaterThan_2_0_2("appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android",
|
| | | activeLog.getVersionCode()))
|
| | | return;
|
| | | }
|
| | | 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());
|
| | | if (totalReward > 0)
|
| | |
| | | dto.setTitle("红包增加");
|
| | | dto.setMoney("¥" + money.setScale(2));
|
| | | dto.setBalance("¥" + redPackBalanceService.getBalance(boss.getId()).setScale(2));
|
| | | userMoneyMsgNotificationService.redPackMsg(boss.getId(), MsgTypeMoneyTypeEnum.redPackInviteSucceed, new Gson().toJson(dto), "红包可用于购买会员");
|
| | | userMoneyMsgNotificationService.redPackMsg(boss.getId(), MsgTypeMoneyTypeEnum.redPackInviteSucceed,
|
| | | new Gson().toJson(dto), "请到“我的-红包”中查看");
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.mongodb.redpack.RedPackWinNewUserDao;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackBalance;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackWinNewUser;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
|
| | |
| | | if (uid == null || uid <= 0)
|
| | | return true; // 未登录弹出
|
| | |
|
| | | RedPackBalance redPackBalance = redPackBalanceService.selectByPrimaryKey(uid);
|
| | | if (redPackBalance != null && redPackBalance.getState() != null |
| | | && redPackBalance.getState() == RedPackBalance.STATE_LOCKED) |
| | | return false; // 红包封禁
|
| | | |
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || userInfoExtra.getFirstLoginTime() == null)
|
| | | return false;
|
| | |
| | | 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;
|
| | |
| | | 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
|
| | |
| | | }
|
| | |
|
| | | @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))
|
| | |
| | | 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)
|
| | |
| | |
|
| | |
|
| | | @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, "用户未登录");
|
| | |
|
| | |
| | | }
|
| | | });
|
| | | } else if (tokenType == TokenTypeEnum.redPack) {
|
| | | if(!VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | throw new TokenRecordException(1, "请升级到最新版");
|
| | | |
| | | try {
|
| | | msg = "领取红包成功,请到[我的-红包]中查看";
|
| | | // 领取红包、更新记录
|
| | |
| | |
|
| | | 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;
|
| | |
| | | * @return
|
| | | * @throws TokenRecordException
|
| | | */
|
| | | public TokenVO discernToken(String token, Long uid) throws TokenRecordException;
|
| | | public TokenVO discernToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException;
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @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);
|
| | |
| | | goods.setIncludeDxjh(0);
|
| | |
|
| | | goods.setSellerId(item.optLong("seller_id"));
|
| | | goods.setShopTitle(item.optString("shop_title"));
|
| | | goods.setShopTitle(item.optString("nick"));
|
| | | goods.setTitle(item.optString("title"));
|
| | | goods.setProvcity(item.optString("provcity"));
|
| | |
|