소스 검색

CID改动

lmx 3 일 전
부모
커밋
8b13fb9466

+ 3 - 0
fs-company/src/main/java/com/fs/company/controller/company/CompanyVoiceRoboticCallLogCallphoneController.java

@@ -117,6 +117,9 @@ public class CompanyVoiceRoboticCallLogCallphoneController extends BaseControlle
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         companyVoiceRoboticCallLogCallphone.setCompanyId(loginUser.getCompany().getCompanyId());
         companyVoiceRoboticCallLogCallphone.setManualAnswered(1);
+        if(!loginUser.getUser().getUserType().equals("00")){
+            companyVoiceRoboticCallLogCallphone.setCompanyUserId(loginUser.getUser().getUserId());
+        }
         startPage();
         List<CompanyVoiceRoboticCallLogCallphone> list = companyVoiceRoboticCallLogCallphoneService.selectManualAnsweredList(companyVoiceRoboticCallLogCallphone);
         return getDataTable(list);

+ 6 - 0
fs-service/src/main/java/com/fs/crm/mapper/CrmCustomerMapper.java

@@ -292,6 +292,12 @@ public interface CrmCustomerMapper extends BaseMapper<CrmCustomer> {
             "<if test = 'maps.roboticId != null and maps.taskCustomerFilter != null and maps.taskCustomerFilter == \"inTask\"   '> " +
             "and c.customer_id IN (SELECT ce.user_id FROM company_voice_robotic_callees ce WHERE ce.robotic_id = #{maps.roboticId}) " +
             "</if>" +
+            "<if test = 'maps.aiConnectFilter != null and maps.aiConnectFilter == \"todayNotConnected\"   '> " +
+            "and (select ifnull(sum(case when aic.call_time &gt; 0 then 1 else 0 end), 0) from company_voice_robotic_call_log_callphone aic inner join company_voice_robotic_callees ce on ce.id = aic.caller_id where ce.user_id = c.customer_id and date(aic.create_time) = curdate()) = 0 " +
+            "</if>" +
+            "<if test = 'maps.aiConnectFilter != null and maps.aiConnectFilter == \"totalNotConnected\"   '> " +
+            "and (select ifnull(sum(case when aic.call_time &gt; 0 then 1 else 0 end), 0) from company_voice_robotic_call_log_callphone aic inner join company_voice_robotic_callees ce on ce.id = aic.caller_id where ce.user_id = c.customer_id) = 0 " +
+            "</if>" +
             "${maps.params.dataScope}"+
             " order by c.customer_id desc "+
             "</script>"})

+ 3 - 0
fs-service/src/main/java/com/fs/crm/param/CrmCustomerListQueryParam.java

@@ -116,4 +116,7 @@ public class CrmCustomerListQueryParam extends BaseQueryParam
     /** 自定义标签模糊搜索(LIKE '%customTag%') */
     private String customTag;
 
+    /** AI外呼接通筛选:todayNotConnected=今日接通量为0,totalNotConnected=累计接通量为0 */
+    private String aiConnectFilter;
+
 }

+ 2 - 1
fs-service/src/main/resources/mapper/company/CompanyVoiceRoboticCallLogCallphoneMapper.xml

@@ -354,8 +354,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="companyId != null">and t1.company_id = #{companyId}</if>
             <if test="roboticId != null">and t1.robotic_id = #{roboticId}</if>
             <if test="answeredExtNum != null and answeredExtNum != ''">and t1.answered_ext_num = #{answeredExtNum}</if>
+            <if test="companyUserId != null"> and cvr.company_user_id = #{companyUserId}</if>
         </where>
-        order by t1.handle_flag asc, t1.create_time desc
+        order by t1.handle_flag asc, t1.call_create_time desc
     </select>
 
     <!-- 按 customer_id(= callees.user_id)批量统计今日 AI 外呼(总数 / 接通数) -->