From 5aa6ce8d790264d199a78560100a4dda438b6c79 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 08 八月 2019 17:07:12 +0800
Subject: [PATCH] 拼多多转链bug修改
---
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 51 insertions(+), 7 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 ddfb5db..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));
@@ -604,8 +619,8 @@
} else
vo.setRead(true);
-
- if(StringUtil.isNullOrEmpty(vo.getLatestMsg()))
+
+ if (StringUtil.isNullOrEmpty(vo.getLatestMsg()))
vo.setLatestMsg("[鐐瑰嚮鎵撳紑浜哄伐瀹㈡湇]");
return vo;
@@ -689,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));
}
}
@@ -727,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);
}
@@ -821,6 +842,29 @@
}
}
+ /**
+ * 鎻愰啋澶у浘
+ */
+ 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));
root.put("commonList", builder.create().toJson(commonMsgList));
root.put("count", listCenter.size());
--
Gitblit v1.8.0