suntianwu 4 gadi atpakaļ
vecāks
revīzija
5e43385b72

+ 5 - 2
src/main/java/com/care/outcall/entity/KoalaLogDomain.java

@@ -22,8 +22,11 @@ public class KoalaLogDomain implements Serializable {
     @ApiModelProperty(dataType = "String", name = "olderId", value = "被监护人ID")
     private String olderId;
 
-    @ApiModelProperty(dataType = "String", name = "contactId", value = "联系人id")
-    private String contactId;
+    @ApiModelProperty(dataType = "String", name = "calledId", value = "被呼叫人ID")
+    private String calledId;
+
+    @ApiModelProperty(dataType = "String", name = "calledType", value = "被呼叫人类型:1、紧急联系人,2、管家,3、老人本人,4、120")
+    private String calledType;
 
     @ApiModelProperty(dataType = "String", name = "contactId", value = "事件工单ID")
     private String orderId;

+ 7 - 4
src/main/java/com/care/outcall/entity/KoalaOlderDto.java

@@ -1,5 +1,6 @@
 package com.care.outcall.entity;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -36,10 +37,12 @@ public class KoalaOlderDto implements Serializable {
      */
     private String stationId;
 
-    /**
-     * 机构ID
-     */
-    private String contactId;
+    @ApiModelProperty(dataType = "String", name = "calledId", value = "被呼叫人ID")
+    private String calledId;
+
+    @ApiModelProperty(dataType = "String", name = "calledType", value = "被呼叫人类型:1、紧急联系人,2、管家,3、老人本人,4、120")
+    private String calledType;
+
     /**
      * 事件工单ID
      */

+ 6 - 1
src/main/java/com/care/outcall/entity/KoalaOutCallBill.java

@@ -1,5 +1,6 @@
 package com.care.outcall.entity;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -22,7 +23,11 @@ public class KoalaOutCallBill implements Serializable{
     private String orgId;
     private String stationId;
     private String olderId;
-    private String contactId;
+    @ApiModelProperty(dataType = "String", name = "calledId", value = "被呼叫人ID")
+    private String calledId;
+
+    @ApiModelProperty(dataType = "String", name = "calledType", value = "被呼叫人类型:1、紧急联系人,2、管家,3、老人本人,4、120")
+    private String calledType;
     private String orderId;
     //'呼叫号码
     private String phone;

+ 1 - 1
src/main/java/com/care/outcall/mapper/KoalaOutCallDao.java

@@ -22,7 +22,7 @@ public interface KoalaOutCallDao {
      * @param userId 大有坐席id
      * @return 返回:考拉坐席号、账户编号和坐席密码
      */
-    Map<String, String> getKoalaAccountNoAndApiSecretByUserId(@Param(value = "userId") String userId);
+    Map<String, String> getAgentInfo(@Param(value = "userId") String userId);
 
     /**
      * 记录考拉外呼日志

+ 5 - 3
src/main/java/com/care/outcall/schedule/KoalaOutCallBillSchuding.java

@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.util.StringUtils;
 
 import java.util.*;
@@ -33,7 +34,7 @@ public class KoalaOutCallBillSchuding {
     /**
      * 10 秒钟调用一次
      */
-   // @Scheduled(cron = "0/10 * * * * ?")
+    @Scheduled(cron = "0/10 * * * * ?")
     public void exePhoneBill() {
         try {
             //构建话单
@@ -44,7 +45,7 @@ public class KoalaOutCallBillSchuding {
     }
 
 
-    //@Scheduled(cron = "0 0 0 * * ?")
+    @Scheduled(cron = "0 0 0 * * ?")
     public void updateComputeTrafficToFinish() {
         try {
             //大于两天的话单日志默认已计算
@@ -236,7 +237,8 @@ public class KoalaOutCallBillSchuding {
             koalaOutCallBill.setOlderId(koalaOlderDto.getOlderId());
             koalaOutCallBill.setOrderId(koalaOlderDto.getOrderId());
             koalaOutCallBill.setStationId(koalaOlderDto.getStationId());
-            koalaOutCallBill.setContactId(koalaOlderDto.getContactId());
+            koalaOutCallBill.setCalledId(koalaOlderDto.getCalledId());
+            koalaOutCallBill.setCalledType(koalaOlderDto.getCalledType());
             koalaOutCallBill.setSessionId(sessionId);
             koalaOutCallBill.setTeleAgentId(agentId);
 

+ 3 - 3
src/main/java/com/care/outcall/service/impl/KoalaOutCallServiceImpl.java

@@ -43,8 +43,8 @@ public class KoalaOutCallServiceImpl implements KoalaOutCallService {
         domain.setStationId(koalaLogDomain.getStationId());
         domain.setOlderId(koalaLogDomain.getOlderId());
         domain.setOrderId(koalaLogDomain.getOrderId());
-        domain.setContactId(koalaLogDomain.getContactId());
-
+        domain.setCalledId(koalaLogDomain.getCalledId());
+        domain.setCalledType(koalaLogDomain.getCalledType());
         domain.setOutDisplayNo(koalaLogDomain.getOutDisplayNo());
 
         //解析请求结果,获取sessionId和坐席分机号等
@@ -111,7 +111,7 @@ public class KoalaOutCallServiceImpl implements KoalaOutCallService {
     @Override
     public Map<String, String> getAgentInfo(String userId) throws Exception {
 
-        Map<String, String> koalaAccountNoAndApiSecret = this.koalaOutCallDao.getKoalaAccountNoAndApiSecretByUserId(userId);
+        Map<String, String> koalaAccountNoAndApiSecret = this.koalaOutCallDao.getAgentInfo(userId);
 
         String entId = koalaAccountNoAndApiSecret.get("entId");
         String agentId = koalaAccountNoAndApiSecret.get("agentId");

+ 31 - 14
src/main/resources/mybatis/KoalaOutCallMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.care.outcall.mapper.KoalaOutCallDao">
 
-    <select id="getKoalaAccountNoAndApiSecretByUserId" resultType="Map">
+    <select id="getAgentInfo" resultType="Map">
         select
         substring(cua.agent_id, 1, INSTR(cua.agent_id, '@') - 1) as agentId,
         cua.agent_password as agentPassword,
@@ -29,8 +29,11 @@
             <if test="orderId!=null and orderId!='' ">
                 order_id,
             </if>
-            <if test="contactId!=null and contactId!='' ">
-                contact_id,
+            <if test="calledId!=null and calledId!='' ">
+                called_id,
+            </if>
+            <if test="calledType!=null and calledType!='' ">
+                called_type,
             </if>
             <if test="phone!=null and phone!='' ">
                 phone,
@@ -84,8 +87,11 @@
             <if test="orderId!=null and orderId!='' ">
                 #{orderId},
             </if>
-            <if test="contactId!=null and contactId!='' ">
-                #{contactId},
+            <if test="calledId!=null and calledId!='' ">
+                #{calledId},
+            </if>
+            <if test="calledType!=null and calledType!='' ">
+                #{calledType},
             </if>
             <if test="phone!=null and phone!='' ">
                 #{phone},
@@ -133,7 +139,8 @@
         station_id as stationId,
         older_id as olderId,
          order_id as orderId,
-        contact_id as contactId,
+        called_id as calledId,
+         called_type as calledType,
         phone as phone,
         tenant_id as tenantId,
         agent_id as agentId,
@@ -216,8 +223,11 @@
             <if test="stationId!=null and stationId!=''">
                 station_id,
             </if>
-            <if test="contactId!=null and contactId!=''">
-                contact_id,
+            <if test="calledId!=null and calledId!=''">
+                called_id,
+            </if>
+            <if test="calledType!=null and calledType!=''">
+                called_type,
             </if>
             create_time,
             update_time
@@ -283,8 +293,11 @@
             <if test="stationId!=null">
                 #{stationId},
             </if>
-            <if test="contactId!=null">
-                #{contactId},
+            <if test="calledId!=null">
+                #{calledId},
+            </if>
+            <if test="calledType!=null">
+                #{calledType},
             </if>
             now(),
             now()
@@ -349,8 +362,11 @@
             <if test="stationId!=null and stationId!='' ">
                 station_id=#{stationId},
             </if>
-            <if test="contactId!=null and contactId!='' ">
-                contact_id=#{contactId},
+            <if test="calledId!=null and calledId!='' ">
+                called_id=#{calledId},
+            </if>
+            <if test="calledType!=null and calledType!='' ">
+                called_type=#{calledType},
             </if>
         </set>
         WHERE session_id=#{sessionId}
@@ -384,8 +400,9 @@
         distinct ckl.session_id as sessionId,
         ckl.org_id as orgId,
         ckl.older_id as olderId,
-          ckl.order_id as orderId,
-         ckl.contact_id as contactId,
+        ckl.order_id as orderId,
+        ckl.called_id as calledId,
+        ckl.called_type as calledType,
         ckl.phone as phone,
         date_format(ckl.create_time, '%Y%m%d%H%i%s') createTime
         from cc_koala_log ckl