suntianwu před 3 roky
rodič
revize
99f78ff5f2

+ 3 - 2
src/main/java/com/care/bigscreen/controller/BigScreenController.java

@@ -322,12 +322,13 @@ public class BigScreenController {
     @ApiImplicitParams(
     @ApiImplicitParams(
             {
             {
                     @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"),
                     @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"),
+                    @ApiImplicitParam(name = "olderName", value = "被监护人姓名", dataTypeClass = String.class,required = false),
                     @ApiImplicitParam(name = "stationId", value = "站点ID", dataTypeClass = Long.class,required = true)
                     @ApiImplicitParam(name = "stationId", value = "站点ID", dataTypeClass = Long.class,required = true)
             }
             }
     )
     )
-    public Result<BigScreenOlderCardTotalVO> selectStationBigScreenOlderCardTotal(@RequestHeader("token") String token,Long stationId) {
+    public Result<BigScreenOlderCardTotalVO> selectStationBigScreenOlderCardTotal(@RequestHeader("token") String token,Long stationId,String olderName) {
         try {
         try {
-            BigScreenOlderCardTotalVO bigScreenOlderCardTotalVO =  bigScreenService.selectStationBigScreenOlderCardTotal(stationId);
+            BigScreenOlderCardTotalVO bigScreenOlderCardTotalVO =  bigScreenService.selectStationBigScreenOlderCardTotal(stationId,olderName);
             return Result.success(bigScreenOlderCardTotalVO);
             return Result.success(bigScreenOlderCardTotalVO);
         } catch (Exception e) {
         } catch (Exception e) {
             log.error("服务站大屏的用户卡片总计查询出现异常",e);
             log.error("服务站大屏的用户卡片总计查询出现异常",e);

+ 1 - 1
src/main/java/com/care/bigscreen/mapper/BigSreenMapper.java

@@ -84,7 +84,7 @@ public interface BigSreenMapper extends BaseMapper<StStation> {
     /**
     /**
      * 服务站大屏的告警用户卡片列表总记录数
      * 服务站大屏的告警用户卡片列表总记录数
      */
      */
-    BigScreenOlderCardTotalVO selectStationBigScreenOlderCardTotal(@Param("stationId") Long stationId);
+    BigScreenOlderCardTotalVO selectStationBigScreenOlderCardTotal(@Param("stationId") Long stationId,@Param("olderName") String olderName);
 
 
     /**
     /**
      * 服务站大屏的用户卡片列表总记录数
      * 服务站大屏的用户卡片列表总记录数

+ 1 - 1
src/main/java/com/care/bigscreen/service/BigScreenService.java

@@ -76,7 +76,7 @@ public interface BigScreenService {
     /**
     /**
      * 服务站大屏的用户卡片总计查询
      * 服务站大屏的用户卡片总计查询
      */
      */
-    BigScreenOlderCardTotalVO selectStationBigScreenOlderCardTotal(Long stationId);
+    BigScreenOlderCardTotalVO selectStationBigScreenOlderCardTotal(Long stationId,String olderName);
 
 
     /**
     /**
      * 服务站大屏的用户卡片列表分页查询
      * 服务站大屏的用户卡片列表分页查询

+ 2 - 2
src/main/java/com/care/bigscreen/service/impl/BigScreenServiceImpl.java

@@ -135,8 +135,8 @@ public class BigScreenServiceImpl implements BigScreenService {
      * @return 搜索符合条件的大屏统计数据
      * @return 搜索符合条件的大屏统计数据
      */
      */
     @Override
     @Override
-    public BigScreenOlderCardTotalVO selectStationBigScreenOlderCardTotal(Long stationId){
-        return bigSreenMapper.selectStationBigScreenOlderCardTotal(stationId);
+    public BigScreenOlderCardTotalVO selectStationBigScreenOlderCardTotal(Long stationId,String olderName){
+        return bigSreenMapper.selectStationBigScreenOlderCardTotal(stationId,olderName);
     }
     }
 
 
     /**
     /**

+ 4 - 4
src/main/java/com/care/outcall/controller/KoalaOutCallController.java

@@ -6,7 +6,7 @@ import com.care.common.util.JsonUtil;
 import com.care.common.util.JwtUtils;
 import com.care.common.util.JwtUtils;
 import com.care.common.util.Result;
 import com.care.common.util.Result;
 import com.care.common.vo.UserLogindConvertVO;
 import com.care.common.vo.UserLogindConvertVO;
-import com.care.outcall.entity.KoalaLoggerEntity;
+import com.care.outcall.entity.KoalaLogDomain;
 import com.care.outcall.service.KoalaOutCallService;
 import com.care.outcall.service.KoalaOutCallService;
 
 
 import io.jsonwebtoken.Claims;
 import io.jsonwebtoken.Claims;
@@ -59,12 +59,12 @@ public class KoalaOutCallController {
 
 
     @ApiOperation(value = "记录呼叫中心日志API", notes = "记录呼叫中心日志")
     @ApiOperation(value = "记录呼叫中心日志API", notes = "记录呼叫中心日志")
     @PostMapping(value = "/koala/addOptLog", produces = "application/json;charset=UTF-8", consumes = "application/json;charset=UTF-8")
     @PostMapping(value = "/koala/addOptLog", produces = "application/json;charset=UTF-8", consumes = "application/json;charset=UTF-8")
-    public Result addOptLog(@RequestBody KoalaLoggerEntity koalaLoggerEntity) {
+    public Result addOptLog(@RequestBody KoalaLogDomain koalaLogDomain) {
         try {
         try {
             if (logger.isDebugEnabled()) {
             if (logger.isDebugEnabled()) {
-                logger.debug(JsonUtil.toJson(koalaLoggerEntity));
+                logger.debug(JsonUtil.toJson(koalaLogDomain));
             }
             }
-            koalaOutCallService.addOptLog(koalaLoggerEntity);
+            koalaOutCallService.addOptLog(koalaLogDomain);
         } catch (Exception e) {
         } catch (Exception e) {
             logger.error("记录日志接口异常,异常信息:" + e.getMessage());
             logger.error("记录日志接口异常,异常信息:" + e.getMessage());
         }
         }

+ 43 - 146
src/main/java/com/care/outcall/entity/KoalaLogDomain.java

@@ -1,168 +1,65 @@
 package com.care.outcall.entity;
 package com.care.outcall.entity;
 
 
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
 /**
 /**
  * @author stw
  * @author stw
  * @version 2.7.0 创建于 2019/7/15
  * @version 2.7.0 创建于 2019/7/15
  **/
  **/
-public class KoalaLogDomain extends KoalaLoggerEntity {
+@Data
+public class KoalaLogDomain implements Serializable {
     private String id;
     private String id;
-    private String entId;
-    private String entNo;
-    private String tenantId;
-    private String agentId;
-    private String agentNumber;
-    private String sessionId;
 
 
-    private String calledNumber;
-    private String calledOriginalNumber;
-    private String receiveTime;
-    private String eventStatus;
-    private String computeTraffic;
+    @ApiModelProperty(dataType = "String", name = "orgId", value = "机构ID")
+    private String orgId;
+
+    @ApiModelProperty(dataType = "String", name = "stationId", value = "服务站ID")
+    private String stationId;
 
 
+    @ApiModelProperty(dataType = "String", name = "olderId", value = "被监护人ID")
     private String olderId;
     private String olderId;
-    private String disNumber;
-    private String md5FlowNo;
 
 
-    private String createTime;
-    private String updateTime;
+    @ApiModelProperty(dataType = "String", name = "contactId", value = "联系人id")
+    private String contactId;
 
 
-    public String getId() {
-        return id;
-    }
+    @ApiModelProperty(dataType = "String", name = "phone", value = "被叫号码")
+    private String phone;
 
 
-    public void setId(String id) {
-        this.id = id;
-    }
+    @ApiModelProperty(dataType = "String", name = "disNumber", value = "租户id,考拉开通的租户id")
+    private String tenantId;
 
 
-    public String getEntId() {
-        return entId;
-    }
+    @ApiModelProperty(dataType = "String", name = "agentId", value = "坐席工号")
+    private String agentId;
+
+    @ApiModelProperty(dataType = "String", name = "agentId", value = "坐席分机号")
+    private String agentNumber;
+
+    @ApiModelProperty(dataType = "String", name = "apiMethod", value = "web请求的api方法名称,如:makeCall 事件名称等")
+    private String apiMethod;
+
+    @ApiModelProperty(dataType = "String", name = "result", value = "接口请求返回结果,json字符串")
+    private String result;
+
+    @ApiModelProperty(dataType = "String", name = "result", value = "会话id")
+    private String sessionId;
 
 
-    public void setEntId(String entId) {
-        this.entId = entId;
-    }
+    @ApiModelProperty(dataType = "String", name = "result", value = "接收日志的时间")
+    private String receiveTime;
 
 
-    public String getAgentId() {
-        return agentId;
-    }
+    @ApiModelProperty(dataType = "String", name = "disNumber", value = "外显号码")
+    private String outDisplayNo;
 
 
-    public void setAgentId(String agentId) {
-        this.agentId = agentId;
-    }
+    @ApiModelProperty(dataType = "String", name = "disNumber", value = "事件的状态,描述事件的生存周期:1.坐席振铃,2.坐席接通,3.客户振铃,4.客户接通,5.坐席挂断,6.客户挂断,7.未接通")
+    private String eventStatus;
 
 
-    public String getAgentNumber() {
-        return agentNumber;
-    }
+    @ApiModelProperty(dataType = "String", name = "disNumber", value = " 0.话单日志日志未被计算,1.非话单日志,或者话单日志已经被计算")
+    private String computeTraffic;
 
 
-    public void setAgentNumber(String agentNumber) {
-        this.agentNumber = agentNumber;
-    }
+    private String createTime;
+    private String updateTime;
 
 
-    public String getTenantId() {
-        return tenantId;
-    }
 
 
-    public void setTenantId(String tenantId) {
-        this.tenantId = tenantId;
-    }
-
-    public String getSessionId() {
-        return sessionId;
-    }
-
-    public void setSessionId(String sessionId) {
-        this.sessionId = sessionId;
-    }
-
-    public String getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(String createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(String updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getCalledNumber() {
-        return calledNumber;
-    }
-
-    public void setCalledNumber(String calledNumber) {
-        this.calledNumber = calledNumber;
-    }
-
-    public String getCalledOriginalNumber() {
-        return calledOriginalNumber;
-    }
-
-    public void setCalledOriginalNumber(String calledOriginalNumber) {
-        this.calledOriginalNumber = calledOriginalNumber;
-    }
-
-    public String getReceiveTime() {
-        return receiveTime;
-    }
-
-    public void setReceiveTime(String receiveTime) {
-        this.receiveTime = receiveTime;
-    }
-
-    public String getEventStatus() {
-        return eventStatus;
-    }
-
-    public void setEventStatus(String eventStatus) {
-        this.eventStatus = eventStatus;
-    }
-
-    public String getComputeTraffic() {
-        return computeTraffic;
-    }
-
-    public void setComputeTraffic(String computeTraffic) {
-        this.computeTraffic = computeTraffic;
-    }
-
-    @Override
-    public String getOlderId() {
-        return olderId;
-    }
-
-    @Override
-    public void setOlderId(String olderId) {
-        this.olderId = olderId;
-    }
-
-    public String getDisNumber() {
-        return disNumber;
-    }
-
-    public void setDisNumber(String disNumber) {
-        this.disNumber = disNumber;
-    }
-
-    public String getMd5FlowNo() {
-        return md5FlowNo;
-    }
-
-    public void setMd5FlowNo(String md5FlowNo) {
-        this.md5FlowNo = md5FlowNo;
-    }
-
-    @Override
-    public String getEntNo() {
-        return entNo;
-    }
-
-    @Override
-    public void setEntNo(String entNo) {
-        this.entNo = entNo;
-    }
 }
 }

+ 0 - 94
src/main/java/com/care/outcall/entity/KoalaLoggerEntity.java

@@ -1,94 +0,0 @@
-package com.care.outcall.entity;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-
-/**
- * @author stw
- * @version 2.7.0 创建于 2019/7/15
- **/
-@ApiModel(description = "日志实体类")
-public class KoalaLoggerEntity implements Serializable {
-    @ApiModelProperty(dataType = "String", name = "apiMethod", value = "接口方法,直接写接口名称")
-    private String apiMethod;
-    @ApiModelProperty(dataType = "String", name = "apiEvent", value = "事件状态,1.坐席振铃,2.坐席接通,3.客户振铃,4.客户接通,5.坐席挂断,6.客户挂断,7.未接通")
-    private String apiEventStatus;
-    @ApiModelProperty(dataType = "String", name = "agentId", value = "坐席id")
-    private String agentId;
-    @ApiModelProperty(dataType = "String", name = "olderId", value = "任务id")
-    private String olderId;
-    @ApiModelProperty(dataType = "String", name = "outCallNumber", value = "外呼流水号")
-    private String outCallNumber;
-    @ApiModelProperty(dataType = "String", name = "disNumber", value = "外显号码")
-    private String disNumber;
-    @ApiModelProperty(dataType = "String", name = "entId", value = "企业编码")
-    private String entNo;
-    @ApiModelProperty(dataType = "String", name = "result", value = "接口请求返回结果")
-    private String result;
-
-    public String getApiMethod() {
-        return apiMethod;
-    }
-
-    public void setApiMethod(String apiMethod) {
-        this.apiMethod = apiMethod;
-    }
-
-    public String getApiEventStatus() {
-        return apiEventStatus;
-    }
-
-    public void setApiEventStatus(String apiEventStatus) {
-        this.apiEventStatus = apiEventStatus;
-    }
-
-    public String getResult() {
-        return result;
-    }
-
-    public void setResult(String result) {
-        this.result = result;
-    }
-
-    public String getAgentId() {
-        return agentId;
-    }
-
-    public void setAgentId(String agentId) {
-        this.agentId = agentId;
-    }
-
-    public String getOlderId() {
-        return olderId;
-    }
-
-    public void setOlderId(String olderId) {
-        this.olderId = olderId;
-    }
-
-    public String getOutCallNumber() {
-        return outCallNumber;
-    }
-
-    public void setOutCallNumber(String outCallNumber) {
-        this.outCallNumber = outCallNumber;
-    }
-
-    public String getDisNumber() {
-        return disNumber;
-    }
-
-    public void setDisNumber(String disNumber) {
-        this.disNumber = disNumber;
-    }
-
-    public String getEntNo() {
-        return entNo;
-    }
-
-    public void setEntNo(String entNo) {
-        this.entNo = entNo;
-    }
-}

+ 15 - 5
src/main/java/com/care/outcall/entity/KoalaOlderDto.java

@@ -12,9 +12,9 @@ import java.io.Serializable;
 public class KoalaOlderDto implements Serializable {
 public class KoalaOlderDto implements Serializable {
 
 
     /**
     /**
-     * 大有流水号
+     * 电话
      */
      */
-    private String dyFlowNo;
+    private String phone;
 
 
     /**
     /**
      * 老人id
      * 老人id
@@ -22,14 +22,24 @@ public class KoalaOlderDto implements Serializable {
     private String olderId;
     private String olderId;
 
 
     /**
     /**
-     * 流水号信息
+     * 会话ID
      */
      */
     private String sessionId;
     private String sessionId;
 
 
     /**
     /**
-     * 大有企业号
+     * 机构ID
      */
      */
-    private String enterpriseNo;
+    private String orgId;
+
+    /**
+     * 服务站ID
+     */
+    private String stationId;
+
+    /**
+     * 机构ID
+     */
+    private String contactId;
 
 
     /**
     /**
      * 创建时间
      * 创建时间

+ 12 - 205
src/main/java/com/care/outcall/entity/KoalaOutCallBill.java

@@ -1,5 +1,7 @@
 package com.care.outcall.entity;
 package com.care.outcall.entity;
 
 
+import lombok.Data;
+
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
 
 
@@ -10,11 +12,19 @@ import java.util.Date;
  * @Date: Created In 2018/1/10 16:03
  * @Date: Created In 2018/1/10 16:03
  * @Modified By:
  * @Modified By:
  */
  */
+@Data
 public class KoalaOutCallBill implements Serializable{
 public class KoalaOutCallBill implements Serializable{
     // '主键值为uuid',
     // '主键值为uuid',
     private String id;
     private String id;
-    //'呼叫号码或md5身份证号',
-    private String clientFlowNo;
+    //业务字段
+    private Date createTime;
+    private Date updateTime;
+    private String orgId;
+    private String stationId;
+    private String olderId;
+    private String contactId;
+    //'呼叫号码
+    private String phone;
     //接通状态:{电信:以客户接通为准取1,其他取2},{联通:PCS000.已拨通电话,,PCS001.未获取,PCS002.已获取,PCS003.获取失败}',
     //接通状态:{电信:以客户接通为准取1,其他取2},{联通:PCS000.已拨通电话,,PCS001.未获取,PCS002.已获取,PCS003.获取失败}',
     private String outCallStatus;
     private String outCallStatus;
 //接通状态:{电信:以客户接通为准取1,其他取2},{联通:PCS000.已拨通电话,,PCS001.未获取,PCS002.已获取,PCS003.获取失败}(原始状态)
 //接通状态:{电信:以客户接通为准取1,其他取2},{联通:PCS000.已拨通电话,,PCS001.未获取,PCS002.已获取,PCS003.获取失败}(原始状态)
@@ -22,8 +32,6 @@ public class KoalaOutCallBill implements Serializable{
     //通话结果状态:1.成功通话2.废号(空号/欠费/停机)3.无法接通(占线/转秘书台)4.无法接通(占线/转秘书台)5.无人接(未接听)6.无人接(主动挂)7.传真机/总机8.关机
     //通话结果状态:1.成功通话2.废号(空号/欠费/停机)3.无法接通(占线/转秘书台)4.无法接通(占线/转秘书台)5.无人接(未接听)6.无人接(主动挂)7.传真机/总机8.关机
     private String callResultStatus;
     private String callResultStatus;
 
 
-    private String batchId;//'电信:任务编号,联通:批次号',
-
     private String sessionId;// '会话id,通话唯一标识,联通为uuid',
     private String sessionId;// '会话id,通话唯一标识,联通为uuid',
     private String teleEntId;//'企业id',
     private String teleEntId;//'企业id',
     private String teleAgentId;// '坐席id',
     private String teleAgentId;// '坐席id',
@@ -38,207 +46,6 @@ public class KoalaOutCallBill implements Serializable{
     private String audioUrl;
     private String audioUrl;
 
 
 
 
-    //业务字段
-    private Date createTime;
-    private Date updateTime;
-    private String enterpriseNo;
-    private String enterpriseId;
-
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getEnterpriseNo() {
-        return enterpriseNo;
-    }
-
-    public void setEnterpriseNo(String enterpriseNo) {
-        this.enterpriseNo = enterpriseNo;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getClientFlowNo() {
-        return clientFlowNo;
-    }
-
-    public void setClientFlowNo(String clientFlowNo) {
-        this.clientFlowNo = clientFlowNo;
-    }
-
-    public String getOutCallStatus() {
-        return outCallStatus;
-    }
-
-    public void setOutCallStatus(String outCallStatus) {
-        this.outCallStatus = outCallStatus;
-    }
-
-
-    public String getBatchId() {
-        return batchId;
-    }
-
-    public void setBatchId(String batchId) {
-        this.batchId = batchId;
-    }
-
-    public String getSessionId() {
-        return sessionId;
-    }
-
-    public void setSessionId(String sessionId) {
-        this.sessionId = sessionId;
-    }
-
-    public String getTeleEntId() {
-        return teleEntId;
-    }
-
-    public void setTeleEntId(String teleEntId) {
-        this.teleEntId = teleEntId;
-    }
-
-    public String getTeleAgentId() {
-        return teleAgentId;
-    }
-
-    public void setTeleAgentId(String teleAgentId) {
-        this.teleAgentId = teleAgentId;
-    }
-
-    public String getOutCallRadioStatus() {
-        return outCallRadioStatus;
-    }
-
-    public void setOutCallRadioStatus(String outCallRadioStatus) {
-        this.outCallRadioStatus = outCallRadioStatus;
-    }
-
-    public String getClientAlertStartTime() {
-        return clientAlertStartTime;
-    }
-
-    public void setClientAlertStartTime(String clientAlertStartTime) {
-        this.clientAlertStartTime = clientAlertStartTime;
-    }
-
-    public String getCallDuration() {
-        return callDuration;
-    }
-
-    public void setCallDuration(String callDuration) {
-        this.callDuration = callDuration;
-    }
-
-
-    public String getHangupType() {
-        return hangupType;
-    }
-
-    public void setHangupType(String hangupType) {
-        this.hangupType = hangupType;
-    }
-
-    public String getCallStartTime() {
-        return callStartTime;
-    }
-
-    public void setCallStartTime(String callStartTime) {
-        this.callStartTime = callStartTime;
-    }
-
-    public String getCallEndTime() {
-        return callEndTime;
-    }
-
-    public void setCallEndTime(String callEndTime) {
-        this.callEndTime = callEndTime;
-    }
-
-    public String getAudioUrl() {
-        return audioUrl;
-    }
-
-    public void setAudioUrl(String audioUrl) {
-        this.audioUrl = audioUrl;
-    }
-
-
-    public String getOrigOutCallStatus() {
-        return origOutCallStatus;
-    }
-
-    public void setOrigOutCallStatus(String origOutCallStatus) {
-        this.origOutCallStatus = origOutCallStatus;
-    }
-
-    public String getCallResultStatus() {
-        return callResultStatus;
-    }
-
-    public void setCallResultStatus(String callResultStatus) {
-        this.callResultStatus = callResultStatus;
-    }
 
 
 
 
-    public String getEnterpriseId() {
-        return enterpriseId;
     }
     }
-
-    public void setEnterpriseId(String enterpriseId) {
-        this.enterpriseId = enterpriseId;
-    }
-
-    @Override
-    public String toString() {
-        return "KoalaOutCallBill{" +
-                "id='" + id + '\'' +
-                ", clientFlowNo='" + clientFlowNo + '\'' +
-                ", outCallStatus='" + outCallStatus + '\'' +
-                ", origOutCallStatus='" + origOutCallStatus + '\'' +
-                ", callResultStatus='" + callResultStatus + '\'' +
-
-                ", batchId='" + batchId + '\'' +
-
-                ", sessionId='" + sessionId + '\'' +
-                ", teleEntId='" + teleEntId + '\'' +
-                ", teleAgentId='" + teleAgentId + '\'' +
-                ", outCallRadioStatus='" + outCallRadioStatus + '\'' +
-                ", clientAlertStartTime='" + clientAlertStartTime + '\'' +
-                ", callDuration='" + callDuration + '\'' +
-
-                ", hangupType='" + hangupType + '\'' +
-                ", callStartTime='" + callStartTime + '\'' +
-                ", callEndTime='" + callEndTime + '\'' +
-                ", audioUrl='" + audioUrl + '\'' +
-
-                ", createTime=" + createTime +
-                ", updateTime=" + updateTime +
-                ", enterpriseNo='" + enterpriseNo + '\'' +
-
-
-                '}';
-    }
-
-
-}

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

@@ -163,7 +163,7 @@ public class KoalaOutCallBillSchuding {
             boolean isBill = false;
             boolean isBill = false;
             for (KoalaLogDomain logDomain : logDomains) {
             for (KoalaLogDomain logDomain : logDomains) {
                 tenantId = logDomain.getTenantId();
                 tenantId = logDomain.getTenantId();
-                calledNumber = logDomain.getCalledNumber();
+                calledNumber = logDomain.getPhone();
                 olderId = logDomain.getOlderId();
                 olderId = logDomain.getOlderId();
                 break;
                 break;
             }
             }
@@ -232,7 +232,7 @@ public class KoalaOutCallBillSchuding {
             //该会话的坐席号
             //该会话的坐席号
             String agentId = logDomain.getAgentId();
             String agentId = logDomain.getAgentId();
             //该会话的企业id
             //该会话的企业id
-            koalaOutCallBill.setClientFlowNo(koalaOlderDto.getDyFlowNo());
+            koalaOutCallBill.setPhone(koalaOlderDto.getPhone());
             koalaOutCallBill.setCallStartTime(callStartTime);
             koalaOutCallBill.setCallStartTime(callStartTime);
             koalaOutCallBill.setOutCallStatus("1");
             koalaOutCallBill.setOutCallStatus("1");
             koalaOutCallBill.setOrigOutCallStatus("1");
             koalaOutCallBill.setOrigOutCallStatus("1");
@@ -240,10 +240,12 @@ public class KoalaOutCallBillSchuding {
             koalaOutCallBill.setCallEndTime(callEndTime);
             koalaOutCallBill.setCallEndTime(callEndTime);
             koalaOutCallBill.setAudioUrl(audioUrl);
             koalaOutCallBill.setAudioUrl(audioUrl);
             koalaOutCallBill.setOutCallRadioStatus("2");//录件获取状态。1未获取,2已获取
             koalaOutCallBill.setOutCallRadioStatus("2");//录件获取状态。1未获取,2已获取
-            koalaOutCallBill.setBatchId(koalaOlderDto.getOlderId());
+            koalaOutCallBill.setOlderId(koalaOlderDto.getOlderId());
+            koalaOutCallBill.setStationId(koalaOlderDto.getOlderId());
+            koalaOutCallBill.setContactId(koalaOlderDto.getContactId());
             koalaOutCallBill.setSessionId(sessionId);
             koalaOutCallBill.setSessionId(sessionId);
             koalaOutCallBill.setTeleAgentId(agentId);
             koalaOutCallBill.setTeleAgentId(agentId);
-            //大有
+
             koalaOutCallBill.setClientAlertStartTime(clientAlterTime);
             koalaOutCallBill.setClientAlertStartTime(clientAlterTime);
             if (callFlag && !unCalledFlag) {
             if (callFlag && !unCalledFlag) {
                 koalaOutCallBill.setCallDuration("0");
                 koalaOutCallBill.setCallDuration("0");
@@ -258,7 +260,7 @@ public class KoalaOutCallBillSchuding {
             }
             }
 
 
             koalaOutCallBill.setHangupType(hangupType);
             koalaOutCallBill.setHangupType(hangupType);
-            koalaOutCallBill.setEnterpriseNo(koalaOlderDto.getEnterpriseNo());
+            koalaOutCallBill.setOrgId(koalaOlderDto.getOrgId());
             return koalaOutCallBill;
             return koalaOutCallBill;
         } catch (Exception e) {
         } catch (Exception e) {
             logger.error("计算话单失败,失败原因={}", e.getMessage());
             logger.error("计算话单失败,失败原因={}", e.getMessage());

+ 2 - 2
src/main/java/com/care/outcall/service/KoalaOutCallService.java

@@ -1,7 +1,7 @@
 package com.care.outcall.service;
 package com.care.outcall.service;
 
 
 
 
-import com.care.outcall.entity.KoalaLoggerEntity;
+import com.care.outcall.entity.KoalaLogDomain;
 
 
 import java.util.Map;
 import java.util.Map;
 
 
@@ -17,5 +17,5 @@ public interface KoalaOutCallService {
      */
      */
     Map<String, String> getAgentInfo(String userId) throws Exception;
     Map<String, String> getAgentInfo(String userId) throws Exception;
 
 
-    void addOptLog(KoalaLoggerEntity koalaLoggerEntity) throws Exception;
+    void addOptLog(KoalaLogDomain koalaLogDomain) throws Exception;
 }
 }

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

@@ -2,7 +2,6 @@ package com.care.outcall.service.impl;
 
 
 
 
 import com.care.outcall.entity.KoalaLogDomain;
 import com.care.outcall.entity.KoalaLogDomain;
-import com.care.outcall.entity.KoalaLoggerEntity;
 import com.care.outcall.mapper.KoalaOutCallDao;
 import com.care.outcall.mapper.KoalaOutCallDao;
 import com.care.outcall.service.KoalaOutCallService;
 import com.care.outcall.service.KoalaOutCallService;
 import com.care.common.util.DateUtils;
 import com.care.common.util.DateUtils;
@@ -24,35 +23,38 @@ public class KoalaOutCallServiceImpl implements KoalaOutCallService {
     private KoalaOutCallDao koalaOutCallDao;
     private KoalaOutCallDao koalaOutCallDao;
 
 
     @Override
     @Override
-    public void addOptLog(KoalaLoggerEntity koalaLoggerEntity) throws Exception {
-        koalaOutCallDao.addOptLog(makeLog(koalaLoggerEntity));
+    public void addOptLog(KoalaLogDomain koalaLogDomain) throws Exception {
+        koalaOutCallDao.addOptLog(makeLog(koalaLogDomain));
     }
     }
 
 
     private static Map<String, Object> parseJson(String json) throws Exception {
     private static Map<String, Object> parseJson(String json) throws Exception {
         return JsonUtil.fromJson(json, Map.class);
         return JsonUtil.fromJson(json, Map.class);
     }
     }
 
 
-    private KoalaLogDomain makeLog(KoalaLoggerEntity koalaLoggerEntity) throws Exception {
+    private KoalaLogDomain makeLog(KoalaLogDomain koalaLogDomain) throws Exception {
         //前端调用接口即触发日志记录事件
         //前端调用接口即触发日志记录事件
         KoalaLogDomain domain = new KoalaLogDomain();
         KoalaLogDomain domain = new KoalaLogDomain();
-        domain.setResult(koalaLoggerEntity.getResult());
-        domain.setApiMethod(koalaLoggerEntity.getApiMethod());
+        domain.setResult(koalaLogDomain.getResult());
+        domain.setApiMethod(koalaLogDomain.getApiMethod());
         domain.setComputeTraffic("0");//话单未被计算
         domain.setComputeTraffic("0");//话单未被计算
 
 
-        domain.setAgentId(koalaLoggerEntity.getAgentId());
-        domain.setEntNo(koalaLoggerEntity.getEntNo());
-        domain.setOlderId(koalaLoggerEntity.getOlderId());
-        domain.setDisNumber(koalaLoggerEntity.getDisNumber());
+        domain.setAgentId(koalaLogDomain.getAgentId());
+        domain.setOrgId(koalaLogDomain.getOrgId());
+        domain.setStationId(koalaLogDomain.getStationId());
+        domain.setOlderId(koalaLogDomain.getOlderId());
+        domain.setContactId(koalaLogDomain.getContactId());
+
+        domain.setOutDisplayNo(koalaLogDomain.getOutDisplayNo());
 
 
         //解析请求结果,获取sessionId和坐席分机号等
         //解析请求结果,获取sessionId和坐席分机号等
-        Map<String, Object> map = parseJson(koalaLoggerEntity.getResult());
+        Map<String, Object> map = parseJson(koalaLogDomain.getResult());
         Object sessionId = map.get("callID");
         Object sessionId = map.get("callID");
         Object agentNumber = map.get("thisDN");
         Object agentNumber = map.get("thisDN");
         Object receiveTime = map.get("creationTime");
         Object receiveTime = map.get("creationTime");
         Object tenantId = map.get("tenantID");
         Object tenantId = map.get("tenantID");
         Object messageId = map.get("messageId");
         Object messageId = map.get("messageId");
         Object callState = map.get("callState");//0:被叫挂断,1:主叫挂断
         Object callState = map.get("callState");//0:被叫挂断,1:主叫挂断
-        Object calledNumber = map.get("otherDN");//被叫号码
+        Object phone = map.get("otherDN");//被叫号码
         if(sessionId != null){
         if(sessionId != null){
             domain.setSessionId(sessionId.toString());
             domain.setSessionId(sessionId.toString());
         }
         }
@@ -71,8 +73,8 @@ public class KoalaOutCallServiceImpl implements KoalaOutCallService {
             //callState为空,默认认为是被叫挂断(用于挂断状态处理)
             //callState为空,默认认为是被叫挂断(用于挂断状态处理)
             domain.setEventStatus(formatOutCallEvent(messageId.toString(), (callState != null) ? callState.toString() : "1"));
             domain.setEventStatus(formatOutCallEvent(messageId.toString(), (callState != null) ? callState.toString() : "1"));
         }
         }
-        if(calledNumber != null){
-            domain.setCalledNumber(calledNumber.toString());
+        if(phone != null){
+            domain.setPhone(phone.toString());
         }
         }
         return domain;
         return domain;
     }
     }

+ 10 - 2
src/main/resources/mybatis/BigSreenMapper.xml

@@ -247,8 +247,16 @@
 
 
     <select id="selectStationBigScreenOlderCardTotal" resultType="com.care.bigscreen.vo.BigScreenOlderCardTotalVO">
     <select id="selectStationBigScreenOlderCardTotal" resultType="com.care.bigscreen.vo.BigScreenOlderCardTotalVO">
         SELECT
         SELECT
-        (select count(1) from care_older  where station_id = #{stationId}  ) allOlderAmount,
-        (select count(1) from care_older  where station_id = #{stationId} and status not in ('0','1') )  alarmOlderAmount
+        (select count(1) from care_older  where station_id = #{stationId}
+        <if test="olderName != null and olderName != ''">
+            AND name like CONCAT('%',#{olderName},'%')
+        </if>
+         ) allOlderAmount,
+        (select count(1) from care_older  where station_id = #{stationId} and status not in ('0','1')
+        <if test="olderName != null and olderName != ''">
+            AND name like CONCAT('%',#{olderName},'%')
+        </if>
+        )  alarmOlderAmount
         from dual
         from dual
     </select>
     </select>
 
 

+ 95 - 63
src/main/resources/mybatis/KoalaOutCallMapper.xml

@@ -17,8 +17,20 @@
             create_time,
             create_time,
             update_time,
             update_time,
             id,
             id,
-            <if test="entNo!=null and entNo!='' ">
-                ent_id,
+            <if test="orgId!=null and orgId!='' ">
+                org_id,
+            </if>
+            <if test="stationId!=null and stationId!='' ">
+                station_id,
+            </if>
+            <if test="olderId!=null and olderId!='' ">
+                older_id,
+            </if>
+            <if test="contactId!=null and contactId!='' ">
+                contact_id,
+            </if>
+            <if test="phone!=null and phone!='' ">
+                phone,
             </if>
             </if>
             <if test="tenantId!=null and tenantId!='' ">
             <if test="tenantId!=null and tenantId!='' ">
                 tenant_id,
                 tenant_id,
@@ -29,41 +41,48 @@
             <if test="agentNumber!=null and agentNumber!='' ">
             <if test="agentNumber!=null and agentNumber!='' ">
                 agent_number,
                 agent_number,
             </if>
             </if>
-            <if test="sessionId!=null and sessionId!='' ">
-                session_id,
+            <if test="apiMethod!=null and apiMethod!='' ">
+                api_method,
             </if>
             </if>
             <if test="result!=null and result!='' ">
             <if test="result!=null and result!='' ">
                 result,
                 result,
             </if>
             </if>
-            <if test="apiMethod!=null and apiMethod!='' ">
-                api_method,
-            </if>
-            <if test="calledNumber!=null and calledNumber!='' ">
-                called_number,
+            <if test="sessionId!=null and sessionId!='' ">
+                session_id,
             </if>
             </if>
+
             <if test="receiveTime!=null and receiveTime!='' ">
             <if test="receiveTime!=null and receiveTime!='' ">
                 receive_time,
                 receive_time,
             </if>
             </if>
+            <if test="outDisplayNo!=null ">
+                out_display_no,
+            </if>
             <if test="eventStatus!=null">
             <if test="eventStatus!=null">
                 event_status,
                 event_status,
             </if>
             </if>
             <if test="computeTraffic!=null ">
             <if test="computeTraffic!=null ">
                 compute_traffic,
                 compute_traffic,
             </if>
             </if>
-            <if test="disNumber!=null ">
-                out_display_no,
-            </if>
-            <if test="olderId!=null ">
-                older_id,
-            </if>
         </trim>
         </trim>
         VALUES
         VALUES
         <trim prefix="(" suffix=")" suffixOverrides=",">
         <trim prefix="(" suffix=")" suffixOverrides=",">
             now(),
             now(),
             now(),
             now(),
             uuid(),
             uuid(),
-            <if test="entNo!=null and entNo!='' ">
-                (select id from cc_enterprise where enterprise_no=#{entNo}),
+            <if test="orgId!=null and orgId!='' ">
+                #{orgId},
+            </if>
+            <if test="stationId!=null and stationId!='' ">
+                #{stationId},
+            </if>
+            <if test="olderId!=null and olderId!='' ">
+                #{olderId},
+            </if>
+            <if test="contactId!=null and contactId!='' ">
+                #{contactId},
+            </if>
+            <if test="phone!=null and phone!='' ">
+                #{phone},
             </if>
             </if>
             <if test="tenantId!=null and tenantId!='' ">
             <if test="tenantId!=null and tenantId!='' ">
                 #{tenantId},
                 #{tenantId},
@@ -74,33 +93,27 @@
             <if test="agentNumber!=null and agentNumber!='' ">
             <if test="agentNumber!=null and agentNumber!='' ">
                 #{agentNumber},
                 #{agentNumber},
             </if>
             </if>
-            <if test="sessionId!=null and sessionId!='' ">
-                #{sessionId},
+            <if test="apiMethod!=null and apiMethod!='' ">
+                #{apiMethod},
             </if>
             </if>
             <if test="result!=null and result!='' ">
             <if test="result!=null and result!='' ">
                 #{result},
                 #{result},
             </if>
             </if>
-            <if test="apiMethod!=null and apiMethod!='' ">
-                #{apiMethod},
-            </if>
-            <if test="calledNumber!=null and calledNumber!='' ">
-                #{calledNumber},
+            <if test="sessionId!=null and sessionId!='' ">
+                #{sessionId},
             </if>
             </if>
             <if test="receiveTime!=null and receiveTime!='' ">
             <if test="receiveTime!=null and receiveTime!='' ">
                 #{receiveTime},
                 #{receiveTime},
             </if>
             </if>
+            <if test="outDisplayNo!=null ">
+                #{outDisplayNo},
+            </if>
             <if test="eventStatus!=null">
             <if test="eventStatus!=null">
                 #{eventStatus},
                 #{eventStatus},
             </if>
             </if>
             <if test="computeTraffic!=null ">
             <if test="computeTraffic!=null ">
                 #{computeTraffic},
                 #{computeTraffic},
             </if>
             </if>
-            <if test="disNumber!=null ">
-                #{disNumber},
-            </if>
-            <if test="olderId!=null ">
-                #{olderId},
-            </if>
         </trim>
         </trim>
     </insert>
     </insert>
 
 
@@ -108,21 +121,24 @@
     <select id="getAllBillInfo" resultType="com.care.outcall.entity.KoalaLogDomain">
     <select id="getAllBillInfo" resultType="com.care.outcall.entity.KoalaLogDomain">
         SELECT
         SELECT
          create_time as createTime,
          create_time as createTime,
+         update_time as updateTime,
         id,
         id,
-        ent_id as entId,
+        org_id as orgId,
+        station_id as stationId,
+        older_id as olderId,
+        contact_id as contactId,
+        phone as phone,
         tenant_id as tenantId,
         tenant_id as tenantId,
         agent_id as agentId,
         agent_id as agentId,
         agent_number as agentNumber,
         agent_number as agentNumber,
-        session_id as sessionId,
-        result,
         api_method as apiMethod,
         api_method as apiMethod,
-        called_number as calledNumber,
+        result,
+        session_id as sessionId,
         receive_time as receiveTime,
         receive_time as receiveTime,
+        out_display_no as outDisplayNo,
         event_status as eventStatus,
         event_status as eventStatus,
-        compute_traffic as computeTraffic,
-        out_display_no as disNumber,
-        older_id as olderId
-        FROM cc_koala_log WHERE compute_traffic=0 and older_id &lt;> '-1'
+        compute_traffic as computeTraffic
+        FROM cc_koala_log WHERE compute_traffic=0
     </select>
     </select>
 
 
     <select id="checkSession" parameterType="java.lang.String" resultType="java.lang.Integer">
     <select id="checkSession" parameterType="java.lang.String" resultType="java.lang.Integer">
@@ -135,8 +151,8 @@
         INSERT INTO cc_traffic_billed
         INSERT INTO cc_traffic_billed
         <trim prefix="(" suffix=")" suffixOverrides=",">
         <trim prefix="(" suffix=")" suffixOverrides=",">
             id,
             id,
-            <if test="clientFlowNo!=null and clientFlowNo!='' ">
-                client_flow_no,
+            <if test="phone!=null and phone!='' ">
+                phone,
             </if>
             </if>
             <if test="outCallStatus!=null and outCallStatus!='' ">
             <if test="outCallStatus!=null and outCallStatus!='' ">
                 out_call_status,
                 out_call_status,
@@ -148,8 +164,8 @@
                 call_result_status,
                 call_result_status,
             </if>
             </if>
 
 
-            <if test="batchId!=null and batchId!='' ">
-                batch_id,
+            <if test="olderId!=null and olderId!='' ">
+                older_id,
             </if>
             </if>
 
 
             <if test="sessionId!=null and sessionId!='' ">
             <if test="sessionId!=null and sessionId!='' ">
@@ -185,18 +201,23 @@
             <if test="audioUrl!=null and audioUrl!=''">
             <if test="audioUrl!=null and audioUrl!=''">
                 audio_url,
                 audio_url,
             </if>
             </if>
-            <if test="enterpriseNo!=null and enterpriseNo!=''">
-                enterprise_id,
+            <if test="orgId!=null and orgId!=''">
+                org_id,
+            </if>
+            <if test="stationId!=null and stationId!=''">
+                station_id,
+            </if>
+            <if test="contactId!=null and contactId!=''">
+                contact_id,
             </if>
             </if>
-
             create_time,
             create_time,
             update_time
             update_time
         </trim>
         </trim>
         VALUES
         VALUES
         <trim prefix="(" suffix=")" suffixOverrides=",">
         <trim prefix="(" suffix=")" suffixOverrides=",">
             uuid(),
             uuid(),
-            <if test="clientFlowNo!=null and clientFlowNo!='' ">
-                #{clientFlowNo},
+            <if test="phone!=null and phone!='' ">
+                #{phone},
             </if>
             </if>
             <if test="outCallStatus!=null and outCallStatus!='' ">
             <if test="outCallStatus!=null and outCallStatus!='' ">
                 #{outCallStatus},
                 #{outCallStatus},
@@ -208,8 +229,8 @@
                 #{callResultStatus},
                 #{callResultStatus},
             </if>
             </if>
 
 
-            <if test="batchId!=null and batchId!='' ">
-                #{batchId},
+            <if test="olderId!=null and olderId!='' ">
+                #{olderId},
             </if>
             </if>
 
 
             <if test="sessionId!=null and sessionId!='' ">
             <if test="sessionId!=null and sessionId!='' ">
@@ -245,10 +266,15 @@
             <if test="audioUrl!=null and audioUrl!=''">
             <if test="audioUrl!=null and audioUrl!=''">
                 #{audioUrl},
                 #{audioUrl},
             </if>
             </if>
-            <if test="enterpriseNo!=null">
-                (select ttt1.id from cc_enterprise ttt1 where ttt1.enterprise_no=#{enterpriseNo}),
+            <if test="orgId!=null">
+                #{orgId},
+            </if>
+            <if test="stationId!=null">
+                #{stationId},
+            </if>
+            <if test="contactId!=null">
+                #{contactId},
             </if>
             </if>
-
             now(),
             now(),
             now()
             now()
         </trim>
         </trim>
@@ -258,8 +284,8 @@
         UPDATE cc_traffic_billed
         UPDATE cc_traffic_billed
         <set>
         <set>
             update_time=now(),
             update_time=now(),
-            <if test="clientFlowNo!=null and clientFlowNo!='' ">
-                client_flow_no=#{clientFlowNo},
+            <if test="phone!=null and phone!='' ">
+                phone=#{phone},
             </if>
             </if>
             <if test="outCallStatus!=null and outCallStatus!='' ">
             <if test="outCallStatus!=null and outCallStatus!='' ">
                 out_call_status=#{outCallStatus},
                 out_call_status=#{outCallStatus},
@@ -300,10 +326,18 @@
             <if test="teleAgentId!=null and teleAgentId!='' ">
             <if test="teleAgentId!=null and teleAgentId!='' ">
                 tele_agent_id=#{teleAgentId},
                 tele_agent_id=#{teleAgentId},
             </if>
             </if>
-            <if test="batchId!=null and batchId!='' ">
-                batch_id=#{batchId},
+            <if test="olderId!=null and olderId!='' ">
+                older_id=#{olderId},
+            </if>
+            <if test="orgId!=null and orgId!='' ">
+                org_id=#{orgId},
+            </if>
+            <if test="stationId!=null and stationId!='' ">
+                station_id=#{stationId},
+            </if>
+            <if test="contactId!=null and contactId!='' ">
+                contact_id=#{contactId},
             </if>
             </if>
-
         </set>
         </set>
         WHERE session_id=#{sessionId}
         WHERE session_id=#{sessionId}
     </update>
     </update>
@@ -334,14 +368,12 @@
     <select id="getOlderInfoBySessionId" resultType="com.care.outcall.entity.KoalaOlderDto">
     <select id="getOlderInfoBySessionId" resultType="com.care.outcall.entity.KoalaOlderDto">
         select
         select
         distinct ckl.session_id as sessionId,
         distinct ckl.session_id as sessionId,
-        ce.org_code as enterpriseNo,
+        ckl.org_id as orgId,
         ckl.older_id as olderId,
         ckl.older_id as olderId,
-        ckl.called_number as dyFlowNo,
-        date_format(cocfn.create_time, '%Y%m%d%H%i%s') createTime
+         ckl.contact_id as contactId,
+        ckl.phone as phone,
+        date_format(ckl.create_time, '%Y%m%d%H%i%s') createTime
         from cc_koala_log ckl
         from cc_koala_log ckl
-        left join care_organization ce on ce.id=ckl.ent_id
-        left join care_older coct on coct.id=ckl.older_id
-        left join care_older_contact cocfn on ckl.called_number=cocfn.phone and coct.id = cocfn.older_id
         where ckl.session_id=#{sessionId}
         where ckl.session_id=#{sessionId}
     </select>
     </select>
 </mapper>
 </mapper>