admin
2019-11-19 b02d3f5053530fc6d8050769a2598399e1a4e03b
记录通过订单获取奖励的记录
6个文件已修改
7个文件已添加
485 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/integral/UserGetIntegralFromOrderRecordMapper.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/integral/UserGetIntegralFromOrderRecord.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/integral/UserGetIntegralFromOrderRecordException.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/integral/UserGetIntegralFromOrderRecordMapper.xml 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/msg/UserOrderMsgNotificationServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/integral/IntegralGetServiceImpl.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/UserGetIntegralFromOrderRecordServiceImpl.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/integral/IntegralGetService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/integral/UserGetIntegralFromOrderRecordService.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/VersionUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/integral/UserGetIntegralFromOrderRecordFactory.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-dev/rocketmq.properties 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/integral/UserGetIntegralFromOrderRecordMapper.java
New file
@@ -0,0 +1,21 @@
package com.yeshi.fanli.dao.mybatis.integral;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord;
public interface UserGetIntegralFromOrderRecordMapper extends BaseMapper<UserGetIntegralFromOrderRecord> {
    /**
     * 根据用户,事件类型,订单信息计数
     *
     * @param eventType
     * @param uid
     * @param orderNo
     * @param orderSourceType
     * @return
     */
    long countByRecordInfo(@Param("record") UserGetIntegralFromOrderRecord record);
}
fanli/src/main/java/com/yeshi/fanli/entity/integral/UserGetIntegralFromOrderRecord.java
New file
@@ -0,0 +1,99 @@
package com.yeshi.fanli.entity.integral;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 用户因为订单获取到金币
 *
 * @author Administrator
 *
 */
