|
|
@@ -44,7 +44,9 @@ public class MessageUtils {
|
|
|
params.put("receiverUu", SystemSession.getUser().getUserUU());
|
|
|
params.put("receiverEnuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
params.put("consumerApp", "B2B");
|
|
|
- params.put("pageParams", pageParams);
|
|
|
+// params.put("pageParams", FlexJsonUtils.toJsonDeep(pageParams));
|
|
|
+ params.put("page", pageParams.getPage());
|
|
|
+ params.put("count", pageParams.getCount());
|
|
|
params.put("isRead", isRead);
|
|
|
if (null != keyword && !"".equals(keyword)) {
|
|
|
params.put("keyword", keyword);
|
|
|
@@ -71,7 +73,6 @@ public class MessageUtils {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public static ModelMap setRead(Long id) throws Exception {
|
|
|
- ModelMap map = new ModelMap();
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
params.put("receiverUu", SystemSession.getUser().getUserUU());
|
|
|
params.put("receiverEnuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
@@ -79,8 +80,9 @@ public class MessageUtils {
|
|
|
params.put("consumerApp", "B2B");
|
|
|
String res = HttpUtil.doPost(MESSAGE_PUBLIC_SERVICE_URL + "/messages/read", FlexJsonUtils.toJsonDeep(params));
|
|
|
if (null != res) {
|
|
|
- map.put("success", "成功设为已读");
|
|
|
- return map;
|
|
|
+ JSONObject response = JSON.parseObject(res);
|
|
|
+ String status = (String) response.get("success");
|
|
|
+ return status.equals("true") ? new ModelMap("success", "成功设为已读") : new ModelMap("error", "设置已读失败");
|
|
|
} else {
|
|
|
throw new RuntimeException("设置已读失败");
|
|
|
}
|
|
|
@@ -105,8 +107,10 @@ public class MessageUtils {
|
|
|
params.put("consumerApp", "B2B");
|
|
|
String res = HttpUtil.doPost(MESSAGE_PUBLIC_SERVICE_URL + "/messages/read", FlexJsonUtils.toJsonDeep(params));
|
|
|
if (null != res) {
|
|
|
- map.put("success", "批量设置已读成功");
|
|
|
- return map;
|
|
|
+ JSONObject response = JSON.parseObject(res);
|
|
|
+ String status = (String) response.get("success");
|
|
|
+ return status.equals("true") ? new ModelMap("success", "成功设为已读") : new ModelMap("error", "设置已读失败");
|
|
|
+
|
|
|
} else {
|
|
|
throw new RuntimeException("批量设置已读失败");
|
|
|
}
|
|
|
@@ -123,8 +127,8 @@ public class MessageUtils {
|
|
|
*/
|
|
|
public static Integer getMessageNotReadNum(Long enUU, Long userUU) throws Exception {
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
- params.put("receiverUu", enUU);
|
|
|
- params.put("receiverEnuu", userUU);
|
|
|
+ params.put("receiverUu", userUU);
|
|
|
+ params.put("receiverEnuu", enUU);
|
|
|
params.put("consumerApp", "B2B");
|
|
|
HttpUtil.Response res = HttpUtil.sendGetRequest(MESSAGE_PUBLIC_SERVICE_URL + "/messages/count/unread", params);
|
|
|
if (res.getStatusCode() == HttpStatus.OK.value() && null != res.getResponseText()) {
|