Commit 55dab5de authored by huagnxiner's avatar huagnxiner

回访报表跟踪统计修改权限

parent 8c2c2eaa
...@@ -3594,29 +3594,28 @@ public class StatisticController extends BaseController { ...@@ -3594,29 +3594,28 @@ public class StatisticController extends BaseController {
public String callBackTraceStatistic(Integer number, Integer pageSize,Model model, HttpServletRequest request) { public String callBackTraceStatistic(Integer number, Integer pageSize,Model model, HttpServletRequest request) {
UserEntity userEntity = (UserEntity) request.getSession().getAttribute(SessionConstants.THREAD_USER_KEY); UserEntity userEntity = (UserEntity) request.getSession().getAttribute(SessionConstants.THREAD_USER_KEY);
boolean isDirector = user.isDirector(userEntity.getId()); boolean isDirector = user.isDirector(userEntity.getId());
List<DepartmentEntity> departmentEntities = user.getChildDepartList(userEntity.getDeptId()); List<DepartmentEntity> departmentEntities = user.getChildDepartList(userEntity.getDeptId());
//默认返回合肥的数据,只有合肥(deptid=243)需要这个报表
List<DepartmentEntity> hfDepartmentEntityList=new ArrayList<>();
for (DepartmentEntity dep : departmentEntities) {
if(isValidDept(dep.getUrlPath(),"243")){
hfDepartmentEntityList.add(dep);
}
}
departmentEntities.clear();
departmentEntities.addAll(hfDepartmentEntityList);
if (departmentEntities != null && departmentEntities.isEmpty()) { if (departmentEntities != null && departmentEntities.isEmpty()) {
model.addAttribute("departments", departmentEntities); model.addAttribute("departments", departmentEntities);
return getAutoUrl(); return getAutoUrl();
} }
//get user list //get user list
Page page = new Page(pageSize == null ? 20 : pageSize); Page page = new Page(pageSize == null ? 20 : pageSize);
if (null != number) { if (null != number) {
page.setCurrentPage(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 startTime = request.getParameter("startTime");
String endTime = request.getParameter("endTime"); String endTime = request.getParameter("endTime");
...@@ -3636,9 +3635,18 @@ public class StatisticController extends BaseController { ...@@ -3636,9 +3635,18 @@ public class StatisticController extends BaseController {
endTime = endTime + " 23:59:59"; endTime = endTime + " 23:59:59";
} }
if (CollectionUtils.isNotEmpty(departmentEntities)) {
DepartmentEntity dep = departmentEntities.get(0);
String deptId = request.getParameter("deptId") == null ? "" : request.getParameter("deptId");
if (!Strings.isNullOrEmpty(deptId)) {
dep = department.getDepartmentById(Integer.valueOf(deptId)).getEntity();
}
// 获取查询条件
Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_"); Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
UserListResponse ulr = user.getUserListByDept(depet, searchParams, page); UserListResponse ulr = user.getUserListByDept(dep, searchParams, page);
List<UserEntity> userEntities = ulr.getObjectList(); List<UserEntity> userEntities = ulr.getObjectList();
if (searchParams.containsKey("LIKE_realName") && StringUtils.isNotBlank(String.valueOf(searchParams.get("LIKE_realName")))) { if (searchParams.containsKey("LIKE_realName") && StringUtils.isNotBlank(String.valueOf(searchParams.get("LIKE_realName")))) {
if (userEntity.getRealName().contains(searchParams.get("LIKE_realName").toString())) { if (userEntity.getRealName().contains(searchParams.get("LIKE_realName").toString())) {
userEntities.add(userEntity); userEntities.add(userEntity);
...@@ -3682,7 +3690,7 @@ public class StatisticController extends BaseController { ...@@ -3682,7 +3690,7 @@ public class StatisticController extends BaseController {
} else { } else {
vo.setIsClear("0");//0:无客户,1:有客户 vo.setIsClear("0");//0:无客户,1:有客户
} }
LOGGER.info("ManagerVO:"+vo.toString()); LOGGER.info("ManagerVO:" + vo.toString());
managerVOS.add(vo); managerVOS.add(vo);
} }
if (isDirector) { if (isDirector) {
...@@ -3690,11 +3698,21 @@ public class StatisticController extends BaseController { ...@@ -3690,11 +3698,21 @@ public class StatisticController extends BaseController {
} else { } else {
model.addAttribute("isDirector", "0");//0:普通顾问 model.addAttribute("isDirector", "0");//0:普通顾问
} }
model.addAttribute("deptId", depet.getId()); model.addAttribute("deptId", dep.getId());
model.addAttribute("list", managerVOS); model.addAttribute("list", managerVOS);
model.addAttribute("page", page); model.addAttribute("page", page);
model.addAttribute("department", depet); model.addAttribute("departments", departmentEntities);
model.addAttribute("searchParams", Servlets.encodeParameterStringWithPrefix(searchParams, "search_")); model.addAttribute("searchParams", Servlets.encodeParameterStringWithPrefix(searchParams, "search_"));
return getAutoUrl(); return getAutoUrl();
} }
return getAutoUrl();
}
/**
* 判断该部门是否包含对于部门
*/
private boolean isValidDept(String urlPath,String dept){
Set<String> set=new HashSet<>();
set.addAll(Arrays.asList(urlPath.trim().split("/")));
return set.contains(dept);
}
} }
...@@ -68,9 +68,11 @@ ...@@ -68,9 +68,11 @@
<li> <li>
<a tabindex="-1" href="${ctx}/statistic/cloudCusReport/">云迹数据统计表</a> <a tabindex="-1" href="${ctx}/statistic/cloudCusReport/">云迹数据统计表</a>
</li> </li>
<shiro:hasPermission name="CBTS">
<li> <li>
<a tabindex="-1" href="${ctx}/statistic/callBackTraceStatistic/">回访跟进统计</a> <a tabindex="-1" href="${ctx}/statistic/callBackTraceStatistic/">回访跟进统计</a>
</li> </li>
</shiro:hasPermission>
</ul> </ul>
</li> </li>
</shiro:hasPermission> </shiro:hasPermission>
......
...@@ -21,8 +21,29 @@ ...@@ -21,8 +21,29 @@
<div class="page-container"> <div class="page-container">
<div class="row${fluid}"> <div class="row${fluid}">
<c:choose>
<c:when test="${departments!= null && fn:length(departments) == 0}">
<div style="width: 90%;height: 40%;text-align: center;font-size: larger;margin-top: 30px;">名下暂无置业顾问数据
</div>
</c:when>
<c:otherwise>
<form id="filterForm" name="filterForm" class="form-inline filterForm" <form id="filterForm" name="filterForm" class="form-inline filterForm"
action="${ctx}/statistic/callBackTraceStatistic" method="get"> action="${ctx}/statistic/callBackTraceStatistic" method="get">
<c:forEach items="${departments}" var="dept">
<li <c:if test="${dept.id == deptId}">class="active"</c:if>>
<c:choose>
<c:when test="${dept.id == deptId}">
<a href="#">${dept.name}</a>
</c:when>
<c:when test="${dept.id != deptId}">
<a href="${ctx}/statistic/callBackTraceStatistic?deptId=${dept.id}&pageSize=${param['pageSize']}">${dept.name}</a>
</c:when>
<c:otherwise>
</c:otherwise>
</c:choose>
</li>
</c:forEach>
<div style="margin-top:10px;"> <div style="margin-top:10px;">
&nbsp;&nbsp;数据日期:&nbsp;&nbsp; &nbsp;&nbsp;数据日期:&nbsp;&nbsp;
<input type="text" name="startTime" id="startTime" value="${startTime}" <input type="text" name="startTime" id="startTime" value="${startTime}"
...@@ -32,7 +53,8 @@ ...@@ -32,7 +53,8 @@
&nbsp;&nbsp; &nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" placeholder="搜索置业顾问" name="search_LIKE_realName" value="${param['search_LIKE_realName']}"> <input type="text" placeholder="搜索置业顾问" name="search_LIKE_realName"
value="${param['search_LIKE_realName']}">
<div class="inputSearch__btn" onclick="$('#filterForm').submit();" <div class="inputSearch__btn" onclick="$('#filterForm').submit();"
style="display: inline-block; position: relative; top: 9px;left: 5px;" style="display: inline-block; position: relative; top: 9px;left: 5px;"
></div> ></div>
...@@ -41,12 +63,6 @@ ...@@ -41,12 +63,6 @@
<input type="hidden" name="deptId" id="deptId" value="${deptId}"> <input type="hidden" name="deptId" id="deptId" value="${deptId}">
<input type="hidden" name="pageSize" id="pageSize" value="${param['pageSize']}"> <input type="hidden" name="pageSize" id="pageSize" value="${param['pageSize']}">
</form> </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:choose>
<c:when test="${list!= null && fn:length(list) == 0}"> <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 style="width: 90%;height: 40%;text-align: center;font-size: larger;margin-top: 30px;">
...@@ -56,7 +72,6 @@ ...@@ -56,7 +72,6 @@
<c:otherwise> <c:otherwise>
<table class="table table-advance table-hover"> <table class="table table-advance table-hover">
<tbody> <tbody>
<c:forEach items="${list}" var="user" varStatus="n"> <c:forEach items="${list}" var="user" varStatus="n">
<c:choose> <c:choose>
<c:when test="${n.index % 2!=0 && user.star=='off'}"> <c:when test="${n.index % 2!=0 && user.star=='off'}">
...@@ -130,7 +145,6 @@ ...@@ -130,7 +145,6 @@
</td> </td>
</tr> </tr>
</c:forEach> </c:forEach>
</tbody> </tbody>
</table> </table>
<div class="row${fluid}"> <div class="row${fluid}">
...@@ -138,11 +152,9 @@ ...@@ -138,11 +152,9 @@
</div> </div>
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
</div> </div>
</div> </div>
<input type="hidden" value="${queryUser}" name="queryUser" id="queryUser"> <input type="hidden" value="${queryUser}" name="queryUser" id="queryUser">
......
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