Browse Source

外呼系统开发

anderx 1 year ago
parent
commit
3fd20f9a65

+ 2 - 0
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -276,6 +276,8 @@ public interface AdminMapper {
     void updateDepExpenseFinance(@Param("id") String id, @Param("expenseFinanceId") String expenseFinanceId);
 
     List<Admin> agentList();
+
+    Admin selectByCallStaffNo(String staffNo);
 }
 
 

+ 6 - 0
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -1301,5 +1301,11 @@
         from admin
         where status='0' and call_no>0
         </select>
+    <select id="selectByCallStaffNo" resultMap="AdminMap">
+        select
+        <include refid="AdminAllSql"/>
+        from admin
+        where  call_no = #{callStaffNo}
+    </select>
 </mapper>
 

+ 5 - 6
src/main/java/com/goafanti/customer/service/impl/UserOutboundServiceImpl.java

@@ -15,7 +15,6 @@ import com.goafanti.common.utils.HttpUtils;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.StringUtils;
 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;
@@ -145,9 +144,10 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<UserArchivesMapper>
         // keyPress=, taskID=0, taskName=, recordFile=/data/voicerecord/322/20241120/1863336-20241120-103953-13297312076-15574937814.mp3,
         // service=1, session=1732070377-5753-414072, seq=1085, userData=, result=801, releaseCause=1, timeLength=12, callResult=801,
         // typeResult=success, callResultMsg=呼叫成功客户挂断, releasePart=0}}
-        String adminId = TokenManager.getAdminId();
-        Admin admin = adminMapper.queryById(adminId);
+
         Map<String, Object> notify = in.getNotify();
+        String staffNo=String.valueOf(notify.get("staffNo"));
+        Admin admin = adminMapper.selectByCallStaffNo(staffNo);
         String  startTime = String.valueOf(notify.get("startTime"));
         String callee=String.valueOf(notify.get("callee"));
         String caller=String.valueOf(notify.get("caller"));
@@ -165,7 +165,7 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<UserArchivesMapper>
         }
         CallLog callLog=new CallLog();
         callLog.setUid(uid);
-        callLog.setAid(adminId);
+        callLog.setAid(admin.getId());
         callLog.setAdminName(name);
         callLog.setContacts(ContactName);
         callLog.setCreateTime(DateUtils.parseDate(startTime));
@@ -177,11 +177,10 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<UserArchivesMapper>
         callLogMapper.insert(callLog);
         //需要关闭客户呼叫中
         try {
-            systemWebSocketHandler.sendMessageToUser(adminId, new TextMessage("callCompleted"));
+            systemWebSocketHandler.sendMessageToUser(admin.getId(), new TextMessage("callCompleted"));
         }catch (Exception e ){
             LoggerUtils.error(getClass(),"websocket通信失败");
         }
-
         return 1;
     }