Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
Project
Project
Details
Activity
Releases
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
周健威
rs-cloud-platform
Commits
eb546eac
Commit
eb546eac
authored
May 09, 2024
by
chenyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024/05/09_API文档后台管理开发
parent
c7837787
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
4 deletions
+38
-4
TModelTypeBiz.java
...ava/com/upyuns/platform/rs/website/biz/TModelTypeBiz.java
+38
-4
No files found.
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/TModelTypeBiz.java
View file @
eb546eac
...
...
@@ -2,12 +2,16 @@ package com.upyuns.platform.rs.website.biz;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.upyuns.platform.rs.website.dto.TModelTypeDTO
;
import
com.upyuns.platform.rs.website.entity.ApiCustomNode
;
import
com.upyuns.platform.rs.website.entity.TModel
;
import
com.upyuns.platform.rs.website.entity.TModelType
;
import
com.upyuns.platform.rs.website.mapper.TModelMapper
;
...
...
@@ -15,6 +19,7 @@ import com.upyuns.platform.rs.website.mapper.TModelTypeMapper;
import
com.upyuns.platform.rs.website.vo.TModelTypeVo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -25,7 +30,9 @@ public class TModelTypeBiz extends BaseBiz<TModelTypeMapper, TModelType> {
public
List
<
TModelTypeVo
>
getAll
()
{
List
<
TModelTypeVo
>
vos
=
new
ArrayList
<>();
List
<
TModelType
>
tModelTypes
=
mapper
.
selectAll
();
Example
exampleModel
=
new
Example
(
TModelType
.
class
);
exampleModel
.
createCriteria
().
andEqualTo
(
"isDel"
,
0
);
List
<
TModelType
>
tModelTypes
=
mapper
.
selectByExample
(
exampleModel
);
for
(
TModelType
tModelType
:
tModelTypes
)
{
TModelTypeVo
vo
=
new
TModelTypeVo
();
BeanUtils
.
copyProperties
(
tModelType
,
vo
);
...
...
@@ -70,9 +77,36 @@ public class TModelTypeBiz extends BaseBiz<TModelTypeMapper, TModelType> {
return
ObjectRestResponse
.
succ
();
}
public
Page
DataVO
<
TModelType
>
getList
(
TModelTypeDTO
tModelTypeDTO
)
{
public
Page
Info
<?
>
getList
(
TModelTypeDTO
tModelTypeDTO
)
{
Query
query
=
new
Query
(
tModelTypeDTO
);
PageDataVO
<
TModelType
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
selectList
(
query
.
getSuper
()));
return
pageDataVO
;
List
<
TModelTypeVo
>
vos
=
new
ArrayList
<>();
List
<
TModelType
>
tModelTypes
=
mapper
.
selectList
(
query
.
getSuper
());
for
(
TModelType
tModelType
:
tModelTypes
)
{
TModelTypeVo
vo
=
new
TModelTypeVo
();
BeanUtils
.
copyProperties
(
tModelType
,
vo
);
vos
.
add
(
vo
);
}
List
<
TModelTypeVo
>
result
=
new
ArrayList
<>();
for
(
TModelTypeVo
vo
:
vos
)
{
if
(
vo
.
getPid
().
equals
(
0
))
{
result
.
add
(
findChildren
(
vo
,
vos
));
}
}
Page
<
TModelTypeVo
>
page
=
new
Page
(
tModelTypeDTO
.
getPage
(),
tModelTypeDTO
.
getLimit
());
int
total
=
result
.
size
();
page
.
setTotal
(
total
);
int
startIndex
=
(
tModelTypeDTO
.
getPage
()
-
1
)
*
tModelTypeDTO
.
getLimit
();
int
endIndex
=
Math
.
min
(
startIndex
+
tModelTypeDTO
.
getLimit
(),
total
);
if
(
startIndex
>
endIndex
){
page
.
addAll
(
new
ArrayList
());
PageInfo
<
TModelTypeVo
>
pageInfo
=
new
PageInfo
<>(
page
);
return
pageInfo
;
}
else
{
page
.
addAll
(
result
.
subList
(
startIndex
,
endIndex
));
PageInfo
<
TModelTypeVo
>
pageInfo
=
new
PageInfo
<>(
page
);
return
pageInfo
;
}
}
}
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