Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
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
base_platform_enterprise
gic-platform-enterprise
Commits
6a5cf8ce
Commit
6a5cf8ce
authored
Jun 03, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gic运营平台部门职位字段添加
parent
c5f8b23d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
13 deletions
+110
-13
WmStoreSyncController.java
...c/enterprise/web/controller/wm/WmStoreSyncController.java
+17
-0
MenuController.java
...java/com/gic/operation/web/controller/MenuController.java
+61
-13
MenuOperationItemListVO.java
...ava/com/gic/operation/web/vo/MenuOperationItemListVO.java
+32
-0
No files found.
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/controller/wm/WmStoreSyncController.java
View file @
6a5cf8ce
...
...
@@ -185,10 +185,18 @@ public class WmStoreSyncController {
"非"
+
MallModeEnum
.
SMART_RETAIL
.
getMsg
()
+
"不能同步门店"
);
}
if
(
headStoreId
==
null
)
{
return
RestResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"总店参数为空"
);
}
if
(
isBranch
==
null
)
{
isBranch
=
false
;
}
if
(
getHasSyncStore
(
wmMallStoreId
).
contains
(
headStoreId
.
toString
()))
{
return
RestResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"总店重复同步"
);
}
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
//查询总店
ServiceResponse
<
StoreDTO
>
storeResponse
=
storeApiService
.
getStoreById
(
enterpriseId
,
headStoreId
);
...
...
@@ -1007,4 +1015,13 @@ public class WmStoreSyncController {
}
return
null
;
}
private
Set
<
String
>
getHasSyncStore
(
Integer
wmMallStoreId
)
{
ServiceResponse
<
List
<
WmStoreSyncLogDTO
>>
hasSyncStoreListResult
=
wmStoreSyncLogApiService
.
getStoreList
(
null
,
wmMallStoreId
);
if
(
hasSyncStoreListResult
.
isSuccess
())
{
return
new
HashSet
<>(
hasSyncStoreListResult
.
getResult
()
.
stream
().
map
(
e
->
e
.
getStoreId
().
toString
()).
collect
(
Collectors
.
toList
()));
}
return
new
HashSet
<>(
1
);
}
}
gic-platform-operation-web/src/main/java/com/gic/operation/web/controller/MenuController.java
View file @
6a5cf8ce
package
com
.
gic
.
operation
.
web
.
controller
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.gic.auth.dto.MenuAuthDepartDTO
;
import
com.gic.auth.qo.MenuOperationItemListQO
;
import
com.gic.open.api.dto.ServePropDTO
;
import
com.gic.open.api.service.ServeApiService
;
import
com.gic.operation.web.vo.MenuOperationItemListVO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -16,19 +12,25 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.constant.*
;
import
com.gic.auth.dto.MenuAuthDepartDTO
;
import
com.gic.auth.dto.MenuDTO
;
import
com.gic.auth.dto.MenuItemDTO
;
import
com.gic.auth.qo.AuthItemSaveQO
;
import
com.gic.auth.qo.MenuListQO
;
import
com.gic.auth.qo.MenuOperationItemListQO
;
import
com.gic.auth.service.MenuApiService
;
import
com.gic.auth.service.MenuItemApiService
;
import
com.gic.commons.util.CollectionUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.response.EnterpriseRestResponse
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.open.api.service.ServeApiService
;
import
com.gic.operation.web.vo.MenuDetailVO
;
import
com.gic.operation.web.vo.MenuOperationItemListVO
;
import
com.gic.operation.web.vo.MenuOperationItemVO
;
@RestController
...
...
@@ -143,13 +145,25 @@ public class MenuController {
long
serviceAfter
=
System
.
currentTimeMillis
();
LOGGER
.
info
(
"menuApiService.listMenuTree权限菜单服务调用时间:{}"
,
serviceAfter
-
serviceBefore
);
if
(
result
.
isSuccess
())
{
if
(
StringUtils
.
isBlank
(
params
.
getSearch
()))
{
List
<
Map
<
String
,
Object
>>
resultInfo
=
changeListToTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
result
.
getResult
());
LOGGER
.
info
(
"changeListToTree权限菜单数据递归时间:{}"
,
System
.
currentTimeMillis
()
-
serviceAfter
);
return
RestResponse
.
success
(
resultInfo
);
}
else
{
return
RestResponse
.
success
(
addAuthItemSignAndChildrenSignToList
(
result
.
getResult
()));
List
<
MenuDTO
>
menuList
=
result
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
menuList
))
{
//设置部门数据,列表需要展示
Map
<
String
,
List
<
MenuAuthDepartDTO
>>
authDepartMap
=
getAuthDepartMap
(
menuList
.
stream
()
.
map
(
e
->
e
.
getMenuCode
())
.
collect
(
Collectors
.
toList
()));
menuList
=
menuList
.
stream
()
.
map
(
e
->
e
.
setMenuAuthDepartList
(
authDepartMap
.
get
(
e
.
getMenuCode
())))
.
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isBlank
(
params
.
getSearch
()))
{
List
<
Map
<
String
,
Object
>>
resultInfo
=
changeListToTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
menuList
);
LOGGER
.
info
(
"changeListToTree权限菜单数据递归时间:{}"
,
System
.
currentTimeMillis
()
-
serviceAfter
);
return
RestResponse
.
success
(
resultInfo
);
}
else
{
return
RestResponse
.
success
(
addAuthItemSignAndChildrenSignToList
(
menuList
));
}
}
}
return
EnterpriseRestResponse
.
failure
(
result
);
...
...
@@ -292,7 +306,24 @@ public class MenuController {
@RequestMapping
(
"/list-auth-item-all"
)
public
RestResponse
updateAuthItemAll
(
MenuOperationItemListQO
params
)
{
return
ResultControllerUtils
.
commonPageResult
(
menuApiService
.
pageMenuOperationItem
(
params
),
ServiceResponse
<
Page
<
MenuDTO
>>
result
=
menuApiService
.
pageMenuOperationItem
(
params
);
if
(
result
.
isSuccess
())
{
Page
<
MenuDTO
>
page
=
result
.
getResult
();
if
(
page
!=
null
)
{
List
<
MenuDTO
>
menuList
=
page
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
menuList
))
{
Map
<
String
,
List
<
MenuAuthDepartDTO
>>
authDepartMap
=
getAuthDepartMap
(
menuList
.
stream
()
.
map
(
e
->
e
.
getMenuCode
())
.
collect
(
Collectors
.
toList
()));
page
.
setResult
(
menuList
.
stream
()
.
map
(
e
->
e
.
setMenuAuthDepartList
(
authDepartMap
.
get
(
e
.
getMenuCode
())))
.
collect
(
Collectors
.
toList
()));
}
}
}
return
ResultControllerUtils
.
commonPageResult
(
result
,
MenuOperationItemListVO
.
class
);
}
...
...
@@ -348,6 +379,9 @@ public class MenuController {
data
.
put
(
"parentCode"
,
menuDTO
.
getParentCode
());
data
.
put
(
"parentId"
,
menuDTO
.
getParentId
());
data
.
put
(
"menuVersionName"
,
menuDTO
.
getMenuVersionName
());
data
.
put
(
"authType"
,
menuDTO
.
getAuthType
());
data
.
put
(
"authTypeJson"
,
menuDTO
.
getMenuAuthDepartList
());
if
(
menuDTO
.
getLevel
().
intValue
()
==
MenuLevelConstants
.
FIRST_LEVEL
)
{
data
.
put
(
"seq"
,
j
+
1
);
}
...
...
@@ -421,6 +455,8 @@ public class MenuController {
data
.
put
(
"children"
,
childrenMap
.
contains
(
menuDTO
.
getMenuId
().
toString
()));
//是否有权限项
data
.
put
(
"hasAuthItem"
,
authItemMap
.
contains
(
menuDTO
.
getMenuId
().
toString
()));
data
.
put
(
"authType"
,
menuDTO
.
getAuthType
());
data
.
put
(
"authTypeJson"
,
menuDTO
.
getMenuAuthDepartList
());
result
.
add
(
data
);
}
}
...
...
@@ -474,4 +510,16 @@ public class MenuController {
menuDTO
.
setMenuAuthDepartList
(
JSON
.
parseArray
(
authDepartJson
,
MenuAuthDepartDTO
.
class
));
}
}
private
Map
<
String
,
List
<
MenuAuthDepartDTO
>>
getAuthDepartMap
(
List
<
String
>
menuCodeList
)
{
//设置部门数据,列表需要展示
ServiceResponse
<
List
<
MenuAuthDepartDTO
>>
authDepartResult
=
menuApiService
.
listAllAuthDepart
(
menuCodeList
);
if
(
authDepartResult
.
isSuccess
())
{
List
<
MenuAuthDepartDTO
>
authDepartList
=
authDepartResult
.
getResult
();
Map
<
String
,
List
<
MenuAuthDepartDTO
>>
authDepartMap
=
CollectionUtil
.
group
(
authDepartList
,
"menuCode"
);
return
authDepartMap
;
}
return
new
HashMap
<>(
2
);
}
}
gic-platform-operation-web/src/main/java/com/gic/operation/web/vo/MenuOperationItemListVO.java
View file @
6a5cf8ce
package
com
.
gic
.
operation
.
web
.
vo
;
import
com.gic.auth.dto.MenuAuthDepartDTO
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 操作项列表
* @ClassName: MenuOperationItemListVO
...
...
@@ -36,6 +40,16 @@ public class MenuOperationItemListVO implements Serializable{
*/
private
Integer
adminOnlySign
;
/**
* 1:管理员权限集 2:商户级超管及达摩侧人员 3:仅达摩侧人员
*/
private
Integer
authType
;
/**
* 部门职位
*/
private
List
<
MenuAuthDepartDTO
>
menuAuthDepartList
;
public
Integer
getMenuId
()
{
return
menuId
;
}
...
...
@@ -91,4 +105,22 @@ public class MenuOperationItemListVO implements Serializable{
public
void
setAdminOnlySign
(
Integer
adminOnlySign
)
{
this
.
adminOnlySign
=
adminOnlySign
;
}
public
Integer
getAuthType
()
{
return
authType
;
}
public
MenuOperationItemListVO
setAuthType
(
Integer
authType
)
{
this
.
authType
=
authType
;
return
this
;
}
public
List
<
MenuAuthDepartDTO
>
getMenuAuthDepartList
()
{
return
menuAuthDepartList
;
}
public
MenuOperationItemListVO
setMenuAuthDepartList
(
List
<
MenuAuthDepartDTO
>
menuAuthDepartList
)
{
this
.
menuAuthDepartList
=
menuAuthDepartList
;
return
this
;
}
}
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