Bladeren bron

公司加微记录查询功能相关代码

zyy 4 dagen geleden
bovenliggende
commit
7ef3bd79b3

+ 36 - 0
fs-common/src/main/java/com/fs/common/core/page/TableDataInfo.java

@@ -24,6 +24,12 @@ public class TableDataInfo implements Serializable
     /** 消息内容 */
     private String msg;
 
+    private long totalRecordCount;
+
+    private long successRecordCount;
+
+    private long todayRecordCount;
+
     /**
      * 表格数据对象
      */
@@ -82,4 +88,34 @@ public class TableDataInfo implements Serializable
     {
         this.msg = msg;
     }
+
+    public long getTotalRecordCount()
+    {
+        return totalRecordCount;
+    }
+
+    public void setTotalRecordCount(long totalRecordCount)
+    {
+        this.totalRecordCount = totalRecordCount;
+    }
+
+    public long getSuccessRecordCount()
+    {
+        return successRecordCount;
+    }
+
+    public void setSuccessRecordCount(long successRecordCount)
+    {
+        this.successRecordCount = successRecordCount;
+    }
+
+    public long getTodayRecordCount()
+    {
+        return todayRecordCount;
+    }
+
+    public void setTodayRecordCount(long todayRecordCount)
+    {
+        this.todayRecordCount = todayRecordCount;
+    }
 }

+ 45 - 1
fs-company/src/main/java/com/fs/company/controller/company/CompanyVoiceRoboticCallLogAddwxController.java

@@ -3,12 +3,15 @@ package com.fs.company.controller.company;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
 
 import com.fs.common.utils.StringUtils;
 import com.fs.company.domain.CompanyWxClient;
+import com.fs.company.vo.CompanyVoiceRoboticCallLogAddWxExportVO;
 import com.fs.company.vo.CompanyVoiceRoboticCallLogAddwxVO;
+import org.springframework.beans.BeanUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -73,7 +76,46 @@ public class CompanyVoiceRoboticCallLogAddwxController extends BaseController
         }
 
     }
-//
+
+    /**
+     * 查询调用日志_加微信列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:addwxlog:list')")
+    @GetMapping("/listAll")
+    public TableDataInfo listAll(CompanyVoiceRoboticCallLogAddwx companyVoiceRoboticCallLogAddwx)
+    {
+        startPage();
+        List<CompanyVoiceRoboticCallLogAddwxVO> list = companyVoiceRoboticCallLogAddwxService.listAll(companyVoiceRoboticCallLogAddwx);
+        TableDataInfo dataTable = getDataTable(list);
+        Map<String, Long> countMap = companyVoiceRoboticCallLogAddwxService.countListAll(companyVoiceRoboticCallLogAddwx);
+        if (countMap != null) {
+            dataTable.setTotalRecordCount(countMap.getOrDefault("totalRecordCount", 0L));
+            dataTable.setSuccessRecordCount(countMap.getOrDefault("successRecordCount", 0L));
+            dataTable.setTodayRecordCount(countMap.getOrDefault("todayRecordCount", 0L));
+        }
+        return dataTable;
+
+    }
+
+
+    /**
+     * 导出调用日志_加微信列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:addwxlog:export')")
+    @Log(title = "调用日志_加微信", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CompanyVoiceRoboticCallLogAddwx companyVoiceRoboticCallLogAddwx)
+    {
+        List<CompanyVoiceRoboticCallLogAddwxVO> list = companyVoiceRoboticCallLogAddwxService.listAll(companyVoiceRoboticCallLogAddwx);
+        List<CompanyVoiceRoboticCallLogAddWxExportVO> exportList = list.stream().map(item -> {
+            CompanyVoiceRoboticCallLogAddWxExportVO vo = new CompanyVoiceRoboticCallLogAddWxExportVO();
+            BeanUtils.copyProperties(item, vo);
+            return vo;
+        }).collect(Collectors.toList());
+        ExcelUtil<CompanyVoiceRoboticCallLogAddWxExportVO> util = new ExcelUtil<CompanyVoiceRoboticCallLogAddWxExportVO>(CompanyVoiceRoboticCallLogAddWxExportVO.class);
+        return util.exportExcel(exportList, "调用日志_加微信数据");
+    }
+
 //    /**
 //     * 导出调用日志_加微信列表
 //     */
@@ -86,6 +128,8 @@ public class CompanyVoiceRoboticCallLogAddwxController extends BaseController
 //        ExcelUtil<CompanyVoiceRoboticCallLogAddwx> util = new ExcelUtil<CompanyVoiceRoboticCallLogAddwx>(CompanyVoiceRoboticCallLogAddwx.class);
 //        return util.exportExcel(list, "调用日志_加微信数据");
 //    }
+//
+
 //
 //    /**
 //     * 获取调用日志_加微信详细信息

+ 6 - 0
fs-service/src/main/java/com/fs/company/mapper/CompanyVoiceRoboticCallLogAddwxMapper.java