@Table("yeshi_ec_integral_get_from_order")
public class UserGetIntegralFromOrderRecord {
    public static int TYPE_PLACE_ORDER = 1;// 下单
    public static int TYPE_RECIEVE_MONEY = 2;// 到账
    @Column(name = "fo_id")
    private Long id;
    @Column(name = "fo_event_type")
    private Integer eventType;// 事件类型
    @Column(name = "fo_uid")
    private Long uid;// 用户ID
    @Column(name = "fo_order_no")
    private String orderNo;// 订单号
    @Column(name = "fo_order_source_type")
    private Integer orderSourceType;// 订单来源类型
    @Column(name = "fo_integral_count")
    private Integer integralCount;// 金币数量
    @Column(name = "fo_create_time")
    private Date createTime;// 创建时间
    @Column(name = "fo_update_time")
    private Date updateTime;// 更新时间
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Integer getEventType() {
        return eventType;
    }
    public void setEventType(Integer eventType) {
        this.eventType = eventType;
    }
    public Long getUid() {
        return uid;
    }
    public void setUid(Long uid) {
        this.uid = uid;
    }
    public String getOrderNo() {
        return orderNo;
    }
    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
    public Integer getOrderSourceType() {
        return orderSourceType;
    }
    public void setOrderSourceType(Integer orderSourceType) {
        this.orderSourceType = orderSourceType;
    }
    public Integer getIntegralCount() {
        return integralCount;
    }
    public void setIntegralCount(Integer integralCount) {
        this.integralCount = integralCount;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/integral/UserGetIntegralFromOrderRecordException.java
New file
@@ -0,0 +1,16 @@
package com.yeshi.fanli.exception.integral;
import com.yeshi.fanli.exception.BaseException;
public class UserGetIntegralFromOrderRecordException extends BaseException {
    private static final long serialVersionUID = 1L;
    public UserGetIntegralFromOrderRecordException(int code, String msg) {
        super(code, msg);
    }
    public UserGetIntegralFromOrderRecordException() {
        super();
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/integral/UserGetIntegralFromOrderRecordMapper.xml
New file
@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
    namespace="com.yeshi.fanli.dao.mybatis.integral.UserGetIntegralFromOrderRecordMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord">
        <id column="fo_id" property="id" jdbcType="BIGINT" />
        <result column="fo_event_type" property="eventType" jdbcType="INTEGER" />
        <result column="fo_uid" property="uid" jdbcType="BIGINT" />
        <result column="fo_order_no" property="orderNo" jdbcType="VARCHAR" />
        <result column="fo_order_source_type" property="orderSourceType"
            jdbcType="INTEGER" />
        <result column="fo_integral_count" property="integralCount"
            jdbcType="INTEGER" />
        <result column="fo_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="fo_update_time" property="updateTime" jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">fo_id,fo_event_type,fo_uid,fo_order_no,fo_order_source_type,fo_integral_count,fo_create_time,fo_update_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_integral_get_from_order where fo_id =
        #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_integral_get_from_order where fo_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_integral_get_from_order
        (fo_id,fo_event_type,fo_uid,fo_order_no,fo_order_source_type,fo_integral_count,fo_create_time,fo_update_time)
        values
        (#{id,jdbcType=BIGINT},#{eventType,jdbcType=INTEGER},#{uid,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{orderSourceType,jdbcType=INTEGER},#{integralCount,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_integral_get_from_order
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">fo_id,</if>
            <if test="eventType != null">fo_event_type,</if>
            <if test="uid != null">fo_uid,</if>
            <if test="orderNo != null">fo_order_no,</if>
            <if test="orderSourceType != null">fo_order_source_type,</if>
            <if test="integralCount != null">fo_integral_count,</if>
            <if test="createTime != null">fo_create_time,</if>
            <if test="updateTime != null">fo_update_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="eventType != null">#{eventType,jdbcType=INTEGER},</if>
            <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
            <if test="orderNo != null">#{orderNo,jdbcType=VARCHAR},</if>
            <if test="orderSourceType != null">#{orderSourceType,jdbcType=INTEGER},</if>
            <if test="integralCount != null">#{integralCount,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
        parameterType="com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord">update yeshi_ec_integral_get_from_order set
        fo_event_type = #{eventType,jdbcType=INTEGER},fo_uid =
        #{uid,jdbcType=BIGINT},fo_order_no =
        #{orderNo,jdbcType=VARCHAR},fo_order_source_type =
        #{orderSourceType,jdbcType=INTEGER},fo_integral_count =
        #{integralCount,jdbcType=INTEGER},fo_create_time =
        #{createTime,jdbcType=TIMESTAMP},fo_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where fo_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord">
        update yeshi_ec_integral_get_from_order
        <set>
            <if test="eventType != null">fo_event_type=#{eventType,jdbcType=INTEGER},</if>
            <if test="uid != null">fo_uid=#{uid,jdbcType=BIGINT},</if>
            <if test="orderNo != null">fo_order_no=#{orderNo,jdbcType=VARCHAR},</if>
            <if test="orderSourceType != null">fo_order_source_type=#{orderSourceType,jdbcType=INTEGER},
            </if>
            <if test="integralCount != null">fo_integral_count=#{integralCount,jdbcType=INTEGER},</if>
            <if test="createTime != null">fo_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">fo_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where fo_id = #{id,jdbcType=BIGINT}
    </update>
    <select id="countByRecordInfo" resultType="java.lang.Long">
        select
        count(*)
        from yeshi_ec_integral_get_from_order where 1=1
        <if test="record!=null">
            <if test="record.eventType!=null">
                and fo_event_type=#{record.eventType}
            </if>
            <if test="record.uid!=null">
                and fo_uid=#{record.uid}
            </if>
            <if test="record.orderNo!=null">
                and fo_order_no=#{record.orderNo}
            </if>
            <if test="record.orderSourceType!=null">
                and fo_order_source_type=#{record.orderSourceType}
            </if>
        </if>
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/order/msg/UserOrderMsgNotificationServiceImpl.java
@@ -164,7 +164,6 @@
        } catch (PushException e) {
            e.printStackTrace();
        }
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/user/integral/IntegralGetServiceImpl.java
@@ -7,6 +7,7 @@
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yeshi.fanli.dao.mybatis.ThreeSaleMapper;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@@ -17,6 +18,7 @@
import com.yeshi.fanli.entity.integral.IntegralTask.TaskUniqueKeyEnum;
import com.yeshi.fanli.entity.integral.IntegralTaskRank;
import com.yeshi.fanli.entity.integral.IntegralTaskRecord;
import com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord;
import com.yeshi.fanli.exception.integral.IntegralGetException;
import com.yeshi.fanli.exception.integral.IntegralTaskRecordException;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
@@ -24,11 +26,12 @@
import com.yeshi.fanli.service.inter.user.integral.IntegralTaskRankService;
import com.yeshi.fanli.service.inter.user.integral.IntegralTaskRecordService;
import com.yeshi.fanli.service.inter.user.integral.IntegralTaskService;
import com.yeshi.fanli.service.inter.user.integral.UserGetIntegralFromOrderRecordService;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
import com.yeshi.fanli.util.annotation.integral.IntegralGetFrequencyLimit;
import com.yeshi.fanli.util.annotation.integral.IntegralGetVersionLimit;
import com.yeshi.fanli.util.factory.integral.UserGetIntegralFromOrderRecordFactory;
@Lazy
@Service
@@ -51,6 +54,9 @@
    @Resource
    private IntegralTaskRankService integralTaskRankService;
    @Resource
    private UserGetIntegralFromOrderRecordService userGetIntegralFromOrderRecordService;
    private UserInfo getBossByUid(Long uid) {
        return threeSaleMapper.selectBoss(uid);
@@ -143,7 +149,7 @@
        return null;
    }
    @IntegralGetFrequencyLimit(key = "'addShareInvite-'+#uid", time = 30)
    @Override
    public IntegralTaskRecord addShareInvite(Long uid) {
@@ -176,7 +182,7 @@
            addEventStatistic(uid, TaskUniqueKeyEnum.inShopLevelOne.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -186,7 +192,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.inShopLevelTwo.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -254,7 +260,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.taoLiJinBuy.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -270,7 +276,7 @@
            addEventStatistic(uid, TaskUniqueKeyEnum.inviteLevelOne.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -286,7 +292,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.inviteLevelTwo.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -298,7 +304,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.shareSingleGoods.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -310,7 +316,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.shareMultipleGoods.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -322,7 +328,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.shareTLJGoods.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -334,7 +340,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.giveRebateCoupon.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -346,7 +352,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.giveFreeCoupon.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -358,7 +364,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.giveTaoLiJin.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -370,7 +376,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.closeRecommendGoods.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -386,7 +392,7 @@
            addEventStatistic(uid, TaskUniqueKeyEnum.couponRebate.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -406,7 +412,7 @@
            addEventStatistic(uid, TaskUniqueKeyEnum.couponRebateLevelOne.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -422,19 +428,25 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.couponRebateLevelTwo.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
    @IntegralGetVersionLimit(uid = "#uid")
    @RequestSerializableByKeyService(key = "#uid")
    @Async()
    @Transactional
    @Override
    public void addRebateOrder(Long uid) {
    public void addRebateOrder(Long uid, String orderNo, int sourceType) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.rebateOrder.name());
            IntegralTaskRecord record = addEventStatistic(uid, TaskUniqueKeyEnum.rebateOrder.name());
            if (record != null) {
                userGetIntegralFromOrderRecordService.addRecord(
                        UserGetIntegralFromOrderRecordFactory.create(UserGetIntegralFromOrderRecord.TYPE_RECIEVE_MONEY,
                                uid, orderNo, sourceType, record.getGoldCoin()));
            }
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -446,12 +458,19 @@
    @IntegralGetVersionLimit(uid = "#uid")
    @RequestSerializableByKeyService(key = "#uid")
    @Async()
    @Transactional
    @Override
    public void addInviteOrderLevelOne(Long uid) {
    public void addInviteOrderLevelOne(Long uid, String orderNo, int sourceType) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelOne.name());
            IntegralTaskRecord record = addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelOne.name());
            if (record != null) {
                userGetIntegralFromOrderRecordService.addRecord(
                        UserGetIntegralFromOrderRecordFactory.create(UserGetIntegralFromOrderRecord.TYPE_RECIEVE_MONEY,
                                uid, orderNo, sourceType, record.getGoldCoin()));
            }
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -463,24 +482,37 @@
    @IntegralGetVersionLimit(uid = "#uid")
    @RequestSerializableByKeyService(key = "#uid")
    @Async()
    @Transactional
    @Override
    public void addInviteOrderLevelTwo(Long uid) {
    public void addInviteOrderLevelTwo(Long uid, String orderNo, int sourceType) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelTwo.name());
            IntegralTaskRecord record = addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelTwo.name());
            if (record != null) {
                userGetIntegralFromOrderRecordService.addRecord(
                        UserGetIntegralFromOrderRecordFactory.create(UserGetIntegralFromOrderRecord.TYPE_RECIEVE_MONEY,
                                uid, orderNo, sourceType, record.getGoldCoin()));
            }
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
    @IntegralGetVersionLimit(uid = "#uid")
    @RequestSerializableByKeyService(key = "#uid")
    @Async()
    @Transactional
    @Override
    public void addShareOrder(Long uid) {
    public void addShareOrder(Long uid, String orderNo, int sourceType) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.shareOrder.name());
            IntegralTaskRecord record = addEventStatistic(uid, TaskUniqueKeyEnum.shareOrder.name());
            if (record != null) {
                userGetIntegralFromOrderRecordService.addRecord(
                        UserGetIntegralFromOrderRecordFactory.create(UserGetIntegralFromOrderRecord.TYPE_RECIEVE_MONEY,
                                uid, orderNo, sourceType, record.getGoldCoin()));
            }
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -492,7 +524,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.bindWeiXin.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -504,7 +536,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.bindPhone.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -516,7 +548,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.bindTaoBao.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -528,7 +560,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.setWeiXinNum.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -540,7 +572,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.setGender.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -552,7 +584,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.setPortrait.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -564,7 +596,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.setNickName.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -576,7 +608,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.bindAlipay.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
@@ -588,7 +620,7 @@
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.inviteActivate.name());
        } catch (Exception e) {
            //LogHelper.errorDetailInfo(e);
            // LogHelper.errorDetailInfo(e);
        }
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/UserGetIntegralFromOrderRecordServiceImpl.java
New file
@@ -0,0 +1,49 @@
package com.yeshi.fanli.service.impl.user.invite;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yeshi.fanli.dao.mybatis.integral.UserGetIntegralFromOrderRecordMapper;
import com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord;
import com.yeshi.fanli.exception.integral.UserGetIntegralFromOrderRecordException;
import com.yeshi.fanli.service.inter.user.integral.UserGetIntegralFromOrderRecordService;
import com.yeshi.fanli.util.StringUtil;
@Service
public class UserGetIntegralFromOrderRecordServiceImpl implements UserGetIntegralFromOrderRecordService {
    @Resource
    private UserGetIntegralFromOrderRecordMapper userGetIntegralFromOrderRecordMapper;
    @Override
    public long countByEventTypeAndUidAndOrderInfo(int eventType, Long uid, String orderNo, int orderSourceType) {
        UserGetIntegralFromOrderRecord record = new UserGetIntegralFromOrderRecord();
        record.setEventType(eventType);
        record.setOrderNo(orderNo);
        record.setOrderSourceType(orderSourceType);
        record.setUid(uid);
        return userGetIntegralFromOrderRecordMapper.countByRecordInfo(record);
    }
    @Transactional
    @Override
    public void addRecord(UserGetIntegralFromOrderRecord record) throws UserGetIntegralFromOrderRecordException {
        if (record == null || record.getUid() == null || record.getEventType() == null
                || StringUtil.isNullOrEmpty(record.getOrderNo()) || record.getOrderSourceType() == null)
            throw new UserGetIntegralFromOrderRecordException(1, "信息不完整");
        long count = countByEventTypeAndUidAndOrderInfo(record.getEventType(), record.getUid(), record.getOrderNo(),
                record.getOrderSourceType());
        if (count > 0)
            throw new UserGetIntegralFromOrderRecordException(2, "记录已存在");
        if (record.getCreateTime() == null)
            record.setCreateTime(new Date());
        userGetIntegralFromOrderRecordMapper.insertSelective(record);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/integral/IntegralGetService.java
@@ -159,26 +159,26 @@
     *  返利订单
     * @param uid
     */
    public void addRebateOrder(Long uid);
    public void addRebateOrder(Long uid,String orderNo,int sourceType);
    /**
     * 一级邀请订单
     * @param uid
     */
    public void addInviteOrderLevelOne(Long uid);
    public void addInviteOrderLevelOne(Long uid,String orderNo,int sourceType);
    /**
     * 二级邀请订单
     * @param uid
     */
    public void addInviteOrderLevelTwo(Long uid);
    public void addInviteOrderLevelTwo(Long uid,String orderNo,int sourceType);
    
    /**
     * 分享订单
     * @param uid
     */
    public void addShareOrder(Long uid);
    public void addShareOrder(Long uid,String orderNo,int sourceType);
    /**
     * 微信授权
fanli/src/main/java/com/yeshi/fanli/service/inter/user/integral/UserGetIntegralFromOrderRecordService.java
New file
@@ -0,0 +1,24 @@
package com.yeshi.fanli.service.inter.user.integral;
import com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord;
import com.yeshi.fanli.exception.integral.UserGetIntegralFromOrderRecordException;
public interface UserGetIntegralFromOrderRecordService {
    /**
     * 根据事件类型,用户,订单信息检索
     * @param eventType
     * @param uid
     * @param orderNo
     * @param orderSourceType
     * @return
     */
    public long countByEventTypeAndUidAndOrderInfo(int eventType, Long uid, String orderNo, int orderSourceType);
    /**
     *
     * @param record
     */
    public void addRecord(UserGetIntegralFromOrderRecord record) throws UserGetIntegralFromOrderRecordException;
}
fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java
@@ -840,14 +840,28 @@
    private void fanliGetIntegral(HongBaoV2 hongBaoV2) {
        if (hongBaoV2 != null && hongBaoV2.getState() == HongBaoV2.STATE_YILINGQU
                && hongBaoV2.getMoney().compareTo(new BigDecimal(0)) > 0) {
            // 查询对应的订单号
            Long mainHongBaoId = hongBaoV2.getId();
            if (hongBaoV2.getParent() != null && hongBaoV2.getParent().getId() != null)
                mainHongBaoId = hongBaoV2.getParent().getId();
            HongBaoOrder hongbaoOrder = hongBaoOrderService.selectDetailByHongBaoId(mainHongBaoId);
            if (hongbaoOrder == null || hongbaoOrder.getCommonOrder() == null)
                return;
            CommonOrder commonOrder = hongbaoOrder.getCommonOrder();
            if (hongBaoV2.getType() == HongBaoV2.TYPE_ZIGOU) {// 自购订单
                integralGetService.addRebateOrder(hongBaoV2.getUserInfo().getId());
                integralGetService.addRebateOrder(hongBaoV2.getUserInfo().getId(), commonOrder.getOrderNo(),
                        commonOrder.getSourceType());
            } else if (hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_GOODS) {// 分享订单
                integralGetService.addShareOrder(hongBaoV2.getUserInfo().getId());
                integralGetService.addShareOrder(hongBaoV2.getUserInfo().getId(), commonOrder.getOrderNo(),
                        commonOrder.getSourceType());
            } else if (hongBaoV2.getType() == HongBaoV2.TYPE_YIJI || hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_YIJI) {// 一级邀请
                integralGetService.addInviteOrderLevelOne(hongBaoV2.getUserInfo().getId());
                integralGetService.addInviteOrderLevelOne(hongBaoV2.getUserInfo().getId(), commonOrder.getOrderNo(),
                        commonOrder.getSourceType());
            } else if (hongBaoV2.getType() == HongBaoV2.TYPE_ERJI || hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_ERJI) {// 二级邀请
                integralGetService.addInviteOrderLevelTwo(hongBaoV2.getUserInfo().getId());
                integralGetService.addInviteOrderLevelTwo(hongBaoV2.getUserInfo().getId(), commonOrder.getOrderNo(),
                        commonOrder.getSourceType());
            }
        }
    }
fanli/src/main/java/com/yeshi/fanli/util/VersionUtil.java
@@ -81,7 +81,7 @@
    
    public static boolean greaterThan_2_1(String platform, String versionCode) {
        if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 52))
                || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 71)))
                || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 75)))
            return true;
        else
            return false;
