yujian
2019-10-29 0612e7e4104f41c3f8b683073e08cdbb65dad44a
红包相关
22个文件已修改
3个文件已添加
845 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/RedPackAdminController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/redpack/RedPackExchangeMapper.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/ConfigParamsDTO.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgRedPackExchangeContentDTO.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgRedPackGiveContentDTO.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgMoneyDetail.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/redpack/RedPackDetail.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/msg/MsgMoneyDetailMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackDetailMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackExchangeMapper.xml 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/MsgMoneyDetailServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/UserMoneyMsgNotificationServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackExchangeServiceImpl.java 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/money/msg/UserMoneyMsgNotificationService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/redpack/RedPackExchangeService.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/redpack/RedPackGiveRecordService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/RedPackDetailFactory.java 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/GoodsDetailVOFactory.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgMoneyDetailFactory.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 131 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/goods/MoneyInfoVO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/msg/TokenVO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/RedPackAdminController.java
@@ -120,21 +120,19 @@
        Long uid = exchange.getUid();
        BigDecimal balance = redPackBalanceService.getBalance(uid);
        UserInfo userInfo = userInfoService.selectByPKey(uid);
        List<Long> listCount = redPackExchangeService.countState(uid);
        List<BigDecimal> listMoney = redPackExchangeService.countMoneyState(uid);
        
        JSONObject data = new JSONObject();
        data.put("exchange", exchange);
        data.put("userInfo", userInfo);
        
        data.put("countInit", listCount.get(0));
        data.put("countSucceed", listCount.get(1));
        data.put("countReject",  listCount.get(2));
        data.put("countInit", redPackExchangeService.countByUidAndState(uid, RedPackExchange.STATE_INIT));
        data.put("countSucceed", redPackExchangeService.countByUidAndState(uid, RedPackExchange.STATE_SUCCESS));
        data.put("countReject", redPackExchangeService.countByUidAndState(uid, RedPackExchange.STATE_REJECT));
        
        data.put("balance", balance);
        data.put("moneyInit", listMoney.get(0));
        data.put("moneySucceed", listMoney.get(1));
        data.put("moneyReject",  listMoney.get(2));
        data.put("moneyInit", redPackExchangeService.countMoneyByUidAndState(uid,RedPackExchange.STATE_INIT));
        data.put("moneySucceed", redPackExchangeService.countMoneyByUidAndState(uid,RedPackExchange.STATE_SUCCESS));
        data.put("moneyReject",  redPackExchangeService.countMoneyByUidAndState(uid,RedPackExchange.STATE_REJECT));
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
    }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java
