提交 9b05216b 编写于 作者: Crimson's avatar Crimson

usr代码添加回调rest信息

上级 c293d0c8
...@@ -114,35 +114,32 @@ public class IMService { ...@@ -114,35 +114,32 @@ public class IMService {
} }
public IM hD(String im_id, IM im) { public IM hD(String im_id, IM im) {
im = this.client.get(im_id); // PS
if ("30".equals(im.getImwfstate())) { PS ps = new PS();
// PS ps.setPSId(im.getIMId());
PS ps = new PS(); ps = psService.get(ps.getPSId());
ps.setPSId(im.getIMId()); if (ps != null) {
ps = psService.get(ps.getPSId()); ps.setImstate("30");
if (ps != null) {
ps.setImstate("30");
// psService.update(ps.getPSId(), ps); // psService.update(ps.getPSId(), ps);
} }
if (im.getRest() != null) { if (im.getRest() != null) {
JSONArray callbackdata = JSONObject.parseArray(im.getRest()); JSONArray callbackdata = JSONObject.parseArray(im.getRest());
if (callbackdata.size() > 0) { if (callbackdata.size() > 0) {
for (int i =0; i < callbackdata.size(); i++) { for (int i =0; i < callbackdata.size(); i++) {
JSONObject jo = callbackdata.getJSONObject(i); JSONObject jo = callbackdata.getJSONObject(i);
HttpMethod httpMethod = HttpMethod.valueOf(jo.getString("method")); HttpMethod httpMethod = HttpMethod.valueOf(jo.getString("method"));
String url = jo.getString("url"); String url = jo.getString("url");
JSONObject params = null; JSONObject params = null;
if (jo.getBoolean("containspk")) { if (jo.getBoolean("containspk")) {
String replaceStr = url.substring(url.indexOf("{"), url.indexOf("}") + 1); String replaceStr = url.substring(url.indexOf("{"), url.indexOf("}") + 1);
replaceStr = "\\" + replaceStr; replaceStr = "\\" + replaceStr;
replaceStr = replaceStr.substring(0, replaceStr.length() - 1) + "\\}"; replaceStr = replaceStr.substring(0, replaceStr.length() - 1) + "\\}";
url = url.replaceAll(replaceStr, im.getIMId()); url = url.replaceAll(replaceStr, im.getIMId());
} }
if (jo.getBoolean("containset")) { if (jo.getBoolean("containset")) {
params = (JSONObject) JSONObject.toJSON(ps); params = (JSONObject) JSONObject.toJSON(ps);
}
doRestRequest(url, httpMethod, getHeader(), params);
} }
doRestRequest(url, httpMethod, getHeader(), params);
} }
} }
} }
...@@ -266,6 +263,10 @@ public class IMService { ...@@ -266,6 +263,10 @@ public class IMService {
// 保存业务数据 // 保存业务数据
this.update(im_id, im); this.update(im_id, im);
if ("finish".equals(type)) {
this.hD(im_id, im);
}
data.put("rst", "1"); data.put("rst", "1");
return data; return data;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册