Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
b8f79fcf
Commit
b8f79fcf
authored
Apr 01, 2019
by
季圣华
Browse files
解决权限配置的bug
parent
5a1974a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/erp/service/userBusiness/UserBusinessService.java
View file @
b8f79fcf
...
...
@@ -65,19 +65,22 @@ public class UserBusinessService {
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
insertUserBusiness
(
String
beanJson
,
HttpServletRequest
request
)
{
UserBusiness
userBusiness
=
JSONObject
.
parseObject
(
beanJson
,
UserBusiness
.
class
);
return
userBusinessMapper
.
insertSelective
(
userBusiness
);
int
inserts
=
userBusinessMapper
.
insertSelective
(
userBusiness
);
// 更新应用权限
if
(
inserts
>
0
)
{
inserts
=
insertOrUpdateAppValue
(
BusinessConstants
.
TYPE_NAME_ROLE_APP
,
userBusiness
.
getKeyid
(),
userBusiness
.
getValue
());
}
return
inserts
;
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
updateUserBusiness
(
String
beanJson
,
Long
id
)
{
UserBusiness
userBusiness
=
JSONObject
.
parseObject
(
beanJson
,
UserBusiness
.
class
);
userBusiness
.
setId
(
id
);
int
updates
=
userBusinessMapper
.
updateByPrimaryKeySelective
(
userBusiness
);
// 更新应用权限
if
(
updates
>
0
)
{
updates
=
u
pdateAppValue
(
BusinessConstants
.
TYPE_NAME_ROLE_APP
,
userBusiness
.
getKeyid
(),
userBusiness
.
getValue
());
updates
=
insertOrU
pdateAppValue
(
BusinessConstants
.
TYPE_NAME_ROLE_APP
,
userBusiness
.
getKeyid
(),
userBusiness
.
getValue
());
}
return
updates
;
}
...
...
@@ -176,7 +179,7 @@ public class UserBusinessService {
* @param functionIds
* @return
*/
public
int
u
pdateAppValue
(
String
type
,
String
keyId
,
String
functionIds
)
{
public
int
insertOrU
pdateAppValue
(
String
type
,
String
keyId
,
String
functionIds
)
{
int
updates
=
0
;
...
...
@@ -209,8 +212,13 @@ public class UserBusinessService {
if
(
userBusinessList
.
size
()
>
0
)
{
UserBusiness
userBusiness
=
userBusinessList
.
get
(
0
);
userBusiness
.
setValue
(
appIdSb
.
toString
());
updates
=
userBusinessMapper
.
updateByPrimaryKeySelective
(
userBusiness
);
}
else
{
UserBusiness
userBusiness
=
new
UserBusiness
();
userBusiness
.
setType
(
type
);
userBusiness
.
setKeyid
(
keyId
);
userBusiness
.
setValue
(
appIdSb
.
toString
());
updates
=
userBusinessMapper
.
insertSelective
(
userBusiness
);
}
}
}
...
...
Write
Preview
Supports
Markdown
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