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
744d8372
Commit
744d8372
authored
Jan 12, 2021
by
jay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
im统一信息接口添加
parent
092128a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
24 deletions
+46
-24
GetImUserInfoImpl.java
...va/com/house365/ws/interfaces/rest/GetImUserInfoImpl.java
+46
-24
No files found.
house365-hgs-ws/src/main/java/com/house365/ws/interfaces/rest/GetImUserInfoImpl.java
View file @
744d8372
...
...
@@ -2,6 +2,7 @@ package com.house365.ws.interfaces.rest;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.common.base.Strings
;
import
com.house365.beans.entity.DepartmentEntity
;
import
com.house365.beans.entity.KefuEntity
;
import
com.house365.beans.entity.UserEntity
;
import
com.house365.beans.entity.UserMessageEntity
;
...
...
@@ -11,6 +12,7 @@ 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.ws.dao.mapper.DepartMapper
;
import
com.house365.ws.dao.mapper.KefuMapper
;
import
com.house365.ws.dao.mapper.UserMapper
;
import
com.house365.ws.dao.mapper.UserMessageMapper
;
...
...
@@ -44,6 +46,8 @@ public class GetImUserInfoImpl implements IGetImUserInfo {
private
UserMessageMapper
messageMapper
;
@Autowired
private
KefuMapper
kefumapper
;
@Autowired
private
DepartMapper
departMapper
;
@Override
public
Object
exectue
(
Parameter
parameter
)
throws
ServiceRunException
{
...
...
@@ -103,45 +107,63 @@ public class GetImUserInfoImpl implements IGetImUserInfo {
data
.
setEntity
(
putMap
);
}
}
else
{
//非南京情况下,先判断是否直卖楼盘,非直卖楼盘;直卖楼盘调用淘房汇接口,有客服id取客服id,没有取accid,非直卖楼盘直接去新房房博士id
if
(
StringUtils
.
isBlank
(
projectId
)
||
StringUtils
.
isBlank
(
channel
))
{
response
.
setResult
(
ReturnAppResult
.
APP_FAIL
.
getResultCode
());
response
.
setMsg
(
"接口参数不全"
);
return
JSONObject
.
fromObject
(
response
).
toString
();
}
String
accId
;
KefuEntity
kefuEntity
=
kefumapper
.
getKefuInfo
(
city
);
if
(
null
!=
kefuEntity
&&
"1"
.
equals
(
kefuEntity
.
getSetKefu
()))
{
accId
=
kefuEntity
.
getKefuAccid
();
//查询各个城市的新房客服
String
accId
=
""
;
List
<
NameValuePair
>
param
=
new
ArrayList
<>();
param
.
add
(
new
BasicNameValuePair
(
"serviceCode"
,
"TaoFangHui"
));
param
.
add
(
new
BasicNameValuePair
(
"serviceName"
,
"getBindInfo"
));
param
.
add
(
new
BasicNameValuePair
(
"city"
,
city
));
param
.
add
(
new
BasicNameValuePair
(
"projectId"
,
projectId
));
param
.
add
(
new
BasicNameValuePair
(
"channel"
,
channel
));
String
result
=
HttpClientUtil
.
doGet
(
MemoryPropertyPlaceholderConfigurer
.
getContextProperty
(
"tangfanghui.server.url"
),
param
,
4000
,
null
);
//根据条件查不到楼盘信息的情况下 即非直卖楼盘
if
(
""
.
equals
(
result
))
{
//非直卖楼盘,查询各个城市的新房客服
Map
<
String
,
Object
>
searchMap
=
new
HashMap
<>(
10
);
searchMap
.
put
(
"descripition"
,
city
);
List
<
DepartmentEntity
>
deptList
=
departMapper
.
queryByConditions
(
searchMap
);
if
(
CollectionUtils
.
isNotEmpty
(
deptList
))
{
DepartmentEntity
entity
=
deptList
.
get
(
0
);
String
urlPath
=
entity
.
getUrlPath
();
searchMap
.
put
(
"deptUrlPath"
,
urlPath
);
searchMap
.
put
(
"identityType"
,
3
);
List
<
UserEntity
>
userList
=
userMapper
.
queryByConditions
(
searchMap
);
if
(
CollectionUtils
.
isNotEmpty
(
userList
))
{
accId
=
userList
.
get
(
0
).
getAccId
();
}
}
}
else
{
//判断是否直卖楼盘
//调用淘房汇绑定直销人员list
List
<
NameValuePair
>
param
=
new
ArrayList
<>();
param
.
add
(
new
BasicNameValuePair
(
"serviceCode"
,
"TaoFangHui"
));
param
.
add
(
new
BasicNameValuePair
(
"serviceName"
,
"getBindInfo"
));
param
.
add
(
new
BasicNameValuePair
(
"city"
,
city
));
param
.
add
(
new
BasicNameValuePair
(
"projectId"
,
projectId
));
param
.
add
(
new
BasicNameValuePair
(
"channel"
,
channel
));
String
result
=
HttpClientUtil
.
doGet
(
MemoryPropertyPlaceholderConfigurer
.
getContextProperty
(
"tangfanghui.server.url"
),
param
,
4000
,
null
);
//直卖楼盘去查询城市客服
if
(
result
!=
null
)
{
//根据条件查不到楼盘信息的情况下
if
(
""
.
equals
(
result
))
{
return
null
;
}
ObjectMapper
objectMapper
=
new
ObjectMapper
();
Map
<
String
,
Map
<
String
,
Map
>>
webMap
=
objectMapper
.
readValue
(
result
,
Map
.
class
);
List
<
Map
<
String
,
Object
>>
list
=
(
List
<
Map
<
String
,
Object
>>)
webMap
.
get
(
"data"
).
get
(
"entity"
).
get
(
"list"
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
Map
<
String
,
Object
>
l
:
list
)
{
int
userId
=
Integer
.
parseInt
(
l
.
get
(
"userId"
).
toString
());
KefuEntity
kefuEntity
=
kefumapper
.
getKefuInfo
(
city
);
if
(
null
!=
kefuEntity
&&
"1"
.
equals
(
kefuEntity
.
getSetKefu
()))
{
accId
=
kefuEntity
.
getKefuAccid
();
}
else
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
Map
<
String
,
Map
<
String
,
Map
>>
webMap
=
objectMapper
.
readValue
(
result
,
Map
.
class
);
List
<
Map
<
String
,
Object
>>
list
=
(
List
<
Map
<
String
,
Object
>>)
webMap
.
get
(
"data"
).
get
(
"entity"
).
get
(
"list"
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
int
pick
=
getRandom
(
list
.
size
());
Map
<
String
,
Object
>
resultMap
=
list
.
get
(
pick
);
int
userId
=
Integer
.
parseInt
(
resultMap
.
get
(
"userId"
).
toString
());
UserEntity
userEntity
=
userMapper
.
getById
(
userId
);
accId
=
userEntity
.
getAccId
();
}
}
}
}
putMap
.
put
(
"accId"
,
accId
);
data
.
setEntity
(
putMap
);
}
response
.
setResult
(
ReturnAppResult
.
APP_FAIL
.
getResultCode
());
response
.
setMsg
(
"查询成功"
);
response
.
setMsg
(
"查询
IM信息
成功"
);
response
.
setData
(
data
);
}
catch
(
Exception
e
)
{
...
...
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