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 3447cb20
authored
Aug 13, 2021
by
wangnb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
账户体系账户类型菜单是否全选功能添加--think.wang
1 parent
6faa436c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
10 deletions
src/main/java/cn/com/glsx/merchants/contants/Contants.java
src/main/java/cn/com/glsx/merchants/request/ProductRequest.java
src/main/java/cn/com/glsx/merchants/response/AccountProductRelationResponse.java
src/main/java/cn/com/glsx/merchants/response/AccountTypeResponse.java
src/main/java/cn/com/glsx/merchants/service/MerchantAccountTypeService.java
src/main/java/cn/com/glsx/merchants/contants/Contants.java
View file @
3447cb2
...
@@ -27,4 +27,13 @@ public class Contants {
...
@@ -27,4 +27,13 @@ public class Contants {
*/
*/
public
final
static
String
MDC_LOG_DB_ID
=
"LOG_DB_ID"
;
public
final
static
String
MDC_LOG_DB_ID
=
"LOG_DB_ID"
;
/**
* 前端菜单下全部选择
*/
public
final
static
byte
IS_ALL_YES
=
1
;
/**
* 前端菜单下部分选择
*/
public
final
static
byte
IS_ALL_NO
=
0
;
}
}
src/main/java/cn/com/glsx/merchants/request/ProductRequest.java
View file @
3447cb2
...
@@ -28,6 +28,12 @@ public class ProductRequest implements Serializable {
...
@@ -28,6 +28,12 @@ public class ProductRequest implements Serializable {
private
List
<
Integer
>
menuIdList
;
private
List
<
Integer
>
menuIdList
;
/**
/**
* 部分选择菜单id列表
*/
@ApiModelProperty
(
name
=
"partSelectList"
,
notes
=
"部分选择菜单id列表"
,
dataType
=
"List"
)
private
List
<
Integer
>
partSelectList
;
/**
* 选中的功能id列表
* 选中的功能id列表
*/
*/
@ApiModelProperty
(
name
=
"functionIdList"
,
notes
=
"选中的功能id列表"
,
dataType
=
"List"
)
@ApiModelProperty
(
name
=
"functionIdList"
,
notes
=
"选中的功能id列表"
,
dataType
=
"List"
)
...
...
src/main/java/cn/com/glsx/merchants/response/AccountProductRelationResponse.java
0 → 100644
View file @
3447cb2
package
cn
.
com
.
glsx
.
merchants
.
response
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author zhouhaibao
* @version 1.0
* @description: 产品菜单关系响应数据
* @date 2021/7/16 16:50
*/
@Data
public
class
AccountProductRelationResponse
{
/**
* 产品id
*/
@ApiModelProperty
(
name
=
"productId"
,
notes
=
"产品id"
,
dataType
=
"Integer"
)
private
Integer
productId
;
/**
* 产品名
*/
@ApiModelProperty
(
name
=
"productName"
,
notes
=
"产品名"
,
dataType
=
"String"
)
private
String
productName
;
/**
* 回选全部菜单id列表
*/
@ApiModelProperty
(
name
=
"menuIdList"
,
notes
=
"回选全部菜单id列表"
,
dataType
=
"List"
)
private
List
<
Integer
>
menuIdList
;
/**
* 回选部分菜单id列表
*/
@ApiModelProperty
(
name
=
"partSelectList"
,
notes
=
"回选部分菜单id列表"
,
dataType
=
"List"
)
private
List
<
Integer
>
partSelectList
;
/**
* 回选功能id列表
*/
@ApiModelProperty
(
name
=
"functionIdList"
,
notes
=
"回选功能id列表"
,
dataType
=
"List"
)
private
List
<
Integer
>
functionIdList
;
}
src/main/java/cn/com/glsx/merchants/response/AccountTypeResponse.java
View file @
3447cb2
...
@@ -86,7 +86,7 @@ public class AccountTypeResponse implements Serializable {
...
@@ -86,7 +86,7 @@ public class AccountTypeResponse implements Serializable {
* 账户类型功能列表
* 账户类型功能列表
*/
*/
@ApiModelProperty
(
notes
=
"账户类型功能列表"
,
name
=
"responseList"
,
dataType
=
"List"
)
@ApiModelProperty
(
notes
=
"账户类型功能列表"
,
name
=
"responseList"
,
dataType
=
"List"
)
private
List
<
ProductRelationResponse
>
responseList
;
private
List
<
Account
ProductRelationResponse
>
responseList
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantAccountTypeService.java
View file @
3447cb2
...
@@ -3,6 +3,7 @@ package cn.com.glsx.merchants.service;
...
@@ -3,6 +3,7 @@ package cn.com.glsx.merchants.service;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.contants.Contants
;
import
cn.com.glsx.merchants.convert.ConvertRequest
;
import
cn.com.glsx.merchants.convert.ConvertRequest
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.enums.CommonStatusEnum
;
import
cn.com.glsx.merchants.enums.CommonStatusEnum
;
...
@@ -15,8 +16,8 @@ import cn.com.glsx.merchants.remote.MerchantAccountTypeRemote;
...
@@ -15,8 +16,8 @@ import cn.com.glsx.merchants.remote.MerchantAccountTypeRemote;
import
cn.com.glsx.merchants.request.FunctionRequest
;
import
cn.com.glsx.merchants.request.FunctionRequest
;
import
cn.com.glsx.merchants.request.ProductRequest
;
import
cn.com.glsx.merchants.request.ProductRequest
;
import
cn.com.glsx.merchants.request.accounttype.*
;
import
cn.com.glsx.merchants.request.accounttype.*
;
import
cn.com.glsx.merchants.response.AccountProductRelationResponse
;
import
cn.com.glsx.merchants.response.AccountTypeResponse
;
import
cn.com.glsx.merchants.response.AccountTypeResponse
;
import
cn.com.glsx.merchants.response.ProductRelationResponse
;
import
cn.com.glsx.merchants.util.Pagination
;
import
cn.com.glsx.merchants.util.Pagination
;
import
com.github.dozermapper.core.Mapper
;
import
com.github.dozermapper.core.Mapper
;
import
com.glsx.plat.common.annotation.SysLog
;
import
com.glsx.plat.common.annotation.SysLog
;
...
@@ -29,7 +30,6 @@ import org.springframework.stereotype.Service;
...
@@ -29,7 +30,6 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -194,29 +194,37 @@ public class MerchantAccountTypeService {
...
@@ -194,29 +194,37 @@ public class MerchantAccountTypeService {
//根据产品id分组
//根据产品id分组
Map
<
Integer
,
List
<
AccountFunctionRelationResponse
>>
map
=
Map
<
Integer
,
List
<
AccountFunctionRelationResponse
>>
map
=
functionList
.
stream
().
collect
(
Collectors
.
groupingBy
(
AccountFunctionRelationResponse:
:
getProductId
));
functionList
.
stream
().
collect
(
Collectors
.
groupingBy
(
AccountFunctionRelationResponse:
:
getProductId
));
List
<
ProductRelationResponse
>
responseList
=
new
ArrayList
<>();
List
<
Account
ProductRelationResponse
>
responseList
=
new
ArrayList
<>();
for
(
Integer
key
:
map
.
keySet
()){
for
(
Integer
key
:
map
.
keySet
()){
ProductRelationResponse
relationResponse
=
new
ProductRelationResponse
();
AccountProductRelationResponse
relationResponse
=
new
Account
ProductRelationResponse
();
relationResponse
.
setProductId
(
key
);
relationResponse
.
setProductId
(
key
);
List
<
AccountFunctionRelationResponse
>
list
=
map
.
get
(
key
);
List
<
AccountFunctionRelationResponse
>
list
=
map
.
get
(
key
);
relationResponse
.
setProductName
(
list
.
get
(
0
).
getProductName
());
relationResponse
.
setProductName
(
list
.
get
(
0
).
getProductName
());
List
<
Integer
>
idList
=
new
ArrayList
<>();
List
<
Integer
>
menuIdList
=
new
ArrayList
<>();
List
<
Integer
>
partSelectList
=
new
ArrayList
<>();
List
<
Integer
>
functionIdList
=
new
ArrayList
<>();
list
.
stream
().
forEach
(
index
->{
list
.
stream
().
forEach
(
index
->{
if
(
index
.
getFunctionId
()
!=
null
&&
index
.
getFunctionId
()
>
0
){
if
(
index
.
getFunctionId
()
!=
null
&&
index
.
getFunctionId
()
>
0
){
i
dList
.
add
(
index
.
getFunctionId
());
functionI
dList
.
add
(
index
.
getFunctionId
());
String
value
=
index
.
getFunctionValue
();
String
value
=
index
.
getFunctionValue
();
if
(
StringUtils
.
isNotEmpty
(
value
)){
if
(
StringUtils
.
isNotEmpty
(
value
)){
String
[]
arr
=
value
.
split
(
";"
);
String
[]
arr
=
value
.
split
(
";"
);
int
size
=
arr
.
length
;
int
size
=
arr
.
length
;
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
i
dList
.
add
(
Integer
.
valueOf
(
arr
[
i
].
split
(
":"
)[
0
]));
functionI
dList
.
add
(
Integer
.
valueOf
(
arr
[
i
].
split
(
":"
)[
0
]));
}
}
}
}
}
else
{
}
else
{
idList
.
add
(
index
.
getMenuId
());
if
(
Contants
.
IS_ALL_YES
==
index
.
getIsAll
()){
menuIdList
.
add
(
index
.
getMenuId
());
}
else
if
(
Contants
.
IS_ALL_NO
==
index
.
getIsAll
()){
partSelectList
.
add
(
index
.
getMenuId
());
}
}
}
});
});
relationResponse
.
setIdList
(
idList
);
relationResponse
.
setFunctionIdList
(
functionIdList
);
relationResponse
.
setMenuIdList
(
menuIdList
);
relationResponse
.
setPartSelectList
(
partSelectList
);
responseList
.
add
(
relationResponse
);
responseList
.
add
(
relationResponse
);
}
}
response
.
setResponseList
(
responseList
);
response
.
setResponseList
(
responseList
);
...
@@ -235,12 +243,23 @@ public class MerchantAccountTypeService {
...
@@ -235,12 +243,23 @@ public class MerchantAccountTypeService {
List
<
AccountFunctionRelationRequest
>
functionList
=
new
ArrayList
<>();
List
<
AccountFunctionRelationRequest
>
functionList
=
new
ArrayList
<>();
requestList
.
stream
().
forEach
(
index
->{
requestList
.
stream
().
forEach
(
index
->{
List
<
Integer
>
menuIdList
=
index
.
getMenuIdList
();
List
<
Integer
>
menuIdList
=
index
.
getMenuIdList
();
List
<
Integer
>
partSelectList
=
index
.
getPartSelectList
();
List
<
FunctionRequest
>
functionIdList
=
index
.
getFunctionIdList
();
List
<
FunctionRequest
>
functionIdList
=
index
.
getFunctionIdList
();
if
(
CollectionUtils
.
isNotEmpty
(
menuIdList
)){
if
(
CollectionUtils
.
isNotEmpty
(
menuIdList
)){
menuIdList
.
stream
().
forEach
(
menuId
->{
menuIdList
.
stream
().
forEach
(
menuId
->{
AccountFunctionRelationRequest
relation
=
new
AccountFunctionRelationRequest
();
AccountFunctionRelationRequest
relation
=
new
AccountFunctionRelationRequest
();
relation
.
setProductId
(
index
.
getProductId
());
relation
.
setProductId
(
index
.
getProductId
());
relation
.
setMenuId
(
menuId
);
relation
.
setMenuId
(
menuId
);
relation
.
setIsAll
(
Contants
.
IS_ALL_YES
);
functionList
.
add
(
relation
);
});
}
if
(
CollectionUtils
.
isNotEmpty
(
partSelectList
)){
partSelectList
.
stream
().
forEach
(
menuId
->{
AccountFunctionRelationRequest
relation
=
new
AccountFunctionRelationRequest
();
relation
.
setProductId
(
index
.
getProductId
());
relation
.
setMenuId
(
menuId
);
relation
.
setIsAll
(
Contants
.
IS_ALL_NO
);
functionList
.
add
(
relation
);
functionList
.
add
(
relation
);
});
});
}
}
...
@@ -251,6 +270,7 @@ public class MerchantAccountTypeService {
...
@@ -251,6 +270,7 @@ public class MerchantAccountTypeService {
relation
.
setMenuId
(
function
.
getMenuId
());
relation
.
setMenuId
(
function
.
getMenuId
());
relation
.
setFunctionId
(
function
.
getId
());
relation
.
setFunctionId
(
function
.
getId
());
relation
.
setFunctionValue
(
function
.
getFunctionValue
());
relation
.
setFunctionValue
(
function
.
getFunctionValue
());
relation
.
setIsAll
(
Contants
.
IS_ALL_YES
);
functionList
.
add
(
relation
);
functionList
.
add
(
relation
);
});
});
}
}
...
...
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