Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
scrm
/
rop-merchant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f72ffc24
authored
Aug 03, 2021
by
zhouhb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]权限修改
1 parent
61055a20
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
20 deletions
src/main/java/cn/com/glsx/merchants/config/SysLogAspect.java
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
src/main/java/cn/com/glsx/merchants/response/AccountTypeTreeRopResponse.java
src/main/java/cn/com/glsx/merchants/response/CarbrandResponse.java
src/main/java/cn/com/glsx/merchants/service/MerchantCommonService.java
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
src/main/java/cn/com/glsx/merchants/service/MerchantUserService.java
src/test/java/cn/com/glsx/merchants/controller/StaffControllerTest.java
src/main/java/cn/com/glsx/merchants/config/SysLogAspect.java
View file @
f72ffc2
...
...
@@ -7,8 +7,7 @@ import cn.com.glsx.merchants.request.user.MerchantUser;
import
cn.com.glsx.merchants.service.MerchantLogService
;
import
cn.com.glsx.merchants.service.MerchantUserService
;
import
com.glsx.plat.common.annotation.SysLog
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.*
;
import
com.rop.AbstractRopRequest
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.time.DurationFormatUtils
;
...
...
@@ -33,10 +32,6 @@ import java.lang.reflect.Method;
@Component
public
class
SysLogAspect
{
final
static
GsonBuilder
builder
=
new
GsonBuilder
();
final
static
Gson
gson
=
builder
.
create
();
@Autowired
private
MerchantLogService
merchantLogService
;
...
...
@@ -119,7 +114,6 @@ public class SysLogAspect {
Object
[]
args
=
joinPoint
.
getArgs
();
AbstractRopRequest
accessToken
=
(
AbstractRopRequest
)
args
[
0
];
String
ip
=
accessToken
.
getRopRequestContext
().
getIp
();
System
.
out
.
println
(
args
);
// 插入日志
LogRequest
logRequest
=
new
LogRequest
();
logRequest
.
setModule
(
sysLogMark
.
module
());
...
...
@@ -129,9 +123,10 @@ public class SysLogAspect {
logRequest
.
setOperator
(
user
.
getUsername
());
logRequest
.
setIp
(
ip
);
logRequest
.
setResult
(
"成功"
);
logRequest
.
setProcessed
(
args
[
0
].
toString
());
MerchantLogResponse
merchantLogResponse
=
merchantLogService
.
saveMerchantLog
(
logRequest
);
if
(
merchantLogResponse
!=
null
)
{
MDC
.
put
(
Contants
.
MDC_LOG_DB_ID
,
merchantLogResponse
.
getId
()
+
""
);
if
(
merchantLogResponse
!=
null
)
{
MDC
.
put
(
Contants
.
MDC_LOG_DB_ID
,
merchantLogResponse
.
getId
()
+
""
);
}
}
...
...
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
View file @
f72ffc2
...
...
@@ -165,6 +165,24 @@ public class MerchantController {
}
/**
* 查询商户的菜单权限树
*
* @param merchantDetailRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"查询商户的菜单权限树"
)
public
RopResponse
<
List
<
AccountTypeTreeRopResponse
>>
findMenuFunTreeByMerId
(
MerchantDetailRequest
merchantDetailRequest
)
{
try
{
List
<
AccountTypeTreeRopResponse
>
merchantResponse
=
merchantService
.
findMenuFunTreeByMerId
(
merchantDetailRequest
);
return
RopResponse
.
success
(
merchantResponse
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantController__invoke__findMenuFunTreeByMerId__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 更新商户的有效期
*
* @param merchantUpdateValRequest 入参
...
...
src/main/java/cn/com/glsx/merchants/response/AccountTypeTreeRopResponse.java
View file @
f72ffc2
package
cn
.
com
.
glsx
.
merchants
.
response
;
import
cn.com.glsx.merchants.model.response.ProductTreeResponse
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -20,4 +19,9 @@ public class AccountTypeTreeRopResponse {
@ApiModelProperty
(
name
=
"products"
,
notes
=
"产品"
,
dataType
=
"List"
,
required
=
true
,
example
=
"1"
,
value
=
"产品"
)
private
List
<
ProductTreeRopResponse
>
products
;
@ApiModelProperty
(
name
=
"accountTypeName"
,
notes
=
"账户类型"
,
dataType
=
"Integer"
,
required
=
true
,
example
=
"1"
,
value
=
"账户类型id"
)
private
String
accountTypeName
;
private
List
<
MerchantProTreeRopResponse
>
merchantProTreeResponses
;
}
src/main/java/cn/com/glsx/merchants/response/CarbrandResponse.java
View file @
f72ffc2
...
...
@@ -16,5 +16,5 @@ public class CarbrandResponse {
private
Integer
id
;
private
String
label
;
private
List
<
CarbrandResponse
>
children
s
;
private
List
<
CarbrandResponse
>
children
;
}
src/main/java/cn/com/glsx/merchants/service/MerchantCommonService.java
View file @
f72ffc2
...
...
@@ -34,7 +34,7 @@ public class MerchantCommonService {
carbrandResponse1
.
setLabel
(
in
.
getBrand
());
return
carbrandResponse1
;
}).
collect
(
Collectors
.
toList
());
carbrandResponse
.
setChildren
s
(
childrens
);
carbrandResponse
.
setChildren
(
childrens
);
return
carbrandResponse
;
}).
collect
(
Collectors
.
toList
());
return
collect
;
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
View file @
f72ffc2
...
...
@@ -147,6 +147,20 @@ public class MerchantService {
}
/**
* 查询商户的菜单权限树
*
* @param merchantDetailRequest 入参
* @return
*/
public
List
<
AccountTypeTreeRopResponse
>
findMenuFunTreeByMerId
(
MerchantDetailRequest
merchantDetailRequest
)
{
RpcResponse
<
List
<
AccountTypeTreeResponse
>>
merchantDetailRemote
=
merchantRemote
.
findMenuFunTreeByMerId
(
merchantDetailRequest
.
getId
());
if
(
merchantDetailRemote
.
isSuccess
())
{
return
ConvertResponse
.
convertList
(
merchantDetailRemote
.
getResult
(),
AccountTypeTreeRopResponse
.
class
);
}
throw
new
RpcServiceException
(
merchantDetailRemote
.
getException
().
getErrId
(),
merchantDetailRemote
.
getMessage
());
}
/**
* 更新商户的有效期
*
* @param merchantUpdateValRequest 入参
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantUserService.java
View file @
f72ffc2
...
...
@@ -5,9 +5,11 @@ import cn.com.glsx.merchants.request.user.MerchantUser;
import
com.rop.AbstractRopRequest
;
import
com.rop.session.SimpleSession
;
import
lombok.extern.slf4j.Slf4j
;
import
org.oreframework.boot.autoconfigure.rop.session.RopSessionManager
;
import
org.oreframework.boot.autoconfigure.rop.util.RopThreadLocal
;
import
org.oreframework.boot.security.cas.User
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
...
...
src/test/java/cn/com/glsx/merchants/controller/StaffControllerTest.java
View file @
f72ffc2
...
...
@@ -18,16 +18,16 @@ public class StaffControllerTest extends BaseControllerTest{
public
void
testGetExample
()
throws
Exception
{
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<
String
,
String
>(
4
);
params
.
add
(
"v"
,
"1.0.0"
);
params
.
add
(
"method"
,
"cn.com.glsx.merchants.
merchant
.saveStaff"
);
params
.
add
(
"method"
,
"cn.com.glsx.merchants.
staff
.saveStaff"
);
params
.
add
(
"name"
,
"alvin"
);
params
.
add
(
"staffName"
,
"
反抗军地方
"
);
params
.
add
(
"staffJob"
,
"
反抗军地方
"
);
params
.
add
(
"password"
,
"
反抗军地方
"
);
params
.
add
(
"visibleInferiorMer"
,
"
反抗军地方
"
);
params
.
add
(
"staffPhone"
,
"1
3476565332E
"
);
params
.
add
(
"staffName"
,
"
贤心
"
);
params
.
add
(
"staffJob"
,
"
jkl
"
);
params
.
add
(
"password"
,
"
3
"
);
params
.
add
(
"visibleInferiorMer"
,
"
1
"
);
params
.
add
(
"staffPhone"
,
"1
8873336682
"
);
params
.
add
(
"merchantId"
,
"31"
);
params
.
add
(
"staffEmail"
,
"
31545445@
"
);
params
.
add
(
"roleIds[0]"
,
"
1
"
);
params
.
add
(
"staffEmail"
,
"
952643348@qq.com
"
);
params
.
add
(
"roleIds[0]"
,
"
342
"
);
params
.
add
(
"merchantFileRequest.fileUrl"
,
"http://jhjhjhhj"
);
params
.
add
(
"merchantFileRequest.fileName"
,
"dfdfddssd"
);
System
.
out
.
println
(
getByHeader
(
params
));
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment