Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
server
Overview
Overview
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
vanke
server
Commits
bc7d6b42
Commit
bc7d6b42
authored
Apr 14, 2021
by
XiaHou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加万科 从微V导入 功能
parent
5f5189a7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
9 deletions
+53
-9
VankeGetUserInfoVO.java
...in/java/com/macro/mall/domain/dto/VankeGetUserInfoVO.java
+26
-0
ADServiceImpl.java
...java/com/macro/mall/service/vanke/impl/ADServiceImpl.java
+2
-2
VankeMemberLoginServiceImpl.java
.../mall/service/vanke/impl/VankeMemberLoginServiceImpl.java
+22
-7
UmsMemberDao.xml
...ce/src/main/resources/com/macro/mall/dao/UmsMemberDao.xml
+3
-0
No files found.
mall-service/src/main/java/com/macro/mall/domain/dto/VankeGetUserInfoVO.java
0 → 100644
View file @
bc7d6b42
package
com
.
macro
.
mall
.
domain
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Author xh
* @Date 2021/4/14
* description:
*/
@Data
public
class
VankeGetUserInfoVO
implements
Serializable
{
@ApiModelProperty
(
value
=
"轻应用id"
)
private
String
appid
;
@ApiModelProperty
(
value
=
"云之家APP会传递ticket参数给轻应用(把ticket参数追加到轻应用对应的url中)时效为1小时,不建议开发者缓存使用"
)
private
String
ticket
;
@ApiModelProperty
(
value
=
"轻应用secret,即appsecret"
)
private
String
secret
;
@ApiModelProperty
(
value
=
"当前北京时间,Unix格式13位时间戳,精确到毫秒,3分钟内有效。"
)
private
Long
timestamp
;
@ApiModelProperty
(
value
=
"授权级别:app"
)
private
String
scope
;
}
mall-service/src/main/java/com/macro/mall/service/vanke/impl/ADServiceImpl.java
View file @
bc7d6b42
...
...
@@ -14,8 +14,8 @@ import java.util.Hashtable;
@Service
public
class
ADServiceImpl
implements
IADService
{
private
static
String
host
=
"1
82.61.50.234
"
;
//AD域IP,必须填写正确
private
static
String
domain
=
"@
tengfeikeji.club
"
;
//域名后缀,例.@noker.cn.com
private
static
String
host
=
"1
0.0.1.1
"
;
//AD域IP,必须填写正确
private
static
String
domain
=
"@
vanke.net.cn
"
;
//域名后缀,例.@noker.cn.com
private
static
String
port
=
"389"
;
//端口,一般默认389
...
...
mall-service/src/main/java/com/macro/mall/service/vanke/impl/VankeMemberLoginServiceImpl.java
View file @
bc7d6b42
package
com
.
macro
.
mall
.
service
.
vanke
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.macro.mall.common.baiduyun.HttpUtil
;
import
com.macro.mall.common.utils.HttpClientUtil
;
import
com.macro.mall.common.utils.HttpUtils
;
import
com.macro.mall.common.utils.MyJsonUtil
;
import
com.macro.mall.dao.UmsMemberDao
;
import
com.macro.mall.domain.dto.VankeGetUserInfoVO
;
import
com.macro.mall.mapper.UmsMemberMapper
;
import
com.macro.mall.mapper.VankeDepartmentMapper
;
import
com.macro.mall.mapper.VankeVvUserMapper
;
...
...
@@ -64,17 +67,22 @@ public class VankeMemberLoginServiceImpl implements IVankeMemberLoginService {
//先判断redis是否存在vankeAccessToken
String
vankeAccessToken
=
this
.
redisService
.
get
(
"vankeAccessToken"
);
if
(
vankeAccessToken
==
null
||
vankeAccessToken
.
isEmpty
()){
String
params
=
"{\n"
+
/*
String params ="{\n" +
" \"appId\": \""+getConfig("appid")+"\",\n" +
" \"secret\": \""+getConfig("secret")+"\",\n" +
" \"timestamp\": "+new java.util.Date().getTime()+",\n" +
" \"scope\": \""+getConfig("scope")+"\"\n" +
"}"
;
"}";*/
String
res
=
null
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
VankeGetUserInfoVO
vankeGetUserInfoVO
=
new
VankeGetUserInfoVO
();
vankeGetUserInfoVO
.
setAppid
(
getConfig
(
"appid"
));
vankeGetUserInfoVO
.
setSecret
(
getConfig
(
"secret"
));
vankeGetUserInfoVO
.
setTimestamp
(
new
java
.
util
.
Date
().
getTime
());
vankeGetUserInfoVO
.
setScope
(
getConfig
(
"scope"
));
try
{
res
=
HttpUtil
.
postGeneralUrl
(
getConfig
(
"host"
)+
"/gateway/oauth2/token/getAccessToken"
,
"application/json"
,
params
,
"UTF-8"
);
System
.
out
.
println
(
getConfig
(
"host"
));
res
=
HttpUtil
.
postGeneralUrl
(
getConfig
(
"host"
)+
"/gateway/oauth2/token/getAccessToken"
,
"application/json"
,
JSONObject
.
toJSONString
(
vankeGetUserInfoVO
),
"UTF-8"
);
map
=
MyJsonUtil
.
getMapChangeJson
(
res
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -138,18 +146,25 @@ public class VankeMemberLoginServiceImpl implements IVankeMemberLoginService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResultMsg
getVankeUserInfo
(
String
ticket
){
this
.
getVankeConfig
();
if
(
ticket
==
null
||
""
.
equals
(
ticket
)){
return
new
ResultMsg
(
false
,
"传入ticket为空"
);
}
//通过appId 和 ticket 以及 token发起获取用户身份信息请求
String
params
=
"{\n"
+
/*
String params ="{\n" +
" \"appid\": \""+getConfig("appid")+"\",\n" +
" \"ticket\": \""+ticket+"\"\n" +
"}"
;
"}";
*/
String
res
=
null
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
VankeGetUserInfoVO
vankeGetUserInfoVO
=
new
VankeGetUserInfoVO
();
vankeGetUserInfoVO
.
setAppid
(
getConfig
(
"appid"
));
vankeGetUserInfoVO
.
setTicket
(
ticket
);
try
{
res
=
HttpUtil
.
postGeneralUrl
(
getConfig
(
"host"
)+
"/gateway/ticket/user/acquirecontext?accessToken="
+
this
.
getVankeAccessToken
(),
"application/json"
,
params
,
"UTF-8"
);
System
.
out
.
println
(
getConfig
(
"host"
)+
"/gateway/ticket/user/acquirecontext?accessToken="
+
this
.
getVankeAccessToken
());
System
.
out
.
println
(
JSONObject
.
toJSONString
(
vankeGetUserInfoVO
));
res
=
HttpUtil
.
postGeneralUrl
(
getConfig
(
"host"
)+
"/gateway/ticket/user/acquirecontext?accessToken="
+
this
.
getVankeAccessToken
(),
"application/json"
,
JSONObject
.
toJSONString
(
vankeGetUserInfoVO
),
"UTF-8"
);
map
=
MyJsonUtil
.
getMapChangeJson
(
res
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
mall-service/src/main/resources/com/macro/mall/dao/UmsMemberDao.xml
View file @
bc7d6b42
...
...
@@ -861,6 +861,9 @@
<if
test=
"accouuntType != null"
>
and a.accouunt_type = #{accouuntType}
</if>
<if
test=
"name != null and name != ''"
>
and a.name like CONCAT('%',#{name},'%')
</if>
</select>
<select
id=
"selectUmsMemberByJobNo"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
...
...
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