| | |
| | | */
|
| | | @RequestMapping(value = "getMsgList", method = RequestMethod.POST)
|
| | | public void getMsgList(AcceptData acceptData, Long uid, int page, String type, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | |
| | | for (MsgOrderDetail detail : detailList) {
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("orderNo", detail.getOrderId());
|
| | | if (detail.getType() == MsgTypeOrderTypeEnum.share
|
| | | || detail.getType() == MsgTypeOrderTypeEnum.invite)
|
| | | if (detail.getType() == MsgTypeOrderTypeEnum.invite || detail.getType() == MsgTypeOrderTypeEnum.orderInvite)
|
| | | params.put("orderHideNo", UserUtil.filterOrderId(detail.getOrderId()));
|
| | | list.add(UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("order_search"),
|
| | | params));
|
| | | |
| | | UserMsgVO msgVO = UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("order_search"), params);
|
| | | msgVO.setType(MSG_TYPE_ORDER);
|
| | | list.add(msgVO);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_MONEY:
|
| | |
| | | List<MsgMoneyDetail> detailList1 = msgMoneyDetailService.listMsgMoneyDetail(uid, page);
|
| | | count = msgMoneyDetailService.countMsgMoneyDetail(uid);
|
| | | if (detailList1 != null)
|
| | | for (MsgMoneyDetail detail : detailList1)
|
| | | list.add(UserMsgVOFactory.create(detail));
|
| | | for (MsgMoneyDetail detail : detailList1) {
|
| | | UserMsgVO msgVO = UserMsgVOFactory.create(detail);
|
| | | msgVO.setType(MSG_TYPE_MONEY);
|
| | | list.add(msgVO);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_ACCOUNT:
|
| | | userMsgReadStateService.readAccountMsg(uid);
|
| | | List<MsgAccountDetail> detailList2 = msgAccountDetailService.listMsgAccountDetail(uid, page);
|
| | | count = msgAccountDetailService.countMsgAccountDetail(uid);
|
| | | if (detailList2 != null)
|
| | | for (MsgAccountDetail detail : detailList2)
|
| | | list.add(UserMsgVOFactory.create(detail));
|
| | | for (MsgAccountDetail detail : detailList2) {
|
| | | UserMsgVO msgVO = UserMsgVOFactory.create(detail);
|
| | | msgVO.setType(MSG_TYPE_ACCOUNT);
|
| | | list.add(msgVO);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_INVITE:
|
| | | userMsgReadStateService.readInviteMsg(uid);
|
| | |
| | | if (detailList3 != null)
|
| | | for (MsgInviteDetail detail : detailList3) {
|
| | | UserMsgVO vo = UserMsgVOFactory.create(detail);
|
| | | if (vo != null)
|
| | | if (vo != null) {
|
| | | vo.setType(MSG_TYPE_INVITE);
|
| | | list.add(vo);
|
| | | else
|
| | | } else {
|
| | | count--;
|
| | | }
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_OTHER:
|
| | |
| | | if (detailList4 != null)
|
| | | for (MsgOtherDetail detail : detailList4) {
|
| | | UserMsgVO vo = UserMsgVOFactory.create(detail);
|
| | | if (vo != null)
|
| | | if (vo != null) {
|
| | | vo.setType(MSG_TYPE_OTHER);
|
| | | list.add(vo);
|
| | | else
|
| | | } else {
|
| | | count--;
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | private void addRecommendGoods(Long uid, String device, String imei, String idfa) {
|
| | | TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(1, 50, imei, idfa);
|
| | | TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(1, 50, imei, idfa,"");
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) {
|
| | | for (int i = 0; i < result.getTaoBaoGoodsBriefs().size(); i++) {
|
| | | if (result.getTaoBaoGoodsBriefs().get(i).getCouponAmount() == null
|
| | |
| | | for (MsgOrderDetail detail : detailList) {
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("orderNo", detail.getOrderId());
|
| | | if (detail.getType() == MsgTypeOrderTypeEnum.share
|
| | | || detail.getType() == MsgTypeOrderTypeEnum.invite)
|
| | | if (detail.getType() == MsgTypeOrderTypeEnum.invite || detail.getType() == MsgTypeOrderTypeEnum.orderInvite)
|
| | | params.put("orderHideNo", UserUtil.filterOrderId(detail.getOrderId()));
|
| | | UserMsgVO userMsgVO = UserMsgVOFactory.create(detail,
|
| | | jumpDetailV2Service.getByTypeCache("order_search"), params);
|
| | |
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 删除消息
|
| | | * @param acceptData
|
| | | * @param type
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "deleteMsg", method = RequestMethod.POST)
|
| | | public void deleteMsg(AcceptData acceptData, String type, Long id, Long uid, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(type) || id == null || uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("参数不完整"));
|
| | | return;
|
| | | }
|
| | | |
| | | switch (type) {
|
| | | case MSG_TYPE_ORDER:
|
| | | MsgOrderDetail msgOrderDetail = msgOrderDetailService.selectByPrimaryKey(id);
|
| | | if (msgOrderDetail != null && msgOrderDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgOrderDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_MONEY:
|
| | | MsgMoneyDetail moneyDetail = msgMoneyDetailService.selectByPrimaryKey(id);
|
| | | if (moneyDetail != null && moneyDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgMoneyDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_ACCOUNT:
|
| | | MsgAccountDetail accountDetail = msgAccountDetailService.selectByPrimaryKey(id);
|
| | | if (accountDetail != null && accountDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgAccountDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_INVITE:
|
| | | MsgInviteDetail inviteDetail = msgInviteDetailService.selectByPrimaryKey(id);
|
| | | if (inviteDetail != null && inviteDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgInviteDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_OTHER:
|
| | | MsgOtherDetail otherDetail = msgOtherDetailService.selectByPrimaryKey(id);
|
| | | if (otherDetail != null && otherDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgOtherDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | | |
| | | }
|