Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
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-auth
Commits
82ba4f4f
Commit
82ba4f4f
authored
Jun 15, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into 'master'
Developer See merge request
!13
parents
bcaf60f4
2de899d5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
10 deletions
+24
-10
MenuAuthDepartService.java
...main/java/com/gic/auth/service/MenuAuthDepartService.java
+2
-1
MenuAuthDepartServiceImpl.java
.../com/gic/auth/service/impl/MenuAuthDepartServiceImpl.java
+2
-2
MenuServiceImpl.java
.../main/java/com/gic/auth/service/impl/MenuServiceImpl.java
+5
-0
MenuApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
+10
-4
LoginController.java
...ain/java/com/gic/auth/web/controller/LoginController.java
+5
-3
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/service/MenuAuthDepartService.java
View file @
82ba4f4f
...
...
@@ -13,9 +13,10 @@ public interface MenuAuthDepartService {
* @Description:
* @author guojuxing
* @param list
* @param menuCode 菜单code
* @return void
*/
void
saveFetch
(
List
<
MenuAuthDepartDTO
>
list
);
void
saveFetch
(
List
<
MenuAuthDepartDTO
>
list
,
String
menuCode
);
/**
* 查询菜单的所有部门职位
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/MenuAuthDepartServiceImpl.java
View file @
82ba4f4f
...
...
@@ -16,9 +16,9 @@ public class MenuAuthDepartServiceImpl implements MenuAuthDepartService{
private
TabSysMenuAuthDepartMapper
tabSysMenuAuthDepartMapper
;
@Override
public
void
saveFetch
(
List
<
MenuAuthDepartDTO
>
list
)
{
public
void
saveFetch
(
List
<
MenuAuthDepartDTO
>
list
,
String
menuCode
)
{
tabSysMenuAuthDepartMapper
.
deleteByMenuCode
(
menuCode
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
tabSysMenuAuthDepartMapper
.
deleteByMenuCode
(
list
.
get
(
0
).
getMenuCode
());
tabSysMenuAuthDepartMapper
.
saveFetch
(
list
);
}
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/MenuServiceImpl.java
View file @
82ba4f4f
...
...
@@ -10,6 +10,7 @@ import com.gic.auth.qo.MenuOperationItemListQO;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -42,6 +43,10 @@ public class MenuServiceImpl implements MenuService {
record
.
setCreateTime
(
new
Date
());
record
.
setUpdateTime
(
new
Date
());
record
.
setStatus
(
1
);
if
(
StringUtils
.
isBlank
(
menuDTO
.
getMenuCode
()))
{
//权限项没有菜单code数据,但是这样会导致不好批量上传到生产,给一个默认的数据
record
.
setMenuCode
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
}
tabSysMenuMapper
.
insertSelective
(
record
);
return
record
.
getMenuId
();
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
View file @
82ba4f4f
...
...
@@ -421,7 +421,7 @@ public class MenuApiServiceImpl implements MenuApiService {
setMenuAuthType
(
menuDTO
);
menuService
.
updatePage
(
menuDTO
);
menuAuthDepartService
.
saveFetch
(
menuDTO
.
getMenuAuthDepartList
());
menuAuthDepartService
.
saveFetch
(
menuDTO
.
getMenuAuthDepartList
()
,
menuDTO
.
getMenuCode
()
);
//同时更新子集的父级code数据
menuService
.
updateParentCodeByParentId
(
menuDTO
.
getMenuId
(),
menuDTO
.
getMenuCode
());
...
...
@@ -675,6 +675,8 @@ public class MenuApiServiceImpl implements MenuApiService {
menu
.
setParentCode
(
tabSysMenu
.
getMenuCode
());
menu
.
setMenuVersion
(
tabSysMenu
.
getMenuVersion
());
menu
.
setMenuVersionName
(
tabSysMenu
.
getMenuVersionName
());
//避免冲突
menu
.
setMenuId
(
null
);
menuService
.
savePage
(
EntityUtil
.
changeEntityNew
(
MenuDTO
.
class
,
menu
));
}
else
{
//其他层级,查询他的父级ID,根据父级code
...
...
@@ -682,6 +684,8 @@ public class MenuApiServiceImpl implements MenuApiService {
menu
.
setParentId
(
otherLevel
.
getMenuId
());
menu
.
setMenuVersion
(
tabSysMenu
.
getMenuVersion
());
menu
.
setMenuVersionName
(
tabSysMenu
.
getMenuVersionName
());
//避免冲突
menu
.
setMenuId
(
null
);
menuService
.
savePage
(
EntityUtil
.
changeEntityNew
(
MenuDTO
.
class
,
menu
));
}
}
...
...
@@ -736,7 +740,7 @@ public class MenuApiServiceImpl implements MenuApiService {
setNormalFieldValue
(
menuDTO
);
setMenuAuthType
(
menuDTO
);
menuService
.
savePage
(
menuDTO
);
menuAuthDepartService
.
saveFetch
(
menuDTO
.
getMenuAuthDepartList
());
menuAuthDepartService
.
saveFetch
(
menuDTO
.
getMenuAuthDepartList
()
,
menuDTO
.
getMenuCode
()
);
return
ServiceResponse
.
success
();
}
...
...
@@ -789,7 +793,7 @@ public class MenuApiServiceImpl implements MenuApiService {
setMenuAuthType
(
menuDTO
);
Integer
menuId
=
menuService
.
savePage
(
menuDTO
);
menuAuthDepartService
.
saveFetch
(
menuDTO
.
getMenuAuthDepartList
());
menuAuthDepartService
.
saveFetch
(
menuDTO
.
getMenuAuthDepartList
()
,
menuDTO
.
getMenuCode
()
);
return
ServiceResponse
.
success
(
menuId
);
}
...
...
@@ -839,7 +843,7 @@ public class MenuApiServiceImpl implements MenuApiService {
setMenuVersion
(
menuDTO
);
setMenuAuthType
(
menuDTO
);
menuService
.
updatePage
(
menuDTO
);
menuAuthDepartService
.
saveFetch
(
menuDTO
.
getMenuAuthDepartList
());
menuAuthDepartService
.
saveFetch
(
menuDTO
.
getMenuAuthDepartList
()
,
menuDTO
.
getMenuCode
()
);
//同时更新子集的父级code数据
menuService
.
updateParentCodeByParentId
(
menuDTO
.
getMenuId
(),
menuDTO
.
getMenuCode
());
...
...
@@ -1244,6 +1248,8 @@ public class MenuApiServiceImpl implements MenuApiService {
});
}
}
}
else
{
departPosition
.
add
(
departmentCode
+
"-"
+
gicUserDTO
.
getPositionCode
());
}
}
//过滤运营人员的部门职位权限
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/LoginController.java
View file @
82ba4f4f
...
...
@@ -31,8 +31,8 @@ import com.gic.member.config.api.service.MemberCardApiService;
import
com.gic.member.config.api.service.ServiceConfigApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.log4j.LogManager
;
import
org.apache.log4j.Logger
;
import
org.apache.log
ging.log
4j.LogManager
;
import
org.apache.log
ging.log
4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -47,7 +47,7 @@ import java.util.Map;
@RestController
public
class
LoginController
{
private
final
Logger
logger
=
LogManager
.
getLogger
(
LoginController
.
class
);
private
final
static
Logger
logger
=
LogManager
.
getLogger
(
LoginController
.
class
);
@Autowired
private
EnterpriseApiService
enterpriseApiService
;
...
...
@@ -113,6 +113,7 @@ public class LoginController {
if
(
StringUtils
.
isBlank
(
nationCode
))
{
nationCode
=
Constants
.
NATION_CODE
;
}
long
startTime
=
System
.
currentTimeMillis
();
Md5Util
md5
=
new
Md5Util
();
// password 自身作为盐值
if
(
password
.
length
()
!=
32
)
{
...
...
@@ -177,6 +178,7 @@ public class LoginController {
}
//塞缓存
UserDetailUtils
.
setUserDetail
(
userDetail
);
logger
.
info
(
"登录所花时间:{}"
,
System
.
currentTimeMillis
()
-
startTime
);
return
RestResponse
.
success
(
userDetail
);
}
}
...
...
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