@@ -1,6 +1,7 @@
 package com.fs.company.mapper;
 
 import java.util.List;
+import java.util.Map;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.company.domain.CompanyVoiceRoboticCallLogAddwx;
 import com.fs.company.vo.CompanyVoiceRoboticCallLogAddwxVO;
@@ -64,4 +65,9 @@ public interface CompanyVoiceRoboticCallLogAddwxMapper extends BaseMapper<Compan
     List<CompanyVoiceRoboticCallLogAddwxVO>  listByCustomerIdAndRoboticId(CompanyVoiceRoboticCallLogAddwx companyVoiceRoboticCallLogAddwx);
 
     List<CompanyVoiceRoboticCallLogAddwxVO> listByCustomerId(CompanyVoiceRoboticCallLogAddwx companyVoiceRoboticCallLogAddwx);
+
+    List<CompanyVoiceRoboticCallLogAddwxVO> listAll(CompanyVoiceRoboticCallLogAddwx companyVoiceRoboticCallLogAddwx);
+
+    Map<String, Long> countListAll(CompanyVoiceRoboticCallLogAddwx companyVoiceRoboticCallLogAddwx);
+
 }

+ 6 - 0
fs-service/src/main/java/com/fs/company/service/ICompanyVoiceRoboticCallLogAddwxService.java

@@ -1,6 +1,7 @@
 package com.fs.company.service;
 
 import java.util.List;
+import java.util.Map;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.company.domain.CompanyVoiceRoboticCallLogAddwx;
 import com.fs.company.domain.CompanyWxClient;
@@ -69,4 +70,9 @@ public interface ICompanyVoiceRoboticCallLogAddwxService extends IService<Compan
     List<CompanyVoiceRoboticCallLogAddwxVO> listByCustomerIdAndRoboticId(CompanyVoiceRoboticCallLogAddwx companyVoiceRoboticCallLogAddwx);
 
     List<CompanyVoiceRoboticCallLogAddwxVO> listByCustomerId(CompanyVoiceRoboticCallLogAddwx companyVoiceRoboticCallLogAddwx);
+
+    List<CompanyVoiceRoboticCallLogAddwxVO> listAll(CompanyVoiceRoboticCallLogAddwx companyVoiceRoboticCallLogAddwx);
+
+    Map<String, Long> countListAll(CompanyVoiceRoboticCallLogAddwx companyVoiceRoboticCallLogAddwx);
+
 }

+ 15 - 1
fs-service/src/main/java/com/fs/company/service/impl/CompanyVoiceRoboticCallLogAddwxServiceImpl.java

@@ -2,6 +2,7 @@ package com.fs.company.service.impl;
 
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.company.domain.CompanyVoiceRoboticCallLog;
@@ -25,7 +26,9 @@ import com.fs.company.service.ICompanyVoiceRoboticCallLogAddwxService;
  */
 @Service
 @Slf4j
