Commit 06c61ebb authored by jay's avatar jay

上下线相关需求提交

parent 788cd751
package com.house365.beans.entity;
import com.house365.beans.system.DomainObject;
import java.util.Date;
/**
* 上下线操作日志表
*
* @author Created by 365 on 2020/12/31.
*/
public class OnlineLogEntity extends DomainObject {
private static final long serialVersionUID = 1L;
private int oldStatus;
private int newStatus;
private int userId;
private Date createTime;
public int getOldStatus() {
return oldStatus;
}
public void setOldStatus(int oldStatus) {
this.oldStatus = oldStatus;
}
public int getNewStatus() {
return newStatus;
}
public void setNewStatus(int newStatus) {
this.newStatus = newStatus;
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
...@@ -78,13 +78,6 @@ public class UserEntity extends DomainObject { ...@@ -78,13 +78,6 @@ public class UserEntity extends DomainObject {
@Length(max = 11, message = "长度需要大于0且小于11") @Length(max = 11, message = "长度需要大于0且小于11")
private String cornet; private String cornet;
public String getManagerName() {
return managerName;
}
public void setManagerName(String managerName) {
this.managerName = managerName;
}
/** /**
* 部门编号 * 部门编号
...@@ -100,21 +93,6 @@ public class UserEntity extends DomainObject { ...@@ -100,21 +93,6 @@ public class UserEntity extends DomainObject {
private String kefuAccid; private String kefuAccid;
public String getSetKefu() {
return setKefu;
}
public void setSetKefu(String setKefu) {
this.setKefu = setKefu;
}
public String getKefuAccid() {
return kefuAccid;
}
public void setKefuAccid(String kefuAccid) {
this.kefuAccid = kefuAccid;
}
private String resourceId;//资源ID private String resourceId;//资源ID
...@@ -165,7 +143,7 @@ public class UserEntity extends DomainObject { ...@@ -165,7 +143,7 @@ public class UserEntity extends DomainObject {
/** /**
* 1启用 0冻结 * 1启用 0冻结
*/ */
private java.lang.Boolean enabled; private Boolean enabled;
/** /**
* 创建人用户ID * 创建人用户ID
...@@ -240,12 +218,22 @@ public class UserEntity extends DomainObject { ...@@ -240,12 +218,22 @@ public class UserEntity extends DomainObject {
private Integer evaluateCount; private Integer evaluateCount;
//所属城市 //所属城市
private String city; private String city;
private String cityName;//城市名称 //城市名称
private String cityName;
//带看次数 //带看次数
private Integer seeCount; private Integer seeCount;
private String wxNumber; private String wxNumber;
private String wxCodeImgUrl; private String wxCodeImgUrl;
private Integer onlineStatus;
public String getManagerName() {
return managerName;
}
public void setManagerName(String managerName) {
this.managerName = managerName;
}
public String getImshow() { public String getImshow() {
return imshow; return imshow;
...@@ -415,6 +403,22 @@ public class UserEntity extends DomainObject { ...@@ -415,6 +403,22 @@ public class UserEntity extends DomainObject {
this.deptUrlPath = deptUrlPath; this.deptUrlPath = deptUrlPath;
} }
public String getSetKefu() {
return setKefu;
}
public void setSetKefu(String setKefu) {
this.setKefu = setKefu;
}
public String getKefuAccid() {
return kefuAccid;
}
public void setKefuAccid(String kefuAccid) {
this.kefuAccid = kefuAccid;
}
/** /**
* 获取用户名 * 获取用户名
* *
...@@ -895,6 +899,14 @@ public class UserEntity extends DomainObject { ...@@ -895,6 +899,14 @@ public class UserEntity extends DomainObject {
this.promoteId = promoteId; this.promoteId = promoteId;
} }
public Integer getOnlineStatus() {
return onlineStatus;
}
public void setOnlineStatus(Integer onlineStatus) {
this.onlineStatus = onlineStatus;
}
/** /**
* 实体的toString方法 * 实体的toString方法
* *
......
package com.house365.beans.entity;
import com.house365.beans.system.DomainObject;
import java.util.Date;
/**
* 上下线用户信息实体类
*
* @author Created by 365 on 2020/12/30.
*/
public class UserMessageEntity extends DomainObject {
private static final long serialVersionUID = 1L;
private String sender;
private String receiver;
private Date createTime;
private Date updateTime;
public String getSender() {
return sender;
}
public void setSender(String sender) {
this.sender = sender;
}
public String getReceiver() {
return receiver;
}
public void setReceiver(String receiver) {
this.receiver = receiver;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
...@@ -430,13 +430,16 @@ public class MarketingActivityController extends BaseController { ...@@ -430,13 +430,16 @@ public class MarketingActivityController extends BaseController {
List<DutyStaffEntity> dutylist = iuser.getOndutyById(uid); List<DutyStaffEntity> dutylist = iuser.getOndutyById(uid);
if (dutylist != null && dutylist.size() > 0) { if (dutylist != null && dutylist.size() > 0) {
if ("1".equals(dutylist.get(0).getOnduty())) { if ("1".equals(dutylist.get(0).getOnduty())) {
model.addAttribute("limitDate", "0");//名单内:值班不限制时间选择范围 //名单内:值班不限制时间选择范围
model.addAttribute("limitDate", "0");
} }
if ("0".equals(dutylist.get(0).getOnduty())) { if ("0".equals(dutylist.get(0).getOnduty())) {
model.addAttribute("limitDate", "1");//名单内:非值班限制时间选择范围 //名单内:非值班限制时间选择范围
model.addAttribute("limitDate", "1");
} }
} else { } else {
model.addAttribute("limitDate", "0");//名单外不限制时间选择范围 //名单外不限制时间选择范围
model.addAttribute("limitDate", "0");
} }
List<DictionaryEntity> blocks = new ArrayList<>(); List<DictionaryEntity> blocks = new ArrayList<>();
...@@ -502,6 +505,7 @@ public class MarketingActivityController extends BaseController { ...@@ -502,6 +505,7 @@ public class MarketingActivityController extends BaseController {
DepartmentEntity departmentEntity = (DepartmentEntity) request.getSession().getAttribute( DepartmentEntity departmentEntity = (DepartmentEntity) request.getSession().getAttribute(
SessionConstants.SESSION_CURRNET_DEPT_KEY); SessionConstants.SESSION_CURRNET_DEPT_KEY);
String cityId = departmentEntity.getCityID(); String cityId = departmentEntity.getCityID();
String cityCode = departmentEntity.getDescripition();
List<NameValuePair> nameValuePairList = new ArrayList<>(); List<NameValuePair> nameValuePairList = new ArrayList<>();
String total = "0"; String total = "0";
House365RestObject restObject = new House365RestObject(); House365RestObject restObject = new House365RestObject();
...@@ -562,7 +566,7 @@ public class MarketingActivityController extends BaseController { ...@@ -562,7 +566,7 @@ public class MarketingActivityController extends BaseController {
nameValuePairList.add(new BasicNameValuePair("page", "1")); nameValuePairList.add(new BasicNameValuePair("page", "1"));
nameValuePairList.add(new BasicNameValuePair("limit", "1000")); nameValuePairList.add(new BasicNameValuePair("limit", "1000"));
} }
setApplySource(request, entity); setApplySource(request, entity, cityCode);
wrapNameValuePairList(vo, nameValuePairList, entity); wrapNameValuePairList(vo, nameValuePairList, entity);
String preResult = HttpClientUtil.doGet(crmQueryURL, nameValuePairList); String preResult = HttpClientUtil.doGet(crmQueryURL, nameValuePairList);
...@@ -624,7 +628,7 @@ public class MarketingActivityController extends BaseController { ...@@ -624,7 +628,7 @@ public class MarketingActivityController extends BaseController {
return result; return result;
} }
private void setApplySource(HttpServletRequest request, MarketingActivityEntity entity) { private void setApplySource(HttpServletRequest request, MarketingActivityEntity entity, String cityCode) {
Set<String> crmSourceSet = new HashSet<>(); Set<String> crmSourceSet = new HashSet<>();
//根据快捷来源选择所有下级CRM来源 v3.2.0 //根据快捷来源选择所有下级CRM来源 v3.2.0
String quickSources = request.getParameter("quickSource"); String quickSources = request.getParameter("quickSource");
...@@ -633,17 +637,22 @@ public class MarketingActivityController extends BaseController { ...@@ -633,17 +637,22 @@ public class MarketingActivityController extends BaseController {
List<CrmSourceEntity> sourceList = crmSourceService.getListByCategory(source); List<CrmSourceEntity> sourceList = crmSourceService.getListByCategory(source);
if (sourceList != null && !sourceList.isEmpty()) { if (sourceList != null && !sourceList.isEmpty()) {
for (CrmSourceEntity sourceEntity : sourceList) { for (CrmSourceEntity sourceEntity : sourceList) {
crmSourceSet.add(String.valueOf(sourceEntity.getSourceId())); //南京站新需求 过滤400来电562 和房博士im咨询99
if ("nj".equals(cityCode)) {
if (sourceEntity.getSourceId() != 99 && sourceEntity.getSourceId() != 562) {
crmSourceSet.add(String.valueOf(sourceEntity.getSourceId()));
}
} else {
crmSourceSet.add(String.valueOf(sourceEntity.getSourceId()));
}
} }
} }
} }
if (!crmSourceSet.isEmpty()) { if (!crmSourceSet.isEmpty()) {
String source = Joiner.on(",").join(crmSourceSet); String source = Joiner.on(",").join(crmSourceSet);
entity.setApplySource(source); entity.setApplySource(source);
entity.setApplySourceName("电商、房博士、400电话、楼盘订阅、看房团"); entity.setApplySourceName("电商、房博士、400电话、楼盘订阅、看房团");
} }
} }
} }
...@@ -686,7 +695,6 @@ public class MarketingActivityController extends BaseController { ...@@ -686,7 +695,6 @@ public class MarketingActivityController extends BaseController {
new BigDecimal(100)).intValue(); new BigDecimal(100)).intValue();
completePercent = String.valueOf(percent); completePercent = String.valueOf(percent);
} }
} }
Map<String, String> pam = new HashMap<>(10); Map<String, String> pam = new HashMap<>(10);
pam.put("protectCount", "" + protect); pam.put("protectCount", "" + protect);
...@@ -702,8 +710,7 @@ public class MarketingActivityController extends BaseController { ...@@ -702,8 +710,7 @@ public class MarketingActivityController extends BaseController {
@ResponseBody @ResponseBody
public Object importData(MarketingActivityVo vo, HttpServletRequest request) { public Object importData(MarketingActivityVo vo, HttpServletRequest request) {
String result = "fail"; String result = "fail";
DepartmentEntity departmentEntity = (DepartmentEntity) request.getSession().getAttribute( DepartmentEntity departmentEntity = (DepartmentEntity) request.getSession().getAttribute(SessionConstants.SESSION_CURRNET_DEPT_KEY);
SessionConstants.SESSION_CURRNET_DEPT_KEY);
String cityId = departmentEntity.getCityID(); String cityId = departmentEntity.getCityID();
DepartmentResponse departmentResponse = department.getDepartmentById(Integer.valueOf(cityId)); DepartmentResponse departmentResponse = department.getDepartmentById(Integer.valueOf(cityId));
DepartmentEntity city = departmentResponse.getEntity(); DepartmentEntity city = departmentResponse.getEntity();
...@@ -737,7 +744,7 @@ public class MarketingActivityController extends BaseController { ...@@ -737,7 +744,7 @@ public class MarketingActivityController extends BaseController {
entity.setBrowseProjectId(seeProjectId); entity.setBrowseProjectId(seeProjectId);
entity.setBuildingId(projectId); entity.setBuildingId(projectId);
setApplySource(request, entity); setApplySource(request, entity, city.getDescripition());
wrapMap(entity, paraMap); wrapMap(entity, paraMap);
...@@ -784,34 +791,6 @@ public class MarketingActivityController extends BaseController { ...@@ -784,34 +791,6 @@ public class MarketingActivityController extends BaseController {
} }
}); });
result = "success"; result = "success";
// //保存查询条件
// MarketingActivityEntity marketingactivityentity = vo.getEntity();
// MarketingActivityEntity querycondentity = new MarketingActivityEntity();
// querycondentity.setName(marketingactivityentity.getName());
// querycondentity.setMobile(marketingactivityentity.getMobile());
// querycondentity.setMobileType(marketingactivityentity.getMobileType());
// querycondentity.setBuildingId(vo.getBuildingId());
// querycondentity.setBuildingName(vo.getBuildingName());
// querycondentity.setTotalPriceLower(marketingactivityentity.getTotalPriceLower());
// querycondentity.setTotalPriceHigher(marketingactivityentity.getTotalPriceHigher());
// querycondentity.setAreaLower(marketingactivityentity.getAreaLower());
// querycondentity.setAreaHigher(marketingactivityentity.getAreaHigher());
// querycondentity.setBlock(marketingactivityentity.getBlock());
// querycondentity.setDistrict(marketingactivityentity.getDistrict());
// querycondentity.setChannel(marketingactivityentity.getChannel());
// querycondentity.setChannelName(marketingactivityentity.getChannelName());
// querycondentity.setReturnVisitStatus(marketingactivityentity.getReturnVisitStatus());
// querycondentity.setReturnVisitResult(marketingactivityentity.getReturnVisitResult());
// querycondentity.setBrowseProject(vo.getProjectName());
// querycondentity.setBrowseProjectId(vo.getProjectId());
// querycondentity.setSeeCount(vo.getSeeCount());
// querycondentity.setActivityId(marketingactivityentity.getId());
// querycondentity.setBlockName(marketingactivityentity.getBlockName());
// querycondentity.setDistrictName(marketingactivityentity.getDistrictName());
//// querycondentity.setQueryCondStatus(0);//默认:0:未激活,1:激活
// MarketingActivityRequest maq = new MarketingActivityRequest();
// maq.setEntity(querycondentity);
// marketingActivity.addQueryCond(maq);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
activityLogger.error(e.getMessage(), e); activityLogger.error(e.getMessage(), e);
...@@ -878,8 +857,7 @@ public class MarketingActivityController extends BaseController { ...@@ -878,8 +857,7 @@ public class MarketingActivityController extends BaseController {
public String list(Integer number, Model model, HttpServletRequest request) { public String list(Integer number, Model model, HttpServletRequest request) {
UserEntity userEntity = (UserEntity) request.getSession().getAttribute(SessionConstants.THREAD_USER_KEY); UserEntity userEntity = (UserEntity) request.getSession().getAttribute(SessionConstants.THREAD_USER_KEY);
DepartmentEntity departmentEntity = (DepartmentEntity) request.getSession().getAttribute( DepartmentEntity departmentEntity = (DepartmentEntity) request.getSession().getAttribute(SessionConstants.SESSION_CURRNET_DEPT_KEY);
SessionConstants.SESSION_CURRNET_DEPT_KEY);
String cityId = departmentEntity.getCityID(); String cityId = departmentEntity.getCityID();
DepartmentResponse departmentResponse = department.getDepartmentById(Integer.valueOf(cityId)); DepartmentResponse departmentResponse = department.getDepartmentById(Integer.valueOf(cityId));
DepartmentEntity city = departmentResponse.getEntity(); DepartmentEntity city = departmentResponse.getEntity();
...@@ -1316,11 +1294,6 @@ public class MarketingActivityController extends BaseController { ...@@ -1316,11 +1294,6 @@ public class MarketingActivityController extends BaseController {
new BasicNameValuePair("visit_status", String.valueOf(entity.getReturnVisitStatus()))); new BasicNameValuePair("visit_status", String.valueOf(entity.getReturnVisitStatus())));
} }
// if (entity.getReturnVisitResult() != null) {
// nameValuePairList.add(
// new BasicNameValuePair("visit_result", String.valueOf(entity.getReturnVisitResult())));
// }
if (!Strings.isNullOrEmpty(entity.getReturnVisitResult())) { if (!Strings.isNullOrEmpty(entity.getReturnVisitResult())) {
nameValuePairList.add(new BasicNameValuePair("visit_result[]", String.valueOf(entity.getReturnVisitResult()))); nameValuePairList.add(new BasicNameValuePair("visit_result[]", String.valueOf(entity.getReturnVisitResult())));
} }
......
...@@ -436,8 +436,7 @@ public class UserController extends BaseController { ...@@ -436,8 +436,7 @@ public class UserController extends BaseController {
public String updateForm(@PathVariable(value = "id") Integer id, HttpServletRequest request, Model model) { public String updateForm(@PathVariable(value = "id") Integer id, HttpServletRequest request, Model model) {
UserResponse response = user.getUserById(id); UserResponse response = user.getUserById(id);
UserEntity userEntity = response.getEntity(); UserEntity userEntity = response.getEntity();
AttachmentListResponse headImgRes = attachmentInterface.queryByResourceIdAndResouceType(String.valueOf(id), AttachmentListResponse headImgRes = attachmentInterface.queryByResourceIdAndResouceType(String.valueOf(id), "hgs_user_headImg");
"hgs_user_headImg");
DepartmentListRequest listReq = new DepartmentListRequest(); DepartmentListRequest listReq = new DepartmentListRequest();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
...@@ -448,8 +447,7 @@ public class UserController extends BaseController { ...@@ -448,8 +447,7 @@ public class UserController extends BaseController {
userEntity.setHeadImgURL(""); userEntity.setHeadImgURL("");
} }
AttachmentListResponse fullImgRes = attachmentInterface.queryByResourceIdAndResouceType(String.valueOf(id), AttachmentListResponse fullImgRes = attachmentInterface.queryByResourceIdAndResouceType(String.valueOf(id), "hgs_user_fullImg");
"hgs_user_fullImg");
if (null != fullImgRes.getObjectList() && !fullImgRes.getObjectList().isEmpty()) { if (null != fullImgRes.getObjectList() && !fullImgRes.getObjectList().isEmpty()) {
BaseAttachment attachment = (BaseAttachment) fullImgRes.getObjectList().get(0); BaseAttachment attachment = (BaseAttachment) fullImgRes.getObjectList().get(0);
userEntity.setFullImgURL(attachment.getRemotePath()); userEntity.setFullImgURL(attachment.getRemotePath());
...@@ -457,11 +455,9 @@ public class UserController extends BaseController { ...@@ -457,11 +455,9 @@ public class UserController extends BaseController {
userEntity.setFullImgURL(""); userEntity.setFullImgURL("");
} }
DepartmentEntity departmentEntity = (DepartmentEntity) request.getSession().getAttribute( DepartmentEntity departmentEntity = (DepartmentEntity) request.getSession().getAttribute(SessionConstants.SESSION_REAL_DEPT_KEY);
SessionConstants.SESSION_REAL_DEPT_KEY);
if (PathUtil.isAdminDept(departmentEntity)) { if (PathUtil.isAdminDept(departmentEntity)) {
departmentEntity = (DepartmentEntity) request.getSession().getAttribute( departmentEntity = (DepartmentEntity) request.getSession().getAttribute(SessionConstants.SESSION_CURRNET_DEPT_KEY);
SessionConstants.SESSION_CURRNET_DEPT_KEY);
} }
DepartmentResponse deptEntity = department.getDepartmentById(departmentEntity.getId()); DepartmentResponse deptEntity = department.getDepartmentById(departmentEntity.getId());
map.put("LIKE_urlPath", deptEntity.getEntity().getUrlPath()); map.put("LIKE_urlPath", deptEntity.getEntity().getUrlPath());
...@@ -824,7 +820,7 @@ public class UserController extends BaseController { ...@@ -824,7 +820,7 @@ public class UserController extends BaseController {
List<String> paramList = new ArrayList<>(); List<String> paramList = new ArrayList<>();
List<NameValuePair> directParams = new ArrayList<>(); List<NameValuePair> directParams = new ArrayList<>();
directParams.add(new BasicNameValuePair("access_token", token)); directParams.add(new BasicNameValuePair("access_token", token));
directParams.add(new BasicNameValuePair("department_id", "270")); directParams.add(new BasicNameValuePair("department_id", "2"));
directParams.add(new BasicNameValuePair("fetch_child", "1")); directParams.add(new BasicNameValuePair("fetch_child", "1"));
for (NameValuePair pair : directParams) { for (NameValuePair pair : directParams) {
paramList.add(pair.getName() + "=" + pair.getValue()); paramList.add(pair.getName() + "=" + pair.getValue());
......
...@@ -373,5 +373,20 @@ ...@@ -373,5 +373,20 @@
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--更新用户上下线状态-->
<dubbo:reference id="updateUserStatus" interface="com.house365.ws.interfaces.rest.IUpdateUserStatus"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--上下线用户信息新增接口-->
<dubbo:reference id="saveNewMessage" interface="com.house365.ws.interfaces.rest.ISaveNewMessage"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--获取上下线用户信息接口-->
<dubbo:reference id="getNewUserInfo" interface="com.house365.ws.interfaces.rest.IGetNewUserInfo"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
</beans> </beans>
...@@ -370,5 +370,20 @@ ...@@ -370,5 +370,20 @@
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--更新用户上下线状态-->
<dubbo:reference id="updateUserStatus" interface="com.house365.ws.interfaces.rest.IUpdateUserStatus"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--上下线用户信息新增接口-->
<dubbo:reference id="saveNewMessage" interface="com.house365.ws.interfaces.rest.ISaveNewMessage"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--获取上下线用户信息接口-->
<dubbo:reference id="getNewUserInfo" interface="com.house365.ws.interfaces.rest.IGetNewUserInfo"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
</beans> </beans>
...@@ -370,5 +370,20 @@ ...@@ -370,5 +370,20 @@
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--更新用户上下线状态-->
<dubbo:reference id="updateUserStatus" interface="com.house365.ws.interfaces.rest.IUpdateUserStatus"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--上下线用户信息新增接口-->
<dubbo:reference id="saveNewMessage" interface="com.house365.ws.interfaces.rest.ISaveNewMessage"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--获取上下线用户信息接口-->
<dubbo:reference id="getNewUserInfo" interface="com.house365.ws.interfaces.rest.IGetNewUserInfo"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
</beans> </beans>
...@@ -109,10 +109,6 @@ ...@@ -109,10 +109,6 @@
<div class="span4 control-group"> <div class="span4 control-group">
<label class="control-label"><span style="color: red">*</span>报名时间:</label> <label class="control-label"><span style="color: red">*</span>报名时间:</label>
<div class="controls"> <div class="controls">
<%--<input type="hidden" id="applyStartTime" name="entity.applyStartTimeStr"--%>
<%--value="<fmt:formatDate value='${entity.applyStartTime}' pattern='yyyy-MM-dd' />"/>--%>
<%--<input type="hidden" id="applyEndTime" name="entity.applyEndTimeStr"--%>
<%--value="<fmt:formatDate value='${entity.applyEndTime}' pattern='yyyy-MM-dd' />"/>--%>
<input type="hidden" id="applyStartTime" name="entity.applyStartTimeStr"/> <input type="hidden" id="applyStartTime" name="entity.applyStartTimeStr"/>
<input type="hidden" id="applyEndTime" name="entity.applyEndTimeStr"/> <input type="hidden" id="applyEndTime" name="entity.applyEndTimeStr"/>
<input type="text" id="signTime" name="signTime" class="form-control span12"> <input type="text" id="signTime" name="signTime" class="form-control span12">
......
package com.house365.ws.interfaces.rest;
import com.house365.rest.context.IService;
/**
* @author Created by 365 on 2020/12/30.
*/
public interface IGetNewUserInfo extends IService {
}
package com.house365.ws.interfaces.rest;
import com.house365.rest.context.IService;
/**
* @author Created by 365 on 2020/12/30.
*/
public interface ISaveNewMessage extends IService {
}
package com.house365.ws.interfaces.rest;
import com.house365.rest.context.IService;
/**
* @author Created by 365 on 2020/12/30.
*/
public interface IUpdateUserStatus extends IService {
}
package com.house365.ws.dao.mapper;
import com.house365.beans.entity.OnlineLogEntity;
import org.springframework.stereotype.Repository;
/**
* @author Created by 365 on 2020/12/31.
*/
@Repository
public interface OnlineLogMapper {
void save(OnlineLogEntity entity);
}
...@@ -49,4 +49,6 @@ public interface UserMapper { ...@@ -49,4 +49,6 @@ public interface UserMapper {
List<UserEntity> getManagerByPid(Map<String, Object> map); List<UserEntity> getManagerByPid(Map<String, Object> map);
void updateUserStatus(Map<String,Object> map);
} }
package com.house365.ws.dao.mapper;
import com.house365.beans.entity.UserMessageEntity;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
* @author Created by 365 on 2020/12/30.
*/
@Repository
public interface UserMessageMapper {
void getById(int id);
List<UserMessageEntity> queryByConditions(Map<String, Object> map);
void save(UserMessageEntity entity);
void update(UserMessageEntity entity);
}
...@@ -1548,7 +1548,6 @@ public class CustomerImpl implements ICustomer { ...@@ -1548,7 +1548,6 @@ public class CustomerImpl implements ICustomer {
Date newdate = new Date(); Date newdate = new Date();
Integer oldManagerId = customer.getManagerId(); Integer oldManagerId = customer.getManagerId();
String oldManagerName = customer.getManagerName(); String oldManagerName = customer.getManagerName();
// Integer newManagerId = userId;
String newManagerName = user.getRealName(); String newManagerName = user.getRealName();
String oldPhone = customer.getPhone(); String oldPhone = customer.getPhone();
Map<String, Object> paramMap = new HashMap<>(10); Map<String, Object> paramMap = new HashMap<>(10);
...@@ -1564,7 +1563,6 @@ public class CustomerImpl implements ICustomer { ...@@ -1564,7 +1563,6 @@ public class CustomerImpl implements ICustomer {
customerService.update(customer); customerService.update(customer);
} }
if (isHandover && !userId.equals(oldManagerId)) { if (isHandover && !userId.equals(oldManagerId)) {
// Map<String, Object> paramMap = new HashMap<>(10);
paramMap.put("oldManagerId", oldManagerId); paramMap.put("oldManagerId", oldManagerId);
paramMap.put("oldManagerName", oldManagerName); paramMap.put("oldManagerName", oldManagerName);
paramMap.put("newManagerId", userId); paramMap.put("newManagerId", userId);
...@@ -1575,14 +1573,12 @@ public class CustomerImpl implements ICustomer { ...@@ -1575,14 +1573,12 @@ public class CustomerImpl implements ICustomer {
paramMap.put("updateTime", newdate); paramMap.put("updateTime", newdate);
paramMap.put("bindTime", newdate); paramMap.put("bindTime", newdate);
paramMap.put("isHandover", 1); paramMap.put("isHandover", 1);
// customer.setIsHandover(1);
customerMapper.transferManagerInfo(paramMap); customerMapper.transferManagerInfo(paramMap);
} }
paramMap.clear(); paramMap.clear();
//转移后的安家顾问下此客户phone //转移后的安家顾问下此客户phone
// Map<String, Object> map = new HashMap<>(10);
paramMap.put("phone", customer.getPhone()); paramMap.put("phone", customer.getPhone());
paramMap.put("managerId", userId); paramMap.put("managerId", userId);
CustomerEntity oldEntity = customermergemapper.getCustomerMerge(paramMap); CustomerEntity oldEntity = customermergemapper.getCustomerMerge(paramMap);
...@@ -1609,7 +1605,6 @@ public class CustomerImpl implements ICustomer { ...@@ -1609,7 +1605,6 @@ public class CustomerImpl implements ICustomer {
oldEntity.setIsHandover(1); oldEntity.setIsHandover(1);
oldEntity.setManagerName(user.getRealName()); oldEntity.setManagerName(user.getRealName());
//转移判断旧的客户是否有回访记录,有则变更活跃状态,无则不变 //转移判断旧的客户是否有回访记录,有则变更活跃状态,无则不变
// Map<String, Object> searchMap = new HashMap<>(10);
paramMap.clear(); paramMap.clear();
paramMap.put("phone", oldPhone); paramMap.put("phone", oldPhone);
paramMap.put("cityCode", customer.getCityCode()); paramMap.put("cityCode", customer.getCityCode());
...@@ -1621,7 +1616,6 @@ public class CustomerImpl implements ICustomer { ...@@ -1621,7 +1616,6 @@ public class CustomerImpl implements ICustomer {
for (CustomerEntity c : list) { for (CustomerEntity c : list) {
idList.add(c.getId()); idList.add(c.getId());
} }
// Map<String, Object> callBackMap = new HashMap<>(10);
paramMap.clear(); paramMap.clear();
paramMap.put("idList", idList); paramMap.put("idList", idList);
List<CustomerCallbackLogEntity> backList = callbackMapper.queryByConditions(paramMap); List<CustomerCallbackLogEntity> backList = callbackMapper.queryByConditions(paramMap);
...@@ -1630,7 +1624,6 @@ public class CustomerImpl implements ICustomer { ...@@ -1630,7 +1624,6 @@ public class CustomerImpl implements ICustomer {
} }
} }
//将客户标签一并合并给新的安家顾问名下该客户 //将客户标签一并合并给新的安家顾问名下该客户
// Map<String, Object> labelMap = new HashMap<>(10);
paramMap.put("oldManagerId", oldManagerId); paramMap.put("oldManagerId", oldManagerId);
paramMap.put("customerId", customer.getId()); paramMap.put("customerId", customer.getId());
paramMap.put("newCustomerId", oldEntity.getId()); paramMap.put("newCustomerId", oldEntity.getId());
...@@ -1704,7 +1697,6 @@ public class CustomerImpl implements ICustomer { ...@@ -1704,7 +1697,6 @@ public class CustomerImpl implements ICustomer {
if (isHandover) { if (isHandover) {
//客户转移 (同时要更新转移客户日志中安家顾问id) //客户转移 (同时要更新转移客户日志中安家顾问id)
paramMap.clear(); paramMap.clear();
//// Map<String, Object> updateMap = new HashMap<>(10);
paramMap.put("phone", customer.getPhone()); paramMap.put("phone", customer.getPhone());
paramMap.put("oldManagerId", oldManagerId); paramMap.put("oldManagerId", oldManagerId);
paramMap.put("managerId", userId); paramMap.put("managerId", userId);
...@@ -1735,7 +1727,6 @@ public class CustomerImpl implements ICustomer { ...@@ -1735,7 +1727,6 @@ public class CustomerImpl implements ICustomer {
//如果当前客户是云迹客户,需要更新cloud_customer 派工时间和置业顾问 //如果当前客户是云迹客户,需要更新cloud_customer 派工时间和置业顾问
if (customer.getCustomerSourceType() == 7) { if (customer.getCustomerSourceType() == 7) {
paramMap.clear(); paramMap.clear();
// Map<String, Object> queryMap = new HashMap<>(5);
if ("cloud".equals(type)) { if ("cloud".equals(type)) {
paramMap.put("customerId", Integer.valueOf(assignFrom)); paramMap.put("customerId", Integer.valueOf(assignFrom));
} else { } else {
...@@ -1753,7 +1744,6 @@ public class CustomerImpl implements ICustomer { ...@@ -1753,7 +1744,6 @@ public class CustomerImpl implements ICustomer {
} }
} }
Map<String, String> param = new HashMap<>(); Map<String, String> param = new HashMap<>();
// paramMap.clear();
param.put("customerId", String.valueOf(customer.getId())); param.put("customerId", String.valueOf(customer.getId()));
customerService.sendMessageToWechat(NEWCUSTOMER, String.valueOf(user.getId()), param); customerService.sendMessageToWechat(NEWCUSTOMER, String.valueOf(user.getId()), param);
} }
...@@ -3055,7 +3045,7 @@ public class CustomerImpl implements ICustomer { ...@@ -3055,7 +3045,7 @@ public class CustomerImpl implements ICustomer {
} }
@Override @Override
public MapListResponse seaList(MapListRequest request,String type) { public MapListResponse seaList(MapListRequest request, String type) {
MapListResponse response = new MapListResponse(); MapListResponse response = new MapListResponse();
try { try {
Map<String, Object> map = new HashMap<>(10); Map<String, Object> map = new HashMap<>(10);
......
...@@ -78,11 +78,8 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -78,11 +78,8 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
String latestCallResult = getMapValueByKey(Constant.CUSTOMER_CRM_LATESTSCALL_RESULT, map, ""); String latestCallResult = getMapValueByKey(Constant.CUSTOMER_CRM_LATESTSCALL_RESULT, map, "");
String bizPort = getMapValueByKey("bizPort", map, ""); String bizPort = getMapValueByKey("bizPort", map, "");
String requestType = getMapValueByKey("requestType", map, ""); String requestType = getMapValueByKey("requestType", map, "");
// String buyIntention = getMapValueByKey("buyIntention", map, "");
// String status = getMapValueByKey("status", map, "");
String lastJoinVisitRemark = getMapValueByKey("lastJoinVisitRemark", map, ""); String lastJoinVisitRemark = getMapValueByKey("lastJoinVisitRemark", map, "");
// String lastJoinVisitWorker = getMapValueByKey("lastJoinVisitWorker", map, "");
String lastJoinVisitTime = getMapValueByKey("lastJoinVisitTime", map, ""); String lastJoinVisitTime = getMapValueByKey("lastJoinVisitTime", map, "");
String projectId = getMapValueByKey(Constant.PROJECT_ID, map, ""); String projectId = getMapValueByKey(Constant.PROJECT_ID, map, "");
...@@ -104,7 +101,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -104,7 +101,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
customerEntity.setActSource(actSource); customerEntity.setActSource(actSource);
customerEntity.setFirstSource(firstSource); customerEntity.setFirstSource(firstSource);
customerEntity.setBindTime(newdate); customerEntity.setBindTime(newdate);
// customerEntity.setBuyIntention(buyIntention);
customerEntity.setCrmLatestCallResult(latestCallResult); customerEntity.setCrmLatestCallResult(latestCallResult);
if ("5".equals(requestType)) { if ("5".equals(requestType)) {
customerEntity.setCreateSource("留电"); customerEntity.setCreateSource("留电");
...@@ -139,14 +135,12 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -139,14 +135,12 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
customerEntity.setCreater("CRM"); customerEntity.setCreater("CRM");
customerEntity.setUpdater("CRM"); customerEntity.setUpdater("CRM");
customerEntity.setUpdateTime(newdate); customerEntity.setUpdateTime(newdate);
customerEntity.setStatus(Constant.CustomerStatusEnum.NORECORD.getStatus());//客户状态:状态 0 未约看 1 约看、2 到访、3 认筹、4 认购、5 签约、6 退房 //客户状态:状态 0 未约看 1 约看、2 到访、3 认筹、4 认购、5 签约、6 退房
customerEntity.setStatus(Constant.CustomerStatusEnum.NORECORD.getStatus());
customerEntity.setTraceStatus(TRACE_STATUS_INVALID); customerEntity.setTraceStatus(TRACE_STATUS_INVALID);
// customerEntity.setOceanDate(newdate);
customerEntity.setIsDelete(0); customerEntity.setIsDelete(0);
customerEntity.setLastJoinVisitTime(lastJoinVisitTime); customerEntity.setLastJoinVisitTime(lastJoinVisitTime);
// customerEntity.setCustomerSourceType(4);//4:新增客户来源类型,客户来源类型 1:常规;2:抢客;3:营销 4:推广宝小程序, 5:留电, 6:IM咨询
return customerEntity; return customerEntity;
} }
...@@ -184,7 +178,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -184,7 +178,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
public Object exectue(Parameter parameter) throws ServiceRunException { public Object exectue(Parameter parameter) throws ServiceRunException {
// 取得所需参数 // 取得所需参数
Map<String, Object> map = parameter.getArgs(); Map<String, Object> map = parameter.getArgs();
House365RestResponse<CustomerResponse> response = new House365RestResponse<CustomerResponse>(); House365RestResponse<CustomerResponse> response = new House365RestResponse<>();
// 业务校验统一入口 // 业务校验统一入口
try { try {
checkInterfaceParameter(map, Constant.AddCustomerParams4Promote); checkInterfaceParameter(map, Constant.AddCustomerParams4Promote);
...@@ -237,8 +231,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -237,8 +231,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
String lastJoinVisitTime = customerEntity.getLastJoinVisitTime(); String lastJoinVisitTime = customerEntity.getLastJoinVisitTime();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date lastjoinvisittime = sdf.parse(lastJoinVisitTime); Date lastjoinvisittime = sdf.parse(lastJoinVisitTime);
// 设置最后回访时间
// customerEntity.setLastCallTime(lastjoinvisittime);
//客户经理 //客户经理
String userId = getMapValueByKey(Constant.USER_ID, map, ""); String userId = getMapValueByKey(Constant.USER_ID, map, "");
...@@ -246,7 +238,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -246,7 +238,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
String requestType = getMapValueByKey("requestType", map, ""); String requestType = getMapValueByKey("requestType", map, "");
String userName1 = ""; String userName1 = "";
String userName2 = ""; String userName2 = "";
Map<String, Object> searchMap = new HashMap<>(); Map<String, Object> searchMap = new HashMap<>(10);
if ("6".equals(requestType)) { if ("6".equals(requestType)) {
userName1 = "IM咨询"; userName1 = "IM咨询";
userName2 = "IM咨询导入接口"; userName2 = "IM咨询导入接口";
...@@ -373,7 +365,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -373,7 +365,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
customerMe.setCustomerStatus("0"); customerMe.setCustomerStatus("0");
} }
String managermsg = "【三六五】你好,你在" + sdf.format(new Date()) + "有一条用户留电需求待处理,留电人手机[" + customerEntity.getPhone() + "]" + ",请尽快登录全链条后台,进行回访处理."; String managermsg = "【三六五】你好,你在" + sdf.format(new Date()) + "有一条用户留电需求待处理,留电人手机[" + customerEntity.getPhone() + "]" + ",请尽快登录全链条后台,进行回访处理.";
// managermsg = URLEncoder.encode(managermsg, "GBK");
smUrl = smUrl + customerEntity.getCityCode() + "/" + "mobileno/" + user.getMobile(); smUrl = smUrl + customerEntity.getCityCode() + "/" + "mobileno/" + user.getMobile();
List<NameValuePair> params2 = new ArrayList<>(); List<NameValuePair> params2 = new ArrayList<>();
params2.add(new BasicNameValuePair("msg", managermsg)); params2.add(new BasicNameValuePair("msg", managermsg));
...@@ -392,7 +383,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -392,7 +383,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
//IM咨询 //IM咨询
if ("6".equals(requestType)) { if ("6".equals(requestType)) {
if (StringUtils.isNotBlank(userId)) { if (StringUtils.isNotBlank(userId)) {
// UserEntity user = userService.getById(Integer.valueOf(userId));
//判定绑定安家顾问 //判定绑定安家顾问
if (isProtected) { if (isProtected) {
userEntity.setId(customerEntity.getManagerId()); userEntity.setId(customerEntity.getManagerId());
...@@ -425,7 +415,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -425,7 +415,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
oldentity.setUpdateTime(newdate); oldentity.setUpdateTime(newdate);
oldentity.setCreateTime(customerEntity.getCreateTime()); oldentity.setCreateTime(customerEntity.getCreateTime());
oldentity.setBindTime(newdate); oldentity.setBindTime(newdate);
// oldentity.setLastCallTime(customerEntity.getLastCallTime());
handleCustomerMerge(oldentity, lastjoinvisittime); handleCustomerMerge(oldentity, lastjoinvisittime);
customer.updateCustomerMerge(oldentity); customer.updateCustomerMerge(oldentity);
} }
...@@ -437,7 +426,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -437,7 +426,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
customerMe.setManagerPhone(userEntity.getMobile()); customerMe.setManagerPhone(userEntity.getMobile());
Integer sendNum = 0; Integer sendNum = 0;
String customermsg = "感谢您咨询365淘房房博士,根据您的置业需求,我们将安排安家顾问[" + customerEntity.getManagerName() + "],电话[" + userEntity.getMobile() + "],在您合适的时间给您回电,请注意接听,谢谢支持"; String customermsg = "感谢您咨询365淘房房博士,根据您的置业需求,我们将安排安家顾问[" + customerEntity.getManagerName() + "],电话[" + userEntity.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));
...@@ -450,14 +438,12 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -450,14 +438,12 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
customerMe.setCustomerStatus("0"); customerMe.setCustomerStatus("0");
} }
String time = sdf.format(newdate); String time = sdf.format(newdate);
// time = time.replaceAll(" ","");
String managermsg = ""; String managermsg = "";
if (isProtected) {//在保护期内=非第一次IM咨询 if (isProtected) {//在保护期内=非第一次IM咨询
managermsg = "你好,客户[" + customerEntity.getPhone() + "]再次咨询,咨询时间[" + time + "],请登录全链条后台查看."; managermsg = "你好,客户[" + customerEntity.getPhone() + "]再次咨询,咨询时间[" + time + "],请登录全链条后台查看.";
} else { } else {
managermsg = "你好,你在[" + time + "]有一条新的用户咨询需要处理,用户手机[" + customerEntity.getPhone() + "],请登录全链条后台查看."; managermsg = "你好,你在[" + time + "]有一条新的用户咨询需要处理,用户手机[" + customerEntity.getPhone() + "],请登录全链条后台查看.";
} }
// managermsg = URLEncoder.encode(managermsg, "GBK");
smUrl = smUrl + customerEntity.getCityCode() + "/" + "mobileno/" + userEntity.getMobile(); smUrl = smUrl + customerEntity.getCityCode() + "/" + "mobileno/" + userEntity.getMobile();
List<NameValuePair> params2 = new ArrayList<>(); List<NameValuePair> params2 = new ArrayList<>();
params2.add(new BasicNameValuePair("msg", managermsg)); params2.add(new BasicNameValuePair("msg", managermsg));
...@@ -512,7 +498,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -512,7 +498,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
customerMe.setManagerPhone(userEntity.getMobile()); customerMe.setManagerPhone(userEntity.getMobile());
Integer sendNum = 0; Integer sendNum = 0;
String customermsg = "感谢您咨询365淘房房博士,根据您的置业需求,我们将安排安家顾问[" + customerEntity.getManagerName() + "],电话[" + userEntity.getMobile() + "],在您合适的时间给您回电,请注意接听,谢谢支持"; String customermsg = "感谢您咨询365淘房房博士,根据您的置业需求,我们将安排安家顾问[" + customerEntity.getManagerName() + "],电话[" + userEntity.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));
...@@ -592,7 +577,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -592,7 +577,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
oldentity.setCreateTime(customerEntity.getCreateTime()); oldentity.setCreateTime(customerEntity.getCreateTime());
oldentity.setBindTime(newdate); oldentity.setBindTime(newdate);
handleCustomerMerge(oldentity, lastjoinvisittime); handleCustomerMerge(oldentity, lastjoinvisittime);
// oldentity.setLastCallTime(customerEntity.getLastCallTime());
customer.updateCustomerMerge(oldentity); customer.updateCustomerMerge(oldentity);
} }
//发送短信 //发送短信
...@@ -656,7 +640,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -656,7 +640,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
return restObject; return restObject;
} }
public static int differentDaysByDate(Date date1, Date date2) { private static int differentDaysByDate(Date date1, Date date2) {
int days = (int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)); int days = (int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24));
return days; return days;
...@@ -667,7 +651,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer { ...@@ -667,7 +651,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
* @param currentCustomer * @param currentCustomer
* @return * @return
*/ */
public 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的回访记录
......
...@@ -2034,6 +2034,7 @@ public class CustomerWechat implements ICustomerWechat { ...@@ -2034,6 +2034,7 @@ public class CustomerWechat implements ICustomerWechat {
/** /**
* 放弃400客户 * 放弃400客户
*
* @param parameter * @param parameter
* @return * @return
* @throws ServiceRunException * @throws ServiceRunException
...@@ -2254,7 +2255,13 @@ public class CustomerWechat implements ICustomerWechat { ...@@ -2254,7 +2255,13 @@ public class CustomerWechat implements ICustomerWechat {
evaluate.setIsDeleted(0); evaluate.setIsDeleted(0);
evaluate.setIsEvaluated(0); evaluate.setIsEvaluated(0);
evaluate.setCheckStatus(0); evaluate.setCheckStatus(0);
evaluate.setCreateTime(DateTimeUtils.parseDate(seeDate, "yyyy-MM-dd")); Date date = DateTimeUtils.parseDate(seeDate, "yyyy-MM-dd");
//创建时间添加判断
if (date == null) {
evaluate.setCreateTime(new Date());
} else {
evaluate.setCreateTime(DateTimeUtils.parseDate(seeDate, "yyyy-MM-dd"));
}
evaluate.setCity(city); evaluate.setCity(city);
evaluate.setChannel(Integer.valueOf(channel)); evaluate.setChannel(Integer.valueOf(channel));
evaluateUserCustomerLogService.save(evaluate); evaluateUserCustomerLogService.save(evaluate);
......
package com.house365.ws.interfaces.rest;
import com.google.common.base.Strings;
import com.house365.beans.entity.UserEntity;
import com.house365.beans.entity.UserMessageEntity;
import com.house365.rest.context.Parameter;
import com.house365.rest.exception.ServiceRunException;
import com.house365.rest.parameter.House365RestObject;
import com.house365.rest.parameter.House365RestResponse;
import com.house365.ws.dao.mapper.UserMapper;
import com.house365.ws.dao.mapper.UserMessageMapper;
import com.house365.ws.system.ReturnAppResult;
import net.sf.json.JSONObject;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
/**
* im直销组 上线人员信息表
*
* @author Created by 365 on 2020/12/30.
*/
@Service("getNewUserInfo")
public class GetNewUserInfoImpl implements IGetNewUserInfo {
private static final Logger logger = LoggerFactory.getLogger(GetNewUserInfoImpl.class);
@Autowired
private UserMapper userMapper;
@Autowired
private UserMessageMapper messageMapper;
/**
* 对于纯新咨询的客户,随机分配给一位在线IM房博士; 
* 对于非全新咨询的客户,每次咨询时需判断下上次咨询的人员账号是否在线,如在线直接分配上回的人员,如不在线,随机分配给其他在线人员;
* 若所有组员都不在线时,默认分配给组长,保证有人接待客户;
* 组长使用原新房房博士的账号,accid是qlt_527
*
* @param parameter 服务输入,不包含服务配置和控制信息
* @return
* @throws ServiceRunException
*/
@Override
public Object exectue(Parameter parameter) throws ServiceRunException {
Map<String, Object> map = parameter.getArgs();
House365RestResponse<Map<String, Object>> response = new House365RestResponse<>();
// 业务层统一处理
try {
House365RestObject<Map<String, Object>> data = new House365RestObject<>();
Map<String, Object> putMap = new HashMap<>(5);
String tfId = getMapValueByKey("tfId", map, "");
String city = getMapValueByKey("city", map, "");
if (StringUtils.isBlank(tfId) || StringUtils.isBlank(city)) {
response.setResult(ReturnAppResult.APP_FAIL.getResultCode());
response.setMsg("接口参数不全");
return JSONObject.fromObject(response).toString();
}
if (!"nj".equals(city) || !tfId.startsWith("tf_")) {
response.setResult(ReturnAppResult.APP_FAIL.getResultCode());
response.setMsg("参数不正确");
return JSONObject.fromObject(response).toString();
}
//查询在线客服list
Map<String, Object> queryMap = new HashMap<>(5);
queryMap.put("deptUrlPath", "/1/2/69/70/71/72/77");
queryMap.put("onlineStatus", 1);
List<UserEntity> userList = userMapper.queryByConditions(queryMap);
Map<String, Object> searchMap = new HashMap<>(5);
searchMap.put("sender", tfId);
searchMap.put("order", 1);
List<UserMessageEntity> messList = messageMapper.queryByConditions(searchMap);
String accId;
//判断该淘房用户是否聊过天
if (CollectionUtils.isNotEmpty(messList)) {
UserMessageEntity messageEntity = messList.get(0);
queryMap.put("accId", messageEntity.getReceiver());
List<UserEntity> userListNew = userMapper.queryByConditions(queryMap);
if (CollectionUtils.isNotEmpty(userListNew)) {
accId = messageEntity.getReceiver();
} else {
//如不在线,随机分配给其他在线人员
//有在线房博士,随机分配一个,没有则默认组长
if (CollectionUtils.isNotEmpty(userList)) {
int pick = getRandom(userList.size());
accId = userList.get(pick).getAccId();
} else {
//没有聊天 取默认值组长的的id
accId = "qlt_527";
}
}
putMap.put("accId", accId);
data.setEntity(putMap);
} else {
//有在线房博士,随机分配一个,没有则默认组长
if (CollectionUtils.isNotEmpty(userList)) {
int pick = getRandom(userList.size());
accId = userList.get(pick).getAccId();
} else {
//没有聊天 取默认值组长的的id
accId = "qlt_527";
}
putMap.put("accId", accId);
data.setEntity(putMap);
}
response.setData(data);
response.setResult(ReturnAppResult.APP_SUCCESS.getResultCode());
response.setMsg("查询成功");
} catch (Exception e) {
e.printStackTrace();
logger.error("查询用户信息失败", e);
response.setResult(ReturnAppResult.APP_FAIL.getResultCode());
response.setMsg((ReturnAppResult.APP_FAIL.getResultMessage() + ":" + e.getMessage()));
}
String result = JSONObject.fromObject(response).toString();
return result;
}
/**
* 获取随机数
*
* @param bound 范围 0 - bound-1
* @return
*/
private int getRandom(int bound) {
Random random = new Random();
return random.nextInt(bound);
}
private String getMapValueByKey(String key, Map<String, Object> map, String defaultValue) {
String value = "";
if (map.containsKey(key) && map.get(key) != null && !Strings.isNullOrEmpty(((String[]) map.get(key))[0])) {
value = ((String[]) map.get(key))[0];
}
if (Strings.isNullOrEmpty(value)) {
value = defaultValue;
}
return value;
}
@Override
public boolean isControlService() {
return false;
}
@Override
public boolean isLogService() {
return false;
}
@Override
public boolean isMonitorService() {
return false;
}
@Override
public Object rollback() {
return null;
}
@Override
public void commit() {
}
}
package com.house365.ws.interfaces.rest; package com.house365.ws.interfaces.rest;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.house365.beans.entity.CustomerCallbackLogEntity;
import com.house365.beans.entity.CustomerEntity; import com.house365.beans.entity.CustomerEntity;
import com.house365.beans.entity.MessageEntity;
import com.house365.beans.entity.UserEntity; import com.house365.beans.entity.UserEntity;
import com.house365.commons.system.HttpClientUtil;
import com.house365.rest.context.Parameter; import com.house365.rest.context.Parameter;
import com.house365.rest.exception.IllegalServiceParameterException; import com.house365.rest.exception.IllegalServiceParameterException;
import com.house365.rest.exception.ServiceRunException; import com.house365.rest.exception.ServiceRunException;
import com.house365.rest.parameter.House365RestObject; import com.house365.rest.parameter.House365RestObject;
import com.house365.rest.parameter.House365RestResponse; import com.house365.rest.parameter.House365RestResponse;
import com.house365.web.util.MemoryPropertyPlaceholderConfigurer;
import com.house365.web.util.StringUtils;
import com.house365.ws.beans.response.CustomerResponse;
import com.house365.ws.dao.mapper.CustomerMapper; import com.house365.ws.dao.mapper.CustomerMapper;
import com.house365.ws.dao.mapper.CustomerMergeMapper; import com.house365.ws.dao.mapper.CustomerMergeMapper;
import com.house365.ws.service.interfaces.IUserService; import com.house365.ws.service.interfaces.IUserService;
import com.house365.ws.system.ReturnAppResult; import com.house365.ws.system.ReturnAppResult;
import com.house365.ws.util.Constant; import com.house365.ws.util.Constant;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.apache.poi.ss.usermodel.DateUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.net.URLEncoder; import java.util.Date;
import java.text.SimpleDateFormat; import java.util.List;
import java.util.*; import java.util.Map;
@Service("protectionPeriod") @Service("protectionPeriod")
public class IMProtectionImpl implements IMProtection { public class IMProtectionImpl implements IMProtection {
...@@ -122,7 +111,7 @@ public class IMProtectionImpl implements IMProtection { ...@@ -122,7 +111,7 @@ public class IMProtectionImpl implements IMProtection {
return value; return value;
} }
public static int differentDaysByDate(Date date1,Date date2) { public static int differentDaysByDate(Date date1, Date date2) {
int days = (int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)); int days = (int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24));
return days; return days;
...@@ -141,23 +130,23 @@ public class IMProtectionImpl implements IMProtection { ...@@ -141,23 +130,23 @@ public class IMProtectionImpl implements IMProtection {
CustomerEntity ce = new CustomerEntity(); CustomerEntity ce = new CustomerEntity();
ce.setPhone(phone); ce.setPhone(phone);
ce.setCityCode(cityCode); ce.setCityCode(cityCode);
Date nowDate = new Date(); Date nowDate = new Date();
List<CustomerEntity> list = customermapper.queryCustomerPeriod(ce); List<CustomerEntity> list = customermapper.queryCustomerPeriod(ce);
boolean protectPeriod = false; boolean protectPeriod = false;
if(list!=null && list.size()>0){ if (list != null && list.size() > 0) {
for(CustomerEntity entity: list){ for (CustomerEntity entity : list) {
Date createTime = entity.getCreateTime(); Date createTime = entity.getCreateTime();
int days = differentDaysByDate(createTime, nowDate); int days = differentDaysByDate(createTime, nowDate);
if(days < period){//仍在保护期内 if (days < period) {//仍在保护期内
protectPeriod = true; protectPeriod = true;
ce.setProtectPeriod(protectPeriod); ce.setProtectPeriod(protectPeriod);
UserEntity user = userService.getById(entity.getManagerId()); UserEntity user = userService.getById(entity.getManagerId());
ce.setProtectMsg("咨询跟进保护中,跟进人:"+user.getDeptName()+"-"+entity.getManagerName()); ce.setProtectMsg("咨询跟进保护中,跟进人:" + user.getDeptName() + "-" + entity.getManagerName());
ce.setManagerName(entity.getManagerName()); ce.setManagerName(entity.getManagerName());
break; break;
} }
} }
}else{ } else {
ce.setProtectPeriod(protectPeriod); ce.setProtectPeriod(protectPeriod);
} }
restObject.setEntity(ce); restObject.setEntity(ce);
......
...@@ -17,10 +17,12 @@ import org.slf4j.LoggerFactory; ...@@ -17,10 +17,12 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service("kefuAccIdByCity") @Service("kefuAccIdByCity")
public class KefuAccIdByCity implements IKefuAccIdByCity{ public class KefuAccIdByCity implements IKefuAccIdByCity {
private static final Logger LOGGER = LoggerFactory.getLogger(KefuAccIdByCity.class); private static final Logger LOGGER = LoggerFactory.getLogger(KefuAccIdByCity.class);
...@@ -41,7 +43,7 @@ public class KefuAccIdByCity implements IKefuAccIdByCity{ ...@@ -41,7 +43,7 @@ public class KefuAccIdByCity implements IKefuAccIdByCity{
public Object exectue(Parameter parameter) throws ServiceRunException { public Object exectue(Parameter parameter) throws ServiceRunException {
// 取得所需参数 // 取得所需参数
Map<String, Object> map = parameter.getArgs(); Map<String, Object> map = parameter.getArgs();
House365RestResponse<CustomerResponse> response = new House365RestResponse<CustomerResponse>(); House365RestResponse<CustomerResponse> response = new House365RestResponse<>();
try { try {
checkInterfaceParameter(map, Constant.CITYCODE); checkInterfaceParameter(map, Constant.CITYCODE);
response.setResult(ReturnAppResult.APP_SUCCESS.getResultCode()); response.setResult(ReturnAppResult.APP_SUCCESS.getResultCode());
...@@ -77,10 +79,6 @@ public class KefuAccIdByCity implements IKefuAccIdByCity{ ...@@ -77,10 +79,6 @@ public class KefuAccIdByCity implements IKefuAccIdByCity{
House365RestObject<KefuEntity> restObject = new House365RestObject<>(); House365RestObject<KefuEntity> restObject = new House365RestObject<>();
String cityCode = getMapValueByKey("cityCode", map, ""); String cityCode = getMapValueByKey("cityCode", map, "");
Map<String, Object> searchMap = new HashMap<>();
searchMap.put("cityCode", cityCode);
KefuEntity kefuEntity = kefumapper.getKefuInfo(cityCode); KefuEntity kefuEntity = kefumapper.getKefuInfo(cityCode);
List<KefuEntity> list = new ArrayList<>(); List<KefuEntity> list = new ArrayList<>();
list.add(kefuEntity); list.add(kefuEntity);
...@@ -89,9 +87,6 @@ public class KefuAccIdByCity implements IKefuAccIdByCity{ ...@@ -89,9 +87,6 @@ public class KefuAccIdByCity implements IKefuAccIdByCity{
} }
/** /**
* 获取map中的值 * 获取map中的值
* *
......
package com.house365.ws.interfaces.rest;
import com.google.common.base.Strings;
import com.house365.beans.entity.UserEntity;
import com.house365.beans.entity.UserMessageEntity;
import com.house365.rest.context.Parameter;
import com.house365.rest.exception.ServiceRunException;
import com.house365.rest.parameter.House365RestResponse;
import com.house365.ws.dao.mapper.UserMapper;
import com.house365.ws.dao.mapper.UserMessageMapper;
import com.house365.ws.system.ReturnAppResult;
import net.sf.json.JSONObject;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 用户上下线 im信息新增接口
*
* @author Created by 365 on 2020/12/30.
*/
@Service("saveNewMessage")
public class SaveNewMessage implements ISaveNewMessage {
private static final Logger logger = LoggerFactory.getLogger(SaveNewMessage.class);
@Autowired
private UserMapper userMapper;
@Autowired
private UserMessageMapper messageMapper;
@Override
public Object exectue(Parameter parameter) throws ServiceRunException {
// 取得所需参数
Map<String, Object> map = parameter.getArgs();
House365RestResponse<UserMessageEntity> response = new House365RestResponse<>();
try {
String messageEntity = getMapValueByKey("data", map, "");
if (!Strings.isNullOrEmpty(messageEntity)) {
JSONObject message = JSONObject.fromObject(messageEntity);
String sender = getJsonValueByKey("sender", message, "");
String receiver = getJsonValueByKey("receiver", message, "");
if (StringUtils.isBlank(sender) || StringUtils.isBlank(receiver)) {
response.setResult(ReturnAppResult.APP_FAIL.getResultCode());
response.setMsg("接口参数不全");
return JSONObject.fromObject(response).toString();
}
//过滤不是IM咨询组的人信息
if (receiver.startsWith("qlt_") && sender.startsWith("tf_")) {
Date now = new Date();
Map<String, Object> queryMap = new HashMap<>(5);
queryMap.put("deptUrlPath", "/1/2/69/70/71/72/77");
queryMap.put("accId", receiver);
List<UserEntity> userList = userMapper.queryByConditions(queryMap);
if (CollectionUtils.isNotEmpty(userList)) {
Map<String, Object> searchMap = new HashMap<>(5);
searchMap.put("sender", sender);
searchMap.put("receiver", receiver);
List<UserMessageEntity> list = messageMapper.queryByConditions(searchMap);
//判断如果存在聊天,则更新时间,不存在则新增一条记录
if (CollectionUtils.isNotEmpty(list)) {
UserMessageEntity oldEntity = list.get(0);
oldEntity.setUpdateTime(now);
messageMapper.update(oldEntity);
} else {
UserMessageEntity entity = new UserMessageEntity();
entity.setSender(sender);
entity.setReceiver(receiver);
entity.setCreateTime(now);
entity.setUpdateTime(now);
messageMapper.save(entity);
}
response.setResult(ReturnAppResult.APP_SUCCESS.getResultCode());
response.setMsg("同步message成功");
}
} else {
response.setResult(ReturnAppResult.APP_SUCCESS.getResultCode());
response.setMsg("同步message成功");
}
} else {
response.setResult(ReturnAppResult.APP_FAIL.getResultCode());
response.setMsg("data参数不能为空");
}
} catch (Exception e) {
e.printStackTrace();
logger.error("同步信息失败", e);
response.setResult(ReturnAppResult.APP_FAIL.getResultCode());
response.setMsg((ReturnAppResult.APP_FAIL.getResultMessage() + ":" + e.getMessage()));
}
return JSONObject.fromObject(response).toString();
}
private String getJsonValueByKey(String key, JSONObject obj, String defaultValue) {
String value = "";
if (obj.containsKey(key) && obj.get(key) != null && !Strings.isNullOrEmpty(String.valueOf(obj.get(key)))) {
value = String.valueOf(obj.get(key));
}
if (Strings.isNullOrEmpty(value)) {
value = defaultValue;
}
return value;
}
private String getMapValueByKey(String key, Map<String, Object> map, String defaultValue) {
String value = "";
if (map.containsKey(key) && map.get(key) != null && !Strings.isNullOrEmpty(((String[]) map.get(key))[0])) {
value = ((String[]) map.get(key))[0];
}
if (Strings.isNullOrEmpty(value)) {
value = defaultValue;
}
return value;
}
@Override
public boolean isControlService() {
return false;
}
@Override
public boolean isLogService() {
return false;
}
@Override
public boolean isMonitorService() {
return false;
}
@Override
public Object rollback() {
return null;
}
@Override
public void commit() {
}
}
...@@ -52,8 +52,8 @@ public class UpdateUserImpl implements IUpdateUser { ...@@ -52,8 +52,8 @@ public class UpdateUserImpl implements IUpdateUser {
String hotlinephone = getMapValueByKey("hotlinephone", map, ""); String hotlinephone = getMapValueByKey("hotlinephone", map, "");
String goodat = getMapValueByKey("goodat", map, ""); String goodat = getMapValueByKey("goodat", map, "");
String description = getMapValueByKey("description", map, ""); String description = getMapValueByKey("description", map, "");
String headImgURL = getMapValueByKey("headImgURL", map, ""); String headImgUrl = getMapValueByKey("headImgURL", map, "");
String fullImgURL = getMapValueByKey("fullImgURL", map, ""); String fullImgUrl = getMapValueByKey("fullImgURL", map, "");
String defaultVisit = getMapValueByKey("defaultVisit", map, ""); String defaultVisit = getMapValueByKey("defaultVisit", map, "");
if (Strings.isNullOrEmpty(id) || !StringUtils.isNumeric(id)) { if (Strings.isNullOrEmpty(id) || !StringUtils.isNumeric(id)) {
...@@ -62,7 +62,7 @@ public class UpdateUserImpl implements IUpdateUser { ...@@ -62,7 +62,7 @@ public class UpdateUserImpl implements IUpdateUser {
return JSONObject.fromObject(response).toString(); return JSONObject.fromObject(response).toString();
} }
System.out.println("=========" + id + "," + hotlinephone + "," + goodat + "," + description + "," + headImgURL + "," + fullImgURL); System.out.println("=========" + id + "," + hotlinephone + "," + goodat + "," + description + "," + headImgUrl + "," + fullImgUrl);
UserEntity userEntity = (UserEntity) userService.getById(Integer.parseInt(id)); UserEntity userEntity = (UserEntity) userService.getById(Integer.parseInt(id));
if (userEntity == null) { if (userEntity == null) {
...@@ -72,8 +72,8 @@ public class UpdateUserImpl implements IUpdateUser { ...@@ -72,8 +72,8 @@ public class UpdateUserImpl implements IUpdateUser {
} }
userEntity.setGoodat(goodat); userEntity.setGoodat(goodat);
userEntity.setDescription(description); userEntity.setDescription(description);
userEntity.setHeadImgURL(headImgURL); userEntity.setHeadImgURL(headImgUrl);
userEntity.setFullImgURL(fullImgURL); userEntity.setFullImgURL(fullImgUrl);
userEntity.setHotlinephone(hotlinephone); userEntity.setHotlinephone(hotlinephone);
userEntity.setUpdateTime(new Date()); userEntity.setUpdateTime(new Date());
...@@ -91,9 +91,7 @@ public class UpdateUserImpl implements IUpdateUser { ...@@ -91,9 +91,7 @@ public class UpdateUserImpl implements IUpdateUser {
* *
* @author hqc * @author hqc
*/ */
protected void checkInterfaceParameter( protected void checkInterfaceParameter(Map<String, Object> map, String[] checkParams) throws IllegalServiceParameterException {
Map<String, Object> map, String[] checkParams
) throws IllegalServiceParameterException {
// 方法所需参数 // 方法所需参数
for (String str : checkParams) { for (String str : checkParams) {
// 如果不存在跳出 同时抛出相应异常 // 如果不存在跳出 同时抛出相应异常
......
package com.house365.ws.interfaces.rest;
import com.google.common.base.Strings;
import com.house365.beans.entity.OnlineLogEntity;
import com.house365.beans.entity.UserEntity;
import com.house365.rest.context.Parameter;
import com.house365.rest.exception.ServiceRunException;
import com.house365.rest.parameter.House365RestObject;
import com.house365.rest.parameter.House365RestResponse;
import com.house365.ws.dao.mapper.OnlineLogMapper;
import com.house365.ws.dao.mapper.UserMapper;
import com.house365.ws.system.ReturnAppResult;
import net.sf.json.JSONObject;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 更新用户上线下线接口
*
* @author Created by 365 on 2020/12/30.
*/
@Service("updateUserStatus")
public class UpdateUserStatusImpl implements IUpdateUserStatus {
private Logger logger = LoggerFactory.getLogger(UpdateUserStatusImpl.class);
@Autowired
private UserMapper userMapper;
@Autowired
private OnlineLogMapper logMapper;
@Override
public Object exectue(Parameter parameter) throws ServiceRunException {
// 取得所需参数
Map<String, Object> map = parameter.getArgs();
House365RestResponse<UserEntity> response = new House365RestResponse<>();
// 业务层统一处理
try {
House365RestObject<UserEntity> data = new House365RestObject<>();
String phone = getMapValueByKey("phone", map, "");
String status = getMapValueByKey("status", map, "");
if (StringUtils.isBlank(phone) || StringUtils.isBlank(status)) {
response.setResult(ReturnAppResult.APP_FAIL.getResultCode());
response.setMsg("接口参数不全");
return JSONObject.fromObject(response).toString();
}
Map<String, Object> searchMap = new HashMap<>(5);
searchMap.put("telephone", phone);
List<UserEntity> list = userMapper.queryByConditions(searchMap);
if (CollectionUtils.isNotEmpty(list)) {
UserEntity user = list.get(0);
int oldStatus = user.getOnlineStatus();
Map<String, Object> updateMap = new HashMap<>(5);
updateMap.put("mobile", phone);
updateMap.put("onlineStatus", status);
userMapper.updateUserStatus(updateMap);
OnlineLogEntity logEntity = new OnlineLogEntity();
logEntity.setOldStatus(oldStatus);
logEntity.setNewStatus(Integer.parseInt(status));
logEntity.setUserId(user.getId());
logEntity.setCreateTime(new Date());
logMapper.save(logEntity);
response.setData(data);
response.setResult(ReturnAppResult.APP_SUCCESS.getResultCode());
response.setMsg("更新成功");
} else {
response.setResult(ReturnAppResult.APP_FAIL.getResultCode());
response.setMsg("更新失败,用户不存在");
}
} catch (Exception e) {
logger.error("更新用户上下线状态失败", e);
response.setResult(ReturnAppResult.APP_FAIL.getResultCode());
response.setMsg((ReturnAppResult.APP_FAIL.getResultMessage() + ":" + e.getMessage()));
}
String result = JSONObject.fromObject(response).toString();
return result;
}
/**
* 获取map中的值
*
* @param key key
* @param map map
* @param defaultValue 默认值
* @return value
*/
private String getMapValueByKey(String key, Map<String, Object> map, String defaultValue) {
String value = "";
if (map.containsKey(key) && map.get(key) != null && !Strings.isNullOrEmpty(((String[]) map.get(key))[0])) {
value = ((String[]) map.get(key))[0];
}
if (Strings.isNullOrEmpty(value)) {
value = defaultValue;
}
return value;
}
@Override
public boolean isControlService() {
return false;
}
@Override
public boolean isLogService() {
return false;
}
@Override
public boolean isMonitorService() {
return false;
}
@Override
public Object rollback() {
return null;
}
@Override
public void commit() {
}
}
...@@ -338,20 +338,20 @@ ...@@ -338,20 +338,20 @@
version="${dubbo.app.version}" timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> version="${dubbo.app.version}" timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<dubbo:service ref="externalCustomer" interface="com.house365.ws.interfaces.server.IExternalCustomerInterface" <dubbo:service ref="externalCustomer" interface="com.house365.ws.interfaces.server.IExternalCustomerInterface"
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<dubbo:service ref="externalCusCallLog" interface="com.house365.ws.interfaces.server.IExternalCusCallLogInterface" <dubbo:service ref="externalCusCallLog" interface="com.house365.ws.interfaces.server.IExternalCusCallLogInterface"
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<dubbo:service ref="externalCusLog" interface="com.house365.ws.interfaces.server.IExternalCusLogInterface" <dubbo:service ref="externalCusLog" interface="com.house365.ws.interfaces.server.IExternalCusLogInterface"
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<dubbo:service ref="cloudRule" interface="com.house365.ws.interfaces.server.ICloudRuleInterface" <dubbo:service ref="cloudRule" interface="com.house365.ws.interfaces.server.ICloudRuleInterface"
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--获取云迹定制项目列表接口--> <!--获取云迹定制项目列表接口-->
<dubbo:service ref="getCloudRule" interface="com.house365.ws.interfaces.rest.IGetCloudRule" <dubbo:service ref="getCloudRule" interface="com.house365.ws.interfaces.rest.IGetCloudRule"
...@@ -368,4 +368,19 @@ ...@@ -368,4 +368,19 @@
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--更新用户上下线状态-->
<dubbo:service ref="updateUserStatus" interface="com.house365.ws.interfaces.rest.IUpdateUserStatus"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--上下线用户信息新增接口-->
<dubbo:service ref="saveNewMessage" interface="com.house365.ws.interfaces.rest.ISaveNewMessage"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--获取上下线用户信息接口-->
<dubbo:service ref="getNewUserInfo" interface="com.house365.ws.interfaces.rest.IGetNewUserInfo"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
</beans> </beans>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.house365.ws.dao.mapper.OnlineLogMapper">
<resultMap id="infoMap" type="com.house365.beans.entity.OnlineLogEntity">
<result property="id" column="id"/>
<result property="oldStatus" column="old_status"/>
<result property="newStatus" column="new_status"/>
<result property="userId" column="user_id"/>
<result property="createTime" column="create_time"/>
</resultMap>
<insert id="save" parameterType="com.house365.beans.entity.OnlineLogEntity">
insert into online_log (old_status,new_status,user_id,create_time)
values
( #{oldStatus},#{newStatus},#{userId},#{createTime} )
</insert>
</mapper>
\ No newline at end of file
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<result property="wxNumber" column="wx_number"/> <result property="wxNumber" column="wx_number"/>
<result property="wxCodeImgUrl" column="wx_code_imgUrl"/> <result property="wxCodeImgUrl" column="wx_code_imgUrl"/>
<result property="promoteId" column="promote_id"/> <result property="promoteId" column="promote_id"/>
<result property="onlineStatus" column="online_status"/>
</resultMap> </resultMap>
<resultMap id="infoMap2" type="com.house365.beans.entity.UserSimpleEntity"> <resultMap id="infoMap2" type="com.house365.beans.entity.UserSimpleEntity">
...@@ -140,6 +141,12 @@ ...@@ -140,6 +141,12 @@
<if test="identityType != null and identityType != ''"> <if test="identityType != null and identityType != ''">
AND identityType = #{identityType} AND identityType = #{identityType}
</if> </if>
<if test="accId != null and accId != ''">
AND accid = #{accId}
</if>
<if test="onlineStatus != null and onlineStatus >= 0">
AND online_status = #{onlineStatus}
</if>
<if test="order != null and order > 0 "> <if test="order != null and order > 0 ">
ORDER BY name ASC ORDER BY name ASC
</if> </if>
...@@ -246,4 +253,11 @@ ...@@ -246,4 +253,11 @@
order by loginTime desc order by loginTime desc
</select> </select>
<update id="updateUserStatus" parameterType="map">
UPDATE user
SET
online_status = #{onlineStatus}
WHERE mobile = #{mobile}
</update>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.house365.ws.dao.mapper.UserMessageMapper">
<resultMap id="infoMap" type="com.house365.beans.entity.UserMessageEntity">
<result property="id" column="id"/>
<result property="sender" column="sender"/>
<result property="receiver" column="receiver"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="sqlId">
id,sender,receiver,create_time,update_time
</sql>
<select id="getById" resultMap="infoMap" parameterType="Integer">
SELECT
<include refid="sqlId"/>
FROM
user_message
where id = #{id}
</select>
<select id="queryByConditions" resultMap="infoMap" parameterType="map">
SELECT
<include refid="sqlId"/>
FROM user_message
where 1 = 1
<if test="sender != null and sender != ''">
AND sender = #{sender}
</if>
<if test="receiver != null and receiver != ''">
AND receiver = #{receiver}
</if>
<if test="order != null and order >= 0">
ORDER BY update_time DESC
</if>
</select>
<insert id="save" parameterType="com.house365.beans.entity.UserMessageEntity">
insert into user_message (sender,receiver,create_time,update_time)
values
( #{sender},#{receiver},#{createTime},#{updateTime} )
</insert>
<update id="update" parameterType="com.house365.beans.entity.UserMessageEntity">
UPDATE user_message
SET
update_time = #{updateTime}
WHERE id = #{id}
</update>
</mapper>
\ No newline at end of file
...@@ -361,4 +361,19 @@ ...@@ -361,4 +361,19 @@
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--更新用户上下线状态-->
<dubbo:service ref="updateUserStatus" interface="com.house365.ws.interfaces.rest.IUpdateUserStatus"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--上下线用户信息新增接口-->
<dubbo:service ref="saveNewMessage" interface="com.house365.ws.interfaces.rest.ISaveNewMessage"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--获取上下线用户信息接口-->
<dubbo:service ref="getNewUserInfo" interface="com.house365.ws.interfaces.rest.IGetNewUserInfo"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
</beans> </beans>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.house365.ws.dao.mapper.OnlineLogMapper">
<resultMap id="infoMap" type="com.house365.beans.entity.OnlineLogEntity">
<result property="id" column="id"/>
<result property="oldStatus" column="old_status"/>
<result property="newStatus" column="new_status"/>
<result property="userId" column="user_id"/>
<result property="createTime" column="create_time"/>
</resultMap>
<insert id="save" parameterType="com.house365.beans.entity.OnlineLogEntity">
insert into online_log (old_status,new_status,user_id,create_time)
values
( #{oldStatus},#{newStatus},#{userId},#{createTime} )
</insert>
</mapper>
\ No newline at end of file
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<result property="wxNumber" column="wx_number"/> <result property="wxNumber" column="wx_number"/>
<result property="wxCodeImgUrl" column="wx_code_imgUrl"/> <result property="wxCodeImgUrl" column="wx_code_imgUrl"/>
<result property="promoteId" column="promote_id"/> <result property="promoteId" column="promote_id"/>
<result property="onlineStatus" column="online_status"/>
</resultMap> </resultMap>
<resultMap id="infoMap2" type="com.house365.beans.entity.UserSimpleEntity"> <resultMap id="infoMap2" type="com.house365.beans.entity.UserSimpleEntity">
...@@ -140,6 +141,12 @@ ...@@ -140,6 +141,12 @@
<if test="identityType != null and identityType != ''"> <if test="identityType != null and identityType != ''">
AND identityType = #{identityType} AND identityType = #{identityType}
</if> </if>
<if test="accId != null and accId != ''">
AND accid = #{accId}
</if>
<if test="onlineStatus != null and onlineStatus >= 0">
AND online_status = #{onlineStatus}
</if>
<if test="order != null and order > 0 "> <if test="order != null and order > 0 ">
ORDER BY name ASC ORDER BY name ASC
</if> </if>
...@@ -234,10 +241,10 @@ ...@@ -234,10 +241,10 @@
</select> </select>
<insert id="addRequestLoginInfo" parameterType="com.house365.beans.entity.RequestLoginEntity"> <insert id="addRequestLoginInfo" parameterType="com.house365.beans.entity.RequestLoginEntity">
insert into request_login (name,realName,loginIp,loginCity,loginTime,authorizationTime, userId) values insert into request_login (name,realName,loginIp,loginCity,loginTime,authorizationTime, userId) values
( (
#{name},#{realName},#{loginIp},#{loginCity},#{loginTime},#{authorizationTime}, #{userId} #{name},#{realName},#{loginIp},#{loginCity},#{loginTime},#{authorizationTime}, #{userId}
) )
</insert> </insert>
<select id="getRequestLoginInfo" resultMap="infoMap4"> <select id="getRequestLoginInfo" resultMap="infoMap4">
...@@ -246,4 +253,11 @@ ...@@ -246,4 +253,11 @@
order by loginTime desc order by loginTime desc
</select> </select>
<update id="updateUserStatus" parameterType="map">
UPDATE user
SET
online_status = #{onlineStatus}
WHERE mobile = #{mobile}
</update>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.house365.ws.dao.mapper.UserMessageMapper">
<resultMap id="infoMap" type="com.house365.beans.entity.UserMessageEntity">
<result property="id" column="id"/>
<result property="sender" column="sender"/>
<result property="receiver" column="receiver"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="sqlId">
id,sender,receiver,create_time,update_time
</sql>
<select id="getById" resultMap="infoMap" parameterType="Integer">
SELECT
<include refid="sqlId"/>
FROM
user_message
where id = #{id}
</select>
<select id="queryByConditions" resultMap="infoMap" parameterType="map">
SELECT
<include refid="sqlId"/>
FROM user_message
where 1 = 1
<if test="sender != null and sender != ''">
AND sender = #{sender}
</if>
<if test="receiver != null and receiver != ''">
AND receiver = #{receiver}
</if>
<if test="order != null and order >= 0">
ORDER BY update_time DESC
</if>
</select>
<insert id="save" parameterType="com.house365.beans.entity.UserMessageEntity">
insert into user_message (sender,receiver,create_time,update_time)
values
( #{sender},#{receiver},#{createTime},#{updateTime} )
</insert>
<update id="update" parameterType="com.house365.beans.entity.UserMessageEntity">
UPDATE user_message
SET
update_time = #{updateTime}
WHERE id = #{id}
</update>
</mapper>
\ No newline at end of file
...@@ -370,4 +370,19 @@ ...@@ -370,4 +370,19 @@
version="${dubbo.app.version}" version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/> timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--更新用户上下线状态-->
<dubbo:service ref="updateUserStatus" interface="com.house365.ws.interfaces.rest.IUpdateUserStatus"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--上下线用户信息新增接口-->
<dubbo:service ref="saveNewMessage" interface="com.house365.ws.interfaces.rest.ISaveNewMessage"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
<!--获取上下线用户信息接口-->
<dubbo:service ref="getNewUserInfo" interface="com.house365.ws.interfaces.rest.IGetNewUserInfo"
version="${dubbo.app.version}"
timeout="${dubbo.app.timeout}" retries="${dubbo.app.retries}"/>
</beans> </beans>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.house365.ws.dao.mapper.OnlineLogMapper">
<resultMap id="infoMap" type="com.house365.beans.entity.OnlineLogEntity">
<result property="id" column="id"/>
<result property="oldStatus" column="old_status"/>
<result property="newStatus" column="new_status"/>
<result property="userId" column="user_id"/>
<result property="createTime" column="create_time"/>
</resultMap>
<insert id="save" parameterType="com.house365.beans.entity.OnlineLogEntity">
insert into online_log (old_status,new_status,user_id,create_time)
values
( #{oldStatus},#{newStatus},#{userId},#{createTime} )
</insert>
</mapper>
\ No newline at end of file
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<result property="wxNumber" column="wx_number"/> <result property="wxNumber" column="wx_number"/>
<result property="wxCodeImgUrl" column="wx_code_imgUrl"/> <result property="wxCodeImgUrl" column="wx_code_imgUrl"/>
<result property="promoteId" column="promote_id"/> <result property="promoteId" column="promote_id"/>
<result property="onlineStatus" column="online_status"/>
</resultMap> </resultMap>
<resultMap id="infoMap2" type="com.house365.beans.entity.UserSimpleEntity"> <resultMap id="infoMap2" type="com.house365.beans.entity.UserSimpleEntity">
...@@ -140,6 +141,12 @@ ...@@ -140,6 +141,12 @@
<if test="identityType != null and identityType != ''"> <if test="identityType != null and identityType != ''">
AND identityType = #{identityType} AND identityType = #{identityType}
</if> </if>
<if test="accId != null and accId != ''">
AND accid = #{accId}
</if>
<if test="onlineStatus != null and onlineStatus >= 0">
AND online_status = #{onlineStatus}
</if>
<if test="order != null and order > 0 "> <if test="order != null and order > 0 ">
ORDER BY name ASC ORDER BY name ASC
</if> </if>
...@@ -234,10 +241,10 @@ ...@@ -234,10 +241,10 @@
</select> </select>
<insert id="addRequestLoginInfo" parameterType="com.house365.beans.entity.RequestLoginEntity"> <insert id="addRequestLoginInfo" parameterType="com.house365.beans.entity.RequestLoginEntity">
insert into request_login (name,realName,loginIp,loginCity,loginTime,authorizationTime, userId) values insert into request_login (name,realName,loginIp,loginCity,loginTime,authorizationTime, userId) values
( (
#{name},#{realName},#{loginIp},#{loginCity},#{loginTime},#{authorizationTime}, #{userId} #{name},#{realName},#{loginIp},#{loginCity},#{loginTime},#{authorizationTime}, #{userId}
) )
</insert> </insert>
<select id="getRequestLoginInfo" resultMap="infoMap4"> <select id="getRequestLoginInfo" resultMap="infoMap4">
...@@ -246,4 +253,11 @@ ...@@ -246,4 +253,11 @@
order by loginTime desc order by loginTime desc
</select> </select>
<update id="updateUserStatus" parameterType="map">
UPDATE user
SET
online_status = #{onlineStatus}
WHERE mobile = #{mobile}
</update>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.house365.ws.dao.mapper.UserMessageMapper">
<resultMap id="infoMap" type="com.house365.beans.entity.UserMessageEntity">
<result property="id" column="id"/>
<result property="sender" column="sender"/>
<result property="receiver" column="receiver"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="sqlId">
id,sender,receiver,create_time,update_time
</sql>
<select id="getById" resultMap="infoMap" parameterType="Integer">
SELECT
<include refid="sqlId"/>
FROM
user_message
where id = #{id}
</select>
<select id="queryByConditions" resultMap="infoMap" parameterType="map">
SELECT
<include refid="sqlId"/>
FROM user_message
where 1 = 1
<if test="sender != null and sender != ''">
AND sender = #{sender}
</if>
<if test="receiver != null and receiver != ''">
AND receiver = #{receiver}
</if>
<if test="order != null and order >= 0">
ORDER BY update_time DESC
</if>
</select>
<insert id="save" parameterType="com.house365.beans.entity.UserMessageEntity">
insert into user_message (sender,receiver,create_time,update_time)
values
( #{sender},#{receiver},#{createTime},#{updateTime} )
</insert>
<update id="update" parameterType="com.house365.beans.entity.UserMessageEntity">
UPDATE user_message
SET
update_time = #{updateTime}
WHERE id = #{id}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment