Commit 145ea0ef authored by jay's avatar jay

云迹需求提交

parent 8f98789e
package com.house365.beans.entity; package com.house365.beans.entity;
import com.house365.beans.system.DomainObject; import com.house365.beans.system.DomainObject;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 云迹活动实体类 * 云迹活动实体类
...@@ -23,6 +25,32 @@ public class CloudActivityEntity extends DomainObject { ...@@ -23,6 +25,32 @@ public class CloudActivityEntity extends DomainObject {
private Date createTime; private Date createTime;
private int isDelete; private int isDelete;
private int totalPriceMin;
private int totalPriceMax;
private int areaMin;
private int areaMax;
private String block;
private String blockName;
private String district;
private String districtName;
private String channel;
private String channelName;
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date seeStartTime;
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date seeEndTime;
private String seeProjectName;
private int seeCount;
private int type;
private String projectId;
private String projectName;
private List<String> blockList;
private List<String> districtList;
private String startTime;
private String endTime;
public String getName() { public String getName() {
return name; return name;
} }
...@@ -94,4 +122,172 @@ public class CloudActivityEntity extends DomainObject { ...@@ -94,4 +122,172 @@ public class CloudActivityEntity extends DomainObject {
public void setIsDelete(int isDelete) { public void setIsDelete(int isDelete) {
this.isDelete = isDelete; this.isDelete = isDelete;
} }
public int getTotalPriceMin() {
return totalPriceMin;
}
public void setTotalPriceMin(int totalPriceMin) {
this.totalPriceMin = totalPriceMin;
}
public int getTotalPriceMax() {
return totalPriceMax;
}
public void setTotalPriceMax(int totalPriceMax) {
this.totalPriceMax = totalPriceMax;
}
public int getAreaMin() {
return areaMin;
}
public void setAreaMin(int areaMin) {
this.areaMin = areaMin;
}
public int getAreaMax() {
return areaMax;
}
public void setAreaMax(int areaMax) {
this.areaMax = areaMax;
}
public String getBlock() {
return block;
}
public void setBlock(String block) {
this.block = block;
}
public String getBlockName() {
return blockName;
}
public void setBlockName(String blockName) {
this.blockName = blockName;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getDistrictName() {
return districtName;
}
public void setDistrictName(String districtName) {
this.districtName = districtName;
}
public String getChannel() {
return channel;
}
public void setChannel(String channel) {
this.channel = channel;
}
public String getChannelName() {
return channelName;
}
public void setChannelName(String channelName) {
this.channelName = channelName;
}
public Date getSeeStartTime() {
return seeStartTime;
}
public void setSeeStartTime(Date seeStartTime) {
this.seeStartTime = seeStartTime;
}
public Date getSeeEndTime() {
return seeEndTime;
}
public void setSeeEndTime(Date seeEndTime) {
this.seeEndTime = seeEndTime;
}
public String getSeeProjectName() {
return seeProjectName;
}
public void setSeeProjectName(String seeProjectName) {
this.seeProjectName = seeProjectName;
}
public int getSeeCount() {
return seeCount;
}
public void setSeeCount(int seeCount) {
this.seeCount = seeCount;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public List<String> getBlockList() {
return blockList;
}
public void setBlockList(List<String> blockList) {
this.blockList = blockList;
}
public List<String> getDistrictList() {
return districtList;
}
public void setDistrictList(List<String> districtList) {
this.districtList = districtList;
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
} }
...@@ -520,45 +520,6 @@ public class MarketingActivityController extends BaseController { ...@@ -520,45 +520,6 @@ public class MarketingActivityController extends BaseController {
return result; return result;
} }
int count = 0;
List<Map<String, Object>> seeList = new ArrayList<>();
List<Map<String, Object>> crmList = new ArrayList<>();
if (vo.getSeeStartTime() != null && vo.getSeeEndTime() != null) {
String cityName = city.getName();
List<NameValuePair> pairList = new ArrayList<>();
String projectName = vo.getProjectName();
String[] projectNames = projectName.split(",");
for (int i = 0; i < projectNames.length; i++) {
String name = projectNames[i].split("\\(")[0];
pairList.add(new BasicNameValuePair("items[]", name));
}
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String startTime = formatter.format(vo.getSeeStartTime());
String endTime = formatter.format(vo.getSeeEndTime());
pairList.add(new BasicNameValuePair("city_name", cityName));
pairList.add(new BasicNameValuePair("from", startTime));
pairList.add(new BasicNameValuePair("to", endTime));
pairList.add(new BasicNameValuePair("lower", String.valueOf(vo.getSeeCount())));
pairList.add(new BasicNameValuePair("has_login_account", "true"));
pairList.add(new BasicNameValuePair("limit", "2000"));
String seeResult = HttpClientUtil.doGet(crmSeeUrl, pairList);
if (seeResult != null) {
JSONArray jsonarray = JSONArray.fromObject(seeResult);
seeList = (List) JSONArray.toCollection(jsonarray, Map.class);
count = seeList.size();
activityLogger.info("浏览轨迹接口返回数据:", seeResult);
} else {
List<String> params = new ArrayList<>();
for (NameValuePair pair : pairList) {
params.add(pair.getName() + "=" + pair.getValue());
}
activityLogger.error("浏览轨迹接口URL:[{}] ", crmSeeUrl + Joiner.on("&").join(params));
result.setErrorMessage("调用轨迹查询接口出错!请稍后再试!");
result.setStatus(-1);
return result;
}
}
if (entity.getApplyStartTime() != null && entity.getApplyEndTime() != null) { if (entity.getApplyStartTime() != null && entity.getApplyEndTime() != null) {
if (vo.getSeeStartTime() != null && vo.getSeeEndTime() != null) { if (vo.getSeeStartTime() != null && vo.getSeeEndTime() != null) {
nameValuePairList.add(new BasicNameValuePair("page", "1")); nameValuePairList.add(new BasicNameValuePair("page", "1"));
...@@ -571,7 +532,6 @@ public class MarketingActivityController extends BaseController { ...@@ -571,7 +532,6 @@ public class MarketingActivityController extends BaseController {
JSONObject jsonObject = JSONObject.fromObject(preResult); JSONObject jsonObject = JSONObject.fromObject(preResult);
if (jsonObject.containsKey("total")) { if (jsonObject.containsKey("total")) {
total = String.valueOf(jsonObject.get("total")); total = String.valueOf(jsonObject.get("total"));
crmList = (List) jsonObject.get("docs");
} else { } else {
List<String> params = new ArrayList<>(); List<String> params = new ArrayList<>();
for (NameValuePair pair : nameValuePairList) { for (NameValuePair pair : nameValuePairList) {
...@@ -586,34 +546,7 @@ public class MarketingActivityController extends BaseController { ...@@ -586,34 +546,7 @@ public class MarketingActivityController extends BaseController {
} }
Map<String, Integer> map = new HashMap<>(10); Map<String, Integer> map = new HashMap<>(10);
map.put("activeId", entity.getId()); map.put("activeId", entity.getId());
if (entity.getApplyStartTime() != null && entity.getApplyEndTime() != null) { restObject.setTotal(String.valueOf(total));
//当满足两种条件时,取集合的交集
if (vo.getSeeStartTime() != null && vo.getSeeEndTime() != null) {
if (CollectionUtils.isNotEmpty(crmList)) {
List<Map<String, Object>> newList = new ArrayList<>();
for (Map<String, Object> m : crmList) {
String phone = m.get("phone").toString();
if (CollectionUtils.isNotEmpty(seeList)) {
for (Map<String, Object> o : seeList) {
if (o.get("login_account").equals(phone)) {
newList.add(m);
}
}
} else {
restObject.setTotal("0");
}
}
int newCount = newList.size();
restObject.setTotal(String.valueOf(newCount));
} else {
restObject.setTotal("0");
}
} else {
restObject.setTotal(total);
}
} else {
restObject.setTotal(String.valueOf(count));
}
restObject.setParaMap(map); restObject.setParaMap(map);
result.setData(restObject); result.setData(restObject);
...@@ -776,8 +709,6 @@ public class MarketingActivityController extends BaseController { ...@@ -776,8 +709,6 @@ public class MarketingActivityController extends BaseController {
restObject.setTotal(String.valueOf(vo.getEntity().getExpectExtractCount())); restObject.setTotal(String.valueOf(vo.getEntity().getExpectExtractCount()));
restObject.setEntity(vo.getEntity().getId()); restObject.setEntity(vo.getEntity().getId());
marketingActivity.importCustomers(restObject, city); marketingActivity.importCustomers(restObject, city);
} else {
marketingActivity.importCustomerNew(vo, paraMap, city);
} }
final Integer acid = entity.getId(); final Integer acid = entity.getId();
......
...@@ -607,8 +607,8 @@ public class PlatformManagementController extends BaseController { ...@@ -607,8 +607,8 @@ public class PlatformManagementController extends BaseController {
UserUtil.showCreateSource(customerEntity); UserUtil.showCreateSource(customerEntity);
} }
Map<String, Object> tmpMap = new HashMap<>(10); Map<String, Object> tmpMap = new HashMap<>(10);
List<CustomerProjectEntity> cpList = new ArrayList<>(); List<CustomerProjectEntity> cpList;
List<CustomerCallbackLogEntity> backLogList = new ArrayList<>(); List<CustomerCallbackLogEntity> backLogList;
if (StringUtils.isNotEmpty(String.valueOf(customerEntity.getManagerId()))) { if (StringUtils.isNotEmpty(String.valueOf(customerEntity.getManagerId()))) {
//约看项目 //约看项目
cpList = doCustomerProject(userEntity, customerIdList); cpList = doCustomerProject(userEntity, customerIdList);
...@@ -879,7 +879,6 @@ public class PlatformManagementController extends BaseController { ...@@ -879,7 +879,6 @@ public class PlatformManagementController extends BaseController {
* *
* @param model * @param model
* @param request * @param request
* @param
* @return * @return
*/ */
@RequestMapping(value = "saveRule", method = RequestMethod.GET) @RequestMapping(value = "saveRule", method = RequestMethod.GET)
......
...@@ -540,6 +540,18 @@ public class UserController extends BaseController { ...@@ -540,6 +540,18 @@ public class UserController extends BaseController {
entity.getRealName()) && !tmpEntity.getRealName().equals(entity.getRealName())) { entity.getRealName()) && !tmpEntity.getRealName().equals(entity.getRealName())) {
customer.updateManager(entity.getId(), entity.getRealName()); customer.updateManager(entity.getId(), entity.getRealName());
} }
//改变用户名需要同步给im
String env = MemoryPropertyPlaceholderConfigurer.getContextProperty("system.env");
if ("production".equalsIgnoreCase(env) && !oldEntity.getRealName().equals(entity.getRealName())) {
if(org.apache.commons.lang.StringUtils.isNotBlank(oldEntity.getAccId())){
String token = getImToken();
List<NameValuePair> cornetInParam = new ArrayList<>();
cornetInParam.add(new BasicNameValuePair("accid", oldEntity.getAccId()));
cornetInParam.add(new BasicNameValuePair("username", entity.getRealName()));
String updateResult = HttpUtil.doPostWithHeader("http://yunxinim.house365.com/api/5b9235bea9f88", cornetInParam, token, "");
logger.info("******SYNC_TO_CRM_RESULT*******" + updateResult);
}
}
user.updateUserAndSyncToWechat(request); user.updateUserAndSyncToWechat(request);
redirectAttributes.addAttribute("message", "更新成功"); redirectAttributes.addAttribute("message", "更新成功");
...@@ -1020,4 +1032,44 @@ public class UserController extends BaseController { ...@@ -1020,4 +1032,44 @@ public class UserController extends BaseController {
return result; return result;
} }
private String getImToken() {
String accessToken = "";
try {
String deciceId = com.house365.web.util.StringUtils.getRandomNumber(10);
String randStr = com.house365.web.util.StringUtils.getRandomChars(13);
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
String signature = HttpUtil.getSignature2(deciceId, randStr, timestamp);
//获取accesstoken
HashMap<String, String> accesstokenMap = new HashMap<>(5);
accesstokenMap.put("version", "v3.0");
//获取acceToken接口URl
String getAccessTokenUrl = "http://yunxinim.house365.com/api/5b0cc34464a64";
List<NameValuePair> tokenInParam = new ArrayList<>();
tokenInParam.add(new BasicNameValuePair("app_id", "89962055"));
tokenInParam.add(new BasicNameValuePair("app_secret", "pMHTUWAoOGSjaToIhHKwmQJKWZcAAvjN"));
tokenInParam.add(new BasicNameValuePair("device_id", deciceId));
tokenInParam.add(new BasicNameValuePair("rand_str", randStr));
tokenInParam.add(new BasicNameValuePair("timestamp", timestamp));
tokenInParam.add(new BasicNameValuePair("signature", signature));
List<String> newTokenParams = new ArrayList<>();
for (NameValuePair pair : tokenInParam) {
newTokenParams.add(pair.getName() + "=" + pair.getValue());
}
String newTokenUrl = getAccessTokenUrl + "?" + Joiner.on("&").join(newTokenParams);
String tokenResult = "";
tokenResult = HttpUtil.getHttpRequest(newTokenUrl, accesstokenMap, 100000, "utf-8");
if (Strings.isNullOrEmpty(tokenResult)) {
throw new ServiceException("get token failed");
}
JSONObject json = JSONObject.fromObject(tokenResult);
JSONObject jo = json.getJSONObject("data");
accessToken = jo.getString("access_token");
logger.info("******SYNC_TO_CRM_RESULT ACCESS_TOKEN*******" + accessToken);
} catch (Exception e) {
e.printStackTrace();
}
return accessToken;
}
} }
...@@ -28,7 +28,8 @@ projects.server.url=http://oms.house365.com/test/adminpack/index.php ...@@ -28,7 +28,8 @@ projects.server.url=http://oms.house365.com/test/adminpack/index.php
news.server.url=http://mapi.house365.com/cms/mobile_news.php news.server.url=http://mapi.house365.com/cms/mobile_news.php
CRM.CUSTOMERQUERY.URL=http://crmtest.house365.com/api/hgs/query CRM.CUSTOMERQUERY.URL=http://crmtest.house365.com/api/hgs/query
#CRM.CUSTOMERQUERY.URL=http://crm.house365.com/api/hgs/query #CRM.CUSTOMERQUERY.URL=http://crm.house365.com/api/hgs/query
CRM.TRANSLATE.URL=http://crmtest.house365.com/api/hgs/translate #CRM.TRANSLATE.URL=http://crmtest.house365.com/api/hgs/translate
CRM.TRANSLATE.URL=http://crm.house365.com/api/hgs/translate
CRM.SEEQUERY.URL=http://192.168.111.1/statqueryforhgs/v0/itemnames CRM.SEEQUERY.URL=http://192.168.111.1/statqueryforhgs/v0/itemnames
...@@ -70,3 +71,5 @@ WECHAT.IM.SECRET=eu6lRJtqPqSC4NGVNTuJcEhhUgJFSGUp4HZLCAzv5O0 ...@@ -70,3 +71,5 @@ WECHAT.IM.SECRET=eu6lRJtqPqSC4NGVNTuJcEhhUgJFSGUp4HZLCAzv5O0
get.pay.url = https://mtsapi.house365.com get.pay.url = https://mtsapi.house365.com
#云信im同步地址 #云信im同步地址
IM.SYNC.URL = http://www.test.yunxin.com IM.SYNC.URL = http://www.test.yunxin.com
#云迹拉取新接口地址
CLOUD.PULL.URL = http://192.168.105.121:8083/user/hgs/loginaccountinfo
\ No newline at end of file
...@@ -71,6 +71,8 @@ WECHAT.IM.SECRET=eu6lRJtqPqSC4NGVNTuJcEhhUgJFSGUp4HZLCAzv5O0 ...@@ -71,6 +71,8 @@ WECHAT.IM.SECRET=eu6lRJtqPqSC4NGVNTuJcEhhUgJFSGUp4HZLCAzv5O0
get.pay.url = https://mtsapi.house365.com get.pay.url = https://mtsapi.house365.com
#云信im同步地址 #云信im同步地址
IM.SYNC.URL = http://yunxinim.house365.com IM.SYNC.URL = http://yunxinim.house365.com
#云迹拉取新接口地址
CLOUD.PULL.URL = http://192.168.105.121:8083/user/hgs/loginaccountinfo
......
...@@ -71,5 +71,7 @@ WECHAT.IM.SECRET=eu6lRJtqPqSC4NGVNTuJcEhhUgJFSGUp4HZLCAzv5O0 ...@@ -71,5 +71,7 @@ WECHAT.IM.SECRET=eu6lRJtqPqSC4NGVNTuJcEhhUgJFSGUp4HZLCAzv5O0
get.pay.url = https://mtsapi.house365.com get.pay.url = https://mtsapi.house365.com
#云信im同步地址 #云信im同步地址
IM.SYNC.URL = http://www.test.yunxin.com IM.SYNC.URL = http://www.test.yunxin.com
#云迹拉取新接口地址
CLOUD.PULL.URL = http://192.168.105.121:8083/user/hgs/loginaccountinfo
...@@ -165,6 +165,9 @@ ...@@ -165,6 +165,9 @@
<shiro:hasPermission name="CLOUDACTIVITY"> <shiro:hasPermission name="CLOUDACTIVITY">
<li><a href="${ctx}/cloudactivity/list">云迹数据</a></li> <li><a href="${ctx}/cloudactivity/list">云迹数据</a></li>
</shiro:hasPermission> </shiro:hasPermission>
<shiro:hasPermission name="CLOUDPULL">
<li><a href="${ctx}/cloudactivity/pullList">云迹拉取数据</a></li>
</shiro:hasPermission>
<shiro:hasPermission name="EXTERNALCUS"> <shiro:hasPermission name="EXTERNALCUS">
<li><a href="${ctx}/externalCustomer/list">外部客户</a></li> <li><a href="${ctx}/externalCustomer/list">外部客户</a></li>
</shiro:hasPermission> </shiro:hasPermission>
......
...@@ -29,9 +29,10 @@ ...@@ -29,9 +29,10 @@
class="m-wrap small" placeholder="活动名称">&nbsp;&nbsp;&nbsp;&nbsp; class="m-wrap small" placeholder="活动名称">&nbsp;&nbsp;&nbsp;&nbsp;
<a class="btn" onclick="btnSubmit();">搜索</a> <a class="btn" onclick="btnSubmit();">搜索</a>
</div> </div>
<div style="margin-left: 90%"> <div style="margin-left: 80%">
<button type="button" class="btn btn-default" onclick="toAddCloud()">创建活动</button>
<shiro:hasPermission name="FUNC:CUSTOMCLOUD"> <shiro:hasPermission name="FUNC:CUSTOMCLOUD">
<button type="button" class="btn btn-default" onclick="showModalNew()">定制云迹数据</button> <button type="button" class="btn btn-default" onclick="showModalNew()" style="margin-left: 10px">定制云迹数据</button>
</shiro:hasPermission> </shiro:hasPermission>
</div> </div>
</form> </form>
...@@ -239,6 +240,10 @@ ...@@ -239,6 +240,10 @@
$("#cloudModal").modal('show'); $("#cloudModal").modal('show');
}; };
var toAddCloud = function () {
window.open("/house365-hgs-web/cloudactivity/toAdd", "_blank");
};
var checkNum = 0; var checkNum = 0;
function checkAll(btn) { function checkAll(btn) {
var that = btn; var that = btn;
......
<%@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}/cloudactivity/pullList" method="get">
<div style="margin-top:10px;">
活动名称:<input type="text" id="search_name" style="border: 1px solid #d5d5d5;" name="search_name"
value="${param['search_name']}"
class="m-wrap small" placeholder="活动名称">&nbsp;&nbsp;&nbsp;&nbsp;
<a class="btn" onclick="btnSubmit();">搜索</a>
</div>
</form>
<table class="table table-bordered table-advance table-hover">
<tr class="info">
<td width="100" style="text-align:center">序号</td>
<td width="100" style="text-align:center">名称</td>
<td width="100" style="text-align:center">总数</td>
<td width="100" style="text-align:center">待派</td>
<td width="100" style="text-align:center">已派</td>
<td width="100" style="text-align:center">创建人</td>
<td width="100" style="text-align:center">创建时间</td>
<td width="100" style="text-align:center">操作</td>
</tr>
<c:if test="${not empty dataList}">
<c:forEach items="${dataList}" var="item" varStatus="i">
<tr>
<td nowrap="nowrap" style="text-align:center;">
${i.index+1}
</td>
<td nowrap="nowrap" style="text-align:center;">
${item.name}
</td>
<td nowrap="nowrap" style="text-align:center;">
${item.customerCount}
</td>
<td nowrap="nowrap" style="text-align:center;">
${item.waitCount}
</td>
<td nowrap="nowrap" style="text-align:center;">
${item.sentCount}
</td>
<td nowrap="nowrap" style="text-align:center;">
${item.createName}
</td>
<td nowrap="nowrap" style="text-align:center;">
<c:if test="${null ne item.createTime && '' ne item.createTime}">
<f:formatDate value='${item.createTime}'
pattern='yyyy-MM-dd HH:mm:ss'/>
</c:if>
<c:if test="${null eq item.createTime || '' eq item.createTime}">
-
</c:if>
</td>
<td nowrap="nowrap" style="text-align:center;">
<button onclick="geDetail(${item.id})">详情</button>
</td>
</tr>
</c:forEach>
</c:if>
<c:if test="${ empty dataList}">
<tr>
<td colspan="15" style="text-align: center">暂未找到与条件相关的数据,请重新搜索</td>
</tr>
</c:if>
</table>
<div class="row${fluid}">
<house365:pagination page="${page}"/>
</div>
</div>
</div>
<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 type="text/javascript">
function btnSubmit() {
$('#filterForm').submit();
}
$(document).keydown(function (event) {
if (event.keyCode == "13") {
//回车执行查询
$('#filterForm').submit();
}
});
function geDetail(id) {
window.open("/house365-hgs-web/cloudcustomer/list/" + id, "_blank");
}
</script>
</body>
</html>
...@@ -2,8 +2,11 @@ package com.house365.ws.interfaces.server; ...@@ -2,8 +2,11 @@ package com.house365.ws.interfaces.server;
import com.house365.beans.entity.CloudActivityEntity; import com.house365.beans.entity.CloudActivityEntity;
import com.house365.beans.entity.CloudCountEntity; import com.house365.beans.entity.CloudCountEntity;
import com.house365.beans.entity.DepartmentEntity;
import com.house365.rest.parameter.House365RestObject;
import com.house365.ws.beans.request.MapListRequest; import com.house365.ws.beans.request.MapListRequest;
import com.house365.ws.beans.response.MapListResponse; import com.house365.ws.beans.response.MapListResponse;
import org.apache.http.NameValuePair;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -13,14 +16,20 @@ import java.util.Map; ...@@ -13,14 +16,20 @@ import java.util.Map;
*/ */
public interface ICloudActivityInterface { public interface ICloudActivityInterface {
int save(CloudActivityEntity entity);
MapListResponse list(MapListRequest listRequest); MapListResponse list(MapListRequest listRequest);
MapListResponse pullList(MapListRequest listRequest);
List<CloudCountEntity> reportList(Map<String, Object> map); List<CloudCountEntity> reportList(Map<String, Object> map);
MapListResponse reportDetailList(MapListRequest listRequest, int countId); MapListResponse reportDetailList(MapListRequest listRequest, int countId);
List<CloudActivityEntity> queryByConditions(Map<String, Object> map); List<CloudActivityEntity> queryByConditions(Map<String, Object> map);
void importCustomers(int id, DepartmentEntity city);
void setCloudCount(); void setCloudCount();
void startBackNoVisitToSea(); void startBackNoVisitToSea();
......
...@@ -87,7 +87,5 @@ public interface IMarketingActivity extends IService { ...@@ -87,7 +87,5 @@ public interface IMarketingActivity extends IService {
Integer queryCustomerCountByActive(Integer id); Integer queryCustomerCountByActive(Integer id);
void importCustomerNew(MarketingActivityVo vo, Map<String, Object> paraMap, DepartmentEntity city);
void putOvertimeWaitCallToOcean(); void putOvertimeWaitCallToOcean();
} }
...@@ -12,10 +12,12 @@ import java.util.Map; ...@@ -12,10 +12,12 @@ import java.util.Map;
@Repository @Repository
public interface CloudActivityMapper { public interface CloudActivityMapper {
void save(CloudActivityEntity entity); int save(CloudActivityEntity entity);
CloudActivityEntity getById(int id); CloudActivityEntity getById(int id);
CloudActivityEntity getByIdAndDel(int id);
List<CloudActivityEntity> queryByConditions(Map<String, Object> map); List<CloudActivityEntity> queryByConditions(Map<String, Object> map);
void updateCount(CloudActivityEntity entity); void updateCount(CloudActivityEntity entity);
...@@ -23,4 +25,6 @@ public interface CloudActivityMapper { ...@@ -23,4 +25,6 @@ public interface CloudActivityMapper {
List<Map<String, Object>> queryList(Map<String, Object> map); List<Map<String, Object>> queryList(Map<String, Object> map);
int queryCount(Map<String, Object> map); int queryCount(Map<String, Object> map);
void updateStatus(Map<String, Object> map);
} }
...@@ -128,7 +128,6 @@ public class PropertyReportImpl implements IPropertyReportInterface { ...@@ -128,7 +128,6 @@ public class PropertyReportImpl implements IPropertyReportInterface {
List<ReportHouseEntity> list = vo.getList(); List<ReportHouseEntity> list = vo.getList();
mapper.save(entity); mapper.save(entity);
int id = entity.getId(); int id = entity.getId();
// String url = "http://m.house365.com/H5/dist/index.html#/?id=" + id;
String url = "http://report.house365.com/index.html#/?id=" + id; String url = "http://report.house365.com/index.html#/?id=" + id;
Map<String, Object> map = new HashMap<>(5); Map<String, Object> map = new HashMap<>(5);
map.put("id", id); map.put("id", id);
......
...@@ -58,7 +58,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -58,7 +58,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
@Autowired @Autowired
private CustomerMergeMapper customermergemapper; private CustomerMergeMapper customermergemapper;
public static void main(String[] args){ public static void main(String[] args) {
System.out.println(MemoryPropertyPlaceholderConfigurer.getContextProperty("tangfanghui.server.url")); System.out.println(MemoryPropertyPlaceholderConfigurer.getContextProperty("tangfanghui.server.url"));
} }
...@@ -587,11 +587,11 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -587,11 +587,11 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
customerMe.setManagerPhone(userEntity2.getMobile()); customerMe.setManagerPhone(userEntity2.getMobile());
Integer sendNum = 0; Integer sendNum = 0;
String customermsg = "感谢您咨询365淘房房博士,根据您的置业需求,我们将安排安家顾问[" + customerEntity.getManagerName() + "],电话[" + userEntity2.getMobile() + "],在您合适的时间给您回电,请注意接听,谢谢支持"; String customermsg = "感谢您咨询365淘房房博士,根据您的置业需求,我们将安排安家顾问[" + customerEntity.getManagerName() + "],电话[" + userEntity2.getMobile() + "],在您合适的时间给您回电,请注意接听,谢谢支持";
// customermsg = URLEncoder.encode(customermsg);
smUrl = smUrl + customerEntity.getCityCode() + "/" + "mobileno/" + customerEntity.getPhone(); smUrl = smUrl + customerEntity.getCityCode() + "/" + "mobileno/" + customerEntity.getPhone();
List<NameValuePair> params = new ArrayList<>(); List<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("msg", customermsg)); params.add(new BasicNameValuePair("msg", customermsg));
String sendresult = HttpClientUtil.doGet(smUrl, params, null);//发送客户 //发送客户
String sendresult = HttpClientUtil.doGet(smUrl, params, null);
customerMe.setRequestType("6"); customerMe.setRequestType("6");
if (sendresult != null) { if (sendresult != null) {
customerMe.setCustomerStatus("1"); customerMe.setCustomerStatus("1");
...@@ -601,7 +601,8 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -601,7 +601,8 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
} }
String time = sdf.format(newdate); String time = sdf.format(newdate);
String managermsg = ""; String managermsg = "";
if (isProtected) {//在保护期内=非第一次IM咨询 //在保护期内=非第一次IM咨询
if (isProtected) {
managermsg = "你好,客户[" + customerEntity.getName() + "]再次咨询,咨询时间[" + time + "],请登录全链条后台查看."; managermsg = "你好,客户[" + customerEntity.getName() + "]再次咨询,咨询时间[" + time + "],请登录全链条后台查看.";
} else { } else {
managermsg = "你好,你在[" + time + "]有一条新的用户咨询需要处理,用户手机[" + customerEntity.getPhone() + "]请登录全链条后台查看."; managermsg = "你好,你在[" + time + "]有一条新的用户咨询需要处理,用户手机[" + customerEntity.getPhone() + "]请登录全链条后台查看.";
...@@ -648,10 +649,11 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -648,10 +649,11 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
/** /**
* 非客户转移-处理合并最新回访时间 * 非客户转移-处理合并最新回访时间
*
* @param currentCustomer * @param currentCustomer
* @return * @return
*/ */
private CustomerEntity handleCustomerMerge(CustomerEntity currentCustomer){ private CustomerEntity handleCustomerMerge(CustomerEntity currentCustomer) {
//先去查询该客户的所有id //先去查询该客户的所有id
List<CustomerEntity> customerIdList = customer.getCustomerIds(currentCustomer.getId(), currentCustomer.getCityCode()); List<CustomerEntity> customerIdList = customer.getCustomerIds(currentCustomer.getId(), currentCustomer.getCityCode());
//再获取所有id的回访记录 //再获取所有id的回访记录
...@@ -663,20 +665,21 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -663,20 +665,21 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
idsMap.put("ids", ids); idsMap.put("ids", ids);
if (ids.size() > 0) { if (ids.size() > 0) {
List<CustomerCallbackLogEntity> callbacklist = customer.getCallBackList(idsMap); List<CustomerCallbackLogEntity> callbacklist = customer.getCallBackList(idsMap);
if(callbacklist != null && callbacklist.size()>0){ if (callbacklist != null && callbacklist.size() > 0) {
currentCustomer.setLastCallTime(callbacklist.get(0).getCreateTime()); currentCustomer.setLastCallTime(callbacklist.get(0).getCreateTime());
} }
} }
return currentCustomer; return currentCustomer;
} }
/** /**
* 客户转移-处理合并客户最近回访时间 * 客户转移-处理合并客户最近回访时间
*
* @param currentCustomer * @param currentCustomer
* @param * @param
* @return * @return
*/ */
public CustomerEntity handleCustomerMerge(CustomerEntity currentCustomer, Date lastjoinvisittime){ public CustomerEntity handleCustomerMerge(CustomerEntity currentCustomer, Date lastjoinvisittime) {
//先去查询该客户的所有id //先去查询该客户的所有id
List<CustomerEntity> customerIdList = customer.getCustomerIds(currentCustomer.getId(), currentCustomer.getCityCode()); List<CustomerEntity> customerIdList = customer.getCustomerIds(currentCustomer.getId(), currentCustomer.getCityCode());
//再获取所有id的回访记录 //再获取所有id的回访记录
...@@ -688,13 +691,13 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -688,13 +691,13 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
idsMap.put("ids", ids); idsMap.put("ids", ids);
if (ids.size() > 0) { if (ids.size() > 0) {
List<CustomerCallbackLogEntity> callbacklist = customer.getCallBackList(idsMap); List<CustomerCallbackLogEntity> callbacklist = customer.getCallBackList(idsMap);
if(callbacklist != null && callbacklist.size()>0 && lastjoinvisittime.before(callbacklist.get(0).getCreateTime())){ if (callbacklist != null && callbacklist.size() > 0 && lastjoinvisittime.before(callbacklist.get(0).getCreateTime())) {
currentCustomer.setLastCallTime(callbacklist.get(0).getCreateTime()); currentCustomer.setLastCallTime(callbacklist.get(0).getCreateTime());
}else{ } else {
currentCustomer.setLastCallTime(lastjoinvisittime); currentCustomer.setLastCallTime(lastjoinvisittime);
} }
} }
return currentCustomer; return currentCustomer;
} }
/** /**
......
...@@ -45,7 +45,7 @@ public class GetNewUserInfoImpl implements IGetNewUserInfo { ...@@ -45,7 +45,7 @@ public class GetNewUserInfoImpl implements IGetNewUserInfo {
* 对于纯新咨询的客户,随机分配给一位在线IM房博士;  * 对于纯新咨询的客户,随机分配给一位在线IM房博士; 
* 对于非全新咨询的客户,每次咨询时需判断下上次咨询的人员账号是否在线,如在线直接分配上回的人员,如不在线,随机分配给其他在线人员; * 对于非全新咨询的客户,每次咨询时需判断下上次咨询的人员账号是否在线,如在线直接分配上回的人员,如不在线,随机分配给其他在线人员;
* 若所有组员都不在线时,默认分配给组长,保证有人接待客户; * 若所有组员都不在线时,默认分配给组长,保证有人接待客户;
* 组长使用原新房房博士的账号,accid是qlt_527 * 组长使用原新房房博士的账号,accid是qlt_527
* *
* @param parameter 服务输入,不包含服务配置和控制信息 * @param parameter 服务输入,不包含服务配置和控制信息
* @return * @return
...@@ -75,8 +75,8 @@ public class GetNewUserInfoImpl implements IGetNewUserInfo { ...@@ -75,8 +75,8 @@ public class GetNewUserInfoImpl implements IGetNewUserInfo {
//查询在线客服list //查询在线客服list
Map<String, Object> queryMap = new HashMap<>(5); Map<String, Object> queryMap = new HashMap<>(5);
//测试临时新加部门,上线需要调整 //测试临时新加部门,上线需要调整
// queryMap.put("deptId", 568); queryMap.put("deptId", 568);
queryMap.put("deptId", 557); // queryMap.put("deptId", 557);
queryMap.put("onlineStatus", 1); queryMap.put("onlineStatus", 1);
List<UserEntity> userList = userMapper.queryByConditions(queryMap); List<UserEntity> userList = userMapper.queryByConditions(queryMap);
...@@ -121,44 +121,40 @@ public class GetNewUserInfoImpl implements IGetNewUserInfo { ...@@ -121,44 +121,40 @@ public class GetNewUserInfoImpl implements IGetNewUserInfo {
response.setData(data); response.setData(data);
response.setResult(ReturnAppResult.APP_SUCCESS.getResultCode()); response.setResult(ReturnAppResult.APP_SUCCESS.getResultCode());
response.setMsg("查询成功"); response.setMsg("查询成功");
//todo 1、查询成功同时添加日志(请求url返回result) 2、聊天机制废除,查询的同时触发新增信息接口 //1、查询成功同时添加日志(请求url返回result) 2、聊天机制废除,查询的同时触发新增信息接口
ExecutorService executor = Executors.newCachedThreadPool(); ExecutorService executor = Executors.newCachedThreadPool();
executor.execute(new Runnable() { executor.execute(() -> {
@Override try {
public void run() { Date now = new Date();
try { if (!"qlt_527".equals(accId)) {
Date now = new Date(); Map<String, Object> mesMap = new HashMap<>(5);
if (!"qlt_527".equals(accId)) { mesMap.put("sender", tfId);
Map<String, Object> mesMap = new HashMap<>(5); mesMap.put("receiver", accId);
mesMap.put("sender", tfId); List<UserMessageEntity> list = messageMapper.queryByConditions(mesMap);
mesMap.put("receiver", accId); //判断如果存在聊天,则更新时间,不存在则新增一条记录
List<UserMessageEntity> list = messageMapper.queryByConditions(mesMap); if (CollectionUtils.isNotEmpty(list)) {
//判断如果存在聊天,则更新时间,不存在则新增一条记录 UserMessageEntity oldEntity = list.get(0);
if (CollectionUtils.isNotEmpty(list)) { oldEntity.setUpdateTime(now);
UserMessageEntity oldEntity = list.get(0); messageMapper.update(oldEntity);
oldEntity.setUpdateTime(now); } else {
messageMapper.update(oldEntity); UserMessageEntity entity = new UserMessageEntity();
} else { entity.setSender(tfId);
UserMessageEntity entity = new UserMessageEntity(); entity.setReceiver(accId);
entity.setSender(tfId); entity.setCreateTime(now);
entity.setReceiver(accId); entity.setUpdateTime(now);
entity.setCreateTime(now); messageMapper.save(entity);
entity.setUpdateTime(now);
messageMapper.save(entity);
}
} }
ImInfoLogEntity logEntity = new ImInfoLogEntity();
logEntity.setTfId(tfId);
logEntity.setCity(city);
logEntity.setAccId(accId);
logEntity.setCreateTime(now);
logMapper.save(logEntity);
} catch (Exception e) {
logger.error("同步IM信息失败", e);
} }
ImInfoLogEntity logEntity = new ImInfoLogEntity();
logEntity.setTfId(tfId);
logEntity.setCity(city);
logEntity.setAccId(accId);
logEntity.setCreateTime(now);
logMapper.save(logEntity);
} catch (Exception e) {
logger.error("同步IM信息失败", e);
} }
}); });
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error("查询用户信息失败", e); logger.error("查询用户信息失败", e);
......
...@@ -164,13 +164,11 @@ public class StaffDuty implements IStaffDuty { ...@@ -164,13 +164,11 @@ public class StaffDuty implements IStaffDuty {
CloudActivityEntity entity = new CloudActivityEntity(); CloudActivityEntity entity = new CloudActivityEntity();
String name = "云迹数据" + date; String name = "云迹数据" + date;
entity.setName(name); entity.setName(name);
entity.setCustomerCount(0);
entity.setWaitCount(0);
entity.setSentCount(0);
entity.setCity(city); entity.setCity(city);
entity.setCreateId(Integer.valueOf(staffEntity.getUserId())); entity.setCreateId(Integer.valueOf(staffEntity.getUserId()));
entity.setCreateName(staffEntity.getName()); entity.setCreateName(staffEntity.getName());
entity.setCreateTime(now); entity.setCreateTime(now);
setData(entity);
activityMapper.save(entity); activityMapper.save(entity);
} }
} else { } else {
...@@ -183,13 +181,11 @@ public class StaffDuty implements IStaffDuty { ...@@ -183,13 +181,11 @@ public class StaffDuty implements IStaffDuty {
CloudActivityEntity entity = new CloudActivityEntity(); CloudActivityEntity entity = new CloudActivityEntity();
String name = "云迹数据" + date; String name = "云迹数据" + date;
entity.setName(name); entity.setName(name);
entity.setCustomerCount(0);
entity.setWaitCount(0);
entity.setSentCount(0);
entity.setCity(city); entity.setCity(city);
entity.setCreateId(staffEntity.getUserId()); entity.setCreateId(staffEntity.getUserId());
entity.setCreateName(staffEntity.getName()); entity.setCreateName(staffEntity.getName());
entity.setCreateTime(now); entity.setCreateTime(now);
setData(entity);
activityMapper.save(entity); activityMapper.save(entity);
} }
} }
...@@ -207,6 +203,29 @@ public class StaffDuty implements IStaffDuty { ...@@ -207,6 +203,29 @@ public class StaffDuty implements IStaffDuty {
} }
} }
private void setData(CloudActivityEntity entity) {
entity.setCustomerCount(0);
entity.setWaitCount(0);
entity.setSentCount(0);
entity.setIsDelete(0);
//新增字段赋值
entity.setTotalPriceMin(0);
entity.setTotalPriceMax(0);
entity.setAreaMin(0);
entity.setAreaMax(0);
entity.setBlock("");
entity.setBlockName("");
entity.setDistrict("");
entity.setDistrictName("");
entity.setChannel("");
entity.setChannelName("");
entity.setSeeProjectName("");
entity.setSeeStartTime(null);
entity.setSeeEndTime(null);
entity.setSeeCount(0);
entity.setType(0);
}
/** /**
* 定时新增定制云迹活动 * 定时新增定制云迹活动
*/ */
...@@ -236,13 +255,12 @@ public class StaffDuty implements IStaffDuty { ...@@ -236,13 +255,12 @@ public class StaffDuty implements IStaffDuty {
CloudActivityEntity entity = new CloudActivityEntity(); CloudActivityEntity entity = new CloudActivityEntity();
String name = "定制云迹数据" + date; String name = "定制云迹数据" + date;
entity.setName(name); entity.setName(name);
entity.setCustomerCount(0);
entity.setWaitCount(0);
entity.setSentCount(0);
entity.setCity(c.getCityCode()); entity.setCity(c.getCityCode());
entity.setCreateId(c.getUserId()); entity.setCreateId(c.getUserId());
entity.setCreateName(c.getCreateName()); entity.setCreateName(c.getCreateName());
entity.setCreateTime(now); entity.setCreateTime(now);
//新增字段赋值
setData(entity);
activityMapper.save(entity); activityMapper.save(entity);
} }
} }
...@@ -335,6 +353,7 @@ public class StaffDuty implements IStaffDuty { ...@@ -335,6 +353,7 @@ public class StaffDuty implements IStaffDuty {
long seconds = 100; long seconds = 100;
if (redisUtil.setNX(key, value, seconds)) { if (redisUtil.setNX(key, value, seconds)) {
Map<String, Object> map = new HashMap<>(10); Map<String, Object> map = new HashMap<>(10);
map.put("type", 0);
List<CloudActivityEntity> list = activityMapper.queryByConditions(map); List<CloudActivityEntity> list = activityMapper.queryByConditions(map);
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
for (CloudActivityEntity c : list) { for (CloudActivityEntity c : list) {
...@@ -711,6 +730,7 @@ public class StaffDuty implements IStaffDuty { ...@@ -711,6 +730,7 @@ public class StaffDuty implements IStaffDuty {
map.put("group", 1); map.put("group", 1);
map.put("startTime", startTime); map.put("startTime", startTime);
map.put("endTime", endTime); map.put("endTime", endTime);
map.put("type", 0);
List<CloudActivityEntity> activeList1 = activityMapper.queryByConditions(map); List<CloudActivityEntity> activeList1 = activityMapper.queryByConditions(map);
if (CollectionUtils.isNotEmpty(activeList1)) { if (CollectionUtils.isNotEmpty(activeList1)) {
final List<CloudActivityEntity> activeList = activeList1; final List<CloudActivityEntity> activeList = activeList1;
......
...@@ -15,9 +15,31 @@ ...@@ -15,9 +15,31 @@
<result property="createName" column="create_name"/> <result property="createName" column="create_name"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="isDelete" column="is_delete"/> <result property="isDelete" column="is_delete"/>
<result property="totalPriceMin" column="total_price_min"/>
<result property="totalPriceMax" column="total_price_max"/>
<result property="areaMin" column="area_min"/>
<result property="areaMax" column="area_max"/>
<result property="block" column="block"/>
<result property="blockName" column="block_name"/>
<result property="district" column="district"/>
<result property="districtName" column="district_name"/>
<result property="channel" column="channel"/>
<result property="channelName" column="channel_name"/>
<result property="seeProjectName" column="see_project_name"/>
<result property="seeStartTime" column="see_start_time"/>
<result property="seeEndTime" column="see_end_time"/>
<result property="seeCount" column="see_count"/>
<result property="type" column="type"/>
</resultMap> </resultMap>
<insert id="save" parameterType="com.house365.beans.entity.CloudActivityEntity"> <sql id="sqlId">
id,name,customer_count,wait_count,sent_count,city,create_id,create_name,create_time,is_delete,total_price_min,total_price_max,
area_min,area_max,block,block_name,district,district_name,channel,channel_name,see_project_name,see_start_time,
see_end_time,see_count,type
</sql>
<insert id="save" useGeneratedKeys="true" keyProperty="id" parameterType="com.house365.beans.entity.CloudActivityEntity">
INSERT INTO cloud_activity ( INSERT INTO cloud_activity (
name, name,
customer_count, customer_count,
...@@ -27,7 +49,22 @@ ...@@ -27,7 +49,22 @@
create_id, create_id,
create_name, create_name,
create_time, create_time,
is_delete is_delete,
total_price_min,
total_price_max,
area_min,
area_max,
block,
block_name,
district,
district_name,
channel,
channel_name,
see_project_name,
see_start_time,
see_end_time,
see_count,
type
) )
VALUES ( VALUES (
#{name}, #{name},
...@@ -38,23 +75,46 @@ ...@@ -38,23 +75,46 @@
#{createId}, #{createId},
#{createName}, #{createName},
#{createTime}, #{createTime},
#{isDelete} #{isDelete},
#{totalPriceMin},
#{totalPriceMax},
#{areaMin},
#{areaMax},
#{block},
#{blockName},
#{district},
#{districtName},
#{channel},
#{channelName},
#{seeProjectName},
#{seeStartTime},
#{seeEndTime},
#{seeCount},
#{type}
) )
</insert> </insert>
<select id="getById" resultMap="infoMap" parameterType="map"> <select id="getById" resultMap="infoMap" parameterType="map">
SELECT SELECT
* <include refid="sqlId"/>
FROM FROM
cloud_activity cloud_activity
where is_delete = 0 AND id = #{id} where is_delete = 0 AND id = #{id}
</select>
<select id="getByIdAndDel" resultMap="infoMap" parameterType="map">
SELECT
<include refid="sqlId"/>
FROM
cloud_activity
where id = #{id}
</select> </select>
<select id="queryByConditions" resultMap="infoMap" parameterType="map"> <select id="queryByConditions" resultMap="infoMap" parameterType="map">
SELECT SELECT
* <include refid="sqlId"/>
FROM FROM
cloud_activity cloud_activity
where is_delete = 0 where is_delete = 0
<if test="name != null and name != ''"> <if test="name != null and name != ''">
AND name LIKE CONCAT('%',#{name},'%') AND name LIKE CONCAT('%',#{name},'%')
...@@ -77,6 +137,9 @@ ...@@ -77,6 +137,9 @@
<if test="id != null and id > 0 "> <if test="id != null and id > 0 ">
AND id = #{id} AND id = #{id}
</if> </if>
<if test="type != null and type >= 0 ">
AND type = #{type}
</if>
<if test="group != null and group > 0 "> <if test="group != null and group > 0 ">
group BY create_id group BY create_id
</if> </if>
...@@ -93,17 +156,18 @@ ...@@ -93,17 +156,18 @@
<select id="queryList" resultType="java.util.HashMap" parameterType="map"> <select id="queryList" resultType="java.util.HashMap" parameterType="map">
SELECT SELECT
id,name,customer_count as customerCount,wait_count as waitCount, id,name,customer_count as customerCount,wait_count as waitCount,
sent_count as sentCount,city,create_id as createId,create_name as createName, sent_count as sentCount,city,create_id as createId,create_name as createName,
create_time as createTime,is_delete as isDelete create_time as createTime,is_delete as isDelete
FROM FROM
cloud_activity cloud_activity
where is_delete = 0 where is_delete = 0
<if test="name != null and name != ''"> <if test="name != null and name != ''">
AND name LIKE CONCAT('%',#{name},'%') AND name LIKE CONCAT('%',#{name},'%')
</if> </if>
<if test="createId != null and createId > 0 "> <if test="createId != null and createId > 0 ">
AND (create_id = #{createId} OR create_id IN (SELECT id FROM user WHERE depturlpath LIKE (SELECT CONCAT(depturlpath,'/%') FROM user WHERE id = #{createId}))) AND (create_id = #{createId} OR create_id IN (SELECT id FROM user WHERE depturlpath LIKE (SELECT
CONCAT(depturlpath,'/%') FROM user WHERE id = #{createId})))
</if> </if>
<if test="createName != null and createName != ''"> <if test="createName != null and createName != ''">
AND create_name = #{createName} AND create_name = #{createName}
...@@ -114,6 +178,9 @@ ...@@ -114,6 +178,9 @@
<if test="city != null and city != ''"> <if test="city != null and city != ''">
AND city = #{city} AND city = #{city}
</if> </if>
<if test="type != null and type >= 0 ">
AND type = #{type}
</if>
ORDER BY id DESC ORDER BY id DESC
<if test="start != null and start >= 0 "> <if test="start != null and start >= 0 ">
limit #{start},#{limit} limit #{start},#{limit}
...@@ -128,7 +195,8 @@ ...@@ -128,7 +195,8 @@
AND name LIKE CONCAT('%',#{name},'%') AND name LIKE CONCAT('%',#{name},'%')
</if> </if>
<if test="createId != null and createId > 0 "> <if test="createId != null and createId > 0 ">
AND (create_id = #{createId} OR create_id IN (SELECT id FROM user WHERE depturlpath LIKE (SELECT CONCAT(depturlpath,'/%') FROM user WHERE id = #{createId}))) AND (create_id = #{createId} OR create_id IN (SELECT id FROM user WHERE depturlpath LIKE (SELECT
CONCAT(depturlpath,'/%') FROM user WHERE id = #{createId})))
</if> </if>
<if test="createName != null and createName != ''"> <if test="createName != null and createName != ''">
AND create_name = #{createName} AND create_name = #{createName}
...@@ -139,6 +207,16 @@ ...@@ -139,6 +207,16 @@
<if test="city != null and city != ''"> <if test="city != null and city != ''">
AND city = #{city} AND city = #{city}
</if> </if>
<if test="type != null and type >= 0 ">
AND type = #{type}
</if>
</select> </select>
<update id="updateStatus" parameterType="map">
UPDATE cloud_activity
SET
is_delete = #{isDelete}
WHERE id = #{id}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -68,3 +68,5 @@ crm.track.url = http://crm.house365.com/api/qlt/getImportantJoins ...@@ -68,3 +68,5 @@ crm.track.url = http://crm.house365.com/api/qlt/getImportantJoins
projects.server.url=http://oms.house365.com/test/adminpack/index.php projects.server.url=http://oms.house365.com/test/adminpack/index.php
#推广部同步用户url #推广部同步用户url
promote.url = http://365tgb.house365.com/api/app/syncUserFromApp promote.url = http://365tgb.house365.com/api/app/syncUserFromApp
#云迹拉取新接口地址
CLOUD.PULL.URL = http://192.168.105.121:8083/user/hgs/loginaccountinfo
...@@ -15,44 +15,104 @@ ...@@ -15,44 +15,104 @@
<result property="createName" column="create_name"/> <result property="createName" column="create_name"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="isDelete" column="is_delete"/> <result property="isDelete" column="is_delete"/>
<result property="totalPriceMin" column="total_price_min"/>
<result property="totalPriceMax" column="total_price_max"/>
<result property="areaMin" column="area_min"/>
<result property="areaMax" column="area_max"/>
<result property="block" column="block"/>
<result property="blockName" column="block_name"/>
<result property="district" column="district"/>
<result property="districtName" column="district_name"/>
<result property="channel" column="channel"/>
<result property="channelName" column="channel_name"/>
<result property="seeProjectName" column="see_project_name"/>
<result property="seeStartTime" column="see_start_time"/>
<result property="seeEndTime" column="see_end_time"/>
<result property="seeCount" column="see_count"/>
<result property="type" column="type"/>
</resultMap> </resultMap>
<insert id="save" parameterType="com.house365.beans.entity.CloudActivityEntity"> <sql id="sqlId">
id,name,customer_count,wait_count,sent_count,city,create_id,create_name,create_time,is_delete,total_price_min,total_price_max,
area_min,area_max,block,block_name,district,district_name,channel,channel_name,see_project_name,see_start_time,
see_end_time,see_count,type
</sql>
<insert id="save" useGeneratedKeys="true" keyProperty="id" parameterType="com.house365.beans.entity.CloudActivityEntity">
INSERT INTO cloud_activity ( INSERT INTO cloud_activity (
name, name,
customer_count, customer_count,
wait_count, wait_count,
sent_count, sent_count,
city, city,
create_id, create_id,
create_name, create_name,
create_time, create_time,
is_delete is_delete,
total_price_min,
total_price_max,
area_min,
area_max,
block,
block_name,
district,
district_name,
channel,
channel_name,
see_project_name,
see_start_time,
see_end_time,
see_count,
type
) )
VALUES ( VALUES (
#{name}, #{name},
#{customerCount}, #{customerCount},
#{waitCount}, #{waitCount},
#{sentCount}, #{sentCount},
#{city}, #{city},
#{createId}, #{createId},
#{createName}, #{createName},
#{createTime}, #{createTime},
#{isDelete} #{isDelete},
#{totalPriceMin},
#{totalPriceMax},
#{areaMin},
#{areaMax},
#{block},
#{blockName},
#{district},
#{districtName},
#{channel},
#{channelName},
#{seeProjectName},
#{seeStartTime},
#{seeEndTime},
#{seeCount},
#{type}
) )
</insert> </insert>
<select id="getById" resultMap="infoMap" parameterType="map"> <select id="getById" resultMap="infoMap" parameterType="map">
SELECT SELECT
* <include refid="sqlId"/>
FROM
cloud_activity
where is_delete = 0 AND id = #{id}
</select>
<select id="getByIdAndDel" resultMap="infoMap" parameterType="map">
SELECT
<include refid="sqlId"/>
FROM FROM
cloud_activity cloud_activity
where is_delete = 0 AND id = #{id} where id = #{id}
</select> </select>
<select id="queryByConditions" resultMap="infoMap" parameterType="map"> <select id="queryByConditions" resultMap="infoMap" parameterType="map">
SELECT SELECT
* <include refid="sqlId"/>
FROM FROM
cloud_activity cloud_activity
where is_delete = 0 where is_delete = 0
...@@ -77,6 +137,9 @@ ...@@ -77,6 +137,9 @@
<if test="id != null and id > 0 "> <if test="id != null and id > 0 ">
AND id = #{id} AND id = #{id}
</if> </if>
<if test="type != null and type >= 0 ">
AND type = #{type}
</if>
<if test="group != null and group > 0 "> <if test="group != null and group > 0 ">
group BY create_id group BY create_id
</if> </if>
...@@ -93,9 +156,9 @@ ...@@ -93,9 +156,9 @@
<select id="queryList" resultType="java.util.HashMap" parameterType="map"> <select id="queryList" resultType="java.util.HashMap" parameterType="map">
SELECT SELECT
id,name,customer_count as customerCount,wait_count as waitCount, id,name,customer_count as customerCount,wait_count as waitCount,
sent_count as sentCount,city,create_id as createId,create_name as createName, sent_count as sentCount,city,create_id as createId,create_name as createName,
create_time as createTime,is_delete as isDelete create_time as createTime,is_delete as isDelete
FROM FROM
cloud_activity cloud_activity
where is_delete = 0 where is_delete = 0
...@@ -103,7 +166,8 @@ ...@@ -103,7 +166,8 @@
AND name LIKE CONCAT('%',#{name},'%') AND name LIKE CONCAT('%',#{name},'%')
</if> </if>
<if test="createId != null and createId > 0 "> <if test="createId != null and createId > 0 ">
AND (create_id = #{createId} OR create_id IN (SELECT id FROM user WHERE depturlpath LIKE (SELECT CONCAT(depturlpath,'/%') FROM user WHERE id = #{createId}))) AND (create_id = #{createId} OR create_id IN (SELECT id FROM user WHERE depturlpath LIKE (SELECT
CONCAT(depturlpath,'/%') FROM user WHERE id = #{createId})))
</if> </if>
<if test="createName != null and createName != ''"> <if test="createName != null and createName != ''">
AND create_name = #{createName} AND create_name = #{createName}
...@@ -114,6 +178,9 @@ ...@@ -114,6 +178,9 @@
<if test="city != null and city != ''"> <if test="city != null and city != ''">
AND city = #{city} AND city = #{city}
</if> </if>
<if test="type != null and type >= 0 ">
AND type = #{type}
</if>
ORDER BY id DESC ORDER BY id DESC
<if test="start != null and start >= 0 "> <if test="start != null and start >= 0 ">
limit #{start},#{limit} limit #{start},#{limit}
...@@ -128,7 +195,8 @@ ...@@ -128,7 +195,8 @@
AND name LIKE CONCAT('%',#{name},'%') AND name LIKE CONCAT('%',#{name},'%')
</if> </if>
<if test="createId != null and createId > 0 "> <if test="createId != null and createId > 0 ">
AND (create_id = #{createId} OR create_id IN (SELECT id FROM user WHERE depturlpath LIKE (SELECT CONCAT(depturlpath,'/%') FROM user WHERE id = #{createId}))) AND (create_id = #{createId} OR create_id IN (SELECT id FROM user WHERE depturlpath LIKE (SELECT
CONCAT(depturlpath,'/%') FROM user WHERE id = #{createId})))
</if> </if>
<if test="createName != null and createName != ''"> <if test="createName != null and createName != ''">
AND create_name = #{createName} AND create_name = #{createName}
...@@ -139,6 +207,16 @@ ...@@ -139,6 +207,16 @@
<if test="city != null and city != ''"> <if test="city != null and city != ''">
AND city = #{city} AND city = #{city}
</if> </if>
<if test="type != null and type >= 0 ">
AND type = #{type}
</if>
</select> </select>
<update id="updateStatus" parameterType="map">
UPDATE cloud_activity
SET
is_delete = #{isDelete}
WHERE id = #{id}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -69,4 +69,6 @@ crm.track.url = http://crm.house365.com/api/qlt/getImportantJoins ...@@ -69,4 +69,6 @@ crm.track.url = http://crm.house365.com/api/qlt/getImportantJoins
projects.server.url=http://oms.house365.com/tpp/adminpack/index.php projects.server.url=http://oms.house365.com/tpp/adminpack/index.php
#推广部同步用户url #推广部同步用户url
promote.url = http://365tgb.house365.com/api/app/syncUserFromApp promote.url = http://365tgb.house365.com/api/app/syncUserFromApp
#云迹拉取新接口地址
CLOUD.PULL.URL = http://192.168.105.121:8083/user/hgs/loginaccountinfo
...@@ -15,9 +15,31 @@ ...@@ -15,9 +15,31 @@
<result property="createName" column="create_name"/> <result property="createName" column="create_name"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="isDelete" column="is_delete"/> <result property="isDelete" column="is_delete"/>
<result property="totalPriceMin" column="total_price_min"/>
<result property="totalPriceMax" column="total_price_max"/>
<result property="areaMin" column="area_min"/>
<result property="areaMax" column="area_max"/>
<result property="block" column="block"/>
<result property="blockName" column="block_name"/>
<result property="district" column="district"/>
<result property="districtName" column="district_name"/>
<result property="channel" column="channel"/>
<result property="channelName" column="channel_name"/>
<result property="seeProjectName" column="see_project_name"/>
<result property="seeStartTime" column="see_start_time"/>
<result property="seeEndTime" column="see_end_time"/>
<result property="seeCount" column="see_count"/>
<result property="type" column="type"/>
</resultMap> </resultMap>
<insert id="save" parameterType="com.house365.beans.entity.CloudActivityEntity"> <sql id="sqlId">
id,name,customer_count,wait_count,sent_count,city,create_id,create_name,create_time,is_delete,total_price_min,total_price_max,
area_min,area_max,block,block_name,district,district_name,channel,channel_name,see_project_name,see_start_time,
see_end_time,see_count,type
</sql>
<insert id="save" useGeneratedKeys="true" keyProperty="id" parameterType="com.house365.beans.entity.CloudActivityEntity">
INSERT INTO cloud_activity ( INSERT INTO cloud_activity (
name, name,
customer_count, customer_count,
...@@ -27,7 +49,22 @@ ...@@ -27,7 +49,22 @@
create_id, create_id,
create_name, create_name,
create_time, create_time,
is_delete is_delete,
total_price_min,
total_price_max,
area_min,
area_max,
block,
block_name,
district,
district_name,
channel,
channel_name,
see_project_name,
see_start_time,
see_end_time,
see_count,
type
) )
VALUES ( VALUES (
#{name}, #{name},
...@@ -38,21 +75,44 @@ ...@@ -38,21 +75,44 @@
#{createId}, #{createId},
#{createName}, #{createName},
#{createTime}, #{createTime},
#{isDelete} #{isDelete},
#{totalPriceMin},
#{totalPriceMax},
#{areaMin},
#{areaMax},
#{block},
#{blockName},
#{district},
#{districtName},
#{channel},
#{channelName},
#{seeProjectName},
#{seeStartTime},
#{seeEndTime},
#{seeCount},
#{type}
) )
</insert> </insert>
<select id="getById" resultMap="infoMap" parameterType="map"> <select id="getById" resultMap="infoMap" parameterType="map">
SELECT SELECT
* <include refid="sqlId"/>
FROM
cloud_activity
where is_delete = 0 AND id = #{id}
</select>
<select id="getByIdAndDel" resultMap="infoMap" parameterType="map">
SELECT
<include refid="sqlId"/>
FROM FROM
cloud_activity cloud_activity
where is_delete = 0 AND id = #{id} where id = #{id}
</select> </select>
<select id="queryByConditions" resultMap="infoMap" parameterType="map"> <select id="queryByConditions" resultMap="infoMap" parameterType="map">
SELECT SELECT
* <include refid="sqlId"/>
FROM FROM
cloud_activity cloud_activity
where is_delete = 0 where is_delete = 0
...@@ -77,6 +137,9 @@ ...@@ -77,6 +137,9 @@
<if test="id != null and id > 0 "> <if test="id != null and id > 0 ">
AND id = #{id} AND id = #{id}
</if> </if>
<if test="type != null and type >= 0 ">
AND type = #{type}
</if>
<if test="group != null and group > 0 "> <if test="group != null and group > 0 ">
group BY create_id group BY create_id
</if> </if>
...@@ -103,7 +166,8 @@ ...@@ -103,7 +166,8 @@
AND name LIKE CONCAT('%',#{name},'%') AND name LIKE CONCAT('%',#{name},'%')
</if> </if>
<if test="createId != null and createId > 0 "> <if test="createId != null and createId > 0 ">
AND (create_id = #{createId} OR create_id IN (SELECT id FROM user WHERE depturlpath LIKE (SELECT CONCAT(depturlpath,'/%') FROM user WHERE id = #{createId}))) AND (create_id = #{createId} OR create_id IN (SELECT id FROM user WHERE depturlpath LIKE (SELECT
CONCAT(depturlpath,'/%') FROM user WHERE id = #{createId})))
</if> </if>
<if test="createName != null and createName != ''"> <if test="createName != null and createName != ''">
AND create_name = #{createName} AND create_name = #{createName}
...@@ -114,6 +178,9 @@ ...@@ -114,6 +178,9 @@
<if test="city != null and city != ''"> <if test="city != null and city != ''">
AND city = #{city} AND city = #{city}
</if> </if>
<if test="type != null and type >= 0 ">
AND type = #{type}
</if>
ORDER BY id DESC ORDER BY id DESC
<if test="start != null and start >= 0 "> <if test="start != null and start >= 0 ">
limit #{start},#{limit} limit #{start},#{limit}
...@@ -128,7 +195,8 @@ ...@@ -128,7 +195,8 @@
AND name LIKE CONCAT('%',#{name},'%') AND name LIKE CONCAT('%',#{name},'%')
</if> </if>
<if test="createId != null and createId > 0 "> <if test="createId != null and createId > 0 ">
AND (create_id = #{createId} OR create_id IN (SELECT id FROM user WHERE depturlpath LIKE (SELECT CONCAT(depturlpath,'/%') FROM user WHERE id = #{createId}))) AND (create_id = #{createId} OR create_id IN (SELECT id FROM user WHERE depturlpath LIKE (SELECT
CONCAT(depturlpath,'/%') FROM user WHERE id = #{createId})))
</if> </if>
<if test="createName != null and createName != ''"> <if test="createName != null and createName != ''">
AND create_name = #{createName} AND create_name = #{createName}
...@@ -139,6 +207,16 @@ ...@@ -139,6 +207,16 @@
<if test="city != null and city != ''"> <if test="city != null and city != ''">
AND city = #{city} AND city = #{city}
</if> </if>
<if test="type != null and type >= 0 ">
AND type = #{type}
</if>
</select> </select>
<update id="updateStatus" parameterType="map">
UPDATE cloud_activity
SET
is_delete = #{isDelete}
WHERE id = #{id}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -69,4 +69,6 @@ crm.track.url = http://crm.house365.com/api/qlt/getImportantJoins ...@@ -69,4 +69,6 @@ crm.track.url = http://crm.house365.com/api/qlt/getImportantJoins
projects.server.url=http://oms.house365.com/test/adminpack/index.php projects.server.url=http://oms.house365.com/test/adminpack/index.php
#推广部同步用户url #推广部同步用户url
promote.url = http://365tgb.house365.com/api/app/syncUserFromApp promote.url = http://365tgb.house365.com/api/app/syncUserFromApp
#云迹拉取新接口地址
CLOUD.PULL.URL = http://192.168.105.121:8083/user/hgs/loginaccountinfo
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