fanli/src/main/java/com/yeshi/fanli/util/factory/integral/UserGetIntegralFromOrderRecordFactory.java
New file
@@ -0,0 +1,17 @@
package com.yeshi.fanli.util.factory.integral;
import com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord;
public class UserGetIntegralFromOrderRecordFactory {
    public static UserGetIntegralFromOrderRecord create(int eventType, Long uid, String orderNo, int sourceType,int integralCount) {
        UserGetIntegralFromOrderRecord record=new UserGetIntegralFromOrderRecord();
        record.setEventType(eventType);
        record.setIntegralCount(integralCount);
        record.setUid(uid);
        record.setOrderSourceType(sourceType);
        record.setOrderNo(orderNo);
        return record;
    }
}
fanli/src/main/resource/env-dev/rocketmq.properties
@@ -2,6 +2,6 @@
rocketmq.SecretKey=ixWg90QbYFKP6ae5xpAo2P1qwIyll5
#测试  http://MQ_INST_1205444665315884_Bbkj89nI.mq-internet-access.mq-internet.aliyuncs.com:80
#正式 http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
rocketmq.NAMESRV_ADDR=http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
rocketmq.NAMESRV_ADDR=http://MQ_INST_1205444665315884_Bbkj89nI.mq-internet-access.mq-internet.aliyuncs.com:80