@@ -119,7 +119,7 @@
        String giveMax = redPackConfigService.getValueByKey("give_money_max");
        
        // 正在提现金额
        BigDecimal extractingMoney = redPackExchangeService.countMoneyByState(uid, RedPackExchange.STATE_INIT);
        BigDecimal extractingMoney = redPackExchangeService.countMoneyByUidAndState(uid, RedPackExchange.STATE_INIT);
        
        JSONObject data = new JSONObject();
        data.put("balance", balance.setScale(2).toString());
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/redpack/RedPackExchangeMapper.java
@@ -29,21 +29,14 @@
     * @param uid
     * @return
     */
    List<Long> countState(@Param("uid") long uid);
    Long countByUidAndState(@Param("uid") long uid, @Param("state") Integer state);
    
    /**
     * 统计各个状态金额
     * @param uid
     * @return
     */
    List<BigDecimal> countMoneyState(@Param("uid") long uid);
    
    /**
     * 统计状态金额
     * @param uid
     * @return
     */
    BigDecimal countMoneyByState(@Param("uid") Long uid, @Param("state") Integer state);
    BigDecimal countMoneyByUidAndState(@Param("uid") Long uid, @Param("state") Integer state);
        
}
fanli/src/main/java/com/yeshi/fanli/dto/ConfigParamsDTO.java
New file
@@ -0,0 +1,33 @@
package com.yeshi.fanli.dto;
import java.math.BigDecimal;
public class ConfigParamsDTO {
    // 返利比例
    private BigDecimal fanLiRate;
    // 分享比例
    private BigDecimal shareRate;
    // 奖励券最高返比例
    private BigDecimal maxRewardRate;
    public BigDecimal getFanLiRate() {
        return fanLiRate;
    }
    public void setFanLiRate(BigDecimal fanLiRate) {
        this.fanLiRate = fanLiRate;
    }
    public BigDecimal getShareRate() {
        return shareRate;
    }
    public void setShareRate(BigDecimal shareRate) {
        this.shareRate = shareRate;
    }
    public BigDecimal getMaxRewardRate() {
        return maxRewardRate;
    }
    public void setMaxRewardRate(BigDecimal maxRewardRate) {
        this.maxRewardRate = maxRewardRate;
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgRedPackExchangeContentDTO.java
New file
@@ -0,0 +1,65 @@
package com.yeshi.fanli.dto.msg;
/**
 * 红包提现相关消息
 *
 * @author Administrator
 *
 */
public class MsgRedPackExchangeContentDTO {
    private String title; // 标题
    private String time; // 时间
    private String money; // 金额
    private String balance; // 余额
    private String reason; //原因
    private String handle; // 处理
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getTime() {
        return time;
    }
    public void setTime(String time) {
        this.time = time;
    }
    public String getMoney() {
        return money;
    }
    public void setMoney(String money) {
        this.money = money;
    }
    public String getBalance() {
        return balance;
    }
    public void setBalance(String balance) {
        this.balance = balance;
    }
    public String getReason() {
        return reason;
    }
    public void setReason(String reason) {
        this.reason = reason;
    }
    public String getHandle() {
        return handle;
    }
    public void setHandle(String handle) {
        this.handle = handle;
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgRedPackGiveContentDTO.java
New file
@@ -0,0 +1,47 @@
package com.yeshi.fanli.dto.msg;
/**
 * 红包赠送相关消息
 *
 * @author Administrator
 *
 */
public class MsgRedPackGiveContentDTO {
    private String title; // 标题
    private String userInfo; // 用户信息
    private String time; // 时间
    private String money; // 金额
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getUserInfo() {
        return userInfo;
    }
    public void setUserInfo(String userInfo) {
        this.userInfo = userInfo;
    }
    public String getTime() {
        return time;
    }
    public void setTime(String time) {
        this.time = time;
    }
    public String getMoney() {
        return money;
    }
    public void setMoney(String money) {
        this.money = money;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgMoneyDetail.java
@@ -21,7 +21,10 @@
    public enum MsgTypeMoneyTypeEnum {
        share("分享奖金"), invite("邀请奖金"), fanli("返利到账"), extract("提现"), extractAutoWX("自动提现"), extractValid("提现账号验证"), shareWeiQuan(
                "分享奖金扣除"), inviteWeiQuan("邀请奖金扣除"), fanliWeiQuan("返利扣除"), orderReward("返利奖励"), systemEqualize("系统补齐"),fanliElme("返利到账");
                "分享奖金扣除"), inviteWeiQuan("邀请奖金扣除"), fanliWeiQuan("返利扣除"), orderReward("返利奖励"), systemEqualize("系统补齐"),fanliElme("返利到账"),
        redPackGiveOff("赠送红包完成"),redPackReceiveOff("赠送红包领取"),redPackExchangePass("红包提现成功"),redPackExchangeReject("红包提现失败");
        private final String desc;
        private MsgTypeMoneyTypeEnum(String desc) {
@@ -66,7 +69,10 @@
    private Date updateTime;
    @Column(name = "mm_read")
    private Boolean read;
    @Column(name = "mm_content") // 消息内容
    private String content;
    public Long getId() {
        return id;
    }
@@ -202,4 +208,12 @@
    public void setDesc(String desc) {
        this.desc = desc;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/redpack/RedPackDetail.java
@@ -29,10 +29,11 @@
        giveOthers("红包赠送待领取中", "http://img.flqapp.com/img/tlj/icon_tlj.png"), 
        giveOthersSucceed("红包赠送领取成功", "http://img.flqapp.com/img/tlj/icon_tlj.png"), 
        giveOthersFail("红包赠送超时退回", "http://img.flqapp.com/img/tlj/icon_tlj.png"), 
        giveOthersReceive("好友赠送", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        
        redExchange("红包提现中", "http://img.flqapp.com/resource/money_detail/icon_score.png"),
        redExchangePass("红包提现成功", "http://img.flqapp.com/resource/money_detail/icon_score.png"),
        redExchangeReject("红包提现失败", "http://img.flqapp.com/resource/money_detail/icon_score.png");
        redExchange("红包提现中", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png"),
        redExchangePass("红包提现成功", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png"),
        redExchangeReject("红包提现失败", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png");
        private final String desc;
        private final String picture;
fanli/src/main/java/com/yeshi/fanli/mapping/msg/MsgMoneyDetailMapper.xml
@@ -18,6 +18,7 @@
        <result column="mm_read" property="read" jdbcType="BOOLEAN" />
        <result column="mm_order_type" property="orderType" jdbcType="INTEGER" />
        <result column="mm_desc" property="desc" jdbcType="VARCHAR" />
        <result column="mm_content" property="content" jdbcType="VARCHAR" />
        <association property="user" column="mm_uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="mm_uid" property="id" jdbcType="BIGINT" />
@@ -27,7 +28,7 @@
        <association property="alipayAccountValid" column="mm_source_id_alipayvalid"
            select="com.yeshi.fanli.dao.mybatis.AlipayAccountValidNormalHistoryMapper.selectByPrimaryKey" />
    </resultMap>
    <sql id="Base_Column_List">mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc
    <sql id="Base_Column_List">mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc,mm_content
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -58,9 +59,9 @@
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_msg_money
        (mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc)
        (mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc,mm_content)
        values
        (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{msgType,jdbcType=VARCHAR},#{orderCount,jdbcType=INTEGER},#{goodsCount,jdbcType=INTEGER},#{orderId,jdbcType=VARCHAR},#{extract.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{balance,jdbcType=DECIMAL},#{stateDesc,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{read,jdbcType=BOOLEAN},#{orderType,jdbcType=INTEGER},#{desc,jdbcType=VARCHAR})
        (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{msgType,jdbcType=VARCHAR},#{orderCount,jdbcType=INTEGER},#{goodsCount,jdbcType=INTEGER},#{orderId,jdbcType=VARCHAR},#{extract.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{balance,jdbcType=DECIMAL},#{stateDesc,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{read,jdbcType=BOOLEAN},#{orderType,jdbcType=INTEGER},#{desc,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail"
        useGeneratedKeys="true" keyProperty="id">
@@ -83,6 +84,7 @@
            <if test="read != null">mm_read,</if>
            <if test="orderType != null">mm_order_type,</if>
            <if test="desc != null">mm_desc,</if>
            <if test="content != null">mm_content,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -103,6 +105,7 @@
            <if test="read != null">#{read,jdbcType=BOOLEAN},</if>
            <if test="orderType != null">#{orderType,jdbcType=INTEGER}</if>
            <if test="desc != null">#{desc,jdbcType=VARCHAR},</if>
            <if test="content != null">#{content,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail">update
@@ -119,7 +122,8 @@
        #{createTime,jdbcType=TIMESTAMP},mm_update_time =
        #{updateTime,jdbcType=TIMESTAMP},mm_read = #{read,jdbcType=BOOLEAN}
        ,mm_order_type =#{orderType,jdbcType=INTEGER},
        mm_desc = #{desc,jdbcType=VARCHAR} where mm_id =
        mm_desc = #{desc,jdbcType=VARCHAR},
        mm_content = #{content,jdbcType=VARCHAR} where mm_id =
        #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail">
@@ -142,6 +146,7 @@
            <if test="read != null">mm_read=#{read,jdbcType=BOOLEAN},</if>
            <if test="orderType !=null">mm_order_type =#{orderType,jdbcType=INTEGER},</if>
            <if test="desc != null">mm_desc=#{desc,jdbcType=VARCHAR},</if>
            <if test="content != null">mm_content=#{content,jdbcType=VARCHAR},</if>
        </set>
        where mm_id = #{id,jdbcType=BIGINT}
    </update>
fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackDetailMapper.xml
@@ -68,10 +68,14 @@
    </set> where rpd_id = #{id,jdbcType=BIGINT}
  </update>
  
  <select id="getByIdentifyCode" resultMap="BaseResultMap">
      SELECT * FROM `yeshi_red_pack_detail` t
    WHERE t.`rpd_identify_code` = #{identifyCode}
  </select>
  
  <select id="countUseMoneyByDate" resultType="java.math.BigDecimal">
      SELECT IFNULL(SUM(t.`rpd_money`),0) FROM `yeshi_red_pack_detail` t
    WHERE t.`rpd_money` <![CDATA[<]]> 0 AND t.`rpd_uid` = #{uid} AND t.`rpd_type` <![CDATA[<>]]> 'violation'
    WHERE t.rpd_display = 1 AND t.`rpd_money` <![CDATA[<]]> 0 AND t.`rpd_uid` = #{uid} AND t.`rpd_type` <![CDATA[<>]]> 'violation'
        <if test="dateType == 1"> <!-- 今日  -->
            AND TO_DAYS(t.`rpd_create_time`) =  TO_DAYS(NOW());
        </if>
@@ -89,7 +93,7 @@
  
  <select id="countAddMoneyByDate" resultType="java.math.BigDecimal">
      SELECT IFNULL(SUM(t.`rpd_money`),0) FROM `yeshi_red_pack_detail` t
    WHERE t.`rpd_money` <![CDATA[>]]> 0  AND t.`rpd_uid` = #{uid} AND  t.`rpd_type`<![CDATA[<>]]>'refund'
    WHERE t.rpd_display = 1 AND t.`rpd_money` <![CDATA[>]]> 0  AND t.`rpd_uid` = #{uid} AND  t.`rpd_type`<![CDATA[<>]]>'refund'
        <if test="dateType == 1"> <!-- 今日  -->
            AND TO_DAYS(t.`rpd_create_time`) =  TO_DAYS(NOW());
        </if>
@@ -106,14 +110,14 @@
  
  <select id="selectByMaxCreateTime" resultMap="BaseResultMap">
    SELECT <include refid="Base_Column_List" /> FROM yeshi_red_pack_detail t
    WHERE t.`rpd_uid`=#{uid} AND t.`rpd_create_time`<![CDATA[<=]]> #{date}
    WHERE t.rpd_display = 1 AND t.`rpd_uid`=#{uid} AND t.`rpd_create_time`<![CDATA[<=]]> #{date}
    ORDER BY t.`rpd_create_time` DESC,t.rpd_id DESC
    LIMIT #{count}
  </select>
  
  <select id="selectByUidWithIndexId" resultMap="BaseResultMap">
    SELECT <include refid="Base_Column_List" />    FROM yeshi_red_pack_detail t 
    WHERE t.`rpd_uid`=#{uid}
    WHERE t.rpd_display = 1 AND t.`rpd_uid`=#{uid}
        AND t.`rpd_create_time`<![CDATA[<=]]>(SELECT rpd_create_time FROM yeshi_red_pack_detail WHERE rpd_id =#{id})
    ORDER BY t.`rpd_create_time` DESC,t.rpd_id DESC
    LIMIT #{count}
@@ -127,13 +131,13 @@
                FROM (SELECT  #{item} AS `time`) c 
                LEFT JOIN (SELECT DATE_FORMAT(d.`rpd_create_time`,'%Y-%m') AS `time`,SUM(d.`rpd_money`)AS money
                               FROM `yeshi_red_pack_detail` d
                               WHERE d.`rpd_uid`=#{uid} AND  d.`rpd_money`<![CDATA[>=]]>0 AND DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')=#{item}
                               WHERE d.rpd_display = 1 AND d.`rpd_uid`=#{uid} AND  d.`rpd_money`<![CDATA[>=]]>0 AND DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')=#{item}
                               GROUP BY DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')
                               ) a ON a.time=c.time
                LEFT JOIN(SELECT DATE_FORMAT(d.`rpd_create_time`,'%Y-%m') AS `time`,SUM(d.`rpd_money`) AS money
                              FROM `yeshi_red_pack_detail` d
                            WHERE d.`rpd_uid`=#{uid} AND d.`rpd_money` <![CDATA[<]]>0 AND DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')=#{item}
                            WHERE d.rpd_display = 1 AND d.`rpd_uid`=#{uid} AND d.`rpd_money` <![CDATA[<]]>0 AND DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')=#{item}
                              GROUP BY DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')
                              ) b ON c.time=b.time
           </trim>
@@ -142,19 +146,19 @@
  
  <select id="selectCountByUid" resultType="java.lang.Long"  parameterType="java.lang.Long">
    SELECT count(rpd_id) FROM yeshi_red_pack_detail
    WHERE rpd_uid=#{uid}
    WHERE rpd_display = 1 AND rpd_uid=#{uid}
  </select>
  
  <select id="selectMonthCountByUid" resultType="java.lang.Integer">
    SELECT COUNT(*) FROM 
            (SELECT * FROM yeshi_red_pack_detail d 
             WHERE d.`rpd_uid`=#{uid} AND d.`rpd_create_time` <![CDATA[<=]]> #{date}
             WHERE d.rpd_display = 1 AND d.`rpd_uid`=#{uid} AND d.`rpd_create_time` <![CDATA[<=]]> #{date}
             GROUP BY DATE_FORMAT(d.`rpd_create_time`,'%y-%m')
             ) a
  </select>
  
  <select id="selectCountByUidAndMaxCreateTime" resultType="java.lang.Long">
    SELECT count(rpd_id) FROM yeshi_red_pack_detail
    WHERE rpd_uid=#{uid} and `rpd_create_time`<![CDATA[<=]]>#{date}
    WHERE rpd_display = 1 AND rpd_uid=#{uid} and `rpd_create_time`<![CDATA[<=]]>#{date}
 </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackExchangeMapper.xml
@@ -62,7 +62,7 @@
         <if test="state != null ">
            AND d.rpe_state = #{state}
        </if>
    ORDER BY d.`rpe_state`,d.`rpe_create_time`
    ORDER BY  d.`rpe_state`,d.`rpe_create_time` DESC
    LIMIT #{start},#{count}
  </select>
  
@@ -77,21 +77,12 @@
        </if>
  </select>
  
  <select id="countState" resultType="Long">
      SELECT IFNULL(COUNT(d.rpe_id),0) FROM yeshi_red_pack_exchange d
    WHERE d.rpe_uid = #{uid}
    GROUP BY d.`rpe_state`
    ORDER BY d.`rpe_state`
  <select id="countByUidAndState" resultType="Long">
    SELECT IFNULL(COUNT(d.rpe_id),0) FROM yeshi_red_pack_exchange d
    WHERE d.rpe_uid = #{uid} AND d.`rpe_state` = #{state}
  </select>
  
  <select id="countMoneyState" resultType="BigDecimal">
      SELECT IFNULL(SUM(d.rpe_money),0) FROM yeshi_red_pack_exchange d
    WHERE d.rpe_uid = #{uid}
    GROUP BY d.`rpe_state`
    ORDER BY d.`rpe_state`
  </select>
  <select id="countMoneyByState" resultType="BigDecimal">
  <select id="countMoneyByUidAndState" resultType="BigDecimal">
      SELECT IFNULL(SUM(d.rpe_money),0) FROM yeshi_red_pack_exchange d
    WHERE d.rpe_uid = #{uid} AND d.`rpe_state` = #{state}
  </select>
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/MsgMoneyDetailServiceImpl.java
@@ -126,6 +126,15 @@
                update.setStateDesc(detail.getStateDesc());
                msgMoneyDetailMapper.updateByPrimaryKeySelective(update);
            }
        } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackGiveOff
                || detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangePass
                || detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangeReject) {
            if (detail.getUser() == null)
                throw new MsgMoneyDetailException(2, "消息信息不全");
            detail.setCreateTime(new Date());
            detail.setUpdateTime(new Date());
            detail.setRead(false);
            msgMoneyDetailMapper.insertSelective(detail);
        }
        userMsgReadStateService.addMoneyMsgUnReadCount(detail.getUser().getId(), 1);
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/UserMoneyMsgNotificationServiceImpl.java
@@ -10,6 +10,7 @@
import com.yeshi.fanli.dto.push.PushContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
import com.yeshi.fanli.entity.bus.user.Extract;
import com.yeshi.fanli.entity.bus.user.ExtractWeiXinRecord;
@@ -284,5 +285,16 @@
            e.printStackTrace();
        }
    }
    @Async
    @Override
    public void redPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu) {
        MsgMoneyDetail detail = MsgMoneyDetailFactory.createRedPackMsg(uid, type, content, beiZhu);
        try {
            msgMoneyDetailService.addMsgMoneyDetail(detail);
        } catch (MsgMoneyDetailException e) {
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackExchangeServiceImpl.java
@@ -1,15 +1,20 @@
package com.yeshi.fanli.service.impl.redpack;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.omg.CORBA.LongHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.gson.Gson;
import com.yeshi.fanli.dao.mybatis.redpack.RedPackExchangeMapper;
import com.yeshi.fanli.dto.msg.MsgRedPackExchangeContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
@@ -18,7 +23,9 @@
import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackExchange;
import com.yeshi.fanli.exception.redpack.RedPackExchangeException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.money.UserMoneyService;
import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.redpack.RedPackConfigService;
import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
@@ -45,6 +52,9 @@
    @Resource
    private RedPackDetailService redPackDetailService;
    
    @Resource
    private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
    
    @Override
    public List<RedPackExchange> query(Integer start, Integer count, String key, Integer state){
@@ -57,19 +67,13 @@
    }
    
    @Override
    public List<Long> countState(long uid){
        return redPackExchangeMapper.countState(uid);
    }
    @Override
    public List<BigDecimal> countMoneyState(long uid){
        return redPackExchangeMapper.countMoneyState(uid);
    public Long countByUidAndState(long uid, Integer state) {
        return redPackExchangeMapper.countByUidAndState(uid, state);
    }
    
    @Override
    public BigDecimal countMoneyByState(Long uid, Integer state){
        return redPackExchangeMapper.countMoneyByState(uid, state);
    public BigDecimal countMoneyByUidAndState(Long uid, Integer state){
        return redPackExchangeMapper.countMoneyByUidAndState(uid, state);
    }
    
    @Override
@@ -125,7 +129,7 @@
        if (record == null) 
            throw new RedPackExchangeException(1,"申请记录已不存在");
        if (RedPackExchange.STATE_INIT == record.getState())
        if (RedPackExchange.STATE_INIT != record.getState())
            throw new RedPackExchangeException(1,"该申请已被处理,请刷新");
        Date nowDate = new Date();
@@ -148,14 +152,28 @@
        // 添加资金
        userMoneyService.addUserMoney(record.getUid(), record.getMoney(), detail);
        
        // 更新红包提现明细
        try {
            String identifyCode = StringUtil.Md5(RedPackDetailTypeEnum.redExchangePass.name() + ":" + record.getId());
            String identifyCode = StringUtil.Md5(RedPackDetailTypeEnum.redExchange.name() + ":" + record.getId());
            RedPackDetail redPackDetail = redPackDetailService.getByIdentifyCode(identifyCode);
            // 创建明细更新
            RedPackDetail updateDetail = RedPackDetailFactory.updateExchangePass(redPackDetail.getId(), record);
            redPackDetailService.updateByPrimaryKeySelective(updateDetail);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
            throw new RedPackExchangeException(1,"更新提现明细出错");
        }
        //消息
        SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
        String beizu = "红包提现成功后请到“我的-账户余额”中查看";
        MsgRedPackExchangeContentDTO dto = new MsgRedPackExchangeContentDTO();
        dto.setTitle("红包提现");
        dto.setTime(sd.format(record.getCreateTime()));
        dto.setHandle("人工审核" + sd.format(new Date()));
        dto.setMoney("¥" + record.getMoney().setScale(2));
        dto.setBalance("¥" + redPackBalanceService.getBalance(record.getUid()));
        userMoneyMsgNotificationService.redPackMsg(record.getUid(), MsgTypeMoneyTypeEnum.redPackExchangePass, new Gson().toJson(dto), beizu);
    }
    
@@ -166,7 +184,7 @@
        if (record == null) 
            throw new RedPackExchangeException(1,"申请记录已不存在");
        if (RedPackExchange.STATE_INIT == record.getState())
        if (RedPackExchange.STATE_INIT != record.getState())
            throw new RedPackExchangeException(1,"该申请已被处理,请刷新");
        
        record.setReason(reason);
@@ -179,8 +197,18 @@
        try {
            redPackBalanceService.addRedPack(record.getUid(), record.getMoney(), RedPackDetailFactory.createExchange(record));
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
            throw new RedPackExchangeException(1, "红包退回时出错");
        }
        //消息
        SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
        MsgRedPackExchangeContentDTO dto = new MsgRedPackExchangeContentDTO();
        dto.setTitle("红包提现");
        dto.setReason(reason);
        dto.setHandle(""); // TODO 处理方式待定
        dto.setTime(sd.format(record.getCreateTime()));
        userMoneyMsgNotificationService.redPackMsg(record.getUid(), MsgTypeMoneyTypeEnum.redPackExchangeReject, new Gson().toJson(dto), null);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java
@@ -12,14 +12,17 @@
import com.yeshi.fanli.dao.mybatis.redpack.RedPackGiveRecordMapper;
import com.yeshi.fanli.entity.bus.user.TokenRecord;
import com.yeshi.fanli.entity.bus.user.TokenRecord.TokenTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackDetail;
import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.redpack.RedPackConfigService;
import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
import com.yeshi.fanli.service.inter.redpack.RedPackGiveRecordService;
import com.yeshi.fanli.service.inter.user.TokenRecordService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TokenUtil;
import com.yeshi.fanli.util.factory.RedPackDetailFactory;
@@ -38,6 +41,22 @@
    
    @Resource
    private TokenRecordService tokenRecordService;
    @Resource
    private RedPackDetailService redPackDetailService;
    @Override
    public RedPackGiveRecord selectByPrimaryKey(Long id) {
        return redPackGiveRecordMapper.selectByPrimaryKey(id);
    }
    @Override
    public void updateByPrimaryKeySelective(RedPackGiveRecord record) {
        redPackGiveRecordMapper.updateByPrimaryKeySelective(record);
    }
    
    @Override
    @Transactional(rollbackFor = Exception.class)
@@ -85,14 +104,53 @@
            tips = tips.replace("{APP名称}", projectChineseName);
        }
        tips = tips.replace("{口令}", token).replace("{下载链接}", redPackConfigService.getValueByKey("app_down_link")).replace("{面额}",
                amount.setScale(0).toString());
                amount.toString());
        
        // 减少红包
        try {
            redPackBalanceService.subRedPack(uid, amount, RedPackDetailFactory.createGiveOthers(giveRecord, null, RedPackDetailTypeEnum.giveOthers));
            redPackBalanceService.subRedPack(uid, amount, RedPackDetailFactory.createGiveOthers(giveRecord));
        } catch (Exception e) {
            throw new RedPackGiveRecordException(1, "红包创建失败");
        }
        return tips;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public RedPackGiveRecord receiveFriendsGive(Long uid, Long id) throws RedPackGiveRecordException{
        RedPackGiveRecord giveRecord = redPackGiveRecordMapper.selectByPrimaryKey(id);
        if (giveRecord == null || giveRecord.getState() != RedPackGiveRecord.STATE_INIT)
            throw new RedPackGiveRecordException(1, "赠送记录失效或已被领取");
        Date now = new Date();
        Date endTime = giveRecord.getEndTime();
        if (endTime != null && endTime.getTime() < now.getTime())
            throw new RedPackGiveRecordException(1, "红包已失效了");
        giveRecord.setGiveUid(uid);
        giveRecord.setReceiveTime(now);
        giveRecord.setState(RedPackGiveRecord.STATE_RECEIVE);
        // 领取人增加红包
        try {
            redPackBalanceService.addRedPack(uid, giveRecord.getAmount(), RedPackDetailFactory.createGiveOthers(giveRecord));
        } catch (Exception e) {
            throw new RedPackGiveRecordException(1, "红包领取失败");
        }
        // 更新赠送记录
        redPackGiveRecordMapper.updateByPrimaryKey(giveRecord);
        try {
            String identifyCode = StringUtil.Md5(RedPackDetailTypeEnum.giveOthers.name() + ":" + giveRecord.getId());
            RedPackDetail redPackDetail = redPackDetailService.getByIdentifyCode(identifyCode);
            RedPackDetail updateDetail = RedPackDetailFactory.createGiveOthersSucceed(redPackDetail.getId(), giveRecord);
            redPackDetailService.updateByPrimaryKeySelective(updateDetail);
        } catch (Exception e) {
            throw new RedPackGiveRecordException(1,"更新提现明细出错");
        }
        return giveRecord;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java
@@ -11,9 +11,13 @@
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Service;
import com.google.gson.Gson;
import com.yeshi.fanli.dao.mybatis.user.TokenRecordMapper;
import com.yeshi.fanli.dto.msg.MsgInviteContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
import com.yeshi.fanli.dto.msg.MsgRedPackGiveContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord;
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;
@@ -21,13 +25,17 @@
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
import com.yeshi.fanli.entity.system.SystemCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
import com.yeshi.fanli.exception.user.TokenRecordException;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.SystemCouponService;
import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
import com.yeshi.fanli.service.inter.redpack.RedPackGiveRecordService;
import com.yeshi.fanli.service.inter.user.TokenRecordService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
@@ -83,6 +91,12 @@
    @Resource
    private UserInviteMsgNotificationService userInviteMsgNotificationService;
    
    @Resource
    private RedPackGiveRecordService redPackGiveRecordService;
    @Resource
    private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
    @Override
    public void insertSelective(TokenRecord record) {
@@ -125,8 +139,9 @@
            throw new TokenRecordException(1, "口令已失效");
        
        Integer num = 1;
        Integer num = 0;
        Integer type = 0;
        String money = null;
        boolean state = false;
        List<String> tips = new ArrayList<String>();
        String identify = rokenRecord.getIdentify();
@@ -140,15 +155,12 @@
                throw new TokenRecordException(1, "赠送记录不存在");
            
            Date endTime = giveRecord.getEndTime();
            if (endTime != null && endTime.getTime() < now.getTime())
                throw new TokenRecordException(1, "赠送记录已过期");
            // 用户券信息
            UserSystemCoupon userCoupon = userSystemCouponService.selectByPrimaryKey(giveRecord.getCouponId());
            if (userCoupon == null || userCoupon.getGive() == null || !userCoupon.getGive())
                throw new TokenRecordException(1, "券不存在或非赠送状态");
            
            if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE) {
            if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE || (endTime != null && endTime.getTime() < now.getTime())) {
                tips.add("哎呀,这张免单券已失效了!");
            } else if (userCoupon.getState() == UserSystemCoupon.STATE_END_USE) {
                tips.add("哎呀,这张免单券已被领取了!");
@@ -179,15 +191,12 @@
                throw new TokenRecordException(1, "赠送记录不存在");
            
            Date endTime = giveRecord.getEndTime();
            if (endTime != null && endTime.getTime() < now.getTime())
                throw new TokenRecordException(1, "赠送记录已过期");
            UserSystemCoupon userCoupon = userSystemCouponService.selectByPrimaryKey(giveRecord.getCouponId());
            if (userCoupon == null || userCoupon.getGive() == null || !userCoupon.getGive())
                throw new TokenRecordException(1, "券不存在或非赠送状态");
            
            
            if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE) {
            if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE|| (endTime != null && endTime.getTime() < now.getTime())) {
                tips.add("哎呀,这张返利奖励券已失效了!");
            } else if (userCoupon.getState() == UserSystemCoupon.STATE_END_USE) {
                tips.add("哎呀,这张返利奖励券已被领取了!");
@@ -207,6 +216,35 @@
                }
            } else {
                throw new TokenRecordException(1, "口令已失效");
            }
        } else if (tokenType == TokenTypeEnum.redPack) {
            type = 13;
            RedPackGiveRecord giveRecord = redPackGiveRecordService.selectByPrimaryKey(Long.parseLong(identify));
            if (giveRecord == null)
                throw new TokenRecordException(1, "口令已失效");
            Date endTime = giveRecord.getEndTime();
            // 赠送面额
            money = giveRecord.getAmount().setScale(2).toString();
            if(giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_OVERDUE
                    || (endTime != null && endTime.getTime() < now.getTime())) {
                tips.add("哎呀,这个红包已失效了!");
            } else if (giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_RECEIVE) {
                tips.add("哎呀,这个红包已被领取了!");
            } else if (giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_INIT) {
                if (uid == null || uid <= 0)
                    throw new TokenRecordException(1001, "温馨提示,[红包]需要登录后领取");
                state = true;
                UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
                if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
                    tips.add("确认领取后,你将成为增值的一级队员;");
                    tips.add("红包可提现,可购买折扣商品;");
                    tips.add("成功领取后,请到“我的-红包”中查看。");
                } else {
                    tips.add("红包可提现,可购买折扣商品;");
                    tips.add("成功领取后,请到“我的-红包”中查看。");
                }
            }
        } else if (tokenType == TokenTypeEnum.taoLiJin) {
            throw new TokenRecordException(1, "推广红包相关功能已下线!");
@@ -237,6 +275,7 @@
        
        TokenVO tokenVO = new TokenVO();
        tokenVO.setAmount(num);
        tokenVO.setMoney(money);
        tokenVO.setToken(parseToken);
        tokenVO.setNickName(nickName + "赠送");
        tokenVO.setPortrait(portrait);
@@ -285,7 +324,6 @@
        String msg = "领取成功";
        TokenTypeEnum tokenType = rokenRecord.getType();
        if (tokenType == TokenTypeEnum.freeCoupon) {
            // 赠送记录
            UserSystemCouponGiveRecord giveRecord = userSystemCouponGiveRecordService
                    .selectByPrimaryKey(Long.parseLong(identify));
@@ -465,6 +503,55 @@
                        addInviteMsg(uid, giveUid, "返利奖励券");
                }
            });
        } else if (tokenType == TokenTypeEnum.redPack) {
            try {
                msg = "领取红包成功,请到[我的-红包]中查看";
                // 领取红包、更新记录
                RedPackGiveRecord giveRecord = redPackGiveRecordService.receiveFriendsGive(uidToken, Long.parseLong(identify));
                // 消息 + 队员
                executor.execute(new Runnable() {
                    @Override
                    public void run() {
                        SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
                        boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
                        String beiZhu = "无";
                        String giveBeiZhu = "无";
                        if (addTeam) {
                            beiZhu = "你已成为赠送人的一级队员";
                            giveBeiZhu = "领取人已成为你的一级队员";
                            // 激活邀请信息
                            addInviteMsg(uid, giveUid, giveRecord.getAmount().setScale(2) + "元红包");
                        }
                        // 领取人消息
                        String giveUserName = "无";
                        UserInfo giveuser = userInfoService.selectByPKey(giveUid);
                        if (giveuser != null && !StringUtil.isNullOrEmpty(giveuser.getNickName()))
                            giveUserName = giveuser.getNickName();
                        MsgRedPackGiveContentDTO dto = new MsgRedPackGiveContentDTO();
                        dto.setTitle("红包领取");
                        dto.setUserInfo("昵称:" + giveUserName + " ID:" + giveUid);
                        dto.setTime(sd.format(giveRecord.getGiveTime()));
                        dto.setMoney("¥" + giveRecord.getAmount().setScale(2));
                        userMoneyMsgNotificationService.redPackMsg(giveUid, MsgTypeMoneyTypeEnum.redPackReceiveOff, new Gson().toJson(dto), beiZhu);
                        // 赠送人消息
                        String userName = "无";
                        UserInfo user = userInfoService.selectByPKey(uid);
                        if (user != null && !StringUtil.isNullOrEmpty(user.getNickName()))
                            userName = user.getNickName();
                        MsgRedPackGiveContentDTO givedto = new MsgRedPackGiveContentDTO();
                        givedto.setTitle("红包领取");
                        givedto.setUserInfo("昵称:" + userName + " ID:" + uid);
                        givedto.setTime(sd.format(new Date()));
                        givedto.setMoney("¥" + giveRecord.getAmount().setScale(2));
                        userMoneyMsgNotificationService.redPackMsg(giveUid, MsgTypeMoneyTypeEnum.redPackGiveOff, new Gson().toJson(givedto), giveBeiZhu);
                    }
                });
            } catch (RedPackGiveRecordException e) {
                throw new TokenRecordException(1, e.getMsg());
            }
        } else if (tokenType == TokenTypeEnum.taoLiJin) {
            throw new TokenRecordException(1, "推广红包相关功能已下线!");
        } else {
fanli/src/main/java/com/yeshi/fanli/service/inter/money/msg/UserMoneyMsgNotificationService.java
@@ -2,6 +2,7 @@
import java.math.BigDecimal;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
import com.yeshi.fanli.entity.bus.user.Extract;
import com.yeshi.fanli.entity.bus.user.ExtractWeiXinRecord;
@@ -153,4 +154,9 @@
     */
    public void extractAuto(ExtractWeiXinRecord extractRecord, String stateDesc, String desc, String beiZhu);
    /**
     * 红包消息
     */
    public void redPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/redpack/RedPackExchangeService.java
@@ -34,14 +34,8 @@
     * @param uid
     * @return
     */
    public List<Long> countState(long uid);
    public Long countByUidAndState(long uid,  Integer state);
    /**
     * 统计各个状态金额
     * @param uid
     * @return
     */
    public List<BigDecimal> countMoneyState(long uid);
    /**
     * 获取申请
@@ -73,7 +67,7 @@
     * @param state
     * @return
     */
    public BigDecimal countMoneyByState(Long uid, Integer state);
    public BigDecimal countMoneyByUidAndState(Long uid, Integer state);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/redpack/RedPackGiveRecordService.java
@@ -2,6 +2,7 @@
import java.math.BigDecimal;
import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
public interface RedPackGiveRecordService {
@@ -15,5 +16,26 @@
     */
    public String giving(Long uid, BigDecimal amount) throws RedPackGiveRecordException;
    /**
     * 查询记录
     * @param id
     * @return
     */
    public RedPackGiveRecord selectByPrimaryKey(Long id);
    /**
     * 更新记录
     * @param record
     */
    public void updateByPrimaryKeySelective(RedPackGiveRecord record);
    /**
     * 口令红包领取
     * @param uid
     * @param id
     * @throws RedPackGiveRecordException
     */
    public RedPackGiveRecord receiveFriendsGive(Long uid, Long id) throws RedPackGiveRecordException;
}
fanli/src/main/java/com/yeshi/fanli/util/factory/RedPackDetailFactory.java
@@ -84,21 +84,88 @@
    
    
    
    public static RedPackDetail createGiveOthers(RedPackGiveRecord giveRecord, String desc, RedPackDetailTypeEnum type) throws RedPackDetailException {
        if (giveRecord == null || type == null)
            throw new RedPackDetailException(1, "提现记录、类型不能为空");
        // 红包明细- 退回红包
    /**
     * 赠送好友明细
     * @param giveRecord
     * @return
     * @throws RedPackDetailException
     */
    public static RedPackDetail createGiveOthers(RedPackGiveRecord giveRecord) throws RedPackDetailException {
        if (giveRecord == null)
            throw new RedPackDetailException(1, "赠送记录不能为空");
        RedPackDetail detail = new RedPackDetail();
        detail.setDisplay(true);
        detail.setUid(giveRecord.getGiveUid());
        detail.setMoney(new BigDecimal("-" + giveRecord.getAmount()));
        detail.setType(RedPackDetailTypeEnum.giveOthers);
        detail.setTitle(RedPackDetailTypeEnum.giveOthers.getDesc());
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthers.name() + ":" + giveRecord.getId()));
        detail.setCreateTime(new Date());
        return detail;
    }
    /**
     * 赠送成功
     * @param id
     * @param giveRecord
     * @return
     * @throws RedPackDetailException
     */
    public static RedPackDetail createGiveOthersSucceed(Long id, RedPackGiveRecord giveRecord) throws RedPackDetailException {
        if (giveRecord == null)
            throw new RedPackDetailException(1, "赠送记录不能为空");
        RedPackDetail detail = new RedPackDetail();
        detail.setId(id);
        detail.setDisplay(true);
        detail.setType(RedPackDetailTypeEnum.giveOthersSucceed);
        detail.setTitle(RedPackDetailTypeEnum.giveOthersSucceed.getDesc());
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthersSucceed.name() + ":" + giveRecord.getId()));
        detail.setCreateTime(new Date());
        return detail;
    }
    /**
     * 赠送失败
     * @param giveRecord
     * @return
     * @throws RedPackDetailException
     */
    public static RedPackDetail createGiveOthersFail(RedPackGiveRecord giveRecord) throws RedPackDetailException {
        if (giveRecord == null)
            throw new RedPackDetailException(1, "赠送记录不能为空");
        RedPackDetail detail = new RedPackDetail();
        detail.setDisplay(true);
        detail.setUid(giveRecord.getGiveUid());
        detail.setMoney(giveRecord.getAmount());
        detail.setDesc(desc);
        detail.setType(type);
        detail.setTitle(type.getDesc());
        detail.setIdentifyCode(StringUtil.Md5(type.name() + ":" + giveRecord.getId()));
        detail.setType(RedPackDetailTypeEnum.giveOthersFail);
        detail.setTitle(RedPackDetailTypeEnum.giveOthersFail.getDesc());
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthersFail.name() + ":" + giveRecord.getId()));
        detail.setCreateTime(new Date());
        return detail;
    }
    /**
     * 赠送失败
     * @param giveRecord
     * @return
     * @throws RedPackDetailException
     */
    public static RedPackDetail createGiveOthersReceive(RedPackGiveRecord giveRecord) throws RedPackDetailException {
        if (giveRecord == null)
            throw new RedPackDetailException(1, "赠送记录不能为空");
        RedPackDetail detail = new RedPackDetail();
        detail.setDisplay(true);
        detail.setUid(giveRecord.getReceiveUid());
        detail.setMoney(giveRecord.getAmount());
        detail.setType(RedPackDetailTypeEnum.giveOthersReceive);
        detail.setTitle(RedPackDetailTypeEnum.giveOthersReceive.getDesc());
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthersReceive.name() + ":" + giveRecord.getId()));
        detail.setCreateTime(new Date());
        return detail;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/GoodsDetailVOFactory.java
@@ -9,6 +9,7 @@
import org.yeshi.utils.taobao.TbImgUtil;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.common.GoodsOtherInfoDTO;
import com.yeshi.fanli.dto.jd.JDCouponInfo;
import com.yeshi.fanli.dto.jd.JDPingouInfo;
@@ -54,8 +55,7 @@
     *            返利比例
     * @return
     */
    public static GoodsDetailVO convertCommonGoods(CommonGoods goods, String pid, BigDecimal fanLiRate,
            BigDecimal shareRate) {
    public static GoodsDetailVO convertCommonGoods(CommonGoods goods, ConfigParamsDTO params) {
        GoodsDetailVO goodsInfo = new GoodsDetailVO();
        goodsInfo.setGoodsId(goods.getGoodsId());
        goodsInfo.setTitle(goods.getTitle());
@@ -157,8 +157,11 @@
        // 资金信息
        MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
        moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
        moneyInfoVO.setFanliMoney(CommonGoodsUtil.getCommissionInfo(goods, fanLiRate));
        moneyInfoVO.setShareMoney(CommonGoodsUtil.getCommissionInfo(goods, shareRate));
        BigDecimal commission = CommonGoodsUtil.getCommission(goods, params.getFanLiRate());
        moneyInfoVO.setFanliMoney("¥" + commission);
        moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
        moneyInfoVO.setShareMoney(CommonGoodsUtil.getCommissionInfo(goods, params.getShareRate()));
        goodsInfo.setMoneyInfo(moneyInfoVO);
        // 券信息
@@ -204,8 +207,7 @@
     *            返利比例
     * @return
     */
    public static GoodsDetailVO convertTaoBaoGoodsBriefExtra(TaoBaoGoodsBriefExtra goods, BigDecimal fanLiRate,
            BigDecimal shareRate) {
    public static GoodsDetailVO convertTaoBaoGoodsBriefExtra(TaoBaoGoodsBriefExtra goods, ConfigParamsDTO params) {
        GoodsDetailVO goodsInfo = new GoodsDetailVO();
        goodsInfo.setBaoyou(true);
        goodsInfo.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
@@ -235,9 +237,12 @@
            TaoBaoHongBaoInfo taoBaoHongBaoInfo = goods.getTaoBaoHongBaoInfo();
            moneyInfoVO.setFanliMoney("¥" + taoBaoHongBaoInfo.getHongbao());
            moneyInfoVO.setShareMoney("¥" + taoBaoHongBaoInfo.getHongbao());
            moneyInfoVO.setMaxMoney("¥" + taoBaoHongBaoInfo.getHongbao().add(MoneyBigDecimalUtil.mul(taoBaoHongBaoInfo.getHongbao(), params.getMaxRewardRate())));
        } else {
            moneyInfoVO.setFanliMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, fanLiRate));
            moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, shareRate));
            BigDecimal commission = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getFanLiRate());
            moneyInfoVO.setFanliMoney("¥" + commission);
            moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
            moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, params.getShareRate()));
        }
        goodsInfo.setMoneyInfo(moneyInfoVO);
