| | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
|
| | | 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.UserMsgUnReadNum;
|
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsg;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.factory.CommonGoodsFactory;
|
| | | import com.yeshi.fanli.util.factory.msg.UserMsgVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
| | | List<MsgOrderDetail> detailList = msgOrderDetailService.listMsgOrderDetail(uid, page);
|
| | | count = msgOrderDetailService.countMsgOrderDetail(uid);
|
| | | if (detailList != null)
|
| | | for (MsgOrderDetail detail : detailList)
|
| | | list.add(UserMsgVOFactory.create(detail));
|
| | | for (MsgOrderDetail detail : detailList) {
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("orderNo", detail.getOrderId());
|
| | | if (detail.getType() == MsgTypeOrderTypeEnum.share
|
| | | || detail.getType() == MsgTypeOrderTypeEnum.invite)
|
| | | params.put("orderHideNo", UserUtil.filterOrderId(detail.getOrderId()));
|
| | | list.add(UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("order_search"),
|
| | | params));
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_MONEY:
|
| | | userMsgReadStateService.readMoneyMsg(uid);
|
| | |
| | | data.put("totalCount", 0);
|
| | | }
|
| | | } catch (UserCustomSettingsException e) {
|
| | | }
|
| | |
|
| | | if (VersionUtil.greaterThan_1_5_50(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | int totalCount = msgDeviceReadStateService.getUnReadCount(acceptData.getDevice(),
|
| | | "android".equalsIgnoreCase(acceptData.getPlatform()) ? 1 : 2, MsgDeviceReadState.TYPE_KEFU);
|
| | | data.put("totalCount", totalCount);
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | vo.setRead(false);
|
| | | else
|
| | | vo.setRead(true);
|
| | |
|
| | | if (kefuState.getLatestContentTime() != null)
|
| | | vo.setTime(kefuState.getLatestContentTime());
|
| | |
|
| | | } else
|
| | | vo.setRead(true);
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(vo.getLatestMsg()))
|
| | | vo.setLatestMsg("[点击打开人工客服]");
|
| | |
|
| | | return vo;
|
| | | }
|
| | |
| | | acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2);
|
| | | boolean read = false;
|
| | | if (state != null && state.getReadTime() != null
|
| | | && list.get(0).getCreateTime().getTime() < state.getReadTime().getTime())
|
| | | && list.get(0).getPushTime().getTime() < state.getReadTime().getTime())
|
| | | read = true;
|
| | |
|
| | | commonMsgList.add(new UserCommonMsgVO("http://img.flqapp.com/resource/msg/icon_recommend.png", "推荐记录",
|
| | | list.get(0).getCreateTime(), UserCommonMsgVO.TYPE_RECOMMEND, list.get(0).getContent(), read,
|
| | | list.get(0).getPushTime(), UserCommonMsgVO.TYPE_RECOMMEND, list.get(0).getContent(), read,
|
| | | jumpDetailV2Service.getByTypeCache("recommend_list"), null, 0));
|
| | | }
|
| | | }
|
| | |
| | | List<MsgOrderDetail> detailList = msgOrderDetailService.listMsgOrderDetail(uid, page);
|
| | | if (detailList != null && detailList.size() > 0) {
|
| | | for (MsgOrderDetail detail : detailList) {
|
| | | UserMsgVO userMsgVO = UserMsgVOFactory.create(detail);
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("orderNo", detail.getOrderId());
|
| | | if (detail.getType() == MsgTypeOrderTypeEnum.share
|
| | | || detail.getType() == MsgTypeOrderTypeEnum.invite)
|
| | | params.put("orderHideNo", UserUtil.filterOrderId(detail.getOrderId()));
|
| | | UserMsgVO userMsgVO = UserMsgVOFactory.create(detail,
|
| | | jumpDetailV2Service.getByTypeCache("order_search"), params);
|
| | | userMsgVO.setType(MSG_TYPE_ORDER);
|
| | | list.add(userMsgVO);
|
| | | }
|
| | |
| | | "http://img.flqapp.com/resource/msg/icon_msg_system.png",
|
| | | getTimeDesc(new Date(), usm.getCreateTime()), num.getTypeSystem()));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 提醒大图
|
| | | */
|
| | | MsgCommonDTO notify = msgConfigService.getNotifyMsg();
|
| | |
|
| | | if (notify != null && notify.getShow() == true) {
|
| | | boolean read = false;
|
| | | MsgDeviceReadState state = msgDeviceReadStateService.getByDeviceAndPlatformAndType(
|
| | | UserCommonMsgVO.TYPE_NOTIFY, acceptData.getDevice(),
|
| | | acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2);
|
| | | if (state != null && state.getReadTime() != null
|
| | | && zhuShouMsg.getUpdateTime().getTime() < state.getReadTime().getTime())
|
| | | read = true;
|
| | | if (notify.getJumpDetail() == null)
|
| | | read = true;
|
| | | // 查询是否已读
|
| | | UserCommonMsgVO vo = new UserCommonMsgVO(notify.getIcon(), notify.getTitle(), notify.getUpdateTime(),
|
| | | UserCommonMsgVO.TYPE_NOTIFY, notify.getContent(), read, notify.getJumpDetail(), notify.getParams(),
|
| | | 0);
|
| | | vo.setPicture(notify.getPicture());
|
| | | root.put("notifyMsg", builder.create().toJson(vo));
|
| | | }
|
| | |
|
| | | root.put("list", builder.create().toJson(listCenter));
|
| | |
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 上传最近的客服消息
|
| | | * |
| | | * @param acceptData
|
| | | * @param content
|
| | | * @param time
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "uploadLatestKeFuMsg", method = RequestMethod.POST)
|
| | | public void uploadLatestKeFuMsg(AcceptData acceptData, String content, Long datetime, PrintWriter out) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(content) || datetime == null) {
|
| | | out.print(JsonUtil.loadFalseResult("参数不完整"));
|
| | | return;
|
| | | }
|
| | | msgDeviceReadStateService.addUnreadDeviceMsg(MsgDeviceReadState.TYPE_KEFU, acceptData.getDevice(),
|
| | | "android".equalsIgnoreCase(acceptData.getPlatform()) ? 1 : 2, 0, content, new Date(datetime));
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | }
|