Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
H
Hgs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐州
Hgs
Commits
06c61ebb
Commit
06c61ebb
authored
Dec 31, 2020
by
jay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上下线相关需求提交
parent
788cd751
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
1106 additions
and
173 deletions
+1106
-173
OnlineLogEntity.java
.../main/java/com/house365/beans/entity/OnlineLogEntity.java
+51
-0
UserEntity.java
...s/src/main/java/com/house365/beans/entity/UserEntity.java
+36
-24
UserMessageEntity.java
...ain/java/com/house365/beans/entity/UserMessageEntity.java
+52
-0
MarketingActivityController.java
.../house365/web/controller/MarketingActivityController.java
+20
-47
UserController.java
...main/java/com/house365/web/controller/UserController.java
+5
-9
applicationContext-dubbo.xml
...rces/development/application/applicationContext-dubbo.xml
+15
-0
applicationContext-dubbo.xml
...urces/production/application/applicationContext-dubbo.xml
+15
-0
applicationContext-dubbo.xml
...n/resources/test/application/applicationContext-dubbo.xml
+15
-0
step2.jsp
...in/webapp/WEB-INF/views/marketingactivity/pages/step2.jsp
+0
-4
IGetNewUserInfo.java
...java/com/house365/ws/interfaces/rest/IGetNewUserInfo.java
+9
-0
ISaveNewMessage.java
...java/com/house365/ws/interfaces/rest/ISaveNewMessage.java
+9
-0
IUpdateUserStatus.java
...va/com/house365/ws/interfaces/rest/IUpdateUserStatus.java
+10
-0
OnlineLogMapper.java
...main/java/com/house365/ws/dao/mapper/OnlineLogMapper.java
+13
-0
UserMapper.java
.../src/main/java/com/house365/ws/dao/mapper/UserMapper.java
+2
-0
UserMessageMapper.java
...in/java/com/house365/ws/dao/mapper/UserMessageMapper.java
+22
-0
CustomerImpl.java
...in/java/com/house365/ws/interfaces/impl/CustomerImpl.java
+1
-11
AddPromoteCustomerImpl.java
...m/house365/ws/interfaces/rest/AddPromoteCustomerImpl.java
+6
-22
CustomerWechat.java
.../java/com/house365/ws/interfaces/rest/CustomerWechat.java
+8
-1
GetNewUserInfoImpl.java
...a/com/house365/ws/interfaces/rest/GetNewUserInfoImpl.java
+174
-0
IMProtectionImpl.java
...ava/com/house365/ws/interfaces/rest/IMProtectionImpl.java
+10
-21
KefuAccIdByCity.java
...java/com/house365/ws/interfaces/rest/KefuAccIdByCity.java
+5
-10
SaveNewMessage.java
.../java/com/house365/ws/interfaces/rest/SaveNewMessage.java
+148
-0
UpdateUserImpl.java
.../java/com/house365/ws/interfaces/rest/UpdateUserImpl.java
+6
-8
UpdateUserStatusImpl.java
...com/house365/ws/interfaces/rest/UpdateUserStatusImpl.java
+131
-0
applicationContext-dubbo.xml
...rces/development/application/applicationContext-dubbo.xml
+23
-8
OnlineLogMapper.xml
...rc/main/resources/development/mybatis/OnlineLogMapper.xml
+22
-0
UserMapper.xml
...-ws/src/main/resources/development/mybatis/UserMapper.xml
+15
-0
UserMeaaageMapper.xml
.../main/resources/development/mybatis/UserMeaaageMapper.xml
+57
-0
applicationContext-dubbo.xml
...urces/production/application/applicationContext-dubbo.xml
+15
-0
OnlineLogMapper.xml
...src/main/resources/production/mybatis/OnlineLogMapper.xml
+22
-0
UserMapper.xml
...s-ws/src/main/resources/production/mybatis/UserMapper.xml
+19
-4
UserMeaaageMapper.xml
...c/main/resources/production/mybatis/UserMeaaageMapper.xml
+57
-0
applicationContext-dubbo.xml
...n/resources/test/application/applicationContext-dubbo.xml
+15
-0
OnlineLogMapper.xml
...gs-ws/src/main/resources/test/mybatis/OnlineLogMapper.xml
+22
-0
UserMapper.xml
...365-hgs-ws/src/main/resources/test/mybatis/UserMapper.xml
+19
-4
UserMeaaageMapper.xml
...-ws/src/main/resources/test/mybatis/UserMeaaageMapper.xml
+57
-0
No files found.
house365-hgs-beans/src/main/java/com/house365/beans/entity/OnlineLogEntity.java
0 → 100644
View file @
06c61ebb
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
;
}
}
house365-hgs-beans/src/main/java/com/house365/beans/entity/UserEntity.java
View file @
06c61ebb
...
...
@@ -78,13 +78,6 @@ public class UserEntity extends DomainObject {
@Length
(
max
=
11
,
message
=
"长度需要大于0且小于11"
)
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 {
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
...
...
@@ -165,7 +143,7 @@ public class UserEntity extends DomainObject {
/**
* 1启用 0冻结
*/
private
java
.
lang
.
Boolean
enabled
;
private
Boolean
enabled
;
/**
* 创建人用户ID
...
...
@@ -240,12 +218,22 @@ public class UserEntity extends DomainObject {
private
Integer
evaluateCount
;
//所属城市
private
String
city
;
private
String
cityName
;
//城市名称
//城市名称
private
String
cityName
;
//带看次数
private
Integer
seeCount
;
private
String
wxNumber
;
private
String
wxCodeImgUrl
;
private
Integer
onlineStatus
;
public
String
getManagerName
()
{
return
managerName
;
}
public
void
setManagerName
(
String
managerName
)
{
this
.
managerName
=
managerName
;
}
public
String
getImshow
()
{
return
imshow
;
...
...
@@ -415,6 +403,22 @@ public class UserEntity extends DomainObject {
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 {
this
.
promoteId
=
promoteId
;
}
public
Integer
getOnlineStatus
()
{
return
onlineStatus
;
}
public
void
setOnlineStatus
(
Integer
onlineStatus
)
{
this
.
onlineStatus
=
onlineStatus
;
}
/**
* 实体的toString方法
*
...
...
house365-hgs-beans/src/main/java/com/house365/beans/entity/UserMessageEntity.java
0 → 100644
View file @
06c61ebb
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
;
}
}
house365-hgs-web/src/main/java/com/house365/web/controller/MarketingActivityController.java
View file @
06c61ebb
...
...
@@ -430,13 +430,16 @@ public class MarketingActivityController extends BaseController {
List
<
DutyStaffEntity
>
dutylist
=
iuser
.
getOndutyById
(
uid
);
if
(
dutylist
!=
null
&&
dutylist
.
size
()
>
0
)
{
if
(
"1"
.
equals
(
dutylist
.
get
(
0
).
getOnduty
()))
{
model
.
addAttribute
(
"limitDate"
,
"0"
);
//名单内:值班不限制时间选择范围
//名单内:值班不限制时间选择范围
model
.
addAttribute
(
"limitDate"
,
"0"
);
}
if
(
"0"
.
equals
(
dutylist
.
get
(
0
).
getOnduty
()))
{
model
.
addAttribute
(
"limitDate"
,
"1"
);
//名单内:非值班限制时间选择范围
//名单内:非值班限制时间选择范围
model
.
addAttribute
(
"limitDate"
,
"1"
);
}
}
else
{
model
.
addAttribute
(
"limitDate"
,
"0"
);
//名单外不限制时间选择范围
//名单外不限制时间选择范围
model
.
addAttribute
(
"limitDate"
,
"0"
);
}
List
<
DictionaryEntity
>
blocks
=
new
ArrayList
<>();
...
...
@@ -502,6 +505,7 @@ public class MarketingActivityController extends BaseController {
DepartmentEntity
departmentEntity
=
(
DepartmentEntity
)
request
.
getSession
().
getAttribute
(
SessionConstants
.
SESSION_CURRNET_DEPT_KEY
);
String
cityId
=
departmentEntity
.
getCityID
();
String
cityCode
=
departmentEntity
.
getDescripition
();
List
<
NameValuePair
>
nameValuePairList
=
new
ArrayList
<>();
String
total
=
"0"
;
House365RestObject
restObject
=
new
House365RestObject
();
...
...
@@ -562,7 +566,7 @@ public class MarketingActivityController extends BaseController {
nameValuePairList
.
add
(
new
BasicNameValuePair
(
"page"
,
"1"
));
nameValuePairList
.
add
(
new
BasicNameValuePair
(
"limit"
,
"1000"
));
}
setApplySource
(
request
,
entity
);
setApplySource
(
request
,
entity
,
cityCode
);
wrapNameValuePairList
(
vo
,
nameValuePairList
,
entity
);
String
preResult
=
HttpClientUtil
.
doGet
(
crmQueryURL
,
nameValuePairList
);
...
...
@@ -624,7 +628,7 @@ public class MarketingActivityController extends BaseController {
return
result
;
}
private
void
setApplySource
(
HttpServletRequest
request
,
MarketingActivityEntity
entity
)
{
private
void
setApplySource
(
HttpServletRequest
request
,
MarketingActivityEntity
entity
,
String
cityCode
)
{
Set
<
String
>
crmSourceSet
=
new
HashSet
<>();
//根据快捷来源选择所有下级CRM来源 v3.2.0
String
quickSources
=
request
.
getParameter
(
"quickSource"
);
...
...
@@ -633,17 +637,22 @@ public class MarketingActivityController extends BaseController {
List
<
CrmSourceEntity
>
sourceList
=
crmSourceService
.
getListByCategory
(
source
);
if
(
sourceList
!=
null
&&
!
sourceList
.
isEmpty
())
{
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
())
{
String
source
=
Joiner
.
on
(
","
).
join
(
crmSourceSet
);
entity
.
setApplySource
(
source
);
entity
.
setApplySourceName
(
"电商、房博士、400电话、楼盘订阅、看房团"
);
}
}
}
...
...
@@ -686,7 +695,6 @@ public class MarketingActivityController extends BaseController {
new
BigDecimal
(
100
)).
intValue
();
completePercent
=
String
.
valueOf
(
percent
);
}
}
Map
<
String
,
String
>
pam
=
new
HashMap
<>(
10
);
pam
.
put
(
"protectCount"
,
""
+
protect
);
...
...
@@ -702,8 +710,7 @@ public class MarketingActivityController extends BaseController {
@ResponseBody
public
Object
importData
(
MarketingActivityVo
vo
,
HttpServletRequest
request
)
{
String
result
=
"fail"
;
DepartmentEntity
departmentEntity
=
(
DepartmentEntity
)
request
.
getSession
().
getAttribute
(
SessionConstants
.
SESSION_CURRNET_DEPT_KEY
);
DepartmentEntity
departmentEntity
=
(
DepartmentEntity
)
request
.
getSession
().
getAttribute
(
SessionConstants
.
SESSION_CURRNET_DEPT_KEY
);
String
cityId
=
departmentEntity
.
getCityID
();
DepartmentResponse
departmentResponse
=
department
.
getDepartmentById
(
Integer
.
valueOf
(
cityId
));
DepartmentEntity
city
=
departmentResponse
.
getEntity
();
...
...
@@ -737,7 +744,7 @@ public class MarketingActivityController extends BaseController {
entity
.
setBrowseProjectId
(
seeProjectId
);
entity
.
setBuildingId
(
projectId
);
setApplySource
(
request
,
entity
);
setApplySource
(
request
,
entity
,
city
.
getDescripition
()
);
wrapMap
(
entity
,
paraMap
);
...
...
@@ -784,34 +791,6 @@ public class MarketingActivityController extends BaseController {
}
});
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
)
{
e
.
printStackTrace
();
activityLogger
.
error
(
e
.
getMessage
(),
e
);
...
...
@@ -878,8 +857,7 @@ public class MarketingActivityController extends BaseController {
public
String
list
(
Integer
number
,
Model
model
,
HttpServletRequest
request
)
{
UserEntity
userEntity
=
(
UserEntity
)
request
.
getSession
().
getAttribute
(
SessionConstants
.
THREAD_USER_KEY
);
DepartmentEntity
departmentEntity
=
(
DepartmentEntity
)
request
.
getSession
().
getAttribute
(
SessionConstants
.
SESSION_CURRNET_DEPT_KEY
);
DepartmentEntity
departmentEntity
=
(
DepartmentEntity
)
request
.
getSession
().
getAttribute
(
SessionConstants
.
SESSION_CURRNET_DEPT_KEY
);
String
cityId
=
departmentEntity
.
getCityID
();
DepartmentResponse
departmentResponse
=
department
.
getDepartmentById
(
Integer
.
valueOf
(
cityId
));
DepartmentEntity
city
=
departmentResponse
.
getEntity
();
...
...
@@ -1316,11 +1294,6 @@ public class MarketingActivityController extends BaseController {
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
()))
{
nameValuePairList
.
add
(
new
BasicNameValuePair
(
"visit_result[]"
,
String
.
valueOf
(
entity
.
getReturnVisitResult
())));
}
...
...
house365-hgs-web/src/main/java/com/house365/web/controller/UserController.java
View file @
06c61ebb
...
...
@@ -436,8 +436,7 @@ public class UserController extends BaseController {
public
String
updateForm
(
@PathVariable
(
value
=
"id"
)
Integer
id
,
HttpServletRequest
request
,
Model
model
)
{
UserResponse
response
=
user
.
getUserById
(
id
);
UserEntity
userEntity
=
response
.
getEntity
();
AttachmentListResponse
headImgRes
=
attachmentInterface
.
queryByResourceIdAndResouceType
(
String
.
valueOf
(
id
),
"hgs_user_headImg"
);
AttachmentListResponse
headImgRes
=
attachmentInterface
.
queryByResourceIdAndResouceType
(
String
.
valueOf
(
id
),
"hgs_user_headImg"
);
DepartmentListRequest
listReq
=
new
DepartmentListRequest
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
@@ -448,8 +447,7 @@ public class UserController extends BaseController {
userEntity
.
setHeadImgURL
(
""
);
}
AttachmentListResponse
fullImgRes
=
attachmentInterface
.
queryByResourceIdAndResouceType
(
String
.
valueOf
(
id
),
"hgs_user_fullImg"
);
AttachmentListResponse
fullImgRes
=
attachmentInterface
.
queryByResourceIdAndResouceType
(
String
.
valueOf
(
id
),
"hgs_user_fullImg"
);
if
(
null
!=
fullImgRes
.
getObjectList
()
&&
!
fullImgRes
.
getObjectList
().
isEmpty
())
{
BaseAttachment
attachment
=
(
BaseAttachment
)
fullImgRes
.
getObjectList
().
get
(
0
);
userEntity
.
setFullImgURL
(
attachment
.
getRemotePath
());
...
...
@@ -457,11 +455,9 @@ public class UserController extends BaseController {
userEntity
.
setFullImgURL
(
""
);
}
DepartmentEntity
departmentEntity
=
(
DepartmentEntity
)
request
.
getSession
().
getAttribute
(
SessionConstants
.
SESSION_REAL_DEPT_KEY
);
DepartmentEntity
departmentEntity
=
(
DepartmentEntity
)
request
.
getSession
().
getAttribute
(
SessionConstants
.
SESSION_REAL_DEPT_KEY
);
if
(
PathUtil
.
isAdminDept
(
departmentEntity
))
{
departmentEntity
=
(
DepartmentEntity
)
request
.
getSession
().
getAttribute
(
SessionConstants
.
SESSION_CURRNET_DEPT_KEY
);
departmentEntity
=
(
DepartmentEntity
)
request
.
getSession
().
getAttribute
(
SessionConstants
.
SESSION_CURRNET_DEPT_KEY
);
}
DepartmentResponse
deptEntity
=
department
.
getDepartmentById
(
departmentEntity
.
getId
());
map
.
put
(
"LIKE_urlPath"
,
deptEntity
.
getEntity
().
getUrlPath
());
...
...
@@ -824,7 +820,7 @@ public class UserController extends BaseController {
List
<
String
>
paramList
=
new
ArrayList
<>();
List
<
NameValuePair
>
directParams
=
new
ArrayList
<>();
directParams
.
add
(
new
BasicNameValuePair
(
"access_token"
,
token
));
directParams
.
add
(
new
BasicNameValuePair
(
"department_id"
,
"2
70
"
));
directParams
.
add
(
new
BasicNameValuePair
(
"department_id"
,
"2"
));
directParams
.
add
(
new
BasicNameValuePair
(
"fetch_child"
,
"1"
));
for
(
NameValuePair
pair
:
directParams
)
{
paramList
.
add
(
pair
.
getName
()
+
"="
+
pair
.
getValue
());
...
...
house365-hgs-web/src/main/resources/development/application/applicationContext-dubbo.xml
View file @
06c61ebb
...
...
@@ -373,5 +373,20 @@
version=
"${dubbo.app.version}"
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>
house365-hgs-web/src/main/resources/production/application/applicationContext-dubbo.xml
View file @
06c61ebb
...
...
@@ -370,5 +370,20 @@
version=
"${dubbo.app.version}"
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>
house365-hgs-web/src/main/resources/test/application/applicationContext-dubbo.xml
View file @
06c61ebb
...
...
@@ -370,5 +370,20 @@
version=
"${dubbo.app.version}"
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>
house365-hgs-web/src/main/webapp/WEB-INF/views/marketingactivity/pages/step2.jsp
View file @
06c61ebb
...
...
@@ -109,10 +109,6 @@
<div
class=
"span4 control-group"
>
<label
class=
"control-label"
><span
style=
"color: red"
>
*
</span>
报名时间:
</label>
<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=
"applyEndTime"
name=
"entity.applyEndTimeStr"
/>
<input
type=
"text"
id=
"signTime"
name=
"signTime"
class=
"form-control span12"
>
...
...
house365-hgs-ws-interfaces/src/main/java/com/house365/ws/interfaces/rest/IGetNewUserInfo.java
0 → 100644
View file @
06c61ebb
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
{
}
house365-hgs-ws-interfaces/src/main/java/com/house365/ws/interfaces/rest/ISaveNewMessage.java
0 → 100644
View file @
06c61ebb
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
{
}
house365-hgs-ws-interfaces/src/main/java/com/house365/ws/interfaces/rest/IUpdateUserStatus.java
0 → 100644
View file @
06c61ebb
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
{
}
house365-hgs-ws/src/main/java/com/house365/ws/dao/mapper/OnlineLogMapper.java
0 → 100644
View file @
06c61ebb
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
);
}
house365-hgs-ws/src/main/java/com/house365/ws/dao/mapper/UserMapper.java
View file @
06c61ebb
...
...
@@ -49,4 +49,6 @@ public interface UserMapper {
List
<
UserEntity
>
getManagerByPid
(
Map
<
String
,
Object
>
map
);
void
updateUserStatus
(
Map
<
String
,
Object
>
map
);
}
house365-hgs-ws/src/main/java/com/house365/ws/dao/mapper/UserMessageMapper.java
0 → 100644
View file @
06c61ebb
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
);
}
house365-hgs-ws/src/main/java/com/house365/ws/interfaces/impl/CustomerImpl.java
View file @
06c61ebb
...
...
@@ -1548,7 +1548,6 @@ public class CustomerImpl implements ICustomer {
Date
newdate
=
new
Date
();
Integer
oldManagerId
=
customer
.
getManagerId
();
String
oldManagerName
=
customer
.
getManagerName
();
// Integer newManagerId = userId;
String
newManagerName
=
user
.
getRealName
();
String
oldPhone
=
customer
.
getPhone
();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>(
10
);
...
...
@@ -1564,7 +1563,6 @@ public class CustomerImpl implements ICustomer {
customerService
.
update
(
customer
);
}
if
(
isHandover
&&
!
userId
.
equals
(
oldManagerId
))
{
// Map<String, Object> paramMap = new HashMap<>(10);
paramMap
.
put
(
"oldManagerId"
,
oldManagerId
);
paramMap
.
put
(
"oldManagerName"
,
oldManagerName
);
paramMap
.
put
(
"newManagerId"
,
userId
);
...
...
@@ -1575,14 +1573,12 @@ public class CustomerImpl implements ICustomer {
paramMap
.
put
(
"updateTime"
,
newdate
);
paramMap
.
put
(
"bindTime"
,
newdate
);
paramMap
.
put
(
"isHandover"
,
1
);
// customer.setIsHandover(1);
customerMapper
.
transferManagerInfo
(
paramMap
);
}
paramMap
.
clear
();
//转移后的安家顾问下此客户phone
// Map<String, Object> map = new HashMap<>(10);
paramMap
.
put
(
"phone"
,
customer
.
getPhone
());
paramMap
.
put
(
"managerId"
,
userId
);
CustomerEntity
oldEntity
=
customermergemapper
.
getCustomerMerge
(
paramMap
);
...
...
@@ -1609,7 +1605,6 @@ public class CustomerImpl implements ICustomer {
oldEntity
.
setIsHandover
(
1
);
oldEntity
.
setManagerName
(
user
.
getRealName
());
//转移判断旧的客户是否有回访记录,有则变更活跃状态,无则不变
// Map<String, Object> searchMap = new HashMap<>(10);
paramMap
.
clear
();
paramMap
.
put
(
"phone"
,
oldPhone
);
paramMap
.
put
(
"cityCode"
,
customer
.
getCityCode
());
...
...
@@ -1621,7 +1616,6 @@ public class CustomerImpl implements ICustomer {
for
(
CustomerEntity
c
:
list
)
{
idList
.
add
(
c
.
getId
());
}
// Map<String, Object> callBackMap = new HashMap<>(10);
paramMap
.
clear
();
paramMap
.
put
(
"idList"
,
idList
);
List
<
CustomerCallbackLogEntity
>
backList
=
callbackMapper
.
queryByConditions
(
paramMap
);
...
...
@@ -1630,7 +1624,6 @@ public class CustomerImpl implements ICustomer {
}
}
//将客户标签一并合并给新的安家顾问名下该客户
// Map<String, Object> labelMap = new HashMap<>(10);
paramMap
.
put
(
"oldManagerId"
,
oldManagerId
);
paramMap
.
put
(
"customerId"
,
customer
.
getId
());
paramMap
.
put
(
"newCustomerId"
,
oldEntity
.
getId
());
...
...
@@ -1704,7 +1697,6 @@ public class CustomerImpl implements ICustomer {
if
(
isHandover
)
{
//客户转移 (同时要更新转移客户日志中安家顾问id)
paramMap
.
clear
();
//// Map<String, Object> updateMap = new HashMap<>(10);
paramMap
.
put
(
"phone"
,
customer
.
getPhone
());
paramMap
.
put
(
"oldManagerId"
,
oldManagerId
);
paramMap
.
put
(
"managerId"
,
userId
);
...
...
@@ -1735,7 +1727,6 @@ public class CustomerImpl implements ICustomer {
//如果当前客户是云迹客户,需要更新cloud_customer 派工时间和置业顾问
if
(
customer
.
getCustomerSourceType
()
==
7
)
{
paramMap
.
clear
();
// Map<String, Object> queryMap = new HashMap<>(5);
if
(
"cloud"
.
equals
(
type
))
{
paramMap
.
put
(
"customerId"
,
Integer
.
valueOf
(
assignFrom
));
}
else
{
...
...
@@ -1753,7 +1744,6 @@ public class CustomerImpl implements ICustomer {
}
}
Map
<
String
,
String
>
param
=
new
HashMap
<>();
// paramMap.clear();
param
.
put
(
"customerId"
,
String
.
valueOf
(
customer
.
getId
()));
customerService
.
sendMessageToWechat
(
NEWCUSTOMER
,
String
.
valueOf
(
user
.
getId
()),
param
);
}
...
...
@@ -3055,7 +3045,7 @@ public class CustomerImpl implements ICustomer {
}
@Override
public
MapListResponse
seaList
(
MapListRequest
request
,
String
type
)
{
public
MapListResponse
seaList
(
MapListRequest
request
,
String
type
)
{
MapListResponse
response
=
new
MapListResponse
();
try
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
10
);
...
...
house365-hgs-ws/src/main/java/com/house365/ws/interfaces/rest/AddPromoteCustomerImpl.java
View file @
06c61ebb
...
...
@@ -78,11 +78,8 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
String
latestCallResult
=
getMapValueByKey
(
Constant
.
CUSTOMER_CRM_LATESTSCALL_RESULT
,
map
,
""
);
String
bizPort
=
getMapValueByKey
(
"bizPort"
,
map
,
""
);
String
requestType
=
getMapValueByKey
(
"requestType"
,
map
,
""
);
// String buyIntention = getMapValueByKey("buyIntention", map, "");
// String status = getMapValueByKey("status", map, "");
String
lastJoinVisitRemark
=
getMapValueByKey
(
"lastJoinVisitRemark"
,
map
,
""
);
// String lastJoinVisitWorker = getMapValueByKey("lastJoinVisitWorker", map, "");
String
lastJoinVisitTime
=
getMapValueByKey
(
"lastJoinVisitTime"
,
map
,
""
);
String
projectId
=
getMapValueByKey
(
Constant
.
PROJECT_ID
,
map
,
""
);
...
...
@@ -104,7 +101,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
customerEntity
.
setActSource
(
actSource
);
customerEntity
.
setFirstSource
(
firstSource
);
customerEntity
.
setBindTime
(
newdate
);
// customerEntity.setBuyIntention(buyIntention);
customerEntity
.
setCrmLatestCallResult
(
latestCallResult
);
if
(
"5"
.
equals
(
requestType
))
{
customerEntity
.
setCreateSource
(
"留电"
);
...
...
@@ -139,14 +135,12 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
customerEntity
.
setCreater
(
"CRM"
);
customerEntity
.
setUpdater
(
"CRM"
);
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.setOceanDate(newdate);
customerEntity
.
setIsDelete
(
0
);
customerEntity
.
setLastJoinVisitTime
(
lastJoinVisitTime
);
// customerEntity.setCustomerSourceType(4);//4:新增客户来源类型,客户来源类型 1:常规;2:抢客;3:营销 4:推广宝小程序, 5:留电, 6:IM咨询
return
customerEntity
;
}
...
...
@@ -184,7 +178,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
public
Object
exectue
(
Parameter
parameter
)
throws
ServiceRunException
{
// 取得所需参数
Map
<
String
,
Object
>
map
=
parameter
.
getArgs
();
House365RestResponse
<
CustomerResponse
>
response
=
new
House365RestResponse
<
CustomerResponse
>();
House365RestResponse
<
CustomerResponse
>
response
=
new
House365RestResponse
<>();
// 业务校验统一入口
try
{
checkInterfaceParameter
(
map
,
Constant
.
AddCustomerParams4Promote
);
...
...
@@ -237,8 +231,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
String
lastJoinVisitTime
=
customerEntity
.
getLastJoinVisitTime
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Date
lastjoinvisittime
=
sdf
.
parse
(
lastJoinVisitTime
);
// 设置最后回访时间
// customerEntity.setLastCallTime(lastjoinvisittime);
//客户经理
String
userId
=
getMapValueByKey
(
Constant
.
USER_ID
,
map
,
""
);
...
...
@@ -246,7 +238,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
String
requestType
=
getMapValueByKey
(
"requestType"
,
map
,
""
);
String
userName1
=
""
;
String
userName2
=
""
;
Map
<
String
,
Object
>
searchMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
searchMap
=
new
HashMap
<>(
10
);
if
(
"6"
.
equals
(
requestType
))
{
userName1
=
"IM咨询"
;
userName2
=
"IM咨询导入接口"
;
...
...
@@ -373,7 +365,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
customerMe
.
setCustomerStatus
(
"0"
);
}
String
managermsg
=
"【三六五】你好,你在"
+
sdf
.
format
(
new
Date
())
+
"有一条用户留电需求待处理,留电人手机["
+
customerEntity
.
getPhone
()
+
"]"
+
",请尽快登录全链条后台,进行回访处理."
;
// managermsg = URLEncoder.encode(managermsg, "GBK");
smUrl
=
smUrl
+
customerEntity
.
getCityCode
()
+
"/"
+
"mobileno/"
+
user
.
getMobile
();
List
<
NameValuePair
>
params2
=
new
ArrayList
<>();
params2
.
add
(
new
BasicNameValuePair
(
"msg"
,
managermsg
));
...
...
@@ -392,7 +383,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
//IM咨询
if
(
"6"
.
equals
(
requestType
))
{
if
(
StringUtils
.
isNotBlank
(
userId
))
{
// UserEntity user = userService.getById(Integer.valueOf(userId));
//判定绑定安家顾问
if
(
isProtected
)
{
userEntity
.
setId
(
customerEntity
.
getManagerId
());
...
...
@@ -425,7 +415,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
oldentity
.
setUpdateTime
(
newdate
);
oldentity
.
setCreateTime
(
customerEntity
.
getCreateTime
());
oldentity
.
setBindTime
(
newdate
);
// oldentity.setLastCallTime(customerEntity.getLastCallTime());
handleCustomerMerge
(
oldentity
,
lastjoinvisittime
);
customer
.
updateCustomerMerge
(
oldentity
);
}
...
...
@@ -437,7 +426,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
customerMe
.
setManagerPhone
(
userEntity
.
getMobile
());
Integer
sendNum
=
0
;
String
customermsg
=
"感谢您咨询365淘房房博士,根据您的置业需求,我们将安排安家顾问["
+
customerEntity
.
getManagerName
()
+
"],电话["
+
userEntity
.
getMobile
()
+
"],在您合适的时间给您回电,请注意接听,谢谢支持"
;
// customermsg = URLEncoder.encode(customermsg);
smUrl
=
smUrl
+
customerEntity
.
getCityCode
()
+
"/"
+
"mobileno/"
+
customerEntity
.
getPhone
();
List
<
NameValuePair
>
params
=
new
ArrayList
<>();
params
.
add
(
new
BasicNameValuePair
(
"msg"
,
customermsg
));
...
...
@@ -450,14 +438,12 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
customerMe
.
setCustomerStatus
(
"0"
);
}
String
time
=
sdf
.
format
(
newdate
);
// time = time.replaceAll(" ","");
String
managermsg
=
""
;
if
(
isProtected
)
{
//在保护期内=非第一次IM咨询
managermsg
=
"你好,客户["
+
customerEntity
.
getPhone
()
+
"]再次咨询,咨询时间["
+
time
+
"],请登录全链条后台查看."
;
}
else
{
managermsg
=
"你好,你在["
+
time
+
"]有一条新的用户咨询需要处理,用户手机["
+
customerEntity
.
getPhone
()
+
"],请登录全链条后台查看."
;
}
// managermsg = URLEncoder.encode(managermsg, "GBK");
smUrl
=
smUrl
+
customerEntity
.
getCityCode
()
+
"/"
+
"mobileno/"
+
userEntity
.
getMobile
();
List
<
NameValuePair
>
params2
=
new
ArrayList
<>();
params2
.
add
(
new
BasicNameValuePair
(
"msg"
,
managermsg
));
...
...
@@ -512,7 +498,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
customerMe
.
setManagerPhone
(
userEntity
.
getMobile
());
Integer
sendNum
=
0
;
String
customermsg
=
"感谢您咨询365淘房房博士,根据您的置业需求,我们将安排安家顾问["
+
customerEntity
.
getManagerName
()
+
"],电话["
+
userEntity
.
getMobile
()
+
"],在您合适的时间给您回电,请注意接听,谢谢支持"
;
// customermsg = URLEncoder.encode(customermsg);
smUrl
=
smUrl
+
customerEntity
.
getCityCode
()
+
"/"
+
"mobileno/"
+
customerEntity
.
getPhone
();
List
<
NameValuePair
>
params
=
new
ArrayList
<>();
params
.
add
(
new
BasicNameValuePair
(
"msg"
,
customermsg
));
...
...
@@ -592,7 +577,6 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
oldentity
.
setCreateTime
(
customerEntity
.
getCreateTime
());
oldentity
.
setBindTime
(
newdate
);
handleCustomerMerge
(
oldentity
,
lastjoinvisittime
);
// oldentity.setLastCallTime(customerEntity.getLastCallTime());
customer
.
updateCustomerMerge
(
oldentity
);
}
//发送短信
...
...
@@ -656,7 +640,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
return
restObject
;
}
p
ublic
static
int
differentDaysByDate
(
Date
date1
,
Date
date2
)
{
p
rivate
static
int
differentDaysByDate
(
Date
date1
,
Date
date2
)
{
int
days
=
(
int
)
((
date2
.
getTime
()
-
date1
.
getTime
())
/
(
1000
*
3600
*
24
));
return
days
;
...
...
@@ -667,7 +651,7 @@ public class AddPromoteCustomerImpl implements IAddPromoteCustomer {
* @param currentCustomer
* @return
*/
p
ublic
CustomerEntity
handleCustomerMerge
(
CustomerEntity
currentCustomer
){
p
rivate
CustomerEntity
handleCustomerMerge
(
CustomerEntity
currentCustomer
){
//先去查询该客户的所有id
List
<
CustomerEntity
>
customerIdList
=
customer
.
getCustomerIds
(
currentCustomer
.
getId
(),
currentCustomer
.
getCityCode
());
//再获取所有id的回访记录
...
...
house365-hgs-ws/src/main/java/com/house365/ws/interfaces/rest/CustomerWechat.java
View file @
06c61ebb
...
...
@@ -2034,6 +2034,7 @@ public class CustomerWechat implements ICustomerWechat {
/**
* 放弃400客户
*
* @param parameter
* @return
* @throws ServiceRunException
...
...
@@ -2254,7 +2255,13 @@ public class CustomerWechat implements ICustomerWechat {
evaluate
.
setIsDeleted
(
0
);
evaluate
.
setIsEvaluated
(
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
.
setChannel
(
Integer
.
valueOf
(
channel
));
evaluateUserCustomerLogService
.
save
(
evaluate
);
...
...
house365-hgs-ws/src/main/java/com/house365/ws/interfaces/rest/GetNewUserInfoImpl.java
0 → 100644
View file @
06c61ebb
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
()
{
}
}
house365-hgs-ws/src/main/java/com/house365/ws/interfaces/rest/IMProtectionImpl.java
View file @
06c61ebb
package
com
.
house365
.
ws
.
interfaces
.
rest
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.common.base.Strings
;
import
com.house365.beans.entity.CustomerCallbackLogEntity
;
import
com.house365.beans.entity.CustomerEntity
;
import
com.house365.beans.entity.MessageEntity
;
import
com.house365.beans.entity.UserEntity
;
import
com.house365.commons.system.HttpClientUtil
;
import
com.house365.rest.context.Parameter
;
import
com.house365.rest.exception.IllegalServiceParameterException
;
import
com.house365.rest.exception.ServiceRunException
;
import
com.house365.rest.parameter.House365RestObject
;
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.CustomerMergeMapper
;
import
com.house365.ws.service.interfaces.IUserService
;
import
com.house365.ws.system.ReturnAppResult
;
import
com.house365.ws.util.Constant
;
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.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.
net.URLEncoder
;
import
java.
text.SimpleDateForma
t
;
import
java.util.
*
;
import
java.
util.Date
;
import
java.
util.Lis
t
;
import
java.util.
Map
;
@Service
(
"protectionPeriod"
)
public
class
IMProtectionImpl
implements
IMProtection
{
...
...
@@ -122,7 +111,7 @@ public class IMProtectionImpl implements IMProtection {
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
));
return
days
;
...
...
@@ -141,23 +130,23 @@ public class IMProtectionImpl implements IMProtection {
CustomerEntity
ce
=
new
CustomerEntity
();
ce
.
setPhone
(
phone
);
ce
.
setCityCode
(
cityCode
);
Date
nowDate
=
new
Date
();
Date
nowDate
=
new
Date
();
List
<
CustomerEntity
>
list
=
customermapper
.
queryCustomerPeriod
(
ce
);
boolean
protectPeriod
=
false
;
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
for
(
CustomerEntity
entity:
list
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
CustomerEntity
entity
:
list
)
{
Date
createTime
=
entity
.
getCreateTime
();
int
days
=
differentDaysByDate
(
createTime
,
nowDate
);
if
(
days
<
period
)
{
//仍在保护期内
if
(
days
<
period
)
{
//仍在保护期内
protectPeriod
=
true
;
ce
.
setProtectPeriod
(
protectPeriod
);
UserEntity
user
=
userService
.
getById
(
entity
.
getManagerId
());
ce
.
setProtectMsg
(
"咨询跟进保护中,跟进人:"
+
user
.
getDeptName
()+
"-"
+
entity
.
getManagerName
());
ce
.
setProtectMsg
(
"咨询跟进保护中,跟进人:"
+
user
.
getDeptName
()
+
"-"
+
entity
.
getManagerName
());
ce
.
setManagerName
(
entity
.
getManagerName
());
break
;
}
}
}
else
{
}
else
{
ce
.
setProtectPeriod
(
protectPeriod
);
}
restObject
.
setEntity
(
ce
);
...
...
house365-hgs-ws/src/main/java/com/house365/ws/interfaces/rest/KefuAccIdByCity.java
View file @
06c61ebb
...
...
@@ -17,10 +17,12 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
@Service
(
"kefuAccIdByCity"
)
public
class
KefuAccIdByCity
implements
IKefuAccIdByCity
{
public
class
KefuAccIdByCity
implements
IKefuAccIdByCity
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
KefuAccIdByCity
.
class
);
...
...
@@ -41,7 +43,7 @@ public class KefuAccIdByCity implements IKefuAccIdByCity{
public
Object
exectue
(
Parameter
parameter
)
throws
ServiceRunException
{
// 取得所需参数
Map
<
String
,
Object
>
map
=
parameter
.
getArgs
();
House365RestResponse
<
CustomerResponse
>
response
=
new
House365RestResponse
<
CustomerResponse
>();
House365RestResponse
<
CustomerResponse
>
response
=
new
House365RestResponse
<>();
try
{
checkInterfaceParameter
(
map
,
Constant
.
CITYCODE
);
response
.
setResult
(
ReturnAppResult
.
APP_SUCCESS
.
getResultCode
());
...
...
@@ -77,10 +79,6 @@ public class KefuAccIdByCity implements IKefuAccIdByCity{
House365RestObject
<
KefuEntity
>
restObject
=
new
House365RestObject
<>();
String
cityCode
=
getMapValueByKey
(
"cityCode"
,
map
,
""
);
Map
<
String
,
Object
>
searchMap
=
new
HashMap
<>();
searchMap
.
put
(
"cityCode"
,
cityCode
);
KefuEntity
kefuEntity
=
kefumapper
.
getKefuInfo
(
cityCode
);
List
<
KefuEntity
>
list
=
new
ArrayList
<>();
list
.
add
(
kefuEntity
);
...
...
@@ -89,9 +87,6 @@ public class KefuAccIdByCity implements IKefuAccIdByCity{
}
/**
* 获取map中的值
*
...
...
house365-hgs-ws/src/main/java/com/house365/ws/interfaces/rest/SaveNewMessage.java
0 → 100644
View file @
06c61ebb
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
()
{
}
}
house365-hgs-ws/src/main/java/com/house365/ws/interfaces/rest/UpdateUserImpl.java
View file @
06c61ebb
...
...
@@ -52,8 +52,8 @@ public class UpdateUserImpl implements IUpdateUser {
String
hotlinephone
=
getMapValueByKey
(
"hotlinephone"
,
map
,
""
);
String
goodat
=
getMapValueByKey
(
"goodat"
,
map
,
""
);
String
description
=
getMapValueByKey
(
"description"
,
map
,
""
);
String
headImgU
RL
=
getMapValueByKey
(
"headImgURL"
,
map
,
""
);
String
fullImgU
RL
=
getMapValueByKey
(
"fullImgURL"
,
map
,
""
);
String
headImgU
rl
=
getMapValueByKey
(
"headImgURL"
,
map
,
""
);
String
fullImgU
rl
=
getMapValueByKey
(
"fullImgURL"
,
map
,
""
);
String
defaultVisit
=
getMapValueByKey
(
"defaultVisit"
,
map
,
""
);
if
(
Strings
.
isNullOrEmpty
(
id
)
||
!
StringUtils
.
isNumeric
(
id
))
{
...
...
@@ -62,7 +62,7 @@ public class UpdateUserImpl implements IUpdateUser {
return
JSONObject
.
fromObject
(
response
).
toString
();
}
System
.
out
.
println
(
"========="
+
id
+
","
+
hotlinephone
+
","
+
goodat
+
","
+
description
+
","
+
headImgU
RL
+
","
+
fullImgURL
);
System
.
out
.
println
(
"========="
+
id
+
","
+
hotlinephone
+
","
+
goodat
+
","
+
description
+
","
+
headImgU
rl
+
","
+
fullImgUrl
);
UserEntity
userEntity
=
(
UserEntity
)
userService
.
getById
(
Integer
.
parseInt
(
id
));
if
(
userEntity
==
null
)
{
...
...
@@ -72,8 +72,8 @@ public class UpdateUserImpl implements IUpdateUser {
}
userEntity
.
setGoodat
(
goodat
);
userEntity
.
setDescription
(
description
);
userEntity
.
setHeadImgURL
(
headImgU
RL
);
userEntity
.
setFullImgURL
(
fullImgU
RL
);
userEntity
.
setHeadImgURL
(
headImgU
rl
);
userEntity
.
setFullImgURL
(
fullImgU
rl
);
userEntity
.
setHotlinephone
(
hotlinephone
);
userEntity
.
setUpdateTime
(
new
Date
());
...
...
@@ -91,9 +91,7 @@ public class UpdateUserImpl implements IUpdateUser {
*
* @author hqc
*/
protected
void
checkInterfaceParameter
(
Map
<
String
,
Object
>
map
,
String
[]
checkParams
)
throws
IllegalServiceParameterException
{
protected
void
checkInterfaceParameter
(
Map
<
String
,
Object
>
map
,
String
[]
checkParams
)
throws
IllegalServiceParameterException
{
// 方法所需参数
for
(
String
str
:
checkParams
)
{
// 如果不存在跳出 同时抛出相应异常
...
...
house365-hgs-ws/src/main/java/com/house365/ws/interfaces/rest/UpdateUserStatusImpl.java
0 → 100644
View file @
06c61ebb
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
()
{
}
}
house365-hgs-ws/src/main/resources/development/application/applicationContext-dubbo.xml
View file @
06c61ebb
...
...
@@ -338,20 +338,20 @@
version=
"${dubbo.app.version}"
timeout=
"${dubbo.app.timeout}"
retries=
"${dubbo.app.retries}"
/>
<dubbo:service
ref=
"externalCustomer"
interface=
"com.house365.ws.interfaces.server.IExternalCustomerInterface"
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=
"externalCusCallLog"
interface=
"com.house365.ws.interfaces.server.IExternalCusCallLogInterface"
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=
"externalCusLog"
interface=
"com.house365.ws.interfaces.server.IExternalCusLogInterface"
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=
"cloudRule"
interface=
"com.house365.ws.interfaces.server.ICloudRuleInterface"
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=
"getCloudRule"
interface=
"com.house365.ws.interfaces.rest.IGetCloudRule"
...
...
@@ -368,4 +368,19 @@
version=
"${dubbo.app.version}"
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>
house365-hgs-ws/src/main/resources/development/mybatis/OnlineLogMapper.xml
0 → 100644
View file @
06c61ebb
<?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
house365-hgs-ws/src/main/resources/development/mybatis/UserMapper.xml
View file @
06c61ebb
...
...
@@ -46,6 +46,7 @@
<result
property=
"wxNumber"
column=
"wx_number"
/>
<result
property=
"wxCodeImgUrl"
column=
"wx_code_imgUrl"
/>
<result
property=
"promoteId"
column=
"promote_id"
/>
<result
property=
"onlineStatus"
column=
"online_status"
/>
</resultMap>
<resultMap
id=
"infoMap2"
type=
"com.house365.beans.entity.UserSimpleEntity"
>
...
...
@@ -140,6 +141,12 @@
<if
test=
"identityType != null and identityType != ''"
>
AND identityType = #{identityType}
</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 "
>
ORDER BY name ASC
</if>
...
...
@@ -246,4 +253,11 @@
order by loginTime desc
</select>
<update
id=
"updateUserStatus"
parameterType=
"map"
>
UPDATE user
SET
online_status = #{onlineStatus}
WHERE mobile = #{mobile}
</update>
</mapper>
\ No newline at end of file
house365-hgs-ws/src/main/resources/development/mybatis/UserMeaaageMapper.xml
0 → 100644
View file @
06c61ebb
<?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
house365-hgs-ws/src/main/resources/production/application/applicationContext-dubbo.xml
View file @
06c61ebb
...
...
@@ -361,4 +361,19 @@
version=
"${dubbo.app.version}"
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>
house365-hgs-ws/src/main/resources/production/mybatis/OnlineLogMapper.xml
0 → 100644
View file @
06c61ebb
<?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
house365-hgs-ws/src/main/resources/production/mybatis/UserMapper.xml
View file @
06c61ebb
...
...
@@ -46,6 +46,7 @@
<result
property=
"wxNumber"
column=
"wx_number"
/>
<result
property=
"wxCodeImgUrl"
column=
"wx_code_imgUrl"
/>
<result
property=
"promoteId"
column=
"promote_id"
/>
<result
property=
"onlineStatus"
column=
"online_status"
/>
</resultMap>
<resultMap
id=
"infoMap2"
type=
"com.house365.beans.entity.UserSimpleEntity"
>
...
...
@@ -140,6 +141,12 @@
<if
test=
"identityType != null and identityType != ''"
>
AND identityType = #{identityType}
</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 "
>
ORDER BY name ASC
</if>
...
...
@@ -234,10 +241,10 @@
</select>
<insert
id=
"addRequestLoginInfo"
parameterType=
"com.house365.beans.entity.RequestLoginEntity"
>
insert into request_login (name,realName,loginIp,loginCity,loginTime,authorizationTime, userId) values
(
#{name},#{realName},#{loginIp},#{loginCity},#{loginTime},#{authorizationTime}, #{userId}
)
insert into request_login (name,realName,loginIp,loginCity,loginTime,authorizationTime, userId) values
(
#{name},#{realName},#{loginIp},#{loginCity},#{loginTime},#{authorizationTime}, #{userId}
)
</insert>
<select
id=
"getRequestLoginInfo"
resultMap=
"infoMap4"
>
...
...
@@ -246,4 +253,11 @@
order by loginTime desc
</select>
<update
id=
"updateUserStatus"
parameterType=
"map"
>
UPDATE user
SET
online_status = #{onlineStatus}
WHERE mobile = #{mobile}
</update>
</mapper>
\ No newline at end of file
house365-hgs-ws/src/main/resources/production/mybatis/UserMeaaageMapper.xml
0 → 100644
View file @
06c61ebb
<?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
house365-hgs-ws/src/main/resources/test/application/applicationContext-dubbo.xml
View file @
06c61ebb
...
...
@@ -370,4 +370,19 @@
version=
"${dubbo.app.version}"
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>
house365-hgs-ws/src/main/resources/test/mybatis/OnlineLogMapper.xml
0 → 100644
View file @
06c61ebb
<?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
house365-hgs-ws/src/main/resources/test/mybatis/UserMapper.xml
View file @
06c61ebb
...
...
@@ -46,6 +46,7 @@
<result
property=
"wxNumber"
column=
"wx_number"
/>
<result
property=
"wxCodeImgUrl"
column=
"wx_code_imgUrl"
/>
<result
property=
"promoteId"
column=
"promote_id"
/>
<result
property=
"onlineStatus"
column=
"online_status"
/>
</resultMap>
<resultMap
id=
"infoMap2"
type=
"com.house365.beans.entity.UserSimpleEntity"
>
...
...
@@ -140,6 +141,12 @@
<if
test=
"identityType != null and identityType != ''"
>
AND identityType = #{identityType}
</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 "
>
ORDER BY name ASC
</if>
...
...
@@ -234,10 +241,10 @@
</select>
<insert
id=
"addRequestLoginInfo"
parameterType=
"com.house365.beans.entity.RequestLoginEntity"
>
insert into request_login (name,realName,loginIp,loginCity,loginTime,authorizationTime, userId) values
(
#{name},#{realName},#{loginIp},#{loginCity},#{loginTime},#{authorizationTime}, #{userId}
)
insert into request_login (name,realName,loginIp,loginCity,loginTime,authorizationTime, userId) values
(
#{name},#{realName},#{loginIp},#{loginCity},#{loginTime},#{authorizationTime}, #{userId}
)
</insert>
<select
id=
"getRequestLoginInfo"
resultMap=
"infoMap4"
>
...
...
@@ -246,4 +253,11 @@
order by loginTime desc
</select>
<update
id=
"updateUserStatus"
parameterType=
"map"
>
UPDATE user
SET
online_status = #{onlineStatus}
WHERE mobile = #{mobile}
</update>
</mapper>
\ No newline at end of file
house365-hgs-ws/src/main/resources/test/mybatis/UserMeaaageMapper.xml
0 → 100644
View file @
06c61ebb
<?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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment