| | |
| | | package com.yeshi.fanli.lijin.manager; |
| | | |
| | | import com.ks.vip.exception.LijinBalanceException; |
| | | import com.ks.vip.pojo.DO.UserLijinRecord; |
| | | import com.ks.vip.pojo.Enums.VIPEnum; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import com.yeshi.fanli.entity.push.DeviceActive; |
| | | import com.yeshi.fanli.lijin.dto.LijinSendInfo; |
| | | import com.yeshi.fanli.service.inter.config.ConfigService; |
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService; |
| | | import com.yeshi.fanli.util.RedisManager; |
| | |
| | | |
| | | @Resource |
| | | private UserLijinMnager userLijinMnager; |
| | | |
| | | @Resource |
| | | private ConfigService configService; |
| | | |
| | | |
| | | private String getRedisKey(SystemEnum system, String deviceId, Long uid) { |
| | |
| | | * |
| | | * @param id |
| | | */ |
| | | public LijinSendInfo recieveLijin(String id, Long uid) throws Exception { |
| | | public LijinSendInfo recieveLijin(String id, Long uid) throws LijinBalanceException, Exception { |
| | | LijinSendInfo lijinSendInfo = (LijinSendInfo) redisManager.getObj(LijinSendInfo.class, id); |
| | | if (lijinSendInfo == null) |
| | | throw new Exception("红包为空"); |
| | |
| | | } |
| | | |
| | | //判断是否是新人红包 |
| | | if(lijinSendInfo.getCategory().equalsIgnoreCase(UserLijinRecord.Category.newer.name())){ |
| | | if (lijinSendInfo.getCategory() != null && lijinSendInfo.getCategory().equalsIgnoreCase(UserLijinRecord.Category.newer.name())) { |
| | | UserLijinRecord record = userLijinMnager.getLijinRecord(uid, null, UserLijinRecord.Category.newer.name()); |
| | | if(record!=null){ |
| | | if (record != null) { |
| | | throw new Exception("已领过新人红包"); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 初始化余额 |
| | | * |
| | | * @param uid |
| | | */ |
| | | public void initBalance(Long uid) { |
| | | userLijinMnager.initBalance(uid); |
| | | } |
| | | |
| | | |
| | | } |