admin
2019-08-26 4f0197ad8aeb2dd13929d2f656d80265263775ed
Merge remote-tracking branch 'origin/div' into div
3个文件已修改
26 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/job/UserSystemCouponJob.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemCouponServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/UserSystemCouponJob.java
@@ -24,19 +24,18 @@
    private UserSystemCouponService userSystemCouponService;
    
    /**
     * 每天00:10  更新券
     * 每天一个小时更新券
     */
    @Scheduled(cron = "0 10 0 * * ? ")
    @Scheduled(cron = "0 0 0/1 * * ? ")
    public void updateCouponInfo() {
        if (!Constant.IS_TASK)
            return;
        // 1、赠送退回券
        giveSendBack();
        
        // 2、券失效
        updateInvalid();
    }
    
    /**
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemCouponServiceImpl.java
@@ -68,7 +68,7 @@
        List<String> listType = new ArrayList<String>();
        listType.add(CouponTypeEnum.freeCoupon.name());
        listType.add(CouponTypeEnum.welfareFreeCoupon.name());
        listType.add(CouponTypeEnum.freeCouponBuy.name());
        return systemCouponMapper.getCouponListByType(listType);
    }
    
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java
@@ -117,8 +117,8 @@
            throw new TokenRecordException(1, "口令不存在");
        Long uidToken = rokenRecord.getUid();
        if (uid != null && uidToken != null && uid.longValue() == uidToken.longValue())
            throw new TokenRecordException(1, "不能自己赠送给自己");
//        if (uid != null && uidToken != null && uid.longValue() == uidToken.longValue())
//            throw new TokenRecordException(1, "不能自己赠送给自己");
        
        Date now = new Date();
        Date endTimeToken = rokenRecord.getEndTime();
@@ -289,9 +289,9 @@
        if (rokenRecord == null)
            throw new TokenRecordException(1, "口令已失效");
        
        Long uidToken = rokenRecord.getUid();
        if (uidToken != null && uid.longValue() == uidToken.longValue())
            throw new TokenRecordException(1, "不能自己赠送给自己");
//        Long uidToken = rokenRecord.getUid();
//        if (uidToken != null && uid.longValue() == uidToken.longValue())
//            throw new TokenRecordException(1, "不能自己赠送给自己");
        
        Date now = new Date();
        Date endTimeToken = rokenRecord.getEndTime();
@@ -417,14 +417,9 @@
            if (systemCoupon == null)
                throw new TokenRecordException(1, "该券不存在");
            
            BigDecimal percent = null;
            String amount = systemCoupon.getAmount();
            if (!StringUtil.isNullOrEmpty(amount))
                percent = new BigDecimal(amount);
            try {
                userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.rebatePercentCoupon.name(),
                        UserSystemCoupon.SOURCE_GIVE, percent);
                        UserSystemCoupon.SOURCE_GIVE, systemCoupon.getPercent());
            } catch (Exception e) {
                LogHelper.errorDetailInfo(e);
                throw new TokenRecordException(1, "领取失败");