Browse Source

客户入群修改成客户订单入群

anderx 1 year ago
parent
commit
9f2406e08a

+ 24 - 0
src/main/java/com/goafanti/customer/bo/InputCallNumber.java

@@ -0,0 +1,24 @@
+package com.goafanti.customer.bo;
+
+public class InputCallNumber {
+
+    private String agent;
+    private String callee;
+
+
+    public String getAgent() {
+        return agent;
+    }
+
+    public void setAgent(String agent) {
+        this.agent = agent;
+    }
+
+    public String getCallee() {
+        return callee;
+    }
+
+    public void setCallee(String callee) {
+        this.callee = callee;
+    }
+}

+ 19 - 0
src/main/java/com/goafanti/customer/controller/UserOutboundApiController.java

@@ -1,7 +1,9 @@
 package com.goafanti.customer.controller;
 
+import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.customer.bo.InputCallNumber;
 import com.goafanti.customer.service.UserOutboundService;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -24,4 +26,21 @@ public class UserOutboundApiController  extends BaseApiController {
     public Result checkUser(Integer type) {
         return new Result<>().data(this.userOutboundService.checkUser(type));
     }
+
+
+    /**
+     * 坐席点击呼叫
+     *
+     */
+    @PostMapping("/callNumber")
+    public Result callNumber(InputCallNumber in) {
+        Result res =new Result();
+        if (in.getAgent()==null){
+            return res.error(new Error("坐席号不能为空"));
+        }
+        if (in.getCallee()==null){
+            return res.error(new Error("客户号不能为空"));
+        }
+        return new Result<>().data(this.userOutboundService.callNumber(in));
+    }
 }

+ 4 - 0
src/main/java/com/goafanti/customer/service/UserOutboundService.java

@@ -1,5 +1,9 @@
 package com.goafanti.customer.service;
 
+import com.goafanti.customer.bo.InputCallNumber;
+
 public interface UserOutboundService {
     Object checkUser(Integer type);
+
+    Object callNumber(InputCallNumber in);
 }

+ 24 - 2
src/main/java/com/goafanti/customer/service/impl/UserOutboundServiceImpl.java

@@ -3,6 +3,7 @@ package com.goafanti.customer.service.impl;
 import com.goafanti.common.dao.UserArchivesMapper;
 import com.goafanti.common.utils.HttpUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.customer.bo.InputCallNumber;
 import com.goafanti.customer.service.UserOutboundService;
 import org.apache.shiro.crypto.hash.SimpleHash;
 import org.springframework.stereotype.Service;
@@ -22,6 +23,17 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<UserArchivesMapper>
     public Object checkUser(Integer type) {
         String url= default_url +"/openapi/"+version+"/getClientInfo";
         Map<String,Object> param=new HashMap<>();
+        param.put("authentication",getAuthentication());
+        Map<String,Object> request=new HashMap<>();
+        request.put("type",type);
+        param.put("request",request);
+        HttpUtils httpUtils=new HttpUtils();
+        String s = httpUtils.sendHttpsRequest(url, "POST", param);
+        System.out.println(s);
+        return null;
+    }
+
+    private Map<String, Object> getAuthentication() {
         Map<String,Object> authentication=new HashMap<>();
         authentication.put("customer","C322");
         long timeMillis = System.currentTimeMillis();
@@ -32,12 +44,22 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<UserArchivesMapper>
         String md5 = new SimpleHash("MD5", digestSource).toHex();
 //        System.out.println("md5="+md5);
         authentication.put("digest",md5);
-        param.put("authentication",authentication);
+        return authentication;
+    }
+
+    @Override
+    public Object callNumber(InputCallNumber in) {
+        String url= default_url +"/openapi/"+version+"/callNumber";
+        Map<String,Object> param=new HashMap<>();
+        param.put("authentication",getAuthentication());
         Map<String,Object> request=new HashMap<>();
-        request.put("type",type);
+        request.put("agent",in.getAgent());
+        request.put("callee",in.getCallee());
         param.put("request",request);
         HttpUtils httpUtils=new HttpUtils();
         String s = httpUtils.sendHttpsRequest(url, "POST", param);
+        System.out.println("url="+url);
+        System.out.println("param="+param);
         System.out.println(s);
         return null;
     }