yujian
2019-08-15 1823b680b950e4c3a26acced18fe0629b2139c53
福利中心
11个文件已修改
347 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserSystemCoupon.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/integral/CodePublishRecord.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/integral/IntegralExchange.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/CodePublishRecordServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 234 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/account/UserUtil.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/user/UserSystemCouponVO.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java
@@ -29,7 +29,6 @@
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.VersionUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -71,6 +70,7 @@
            JSONObject data = new JSONObject();
            data.put("nickName", userInfo.getNickName());
            data.put("portrait", userInfo.getPortrait());
            data.put("tips", "确认要成为TA的一级队员吗?邀请关系一旦建立不可更改。");
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserInfoExtraException e) {
            out.print(JsonUtil.loadFalseResult(e.getMsg()));
@@ -89,6 +89,7 @@
            JSONObject data = new JSONObject();
            data.put("nickName", userInfo.getNickName());
            data.put("portrait", userInfo.getPortrait());
            data.put("tips", "确认要成为TA的一级队员吗?邀请关系一旦建立不可更改。");
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserInfoExtraException e) {
            out.print(JsonUtil.loadFalseResult(e.getMsg()));
@@ -227,12 +228,21 @@
    public void countMyTeam(AcceptData acceptData, long uid, PrintWriter out) {
        JSONObject bossData = getBossInfo(acceptData, uid, threeSaleSerivce.getMyBoss(uid));
        JSONObject resultData = new JSONObject();
        long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
        resultData.put("boss", bossData);
        resultData.put("helpLink", configService.get("team_help_url"));
        resultData.put("firstTeam", threeSaleSerivce.countFirstTeam(uid, 1));
        resultData.put("firstTeam", firstTeam);
        resultData.put("firstTeamTotal", threeSaleSerivce.countFirstTeam(uid, null));
        resultData.put("secondTeam", threeSaleSerivce.countSecondTeam(uid, 1));
        resultData.put("secondTeamTotal", threeSaleSerivce.countSecondTeam(uid, null));
        boolean hasTeam = true;
        if (firstTeam <= 0) {
            hasTeam = false;
            resultData.put("invitelink", configService.get("invite_activation_url"));
        }
        resultData.put("hasTeam", hasTeam);
        
        boolean hasCode = false;
        boolean bdWeiXin = false;
@@ -245,15 +255,15 @@
                bdWeiXin = true;
        }
        
        List<String> tipCode = new ArrayList<String>();
        // 未激活邀请码
        resultData.put("hasCode", hasCode);
        if (!hasCode) {
            List<String> tipCode = new ArrayList<String>();
            resultData.put("helpLinkActivate", configService.get("team_help_url"));
            tipCode.add("激活邀请功能后才可以邀请队员,一级队员是由你直接邀请,二级队员是由你的一级队员邀请。");
            tipCode.add("邀请激活功能,必须要有邀请码,邀请码可以通过金币兑换,也可以全网搜索。");
            resultData.put("tipCode", tipCode);
        }
        resultData.put("hasCode", hasCode);
        resultData.put("tipCode", tipCode);
        
        // 未添加微信号
        List<String> tipWeiXin = new ArrayList<String>();
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserSystemCoupon.java
@@ -16,11 +16,24 @@
@Table("yeshi_ec_user_system_coupon")
public class UserSystemCoupon {
    // 状态:未使用1、使用中2、已使用3、已过期4
    // 未使用1
    public final static int STATE_CAN_USE = 1;
    // 使用中2
    public final static int STATE_IN_USE = 2;
    // 已使用3
    public final static int STATE_END_USE = 3;
    // 已过期4
    public final static int STATE_OVERDUE = 4;
    // 可使用、可赠送(返回前端字段)
    public final static int STATE_USE_GIVE = 10;
    // 只可赠送(返回前端字段)
    public final static int STATE_GIVE_ONLY = 11;
    // 赠送中(返回前端字段)
    public final static int STATE_GIVE_IN = 12;
    // 赠送成功(返回前端字段)
    public final static int STATE_GIVE_END = 13;
    
    
    // 来源: 新人抽奖、邀请奖励
@@ -58,8 +71,7 @@
    @Column(name = "usc_state_activate")
    private Integer stateActivated;
    
    // 是否可赠送
    @Expose
    // 是否已赠送
    @Column(name = "usc_give")
    private Boolean give;
    
fanli/src/main/java/com/yeshi/fanli/entity/integral/CodePublishRecord.java
@@ -37,7 +37,7 @@
    private String portrait; // 图片
    @Expose
    private String team; // 邀请码
    private Long team; // 邀请码
    @Expose
    private String inviteCode; // 邀请码
@@ -82,11 +82,11 @@
        this.portrait = portrait;
    }
    public String getTeam() {
    public Long getTeam() {
        return team;
    }
    public void setTeam(String team) {
    public void setTeam(Long team) {
        this.team = team;
    }
fanli/src/main/java/com/yeshi/fanli/entity/integral/IntegralExchange.java
@@ -88,6 +88,10 @@
    @Column(name = "ex_update_time")
    private Date updateTime;
    // 用户金币
    @Expose
    private String userGoldCoin;
    public Long getId() {
        return id;
@@ -208,4 +212,12 @@
    public void setProgress(String progress) {
        this.progress = progress;
    }
    public String getUserGoldCoin() {
        return userGoldCoin;
    }
    public void setUserGoldCoin(String userGoldCoin) {
        this.userGoldCoin = userGoldCoin;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponMapper.xml
@@ -115,14 +115,14 @@
  
  <select id="getUserCouponVOList" resultMap="ResultVOMap">
    SELECT * FROM `yeshi_ec_user_system_coupon` uc
    WHERE uc.`usc_uid`= #{uid}
    WHERE uc.`usc_uid`= #{uid} AND DATEDIFF(NOW(), uc.`usc_end_time`)<![CDATA[ <= ]]> 30
    ORDER BY uc.`usc_state`,uc.`usc_create_time` DESC
    LIMIT #{start},#{count}
  </select>
  
  <select id="countUserCouponList" resultType="java.lang.Long">
    SELECT IFNULL(count(uc.`usc_id`),0) FROM `yeshi_ec_user_system_coupon` uc
    WHERE uc.`usc_uid`= #{uid}
    WHERE uc.`usc_uid`= #{uid} AND DATEDIFF(NOW(), uc.`usc_end_time`)<![CDATA[ <= ]]> 30
  </select>
  
  <select id="getEnableListByCouponId" resultMap="ResultVOMap">
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/CodePublishRecordServiceImpl.java
@@ -72,7 +72,7 @@
            
            long firstTeam = threeSaleSerivce.countFirstTeam(codePublishRecord.getUid(), 1);
            long secondTeam = threeSaleSerivce.countSecondTeam(codePublishRecord.getUid(), 1);
            codePublishRecord.setTeam("共有" + (firstTeam + secondTeam) + "个队员");
            codePublishRecord.setTeam(firstTeam + secondTeam);
        }
        
        return listValid;
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java
@@ -158,16 +158,12 @@
        
        try {
            ExchangeTypeEnum type = exchange.getType();
            if (ExchangeTypeEnum.freeCouponBuy == type) {
                // 自购免单券
                userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, false, null);
            } else if (ExchangeTypeEnum.freeCouponGive == type) {
                // 赠送免单券
                userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, true, null);
            if (ExchangeTypeEnum.freeCouponBuy == type || ExchangeTypeEnum.freeCouponGive == type) {
                // 自购免单券、赠送免单券
                userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, null);
            } else if (ExchangeTypeEnum.rebatePercentCoupon == type) {
                // 奖励免单券
                userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, true,
                        new BigDecimal(10));
                userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, new BigDecimal(10));
            } else if (ExchangeTypeEnum.inviteCodePublish == type) {
                // 邀请码发布
                if(codePublishRecordService.countValidRecord(uid) > 0)
@@ -211,6 +207,9 @@
            extraUpdate.setId(extraVO.getId());
            extraUpdate.setGoldCoin(goldCoinHas.intValue() - goldCoin.intValue());
            userInfoExtraService.saveUserInfoExtra(extraUpdate);
            exchange.setUserGoldCoin(extraUpdate.getGoldCoin() + "枚");
            return exchange;
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -20,6 +20,8 @@
import com.yeshi.fanli.entity.bus.user.DeviceLotteryRecord;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.Order;
import com.yeshi.fanli.entity.bus.user.TokenRecord;
import com.yeshi.fanli.entity.bus.user.TokenRecord.TokenTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
@@ -48,6 +50,7 @@
import com.yeshi.fanli.service.inter.push.PushCouponRecordService;
import com.yeshi.fanli.service.inter.push.PushCouponService;
import com.yeshi.fanli.service.inter.user.DeviceLotteryRecordService;
import com.yeshi.fanli.service.inter.user.TokenRecordService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
@@ -56,6 +59,7 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.account.UserUtil;
import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
@@ -133,6 +137,9 @@
    
    @Resource
    private PushCouponRecordService pushCouponRecordService;
    @Resource
    private TokenRecordService tokenRecordService;
    
    
    @Override
@@ -1636,7 +1643,7 @@
    
    @Override
    @Transactional
    public void exchangeCoupon(Long uid, String couponType, String source, boolean give, BigDecimal percent) throws UserSystemCouponException, Exception {
    public void exchangeCoupon(Long uid, String couponType, String source, BigDecimal percent) throws UserSystemCouponException, Exception {
        if (couponType == null || uid == null) {
            throw new UserSystemCouponException(1, "参数不正确");
        }
@@ -1667,30 +1674,28 @@
        UserSystemCoupon userCoupon = new UserSystemCoupon();
        userCoupon.setUid(uid);
        userCoupon.setSource(source);
        userCoupon.setGive(give);
        userCoupon.setSystemCoupon(coupon);
        userCoupon.setState(UserSystemCoupon.STATE_CAN_USE);
        userCoupon.setStateActivated(stateActivated);
        userCoupon.setStartTime(new Date());
        userCoupon.setEndTime(endTime);
        userCoupon.setGive(false);
        userCoupon.setCreateTime(new Date());
        userCoupon.setUpdateTime(new Date());
        userCoupon.setState(UserSystemCoupon.STATE_CAN_USE);
        insertSelective(userCoupon);
    }
    
    
    @Transactional
    @Override
    public List<UserSystemCouponVO> getCouponList(long start, int count, Long uid)throws UserSystemCouponException, Exception {
        if (uid == null) {
            return null;
        }
    public List<UserSystemCouponVO> getCouponList(long start, int count, Long uid)
            throws UserSystemCouponException, Exception {
        // 更新过期券
        updateCounponInvalid(uid);
        // 退回券
        sendBackTimeOutCoupon(uid);
        List<UserSystemCouponVO> listVO = userSystemCouponMapper.getUserCouponVOList(start, count, uid);
        if (listVO == null || listVO.size() == 0) {
            return listVO;
@@ -1702,7 +1707,7 @@
        if (userInfoExtra != null) {
            inviteCode = userInfoExtra.getInviteCode();
        }
        for (UserSystemCouponVO userCouponVO : listVO) {
            SystemCoupon systemCoupon = userCouponVO.getSystemCoupon();
            if (systemCoupon != null && systemCoupon.getId() != null) {
@@ -1718,73 +1723,6 @@
            userCouponVO.setCouponEffect(systemCoupon.getEffect());
            userCouponVO.setCouponRule(systemCoupon.getRule());
            userCouponVO.setCouponRuleLink(systemCoupon.getRuleLink());
            Integer state = userCouponVO.getState();
            // 券失效图片替换
            if (UserSystemCoupon.STATE_END_USE == state || UserSystemCoupon.STATE_OVERDUE == state) {
                userCouponVO.setCouponPicture(systemCoupon.getPictureInvalid());
            } else {
                userCouponVO.setCouponPicture(systemCoupon.getPicture());
            }
            Map<String, Object> jumpBtn = null;
            CouponTypeEnum type = systemCoupon.getType();
            Integer stateActivated = userCouponVO.getStateActivated();
            // 状态待激活 -且可使用
            if (UserSystemCoupon.STATE_CAN_USE == state && (stateActivated == null || stateActivated == 0)) {
                userCouponVO.setState(0);
                userCouponVO.setCouponEffect("待激活");
                if (CouponTypeEnum.freeCoupon == type) {
                    List<String> listTip = new ArrayList<String>();
                    listTip.add("本免单券由好友赠送,从获赠日起60天内需产生3笔返利订单;");
                    listTip.add("返利订单“已到账”后,方能视为订单产生成功;");
                    listTip.add("满足条件后,系统将自动激活,并在消息-其它消息中提醒。");
                } else if (CouponTypeEnum.welfareFreeCoupon == type) {
                    // 未激活规则
                    userCouponVO.setCouponRule(systemCoupon.getRemark());
                    jumpBtn = new HashMap<String, Object>();
                    if (inviteCode != null && inviteCode.trim().length() > 0) {
                        jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("invite_friends"));
                    } else {
                        jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("invite_activate"));
                    }
                }
            } else if (stateActivated == 1) {
                // 显示规则
                userCouponVO.setCouponRule(systemCoupon.getRule());
                if (UserSystemCoupon.STATE_CAN_USE == state) {
                    Map<String, Object> jumpLink = new HashMap<String, Object>();
                    if (CouponTypeEnum.freeCoupon == type || CouponTypeEnum.welfareFreeCoupon == type) {
                        // 免单券、 福利免单券
                        // 免单商品列表
                        jumpLink.put("url", configService.get("free_goods_list"));
                        jumpBtn = new HashMap<String, Object>();
                        jumpBtn.put("params", jumpLink);
                        jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("web"));
                    } else if (CouponTypeEnum.rebatePercentCoupon == type) {
                        // 返利奖励券- 跳转至订单到账界面
                        jumpLink.put("state", "2");
                        jumpBtn = new HashMap<String, Object>();
                        jumpBtn.put("params", jumpLink);
                        // 跳转订单列表
                        jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("orderList"));
                    }
                } else if (UserSystemCoupon.STATE_IN_USE == state) {
                    // 使用中
                    userCouponVO.setInUseExplain(configService.get("free_coupon_using-help"));
                }
            }
            userCouponVO.setJumpBtn(jumpBtn);
            String couponTerm = "有效期:";
            Date startTime = userCouponVO.getStartTime();
@@ -1794,6 +1732,13 @@
                couponTerm = couponTerm + sdf.format(startTime) + "-" + sdf.format(endTime);
            }
            userCouponVO.setCouponTerm(couponTerm);
            Integer state = userCouponVO.getState();
            if (UserSystemCoupon.STATE_END_USE == state || UserSystemCoupon.STATE_OVERDUE == state) {
                userCouponVO.setCouponPicture(systemCoupon.getPictureInvalid());
            } else {
                userCouponVO.setCouponPicture(systemCoupon.getPicture());
            }
            if (UserSystemCoupon.STATE_CAN_USE == state) {
                int differentDays = 0;
@@ -1810,7 +1755,142 @@
                remainDays.put("fontColor", "#F14242");
                userCouponVO.setRemainDays(remainDays);
            }
            Map<String, Object> jumpBtn = null;
            CouponTypeEnum type = systemCoupon.getType();
            Integer stateActivated = userCouponVO.getStateActivated();
            // 未激活
            if (stateActivated == null || stateActivated == 0) {
                userCouponVO.setCouponEffect("待激活");
                userCouponVO.setCouponRule(systemCoupon.getRemark());
                if (UserSystemCoupon.STATE_CAN_USE == state) {
                    state = 0;
                    userCouponVO.setState(state);
                    if (CouponTypeEnum.freeCoupon == type) {
                        List<String> listTip = new ArrayList<String>();
                        listTip.add("本免单券由好友赠送,从获赠日起60天内需产生3笔返利订单;");
                        listTip.add("返利订单“已到账”后,方能视为订单产生成功;");
                        listTip.add("满足条件后,系统将自动激活,并在消息-其它消息中提醒。");
                        userCouponVO.setTips(listTip);
                        userCouponVO.setPopup(true);
                    } else if (CouponTypeEnum.welfareFreeCoupon == type) {
                        jumpBtn = new HashMap<String, Object>();
                        if (inviteCode != null && inviteCode.trim().length() > 0) {
                            jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("invite_friends"));
                        } else {
                            jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("invite_activate"));
                        }
                    }
                }
            }
            if (UserSystemCoupon.STATE_IN_USE == state && (CouponTypeEnum.freeCouponBuy == type
                    || CouponTypeEnum.freeCoupon == type || CouponTypeEnum.welfareFreeCoupon == type)) {
                userCouponVO.setInUseExplain(configService.get("free_coupon_using-help"));
            }
            // 是否已赠送
            Boolean give = userCouponVO.getGive();
            if (give == null) {
                give = false;
            }
            if (UserSystemCoupon.STATE_CAN_USE == state) {
                Map<String, Object> jumpLink = new HashMap<String, Object>();
                if (CouponTypeEnum.freeCouponGive == type) {
                    userCouponVO.setState(UserSystemCoupon.STATE_GIVE_ONLY);
                } else if (CouponTypeEnum.freeCoupon == type || CouponTypeEnum.welfareFreeCoupon == type
                        || CouponTypeEnum.freeCouponBuy == type) {
                    jumpLink.put("url", configService.get("free_goods_list"));
                    jumpBtn = new HashMap<String, Object>();
                    jumpBtn.put("params", jumpLink);
                    jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("web"));
                } else if (CouponTypeEnum.rebatePercentCoupon == type) {
                    // 可使用、 可赠送
                    userCouponVO.setState(UserSystemCoupon.STATE_USE_GIVE);
                    // 返利奖励券- 跳转至订单到账界面
                    jumpLink.put("state", "2");
                    jumpBtn = new HashMap<String, Object>();
                    jumpBtn.put("params", jumpLink);
                    jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("orderList"));
                }
            } else if (UserSystemCoupon.STATE_IN_USE == state) {
                if (CouponTypeEnum.freeCouponGive == type) {
                    userCouponVO.setState(UserSystemCoupon.STATE_GIVE_IN);
                }
                if (give && CouponTypeEnum.rebatePercentCoupon == type) {
                    userCouponVO.setState(UserSystemCoupon.STATE_GIVE_IN);
                }
            } else if (UserSystemCoupon.STATE_END_USE == state) {
                if (CouponTypeEnum.freeCouponGive == type) {
                    userCouponVO.setState(UserSystemCoupon.STATE_GIVE_END);
                }
                if (give && CouponTypeEnum.rebatePercentCoupon == type) {
                    userCouponVO.setState(UserSystemCoupon.STATE_GIVE_END);
                }
            }
            userCouponVO.setJumpBtn(jumpBtn);
        }
        return listVO;
    }
    @Transactional
    @Override
    public String giveCoupon(Long uid, Long id) throws UserSystemCouponException {
        UserSystemCoupon userSystemCoupon = userSystemCouponMapper.selectByPrimaryKey(id);
        if (userSystemCoupon == null)
            throw new UserSystemCouponException(1, "该券已不存在");
        SystemCoupon systemCoupon = userSystemCoupon.getSystemCoupon();
        if (systemCoupon == null)
            throw new UserSystemCouponException(1, "该券已不存在");
        systemCoupon = systemCouponService.selectByPrimaryKey(systemCoupon.getId());
        if (systemCoupon == null)
            throw new UserSystemCouponException(1, "该券已失效");
        Integer state = userSystemCoupon.getState();
        if (state == UserSystemCoupon.STATE_OVERDUE)
            throw new UserSystemCouponException(1, "该券已过期");
        if (state == UserSystemCoupon.STATE_END_USE)
            throw new UserSystemCouponException(1, "该券使用/赠送成功");
        CouponTypeEnum type = systemCoupon.getType();
        if (type != CouponTypeEnum.freeCouponGive && type != CouponTypeEnum.rebatePercentCoupon )
            throw new UserSystemCouponException(1, "该券不支持赠送");
        Date startTime = new Date();
        Date endTime = DateUtil.plusDayDate(3, new Date());
        long num = 10000 + (long) (Math.random() * 10000);
        String token = UserUtil.getInviteCode(num);
        TokenRecord tokenRecord = new TokenRecord();
        tokenRecord.setUid(uid);
        tokenRecord.setIdentify(id+"");
        tokenRecord.setType(TokenTypeEnum.coupon);
        tokenRecord.setEndTime(endTime);
        tokenRecord.setStartTime(startTime);
        tokenRecord.setToken(token);
        tokenRecord.setState(state);
        tokenRecordService.insertSelective(tokenRecord);
        String tips = "送给你一张返利奖励券快去领取吧,复制本条消息[&%s&],打开[返利券]App领取,使用后可让返利加倍。\r\n"
                +"----------------------------\r\n"
                + "下载[返利券]App链接:http://t.cn/2H7AXAH\r\n"
                + "PS:口令将会24小时内失效,请及时领取。";
        tips = String.format(tips, token);
        return tips;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java
@@ -212,11 +212,29 @@
     * @param source
     * @throws UserSystemCouponException
     */
    public void exchangeCoupon(Long uid, String couponType, String source, boolean give,
    public void exchangeCoupon(Long uid, String couponType, String source,
            BigDecimal percent) throws UserSystemCouponException, Exception;
    
    /**
     * 券列表 1.6.5
     * @param start
     * @param count
     * @param uid
     * @return
     * @throws UserSystemCouponException
     * @throws Exception
     */
    public List<UserSystemCouponVO> getCouponList(long start, int count, Long uid) throws UserSystemCouponException, Exception;
    /**
     * 赠送券生成口令
     * @param uid
     * @param id
     * @return
     * @throws UserSystemCouponException
     */
    public String giveCoupon(Long uid, Long id) throws UserSystemCouponException;
}
fanli/src/main/java/com/yeshi/fanli/util/account/UserUtil.java
@@ -187,7 +187,5 @@
        } else {// 隐藏6位
            return orderId.substring(0, orderId.length() - 6) + "******";
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/user/UserSystemCouponVO.java
@@ -47,9 +47,13 @@
    // 跳转按钮
    @Expose
     private Map<String, Object> jumpBtn;
    // 剩下天数
    @Expose
     private Map<String, Object> remainDays;
    @Expose
     private boolean popup;
    
    @Expose
     private List<String> tips;
@@ -152,4 +156,12 @@
        this.tips = tips;
    }
    public boolean isPopup() {
        return popup;
    }
    public void setPopup(boolean popup) {
        this.popup = popup;
    }
}