admin
2019-03-06 a164cfb37b81879f2282d3b8dae73cc9cee00c6e
Merge remote-tracking branch 'origin/master'
1个文件已修改
19 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -15,7 +15,6 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yeshi.utils.DateUtil;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponMapper;
import com.yeshi.fanli.entity.bus.user.DeviceLotteryRecord;
@@ -28,6 +27,7 @@
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
import com.yeshi.fanli.entity.order.CommonOrder;
import com.yeshi.fanli.entity.push.PushCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@@ -596,6 +596,13 @@
        if (userSystemCoupon == null) {
            throw new UserSystemCouponException(1, "券数据不正确");
        }
        Integer state = userSystemCoupon.getState();
        Integer stateActivated = userSystemCoupon.getStateActivated();
        if (UserSystemCoupon.STATE_CAN_USE != state || 1 != stateActivated) {
            throw new UserSystemCouponException(1, "该券不能被使用");
        }
        Long couponUid = userSystemCoupon.getUid();
        if (!uid.equals(couponUid)) {
@@ -658,6 +665,12 @@
        UserSystemCoupon userSystemCoupon = selectByPrimaryKey(id);
        if (userSystemCoupon == null) {
            throw new UserSystemCouponException(1, "券信息不存在");
        }
        Integer state = userSystemCoupon.getState();
        Integer stateActivated = userSystemCoupon.getStateActivated();
        if (UserSystemCoupon.STATE_CAN_USE != state || 1 != stateActivated) {
            throw new UserSystemCouponException(1, "该券不能被使用");
        }
        // 系统券信息
@@ -1040,6 +1053,7 @@
        return userRecordVO;
    }
    
    @Transactional
    @Override
    public void activatedWelfareFreeCoupon(Long uid, String fromNickName) {
@@ -1367,6 +1381,8 @@
        
        // 获取额外信息
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        // 已经抽过奖的或者已经进入过抽奖页面的
        if (userInfoExtra != null && userInfoExtra.getLotteryNewbies() != null) {
            return;
        }
@@ -1458,5 +1474,6 @@
        userInfoExtraService.saveUserInfoExtra(userInfoExtra);
    
    }
}