| | |
| | | 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;
|
| | |
| | | * @return
|
| | | */
|
| | | public static UserMsgVO create(MsgOrderDetail msg, JumpDetailV2 jumpDetail, JSONObject params) {
|
| | | List<CommonMsgItemVO> items = new ArrayList<>();
|
| | | |
| | | // 新版消息
|
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) {
|
| | | Gson gson = new Gson();
|
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), 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);
|
| | | |
| | | userMsgVO.setJumpDetail(jumpDetail);
|
| | | if (params != null)
|
| | | userMsgVO.setParams(params.toString());
|
| | | |
| | | return userMsgVO;
|
| | | }
|
| | | |
| | | |
| | | UserMsgVO vo = new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_order.png", "订单消息",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), null);
|
| | |
|
| | | List<CommonMsgItemVO> items = new ArrayList<>();
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | if (msg.getType() == MsgTypeOrderTypeEnum.found) {
|
| | | contentList = new ArrayList<>();
|
| | |
| | |
|
| | | String orderId = msg.getOrderId();
|
| | | MsgTypeOrderTypeEnum type = msg.getType();
|
| | | if (type == MsgTypeOrderTypeEnum.invite || type == MsgTypeOrderTypeEnum.share) {
|
| | | if (type == MsgTypeOrderTypeEnum.invite) {
|
| | | orderId = UserUtil.filterOrderId(orderId);
|
| | | }
|
| | | contentList = new ArrayList<>();
|
| | |
| | |
|
| | | String orderId = msg.getOrderId();
|
| | | MsgTypeOrderTypeEnum type = msg.getType();
|
| | | if (type == MsgTypeOrderTypeEnum.invite || type == MsgTypeOrderTypeEnum.share) {
|
| | | if (type == MsgTypeOrderTypeEnum.invite) {
|
| | | orderId = UserUtil.filterOrderId(orderId);
|
| | | }
|
| | | contentList = new ArrayList<>();
|
| | |
| | | * @return
|
| | | */
|
| | | public static UserMsgVO create(MsgMoneyDetail msg) {
|
| | |
|
| | | List<CommonMsgItemVO> items = new ArrayList<>();
|
| | | // 新版消息
|
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) {
|
| | | Gson gson = new Gson();
|
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setIcon(msg.getMsgType().getIcon());
|
| | | userMsgVO.setTitle(msg.getMsgType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | | userMsgVO.setContentItems(items);
|
| | | return userMsgVO;
|
| | | }
|
| | | |
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | |
|
| | | // 提现
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("渠道来源", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | |
|
| | | contentList.add(new ClientTextStyleVO(msg.getOrderId(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("返利订单", COLOR_TITLE), contentList));
|
| | |
|
| | |
| | | contentList = new ArrayList<>();
|
| | |
|
| | | contentList.add(new ClientTextStyleVO(msg.getOrderId(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请订单", COLOR_TITLE), contentList));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("分享订单", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("订单售后", COLOR_CONTENT));
|
| | |
| | | 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(),
|
| | | 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()))
|
| | |
| | | */
|
| | | public static UserMsgVO create(MsgAccountDetail msg) {
|
| | | List<CommonMsgItemVO> items = new ArrayList<>();
|
| | | // 新版消息
|
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) {
|
| | | Gson gson = new Gson();
|
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), 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;
|
| | | }
|
| | | |
| | | 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));
|
| | |
| | | */
|
| | | public static UserMsgVO create(MsgInviteDetail msg) {
|
| | | MsgTypeInviteTypeEnum msgType = msg.getMsgType();
|
| | | |
| | | // 新版消息
|
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) {
|
| | | Gson gson = new Gson();
|
| | | List<CommonMsgItemVO> items = new ArrayList<>();
|
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setIcon(msg.getMsgType().getIcon());
|
| | | userMsgVO.setTitle(msg.getMsgType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | | userMsgVO.setContentItems(items);
|
| | | return userMsgVO;
|
| | | }
|
| | | |
| | | |
| | | if (msgType != null && msgType == MsgTypeInviteTypeEnum.receiveGift) {
|
| | | if (StringUtil.isNullOrEmpty(msg.getDesc()))
|
| | | return null;
|
| | |
| | | */
|
| | | public static UserMsgVO create(MsgOtherDetail msg) {
|
| | | List<CommonMsgItemVO> items = new ArrayList<>();
|
| | | // 新版消息
|
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) {
|
| | | Gson gson = new Gson();
|
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), 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;
|
| | | }
|
| | | |
| | | String icon = null;
|
| | |
|
| | | if (msg.getType() == MsgTypeOtherTypeEnum.couponMianDan
|
| | | || msg.getType() == MsgTypeOtherTypeEnum.couponWelfareMianDan
|
| | | || msg.getType() == MsgTypeOtherTypeEnum.couponReward) {
|
| | | || msg.getType() == MsgTypeOtherTypeEnum.couponReward
|
| | | || msg.getType() == MsgTypeOtherTypeEnum.freeCouponBuy
|
| | | || msg.getType() == MsgTypeOtherTypeEnum.freeCouponGive) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | | return null;
|
| | |
| | | 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(),
|