| | |
| | | import com.yeshi.fanli.entity.integral.IntegralExchange.ExchangeTypeEnum;
|
| | | import com.yeshi.fanli.entity.integral.IntegralExchangeRecord;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.integral.CodePublishRecordService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralExchangeRecordService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralExchangeService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | | @Resource
|
| | | private CodePublishRecordService codePublishRecordService;
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public List<IntegralExchange> listExchange(long start, int count, Long uid){
|
| | |
| | | Long id = exchange.getId();
|
| | | if (type == ExchangeTypeEnum.freeCouponBuy) {
|
| | | // 注:因自购免单券,一个用户只能兑换一次,则当前用户一旦兑换成功,自购免单券兑换入口永久在当前用户金币兑换列表中消失。
|
| | | long num = integralExchangeRecordMapper.countRecordByUid(id, uid);
|
| | | long num = integralExchangeRecordMapper.countRecordByUid(id, uid, null);
|
| | | if (num >= 1) {
|
| | | listValid.remove(i);
|
| | | i --;
|
| | |
| | | }
|
| | |
|
| | | // 邀请码激活卡,兑换项,如果当前用户已经激活了邀请功能,则不需要显示该兑换项。
|
| | | if (type == ExchangeTypeEnum.inviteCodeActivate && hasCode) {
|
| | | listValid.remove(i);
|
| | | i --;
|
| | | continue;
|
| | | if (type == ExchangeTypeEnum.inviteCodeActivate) {
|
| | | if (hasCode) {
|
| | | listValid.remove(i);
|
| | | i --;
|
| | | continue;
|
| | | } |
| | | |
| | | // 兑换一次之后隐藏
|
| | | long num = integralExchangeRecordMapper.countRecordByUid(id, uid, null);
|
| | | if (num >= 1) {
|
| | | listValid.remove(i);
|
| | | i --;
|
| | | continue;
|
| | | }
|
| | | }
|
| | |
|
| | | // 邀请码发布卡,兑换项,如果当前用户未激活邀请功能,则不需要显示该兑换项。
|
| | | if (type == ExchangeTypeEnum.inviteCodePublish && !hasCode) {
|
| | | listValid.remove(i);
|
| | | i --;
|
| | | continue;
|
| | | if (type == ExchangeTypeEnum.inviteCodePublish) {
|
| | | if (!hasCode) {
|
| | | listValid.remove(i);
|
| | | i --;
|
| | | continue;
|
| | | }
|
| | | |
| | | if(codePublishRecordService.countValidRecord(uid) > 0) {
|
| | | exchange.setBtnName("去查看");
|
| | | exchange.setNeedJump(true);
|
| | | }
|
| | | }
|
| | |
|
| | | String progress = exchange.getProgress();
|
| | | if (StringUtil.isNullOrEmpty(progress))
|
| | | continue;
|
| | |
|
| | | // 自购免单券-只能兑换一次
|
| | | if (type == ExchangeTypeEnum.freeCouponBuy) {
|
| | | long num = integralExchangeRecordMapper.countRecordByUid(id, uid, null);
|
| | | if (num >= 1) {
|
| | | listValid.remove(i);
|
| | | i --;
|
| | | continue;
|
| | | }
|
| | | }
|
| | | |
| | | // 今日兑换情况
|
| | | long num = integralExchangeRecordMapper.countRecordByUid(id, uid);
|
| | | long num = integralExchangeRecordMapper.countRecordByUid(id, uid, 1);
|
| | | Integer upperLimit = exchange.getUpperLimit();
|
| | | if (upperLimit == null) {
|
| | | progress = progress.replace("{已兑换}", num + "").replace("/{上限数}", "");
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public long countRecordByUid(long exchangeid, Long uid){
|
| | | return integralExchangeRecordMapper.countRecordByUid(exchangeid, uid);
|
| | | public long countRecordByUid(long exchangeid, Long uid, Integer today){
|
| | | return integralExchangeRecordMapper.countRecordByUid(exchangeid, uid, today);
|
| | | }
|
| | |
|
| | | @Override
|