yujian
2019-11-04 01407e36f8a1d46e065cdcfe14629540dbd6b921
红包
1 文件已重命名
13个文件已修改
1个文件已添加
209 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/aspect/VersionLimitAspect.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/CommonOrderMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/redpack/RedPackDetail.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackDetailMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackWinInviteServiceImpl.java 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/CommonOrderService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/redpack/RedPackWinInviteService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/annotation/redpack/RedPackGetVersionLimit.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/RedPackDetailFactory.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/aspect/VersionLimitAspect.java
File was renamed from fanli/src/main/java/com/yeshi/fanli/aspect/integral/IntegralGetVersionLimitAspect.java
@@ -1,4 +1,4 @@
package com.yeshi.fanli.aspect.integral;
package com.yeshi.fanli.aspect;
import java.lang.reflect.Method;
@@ -22,10 +22,11 @@
import com.yeshi.fanli.service.inter.user.UserActiveLogService;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.annotation.integral.IntegralGetVersionLimit;
import com.yeshi.fanli.util.annotation.redpack.RedPackGetVersionLimit;
@Component
@Aspect
public class IntegralGetVersionLimitAspect {
public class VersionLimitAspect {
    @Resource
    private UserActiveLogService userActiveLogService;
@@ -46,7 +47,7 @@
        return expression.getValue(context).toString();
    }
    @Around("execution(public * com.yeshi.fanli.service.impl.user.integral.*.*(..))")
    @Around("execution(public * com.yeshi.fanli.service.impl..*.*(..))")
    public Object requestSerializable(ProceedingJoinPoint joinPoint) throws Throwable {
        Signature signature = joinPoint.getSignature();
        MethodSignature methodSignature = (MethodSignature) signature;
@@ -62,8 +63,22 @@
                    UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(Long.parseLong(uid));
                    if (activeLog != null) {
                        // 小于1.6.5版本不增加积分
                        if (!VersionUtil.greaterThan_1_6_5(
                                "appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android",
                        if (!VersionUtil.greaterThan_1_6_5("appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android",
                                activeLog.getVersionCode()))
                            return null;
                    }
                }
            }
            if (realMethod.isAnnotationPresent(RedPackGetVersionLimit.class)) {
                RedPackGetVersionLimit rs = realMethod.getAnnotation(RedPackGetVersionLimit.class);
                String key = rs.uid();
                String uid = generateKeyBySpEL(key, joinPoint);
                if (uid != null && NumberUtil.isNumeric(uid)) {
                    UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(Long.parseLong(uid));
                    if (activeLog != null) {
                        // 小于2.0.2版本不增加积分
                        if (!VersionUtil.greaterThan_2_0_2("appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android",
                                activeLog.getVersionCode()))
                            return null;
                    }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java
@@ -27,6 +27,7 @@
import com.google.gson.stream.JsonWriter;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackExchange;
import com.yeshi.fanli.entity.redpack.RedPackWinInvite;
@@ -39,8 +40,10 @@
import com.yeshi.fanli.service.inter.redpack.RedPackExchangeService;
import com.yeshi.fanli.service.inter.redpack.RedPackGiveRecordService;
import com.yeshi.fanli.service.inter.redpack.RedPackWinInviteService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.vo.redpack.RedPackDetailVO;
import com.yeshi.fanli.vo.redpack.RedPackWinInviteVO;
@@ -71,6 +74,9 @@
    
    @Resource    
    private UserInfoService userInfoService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    
    /**
@@ -294,7 +300,13 @@
    }
    
    
    /**
     * 红包邀请进度
     * @param acceptData
     * @param page
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getRewardList", method = RequestMethod.POST)
    public void getRewardList(AcceptData acceptData, Integer page, Long uid, PrintWriter out) {
        if (uid == null || uid <= 0) {
@@ -333,4 +345,30 @@
        data.put("list", JsonUtil.getApiCommonGson().toJson(list));
        out.print(JsonUtil.loadTrueResult(data));        
    }
    /**
     * 用户基础信息
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getBasicInfo", method = RequestMethod.POST)
    public void getBasicInfo(AcceptData acceptData, Long uid, PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        JSONObject data = new JSONObject();
        data.put("balance", redPackBalanceService.getBalance(uid));
        data.put("ruleLink", redPackConfigService.getValueByKey("invite_reward_rule_link"));
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
            data.put("inviteCode", userInfoExtra.getInviteCode());
        } else {
            data.put("inviteCode", "");
        }
        out.print(JsonUtil.loadTrueResult(data));
    }
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/CommonOrderMapper.java
@@ -304,7 +304,8 @@
    /**
     * 查询首笔有效到账订单
     * @param uid  
     * @param type 类型: 1自购  2分享 3邀请
     * @param typeHB 类型: 1自购  2分享 3邀请
     * @param typeDate 日期类型: 3本月 4上月
     * @return
     */
    CommonOrderVO firstValidOrderByUid(@Param("uid") Long uid, @Param("typeHB") Integer typeHB,
fanli/src/main/java/com/yeshi/fanli/entity/redpack/RedPackDetail.java
@@ -71,8 +71,8 @@
    @Column(name = "rpd_type")
    private RedPackDetailTypeEnum type;
    @Expose
    @Column(name = "rpd_desc")
    private String desc;
    @Column(name = "rpd_desc_info")
    private String descInfo;
    @Expose
    @Column(name = "rpd_remark")
    private String remark;
@@ -123,12 +123,12 @@
        this.type = type;
    }
    public String getDesc() {
        return desc;
    public String getDescInfo() {
        return descInfo;
    }
    public void setDesc(String desc) {
        this.desc = desc;
    public void setDescInfo(String descInfo) {
        this.descInfo = descInfo;
    }
    public String getRemark() {
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml
@@ -988,7 +988,10 @@
                v2.`hb_type` = 21 OR v2.`hb_type` = 22)
            </if>
            <if test="typeDate == 3"> <!-- 本月 -->
                AND DATE_FORMAT(v2.`hb_get_time`,'%Y%m') =    DATE_FORMAT(CURDATE(),'%Y%m')
                AND DATE_FORMAT(co.`co_create_time`,'%Y%m') =    DATE_FORMAT(CURDATE(),'%Y%m')
            </if>
            <if test="typeDate == 4"> <!-- 上月 -->
                AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'),DATE_FORMAT(co.`co_create_time`, '%Y%m')) = 1
            </if>
        ORDER BY co.`co_id`
        LIMIT 1
fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackDetailMapper.xml
@@ -8,7 +8,7 @@
    <result column="rpd_uid" property="uid" jdbcType="BIGINT"/>
    <result column="rpd_money" property="money" jdbcType="DECIMAL"/>
    <result column="rpd_title" property="title" jdbcType="VARCHAR"/>
    <result column="rpd_desc" property="desc" jdbcType="VARCHAR"/>
    <result column="rpd_desc_info" property="descInfo" jdbcType="VARCHAR"/>
    <result column="rpd_remark" property="remark" jdbcType="VARCHAR"/>
    <result column="rpd_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="rpd_display" property="display" jdbcType="VARCHAR"/>
@@ -21,12 +21,12 @@
        <result column="dateFormate" property="dateFormate" jdbcType="VARCHAR" />
  </resultMap>
  
  <sql id="Base_Column_List">rpd_id,rpd_identify_code,rpd_uid,rpd_money,rpd_title,rpd_type,rpd_desc,rpd_remark,rpd_create_time,rpd_display</sql>
  <sql id="Base_Column_List">rpd_id,rpd_identify_code,rpd_uid,rpd_money,rpd_title,rpd_type,rpd_desc_info,rpd_remark,rpd_create_time,rpd_display</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_red_pack_detail where rpd_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_red_pack_detail where rpd_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.redpack.RedPackDetail" useGeneratedKeys="true" keyProperty="id">insert into yeshi_red_pack_detail (rpd_id,rpd_identify_code,rpd_uid,rpd_money,rpd_title,rpd_type,rpd_desc,rpd_remark,rpd_create_time,rpd_display) values (#{id,jdbcType=BIGINT},,#{identifyCode,jdbcType=VARCHAR}#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{title,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{desc,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{display,jdbcType=VARCHAR})</insert>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.redpack.RedPackDetail" useGeneratedKeys="true" keyProperty="id">insert into yeshi_red_pack_detail (rpd_id,rpd_identify_code,rpd_uid,rpd_money,rpd_title,rpd_type,rpd_desc_info,rpd_remark,rpd_create_time,rpd_display) values (#{id,jdbcType=BIGINT},,#{identifyCode,jdbcType=VARCHAR}#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{title,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{descInfo,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{display,jdbcType=VARCHAR})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.redpack.RedPackDetail" useGeneratedKeys="true" keyProperty="id">insert into yeshi_red_pack_detail
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">rpd_id,</if>
@@ -35,7 +35,7 @@
      <if test="money != null">rpd_money,</if>
      <if test="title != null">rpd_title,</if>
      <if test="type != null">rpd_type,</if>
      <if test="desc != null">rpd_desc,</if>
      <if test="descInfo != null">rpd_desc_info,</if>
      <if test="remark != null">rpd_remark,</if>
      <if test="createTime != null">rpd_create_time,</if>
      <if test="display != null">rpd_display,</if>
@@ -47,13 +47,13 @@
      <if test="money != null">#{money,jdbcType=DECIMAL},</if>
      <if test="title != null">#{title,jdbcType=VARCHAR},</if>
      <if test="type != null">#{type,jdbcType=VARCHAR},</if>
      <if test="desc != null">#{desc,jdbcType=VARCHAR},</if>
      <if test="descInfo != null">#{descInfo,jdbcType=VARCHAR},</if>
      <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="display != null">#{display,jdbcType=VARCHAR},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.redpack.RedPackDetail">update yeshi_red_pack_detail set rpd_identify_code = #{identifyCode,jdbcType=VARCHAR},rpd_uid = #{uid,jdbcType=BIGINT},rpd_money = #{money,jdbcType=DECIMAL},rpd_title = #{title,jdbcType=VARCHAR},rpd_type = #{type,jdbcType=VARCHAR},rpd_desc = #{desc,jdbcType=VARCHAR},rpd_remark = #{remark,jdbcType=VARCHAR},rpd_create_time = #{createTime,jdbcType=TIMESTAMP} where rpd_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.redpack.RedPackDetail">update yeshi_red_pack_detail set rpd_identify_code = #{identifyCode,jdbcType=VARCHAR},rpd_uid = #{uid,jdbcType=BIGINT},rpd_money = #{money,jdbcType=DECIMAL},rpd_title = #{title,jdbcType=VARCHAR},rpd_type = #{type,jdbcType=VARCHAR},rpd_desc_info = #{descInfo,jdbcType=VARCHAR},rpd_remark = #{remark,jdbcType=VARCHAR},rpd_create_time = #{createTime,jdbcType=TIMESTAMP} where rpd_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.redpack.RedPackDetail">update yeshi_red_pack_detail
    <set>
      <if test="identifyCode != null">rpd_identify_code=#{identifyCode,jdbcType=VARCHAR},</if>
@@ -61,7 +61,7 @@
      <if test="money != null">rpd_money=#{money,jdbcType=DECIMAL},</if>
      <if test="title != null">rpd_title=#{title,jdbcType=VARCHAR},</if>
      <if test="type != null">rpd_type=#{type,jdbcType=VARCHAR},</if>
      <if test="desc != null">rpd_desc=#{desc,jdbcType=VARCHAR},</if>
      <if test="descInfo != null">rpd_desc_info=#{descInfo,jdbcType=VARCHAR},</if>
      <if test="remark != null">rpd_remark=#{remark,jdbcType=VARCHAR},</if>
      <if test="createTime != null">rpd_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="display != null">rpd_display=#{display,jdbcType=VARCHAR},</if>
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -1587,9 +1587,8 @@
    
    
    @Override
    public CommonOrderVO firstValidOrderTheMonthByUidAndType(Long uid, Integer type) {
        return commonOrderMapper.firstValidOrderByUid(uid, type, 3);
    public CommonOrderVO firstValidOrderLastMonthByUidAndType(Long uid, Integer type) {
        return commonOrderMapper.firstValidOrderByUid(uid, type, 4);
    }
    
}
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java
@@ -145,7 +145,7 @@
            tips = tips.replace("{APP名称}", projectChineseName);
        }
        tips = tips.replace("{口令}", token).replace("{下载链接}", redPackConfigService.getValueByKey("app_down_link")).replace("{面额}",
                amount.toString());
                amount.setScale(2).toString());
        
        // 减少红包
        try {
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackWinInviteServiceImpl.java
@@ -31,6 +31,8 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
import com.yeshi.fanli.util.annotation.redpack.RedPackGetVersionLimit;
import com.yeshi.fanli.util.factory.RedPackDetailFactory;
import com.yeshi.fanli.vo.order.CommonOrderVO;
@@ -76,8 +78,10 @@
        return redPackWinInviteMapper.countRewardRecord(uid);
    }
    
    @Override
    @RedPackGetVersionLimit(uid = "#uid")
    @RequestSerializableByKeyService(key = "#uid")
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void orderArriveReward(Long uid, Integer source, String orderNo) throws Exception {
        if (uid == null || source == null || orderNo == null)
            return;
@@ -86,10 +90,26 @@
        UserInfo boss = threeSaleSerivce.getBoss(uid);
        if(boss != null) {
            firstReward(uid, source, orderNo);
            firstSharedOrderRewardToBoss(boss.getId(), uid, source, orderNo);
            firstSharedOrderRewardTheMonthToBoss(boss.getId(), uid, source, orderNo);
            bossReward(boss.getId(), uid, source, orderNo);
        }
    }
    /**
     * 上级奖励
     * @param uid
     * @param teamUid
     * @param source
     * @param orderNo
     * @throws Exception
     */
    @RedPackGetVersionLimit(uid = "#uid")
    @Transactional
    private void  bossReward(Long uid, Long teamUid, Integer source, String orderNo)  throws Exception {
        firstSharedOrderRewardToBoss(uid, teamUid, source, orderNo);
        firstSharedOrderRewardTheMonthToBoss(uid, teamUid, source, orderNo);
    }
    
    /**
     * 被邀请人下首单返利(下单就给):
@@ -103,12 +123,12 @@
    private void firstReward(Long uid, Integer source, String orderNo) throws Exception{
        // 奖励一次
        long total = redPackWinInviteMapper.countByUidAndType(uid, RedPackWinInviteTypeEnum.newUserReward.name());
        if (total > 1)
        if (total > 0)
            return;
        
        // 1、判断是否用户首个订单
        CommonOrderVO order = commonOrderService.firstValidOrderByUid(uid);
        if (order == null || source == order.getSourceType() || orderNo.equals(order.getOrderNo()))
        if (order == null || source != order.getSourceType() || !orderNo.equals(order.getOrderNo()))
            return;
        
        // 金额
@@ -149,16 +169,17 @@
    private void firstSharedOrderRewardToBoss(Long uid, Long inviteeUid, Integer source, String orderNo) throws Exception{
        // 同一队员奖励一次
        long totalReward = redPackWinInviteMapper.countByUidAndTeamUidAndType(uid, inviteeUid, RedPackWinInviteTypeEnum.firstSharedOrder.name());
        if (totalReward > 1)
        if (totalReward > 0)
            return;
        
        // 1、判断是否是改用户首个分享订单
        CommonOrderVO order = commonOrderService.firstValidOrderByUidAndType(inviteeUid, 2);
        if (order == null || source == order.getSourceType() || orderNo.equals(order.getOrderNo()))
        if (order == null || source != order.getSourceType() || !orderNo.equals(order.getOrderNo()))
            return;
        
        // 2、判断是第几个人
        long total = redPackWinInviteMapper.countByUidAndType(uid, RedPackWinInviteTypeEnum.firstSharedOrder.name());
        
        // 计算应增加红包金额
        BigDecimal money = new BigDecimal(redPackConfigService.getValueByKey("first_shared_order"));
@@ -201,9 +222,9 @@
     */
    @Transactional
    private void firstSharedOrderRewardTheMonthToBoss(Long uid, Long inviteeUid, Integer source, String orderNo) throws Exception{
        // 1、判断是否是本月首单
        CommonOrderVO order = commonOrderService.firstValidOrderTheMonthByUidAndType(inviteeUid, 2);
        if (order == null || source == order.getSourceType() || orderNo.equals(order.getOrderNo()) ||
        // 1、判断是否是上个月首单
        CommonOrderVO order = commonOrderService.firstValidOrderLastMonthByUidAndType(inviteeUid, 2);
        if (order == null || source != order.getSourceType() || !orderNo.equals(order.getOrderNo()) ||
                order.getAccountTime() == null) 
            return;
        
@@ -251,9 +272,10 @@
    }
    
    
    @RequestSerializableByKeyService(key = "#uid")
    @Override
    @Transactional
    private void inviteSucceedReward(Long uid) throws Exception{
    public void inviteSucceedReward(Long uid) throws Exception{
        // 验证是否存在上级
        UserInfo boss = threeSaleSerivce.getBoss(uid);
        if(boss == null) 
@@ -261,7 +283,7 @@
        
        // 同一队员奖励一次
        long totalReward = redPackWinInviteMapper.countByUidAndTeamUidAndType(boss.getId(), uid, RedPackWinInviteTypeEnum.inviteSucceed.name());
        if (totalReward > 1)
        if (totalReward > 0)
            return;
        
        // 1、绑定电话号码
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java
@@ -542,7 +542,7 @@
                        if (user != null && !StringUtil.isNullOrEmpty(user.getNickName()))
                            userName = user.getNickName();
                        MsgRedPackGiveContentDTO givedto = new MsgRedPackGiveContentDTO();
                        givedto.setTitle("红包领取");
                        givedto.setTitle("红包赠送");
                        givedto.setUserInfo("昵称:" + userName + " ID:" + uid);
                        givedto.setTime(sd.format(new Date()));
                        givedto.setMoney("¥" + giveRecord.getAmount().setScale(2));
fanli/src/main/java/com/yeshi/fanli/service/inter/order/CommonOrderService.java
@@ -321,11 +321,11 @@
    public CommonOrderVO firstValidOrderByUidAndType(Long uid, Integer type);
    /**
     * 查询是否本月到账订单
     * 查询是否上月到账订单
     * @param uid
     * @param type 类型: 1自购  2分享 3邀请
     * @return
     */
    public CommonOrderVO firstValidOrderTheMonthByUidAndType(Long uid, Integer type);
    public CommonOrderVO firstValidOrderLastMonthByUidAndType(Long uid, Integer type);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/redpack/RedPackWinInviteService.java
@@ -30,5 +30,12 @@
     * @return
     */
    public Long countRewardRecord(Long uid);
    /**
     * 邀请成功奖励
     * @param uid
     * @throws Exception
     */
    public void inviteSucceedReward(Long uid) throws Exception;
    
}
fanli/src/main/java/com/yeshi/fanli/util/annotation/redpack/RedPackGetVersionLimit.java
New file
@@ -0,0 +1,22 @@
package com.yeshi.fanli.util.annotation.redpack;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
 * 红包获得版本控制器
 *
 * @author Administrator
 *
 */
@Documented
@Target(ElementType.METHOD)
@Inherited
@Retention(RetentionPolicy.RUNTIME)
public @interface RedPackGetVersionLimit {
    String uid();
}
fanli/src/main/java/com/yeshi/fanli/util/factory/RedPackDetailFactory.java
@@ -25,7 +25,7 @@
        
        RedPackDetail detail = new RedPackDetail();
        detail.setDisplay(false);
        detail.setDesc( "等待人工审核");
        detail.setDescInfo( "等待人工审核");
        detail.setUid(exchange.getUid());
        detail.setMoney(new BigDecimal("-" + exchange.getMoney()));
        detail.setType(RedPackDetailTypeEnum.redExchange);
@@ -52,7 +52,7 @@
        RedPackDetail detail = new RedPackDetail();
        detail.setId(id);
        detail.setDisplay(true);
        detail.setDesc("请到账户余额中查看");
        detail.setDescInfo("请到账户余额中查看");
        detail.setType(RedPackDetailTypeEnum.redExchangePass);
        detail.setTitle(RedPackDetailTypeEnum.redExchangePass.getDesc());
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.redExchangePass.name() + ":" + exchange.getId()));
@@ -75,7 +75,7 @@
        detail.setDisplay(false);
        detail.setUid(exchange.getUid());
        detail.setMoney(exchange.getMoney());
        detail.setDesc("红包产生过程中涉嫌违规");
        detail.setDescInfo("红包产生过程中涉嫌违规");
        detail.setTitle(RedPackDetailTypeEnum.redExchangeReject.getDesc());
        detail.setType(RedPackDetailTypeEnum.redExchangeReject);
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.redExchangeReject.name() + ":" + exchange.getId()));
@@ -183,7 +183,7 @@
        detail.setDisplay(true);
        detail.setUid(winInvite.getUid());
        detail.setMoney(winInvite.getMoney());
        detail.setDesc("完成首笔订单");
        detail.setDescInfo("完成首笔订单");
        detail.setTitle(RedPackDetailTypeEnum.newUserReward.getDesc());
        detail.setType(RedPackDetailTypeEnum.newUserReward);
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.newUserReward.name() + ":" + winInvite.getId()));
@@ -206,7 +206,7 @@
        detail.setDisplay(true);
        detail.setUid(winInvite.getUid());
        detail.setMoney(winInvite.getMoney());
        detail.setDesc("成功邀请好友");
        detail.setDescInfo("成功邀请好友");
        detail.setTitle(RedPackDetailTypeEnum.invite.getDesc());
        detail.setType(RedPackDetailTypeEnum.invite);
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.invite.name() + ":" + winInvite.getId()));
@@ -229,7 +229,7 @@
        detail.setDisplay(true);
        detail.setUid(winInvite.getUid());
        detail.setMoney(winInvite.getMoney());
        detail.setDesc("好友完成订单");
        detail.setDescInfo("好友完成订单");
        detail.setTitle(RedPackDetailTypeEnum.increaseReward.getDesc());
        detail.setType(RedPackDetailTypeEnum.increaseReward);
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.increaseReward.name() + ":" + winInvite.getId()));
@@ -253,7 +253,7 @@
        detail.setDisplay(true);
        detail.setUid(winInvite.getUid());
        detail.setMoney(winInvite.getMoney());
        detail.setDesc("好友完成订单");
        detail.setDescInfo("好友完成订单");
        detail.setTitle(RedPackDetailTypeEnum.seriesReward.getDesc());
        detail.setType(RedPackDetailTypeEnum.seriesReward);
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.seriesReward.name() + ":" + winInvite.getId()));
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -683,7 +683,7 @@
                return null;
            
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(MsgTypeMoneyTypeEnum.redPackExchangePass.getDesc() + "", COLOR_CONTENT));
            contentList.add(new ClientTextStyleVO(msg.getMsgType().getDesc() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
@@ -719,7 +719,7 @@
                return null;
            
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(MsgTypeMoneyTypeEnum.redPackExchangePass.getDesc() + "", COLOR_CONTENT));
            contentList.add(new ClientTextStyleVO(msg.getMsgType().getDesc() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
@@ -763,7 +763,7 @@
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getMoney() + "", COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("金额", COLOR_TITLE), contentList));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("金        额", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getBalance() + "", COLOR_HIGHLIGHT_CONTENT));