Commit 88a757b6 authored by jay's avatar jay

平台客户需求提交

parent 7b037749
......@@ -9,6 +9,7 @@ import com.house365.web.system.controller.BaseController;
import com.house365.web.util.*;
import com.house365.ws.beans.request.*;
import com.house365.ws.beans.response.*;
import com.house365.ws.beans.util.HResult;
import com.house365.ws.interfaces.server.*;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
......@@ -182,14 +183,47 @@ public class PlatformManagementController extends BaseController {
searchParams.put("EQ_platformCreateSource", "PT");
//过滤公海、跟进中
String eqPlatProjectStatus = String.valueOf(searchParams.get("EQ_platProjectStatus"));
if (eqPlatProjectStatus != null && "7".equals(eqPlatProjectStatus)) {//跟进中
//跟进中
if (eqPlatProjectStatus != null && "7".equals(eqPlatProjectStatus)) {
searchParams.remove("EQ_platProjectStatus");
searchParams.put("EQ_platProjectStatus7", "7");
}
if (eqPlatProjectStatus != null && "8".equals(eqPlatProjectStatus)) {//回公海
//回公海
if (eqPlatProjectStatus != null && "8".equals(eqPlatProjectStatus)) {
searchParams.remove("EQ_platProjectStatus");
searchParams.put("EQ_platManager", "8");
}
//添加部门查询
if (searchParams.get("EQ_dept") != null) {
String dept = searchParams.get("EQ_dept").toString();
//查询部门用户
if (org.apache.commons.lang.StringUtils.isNotBlank(dept)) {
Map<String, Object> deptMap = new HashMap<>(5);
if ("1".equals(dept)) {
deptMap.put("likeName", "直销一");
} else if ("2".equals(dept)) {
deptMap.put("likeName", "直销二");
} else if ("3".equals(dept)) {
deptMap.put("likeName", "直销三");
}
List<DepartmentEntity> list = department.queryByCondition(deptMap);
StringBuilder builder = new StringBuilder();
List<Integer> deptList = new ArrayList<>();
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) {
list.forEach(l -> deptList.add(l.getId()));
}
Map<String, Object> userMap = new HashMap<>(5);
userMap.put("deptIdList", deptList);
List<UserEntity> userList = iuser.queryByConditions(userMap);
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(userList)) {
userList.forEach(u -> builder.append(u.getId()).append(","));
String deptManagerId = builder.toString();
deptManagerId = deptManagerId.substring(0, deptManagerId.lastIndexOf(","));
searchParams.put("EQ_deptManagerId", deptManagerId);
}
}
}
CustomerListRequest listRequest = new CustomerListRequest();
listRequest.setPaging(page);
listRequest.setSearchParams(searchParams);
......@@ -228,7 +262,8 @@ public class PlatformManagementController extends BaseController {
//先去查询该客户的所有id
idList = customer.getCustomerIds(customerEntity.getId(), cityCode);
} else {
idList.add(customerEntity);//平台客户回公海
//平台客户回公海
idList.add(customerEntity);
}
//再获取所有id的回访记录
List<Integer> ids = new ArrayList<>();
......@@ -427,7 +462,6 @@ public class PlatformManagementController extends BaseController {
managers = iuser.queryRuleManagers(csMap);
}
model.addAttribute("managers", managers);
//活动来源
model.addAttribute("sources", cslrs.getObjectList());
......@@ -458,15 +492,14 @@ public class PlatformManagementController extends BaseController {
DepartmentResponse departmentResponse = department.getDepartmentById(Integer.valueOf(cityId));
DepartmentEntity city = departmentResponse.getEntity();
CustomerEntity customerEntity = vo.getEntity();
Date newdate = new Date();
Date newDate = new Date();
CustomerRequest cr = new CustomerRequest();
customerEntity.setCreateTime(newdate);
customerEntity.setCreateTime(newDate);
if (!Strings.isNullOrEmpty(customerEntity.getRemark())) {
customerEntity.setLastCallTime(newdate);
customerEntity.setLastCallTime(newDate);
}
customerEntity.setUpdateTime(newdate);
customerEntity.setUpdateTime(newDate);
customerEntity.setCreater(String.valueOf(userEntity.getId()));
// customerEntity.setManagerId();
customerEntity.setIsRecycled(0);
customerEntity.setManagerName(selectedManager);
customerEntity.setCityName(city.getName());
......@@ -477,8 +510,9 @@ public class PlatformManagementController extends BaseController {
customerEntity.setCreateSource("PT");
//修改客户表默认值null改为11
customerEntity.setStatus(Constant.statu);
customerEntity.setBindTime(newdate);
customerEntity.setCustomerSourceType(8);//8:平台导入类型
customerEntity.setBindTime(newDate);
//8:平台导入类型
customerEntity.setCustomerSourceType(8);
CustomerSourceEntity cse = customerSource.getCustomerSourceById(customerEntity.getActSourceId()).getEntity();
customerEntity.setActSource(cse == null ? "" : cse.getSourceName());
cr.setEntity(customerEntity);
......@@ -500,18 +534,18 @@ public class PlatformManagementController extends BaseController {
} else {
mergeCustomerUtil.checkMergeCustomer(customerEntity, oldentity, userEntity.getId(), userEntity.getRealName());
// 意向等级、跟踪状态更新
oldentity.setUpdateTime(newdate);
oldentity.setCreateTime(newdate);
oldentity.setBindTime(newdate);
oldentity.setUpdateTime(newDate);
oldentity.setCreateTime(newDate);
oldentity.setBindTime(newDate);
if (!Strings.isNullOrEmpty(customerEntity.getRemark())) {
oldentity.setLastCallTime(newdate);
oldentity.setLastCallTime(newDate);
}
oldentity.setUpdater(String.valueOf(userEntity.getId()));
customerEntity.setId(oldentity.getId());
customer.updateCustomerMerge(oldentity);
}
if (!Strings.isNullOrEmpty(customerEntity.getRemark())) {
addCallBack(userEntity, String.valueOf(newCustomerEntity.getId()), customerEntity.getRemark(), newdate);
addCallBack(userEntity, String.valueOf(newCustomerEntity.getId()), customerEntity.getRemark(), newDate);
}
model.addAttribute("vo", vo);
......@@ -527,7 +561,7 @@ public class PlatformManagementController extends BaseController {
* @param newdate
* @return
*/
private CustomerCallbackLogResponse addCallBack(UserEntity userEntity, String customerId, String content, Date newdate) {
private void addCallBack(UserEntity userEntity, String customerId, String content, Date newdate) {
CustomerCallbackLogEntity customerCallbackLogEntity = new CustomerCallbackLogEntity();
customerCallbackLogEntity.setCustomerId(Integer.valueOf(customerId));
customerCallbackLogEntity.setContent(content);
......@@ -538,8 +572,7 @@ public class PlatformManagementController extends BaseController {
CustomerCallbackLogRequest callRequest = new CustomerCallbackLogRequest();
callRequest.setEntity(customerCallbackLogEntity);
CustomerCallbackLogResponse response = customerCallbackLog.addCustomerCallbackLog(callRequest);
return response;
customerCallbackLog.addCustomerCallbackLog(callRequest);
}
/**
......@@ -642,7 +675,7 @@ public class PlatformManagementController extends BaseController {
model.addAttribute("backToSeaDate", backToSeaDate);
//查询客户日志
Map<String, Object> map = new HashMap<>(10);
List<CustomerLogEntity> list = new ArrayList<>();
List<CustomerLogEntity> list;
if (StringUtils.isEmpty(managerId)) {
map.put("relateId", customerEntity.getId());
list = logInterface.queryByConditions(map);
......@@ -910,4 +943,25 @@ public class PlatformManagementController extends BaseController {
return "success";
}
/**
* 逻辑删除平台客户
*
* @param id 客户id
* @return
*/
@RequestMapping(value = "deleteById/{id}")
@ResponseBody
public HResult deleteById(@PathVariable int id, HttpServletRequest request) {
HResult result = new HResult();
try {
UserEntity userEntity = (UserEntity) request.getSession().getAttribute(SessionConstants.THREAD_USER_KEY);
result = customer.deleteById(id, userEntity.getId(), userEntity.getRealName());
} catch (Exception e) {
e.printStackTrace();
result.setStatus(500);
result.setErrorMessage("删除失败");
}
return result;
}
}
......@@ -220,7 +220,8 @@
padding: 0;
width: 33%;
}
.mangerId_avar2{
.mangerId_avar2 {
overflow: hidden;
width: 75px;
height: 16px;
......@@ -263,63 +264,63 @@
style="border-style: solid;border-width: thin;border-color: #d5d5d5;padding: 20px;margin-bottom: 20px;line-height: 43px;">
<div class="span12">
添加时间: <input style="width: 7rem;border: 1px solid #d5d5d5;" type="text"
name="search_GTE_createTimeStart"
id="search_GTE_createTimeStart" value="${param['search_GTE_createTimeStart']}"
class="m-wrap small span2">
<input style="width: 7rem;margin-left: 15px;border: 1px solid #d5d5d5;" type="text"
name="search_LTE_createTimeEnd"
id="search_LTE_createTimeEnd" value="${param['search_LTE_createTimeEnd']}"
class="m-wrap small span2"
>
<span id="createTimeRecentSeven"
style="cursor: pointer;<c:if test="${'2' eq timePeriod}">color: #30A3DE;</c:if>"
onclick="createTimeClick('2')">近7天</span>&nbsp;&nbsp;
<span id="createTimeRecentThirty"
style="cursor: pointer;<c:if test="${'1' eq timePeriod}">color: #30A3DE;</c:if>"
onclick="createTimeClick('1')">30天</span>&nbsp;&nbsp;
<span id="createTimeAll"
style="cursor: pointer;<c:if test="${'0' eq timePeriod}">color: #30A3DE;</c:if>"
onclick="createTimeClick('0')">全部</span>&nbsp;&nbsp;
&nbsp;&nbsp;
<select style="width: 6rem" name="search_EQ_customTimeType" id="search_EQ_customTimeType">
<option value="1"
<c:if test="${'1' eq param['search_EQ_customTimeType']}">selected="selected"</c:if>>
回访时间
</option>
<option value="2"
<c:if test="${'2' eq param['search_EQ_customTimeType']}">selected="selected"</c:if>>
约看时间
</option>
<option value="3"
<c:if test="${'3' eq param['search_EQ_customTimeType']}">selected="selected"</c:if>>
到访时间
</option>
<option value="4"
<c:if test="${'4' eq param['search_EQ_customTimeType']}">selected="selected"</c:if>>
认筹时间
</option>
<option value="5"
<c:if test="${'5' eq param['search_EQ_customTimeType']}">selected="selected"</c:if>>
认购时间
</option>
<option value="6"
<c:if test="${'6' eq param['search_EQ_customTimeType']}">selected="selected"</c:if>>
签约时间
</option>
</select>
<input style="width: 7rem;border: 1px solid #d5d5d5;" type="text"
name="search_GTE_customTimeStart"
id="search_GTE_customTimeStart" value="${param['search_GTE_customTimeStart']}"
class="m-wrap small span2"
>
<input style="width: 7rem;margin-left: 15px;;border: 1px solid #d5d5d5;" type="text"
name="search_LTE_customTimeEnd"
id="search_LTE_customTimeEnd" value="${param['search_LTE_customTimeEnd']}"
class="m-wrap small span2"
>
添加时间: <input style="width: 7rem;border: 1px solid #d5d5d5;" type="text"
name="search_GTE_createTimeStart"
id="search_GTE_createTimeStart" value="${param['search_GTE_createTimeStart']}"
class="m-wrap small span2">
<input style="width: 7rem;margin-left: 15px;border: 1px solid #d5d5d5;" type="text"
name="search_LTE_createTimeEnd"
id="search_LTE_createTimeEnd" value="${param['search_LTE_createTimeEnd']}"
class="m-wrap small span2"
>
<span id="createTimeRecentSeven"
style="cursor: pointer;<c:if test="${'2' eq timePeriod}">color: #30A3DE;</c:if>"
onclick="createTimeClick('2')">近7天</span>&nbsp;&nbsp;
<span id="createTimeRecentThirty"
style="cursor: pointer;<c:if test="${'1' eq timePeriod}">color: #30A3DE;</c:if>"
onclick="createTimeClick('1')">30天</span>&nbsp;&nbsp;
<span id="createTimeAll"
style="cursor: pointer;<c:if test="${'0' eq timePeriod}">color: #30A3DE;</c:if>"
onclick="createTimeClick('0')">全部</span>&nbsp;&nbsp;
&nbsp;&nbsp;
<select style="width: 6rem" name="search_EQ_customTimeType" id="search_EQ_customTimeType">
<option value="1"
<c:if test="${'1' eq param['search_EQ_customTimeType']}">selected="selected"</c:if>>
回访时间
</option>
<option value="2"
<c:if test="${'2' eq param['search_EQ_customTimeType']}">selected="selected"</c:if>>
约看时间
</option>
<option value="3"
<c:if test="${'3' eq param['search_EQ_customTimeType']}">selected="selected"</c:if>>
到访时间
</option>
<option value="4"
<c:if test="${'4' eq param['search_EQ_customTimeType']}">selected="selected"</c:if>>
认筹时间
</option>
<option value="5"
<c:if test="${'5' eq param['search_EQ_customTimeType']}">selected="selected"</c:if>>
认购时间
</option>
<option value="6"
<c:if test="${'6' eq param['search_EQ_customTimeType']}">selected="selected"</c:if>>
签约时间
</option>
</select>
<input style="width: 7rem;border: 1px solid #d5d5d5;" type="text"
name="search_GTE_customTimeStart"
id="search_GTE_customTimeStart" value="${param['search_GTE_customTimeStart']}"
class="m-wrap small span2"
>
<input style="width: 7rem;margin-left: 15px;;border: 1px solid #d5d5d5;" type="text"
name="search_LTE_customTimeEnd"
id="search_LTE_customTimeEnd" value="${param['search_LTE_customTimeEnd']}"
class="m-wrap small span2"
>
购房意向:<select style="width: 6rem" name="search_EQ_buyIntention" id="search_EQ_buyIntention">
<option value="all">
......@@ -346,54 +347,76 @@
E
</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;
<br/>
客户姓名:<input style="width: 8rem;border: 1px solid #d5d5d5;" type="text" id="search_LIKE_name" name="search_LIKE_name" value="${param['search_LIKE_name']}"
class="m-wrap small" placeholder="客户姓名">&nbsp;&nbsp;&nbsp;&nbsp;
客户手机:<input style="width: 8rem;border: 1px solid #d5d5d5;" type="text" id="search_LIKE_phone" name="search_LIKE_phone" value="${param['search_LIKE_phone']}"
class="m-wrap small" placeholder="客户手机">&nbsp;&nbsp;&nbsp;&nbsp;
置业顾问:<input style="width: 8rem;border: 1px solid #d5d5d5;" type="text" id="search_LIKE_managerName" name="search_LIKE_managerName" value="${param['search_LIKE_managerName']}"
class="m-wrap small" placeholder="置业顾问">&nbsp;&nbsp;&nbsp;&nbsp;
回访记录:<input type="text" id="search_LIKE_callbackLog" style="border: 1px solid #d5d5d5;" name="search_LIKE_callbackLog" value="${param['search_LIKE_callbackLog']}"
class="m-wrap small" placeholder="回访记录">
客户状态:<select style="width: 6rem" name="search_EQ_platProjectStatus" id="search_EQ_platProjectStatus">
<option value="">
全部
</option>
<option value="7"
<c:if test="${'7' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
跟进中
</option>
<option value="8"
<c:if test="${'8' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
回公海
</option>
<option value="1"
<c:if test="${'1' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
约看
</option>
<option value="2"
<c:if test="${'2' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
到访
</option>
<option value="3"
<c:if test="${'3' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
认筹
</option>
<option value="4"
<c:if test="${'4' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
认购
</option>
<option value="5"
<c:if test="${'5' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
签约
</option>
<option value="6"
<c:if test="${'6' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
退房
</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;
<br/>
客户姓名:<input style="width: 8rem;border: 1px solid #d5d5d5;" type="text" id="search_LIKE_name"
name="search_LIKE_name" value="${param['search_LIKE_name']}"
class="m-wrap small" placeholder="客户姓名">&nbsp;&nbsp;&nbsp;&nbsp;
客户手机:<input style="width: 8rem;border: 1px solid #d5d5d5;" type="text" id="search_LIKE_phone"
name="search_LIKE_phone" value="${param['search_LIKE_phone']}"
class="m-wrap small" placeholder="客户手机">&nbsp;&nbsp;&nbsp;&nbsp;
置业顾问:<input style="width: 8rem;border: 1px solid #d5d5d5;" type="text" id="search_LIKE_managerName"
name="search_LIKE_managerName" value="${param['search_LIKE_managerName']}"
class="m-wrap small" placeholder="置业顾问">&nbsp;&nbsp;&nbsp;&nbsp;
回访记录:<input type="text" id="search_LIKE_callbackLog" style="border: 1px solid #d5d5d5;"
name="search_LIKE_callbackLog" value="${param['search_LIKE_callbackLog']}"
class="m-wrap small" placeholder="回访记录">
客户状态:<select style="width: 6rem" name="search_EQ_platProjectStatus" id="search_EQ_platProjectStatus">
<option value="">
全部
</option>
<option value="7"
<c:if test="${'7' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
跟进中
</option>
<option value="8"
<c:if test="${'8' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
回公海
</option>
<option value="1"
<c:if test="${'1' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
约看
</option>
<option value="2"
<c:if test="${'2' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
到访
</option>
<option value="3"
<c:if test="${'3' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
认筹
</option>
<option value="4"
<c:if test="${'4' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
认购
</option>
<option value="5"
<c:if test="${'5' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
签约
</option>
<option value="6"
<c:if test="${'6' eq param['search_EQ_platProjectStatus']}">selected="selected"</c:if>>
退房
</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;
部门:<select style="width: 6rem" name="search_EQ_dept" id="search_EQ_dept">
<option value="">
全部
</option>
<option value="1"
<c:if test="${'1' eq param['search_EQ_dept']}">selected="selected"</c:if>>
直销一部
</option>
<option value="2"
<c:if test="${'2' eq param['search_EQ_dept']}">selected="selected"</c:if>>
直销二部
</option>
<option value="3"
<c:if test="${'3' eq param['search_EQ_dept']}">selected="selected"</c:if>>
直销三部
</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;
<%--</c:if>--%>
<div style="float: right">
......@@ -417,53 +440,53 @@
<div class="row-fluid">
<ul class="nav nav-tabs" style="margin-bottom: 0;position: relative;">
<%--</c:if>--%>
<a href="javascript:linkTypeUrl('')">全部</a>
<a href="javascript:linkTypeUrl('')">全部</a>
<li style="float: right;padding-top: 10px;padding-right: 10px;">
<select style="width: 120px" name="search_EQ_orderByTime" id="search_EQ_orderByTime"
onchange="$('#filterForm').submit();">
<option value="1"
<c:if test="${'1' eq param['search_EQ_orderByTime']}">selected="selected"</c:if>>
添加时间降序
</option>
<option value="2"
<c:if test="${'2' eq param['search_EQ_orderByTime']}">selected="selected"</c:if>>
添加时间升序
</option>
<option value="3"
<c:if test="${'3' eq param['search_EQ_orderByTime']}">selected="selected"</c:if>>
派工时间降序
</option>
<option value="4"
<c:if test="${'4' eq param['search_EQ_orderByTime']}">selected="selected"</c:if>>
派工时间升序
</option>
<option value="5"
<c:if test="${'5' eq param['search_EQ_orderByTime']}">selected="selected"</c:if>>
回访时间降序
</option>
<option value="6"
<c:if test="${'6' eq param['search_EQ_orderByTime']}">selected="selected"</c:if>>
回访时间升序
</option>
</select>
<select style="width: 120px" name="search_EQ_orderByTime" id="search_EQ_orderByTime"
onchange="$('#filterForm').submit();">
<option value="1"
<c:if test="${'1' eq param['search_EQ_orderByTime']}">selected="selected"</c:if>>
添加时间降序
</option>
<option value="2"
<c:if test="${'2' eq param['search_EQ_orderByTime']}">selected="selected"</c:if>>
添加时间升序
</option>
<option value="3"
<c:if test="${'3' eq param['search_EQ_orderByTime']}">selected="selected"</c:if>>
派工时间降序
</option>
<option value="4"
<c:if test="${'4' eq param['search_EQ_orderByTime']}">selected="selected"</c:if>>
派工时间升序
</option>
<option value="5"
<c:if test="${'5' eq param['search_EQ_orderByTime']}">selected="selected"</c:if>>
回访时间降序
</option>
<option value="6"
<c:if test="${'6' eq param['search_EQ_orderByTime']}">selected="selected"</c:if>>
回访时间升序
</option>
</select>
</li>
</ul>
</div>
</div>
</form>
<table class="table table-advance mine">
<tbody>
<c:forEach items="${customers}" var="customer" varStatus="vs">
<tr id="customerId_${customer.id}" class="header expand
<table class="table table-advance mine">
<tbody>
<c:forEach items="${customers}" var="customer" varStatus="vs">
<tr id="customerId_${customer.id}" class="header expand
<c:if test="${customer.star ne 'on' && vs.index%2==0}">table-complex</c:if>
<c:if test="${customer.star eq 'on'}">table-star</c:if>">
<td class="mangerId mangerItem mine">
<div class="mangerItem__border"></div>
<input type="checkbox" name="memberCheck" value="${customer.id}"
onclick="checkMember(this)">
<span class="mangerId_num mine">${customer.id}</span>
<span class="mangerId_name">
<td class="mangerId mangerItem mine">
<div class="mangerItem__border"></div>
<input type="checkbox" name="memberCheck" value="${customer.id}"
onclick="checkMember(this)">
<span class="mangerId_num mine">${customer.id}</span>
<span class="mangerId_name">
<c:if test="${null ne customer.name && '' ne customer.name}">
<c:choose>
<c:when test="${fn:length(customer.name) > 3}">
......@@ -478,168 +501,168 @@
&nbsp;
</c:if>
</span>
<div class="mangerId_content">
<div class="mangerId_phone">
<c:if test="${null ne customer.phone && '' ne customer.phone}">
<a href="javascript:void(0)" onclick="getCRM(${customer.id})"><c:out
value="${customer.phone}"/></a>
</c:if>
<c:if test="${null eq customer.phone || '' eq customer.phone}">
&nbsp;
</c:if>
<%--<c:if test="${hasPhone == 1}">--%>
<%--<span id="star" class="icon-phone-sign"--%>
<%--onclick="callCustomer('${customer.phone}','${customer.markedLabelId}','${customer.managerId}', '${customer.id}','${customer.buyIntention}','0','${customer.isPeer}', '${customer.starCustomer}')"></span>--%>
<%--</c:if>--%>
<div class="mangerId_content">
<div class="mangerId_phone">
<c:if test="${null ne customer.phone && '' ne customer.phone}">
<a href="javascript:void(0)" onclick="getCRM(${customer.id})"><c:out
value="${customer.phone}"/></a>
</c:if>
<c:if test="${null eq customer.phone || '' eq customer.phone}">
&nbsp;
</c:if>
</div>
<div class="mangerId_person">
<div class="mangerId_avar2" style="float: inherit">
<c:out value="${customer.creater}"/>
</div>
<div class="mangerId_avar"
style="float: inherit;display: flex;width: 80%;margin-top: 5px;justify-content: space-between;">
<c:if test="${null ne customer.managerName && '' ne customer.managerName}">
<c:out value="${customer.managerName}"/>
</c:if>
<c:if test="${null eq customer.managerName || '' eq customer.managerName}">
&nbsp;
</c:if>
<div class="mangerId_up">
<c:choose>
<c:when test="${customer.buyIntention eq '1'}">
A
</c:when>
<c:when test="${customer.buyIntention eq '2'}">
B
</c:when>
<c:when test="${customer.buyIntention eq '3'}">
C
</c:when>
<c:when test="${customer.buyIntention eq '4'}">
D
</c:when>
<c:when test="${customer.buyIntention eq '5'}">
E
</c:when>
<c:otherwise>
待定
</c:otherwise>
</c:choose>
</div>
<div class="mangerId_person">
<div class="mangerId_avar2" style="float: inherit">
<c:out value="${customer.creater}"/>
</div>
<div class="mangerId_avar" style="float: inherit;display: flex;width: 80%;margin-top: 5px;justify-content: space-between;">
<c:if test="${null ne customer.managerName && '' ne customer.managerName}">
<c:out value="${customer.managerName}"/>
</c:if>
<c:if test="${null eq customer.managerName || '' eq customer.managerName}">
&nbsp;
</div>
</div>
</div>
<div class="mangerId_state">
<span class="inline">${customer.platCustomerStatus}</span>
</div>
</td>
<td class="mangerlist mangerItem" style="width: 40%">
<c:if test="${0 ne fn:length(customer.callbackLogEntities)}">
<div class="mangerlist__txt" style="width: 60%">
<div class="mangerlist__item">
<c:forEach items="${customer.callbackLogEntities}" var="callbackLog"
varStatus="index">
<p>
<c:if test="${empty callbackLog.content && index.count<=3}">
<c:if test="${empty callbackLog.callRecordId}">
[电话已拨,但未接通或被挂断]
</c:if>
<c:if test="${not empty callbackLog.callRecordId && index.count<=3}">
[语音记录]
</c:if>
</c:if>
<div class="mangerId_up" >
<c:if test="${not empty callbackLog.content && index.count<=3}">
<c:choose>
<c:when test="${customer.buyIntention eq '1'}">
A
</c:when>
<c:when test="${customer.buyIntention eq '2'}">
B
</c:when>
<c:when test="${customer.buyIntention eq '3'}">
C
</c:when>
<c:when test="${customer.buyIntention eq '4'}">
D
</c:when>
<c:when test="${customer.buyIntention eq '5'}">
E
<c:when test="${fn:length(callbackLog.content) > 20}">
<c:out value="${fn:substring(callbackLog.content, 0, 20)}..."/>
</c:when>
<c:otherwise>
待定
<c:out value="${callbackLog.content}"/>
</c:otherwise>
</c:choose>
</div>
</div>
</div>
</c:if>
</p>
</c:forEach>
</div>
<div class="mangerId_state">
<span class="inline">${customer.platCustomerStatus}</span>
</div>
<div class="mangerlist__date">
<div class="mangerlist__dateC">
<c:forEach items="${customer.callbackLogEntities}" var="callbackLog"
varStatus="index">
<p><c:if test="${index.count<=3}">
<f:formatDate value='${callbackLog.createTime}' pattern='MM-dd HH:mm'/>
</c:if>
</p>
</c:forEach>
</div>
</td>
<td class="mangerlist mangerItem" style="width: 40%">
<c:if test="${0 ne fn:length(customer.callbackLogEntities)}">
<div class="mangerlist__txt" style="width: 60%">
<div class="mangerlist__item">
<c:forEach items="${customer.callbackLogEntities}" var="callbackLog"
varStatus="index">
<p>
<c:if test="${empty callbackLog.content && index.count<=3}">
<c:if test="${empty callbackLog.callRecordId}">
[电话已拨,但未接通或被挂断]
</c:if>
<c:if test="${not empty callbackLog.callRecordId && index.count<=3}">
[语音记录]
</c:if>
</c:if>
<c:if test="${not empty callbackLog.content && index.count<=3}">
<c:choose>
<c:when test="${fn:length(callbackLog.content) > 20}">
<c:out value="${fn:substring(callbackLog.content, 0, 20)}..."/>
</c:when>
<c:otherwise>
<c:out value="${callbackLog.content}"/>
</c:otherwise>
</c:choose>
</c:if>
</p>
</c:forEach>
</div>
</div>
<div class="mangerlist__date">
<div class="mangerlist__dateC">
<c:forEach items="${customer.callbackLogEntities}" var="callbackLog"
varStatus="index">
<p><c:if test="${index.count<=3}">
<f:formatDate value='${callbackLog.createTime}' pattern='MM-dd HH:mm'/>
</c:if>
</p>
</c:forEach>
</div>
</div>
<div class="mangerlist__record" onclick="showCustomerCallbackLogs('${customer.id}', '${customer.managerId}')">
查看回访记录
</div>
</c:if>
<c:if test="${0 eq fn:length(customer.callbackLogEntities)}">
<div class="mangerlist__txt">
<div class="mangerlist__item">
暂无回访记录!
</div>
</div>
<div class="mangerlist__date">
<div class="mangerlist__dateC">
</div>
</div>
</c:if>
<%--<div class="mangerItem__border"></div>--%>
</td>
<%--<td class="mangerItem mangerCollect ${customer.star}"--%>
<%--onclick="toggleCollect(this,'${customer.id}', '${customer.starUserId}', '${customer.star}', '${customer.managerId}')">--%>
<%--<div class="mangerItem__border"></div>--%>
<%--</td>--%>
<td class="mangerItem mangerOperate" style="display: table;padding: 0;overflow:visible;">
<div class="mangerOperate__time" style="right:160px;width:150px;">
<c:if test="${null ne customer.bindTime && '' ne customer.bindTime}">
派工:<f:formatDate value='${customer.bindTime}'
pattern='MM-dd HH:mm'/>
</c:if>
<c:if test="${null eq customer.bindTime || '' eq customer.bindTime}">
&nbsp;
</c:if>
</div>
<div class="mangerlist__record"
onclick="showCustomerCallbackLogs('${customer.id}', '${customer.managerId}')">
查看回访记录
</div>
</c:if>
<c:if test="${0 eq fn:length(customer.callbackLogEntities)}">
<div class="mangerlist__txt">
<div class="mangerlist__item">
暂无回访记录!
</div>
<div class="mangerOperate__time" style="right:0px">
<c:if test="${null ne customer.createTime && '' ne customer.createTime}">
<f:formatDate value='${customer.createTime}'
pattern='MM-dd HH:mm'/>
</c:if>
<c:if test="${null eq customer.createTime || '' eq customer.createTime}">
&nbsp;
</c:if>
</div>
<div class="mangerlist__date">
<div class="mangerlist__dateC">
</div>
<div style="display: table-cell;vertical-align: middle">
<c:if test="${customer.hasCustomerProjects}">
<div class="mangerOperate__record" onclick="showCustomerProjects('${customer.id}', '${customer.managerId}')"
style="position: relative;">
约看记录
<c:if test="${customer.hasNewCustomerProjects}">
<div style="position: absolute; width: 8px;height: 8px;background-color: red;border-radius: 50%;top: 5px;right: -7px;"></div>
</c:if>
</div>
</c:if>
<c:if test="${!customer.hasCustomerProjects}">
<div class="mangerOperate__record none"
style="position: relative;cursor: default;color:grey;">
约看记录
</div>
</div>
</c:if>
</td>
<td class="mangerItem mangerOperate" style="display: table;padding: 0;overflow:visible;">
<div class="mangerOperate__time" style="right:160px;width:150px;">
<c:if test="${null ne customer.bindTime && '' ne customer.bindTime}">
派工:<f:formatDate value='${customer.bindTime}'
pattern='MM-dd HH:mm'/>
</c:if>
<c:if test="${null eq customer.bindTime || '' eq customer.bindTime}">
&nbsp;
</c:if>
</div>
<div class="mangerOperate__time" style="right:0px">
<c:if test="${null ne customer.createTime && '' ne customer.createTime}">
<f:formatDate value='${customer.createTime}'
pattern='MM-dd HH:mm'/>
</c:if>
<c:if test="${null eq customer.createTime || '' eq customer.createTime}">
&nbsp;
</c:if>
</div>
<div style="display: table-cell;vertical-align: middle">
<c:if test="${customer.hasCustomerProjects}">
<div class="mangerOperate__record"
onclick="showCustomerProjects('${customer.id}', '${customer.managerId}')"
style="position: relative;">
约看记录
<c:if test="${customer.hasNewCustomerProjects}">
<div style="position: absolute; width: 8px;height: 8px;background-color: red;border-radius: 50%;top: 5px;right: -7px;"></div>
</c:if>
<div class="mangerOperate__detail" onclick="customerInfo(${customer.id}, '${customer.managerId}', ${customer.phone})">查看详情</div>
</div>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="row-fluid" style="position: relative">
<house365:newPagination page="${page}"/>
</div>
</c:if>
<c:if test="${!customer.hasCustomerProjects}">
<div class="mangerOperate__record none"
style="position: relative;cursor: default;color:grey;">
约看记录
</div>
</c:if>
<div class="mangerOperate__detail"
onclick="customerInfo(${customer.id}, '${customer.managerId}', ${customer.phone})">查看详情
</div>
<%--<div class="mangerOperate__detail"--%>
<%--onclick="deleteById(${customer.id})">删除--%>
<%--</div>--%>
</div>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="row-fluid" style="position: relative">
<house365:newPagination page="${page}"/>
</div>
<script type="text/html" id="customerProjectsTemplate">
......@@ -793,7 +816,7 @@
}
}
return fmt;
}
};
function getCRM(customerId) {
$.ajax({
......@@ -819,6 +842,28 @@
window.open("/house365-hgs-web/platformmanagement/customerInfo?customerId=" + id + "&managerId=" + managerId + "&phone=" + phone, "_blank");
}
function deleteById(customerId) {
House365Util.createModal("删除客户", "删除后将无法恢复,请确认是否继续?", function () {
var url = "${ctx}/platformmanagement/deleteById/" + customerId;
$.ajax({
url: url,
type: 'post',
contentType: 'application/json',
data: '',
dataType: 'json',
cache: false,
success: function (result) {
if (result.status == 0) {
alert("删除成功");
window.location.reload();
} else{
alert(result.errorMessage);
}
}
});
});
}
function showCustomerCallbackLogs(_customerId, managerId) {
setCookie("lastChoseCustomerId", _customerId);
$.ajax({
......
......@@ -23,6 +23,7 @@ import com.house365.ws.beans.request.MapListRequest;
import com.house365.ws.beans.response.CustomerListResponse;
import com.house365.ws.beans.response.CustomerResponse;
import com.house365.ws.beans.response.MapListResponse;
import com.house365.ws.beans.util.HResult;
import java.util.Date;
import java.util.List;
......@@ -241,9 +242,9 @@ public interface ICustomer extends IService {
void updateOldCustomerStar(int customerId, int starCustomer);
int queryCount (Map<String, Object> map);
int queryCount(Map<String, Object> map);
MapListResponse successList(MapListRequest listRequest,UserEntity userEntity);
MapListResponse successList(MapListRequest listRequest, UserEntity userEntity);
Integer countCustomer(Map<String, Object> map);
......@@ -261,6 +262,8 @@ public interface ICustomer extends IService {
List<CustomerEntity> getAllCustomer4(Map<String, Object> map);
MapListResponse seaList(MapListRequest listRequest,String type);
MapListResponse seaList(MapListRequest listRequest, String type);
HResult deleteById(int id, int userId, String userName);
}
......@@ -37,6 +37,7 @@ import com.house365.ws.beans.request.MapListRequest;
import com.house365.ws.beans.response.CustomerListResponse;
import com.house365.ws.beans.response.CustomerResponse;
import com.house365.ws.beans.response.MapListResponse;
import com.house365.ws.beans.util.HResult;
import com.house365.ws.cached.RedisUtilsInterface;
import com.house365.ws.dao.mapper.*;
import com.house365.ws.interfaces.server.ICustomer;
......@@ -142,6 +143,8 @@ public class CustomerImpl implements ICustomer {
private CloudCustomerMapper cloudCustomerMapper;
@Autowired
private UserMapper userMapper;
@Autowired
private DepartMapper departMapper;
@Value("${crm.sync.url}")
......@@ -392,7 +395,6 @@ public class CustomerImpl implements ICustomer {
if (inOtherUser.length() > 0) {
msg += "客户" + inCurrentUser.toString() + "已存在于当前帐号下";
// msg += "<hr/>客户" + inOtherUser.toString() + "已存在于他人帐号下";
}
}
......@@ -3080,6 +3082,22 @@ public class CustomerImpl implements ICustomer {
return response;
}
@Override
public HResult deleteById(int id, int userId, String userName) {
HResult result = new HResult();
CustomerEntity customer = customerMapper.queryById(id);
if (null == customer.getManagerId()) {
customer.setIsDelete(1);
customerService.update(customer);
//新增客户删除日志
logUtils.saveCustomerLog(customer, 3, userId, userName);
} else {
result.setStatus(500);
result.setErrorMessage("客户未回公海,不能删除");
}
return result;
}
/**
* 以下均为自动生成
*/
......
......@@ -73,7 +73,6 @@ public class GetOnlineLogImpl implements IGetOnlineLog {
String endTime = time + " 23:59:59";
searchMap.put("startTime", startTime);
searchMap.put("endTime", endTime);
// searchMap.put("order", 1);
searchMap.put("userId", u.getId());
List<OnlineLogEntity> logList = logMapper.queryByConditions(searchMap);
if (CollectionUtils.isNotEmpty(logList)) {
......
......@@ -912,6 +912,11 @@
(manager_id in ($searchFilters.userIds.value$) )
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="searchFilters.deptManagerId">
<![CDATA[
(manager_id in ($searchFilters.deptManagerId.value$) )
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="searchFilters.customerIds">
<![CDATA[
(id in ($searchFilters.customerIds.value$) )
......
......@@ -36,6 +36,9 @@
<if test="name != null and name != ''">
AND name = #{name}
</if>
<if test="likeName != null and likeName != ''">
AND name LIKE CONCAT('',#{likeName},'%')
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -150,6 +150,12 @@
<if test="deptId != null and deptId >= 0 ">
AND deptId = #{deptId}
</if>
<if test="deptIdList != null and deptIdList.size() > 0 ">
AND deptId in
<foreach collection="deptIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="order != null and order > 0 ">
ORDER BY name ASC
</if>
......
......@@ -912,6 +912,11 @@
(manager_id in ($searchFilters.userIds.value$) )
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="searchFilters.deptManagerId">
<![CDATA[
(manager_id in ($searchFilters.deptManagerId.value$) )
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="searchFilters.customerIds">
<![CDATA[
(id in ($searchFilters.customerIds.value$) )
......
......@@ -36,6 +36,9 @@
<if test="name != null and name != ''">
AND name = #{name}
</if>
<if test="likeName != null and likeName != ''">
AND name LIKE CONCAT('',#{likeName},'%')
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -150,6 +150,12 @@
<if test="deptId != null and deptId >= 0 ">
AND deptId = #{deptId}
</if>
<if test="deptIdList != null and deptIdList.size() > 0 ">
AND deptId in
<foreach collection="deptIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="order != null and order > 0 ">
ORDER BY name ASC
</if>
......
......@@ -912,6 +912,11 @@
(manager_id in ($searchFilters.userIds.value$) )
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="searchFilters.deptManagerId">
<![CDATA[
(manager_id in ($searchFilters.deptManagerId.value$) )
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="searchFilters.customerIds">
<![CDATA[
(id in ($searchFilters.customerIds.value$) )
......
......@@ -36,6 +36,9 @@
<if test="name != null and name != ''">
AND name = #{name}
</if>
<if test="likeName != null and likeName != ''">
AND name LIKE CONCAT('',#{likeName},'%')
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -150,6 +150,12 @@
<if test="deptId != null and deptId >= 0 ">
AND deptId = #{deptId}
</if>
<if test="deptIdList != null and deptIdList.size() > 0 ">
AND deptId in
<foreach collection="deptIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="order != null and order > 0 ">
ORDER BY name ASC
</if>
......
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