yujian
2019-11-12 48077e8c704216f38939cfbf1702f45d7190801d
Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div
6个文件已修改
1个文件已添加
288 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgRedPackUseContentDTO.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgMoneyDetail.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/MsgMoneyDetailServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/InviteOrderSubsidyServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderPayServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 186 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgRedPackUseContentDTO.java
New file
@@ -0,0 +1,58 @@
package com.yeshi.fanli.dto.msg;
import java.math.BigDecimal;
import java.util.Date;
/**
 * 紅包使用相关消息
 *
 * @author Administrator
 *
 */
public class MsgRedPackUseContentDTO {
    private String goodsSetName;//套餐名称
    private BigDecimal money;//现金
    private BigDecimal hongBao;//红包
    private Date time;//审核时间
    private String reason;//原因
    public String getReason() {
        return reason;
    }
    public void setReason(String reason) {
        this.reason = reason;
    }
    public String getGoodsSetName() {
        return goodsSetName;
    }
    public void setGoodsSetName(String goodsSetName) {
        this.goodsSetName = goodsSetName;
    }
    public BigDecimal getMoney() {
        return money;
    }
    public void setMoney(BigDecimal money) {
        this.money = money;
    }
    public BigDecimal getHongBao() {
        return hongBao;
    }
    public void setHongBao(BigDecimal hongBao) {
        this.hongBao = hongBao;
    }
    public Date getTime() {
        return time;
    }
    public void setTime(Date time) {
        this.time = time;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgMoneyDetail.java
@@ -40,7 +40,9 @@
        redPackNewUserReward("新人奖励-完成首笔订单"),
        redPackInviteSucceed("立得现金-成功邀请好友"),
        redPackFirstSharedOrder("递增奖励-好友完成订单"),
        redPackMonthSharedOrder("连续奖励-好友完成订单");
        redPackMonthSharedOrder("连续奖励-好友完成订单"),
        redPackUseSuccess("红包使用成功"),
        redPackUseFail("红包使用失败");
        private final String desc;
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/MsgMoneyDetailServiceImpl.java
@@ -134,7 +134,9 @@
                || detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackNewUserReward
                || detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackInviteSucceed
                || detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackFirstSharedOrder
                || detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackMonthSharedOrder) {
                || detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackMonthSharedOrder
                || detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackUseFail
                || detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackUseSuccess) {
            if (detail.getUser() == null)
                throw new MsgMoneyDetailException(2, "消息信息不全");
            detail.setCreateTime(new Date());
fanli/src/main/java/com/yeshi/fanli/service/impl/order/InviteOrderSubsidyServiceImpl.java
@@ -27,6 +27,7 @@
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
@Service
public class InviteOrderSubsidyServiceImpl implements InviteOrderSubsidyService {
@@ -62,6 +63,11 @@
    @Transactional
    @Override
    public void addOrderSubsidy(InviteOrderSubsidy orderSubsidy) throws InviteOrderSubsidyException {
        // 机制2020年生效
        if (System.currentTimeMillis() < TimeUtil.convertToTimeTemp("2020-01-01", "yyyy-MM-dd")) {
            return;
        }
        if (orderSubsidy.getMoney() == null || StringUtil.isNullOrEmpty(orderSubsidy.getOrderNo())
                || orderSubsidy.getSourceType() == null || orderSubsidy.getUid() == null)
            throw new InviteOrderSubsidyException(1, "数据不完整");
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderPayServiceImpl.java
@@ -16,6 +16,8 @@
import com.google.gson.Gson;
import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
import com.yeshi.fanli.dto.mq.order.body.BanLiShopOrderMQMsg;
import com.yeshi.fanli.dto.msg.MsgRedPackUseContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackDetail;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsClass;
@@ -26,6 +28,7 @@
import com.yeshi.fanli.exception.redpack.RedPackDetailException;
import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
import com.yeshi.fanli.exception.shop.FuLuChargeException;
import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsClassService;
@@ -59,6 +62,9 @@
    @Resource
    private RedPackDetailService redPackDetailService;
    @Resource
    private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
    @Resource(name = "producer")
    private Producer producer;
@@ -333,6 +339,15 @@
            }
        }
        // 消息发送
        MsgRedPackUseContentDTO dto = new MsgRedPackUseContentDTO();
        dto.setGoodsSetName(order.getOrderGoods().getSetName());
        dto.setHongBao(order.getHongBaoPayment());
        dto.setMoney(order.getMoneyPayment());
        dto.setTime(new Date());
        userMoneyMsgNotificationService.redPackMsg(order.getUid(), MsgTypeMoneyTypeEnum.redPackUseSuccess,
                new Gson().toJson(dto), null);
        try {
            if (Constant.IS_TEST) {
                FuLuChargeApiUtil.shaXiangCharge(set.getChargeFuLuNum(), "banlishop" + order.getOrderNo(),
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java
@@ -23,6 +23,8 @@
import com.yeshi.fanli.dao.mybatis.shop.BanLiShopOrderMapper;
import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
import com.yeshi.fanli.dto.mq.order.body.BanLiShopOrderMQMsg;
import com.yeshi.fanli.dto.msg.MsgRedPackUseContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.mq.MQUnSendInfo;
import com.yeshi.fanli.entity.redpack.RedPackDetail;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
@@ -35,6 +37,7 @@
import com.yeshi.fanli.exception.redpack.RedPackBalanceException;
import com.yeshi.fanli.exception.redpack.RedPackDetailException;
import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
import com.yeshi.fanli.service.inter.mq.MQUnSendInfoService;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsClassService;
@@ -83,6 +86,9 @@
    @Resource(name = "transactionManager")
    private DataSourceTransactionManager transactionManager;
    @Resource
    private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
    @Transactional
    @Override
@@ -395,6 +401,15 @@
            update.setUpdateTime(new Date());
            update.setRejectTime(new Date());
            banLiShopOrderMapper.updateByPrimaryKeySelective(update);
            // 消息发送
            MsgRedPackUseContentDTO dto = new MsgRedPackUseContentDTO();
            dto.setGoodsSetName(order.getOrderGoods().getSetName());
            dto.setHongBao(order.getHongBaoPayment());
            dto.setMoney(order.getMoneyPayment());
            dto.setReason(msg);
            dto.setTime(new Date());
            userMoneyMsgNotificationService.redPackMsg(order.getUid(), MsgTypeMoneyTypeEnum.redPackUseFail,
                    new Gson().toJson(dto), null);
            transactionManager.commit(transactionStatus);
        } catch (Exception e) {
            transactionManager.rollback(transactionStatus);
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -17,6 +17,7 @@
import com.yeshi.fanli.dto.msg.MsgRedPackAddContentDTO;
import com.yeshi.fanli.dto.msg.MsgRedPackExchangeContentDTO;
import com.yeshi.fanli.dto.msg.MsgRedPackGiveContentDTO;
import com.yeshi.fanli.dto.msg.MsgRedPackUseContentDTO;
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;
@@ -115,7 +116,7 @@
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单类型", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            if (msg.getState() == HongBaoV2.STATE_BUKELINGQU||msg.getState() == HongBaoV2.STATE_KELINGQU)
            if (msg.getState() == HongBaoV2.STATE_BUKELINGQU || msg.getState() == HongBaoV2.STATE_KELINGQU)
                contentList.add(new ClientTextStyleVO("已付款", COLOR_HIGHLIGHT_CONTENT));
            else if (msg.getState() == HongBaoV2.STATE_SHIXIAO)
                contentList.add(new ClientTextStyleVO("未付款/已退款", COLOR_HIGHLIGHT_CONTENT));
@@ -567,25 +568,22 @@
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.getMoney()), COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("金额", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(msg.getDesc(), COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("来源", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.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/msg/icon_msg_subsidy.png",
                    msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
            return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_subsidy.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;
@@ -593,7 +591,7 @@
            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));
@@ -611,9 +609,8 @@
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_give.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
            return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_give.png", dto.getTitle(),
                    msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackGiveOff) { // 红包被成功领取
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
@@ -621,7 +618,7 @@
            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));
@@ -639,9 +636,8 @@
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_give.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
            return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_give.png", dto.getTitle(),
                    msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackGiveBack) { // 红包未被领取退回
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
@@ -649,7 +645,7 @@
            MsgRedPackGiveContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackGiveContentDTO.class);
            if (dto == null)
                return null;
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getTitle() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠送类别", COLOR_TITLE), contentList));
@@ -657,11 +653,11 @@
            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.getGiveTime() + "", 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));