@@ -284,8 +289,7 @@
     *            返利比例
     * @return
     */
    public static GoodsDetailVO convertTaoBao(TaoBaoGoodsBrief goods, String pid, BigDecimal fanLiRate,
            BigDecimal shareRate) {
    public static GoodsDetailVO convertTaoBao(TaoBaoGoodsBrief goods, ConfigParamsDTO params) {
        GoodsDetailVO goodsInfo = new GoodsDetailVO();
        goodsInfo.setBaoyou(true);
        goodsInfo.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
@@ -338,8 +342,10 @@
        // 资金信息
        MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
        moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
        moneyInfoVO.setFanliMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, fanLiRate));
        moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, shareRate));
        BigDecimal commission = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getFanLiRate());
        moneyInfoVO.setFanliMoney("¥" + commission);
        moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
        moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, params.getShareRate()));
        goodsInfo.setMoneyInfo(moneyInfoVO);
        // 券信息
@@ -365,7 +371,7 @@
                coupon.setStartTime(goods.getCouponEffectiveStartTime().replace("-", "."));
            }
            coupon.setLink(TaoBaoCouponUtil.getCoupleUrl(goods.getCouponActivityId(), pid, goods.getAuctionId() + ""));
            coupon.setLink(TaoBaoCouponUtil.getCoupleUrl(goods.getCouponActivityId(), null, goods.getAuctionId() + ""));
            coupon.setStartFee(goods.getCouponStartFee());
            goodsInfo.setHasCoupon(true);
