| | |
| | | import com.yeshi.fanli.dto.msg.MsgRedPackGiveContentDTO; |
| | | import com.yeshi.fanli.dto.msg.MsgRedPackTeamRewardContentDTO; |
| | | import com.yeshi.fanli.dto.msg.MsgRedPackUseContentDTO; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.*; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail.MsgTypeInviteTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount; |
| | | import com.yeshi.fanli.entity.bus.user.Extract; |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2; |
| | | import com.yeshi.fanli.entity.common.JumpDetailV2; |
| | | import com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | |
| | | // 新版消息 |
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) { |
| | | Gson gson = new Gson(); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType())); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() { |
| | | }.getType())); |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | |
| | | // 新版消息 |
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) { |
| | | Gson gson = new Gson(); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType())); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() { |
| | | }.getType())); |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | |
| | | // 新版消息 |
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) { |
| | | Gson gson = new Gson(); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType())); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() { |
| | | }.getType())); |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | contentList.add(new ClientTextStyleVO(msg.getTitle() + "", COLOR_CONTENT)); |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("事项", COLOR_TITLE), contentList)); |
| | | |
| | |
| | | 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())); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() { |
| | | }.getType())); |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | |
| | | // 新版消息 |
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) { |
| | | Gson gson = new Gson(); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType())); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() { |
| | | }.getType())); |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | |
| | | return null; |
| | | |
| | | Gson gson = new Gson(); |
| | | items.addAll(gson.fromJson(msg.getContent(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType())); |
| | | items.addAll(gson.fromJson(msg.getContent(), new TypeToken<ArrayList<CommonMsgItemVO>>() { |
| | | }.getType())); |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | |
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 礼金消息 |
| | | * |
| | | * @param msg |
| | | * @return |
| | | */ |
| | | public static UserMsgVO create(MsgLijinVIPDetail 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.setId(msg.getId()); |
| | | 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; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | //TODO 系统消息 |
| | | public static UserMsgVO create(UserSystemMsg msg) { |
| | | List<CommonMsgItemVO> items = new ArrayList<>(); |
| | | |
| | | List<ClientTextStyleVO> contentList = null; |
| | | |
| | | contentList = new ArrayList<>(); |
| | | 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)); |
| | | |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | | userMsgVO.setIcon(""); |
| | | userMsgVO.setTitle(msg.getType().getDesc()); |
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime()); |
| | | userMsgVO.setContentItems(items); |
| | | return userMsgVO; |
| | | } |
| | | } |