Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
febeffdb
Commit
febeffdb
authored
Aug 06, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
76536f72
48005a38
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
130 additions
and
127 deletions
+130
-127
AccessGatewayFilter.java
...hub/wxiaoqi/security/gate/filter/AccessGatewayFilter.java
+40
-33
logback.xml
ace-gate/src/main/resources/logback.xml
+2
-2
AppUserDetailBiz.java
...m/github/wxiaoqi/security/admin/biz/AppUserDetailBiz.java
+5
-10
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+45
-19
AppUserSellingWaterBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
+2
-2
AppUserRelationController.java
...xiaoqi/security/admin/rest/AppUserRelationController.java
+2
-1
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+6
-6
TourGoodMapper.xml
...-tour-server/src/main/resources/mapper/TourGoodMapper.xml
+7
-7
OrderPayBiz.java
...ain/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
+17
-44
OrderRefundBiz.java
.../java/com/xxfc/platform/universal/biz/OrderRefundBiz.java
+4
-3
No files found.
ace-gate/src/main/java/com/github/wxiaoqi/security/gate/filter/AccessGatewayFilter.java
View file @
febeffdb
...
@@ -54,7 +54,7 @@ import java.util.stream.Stream;
...
@@ -54,7 +54,7 @@ import java.util.stream.Stream;
*/
*/
@Configuration
@Configuration
@Slf4j
@Slf4j
public
class
AccessGatewayFilter
implements
GlobalFilter
{
public
class
AccessGatewayFilter
implements
GlobalFilter
{
@Autowired
@Autowired
@Lazy
@Lazy
private
IUserService
userService
;
private
IUserService
userService
;
...
@@ -113,8 +113,8 @@ public class AccessGatewayFilter implements GlobalFilter{
...
@@ -113,8 +113,8 @@ public class AccessGatewayFilter implements GlobalFilter{
// IJWTInfo user = null;
// IJWTInfo user = null;
// try {
// try {
// user = getJWTUser(request, mutate);
// user = getJWTUser(request, mutate);
// 申请客户端密钥头
// 申请客户端密钥头
mutate
.
header
(
serviceAuthConfig
.
getTokenHeader
(),
serviceAuthUtil
.
getClientToken
());
mutate
.
header
(
serviceAuthConfig
.
getTokenHeader
(),
serviceAuthUtil
.
getClientToken
());
// } catch (Exception e) {
// } catch (Exception e) {
// log.info("调用免登陆接口的用户Token过期异常", e);
// log.info("调用免登陆接口的用户Token过期异常", e);
// }
// }
...
@@ -257,7 +257,7 @@ public class AccessGatewayFilter implements GlobalFilter{
...
@@ -257,7 +257,7 @@ public class AccessGatewayFilter implements GlobalFilter{
private
boolean
isStartWith
(
String
requestUri
)
{
private
boolean
isStartWith
(
String
requestUri
)
{
boolean
flag
=
false
;
boolean
flag
=
false
;
for
(
String
s
:
GATE_WAY_UNAUTH
.
split
(
","
))
{
for
(
String
s
:
GATE_WAY_UNAUTH
.
split
(
","
))
{
if
(
requestUri
.
contains
(
s
))
{
if
(
requestUri
.
contains
(
s
))
{
return
true
;
return
true
;
}
}
}
}
...
@@ -281,12 +281,12 @@ public class AccessGatewayFilter implements GlobalFilter{
...
@@ -281,12 +281,12 @@ public class AccessGatewayFilter implements GlobalFilter{
}
}
public
void
setLogService
(
ServerWebExchange
exchange
,
GatewayFilterChain
chain
)
{
public
void
setLogService
(
ServerWebExchange
exchange
,
GatewayFilterChain
chain
)
{
MediaType
mediaType
=
exchange
.
getRequest
().
getHeaders
().
getContentType
();
MediaType
mediaType
=
exchange
.
getRequest
().
getHeaders
().
getContentType
();
ServerRequest
serverRequest
=
new
DefaultServerRequest
(
exchange
);
ServerRequest
serverRequest
=
new
DefaultServerRequest
(
exchange
);
// 如果是json格式,将body内容转化为object or map 都可
// 如果是json格式,将body内容转化为object or map 都可
if
(
MediaType
.
APPLICATION_JSON
.
isCompatibleWith
(
mediaType
)){
if
(
MediaType
.
APPLICATION_JSON
.
isCompatibleWith
(
mediaType
))
{
Mono
<
Object
>
modifiedBody
=
serverRequest
.
bodyToMono
(
Object
.
class
)
Mono
<
Object
>
modifiedBody
=
serverRequest
.
bodyToMono
(
Object
.
class
)
.
flatMap
(
body
->
{
.
flatMap
(
body
->
{
recordLog
(
exchange
.
getRequest
(),
body
);
recordLog
(
exchange
.
getRequest
(),
body
);
...
@@ -295,7 +295,7 @@ public class AccessGatewayFilter implements GlobalFilter{
...
@@ -295,7 +295,7 @@ public class AccessGatewayFilter implements GlobalFilter{
}
}
// 如果是表单请求
// 如果是表单请求
else
if
(
MediaType
.
APPLICATION_FORM_URLENCODED
.
isCompatibleWith
(
mediaType
))
{
else
if
(
MediaType
.
APPLICATION_FORM_URLENCODED
.
isCompatibleWith
(
mediaType
))
{
Mono
<
String
>
modifiedBody
=
serverRequest
.
bodyToMono
(
String
.
class
)
Mono
<
String
>
modifiedBody
=
serverRequest
.
bodyToMono
(
String
.
class
)
// .log("modify_request_mono", Level.INFO)
// .log("modify_request_mono", Level.INFO)
.
flatMap
(
body
->
{
.
flatMap
(
body
->
{
...
@@ -310,36 +310,43 @@ public class AccessGatewayFilter implements GlobalFilter{
...
@@ -310,36 +310,43 @@ public class AccessGatewayFilter implements GlobalFilter{
// 无法兼容的请求,则不读取body,像Get请求这种
// 无法兼容的请求,则不读取body,像Get请求这种
recordLog
(
exchange
.
getRequest
(),
""
);
recordLog
(
exchange
.
getRequest
(),
""
);
}
}
private
void
recordLog
(
ServerHttpRequest
request
,
Object
body
)
{
private
void
recordLog
(
ServerHttpRequest
request
,
Object
body
)
{
// 记录要访问的url
// 记录要访问的url
StringBuilder
builder
=
new
StringBuilder
();
if
(!
getNotLogUri
().
contains
(
request
.
getURI
().
getRawPath
()))
{
log
.
info
(
"=================请求uri:"
+
request
.
getURI
().
getRawPath
());
StringBuilder
builder
=
new
StringBuilder
();
// 记录访问的方法
log
.
info
(
"=================请求uri:"
+
request
.
getURI
().
getRawPath
());
HttpMethod
method
=
request
.
getMethod
();
// 记录访问的方法
if
(
null
!=
method
){
HttpMethod
method
=
request
.
getMethod
();
log
.
info
(
"=================请求方法:"
+
method
.
name
());
if
(
null
!=
method
)
{
}
log
.
info
(
"=================请求方法:"
+
method
.
name
());
// 记录头部信息
builder
.
append
(
", header { "
);
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry
:
request
.
getHeaders
().
entrySet
())
{
builder
.
append
(
entry
.
getKey
()).
append
(
":"
).
append
(
StringUtils
.
join
(
entry
.
getValue
(),
","
)).
append
(
","
);
}
log
.
info
(
"=================请求头header:"
+
builder
.
toString
());
// 记录参数
builder
=
new
StringBuilder
();
// 处理get的请求
if
(
null
!=
method
&&
HttpMethod
.
GET
.
matches
(
method
.
name
()))
{
// 记录请求的参数信息 针对GET 请求
MultiValueMap
<
String
,
String
>
queryParams
=
request
.
getQueryParams
();
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry
:
queryParams
.
entrySet
())
{
builder
.
append
(
entry
.
getKey
()).
append
(
"="
).
append
(
StringUtils
.
join
(
entry
.
getValue
(),
","
)).
append
(
","
);
}
}
// 记录头部信息
builder
.
append
(
", header { "
);
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry
:
request
.
getHeaders
().
entrySet
())
{
builder
.
append
(
entry
.
getKey
()).
append
(
":"
).
append
(
StringUtils
.
join
(
entry
.
getValue
(),
","
)).
append
(
","
);
}
log
.
info
(
"=================请求头header:"
+
builder
.
toString
());
// 记录参数
builder
=
new
StringBuilder
();
// 处理get的请求
if
(
null
!=
method
&&
HttpMethod
.
GET
.
matches
(
method
.
name
()))
{
// 记录请求的参数信息 针对GET 请求
MultiValueMap
<
String
,
String
>
queryParams
=
request
.
getQueryParams
();
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry
:
queryParams
.
entrySet
())
{
builder
.
append
(
entry
.
getKey
()).
append
(
"="
).
append
(
StringUtils
.
join
(
entry
.
getValue
(),
","
)).
append
(
","
);
}
}
else
{
// 从body中读取参数
builder
.
append
(
body
);
}
log
.
info
(
"=================请求参数:"
+
builder
.
toString
());
}
}
else
{
}
// 从body中读取参数
@Value
(
"${logback.ignore-log-path}"
)
builder
.
append
(
body
)
;
String
[]
path
;
}
public
List
<
String
>
getNotLogUri
()
{
log
.
info
(
"=================请求参数:"
+
builder
.
toString
()
);
return
Arrays
.
asList
(
path
);
}
}
}
}
ace-gate/src/main/resources/logback.xml
View file @
febeffdb
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<filter
class=
"com.github.wxiaoqi.security.common.filter.DenyFilter"
></filter>
<filter
class=
"com.github.wxiaoqi.security.common.filter.DenyFilter"
></filter>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<FileNamePattern>
${LOG_HOME}/sys.%d{yyyy-MM-dd}.log
</FileNamePattern>
<!--日志文件输出的文件名 -->
<FileNamePattern>
${LOG_HOME}/sys.%d{yyyy-MM-dd}.log
</FileNamePattern>
<!--日志文件输出的文件名 -->
<MaxHistory>
30
</MaxHistory>
<!--日志文件保留天数 -->
<MaxHistory>
15
</MaxHistory>
<!--日志文件保留天数 -->
</rollingPolicy>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<Pattern>
${CONSOLE_LOG_PATTERN}
</Pattern>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
<Pattern>
${CONSOLE_LOG_PATTERN}
</Pattern>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
<filter
class=
"com.github.wxiaoqi.security.common.filter.AcceptFilter"
></filter>
<filter
class=
"com.github.wxiaoqi.security.common.filter.AcceptFilter"
></filter>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<FileNamePattern>
${LOG_HOME}/log.%d{yyyy-MM-dd}.log
</FileNamePattern>
<!--日志文件输出的文件名 -->
<FileNamePattern>
${LOG_HOME}/log.%d{yyyy-MM-dd}.log
</FileNamePattern>
<!--日志文件输出的文件名 -->
<MaxHistory>
30
</MaxHistory>
<!--日志文件保留天数 -->
<MaxHistory>
15
</MaxHistory>
<!--日志文件保留天数 -->
</rollingPolicy>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<Pattern>
${CONSOLE_LOG_PATTERN}
</Pattern>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
<Pattern>
${CONSOLE_LOG_PATTERN}
</Pattern>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserDetailBiz.java
View file @
febeffdb
...
@@ -7,15 +7,17 @@ import com.github.wxiaoqi.security.admin.mapper.AppUserDetailMapper;
...
@@ -7,15 +7,17 @@ import com.github.wxiaoqi.security.admin.mapper.AppUserDetailMapper;
import
com.github.wxiaoqi.security.admin.rpc.service.AppPermissionService
;
import
com.github.wxiaoqi.security.admin.rpc.service.AppPermissionService
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.util.ReferralCodeUtil
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.time.Instant
;
import
java.time.Instant
;
import
java.util.*
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -29,10 +31,6 @@ import java.util.stream.Collectors;
...
@@ -29,10 +31,6 @@ import java.util.stream.Collectors;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
class
AppUserDetailBiz
extends
BaseBiz
<
AppUserDetailMapper
,
AppUserDetail
>
{
public
class
AppUserDetailBiz
extends
BaseBiz
<
AppUserDetailMapper
,
AppUserDetail
>
{
@Autowired
private
AppUserLoginBiz
appUserLoginBiz
;
@Override
@Override
@CacheClear
(
pre
=
"user{1.userid}"
)
@CacheClear
(
pre
=
"user{1.userid}"
)
public
void
updateSelectiveById
(
AppUserDetail
entity
)
{
public
void
updateSelectiveById
(
AppUserDetail
entity
)
{
...
@@ -105,9 +103,6 @@ public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
...
@@ -105,9 +103,6 @@ public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
}
}
//更新用户信息
//更新用户信息
public
Map
<
Integer
,
AppUserDetail
>
findUserIdAndUserDetailMapByMemberIds
(
List
<
Integer
>
memberIds
)
{
public
Map
<
Integer
,
AppUserDetail
>
findUserIdAndUserDetailMapByMemberIds
(
List
<
Integer
>
memberIds
)
{
Map
<
Integer
,
AppUserDetail
>
userIdAndAppUserDetailMap
=
new
HashMap
<>();
Map
<
Integer
,
AppUserDetail
>
userIdAndAppUserDetailMap
=
new
HashMap
<>();
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
febeffdb
...
@@ -57,6 +57,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
...
@@ -57,6 +57,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
/**
/**
* 关系绑定
* 关系绑定
* 规则A->B (B无有效上线+无有效下线)
* @param userId
* @param userId
* @param parentId
* @param parentId
*/
*/
...
@@ -70,28 +71,31 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
...
@@ -70,28 +71,31 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
if
(
relation
==
null
){
if
(
relation
==
null
){
relation
=
new
AppUserRelation
();
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
parentId
);
relation
.
setUserId
(
parentId
);
relation
.
setIsForever
(
1
);
relation
.
setBindTime
(
time
);
relation
.
setBindType
(
type
);
relation
.
setBindType
(
type
);
insertSelective
(
relation
);
insertSelective
(
relation
);
}
}
relation
=
getMyBiz
().
getRelationByUserId
(
userId
);
Long
bindTime
=
time
-
validTime
;
if
(
relation
==
null
){
//判断用户是否有有效的下线
relation
=
new
AppUserRelation
();
if
(
getCountByParentId
(
userId
,
bindTime
)==
0L
){
relation
.
setUserId
(
userId
);
relation
=
getMyBiz
().
getRelationByUserId
(
userId
);
relation
.
setParentId
(
parentId
);
if
(
relation
==
null
){
relation
.
setBindType
(
type
);
relation
=
new
AppUserRelation
();
relation
.
setBindTime
(
time
);
relation
.
setUserId
(
userId
);
insertSelective
(
relation
);
relation
.
setParentId
(
parentId
);
}
else
{
relation
.
setBindType
(
type
);
//用户存在父id为0的不能成为任何人下线
relation
.
setBindTime
(
time
);
if
((
relation
.
getIsForever
()!=
1
&&(
time
-
relation
.
getBindTime
())>
validTime
)){
insertSelective
(
relation
);
relation
.
setParentId
(
parentId
);
}
else
{
relation
.
setBindType
(
type
);
//判断用户是否有有效的上线
relation
.
setBindTime
(
time
);
log
.
info
(
"----userId==="
+
userId
+
"----bindTime===="
+
bindTime
+
"----relation.getBindTime()==="
+
relation
.
getBindTime
());
getMyBiz
().
updRelation
(
relation
);
if
(
relation
.
getParentId
()==
null
||
relation
.
getParentId
()==
0
||(
relation
.
getIsForever
()!=
1
&&
relation
.
getBindTime
()<
bindTime
)){
}
relation
.
setParentId
(
parentId
);
}
relation
.
setBindType
(
type
);
relation
.
setBindTime
(
time
);
getMyBiz
().
updRelation
(
relation
);
}
}
}
}
}
//首页关系绑定
//首页关系绑定
public
ObjectRestResponse
appBindRelation
(
Integer
userId
,
String
code
){
public
ObjectRestResponse
appBindRelation
(
Integer
userId
,
String
code
){
...
@@ -197,6 +201,28 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
...
@@ -197,6 +201,28 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
return
selectOne
(
relation
);
return
selectOne
(
relation
);
}
}
//获取有效的上线
public
AppUserRelation
getRelationByIdUserIdAndTime
(
Integer
userId
){
AppUserRelation
userRelation
=
getMyBiz
().
getRelationByUserId
(
userId
);
if
(
userRelation
==
null
){
return
null
;
}
log
.
info
(
"---userId==="
+
userId
+
"-----isForever==="
+
userRelation
.
getIsForever
());
Long
time
=
System
.
currentTimeMillis
()-
validTime
;
if
(
userRelation
.
getIsForever
()==
1
||
userRelation
.
getBindTime
()>
time
){
return
userRelation
;
}
log
.
info
(
"---userId==="
+
userId
+
"-----time==="
+
time
+
"----userRelation.getBindTime()==="
+
userRelation
.
getBindTime
());
return
null
;
}
//获取用户的下线总数
public
int
getCountByParentId
(
Integer
parentId
,
Long
time
){
Example
example
=
new
Example
(
AppUserRelation
.
class
);
example
.
createCriteria
().
andEqualTo
(
"parentId"
,
parentId
).
andNotEqualTo
(
"isForever"
,
1
).
andGreaterThan
(
"bindTime"
,
time
);
return
mapper
.
selectCountByExample
(
example
);
}
@CacheClear
(
key
=
"user:relation{1.userId}"
)
@CacheClear
(
key
=
"user:relation{1.userId}"
)
public
int
updRelation
(
AppUserRelation
appUserRelation
){
public
int
updRelation
(
AppUserRelation
appUserRelation
){
return
super
.
updateSelectiveByIdRe
(
appUserRelation
);
return
super
.
updateSelectiveByIdRe
(
appUserRelation
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
View file @
febeffdb
...
@@ -95,9 +95,9 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -95,9 +95,9 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
log
.
info
(
"购买计算用户拥金----payOrderWater----参数不能为空----orderId==="
+
orderId
);
log
.
info
(
"购买计算用户拥金----payOrderWater----参数不能为空----orderId==="
+
orderId
);
return
;
return
;
}
}
AppUserRelation
relation
=
relationBiz
.
getRelationBy
UserId
(
userId
);
AppUserRelation
relation
=
relationBiz
.
getRelationBy
IdUserIdAndTime
(
userId
);
if
(
relation
==
null
||
relation
.
getParentId
()
==
null
||
relation
.
getParentId
()
==
0
)
{
if
(
relation
==
null
||
relation
.
getParentId
()
==
null
||
relation
.
getParentId
()
==
0
)
{
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---无上线"
);
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---无
有效
上线"
);
return
;
return
;
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUserRelationController.java
View file @
febeffdb
...
@@ -43,9 +43,10 @@ public class AppUserRelationController extends BaseController<AppUserRelationBiz
...
@@ -43,9 +43,10 @@ public class AppUserRelationController extends BaseController<AppUserRelationBiz
@ApiModelProperty
(
"app分享绑定"
)
@ApiModelProperty
(
"app分享绑定"
)
public
ObjectRestResponse
bind
(
public
ObjectRestResponse
bind
(
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"userid"
,
defaultValue
=
"0"
)
Integer
userid
,
HttpServletRequest
request
){
HttpServletRequest
request
){
try
{
try
{
Integer
userid
=
Integer
.
parseInt
(
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
)).
getId
());
//
Integer userid = Integer.parseInt(userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request)).getId());
return
baseBiz
.
appBindRelation
(
userid
,
code
);
return
baseBiz
.
appBindRelation
(
userid
,
code
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
febeffdb
...
@@ -3,17 +3,16 @@ package com.github.wxiaoqi.security.admin.rpc.service;
...
@@ -3,17 +3,16 @@ package com.github.wxiaoqi.security.admin.rpc.service;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.biz.*
;
import
com.github.wxiaoqi.security.admin.biz.*
;
import
com.github.wxiaoqi.security.admin.biz.AppUserBiz
;
import
com.github.wxiaoqi.security.admin.biz.AppUserDetailBiz
;
import
com.github.wxiaoqi.security.admin.biz.AppUserLoginBiz
;
import
com.github.wxiaoqi.security.admin.biz.ElementBiz
;
import
com.github.wxiaoqi.security.admin.constant.RedisKey
;
import
com.github.wxiaoqi.security.admin.constant.RedisKey
;
import
com.github.wxiaoqi.security.admin.constant.enumerate.UserSourceEnum
;
import
com.github.wxiaoqi.security.admin.constant.enumerate.UserSourceEnum
;
import
com.github.wxiaoqi.security.admin.dto.BaseUserMemberExportDTO
;
import
com.github.wxiaoqi.security.admin.dto.BaseUserMemberExportDTO
;
import
com.github.wxiaoqi.security.admin.dto.RegisterParamDTO
;
import
com.github.wxiaoqi.security.admin.dto.RegisterParamDTO
;
import
com.github.wxiaoqi.security.admin.dto.RegisterQueueDTO
;
import
com.github.wxiaoqi.security.admin.dto.RegisterQueueDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.entity.AppUser
;
import
com.github.wxiaoqi.security.admin.entity.AppUserDetail
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.entity.Element
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.ImiVo
;
import
com.github.wxiaoqi.security.admin.vo.ImiVo
;
import
com.github.wxiaoqi.security.api.vo.authority.PermissionInfo
;
import
com.github.wxiaoqi.security.api.vo.authority.PermissionInfo
;
...
@@ -51,7 +50,8 @@ import javax.annotation.Resource;
...
@@ -51,7 +50,8 @@ import javax.annotation.Resource;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
config
.
rabbit
.
RabbitConstant
.*;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
config
.
rabbit
.
RabbitConstant
.
KEY_APPUSER_AUTH
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
config
.
rabbit
.
RabbitConstant
.
KEY_APPUSER_REGISTER
;
/**
/**
* @author keliii
* @author keliii
...
...
xx-tour/xx-tour-server/src/main/resources/mapper/TourGoodMapper.xml
View file @
febeffdb
...
@@ -86,9 +86,9 @@
...
@@ -86,9 +86,9 @@
SELECT g.id as `id`,g.name as `name`,g.cover as `imgUrl`,g.price,
SELECT g.id as `id`,g.name as `name`,g.cover as `imgUrl`,g.price,
REPLACE(GROUP_CONCAT( DISTINCT t.`name`),',','|')as name1
REPLACE(GROUP_CONCAT( DISTINCT t.`name`),',','|')as name1
from tour_good g
from tour_good g
LEFT JOIN
tour_good_tag
tag ON g.id=tag.good_id
LEFT JOIN
(SELECT * FROM tour_good_tag WHERE is_del=0)
tag ON g.id=tag.good_id
LEFT JOIN
tour_tag
t ON tag.tag_id=t.id
LEFT JOIN
(SELECT * FROM tour_tag WHERE is_del=0)
t ON tag.tag_id=t.id
where g.recommend=1 and g.status=1 and g.is_del=0
and t.is_del=0
where g.recommend=1 and g.status=1 and g.is_del=0
GROUP BY g.id
GROUP BY g.id
ORDER BY g.rank DESC ,g.id DESC
ORDER BY g.rank DESC ,g.id DESC
limit #{start,jdbcType=INTEGER},#{size,jdbcType=INTEGER}
limit #{start,jdbcType=INTEGER},#{size,jdbcType=INTEGER}
...
@@ -101,16 +101,16 @@
...
@@ -101,16 +101,16 @@
<!--后台查询旅游路线列表-->
<!--后台查询旅游路线列表-->
<select
id=
"findGoodList"
resultMap=
"tourGoodVoMap"
>
<select
id=
"findGoodList"
resultMap=
"tourGoodVoMap"
>
SELECT g.*,REPLACE(GROUP_CONCAT( DISTINCT t.`name`),',','|')as tagNames from tour_good g
SELECT g.*,REPLACE(GROUP_CONCAT( DISTINCT t.`name`),',','|')as tagNames from tour_good g
LEFT JOIN
tour_good_tag
tag ON g.id=tag.good_id
LEFT JOIN
(SELECT * FROM tour_good_tag WHERE is_del=0)
tag ON g.id=tag.good_id
LEFT JOIN
tour_tag
t ON tag.tag_id=t.id
LEFT JOIN
(SELECT * FROM tour_tag WHERE is_del=0)
t ON tag.tag_id=t.id
<where>
<where>
g.is_del=0
and t.is_del=0
g.is_del=0
<if
test=
"params.name != null and params.name != ''"
>
<if
test=
"params.name != null and params.name != ''"
>
and (g.`name` like CONCAT('%',#{params.name},'%') or g.introduce like CONCAT('%',#{params.name},'%'))
and (g.`name` like CONCAT('%',#{params.name},'%') or g.introduce like CONCAT('%',#{params.name},'%'))
</if>
</if>
<if
test=
"params.tagId != null and params.tagId != '' "
>
<if
test=
"params.tagId != null and params.tagId != '' "
>
and g.id in (SELECT good_id from tour_good_tag
and g.id in (SELECT good_id from tour_good_tag
where tag_id = #{params.tagId})
where tag_id = #{params.tagId}
and is_del=0
)
</if>
</if>
</where>
</where>
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
View file @
febeffdb
...
@@ -292,7 +292,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -292,7 +292,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
SystemConfig
.
ALIPAY_PAY_BASE_URL
+
"/gateway.do"
,
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
SystemConfig
.
ALIPAY_PAY_BASE_URL
+
"/gateway.do"
,
SystemConfig
.
ALIPAY_APPID
,
SystemConfig
.
ALIPAY_PRIVATE_KEY
,
AlipayConstants
.
FORMAT_JSON
,
SystemConfig
.
ALIPAY_APPID
,
SystemConfig
.
ALIPAY_PRIVATE_KEY
,
AlipayConstants
.
FORMAT_JSON
,
"utf-8"
,
SystemConfig
.
ALIPAY_PUBLIC_KEY
,
AlipayConstants
.
SIGN_TYPE_RSA2
);
"utf-8"
,
SystemConfig
.
ALIPAY_PUBLIC_KEY
,
AlipayConstants
.
SIGN_TYPE_RSA2
);
return
alipayClient
;
return
alipayClient
;
}
}
//支付宝APP支付方法
//支付宝APP支付方法
...
@@ -421,28 +421,34 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -421,28 +421,34 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
}
}
/**
/**
* APP支付退款
* APP支付退款
*
* @param
* @param
* @param outTradeNo 订单号
* @param outTradeNo
订单号
* @param tradNo 流水号
* @param tradNo
流水号
* @param refundAmount 退款金额
* @param refundAmount 退款金额
* @param refundReason 退款原因
* @param refundReason 退款原因
* outRequestNo 退款请求标示 用于分批退款,每笔退款标示不一样,同样标示不会重复退款
* @return
* @return
*/
*/
public
boolean
alipayOrderRefund
(
String
outTradeNo
,
String
tradNo
,
Integer
refundAmount
,
String
refundReason
)
{
public
boolean
alipayOrderRefund
(
String
outTradeNo
,
String
tradNo
,
Integer
refundAmount
,
String
refundReason
,
String
outRequestNo
)
{
AlipayClient
alipayClient
=
getAlipayClient
();
AlipayClient
alipayClient
=
getAlipayClient
();
AlipayTradeRefundRequest
request
=
new
AlipayTradeRefundRequest
();
AlipayTradeRefundRequest
request
=
new
AlipayTradeRefundRequest
();
BigDecimal
realAmount
=
new
BigDecimal
(
refundAmount
.
toString
()).
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_UP
);
request
.
setBizContent
(
"{"
+
request
.
setBizContent
(
"{"
+
"\"out_trade_no\":\""
+
outTradeNo
+
"\","
+
"\"out_trade_no\":\""
+
outTradeNo
+
"\","
+
"\"trade_no\":\""
+
tradNo
+
"\","
+
"\"trade_no\":\""
+
tradNo
+
"\","
+
"\"refund_amount\":"
+
refundAmount
+
","
+
"\"refund_amount\":"
+
realAmount
+
","
+
"\"out_request_no\":\""
+
refundReason
+
"\""
+
"\"refund_reason\":\""
+
refundReason
+
"\","
+
"\"out_request_no\":\""
+
outRequestNo
+
"\""
+
" }"
);
" }"
);
try
{
try
{
log
.
info
(
"支付宝退款中:outTradeNo = {}, tradNo = {}, refundAmount = {}, refundReason = {}"
,
outTradeNo
,
tradNo
,
refundAmount
,
refundReason
);
AlipayTradeRefundResponse
response
=
alipayClient
.
execute
(
request
);
AlipayTradeRefundResponse
response
=
alipayClient
.
execute
(
request
);
if
(
response
.
isSuccess
())
{
if
(
response
.
isSuccess
())
{
return
true
;
return
true
;
}
else
{
}
else
{
log
.
info
(
response
.
getBody
());
return
false
;
return
false
;
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -452,41 +458,8 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -452,41 +458,8 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
return
false
;
return
false
;
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
SystemConfig
.
ALIPAY_PAY_BASE_URL
+
"/gateway.do"
,
OrderPayBiz
orderPayBiz
=
new
OrderPayBiz
();
SystemConfig
.
ALIPAY_APPID
,
SystemConfig
.
ALIPAY_PRIVATE_KEY
,
AlipayConstants
.
FORMAT_JSON
,
orderPayBiz
.
alipayOrderRefund
(
"20190806134440000001"
,
"2019080622001421530542309594"
,
3
,
"xxxx"
,
""
);
AlipayConstants
.
CHARSET_UTF8
,
SystemConfig
.
ALIPAY_PUBLIC_KEY
,
AlipayConstants
.
SIGN_TYPE_RSA2
);
AlipayFundAuthOrderFreezeRequest
arequest
=
new
AlipayFundAuthOrderFreezeRequest
();
arequest
.
setBizContent
(
"{"
+
"\"auth_code\":\"28763443825664394\","
+
"\"auth_code_type\":\"bar_code\","
+
"\"out_order_no\":\"8077735255938023\","
+
"\"out_request_no\":\"8077735255938032\","
+
"\"order_title\":\"预授权冻结\","
+
"\"amount\":0.01,"
+
"\"payee_logon_id\":\"2088531634846583\","
+
"\"payee_user_id\":\"xxfc810@163.com\","
+
"\"pay_timeout\":\"2d\","
+
"\"extra_param\":\"{\\\"secondaryMerchantId\\\":\\\"17320004886\\\"}\","
+
"\"product_code\":\"PRE_AUTH\","
+
"\"trans_currency\":\"USD\","
+
"\"settle_currency\":\"USD\","
+
"\"scene_code\":\"HOTEL\","
+
"\"terminal_params\":\"{\\\"terminalType\\\":\\\"IOT\\\",\\\"signature\\\":\\\"QIIAX8DqbFbNf2oe97FI1RSL\\\",\\\"apdidToken\\\":\\\"xPA3ptuArwYc3F6Va\\\",\\\"signedKeys\\\":\\\"auth,apdidToken\\\"}\","
+
"\"enable_pay_channels\":\"[{\\\"payChannelType\\\":\\\"PCREDIT_PAY\\\"},{\\\"payChannelType\\\":\\\"MONEY_FUND\\\"}]\","
+
"\"identity_params\":\"{\\\"identity_hash\\\":\\\"ABCDEFDxxxxxx\\\",\\\"alipay_user_id\\\":\\\"2088xxx\\\"}\""
+
" }"
);
try
{
AlipayFundAuthOrderFreezeResponse
aresponse
=
alipayClient
.
execute
(
arequest
);
if
(
aresponse
.
isSuccess
())
{
System
.
out
.
println
(
"调用成功"
);
}
else
{
System
.
out
.
println
(
"调用失败"
);
}
}
catch
(
Exception
e
)
{
}
}
}
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/OrderRefundBiz.java
View file @
febeffdb
...
@@ -90,12 +90,13 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper, OrderRefund> {
...
@@ -90,12 +90,13 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper, OrderRefund> {
String
out_trade_no
=
orderPay
.
getTradeNo
();
String
out_trade_no
=
orderPay
.
getTradeNo
();
boolean
flag
=
false
;
boolean
flag
=
false
;
if
(
orderPay
.
getPayWay
()
==
2
)
{
if
(
orderPay
.
getPayWay
()
==
2
)
{
flag
=
payBiz
.
alipayOrderRefund
(
out_trade_no
,
orderPay
.
getSerialNumber
(),
refundAmount
,
refundDesc
);
log
.
info
(
"======支付宝退款中==========="
);
flag
=
payBiz
.
alipayOrderRefund
(
out_trade_no
,
orderPay
.
getSerialNumber
(),
refundAmount
,
refundDesc
,
out_trade_no
+
System
.
currentTimeMillis
());
}
else
if
(
orderPay
.
getPayWay
()
==
1
){
}
else
if
(
orderPay
.
getPayWay
()
==
1
){
log
.
info
(
"======微信退款中==========="
);
flag
=
WxPayRefundUtils
.
refund
(
appid
,
mchId
,
partnerKey
,
out_trade_no
,
out_refund_no
,
payAmount
+
""
,
flag
=
WxPayRefundUtils
.
refund
(
appid
,
mchId
,
partnerKey
,
out_trade_no
,
out_refund_no
,
payAmount
+
""
,
refundAmount
+
""
,
refundDesc
,
APICLIENT_CERT
);
refundAmount
+
""
,
refundDesc
,
APICLIENT_CERT
);
}
}
if
(
flag
)
{
if
(
flag
)
{
OrderRefund
orderRefund
=
new
OrderRefund
();
OrderRefund
orderRefund
=
new
OrderRefund
();
BeanUtils
.
copyProperties
(
orderRefund
,
orderRefundVo
);
BeanUtils
.
copyProperties
(
orderRefund
,
orderRefundVo
);
...
@@ -111,6 +112,6 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper, OrderRefund> {
...
@@ -111,6 +112,6 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper, OrderRefund> {
insertSelective
(
orderRefund
);
insertSelective
(
orderRefund
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
out_refund_no
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
out_refund_no
);
}
}
return
JsonResultUtil
.
create
DefaultFail
(
);
return
JsonResultUtil
.
create
FailedResult
(
40004
,
"退款失败!"
);
}
}
}
}
\ 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