Commit 3079ace7 authored by huagnxiner's avatar huagnxiner

添加回访统计代码以及放开crm拉取99客户

parent d54ae4a9
...@@ -33,6 +33,12 @@ public class ManagerVO { ...@@ -33,6 +33,12 @@ public class ManagerVO {
String callYesterday; String callYesterday;
String allCallToday; String allCallToday;
String allCallYesterday; String allCallYesterday;
//回访客户数
String callCount;
//云迹派工数
String cloudSent;
//云迹数据待回访数
String cloudWait;
public String getIsClear() { public String getIsClear() {
return isClear; return isClear;
...@@ -145,4 +151,28 @@ public class ManagerVO { ...@@ -145,4 +151,28 @@ public class ManagerVO {
public void setAllCallYesterday(String allCallYesterday) { public void setAllCallYesterday(String allCallYesterday) {
this.allCallYesterday = allCallYesterday; this.allCallYesterday = allCallYesterday;
} }
public String getCallCount() {
return callCount;
}
public void setCallCount(String callCount) {
this.callCount = callCount;
}
public String getCloudSent() {
return cloudSent;
}
public void setCloudSent(String cloudSent) {
this.cloudSent = cloudSent;
}
public String getCloudWait() {
return cloudWait;
}
public void setCloudWait(String cloudWait) {
this.cloudWait = cloudWait;
}
} }
...@@ -251,10 +251,10 @@ public class CrmSourceController extends BaseController { ...@@ -251,10 +251,10 @@ public class CrmSourceController extends BaseController {
String[] choseIdArray = choseIds.split(","); String[] choseIdArray = choseIds.split(",");
Set choseIdsSet = new HashSet(); Set choseIdsSet = new HashSet();
Collections.addAll(choseIdsSet, choseIdArray); Collections.addAll(choseIdsSet, choseIdArray);
//南京站新需求 过滤400来电562 和房博士im咨询99 //南京站新需求 过滤400来电562 和房博士im咨询99 //CRM已经限制,全链条无需限制
if (CollectionUtils.isNotEmpty(models) && "nj".equals(city)) { // if (CollectionUtils.isNotEmpty(models) && "nj".equals(city)) {
models.removeIf(m -> m.getSourceId() == 99 || m.getSourceId() == 562); // models.removeIf(m -> m.getSourceId() == 99 || m.getSourceId() == 562);
} // }
JSONArray sources = new JSONArray(); JSONArray sources = new JSONArray();
for (CrmSourceEntity model : models) { for (CrmSourceEntity model : models) {
JSONObject source = new JSONObject(); JSONObject source = new JSONObject();
......
...@@ -11,6 +11,7 @@ import com.house365.beans.po.ProjectSrouceRePo; ...@@ -11,6 +11,7 @@ import com.house365.beans.po.ProjectSrouceRePo;
import com.house365.beans.system.Page; import com.house365.beans.system.Page;
import com.house365.beans.system.QueryParams; import com.house365.beans.system.QueryParams;
import com.house365.beans.vo.LocalReportFormVo; import com.house365.beans.vo.LocalReportFormVo;
import com.house365.beans.vo.ManagerVO;
import com.house365.beans.vo.ReportMarketingFormVo; import com.house365.beans.vo.ReportMarketingFormVo;
import com.house365.web.system.controller.BaseController; import com.house365.web.system.controller.BaseController;
import com.house365.web.util.*; import com.house365.web.util.*;
...@@ -92,6 +93,14 @@ public class StatisticController extends BaseController { ...@@ -92,6 +93,14 @@ public class StatisticController extends BaseController {
@Autowired @Autowired
private ICloudActivityInterface activityInterface; private ICloudActivityInterface activityInterface;
@Autowired
private ICustomer customer;
@Autowired
private IUserStar userStar;
@Autowired
private IStatisticReport iStatisticReport;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public static void main(String[] args) { public static void main(String[] args) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyww"); SimpleDateFormat sdf = new SimpleDateFormat("yyyyww");
...@@ -3573,4 +3582,119 @@ public class StatisticController extends BaseController { ...@@ -3573,4 +3582,119 @@ public class StatisticController extends BaseController {
} }
return getAutoUrl(); return getAutoUrl();
} }
/**
* 回访跟进统计
*
* @param model
* @param request
* @return
*/
@RequestMapping(value = "/callBackTraceStatistic")
public String callBackTraceStatistic(Integer number, Integer pageSize,Model model, HttpServletRequest request) {
UserEntity userEntity = (UserEntity) request.getSession().getAttribute(SessionConstants.THREAD_USER_KEY);
boolean isDirector = user.isDirector(userEntity.getId());
List<DepartmentEntity> departmentEntities = user.getChildDepartList(userEntity.getDeptId());
if (departmentEntities != null && departmentEntities.isEmpty()) {
model.addAttribute("departments", departmentEntities);
return getAutoUrl();
}
//get user list
Page page = new Page(pageSize == null ? 20 : pageSize);
if (null != number) {
page.setCurrentPage(number);
}
//默认返回合肥的数据,只有合肥(deptid=243)需要这个报表
DepartmentEntity depet = null;
for (DepartmentEntity dep : departmentEntities) {
if (dep.getId() == 243) {
depet = dep;
}
}
if (depet == null) {
model.addAttribute("department", null);
return getAutoUrl();
}
// 获取查询条件
String startTime = request.getParameter("startTime");
String endTime = request.getParameter("endTime");
model.addAttribute("startTime", startTime);
model.addAttribute("endTime", endTime);
if (StringUtils.isBlank(startTime) && StringUtils.isBlank(endTime)) {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -1);
Date d = cal.getTime();
SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd");
//获取昨天日期
String yesterday = sp.format(d);
startTime = yesterday + " 00:00:00";
endTime = yesterday + " 23:59:59";
} else {
startTime = startTime + " 00:00:00";
endTime = endTime + " 23:59:59";
}
Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
UserListResponse ulr = user.getUserListByDept(depet, searchParams, page);
List<UserEntity> userEntities = ulr.getObjectList();
if (searchParams.containsKey("LIKE_realName") && StringUtils.isNotBlank(String.valueOf(searchParams.get("LIKE_realName")))) {
if (userEntity.getRealName().contains(searchParams.get("LIKE_realName").toString())) {
userEntities.add(userEntity);
}
} else {
userEntities.add(userEntity);
}
page = ulr.getPaging();
//填充数据
List<ManagerVO> managerVOS = new ArrayList<>();
for (UserEntity ue : userEntities) {
ManagerVO vo = new ManagerVO();
vo.setManagerId(ue.getId());
vo.setManagerName(ue.getRealName());
//total:累计客户; waitCount:待回访客户; callCount:回访客户; cloudSent:云迹派工数; cloudWait:云迹数据待回访数
Map<String, Object> map = iStatisticReport.getStatisticSummary(ue.getId().toString(), startTime, endTime);
vo.setTotal(String.valueOf(map.get("allCount")));
vo.setWaitCount(String.valueOf(map.get("waitCount")));
vo.setCallCount(String.valueOf(map.get("callCount")));
vo.setCloudSent(String.valueOf(map.get("cloudSent")));
vo.setCloudWait(String.valueOf(map.get("cloudWait")));
Map<String, Object> search = new HashMap<>(10);
search.put("EQ_starUserId", ue.getId());
search.put("EQ_userId", userEntity.getId());
UserStarListRequest cul = new UserStarListRequest();
cul.setPaging(new Page(1));
cul.setSearchParams(search);
UserStarListResponse res = userStar.getUserStarList(cul);
if (res.getObjectList() != null && !res.getObjectList().isEmpty()) {
UserStarEntity entity = res.getObjectList().get(0);
vo.setStar(entity.getStar() == 1 ? "on" : "off");
} else {
vo.setStar("off");
}
Map<String, Object> managerIdMap = new HashMap<>(10);
managerIdMap.put("managerId", ue.getId());
Integer customers = customer.getCustomersById(managerIdMap);
if (customers > 0) {
vo.setIsClear("1");//0:无客户,1:有客户
} else {
vo.setIsClear("0");//0:无客户,1:有客户
}
managerVOS.add(vo);
}
if (isDirector) {
model.addAttribute("isDirector", "1");//1:是主管
} else {
model.addAttribute("isDirector", "0");//0:普通顾问
}
model.addAttribute("deptId", depet.getId());
model.addAttribute("list", managerVOS);
model.addAttribute("page", page);
// model.addAttribute("departments", departmentEntities);
model.addAttribute("department", depet);
model.addAttribute("searchParams", Servlets.encodeParameterStringWithPrefix(searchParams, "search_"));
return getAutoUrl();
}
} }
...@@ -402,5 +402,9 @@ ...@@ -402,5 +402,9 @@
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--根据经纪人获取统计信息接口-->
<dubbo:reference id="StatisticReport" interface="com.house365.ws.interfaces.server.IStatisticReport"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
</beans> </beans>
...@@ -398,5 +398,10 @@ ...@@ -398,5 +398,10 @@
<dubbo:reference id="getHeadImgByUserId" interface="com.house365.ws.interfaces.rest.IGetHeadImgByUserId" <dubbo:reference id="getHeadImgByUserId" interface="com.house365.ws.interfaces.rest.IGetHeadImgByUserId"
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--根据经纪人获取统计信息接口-->
<dubbo:reference id="StatisticReport" interface="com.house365.ws.interfaces.server.IStatisticReport"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
</beans> </beans>
...@@ -398,5 +398,10 @@ ...@@ -398,5 +398,10 @@
<dubbo:reference id="getHeadImgByUserId" interface="com.house365.ws.interfaces.rest.IGetHeadImgByUserId" <dubbo:reference id="getHeadImgByUserId" interface="com.house365.ws.interfaces.rest.IGetHeadImgByUserId"
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--根据经纪人获取统计信息接口-->
<dubbo:reference id="StatisticReport" interface="com.house365.ws.interfaces.server.IStatisticReport"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
</beans> </beans>
...@@ -68,6 +68,9 @@ ...@@ -68,6 +68,9 @@
<li> <li>
<a tabindex="-1" href="${ctx}/statistic/cloudCusReport/">云迹数据统计表</a> <a tabindex="-1" href="${ctx}/statistic/cloudCusReport/">云迹数据统计表</a>
</li> </li>
<%-- <li>--%>
<%-- <a tabindex="-1" href="${ctx}/statistic/callBackTraceStatistic/">回访跟进统计</a>--%>
<%-- </li>--%>
</ul> </ul>
</li> </li>
</shiro:hasPermission> </shiro:hasPermission>
......
<%@include file="/WEB-INF/common/layouts/common.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<html>
<head>
<title>回访跟进统计</title>
</head>
<body>
<!-- 面包屑 begin -->
<div class="row-fluid">
<div class="span12">
<ul class="breadcrumb">
<li><a href="/house365-hgs-web/">首页</a>
<span class="divider" style="color:#26a0da;font-weight:bold;"> / </span>统计与分析
<span class="divider" style="color:#26a0da;font-weight:bold;"> / </span>回访跟进统计
</li>
</ul>
</div>
</div>
<div class="page-container">
<div class="row${fluid}">
<form id="filterForm" name="filterForm" class="form-inline filterForm"
action="${ctx}/statistic/callBackTraceStatistic" method="get">
<div style="margin-top:10px;">
&nbsp;&nbsp;数据日期:&nbsp;&nbsp;
<input type="text" name="startTime" id="startTime" class="m-wrap small mydate span2" placeholder="起始时间">
<input type="text" name="endTime" id="endTime" class="m-wrap small mydate span2" placeholder="截止时间">
&nbsp;&nbsp;
<%-- <a class="btn " onclick="btnSubmit();">提交</a>--%>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" placeholder="搜索置业顾问" name="search_LIKE_realName" value="${param['search_LIKE_realName']}">
<div class="inputSearch__btn" onclick="$('#filterForm').submit();"></div>
</div>
<input type="hidden" name="deptId" id="deptId" value="${deptId}">
<input type="hidden" name="pageSize" id="pageSize" value="${param['pageSize']}">
</form>
<c:choose>
<c:when test="${department== null}">
<div style="width: 90%;height: 40%;text-align: center;font-size: larger;margin-top: 30px;">名下暂无安家顾问数据</div>
</c:when>
<c:otherwise>
<c:choose>
<c:when test="${list!= null && fn:length(list) == 0}">
<div style="width: 90%;height: 40%;text-align: center;font-size: larger;margin-top: 30px;">
暂无置业顾问数据
</div>
</c:when>
<c:otherwise>
<table class="table table-advance table-hover">
<tbody>
<c:forEach items="${list}" var="user" varStatus="n">
<c:choose>
<c:when test="${n.index % 2!=0 && user.star=='off'}">
<c:set var="bgc" value="style='background-color:#ddd;'"/>
</c:when>
<c:when test="${user.star=='on'}">
<c:set var="bgc" value="style='background-color: #FFEB3B;'"/>
</c:when>
<c:otherwise>
<c:set var="bgc" value=""/>
</c:otherwise>
</c:choose>
<tr class="header expand" ${bgc}>
<td class="mangerId mangerItem" style="width: 130px;">
<div class="mangerItem__border"></div>
<span class="mangerId_num">${user.managerId}</span>
</td>
<td class="mangerName mangerItem" style="width: 130px;">
<div class="mangerItem__border"></div>
${user.managerName}
</td>
<td class="mangerItem doub" style="width: 130px;">
<div class="mangerItem__border"></div>
<div class="mangerItem__up">${user.total}</div>
<div class="mangerItem__down">累计客户</div>
</td>
<td class="mangerItem doub" style="width: 130px;">
<div class="mangerItem__border"></div>
<div class="mangerItem__up">${user.waitCount}</div>
<div class="mangerItem__down">待回访客户</div>
</td>
<td class="mangerItem doub" style="width: 130px;">
<div class="mangerItem__border"></div>
<div class="mangerItem__up">${user.callCount}</div>
<div class="mangerItem__down">回访客户</div>
</td>
<td class="mangerItem doub" style="width: 130px;">
<div class="mangerItem__border"></div>
<div class="mangerItem__up">${user.cloudSent}</div>
<div class="mangerItem__down">云迹派工数</div>
</td>
<td class="mangerItem doub" style="width: 130px;">
<div class="mangerItem__border"></div>
<div class="mangerItem__up">${user.cloudWait}</div>
<div class="mangerItem__down">云迹数据待回访数</div>
</td>
<td class="mangerItem mangerCollect ${user.star}"
onclick="toggleCollect(this,'${user.managerId}')">
<div class="mangerItem__border"></div>
</td>
<c:if test="${isDirector eq 1}">
<td class="mangerItem">
<a href="#">
<div class="mangerItem__detail"
onclick="clearCustomerByManagerId('${user.managerId}', '${user.managerName}' ,${user.isClear})">
清空客户
</div>
</a>
</td>
</c:if>
<td class="mangerItem">
<a href="#">
<div class="mangerItem__detail"
onclick="window.open('${ctx}/customermanagement/myCustomerNew?managerId=${user.managerId}');">
查看详情
</div>
</a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="row${fluid}">
<house365:newPagination page="${page}"/>
</div>
</c:otherwise>
</c:choose>
</c:otherwise>
</c:choose>
</div>
</div>
<input type="hidden" value="${queryUser}" name="queryUser" id="queryUser">
<link rel="stylesheet" href="${static_common }/script/bootstrap/css/bootstrap-multiselect.css" type="text/css">
<script type="text/javascript" src="${static_common }/script/bootstrap/js/bootstrap-multiselect.js"></script>
<script src="${ctx}/resources/script/echarts/echarts.min.js"></script>
<script language="javascript" type="text/javascript"
src="${ctx}/resources/script/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var timeStart = "${startTime}";
var timeEnd = "${endTime}";
if (timeEnd == '' && timeStart == '') {
$(".mydate").unbind("focus");
$(".mydate").bind("focus", function () {
WdatePicker({dateFmt: 'yyyy-MM-dd', maxDate: '%y-%M-{%d}'});
});
setTime();
} else {
$("#startTime").val(timeStart);
$("#endTime").val(timeEnd);
}
});
function btnSubmit() {
$('#filterForm').submit();
}
function setTime() {
var startTime = $("#startTime");
var endTime = $("#endTime");
if (startTime.val() == '') {
startTime.val(getYesterday());
}
if (endTime.val() == '') {
endTime.val(getYesterday());
}
}
$(document).keydown(function (event) {
if (event.keyCode == "13") {
//回车执行查询
$('#filterForm').submit();
}
})
var clearCustomerByManagerId = function (managerId, managerName, isClear) {
if(isClear == 0){
alert("名下暂无客户");
return false;
}else{
House365Util.createModal("清空客户", "确认后所有客户将被移入公海,请谨慎操作!", function () {
$.ajax({
url: '${ctx}/manager/clearCustomerByManagerId',
data: {"managerId": managerId, "managerName": managerName},
success: function (data) {
if (data.flag == '1') {
window.location.reload();
} else {
alert("清空失败,");
}
window.location.reload();
}
});
});
}
};
function toggleCollect(_this, starUserId) {
//收藏
var flag = "off";
if ($(_this).hasClass('on')) {
$(_this).removeClass('on');
$(_this).closest("tr").css("background-color", "#fff");
} else {
flag = "on";
$(_this).addClass('on');
$(_this).closest("tr").css("background-color", "#FFEB3B");
}
$.ajax({
url: "${ctx}/manager/starToggle",
data: {flag: flag, 'starUserId': starUserId},
success: function (data) {
}
});
}
</script>
</body>
</html>
/**
* Description: AppBrand业务接口
* Copyright: Copyright (c)2016
* Company: 江苏三六五网络股份有限公司
*
* @author: 江苏三六五网络股份有限公司
* @version: 1.0
* Create at: 2016-06-27 下午 13:16:36
* <p>
* Modification History:
* Date Author Version Description
* ------------------------------------------------------------------
* 2016-06-27 江苏三六五网络股份有限公司 1.0 Initial
*/
package com.house365.ws.interfaces.server;
import java.util.Map;
/**
* AppBrand业务接口<br>
*
* @author 江苏三六五网络股份有限公司
* @version 1.0, 2016-06-27
* @see
* @since 1.0
*/
public interface IStatisticReport{
Map<String, Object> getStatisticSummary(String managerId,String startTime,String endTime);
}
package com.house365.ws.dao.mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Map;
/**
* @author Created by Administrator on 2019/1/9.
*/
@Repository
public interface StatisticReportMapper {
Map<String, Object> getStatisticSummary(@Param("managerId") String managerId, @Param("startTime")String startTime, @Param("endTime")String endTime);
}
package com.house365.ws.interfaces.impl;
import com.house365.ws.dao.mapper.StatisticReportMapper;
import com.house365.ws.interfaces.server.IStatisticReport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* @author huang xiner
* @version 1.0
* @date 2021/11/11 17:35
*/
@Service("StatisticReport")
public class StatisticReportImpl implements IStatisticReport {
private static final Logger logger = LoggerFactory.getLogger(StatisticReportImpl.class);
@Autowired
private StatisticReportMapper statisticReportMapper;
@Override
public Map<String, Object> getStatisticSummary(String managerId,String startTime,String endTime) {
return statisticReportMapper.getStatisticSummary(managerId,startTime,endTime);
}
}
...@@ -397,5 +397,9 @@ ...@@ -397,5 +397,9 @@
<dubbo:service ref="getHeadImgByUserId" interface="com.house365.ws.interfaces.rest.IGetHeadImgByUserId" <dubbo:service ref="getHeadImgByUserId" interface="com.house365.ws.interfaces.rest.IGetHeadImgByUserId"
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--根据经纪人获取统计信息接口-->
<dubbo:service ref="StatisticReport" interface="com.house365.ws.interfaces.server.IStatisticReport"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
</beans> </beans>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.house365.ws.dao.mapper.StatisticReportMapper">
<!-- <select id="getStatisticSummary" resultType="java.util.HashMap">-->
<!-- <![CDATA[-->
<!-- SELECT (-->
<!-- SELECT FORMAT(count(distinct id),0) from customer as c where STATUS in(11,0,99) and isWaitCall = 1 and c.is_delete = 0 and (manager_id in ($managerId$))) as waitCount,-->
<!-- (SELECT FORMAT(count(distinct id),0) from customer as c where STATUS in(11,0,99) and (manager_id in ($managerId$))) as allCount,-->
<!-- (select FORMAT(count(distinct id),0) from customer as c join ( SELECT l.customer_id FROM customer_callback_log l where TIMESTAMPDIFF(DAY,date_format(create_time,'%y-%m-%d'),date_format(CURDATE(),'%y-%m-%d'))=0 and l.source = 1 and l.call_record_id is not null) d on c.id=d.customer_id and c.is_delete = 0 and (c.manager_id in ($managerId$))) as callToday,-->
<!-- (select FORMAT(count(distinct id),0) from customer as c join ( SELECT l.customer_id FROM customer_callback_log l where TIMESTAMPDIFF(DAY,date_format(create_time,'%y-%m-%d'),date_format(CURDATE(),'%y-%m-%d'))=1 and l.source = 1 and l.call_record_id is not null) d on c.id=d.customer_id and c.is_delete = 0 and (c.manager_id in ($managerId$))) as callYesterday,-->
<!-- (select FORMAT(count(distinct id),0) from customer as c join ( SELECT l.customer_id FROM customer_callback_log l where TIMESTAMPDIFF(DAY,date_format(create_time,'%y-%m-%d'),date_format(CURDATE(),'%y-%m-%d'))=0 ) d on c.id=d.customer_id and c.is_delete = 0 and (c.manager_id in ($managerId$))) as allCallToday,-->
<!-- (select FORMAT(count(distinct id),0) from customer as c join ( SELECT l.customer_id FROM customer_callback_log l where TIMESTAMPDIFF(DAY,date_format(create_time,'%y-%m-%d'),date_format(CURDATE(),'%y-%m-%d'))=1 ) d on c.id=d.customer_id and c.is_delete = 0 and (c.manager_id in ($managerId$))) as allCallYesterday-->
<!-- ]]>-->
<!-- </select>-->
<select id="getStatisticSummary" resultType="java.util.HashMap">
<![CDATA[
SELECT(
SELECT FORMAT(count(id),0) from customer_merge as c where c.is_delete = 0 AND c.STATUS in(11,0,99) and manager_id = #{managerId}
and c.create_time>=#{startTime} and c.create_time<=#{endTime} and (c.isWaitCall=0 OR c.isWaitCall IS NULL)) as allCount,
(SELECT FORMAT(count(id),0) from customer as c where c.STATUS in(11,0,99) and isWaitCall = 1 and c.is_delete = 0 and manager_id = #{managerId}
and c.create_time>=#{startTime} and c.create_time<=#{endTime}) as waitCount,
(SELECT FORMAT(count(id),0) FROM customer_merge c inner join (select customer_id,count((substr(ccl.manager_name,1,5)!='CRM用户' and ccl.manager_id!=0) or null) as count
from customer_callback_log ccl group by customer_id having count>0) n on c.id=n.customer_id where 1=1
and manager_id = #{managerId} and c.create_time>=#{startTime} and c.create_time<=#{endTime}
AND c.last_call_time is not null AND c.is_delete = 0 AND c.STATUS IN ( 11, 0, 99)
AND ( c.isWaitCall = 0 OR c.isWaitCall IS NULL)) as callCount,
(SELECT FORMAT(count(id),0) from customer_merge as c where c.is_delete = 0 and manager_id = #{managerId}
and c.create_time>=#{startTime} and c.create_time<=#{endTime} and (c.isWaitCall = 0 OR c.isWaitCall IS NULL)
AND c.STATUS IN ( 11, 0, 99 ) and c.customer_source_type=7) as cloudSent,
(select FORMAT(count(id),0) FROM customer_merge c inner join (select m.customer_id from customer_callback_log m inner join
(select customer_id,count(*) as count from customer_callback_log group by customer_id) n
on n.count=1 and m.customer_id=n.customer_id and m.manager_id=0) c2 on c.id=c2.customer_id
where 1=1 AND c.is_delete = 0 and manager_id = #{managerId} and c.create_time>=#{startTime} and c.create_time<=#{endTime}
AND c.STATUS IN ( 11, 0, 99 ) and c.customer_source_type=7) as cloudWait
]]>
</select>
</mapper>
\ No newline at end of file
...@@ -389,4 +389,9 @@ ...@@ -389,4 +389,9 @@
<dubbo:service ref="getHeadImgByUserId" interface="com.house365.ws.interfaces.rest.IGetHeadImgByUserId" <dubbo:service ref="getHeadImgByUserId" interface="com.house365.ws.interfaces.rest.IGetHeadImgByUserId"
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--根据经纪人获取统计信息接口-->
<dubbo:service ref="StatisticReport" interface="com.house365.ws.interfaces.server.IStatisticReport"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
</beans> </beans>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.house365.ws.dao.mapper.StatisticReportMapper">
<!-- <select id="getStatisticSummary" resultType="java.util.HashMap">-->
<!-- <![CDATA[-->
<!-- SELECT (-->
<!-- SELECT FORMAT(count(distinct id),0) from customer as c where STATUS in(11,0,99) and isWaitCall = 1 and c.is_delete = 0 and (manager_id in ($managerId$))) as waitCount,-->
<!-- (SELECT FORMAT(count(distinct id),0) from customer as c where STATUS in(11,0,99) and (manager_id in ($managerId$))) as allCount,-->
<!-- (select FORMAT(count(distinct id),0) from customer as c join ( SELECT l.customer_id FROM customer_callback_log l where TIMESTAMPDIFF(DAY,date_format(create_time,'%y-%m-%d'),date_format(CURDATE(),'%y-%m-%d'))=0 and l.source = 1 and l.call_record_id is not null) d on c.id=d.customer_id and c.is_delete = 0 and (c.manager_id in ($managerId$))) as callToday,-->
<!-- (select FORMAT(count(distinct id),0) from customer as c join ( SELECT l.customer_id FROM customer_callback_log l where TIMESTAMPDIFF(DAY,date_format(create_time,'%y-%m-%d'),date_format(CURDATE(),'%y-%m-%d'))=1 and l.source = 1 and l.call_record_id is not null) d on c.id=d.customer_id and c.is_delete = 0 and (c.manager_id in ($managerId$))) as callYesterday,-->
<!-- (select FORMAT(count(distinct id),0) from customer as c join ( SELECT l.customer_id FROM customer_callback_log l where TIMESTAMPDIFF(DAY,date_format(create_time,'%y-%m-%d'),date_format(CURDATE(),'%y-%m-%d'))=0 ) d on c.id=d.customer_id and c.is_delete = 0 and (c.manager_id in ($managerId$))) as allCallToday,-->
<!-- (select FORMAT(count(distinct id),0) from customer as c join ( SELECT l.customer_id FROM customer_callback_log l where TIMESTAMPDIFF(DAY,date_format(create_time,'%y-%m-%d'),date_format(CURDATE(),'%y-%m-%d'))=1 ) d on c.id=d.customer_id and c.is_delete = 0 and (c.manager_id in ($managerId$))) as allCallYesterday-->
<!-- ]]>-->
<!-- </select>-->
<select id="getStatisticSummary" resultType="java.util.HashMap">
<![CDATA[
SELECT(
SELECT FORMAT(count(id),0) from customer_merge as c where c.is_delete = 0 AND c.STATUS in(11,0,99) and manager_id = #{managerId}
and c.create_time>=#{startTime} and c.create_time<=#{endTime} and (c.isWaitCall=0 OR c.isWaitCall IS NULL)) as allCount,
(SELECT FORMAT(count(id),0) from customer as c where c.STATUS in(11,0,99) and isWaitCall = 1 and c.is_delete = 0 and manager_id = #{managerId}
and c.create_time>=#{startTime} and c.create_time<=#{endTime}) as waitCount,
(SELECT FORMAT(count(id),0) FROM customer_merge c inner join (select customer_id,count((substr(ccl.manager_name,1,5)!='CRM用户' and ccl.manager_id!=0) or null) as count
from customer_callback_log ccl group by customer_id having count>0) n on c.id=n.customer_id where 1=1
and manager_id = #{managerId} and c.create_time>=#{startTime} and c.create_time<=#{endTime}
AND c.last_call_time is not null AND c.is_delete = 0 AND c.STATUS IN ( 11, 0, 99)
AND ( c.isWaitCall = 0 OR c.isWaitCall IS NULL)) as callCount,
(SELECT FORMAT(count(id),0) from customer_merge as c where c.is_delete = 0 and manager_id = #{managerId}
and c.create_time>=#{startTime} and c.create_time<=#{endTime} and (c.isWaitCall = 0 OR c.isWaitCall IS NULL)
AND c.STATUS IN ( 11, 0, 99 ) and c.customer_source_type=7) as cloudSent,
(select FORMAT(count(id),0) FROM customer_merge c inner join (select m.customer_id from customer_callback_log m inner join
(select customer_id,count(*) as count from customer_callback_log group by customer_id) n
on n.count=1 and m.customer_id=n.customer_id and m.manager_id=0) c2 on c.id=c2.customer_id
where 1=1 AND c.is_delete = 0 and manager_id = #{managerId} and c.create_time>=#{startTime} and c.create_time<=#{endTime}
AND c.STATUS IN ( 11, 0, 99 ) and c.customer_source_type=7) as cloudWait
]]>
</select>
</mapper>
\ No newline at end of file
...@@ -399,4 +399,9 @@ ...@@ -399,4 +399,9 @@
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--根据经纪人获取统计信息接口-->
<dubbo:service ref="StatisticReport" interface="com.house365.ws.interfaces.server.IStatisticReport"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
</beans> </beans>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.house365.ws.dao.mapper.StatisticReportMapper">
<!-- <select id="getStatisticSummary" resultType="java.util.HashMap">-->
<!-- <![CDATA[-->
<!-- SELECT (-->
<!-- SELECT FORMAT(count(distinct id),0) from customer as c where STATUS in(11,0,99) and isWaitCall = 1 and c.is_delete = 0 and (manager_id in ($managerId$))) as waitCount,-->
<!-- (SELECT FORMAT(count(distinct id),0) from customer as c where STATUS in(11,0,99) and (manager_id in ($managerId$))) as allCount,-->
<!-- (select FORMAT(count(distinct id),0) from customer as c join ( SELECT l.customer_id FROM customer_callback_log l where TIMESTAMPDIFF(DAY,date_format(create_time,'%y-%m-%d'),date_format(CURDATE(),'%y-%m-%d'))=0 and l.source = 1 and l.call_record_id is not null) d on c.id=d.customer_id and c.is_delete = 0 and (c.manager_id in ($managerId$))) as callToday,-->
<!-- (select FORMAT(count(distinct id),0) from customer as c join ( SELECT l.customer_id FROM customer_callback_log l where TIMESTAMPDIFF(DAY,date_format(create_time,'%y-%m-%d'),date_format(CURDATE(),'%y-%m-%d'))=1 and l.source = 1 and l.call_record_id is not null) d on c.id=d.customer_id and c.is_delete = 0 and (c.manager_id in ($managerId$))) as callYesterday,-->
<!-- (select FORMAT(count(distinct id),0) from customer as c join ( SELECT l.customer_id FROM customer_callback_log l where TIMESTAMPDIFF(DAY,date_format(create_time,'%y-%m-%d'),date_format(CURDATE(),'%y-%m-%d'))=0 ) d on c.id=d.customer_id and c.is_delete = 0 and (c.manager_id in ($managerId$))) as allCallToday,-->
<!-- (select FORMAT(count(distinct id),0) from customer as c join ( SELECT l.customer_id FROM customer_callback_log l where TIMESTAMPDIFF(DAY,date_format(create_time,'%y-%m-%d'),date_format(CURDATE(),'%y-%m-%d'))=1 ) d on c.id=d.customer_id and c.is_delete = 0 and (c.manager_id in ($managerId$))) as allCallYesterday-->
<!-- ]]>-->
<!-- </select>-->
<select id="getStatisticSummary" resultType="java.util.HashMap">
<![CDATA[
SELECT(
SELECT FORMAT(count(id),0) from customer_merge as c where c.is_delete = 0 AND c.STATUS in(11,0,99) and manager_id = #{managerId}
and c.create_time>=#{startTime} and c.create_time<=#{endTime} and (c.isWaitCall=0 OR c.isWaitCall IS NULL)) as allCount,
(SELECT FORMAT(count(id),0) from customer as c where c.STATUS in(11,0,99) and isWaitCall = 1 and c.is_delete = 0 and manager_id = #{managerId}
and c.create_time>=#{startTime} and c.create_time<=#{endTime}) as waitCount,
(SELECT FORMAT(count(id),0) FROM customer_merge c inner join (select customer_id,count((substr(ccl.manager_name,1,5)!='CRM用户' and ccl.manager_id!=0) or null) as count
from customer_callback_log ccl group by customer_id having count>0) n on c.id=n.customer_id where 1=1
and manager_id = #{managerId} and c.create_time>=#{startTime} and c.create_time<=#{endTime}
AND c.last_call_time is not null AND c.is_delete = 0 AND c.STATUS IN ( 11, 0, 99)
AND ( c.isWaitCall = 0 OR c.isWaitCall IS NULL)) as callCount,
(SELECT FORMAT(count(id),0) from customer_merge as c where c.is_delete = 0 and manager_id = #{managerId}
and c.create_time>=#{startTime} and c.create_time<=#{endTime} and (c.isWaitCall = 0 OR c.isWaitCall IS NULL)
AND c.STATUS IN ( 11, 0, 99 ) and c.customer_source_type=7) as cloudSent,
(select FORMAT(count(id),0) FROM customer_merge c inner join (select m.customer_id from customer_callback_log m inner join
(select customer_id,count(*) as count from customer_callback_log group by customer_id) n
on n.count=1 and m.customer_id=n.customer_id and m.manager_id=0) c2 on c.id=c2.customer_id
where 1=1 AND c.is_delete = 0 and manager_id = #{managerId} and c.create_time>=#{startTime} and c.create_time<=#{endTime}
AND c.STATUS IN ( 11, 0, 99 ) and c.customer_source_type=7) as cloudWait
]]>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment