admin
2019-09-06 2012b3b5db3c6b06535a68f775bcc81b16151b90
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -6,9 +6,11 @@
import java.util.List;
import com.google.gson.Gson;
import com.yeshi.fanli.dto.msg.MsgOtherCouponActivateDTO;
import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherExchangeContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherRewardIntegralDTO;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum;
@@ -626,7 +628,15 @@
         if (dto.getLeftDay() != null) {
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getLeftDay() + "", COLOR_HIGHLIGHT_CONTENT));
            contentList.add(new ClientTextStyleVO("天", COLOR_CONTENT));
            if (msg.getType() == MsgTypeOtherTypeEnum.couponReward) {
               contentList.add(new ClientTextStyleVO("天(未使用将会过期)", COLOR_CONTENT));
            } else if (msg.getType() == MsgTypeOtherTypeEnum.couponMianDan) {
               contentList.add(new ClientTextStyleVO("天(未使用将会过期)", COLOR_CONTENT));
            } else {
               contentList.add(new ClientTextStyleVO("天", COLOR_CONTENT));
            }
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("剩余天数", COLOR_TITLE), contentList));
         }
@@ -758,9 +768,8 @@
         if (dto == null)
            return null;
         icon = "http://img.flqapp.com/resource/msg/icon_msg_other_tlj.png";
         icon = "http://img.flqapp.com/resource/msg/icon_msg_other_integral.png";
         
         List<ClientTextStyleVO> contentList = new ArrayList<>();
         contentList.add(new ClientTextStyleVO(dto.getState(), COLOR_CONTENT));
         items.add(new CommonMsgItemVO(new ClientTextStyleVO("状态", COLOR_TITLE), contentList));
@@ -774,7 +783,7 @@
         if (!StringUtil.isNullOrEmpty(dto.getTotalGold())) {
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getTotalGold() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("金币总数", COLOR_TITLE), contentList));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("剩余", COLOR_TITLE), contentList));
         }
         if (!StringUtil.isNullOrEmpty(dto.getThing())) {
@@ -787,8 +796,105 @@
         contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
               COLOR_CONTENT));
         items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
      } else if (msg.getType() == MsgTypeOtherTypeEnum.couponActivate) {
         if (StringUtil.isNullOrEmpty(msg.getContent()))
            return null;
         MsgOtherCouponActivateDTO dto = new Gson().fromJson(msg.getContent(), MsgOtherCouponActivateDTO.class);
         if (dto == null)
            return null;
         icon = "http://img.flqapp.com/resource/msg/icon_msg_other_coupon.png";
         List<ClientTextStyleVO> contentList = new ArrayList<>();
         contentList.add(new ClientTextStyleVO(dto.getType(), COLOR_CONTENT));
         items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
         if (!StringUtil.isNullOrEmpty(dto.getExplain())) {
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getExplain() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("说明", COLOR_TITLE), contentList));
         }
         if (!StringUtil.isNullOrEmpty(dto.getGiveUser())) {
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getGiveUser() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠送人", COLOR_TITLE), contentList));
         }
         if (!StringUtil.isNullOrEmpty(dto.getReceiveTime())) {
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getReceiveTime() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("获赠时间", COLOR_TITLE), contentList));
         }
         if (!StringUtil.isNullOrEmpty(dto.getValidityTime())) {
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getValidityTime() + "", 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));
         UserMsgVO userMsgVO = new UserMsgVO();
         userMsgVO.setIcon(icon);
         userMsgVO.setTitle(dto.getTitle());
         userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
         userMsgVO.setContentItems(items);
         return userMsgVO;
      } else if (msg.getType() == MsgTypeOtherTypeEnum.firstOrderReward) {
         if (StringUtil.isNullOrEmpty(msg.getContent()))
            return null;
         MsgOtherRewardIntegralDTO dto = new Gson().fromJson(msg.getContent(), MsgOtherRewardIntegralDTO.class);
         if (dto == null)
            return null;
         icon = "http://img.flqapp.com/resource/msg/icon_msg_other_integral.png";
         List<ClientTextStyleVO> contentList = new ArrayList<>();
         if (!StringUtil.isNullOrEmpty(dto.getSource())) {
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getSource() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("来源", COLOR_TITLE), contentList));
         }
         if (!StringUtil.isNullOrEmpty(dto.getNum())) {
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getNum() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("数量", COLOR_TITLE), contentList));
         }
         if (!StringUtil.isNullOrEmpty(dto.getTotal())) {
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getTotal() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("剩余", COLOR_TITLE), contentList));
         }
         if (!StringUtil.isNullOrEmpty(dto.getExplain())) {
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getExplain() + "", 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));
         UserMsgVO userMsgVO = new UserMsgVO();
         userMsgVO.setIcon(icon);
         userMsgVO.setTitle(dto.getTitle());
         userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
         userMsgVO.setContentItems(items);
         return userMsgVO;
      }
      return new UserMsgVO(icon, msg.getType().getDesc(),
            msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
   }