Explorar el Código

提交电销相关数据修改

hxl13994548489 hace 1 año
padre
commit
c80d333ba4

+ 16 - 0
src/main/java/com/ydtech/modules/admin/dao/SysTelemarketingWechatDataMapper.java

@@ -44,6 +44,22 @@ public interface SysTelemarketingWechatDataMapper extends BaseMapper<SysTelemark
      *  @Description: 通过用户id查询用户关联数据
      */
     DxReportDataDto findDataByUserId(@Param("userId")  String userId);
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/9 14:23
+     *  @Description: 通过用户id按天查询数据
+     */
+    Page<DxReportDataDto> findDataList(@Param("page") Page<DxReportDataDto> page, @Param("vo") DxQueryVo dxQueryVo);
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/9 14:23
+     *  @Description: 通过用户id查詢用戶数据
+     */
+    DxReportDataDto queryDxUserByUserId(@Param("userId") String userId);
 }
 
 

+ 18 - 13
src/main/java/com/ydtech/modules/admin/service/impl/DxDataServiceImpl.java

@@ -1,8 +1,6 @@
 package com.ydtech.modules.admin.service.impl;
 
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.dao.SysDeptInternalAgentMapper;
@@ -19,8 +17,6 @@ import com.ydtech.modules.admin.service.KhglZgdDataService;
 import com.ydtech.modules.admin.service.KhglZzbDataService;
 import com.ydtech.modules.admin.utils.DxApiConfigurationProperties;
 import com.ydtech.modules.order.entity.BasePageResult;
-import com.ydtech.modules.order.entity.api.pingan.response.TokenResponse;
-import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.ParameterizedTypeReference;
@@ -133,19 +129,28 @@ public class DxDataServiceImpl implements DxDataService {
      */
     public BasePageResult<DxReportDataDto> queryDxDataDayPage(DxQueryVo dxQueryVo) {
         Page<DxReportDataDto> page = new Page<>(dxQueryVo.getPageNum(), dxQueryVo.getPageSize());
-        Page<DxReportDataDto> result = sysTelemarketingWechatDataMapper.queryDataPage(page,dxQueryVo);
+        //查看开始
+        Page<DxReportDataDto> result = sysTelemarketingWechatDataMapper.findDataList(page,dxQueryVo);
+        //Page<DxReportDataDto> result = sysTelemarketingWechatDataMapper.queryDataPage(page,dxQueryVo);
         List<DxReportDataDto> newRecords =new ArrayList<DxReportDataDto>();
         List<DxReportDataDto> records = result.getRecords();
-        DxReportDataDto user =  sysTelemarketingWechatDataMapper.findDataByUserId(dxQueryVo.getUserId());
+
         if (records != null && records.size() > 0) {
             for (DxReportDataDto dxReportDataDto : records) {
-                dxReportDataDto.setQywxCount(dxReportDataDto.getQywxCount() ==null? 0:dxReportDataDto.getQywxCount());
-                dxReportDataDto.setDeptId(user.getDeptId());
-                dxReportDataDto.setDeptName(user.getDeptName());
-                dxReportDataDto.setGroupId(user.getGroupId());
-                dxReportDataDto.setGroupName(user.getGroupName());
-                dxReportDataDto.setUserId(user.getUserId());
-                dxReportDataDto.setUserName(user.getUserName());
+                DxReportDataDto users =  sysTelemarketingWechatDataMapper.queryDxUserByUserId(dxQueryVo.getUserId());
+                DxReportDataDto wxUser =  sysTelemarketingWechatDataMapper.findDataByUserId(dxQueryVo.getUserId());
+                dxReportDataDto.setQywxCount(wxUser.getQywxCount() ==null? 0:wxUser.getQywxCount());
+                dxReportDataDto.setDeptId(users.getDeptId());
+                dxReportDataDto.setDeptName(users.getDeptName());
+                dxReportDataDto.setGroupId(users.getGroupId());
+                dxReportDataDto.setGroupName(users.getGroupName());
+                dxReportDataDto.setUserId(users.getUserId());
+                dxReportDataDto.setUserName(users.getUserName());
+                dxReportDataDto.setUserName(users.getUserName());
+                dxReportDataDto.setZgdUserId(users.getZgdUserId());
+                dxReportDataDto.setZzdUserId(users.getZzdUserId());
+                dxReportDataDto.setDxUserId(users.getDxUserId());
+                dxReportDataDto.setDateTime(dxReportDataDto.getDateTime());
                 if(dxReportDataDto.getDxUserId()==null){
                     dxReportDataDto.setExhaleDuration("0");
                     dxReportDataDto.setOutgoingCallsNumber("0");

+ 42 - 0
src/main/resources/mapper/modules/admin/SysTelemarketingWechatDataMapper.xml

@@ -134,4 +134,46 @@
            AND ( t1.id != '9914D1305' and t1.id != '9914D1316' )
            and t1.id = #{userId}
     </select>
+    <select id="findDataList" resultType="com.ydtech.modules.admin.model.dto.DxReportDataDto">
+
+    SELECT
+    DATE_ADD(#{vo.beginDate}, INTERVAL seq.seq DAY) AS dateTime
+    FROM (
+    SELECT (t3.num*100 + t2.num*10 + t1.num) AS seq
+    FROM (SELECT 0 AS num UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) AS t1,
+    (SELECT 0 AS num UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) AS t2,
+    (SELECT 0 AS num UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) AS t3
+    ) AS seq
+    WHERE DATE_ADD(#{vo.beginDate}, INTERVAL seq.seq DAY) &lt;=  #{vo.endDate}  order  BY  DATE_ADD(#{vo.beginDate}, INTERVAL seq.seq DAY)
+    </select>
+
+    <select id="queryDxUserByUserId" resultType="com.ydtech.modules.admin.model.dto.DxReportDataDto">
+        SELECT
+        t1.id AS userId,
+        t1.NAME AS userName,
+        t1.mobile AS mobile,
+        t2.id AS deptId,
+        t2.`name` AS deptName,
+        t5.NAME AS groupName,
+        t5.id AS groupId,
+        zgd.zgd_user_id AS zgdUserId,
+        zzb.zzb_user_id AS zzdUserId,
+        dx.dx_user_id AS dxUserId
+        FROM
+        sys_user t1
+        LEFT JOIN sys_dept t2 ON t1.dept_id = t2.id
+        LEFT JOIN sys_user_link_dx_user_id dx ON t1.id = dx.user_id
+        LEFT JOIN sys_user_link_dept_internal_agent t4 ON t4.user_id = t1.id
+        LEFT JOIN sys_dept_internal_agent   t5  on t4.sys_dept_internal_agent_id =t5.id
+        LEFT JOIN sys_user_link_zgd_user_id zgd ON t1.id = zgd.user_id
+        LEFT JOIN sys_user_link_zzb_user_id zzb ON t1.id = zzb.user_id
+        WHERE
+        t1.`status` = 1
+        AND t1.dept_id= '9914D13'
+        AND ( t1.id != '9914D1305' and t1.id != '9914D1316' )
+        <if test='userId !=null and userId!="" '>
+            and t1.id = #{userId}
+        </if>
+        order by t1.id
+    </select>
 </mapper>