@@ -381,7 +387,7 @@
        }
        if (TaoBaoUtil.isYUShou(goods)) {// 预售商品
            goodsInfo = loadYuShouInfo(goodsInfo, goods, pid, fanLiRate, shareRate);
            goodsInfo = loadYuShouInfo(goodsInfo, goods, null, params.getFanLiRate(), params.getShareRate());
        }
        if (Constant.IS_TEST) {
@@ -407,7 +413,6 @@
            if (goodsInfo.getLabels() == null)
                goodsInfo.setLabels(new ArrayList<>());
            goodsInfo.getLabels().add(new ClientTextStyleVO("预售", "#FF2B4E"));
        }
        return goodsInfo;
    }
@@ -422,7 +427,7 @@
     *            返利比例
     * @return
     */
    public static GoodsDetailVO convertJDGoods(JDGoods goods, BigDecimal fanLiRate, BigDecimal shareRate) {
    public static GoodsDetailVO convertJDGoods(JDGoods goods, ConfigParamsDTO params) {
        GoodsDetailVO goodsInfo = new GoodsDetailVO();
        goodsInfo.setGoodsType(Constant.SOURCE_TYPE_JD);
        goodsInfo.setGoodsId(goods.getSkuId());
@@ -446,8 +451,10 @@
        // 资金信息
        MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
        moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
        moneyInfoVO.setFanliMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, fanLiRate));
        moneyInfoVO.setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, shareRate));
        BigDecimal commission = JDUtil.getGoodsFanLiMoney(goods, params.getFanLiRate());
        moneyInfoVO.setFanliMoney("¥" + commission);
        moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
        moneyInfoVO.setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, params.getShareRate()));
        goodsInfo.setMoneyInfo(moneyInfoVO);
        JDCouponInfo couponInfo = goods.getCouponInfo();
