Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
operation-control-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王锦盛
operation-control-platform
Commits
55bdac10
Commit
55bdac10
authored
Mar 17, 2022
by
itcast
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
郭凡凡-注册功能
parent
84baf8fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
24 deletions
+36
-24
src/main/java/com/pms/ocp/service/impl/TenantBasicManagementServiceImpl.java
...ms/ocp/service/impl/TenantBasicManagementServiceImpl.java
+36
-24
No files found.
src/main/java/com/pms/ocp/service/impl/TenantBasicManagementServiceImpl.java
View file @
55bdac10
...
@@ -170,43 +170,55 @@ public class TenantBasicManagementServiceImpl extends ServiceImpl<TenantBasicMan
...
@@ -170,43 +170,55 @@ public class TenantBasicManagementServiceImpl extends ServiceImpl<TenantBasicMan
@Override
@Override
public
ResponseVO
applyRegister
(
OcpTenantBaseDto
ocpTenantBaseDto
)
{
public
ResponseVO
applyRegister
(
OcpTenantBaseDto
ocpTenantBaseDto
)
{
//OcpTenantBase
//OcpTenantBase
String
tenantGroupName
=
ocpTenantBaseDto
.
getTenantGroupName
();
//应用分类名称
//
String tenantGroupName = ocpTenantBaseDto.getTenantGroupName();//应用分类名称
LambdaQueryWrapper
<
OcpTenantGroup
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
//
LambdaQueryWrapper<OcpTenantGroup> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper
.
eq
(
OcpTenantGroup:
:
getTenantGroupName
,
tenantGroupName
);
//
lambdaQueryWrapper.eq(OcpTenantGroup::getTenantGroupName, tenantGroupName);
OcpTenantGroup
one
=
ocpTenantGroupService
.
getOne
(
lambdaQueryWrapper
);
//
OcpTenantGroup one = ocpTenantGroupService.getOne(lambdaQueryWrapper);
if
(
one
==
null
)
{
//
if (one == null) {
return
ResponseVO
.
error
(
"该应用分类不存在"
);
//
return ResponseVO.error("该应用分类不存在");
}
//
}
String
tenantCode
=
ocpTenantBaseDto
.
getTenantCode
();
LambdaQueryWrapper
<
OcpTenantBase
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
OcpTenantBase:
:
getTenantCode
,
tenantCode
);
List
<
OcpTenantBase
>
ocpTenantBases
=
tenantBasicManagementMapper
.
selectList
(
lambdaQueryWrapper
);
if
(
ocpTenantBases
.
size
()
!=
1
)
{
return
ResponseVO
.
error
(
"应用代码应该唯一"
);
}
for
(
OcpTenantBase
ocpTenantBase
:
ocpTenantBases
)
{
System
.
out
.
println
(
ocpTenantBase
);
BeanUtils
.
copyProperties
(
ocpTenantBaseDto
,
ocpTenantBase
);
this
.
updateById
(
ocpTenantBase
);
}
String
apiCodes
=
ocpTenantBaseDto
.
getApiCodes
();
String
apiCodes
=
ocpTenantBaseDto
.
getApiCodes
();
if
(
StringUtils
.
isEmpty
(
apiCodes
))
{
if
(
StringUtils
.
isEmpty
(
apiCodes
))
{
return
ResponseVO
.
error
(
"服务编码为空"
);
return
ResponseVO
.
error
(
"服务编码为空"
);
}
}
//获取应用分类编码
//
//获取应用分类编码
String
tenantGroupCode
=
one
.
getTenantGroupCode
();
//
String tenantGroupCode = one.getTenantGroupCode();
//
OcpTenantBase
ocpTenantBase
=
new
OcpTenantBase
();
//
OcpTenantBase ocpTenantBase = new OcpTenantBase();
BeanUtils
.
copyProperties
(
ocpTenantBaseDto
,
ocpTenantBase
);
//
BeanUtils.copyProperties(ocpTenantBaseDto, ocpTenantBase);
ocpTenantBase
.
setTenantGroupCode
(
tenantGroupCode
);
//
ocpTenantBase.setTenantGroupCode(tenantGroupCode);
//OcpTenantBase
//
//OcpTenantBase
tenantBasicManagementMapper
.
insert
(
ocpTenantBase
);
//
tenantBasicManagementMapper.insert(ocpTenantBase);
//ocp_tenant_extent
//
//ocp_tenant_extent
OcpTenantExtent
ocpTenantExtent
=
new
OcpTenantExtent
();
//
OcpTenantExtent ocpTenantExtent = new OcpTenantExtent();
BeanUtils
.
copyProperties
(
ocpTenantBaseDto
,
ocpTenantExtent
);
//
BeanUtils.copyProperties(ocpTenantBaseDto, ocpTenantExtent);
ocpTenantExtent
.
setDepCompanyCode
(
null
);
//
ocpTenantExtent.setDepCompanyCode(null);
ocpTenantExtentMapper
.
insert
(
ocpTenantExtent
);
//
ocpTenantExtentMapper.insert(ocpTenantExtent);
//ocp_api_tenant_rel
//ocp_api_tenant_rel
OcpApiTenantRel
ocpApiTenantRel
=
new
OcpApiTenantRel
();
OcpApiTenantRel
ocpApiTenantRel
=
new
OcpApiTenantRel
();
String
[]
split
=
apiCodes
.
split
(
","
);
String
[]
split
=
apiCodes
.
split
(
","
);
List
<
String
>
apiCode
=
Arrays
.
asList
(
split
);
List
<
String
>
apiCode
=
Arrays
.
asList
(
split
);
String
tenantCode
=
ocpTenantBaseDto
.
getTenantCode
();
for
(
String
s
:
apiCode
)
{
for
(
String
s
:
apiCode
)
{
ocpApiTenantRel
.
setApiCode
(
s
);
ocpApiTenantRel
.
setApiCode
(
s
);
ocpApiTenantRel
.
setTenantDepCompanyCode
(
null
);
ocpApiTenantRel
.
setTenantDepCompanyCode
(
"078002018"
);
ocpApiTenantRel
.
setApiDepCompanyCode
(
null
);
ocpApiTenantRel
.
setApiDepCompanyCode
(
"078002018"
);
ocpApiTenantRel
.
setTenantCode
(
tenantCode
);
ocpApiTenantRel
.
setTenantCode
(
tenantCode
);
ocpApiTenantRel
.
setApiTenantRelCtime
(
Timestamp
.
valueOf
(
LocalDateTime
.
now
()));
ocpApiTenantRel
.
setApiTenantRelCtime
(
Timestamp
.
valueOf
(
LocalDateTime
.
now
()));
ocpApiTenantRel
.
setApiTenantRelMtime
(
Timestamp
.
valueOf
(
LocalDateTime
.
now
()));
ocpApiTenantRel
.
setApiTenantRelMtime
(
Timestamp
.
valueOf
(
LocalDateTime
.
now
()));
...
...
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