yujian
2020-04-02 0ec22dcf4fd9c4496e6f681e7fab89f56c6e4e8a
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -6,6 +6,8 @@
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.dto.msg.MsgAccountVipDTO;
import com.yeshi.fanli.dto.msg.MsgInviteContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherCouponActivateDTO;
import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
@@ -585,6 +587,30 @@
         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.orderTeamReward) { // 团队奖励
         contentList = new ArrayList<>();
         contentList.add(new ClientTextStyleVO(msg.getStateDesc(), COLOR_CONTENT));
         items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
         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_team_reward.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;
@@ -983,6 +1009,63 @@
   public static UserMsgVO create(MsgAccountDetail msg) {
      List<CommonMsgItemVO> items = new ArrayList<>();
      List<ClientTextStyleVO> contentList = new ArrayList<>();
      if (msg.getType() == MsgTypeAccountTypeEnum.vipPgrade) {// 等级升级
         contentList.add(new ClientTextStyleVO(msg.getTitle() + "", COLOR_CONTENT));
         items.add(new CommonMsgItemVO(new ClientTextStyleVO("详        情", COLOR_TITLE), contentList));
         MsgAccountVipDTO dto = new Gson().fromJson(msg.getContent(), MsgAccountVipDTO.class);
         if (dto != null) {
            if (!StringUtil.isNullOrEmpty(dto.getStatus())) {
               contentList = new ArrayList<>();
               contentList.add(new ClientTextStyleVO(dto.getStatus() + "", COLOR_CONTENT));
               items.add(new CommonMsgItemVO(new ClientTextStyleVO("状        态", COLOR_TITLE), contentList));
            }
            if (!StringUtil.isNullOrEmpty(dto.getEquity())) {
               contentList = new ArrayList<>();
               contentList.add(new ClientTextStyleVO(dto.getEquity() + "", COLOR_CONTENT));
               items.add(new CommonMsgItemVO(new ClientTextStyleVO("权        益", COLOR_TITLE), contentList));
            }
            if (!StringUtil.isNullOrEmpty(dto.getReason())) {
               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/resource/msg/icon_msg_account.png", msg.getType().getDesc(),
               msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
      }
      if (msg.getType() == MsgTypeAccountTypeEnum.vipApply) {// vip升级申请
         contentList.add(new ClientTextStyleVO(msg.getTitle() + "", COLOR_CONTENT));
         items.add(new CommonMsgItemVO(new ClientTextStyleVO("申请进度", COLOR_TITLE), contentList));
         contentList = new ArrayList<>();
         contentList.add(new ClientTextStyleVO(msg.getContent() + "", 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_msg_account.png", msg.getType().getDesc(),
               msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
      }
      contentList.add(new ClientTextStyleVO(msg.getTitle() + "", COLOR_CONTENT));
      items.add(new CommonMsgItemVO(new ClientTextStyleVO("事项", COLOR_TITLE), contentList));
@@ -1093,7 +1176,7 @@
         items.add(new CommonMsgItemVO(new ClientTextStyleVO("被邀请人", COLOR_TITLE), contentList));
         contentList = new ArrayList<>();
         contentList.add(new ClientTextStyleVO("邀请队员成功", COLOR_CONTENT));
         contentList.add(new ClientTextStyleVO("邀请粉丝成功", COLOR_CONTENT));
         items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请状态", COLOR_TITLE), contentList));
         contentList = new ArrayList<>();
@@ -1664,6 +1747,19 @@
         userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
         userMsgVO.setContentItems(items);
         return userMsgVO;
      } else if (msg.getType() == MsgTypeOtherTypeEnum.vipUpgradeReward) {
         if (StringUtil.isNullOrEmpty(msg.getContent()))
            return null;
         Gson gson = new Gson();
         items.addAll(gson.fromJson(msg.getContent(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
         UserMsgVO userMsgVO = new UserMsgVO();
         userMsgVO.setIcon(msg.getType().getIcon());
         userMsgVO.setTitle(msg.getType().getDesc());
         userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
         userMsgVO.setContentItems(items);
         return userMsgVO;
      }
      return new UserMsgVO(icon, msg.getType().getDesc(),