Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
458cb84d
authored
Sep 19, 2023
by
李小龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fixbug:28986 平台端-人员管理-组织管理-编辑:改变组织类型时,需要同步更改空间的属性
parent
9114b029
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatOrgServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatUserServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatOrgServiceImpl.java
View file @
458cb84d
...
...
@@ -13,6 +13,7 @@ import com.makeit.entity.platform.auth.PlatOrg;
import
com.makeit.entity.platform.auth.PlatRole
;
import
com.makeit.entity.platform.auth.PlatRoleOrg
;
import
com.makeit.entity.platform.auth.PlatUserRole
;
import
com.makeit.entity.platform.space.PlatSpace
;
import
com.makeit.enums.CodeMessageEnum
;
import
com.makeit.enums.CommonEnum
;
import
com.makeit.enums.id.TreeConst
;
...
...
@@ -25,6 +26,7 @@ import com.makeit.service.platform.auth.PlatRoleOrgService;
import
com.makeit.service.platform.auth.PlatRoleService
;
import
com.makeit.service.platform.auth.PlatUserRoleService
;
import
com.makeit.service.platform.auth.PlatUserService
;
import
com.makeit.service.platform.space.PlatSpaceService
;
import
com.makeit.utils.data.convert.PageUtil
;
import
com.makeit.utils.data.convert.StreamUtil
;
import
com.makeit.utils.user.plat.PlatUserUtil
;
...
...
@@ -70,6 +72,8 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
@Autowired
private
PlatAlarmConfigService
platAlarmConfigService
;
@Autowired
private
PlatSpaceService
platSpaceService
;
@Override
public
List
<
PlatOrg
>
filter
(
List
<
PlatOrg
>
deptList
,
PlatOrgQueryDTO
dto
)
{
...
...
@@ -299,12 +303,22 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
@Override
public
void
edit
(
PlatOrg
dto
)
{
check
(
dto
);
PlatOrg
platOrg
=
this
.
getById
(
dto
.
getId
());
if
(
StringUtils
.
isBlank
(
dto
.
getParentId
())||
StringUtils
.
equals
(
dto
.
getParentId
(),
"1"
))
{
}
else
{
PlatOrg
parent
=
getById
(
dto
.
getParentId
());
dto
.
setPath
(
parent
.
getPath
()
+
","
+
parent
.
getId
());
}
if
(!
StringUtils
.
equals
(
dto
.
getType
(),
platOrg
.
getType
())){
LambdaUpdateWrapper
<
PlatSpace
>
platSpaceLambdaUpdateWrapper
=
Wrappers
.
lambdaUpdate
(
PlatSpace
.
class
)
.
set
(
PlatSpace:
:
getAttribute
,
dto
.
getType
())
.
eq
(
PlatSpace:
:
getOrgId
,
dto
.
getId
());
platSpaceService
.
update
(
platSpaceLambdaUpdateWrapper
);
}
updateById
(
dto
);
}
...
...
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatUserServiceImpl.java
View file @
458cb84d
...
...
@@ -387,11 +387,6 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR_AUTH_USER_PASSWORD
);
}
/**
* 校验机场
*/
//checkUserOrg(platUser);
PlatUserLoginVO
userLoginVO
=
BeanDtoVoUtils
.
convert
(
platUser
,
PlatUserLoginVO
.
class
);
String
token
=
IdGen
.
getUUID
();
...
...
@@ -404,14 +399,14 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
return
userLoginVO
;
}
@Override
public
void
checkTenantOrgStatus
(
PlatUser
platUser
)
{
PlatTenant
platTenant
=
platTenantService
.
getById
(
platUser
.
getTenantId
());
if
(
platTenant
==
null
||
StringUtils
.
equals
(
platTenant
.
getStatus
(),
CommonEnum
.
NO
.
getValue
())){
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR_TENANT_FORBIDDEN
);
}
PlatOrg
platOrg
=
platOrgService
.
getById
(
platUser
.
getOrgId
());
if
(
platOrg
==
null
||
StringUtils
.
equals
(
platOrg
.
getStatus
(),
CommonEnum
.
NO
.
getValue
())){
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR_ORG_FORBIDDEN
);
if
(
StringUtils
.
equals
(
platUser
.
getIsTenant
(),
CommonEnum
.
NO
.
getValue
()))
{
checkUserOrg
(
platUser
);
}
}
...
...
@@ -434,7 +429,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
.
eq
(
PlatOrg:
:
getStatus
,
CommonEnum
.
NO
.
getValue
());
long
count
=
platOrgService
.
count
(
platOrgLambdaQueryWrapper
);
if
(
count
>
0
)
{
throw
new
BusinessException
(
"禁用的子公司其下属账号无法登录"
);
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR_ORG_FORBIDDEN
);
}
}
...
...
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