-public class CompanyVoiceRoboticCallLogAddwxServiceImpl extends ServiceImpl<CompanyVoiceRoboticCallLogAddwxMapper, CompanyVoiceRoboticCallLogAddwx> implements ICompanyVoiceRoboticCallLogAddwxService {
+public
+
+class CompanyVoiceRoboticCallLogAddwxServiceImpl extends ServiceImpl<CompanyVoiceRoboticCallLogAddwxMapper, CompanyVoiceRoboticCallLogAddwx> implements ICompanyVoiceRoboticCallLogAddwxService {
 
 
     @Autowired
@@ -148,4 +151,15 @@ public class CompanyVoiceRoboticCallLogAddwxServiceImpl extends ServiceImpl<Comp
     public  List<CompanyWxClient> getWxClientInfoByCustomerId(Long customerId){
         return companyWxClientMapper.getWxClientInfoByCustomerId(customerId);
     }
+
+    @Override
+    public List<CompanyVoiceRoboticCallLogAddwxVO> listAll(CompanyVoiceRoboticCallLogAddwx companyVoiceRoboticCallLogAddwx){
+        return baseMapper.listAll(companyVoiceRoboticCallLogAddwx);
+    }
+
+    @Override
+    public Map<String, Long> countListAll(CompanyVoiceRoboticCallLogAddwx companyVoiceRoboticCallLogAddwx){
+        return baseMapper.countListAll(companyVoiceRoboticCallLogAddwx);
+    }
+
 }

+ 59 - 0
fs-service/src/main/java/com/fs/company/vo/CompanyVoiceRoboticCallLogAddWxExportVO.java

@@ -0,0 +1,59 @@
+package com.fs.company.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author ZhuanZ(无密码)
+ */
+@Data
+public class CompanyVoiceRoboticCallLogAddWxExportVO {
+    @Excel(name = "记录id")
+    private Long logId;
+
+    @Excel(name = "任务id")
+    private Long roboticId;
+
+    @Excel(name = "客户昵称")
+    private String wxClientName;
+
+    /** 执行状态:1、执行中,2、执行成功,3、执行失败 */
+    @Excel(name = "执行状态", readConverterExp = "1=执行中,2=执行成功,3=执行失败")
+    private Integer status;
+
+    /** 公司id */
+    @Excel(name = "公司")
+    private String companyName;
+
+    /** 个微账号id */
+    @Excel(name = "个微账号")
+    private String wxAccountName;
+
+    private Long customerId;
+
+    @Excel(name = "加微状态", readConverterExp = "0=失败,1=成功,2=加微中")
+    private Integer isAdd;
+
+    @Excel(name = "电话号码")
+    private String phone;
+
+    @Excel(name = "加微类型", readConverterExp = "1=个人微信,2=企业微信")
+    private Long isWeCom;
+
+    @Excel(name = "客户意向")
+    private String intention;
+
+    @Excel(name = "话术")
+    private String dialogName;
+
+    @Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date addTime;
+
+    /** 记录调用时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "调用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date runTime;
+}

+ 16 - 0
fs-service/src/main/java/com/fs/company/vo/CompanyVoiceRoboticCallLogAddwxVO.java

@@ -47,4 +47,20 @@ public class CompanyVoiceRoboticCallLogAddwxVO {
     private String wxAccountName;
 
     private Long customerId;
+
+    private Integer isAdd;
+
+    private String phone;
+
+    private Long isWeCom;
+
+    private String intention;
+
+    private String dialogName;
+
+    private Integer totalRecordCount;
+
+    private Integer successRecordCount;
+
+    private Date addTime;
 }

+ 65 - 1
fs-service/src/main/resources/mapper/company/CompanyVoiceRoboticCallLogAddwxMapper.xml

@@ -137,4 +137,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
         <if test="isWeCom != null "> and t1.is_we_com = #{isWeCom}</if>
     </select>
-</mapper>
+
+    <select id="listAll" parameterType="CompanyVoiceRoboticCallLogAddwx" resultType="com.fs.company.vo.CompanyVoiceRoboticCallLogAddwxVO">
+        select
+            t1.*,
+            t2.wx_nick_name as wxAccountName,
+            t3.nick_name as wxClientName,
+            t3.is_add as isAdd,
+            t3.phone as phone,
+            t3.add_time as addTime,
+            t4.company_name as companyName,
+            t5.nick_name as companyUserName,
+            t6.intention as intention,
+            t7.name as dialogName
+        from company_voice_robotic_call_log_addwx t1
+                 left join company_wx_account t2 on t1.wx_account_id = t2.id
+                 left join company_wx_client t3 on t3.id = t1.wx_client_id
+                 left join company t4 on t4.company_id = t1.company_id
+                 left join company_user t5 on t5.user_id = t2.company_user_id
+                 left join company_voice_robotic_wx t6 on t6.robotic_id = t1.robotic_id
+                 left join company_wx_dialog t7 on t7.id = t6.wx_dialog_id
+        <where>
+            t1.is_we_com = 2
+            <if test="logId != null"> and t1.log_id = #{logId}</if>
+            <if test="customerId != null"> and t3.customer_id = #{customerId}</if>
+            <if test="roboticId != null"> and t1.robotic_id = #{roboticId}</if>
+            <if test="wxClientId != null"> and t1.wx_client_id = #{wxClientId}</if>
+            <if test="runTime != null"> and t1.run_time = #{runTime}</if>
+            <if test="status != null"> and t1.status = #{status}</if>
+            <if test="companyId != null"> and t1.company_id = #{companyId}</if>
+            <if test="wxAccountId != null"> and t1.wx_account_id = #{wxAccountId}</if>
+            <if test="beginTime != null and beginTime != ''">
+                and t1.run_time &gt;= #{beginTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                and t1.run_time &lt;= #{endTime}
+            </if>
+        </where>
+        order by t1.log_id desc
+    </select>
+
+    <select id="countListAll" parameterType="CompanyVoiceRoboticCallLogAddwx" resultType="java.util.HashMap">
+        select
+        count(1) as totalRecordCount,
+        count(case when t1.status = 2 then 1 end) as successRecordCount,
+        <choose>
+            <when test="runTime != null or (beginTime != null and beginTime != '') or (endTime != null and endTime != '')">
+                count(1) as todayRecordCount
+            </when>
+            <otherwise>
+                count(case when date(t1.run_time) = curdate() then 1 end) as todayRecordCount
+            </otherwise>
+        </choose>
+        from company_voice_robotic_call_log_addwx t1
+        left join company_wx_account t2 on t1.wx_account_id = t2.id
+        left join company_wx_client t3 on t3.id = t1.wx_client_id
+        left join company t4 on t4.company_id = t2.company_id
+        left join company_user t5 on t5.user_id = t2.company_user_id
+        left join company_voice_robotic_wx t6 on t6.robotic_id = t1.robotic_id
+        left join company_wx_dialog t7 on t7.id = t6.wx_dialog_id
+        <where>
+            t1.is_we_com = 2
+            <if test="roboticId != null"> and t1.robotic_id = #{roboticId}</if>
+        </where>
+    </select>
+</mapper>