|
|
@@ -1,13 +1,19 @@
|
|
|
package com.goafanti.customer.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.goafanti.common.dao.UserArchivesMapper;
|
|
|
import com.goafanti.common.utils.HttpUtils;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
+import com.goafanti.core.shiro.token.TokenManager;
|
|
|
+import com.goafanti.core.websocket.SystemWebSocketHandler;
|
|
|
import com.goafanti.customer.bo.InputCallNumber;
|
|
|
import com.goafanti.customer.service.UserOutboundService;
|
|
|
import org.apache.shiro.crypto.hash.SimpleHash;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.socket.TextMessage;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -19,6 +25,9 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<UserArchivesMapper>
|
|
|
static final String version= "2.0.6";
|
|
|
static final String default_url ="https://webmc.zb-sx.cn:1443";
|
|
|
|
|
|
+ @Resource
|
|
|
+ private SystemWebSocketHandler systemWebSocketHandler;
|
|
|
+
|
|
|
@Override
|
|
|
public Object checkUser(Integer type) {
|
|
|
String url= default_url +"/openapi/"+version+"/getClientInfo";
|
|
|
@@ -61,6 +70,31 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<UserArchivesMapper>
|
|
|
System.out.println("url="+url);
|
|
|
System.out.println("param="+param);
|
|
|
System.out.println(s);
|
|
|
- return null;
|
|
|
+// {"result":{"error":"0xF1000022","msg":"分机号未注册"},"data":{"seq":"20241101","response":{"seq":null,"userData":null,"result":{"error":4043309090},"data":null}}}
|
|
|
+ JSONObject jsonObject = JSON.parseObject(s);
|
|
|
+ JSONObject result = jsonObject.getJSONObject("result");
|
|
|
+ String msg = result.getString("msg");
|
|
|
+ if (msg!=null)return s;
|
|
|
+ return s;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Object blindTransferByAgent(InputCallNumber in) {
|
|
|
+ String url= default_url +"/openapi/"+version+"/blindTransferByAgent";
|
|
|
+ Map<String,Object> param=new HashMap<>();
|
|
|
+ param.put("authentication",getAuthentication());
|
|
|
+ Map<String,Object> request=new HashMap<>();
|
|
|
+ request.put("agent",in.getAgent());
|
|
|
+ request.put("transAgent",in.getTransAgent());
|
|
|
+ param.put("request",request);
|
|
|
+ HttpUtils httpUtils=new HttpUtils();
|
|
|
+ String s = httpUtils.sendHttpsRequest(url, "POST", param);
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Object callCompleted(InputCallNumber in) {
|
|
|
+ systemWebSocketHandler.sendMessageToUser(TokenManager.getAdminId(), new TextMessage("callCompleted"));
|
|
|
+ return 1;
|
|
|
}
|
|
|
}
|