admin
2019-07-22 d2357693d74ec048ed19e483ea29f87d823cde5f
资金明细添加京东,拼多多兼容
6个文件已修改
270 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/money/UserMoneyDetailMapper.xml 211 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserMoneyDetailServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java
@@ -66,6 +66,10 @@
    @Expose
    @Column(name = "umd_type")
    private UserMoneyDetailTypeEnum type;
    @Column(name = "umd_order_type")
    private Integer orderType;//和订单相关数据才处理
    @Expose
    @Column(name = "umd_title")
    private String title;// 标题
@@ -192,6 +196,15 @@
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public Integer getOrderType() {
        return orderType;
    }
    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/money/UserMoneyDetailMapper.xml
@@ -19,20 +19,19 @@
        <result column="umd_updatetime" property="updateTime" jdbcType="TIMESTAMP" />
        <!-- 老版明细适用该字段 -->
        <result column="state" property="state" jdbcType="INTEGER" />
        <result column="umd_order_type" property="orderType" jdbcType="INTEGER" />
        <association property="userInfo" column="umd_uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="umd_uid" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <resultMap id="UserMonthMoneyMap" type="com.yeshi.fanli.vo.money.UserMonthMoneyVO">
        <result column="expend" property="expend" jdbcType="DECIMAL" />
        <result column="income" property="income" jdbcType="DECIMAL" />
        <result column="dateFormate" property="dateFormate" jdbcType="VARCHAR" />
    </resultMap>
    <sql id="Base_Column_List">umd_id,umd_uid,umd_money,umd_type,umd_title,umd_sub_title,umd_desc_info,umd_source_identify_id,umd_identify_code,umd_beizhu,umd_createtime,umd_updatetime
    <sql id="Base_Column_List">umd_id,umd_uid,umd_money,umd_type,umd_title,umd_sub_title,umd_desc_info,umd_source_identify_id,umd_identify_code,umd_beizhu,umd_createtime,umd_updatetime,umd_order_type
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -40,208 +39,102 @@
        <include refid="Base_Column_List" />
        from yeshi_ec_user_money_detail where umd_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByUidWithIndexId" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_user_money_detail d WHERE d.`umd_createtime`
        <![CDATA[
        FROM yeshi_ec_user_money_detail d WHERE d.`umd_createtime` <![CDATA[
            <=
        ]]>
        (SELECT
        d.`umd_createtime` FROM yeshi_ec_user_money_detail d WHERE
        (SELECT d.`umd_createtime` FROM yeshi_ec_user_money_detail d WHERE
        d.`umd_id`=#{id}) and d.umd_uid=#{uid} order by d.`umd_createtime`
        desc,d.umd_id desc limit #{count}
    </select>
    <select id="selectCountByUid" resultType="java.lang.Long"
        parameterType="java.lang.Long">
        SELECT count(umd_id) FROM yeshi_ec_user_money_detail
        where umd_uid=#{uid}
    </select>
        parameterType="java.lang.Long">SELECT count(umd_id) FROM yeshi_ec_user_money_detail
        where umd_uid=#{uid}</select>
    <select id="selectByMaxCreateTime" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_user_money_detail d WHERE d.umd_uid=#{uid} and
        d.`umd_createtime`
        <![CDATA[
        d.`umd_createtime`<![CDATA[
            <=
        ]]>
        #{date}
        order by d.`umd_createtime` desc,d.umd_id desc limit #{count}
        #{date} order by d.`umd_createtime` desc,d.umd_id desc limit #{count}
    </select>
    <select id="selectCountByUidAndMaxCreateTime" resultType="java.lang.Long">
        SELECT count(umd_id) FROM yeshi_ec_user_money_detail
        where
        umd_uid=#{uid} and `umd_createtime`
        <![CDATA[
    <select id="selectCountByUidAndMaxCreateTime" resultType="java.lang.Long">SELECT
        count(umd_id) FROM yeshi_ec_user_money_detail where umd_uid=#{uid} and
        `umd_createtime`<![CDATA[
            <=
        ]]>
        #{date}
    </select>
    <select id="selectMonthCountByUid" resultType="java.lang.Integer">
        SELECT COUNT(*) FROM (SELECT * FROM yeshi_ec_user_money_detail d WHERE
    <select id="selectMonthCountByUid" resultType="java.lang.Integer">SELECT
        COUNT(*) FROM (SELECT * FROM yeshi_ec_user_money_detail d WHERE
        d.`umd_uid`=#{uid} and d.`umd_createtime` <![CDATA[<=]]>
        #{date} group by DATE_FORMAT(d.`umd_createtime`,'%y-%m')) a
    </select>
    <select id="selectMonthMoneyByUid" resultMap="UserMonthMoneyMap">
        <foreach collection="dateFormat" index="index" item="item"
            separator="UNION ALL">
            <trim prefix="(" suffix=")">
                SELECT
                c.time as dateFormate , if(a.money is null,0,a.money) as
                income ,if(b.money is null,0,b.money) as expend
                FROM
                (select #{item}
                as `time`) c
                left join
                (
                SELECT
                DATE_FORMAT(
                d.`umd_createtime`,'%Y-%m')
                AS
                `time`,SUM(d.`umd_money`)
                AS money
                FROM
                `yeshi_ec_user_money_detail`
                d
                WHERE d.`umd_uid`=#{uid}
                AND
                d.`umd_money`>=0 AND DATE_FORMAT(
                SELECT c.time as dateFormate , if(a.money is null,0,a.money) as
                income ,if(b.money is null,0,b.money) as expend FROM (select #{item}
                as `time`) c left join ( SELECT DATE_FORMAT(
                d.`umd_createtime`,'%Y-%m') AS `time`,SUM(d.`umd_money`) AS money
                FROM `yeshi_ec_user_money_detail` d WHERE d.`umd_uid`=#{uid} AND
                d.`umd_money`&gt;=0 AND DATE_FORMAT(
                d.`umd_createtime`,'%Y-%m')=#{item} GROUP BY DATE_FORMAT(
                d.`umd_createtime`,'%Y-%m')
                ) a
                on a.time=c.time
                LEFT JOIN
                (
                SELECT
                DATE_FORMAT(
                d.`umd_createtime`,'%Y-%m') AS
                `time`,SUM(d.`umd_money`)
                AS money
                FROM
                `yeshi_ec_user_money_detail`
                d
                WHERE d.`umd_uid`=#{uid}
                AND
                d.`umd_money` <![CDATA[<0]]>
                AND DATE_FORMAT(
                d.`umd_createtime`,'%Y-%m')=#{item} GROUP BY
                DATE_FORMAT(
                d.`umd_createtime`,'%Y-%m')
                ) b ON c.time=b.time
                d.`umd_createtime`,'%Y-%m') ) a on a.time=c.time LEFT JOIN ( SELECT
                DATE_FORMAT( d.`umd_createtime`,'%Y-%m') AS
                `time`,SUM(d.`umd_money`) AS money FROM `yeshi_ec_user_money_detail`
                d WHERE d.`umd_uid`=#{uid} AND d.`umd_money`<![CDATA[<0]]>
                AND DATE_FORMAT( d.`umd_createtime`,'%Y-%m')=#{item} GROUP BY
                DATE_FORMAT( d.`umd_createtime`,'%Y-%m') ) b ON c.time=b.time
            </trim>
        </foreach>
    </select>
    <select id="selectByUidWithState" resultMap="BaseResultMap">
        SELECT a.* FROM
        ((SELECT d.*,-1 AS state FROM
        `yeshi_ec_user_money_detail` d
        WHERE
    <select id="selectByUidWithState" resultMap="BaseResultMap">SELECT a.* FROM
        ((SELECT d.*,-1 AS state FROM `yeshi_ec_user_money_detail` d WHERE
        d.`umd_uid`=#{uid} AND (d.`umd_type`!='extract' AND
        d.`umd_type`!='extractReject')
        )
        UNION ALL(
        SELECT d.*,-1 AS
        state
        FROM
        `yeshi_ec_user_money_detail` d LEFT JOIN
        `yeshi_ec_extract` e
        ON
        d.`umd_type`!='extractReject') ) UNION ALL( SELECT d.*,-1 AS state
        FROM `yeshi_ec_user_money_detail` d LEFT JOIN `yeshi_ec_extract` e ON
        e.`id`=d.umd_source_identify_id WHERE d.`umd_uid`=#{uid} AND
        d.umd_type='extractReject'
        )
        UNION ALL(
        SELECT
        d.*,e.state FROM
        `yeshi_ec_user_money_detail` d LEFT JOIN
        `yeshi_ec_extract` e ON
        d.umd_type='extractReject' ) UNION ALL( SELECT d.*,e.state FROM
        `yeshi_ec_user_money_detail` d LEFT JOIN `yeshi_ec_extract` e ON
        e.`id`=d.`umd_source_identify_id` WHERE d.`umd_uid`=#{uid} AND
        d.umd_type='extract'
        )) a ORDER BY a.umd_createtime DESC LIMIT
        #{start},#{count}
    </select>
    <select id="selectCountByUidWithState" resultType="java.lang.Long">
        SELECT
        count(*) FROM
        ((SELECT d.*,-1 AS state FROM
        `yeshi_ec_user_money_detail` d
        WHERE
        d.`umd_uid`=#{uid} AND
        (d.`umd_type`!='extract' AND d.`umd_type`!='extractReject')
        )
        UNION ALL(
        SELECT d.*,-1 AS
        state
        FROM `yeshi_ec_user_money_detail` d LEFT JOIN
        `yeshi_ec_extract` e
        ON
        e.`id`=d.umd_source_identify_id WHERE
        d.`umd_uid`=#{uid} AND
        d.umd_type='extractReject'
        )
        UNION ALL(
        SELECT
        d.umd_type='extract' )) a ORDER BY a.umd_createtime DESC LIMIT
        #{start},#{count}</select>
    <select id="selectCountByUidWithState" resultType="java.lang.Long">SELECT
        count(*) FROM ((SELECT d.*,-1 AS state FROM
        `yeshi_ec_user_money_detail` d WHERE d.`umd_uid`=#{uid} AND
        (d.`umd_type`!='extract' AND d.`umd_type`!='extractReject') ) UNION
        ALL( SELECT d.*,-1 AS state FROM `yeshi_ec_user_money_detail` d LEFT
        JOIN `yeshi_ec_extract` e ON e.`id`=d.umd_source_identify_id WHERE
        d.`umd_uid`=#{uid} AND d.umd_type='extractReject' ) UNION ALL( SELECT
        d.*,e.state FROM `yeshi_ec_user_money_detail` d LEFT JOIN
        `yeshi_ec_extract` e ON e.`id`=d.`umd_source_identify_id` WHERE
        d.`umd_uid`=#{uid} AND
        d.umd_type='extract'
        )) a
    </select>
    <select id="getTotalMoneyByTypeAndUidWithDate" resultType="java.math.BigDecimal">
        select sum(umd_money) from yeshi_ec_user_money_detail where
        umd_uid=#{uid} and umd_createtime>=#{minDate} and
        umd_createtime<![CDATA[<]]>#{maxDate}
        d.`umd_uid`=#{uid} AND d.umd_type='extract' )) a</select>
    <select id="getTotalMoneyByTypeAndUidWithDate" resultType="java.math.BigDecimal">select
        sum(umd_money) from yeshi_ec_user_money_detail where umd_uid=#{uid}
        and umd_createtime&gt;=#{minDate} and umd_createtime<![CDATA[<]]>#{maxDate}
        <foreach collection="typeList" item="item" open=" and ("
            separator=" or " close=")">
            umd_type=#{item}
        </foreach>
            separator=" or " close=")">umd_type=#{item}</foreach>
    </select>
    <select id="selectByTypeAndUidAndIdentifyCode" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_user_money_detail where
        umd_uid=#{uid} and
        from yeshi_ec_user_money_detail where umd_uid=#{uid} and
        umd_type=#{type} and umd_source_identify_id=#{sourceIdentifyId}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_user_money_detail where umd_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.money.UserMoneyDetail"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_user_money_detail
        (umd_id,umd_uid,umd_money,umd_type,umd_title,umd_sub_title,umd_desc_info,umd_source_identify_id,umd_identify_code,umd_beizhu,umd_createtime,umd_updatetime)
        (umd_id,umd_uid,umd_money,umd_type,umd_title,umd_sub_title,umd_desc_info,umd_source_identify_id,umd_identify_code,umd_beizhu,umd_createtime,umd_updatetime,umd_order_type)
        values
        (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{type,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{subTitle,jdbcType=VARCHAR},#{descInfo,jdbcType=VARCHAR},#{sourceIdentifyId,jdbcType=BIGINT},#{identifyCode,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
        (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{type,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{subTitle,jdbcType=VARCHAR},#{descInfo,jdbcType=VARCHAR},#{sourceIdentifyId,jdbcType=BIGINT},#{identifyCode,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{orderType,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.money.UserMoneyDetail"
        useGeneratedKeys="true" keyProperty="id">
@@ -259,6 +152,7 @@
            <if test="beiZhu != null">umd_beizhu,</if>
            <if test="createTime != null">umd_createtime,</if>
            <if test="updateTime != null">umd_updatetime,</if>
            <if test="orderType != null">umd_order_type,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -274,6 +168,7 @@
            <if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="orderType != null">#{orderType,jdbcType=INTEGER}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.money.UserMoneyDetail">update
@@ -288,7 +183,8 @@
        #{identifyCode,jdbcType=VARCHAR},umd_beizhu =
        #{beiZhu,jdbcType=VARCHAR},umd_createtime =
        #{createTime,jdbcType=TIMESTAMP},umd_updatetime =
        #{updateTime,jdbcType=TIMESTAMP} where umd_id = #{id,jdbcType=BIGINT}
        #{updateTime,jdbcType=TIMESTAMP} ,umd_order_type
        =#{orderType,jdbcType=INTEGER} where umd_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.money.UserMoneyDetail">
        update yeshi_ec_user_money_detail
@@ -305,6 +201,7 @@
            <if test="beiZhu != null">umd_beizhu=#{beiZhu,jdbcType=VARCHAR},</if>
            <if test="createTime != null">umd_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">umd_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="orderType !=null">umd_order_type =#{orderType,jdbcType=INTEGER},</if>
        </set>
        where umd_id = #{id,jdbcType=BIGINT}
    </update>
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
@@ -661,7 +661,7 @@
                long invalidCount = hongBaoV2Mapper.countInviteOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_SX,
                        minDate, maxDate);
                UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createInvite(uid, (int) validCount,
                UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createInvite(uid,Constant.SOURCE_TYPE_TAOBAO, (int) validCount,
                        (int) weiQuanCount, (int) invalidCount, invitemoney, new Date());
                // 增加资金
@@ -760,7 +760,7 @@
                long invalidCount = commonOrderService.countByUidAndOrderStateWithOrderBalanceTime(uid,
                        CommonOrder.STATE_SX, minDate, maxDate);
                UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, (int) validCount,
                UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid,Constant.SOURCE_TYPE_TAOBAO, (int) validCount,
                        (int) weiQuanCount, (int) invalidCount, sharemoney, new Date());
                // 添加资金
                userMoneyService.addUserMoney(uid, sharemoney, userMoneyDetail);
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserMoneyDetailServiceImpl.java
@@ -20,6 +20,7 @@
import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
import com.yeshi.fanli.exception.money.UserMoneyDetailException;
import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.vo.money.UserMoneyDetailHistoryVO;
import com.yeshi.fanli.vo.money.UserMonthMoneyVO;
@@ -49,6 +50,7 @@
            } else {// 筛选了时间
                list = userMoneyDetailMapper.selectByMaxCreateTime(uid, maxTime, 20);
            }
            if (list != null && list.size() > 0) {
                Calendar calendar = Calendar.getInstance();
                calendar.setTimeInMillis(list.get(0).getCreateTime().getTime());
@@ -104,6 +106,10 @@
        }
        if (list != null) {
            // 重新设置标题
            for (UserMoneyDetail md : list)
                resetTitle(md);
            if (userMoneyDetailId != null && list.size() > 0) {
                UserMoneyDetail umd = userMoneyDetailMapper.selectByPrimaryKey(userMoneyDetailId);
                if (!TimeUtil.getGernalTime(umd.getCreateTime().getTime(), "yyyy-MM")
@@ -167,6 +173,23 @@
        return finalList;
    }
    private UserMoneyDetail resetTitle(UserMoneyDetail detail) {
        UserMoneyDetailTypeEnum[] enums = new UserMoneyDetailTypeEnum[] { UserMoneyDetailTypeEnum.fanli,
                UserMoneyDetailTypeEnum.fanliWeiQuan, UserMoneyDetailTypeEnum.invite,
                UserMoneyDetailTypeEnum.inviteAndShare, UserMoneyDetailTypeEnum.inviteWeiQuan,
                UserMoneyDetailTypeEnum.orderReward, UserMoneyDetailTypeEnum.repeatStatistic,
                UserMoneyDetailTypeEnum.share, UserMoneyDetailTypeEnum.shareWeiQuan, UserMoneyDetailTypeEnum.weiQuan };
        boolean inType = false;
        for (UserMoneyDetailTypeEnum e : enums)
            if (detail.getType() == e) {
                inType = true;
                break;
            }
        if (inType)
            detail.setTitle(detail.getTitle() + "【" + Constant.getSourceName(detail.getOrderType()) + "】");
        return detail;
    }
    @Override
    public long countUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Date maxTime) {
        long monthCount = 0L;
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -767,7 +767,7 @@
            orderHongBaoMapService.addOrderHongBaoMap(hongBaoV2, order);
            // 3.插入资金明细,用户余额 // TODO
            UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createOrderReward(orderNo, money,
            UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createOrderReward(orderNo,goodsType, money,
                    new UserInfo(uid));
            userMoneyDetailService.addUserMoneyDetail(userMoneyDetail);
            userInfoService.addMoney(new UserInfo(uid), money);
fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java
@@ -12,6 +12,7 @@
import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack;
import com.yeshi.fanli.exception.money.UserMoneyDetailException;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
@@ -45,6 +46,7 @@
        detail.setDescInfo("订单号:" + orderId);
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(uid));
        detail.setOrderType(orderType);
        return detail;
    }
@@ -60,7 +62,7 @@
     * @return
     * @throws UserMoneyDetailException
     */
    public static UserMoneyDetail createShare(Long uid, int validCount, int weiQuanCount, int invalidCount,
    public static UserMoneyDetail createShare(Long uid,int orderType, int validCount, int weiQuanCount, int invalidCount,
            BigDecimal money, Date time) throws UserMoneyDetailException {
        if (money == null)
            throw new UserMoneyDetailException(1, "返利金额为空");
@@ -86,6 +88,7 @@
        detail.setDescInfo(String.format("有效订单:%s笔  维权订单:%s笔  失效订单:%s笔", validCount, weiQuanCount, invalidCount));
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(uid));
        detail.setOrderType(orderType);
        return detail;
    }
@@ -101,7 +104,7 @@
     * @return
     * @throws UserMoneyDetailException
     */
    public static UserMoneyDetail createInvite(Long uid, int validCount, int weiQuanCount, int invalidCount,
    public static UserMoneyDetail createInvite(Long uid,int orderType, int validCount, int weiQuanCount, int invalidCount,
            BigDecimal money, Date time) throws UserMoneyDetailException {
        if (money == null)
            throw new UserMoneyDetailException(1, "返利金额为空");
@@ -128,6 +131,7 @@
            detail.setDescInfo(String.format("有效订单:%s笔   维权订单:%s笔   失效订单:%s笔", validCount, weiQuanCount, invalidCount));
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(uid));
        detail.setOrderType(orderType);
        return detail;
    }
@@ -167,6 +171,7 @@
        detail.setDescInfo("订单号:" + drawBack.getOrderId());
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(uid));
        detail.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
        return detail;
    }
@@ -206,6 +211,7 @@
        detail.setDescInfo("订单号:" + drawBack.getOrderId());
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(uid));
        detail.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
        return detail;
    }
@@ -245,6 +251,7 @@
        detail.setDescInfo("订单号:" + drawBack.getOrderId());
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(uid));
        detail.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
        return detail;
    }
@@ -415,7 +422,7 @@
     * @return
     * @throws UserMoneyDetailException
     */
    public static UserMoneyDetail createOrderReward(String orderId, BigDecimal money, UserInfo user)
    public static UserMoneyDetail createOrderReward(String orderId,int orderType, BigDecimal money, UserInfo user)
            throws UserMoneyDetailException {
        if (StringUtil.isNullOrEmpty(orderId))
            throw new UserMoneyDetailException(1, "订单号不能为空");
@@ -432,6 +439,7 @@
        detail.setType(UserMoneyDetailTypeEnum.orderReward);
        detail.setUpdateTime(new Date());
        detail.setUserInfo(user);
        detail.setOrderType(orderType);
        // detail.setDescInfo("订单号:" + orderId);
        return detail;
    }
@@ -445,7 +453,7 @@
     * @return
     * @throws UserMoneyDetailException
     */
    public static UserMoneyDetail createRepeatStatistic(String orderId, BigDecimal money, UserInfo user)
    public static UserMoneyDetail createRepeatStatistic(String orderId,int orderType,  BigDecimal money, UserInfo user)
            throws UserMoneyDetailException {
        if (StringUtil.isNullOrEmpty(orderId))
            throw new UserMoneyDetailException(1, "订单号不能为空");
@@ -464,6 +472,7 @@
        detail.setUpdateTime(new Date());
        detail.setUserInfo(user);
        detail.setDescInfo("订单号:" + orderId);
        detail.setOrderType(orderType);
        return detail;
    }