| | |
| | | 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; |
| | |
| | | * |
| | | * @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); |
| | | } |
| | | |
| | | |
| | | } |