@@ -672,16 +668,17 @@
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_give.png",
                    MsgTypeMoneyTypeEnum.redPackGiveBack.getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
                    MsgTypeMoneyTypeEnum.redPackGiveBack.getDesc(),
                    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);
            MsgRedPackExchangeContentDTO dto = new Gson().fromJson(msg.getContent(),
                    MsgRedPackExchangeContentDTO.class);
            if (dto == null)
                return null;
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(msg.getMsgType().getDesc() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
@@ -693,31 +690,31 @@
            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/msg/icon_hongbao_tixian.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
            return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_tixian.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);
            MsgRedPackExchangeContentDTO dto = new Gson().fromJson(msg.getContent(),
                    MsgRedPackExchangeContentDTO.class);
            if (dto == null)
                return null;
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(msg.getMsgType().getDesc() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
@@ -729,23 +726,21 @@
            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/msg/icon_hongbao_tixian.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
            return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png", dto.getTitle(),
                    msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackNewUserReward
                || msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackInviteSucceed
                || msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackFirstSharedOrder
@@ -756,7 +751,7 @@
            MsgRedPackAddContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackAddContentDTO.class);
            if (dto == null)
                return null;
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(msg.getMsgType().getDesc() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("增加原因", COLOR_TITLE), contentList));
@@ -768,15 +763,120 @@
            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/img/tlj/icon_tlj.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
            return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png", dto.getTitle(),
                    msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackUseSuccess) { // 红包使用成功
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgRedPackUseContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackUseContentDTO.class);
            if (dto == null)
                return null;
            String useType = "";
            boolean moneyPay = dto.getMoney() != null && dto.getMoney().compareTo(new BigDecimal(0)) > 0;
            boolean hongBaoPay = dto.getHongBao() != null && dto.getHongBao().compareTo(new BigDecimal(0)) > 0;
            if (moneyPay && hongBaoPay) {
                useType = "红包+现金";
            } else if (hongBaoPay)
                useType = "仅红包";
            else if (moneyPay)
                useType = "仅现金";
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO("红包使用成功", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("状态", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getGoodsSetName() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("兑换商品", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(useType, COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("兑换方式", COLOR_TITLE), contentList));
            if (hongBaoPay) {
                contentList = new ArrayList<>();
                contentList
                        .add(new ClientTextStyleVO("¥"+dto.getHongBao().setScale(2).toString(), COLOR_HIGHLIGHT_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("消耗红包", COLOR_TITLE), contentList));
            }
            if (moneyPay) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO("¥"+dto.getMoney().setScale(2).toString(), COLOR_HIGHLIGHT_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("消耗现金", COLOR_TITLE), contentList));
            }
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO("人工审核["+ TimeUtil.getGernalTime(dto.getTime().getTime(),"yyyy.MM.dd HH:mm")+"]", 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/img/tlj/icon_tlj.png", "红包消息",
                    msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackUseFail) { // 红包使用失败
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgRedPackUseContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackUseContentDTO.class);
            if (dto == null)
                return null;
            String useType = "";
            boolean moneyPay = dto.getMoney() != null && dto.getMoney().compareTo(new BigDecimal(0)) > 0;
            boolean hongBaoPay = dto.getHongBao() != null && dto.getHongBao().compareTo(new BigDecimal(0)) > 0;
            if (moneyPay && hongBaoPay) {
                useType = "红包+现金";
            } else if (hongBaoPay)
                useType = "仅红包";
            else if (moneyPay)
                useType = "仅现金";
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO("红包使用失败", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("状态", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getGoodsSetName() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("兑换商品", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(useType, COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("兑换方式", COLOR_TITLE), contentList));
            if (hongBaoPay) {
                contentList = new ArrayList<>();
                contentList
                        .add(new ClientTextStyleVO("¥"+dto.getHongBao().setScale(2).toString(), COLOR_HIGHLIGHT_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("消耗红包", COLOR_TITLE), contentList));
            }
            if (moneyPay) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO("¥"+dto.getMoney().setScale(2).toString()+"[已原路退回]", COLOR_HIGHLIGHT_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));
            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/img/tlj/icon_tlj.png", "红包消息",
                    msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
        }
        return null;
    }