@@ -540,7 +547,7 @@
     *            返利比例
     * @return
     */
    public static GoodsDetailVO convertPDDGoods(PDDGoodsDetail goods, BigDecimal fanLiRate, BigDecimal shareRate) {
    public static GoodsDetailVO convertPDDGoods(PDDGoodsDetail goods, ConfigParamsDTO params) {
        GoodsDetailVO goodsInfo = new GoodsDetailVO();
        goodsInfo.setBaoyou(true);
        goodsInfo.setGoodsType(Constant.SOURCE_TYPE_PDD);
@@ -575,8 +582,10 @@
        // 资金信息
        MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
        moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
        moneyInfoVO.setFanliMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, fanLiRate));
        moneyInfoVO.setShareMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, shareRate));
        BigDecimal commission = PinDuoDuoUtil.getGoodsFanLiMoney(goods, params.getFanLiRate());
        moneyInfoVO.setFanliMoney("¥" + commission);
        moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
        moneyInfoVO.setShareMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, params.getShareRate()));
        goodsInfo.setMoneyInfo(moneyInfoVO);
        Boolean hasCoupon = goods.getHasCoupon();
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgMoneyDetailFactory.java
@@ -10,6 +10,7 @@
import com.yeshi.fanli.entity.bus.user.ExtractWeiXinRecord;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
public class MsgMoneyDetailFactory {
@@ -363,5 +364,27 @@
        detail.setUser(new UserInfo(uid));
        return detail;
    }
    /**
     * 红包相关信息
     * @param uid
     * @param type
     * @param content
     * @param beiZhu
     * @return
     */
    public static MsgMoneyDetail createRedPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu) {
        if (uid == null || type == null || StringUtil.isNullOrEmpty(content))
            return null;
        MsgMoneyDetail detail = new MsgMoneyDetail();
        detail.setUser(new UserInfo(uid));
        detail.setRead(false);
        detail.setContent(content);
        detail.setMsgType(type);
        detail.setBeiZhu(beiZhu);
        detail.setCreateTime(new Date());
        return detail;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -14,6 +14,8 @@
import com.yeshi.fanli.dto.msg.MsgOtherRewardIntegralDTO;
import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.dto.msg.MsgRedPackExchangeContentDTO;
import com.yeshi.fanli.dto.msg.MsgRedPackGiveContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum;
import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
@@ -556,8 +558,135 @@
            return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
                    msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
        }
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackReceiveOff) { // 红包成功领取
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgRedPackGiveContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackGiveContentDTO.class);
            if (dto == null)
                return null;
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getUserInfo() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠送人", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getTime() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠送时间", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getMoney() + "", COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("领取金额", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackGiveOff) { // 红包被成功领取
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgRedPackGiveContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackGiveContentDTO.class);
            if (dto == null)
                return null;
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getUserInfo() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("领取人", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getTime() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("领取时间", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getMoney() + "", COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠送金额", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangePass) { // 红包提现成功
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgRedPackExchangeContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackExchangeContentDTO.class);
            if (dto == null)
                return null;
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(MsgTypeMoneyTypeEnum.redPackExchangePass.getDesc() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getTime() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("提现时间", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getHandle() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("审核方式", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getMoney() + "", COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("提现金额", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getBalance() + "", COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangeReject) { // 红包提现成功
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgRedPackExchangeContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackExchangeContentDTO.class);
            if (dto == null)
                return null;
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(MsgTypeMoneyTypeEnum.redPackExchangePass.getDesc() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getTime() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("提现时间", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getReason() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("失败原因", COLOR_TITLE), contentList));
            String handle = dto.getHandle();
            if (StringUtil.isNullOrEmpty(handle))
                handle = "无";
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(handle, COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("处理", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
        }
        return null;
    }
fanli/src/main/java/com/yeshi/fanli/vo/goods/MoneyInfoVO.java
@@ -15,6 +15,8 @@
    private int moneyType;// 资金类型
    @Expose
    private String shareMoney;// 分享奖金
    @Expose
    private String maxMoney;// 最高返回
    public String getFanliMoney() {
        return fanliMoney;
@@ -39,4 +41,13 @@
    public void setShareMoney(String shareMoney) {
        this.shareMoney = shareMoney;
    }
    public String getMaxMoney() {
        return maxMoney;
    }
    public void setMaxMoney(String maxMoney) {
        this.maxMoney = maxMoney;
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/msg/TokenVO.java
@@ -20,6 +20,9 @@
    
    @Expose // 数量、面额
    private Integer amount;
    @Expose // 数量、面额--- V2
    private String money;
    
    @Expose // 提示语
    private List<String> tips;
@@ -84,4 +87,12 @@
    public void setState(Boolean state) {
        this.state = state;
    }
    public String getMoney() {
        return money;
    }
    public void setMoney(String money) {
        this.money = money;
    }
}