From 34e65d72e73acab040b68d01ef6b4764b4408624 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 05 八月 2019 10:07:38 +0800 Subject: [PATCH] 修改推荐记录点击详情跳转方式不对的bug --- fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java | 84 +++++++++++++++++++++++++++++++++++++++--- 1 files changed, 78 insertions(+), 6 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java index 8cf4ffb..072f0d9 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java @@ -39,6 +39,7 @@ 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; @@ -77,6 +78,7 @@ 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; @@ -190,8 +192,15 @@ 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); @@ -293,6 +302,12 @@ 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)); @@ -598,7 +613,15 @@ 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; } @@ -681,11 +704,11 @@ 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)); } } @@ -719,7 +742,13 @@ 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); } @@ -811,6 +840,29 @@ "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)); @@ -959,4 +1011,24 @@ 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("")); + } + } -- Gitblit v1.8.0