Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
tianjin-cement
Project
Project
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
竹天卫
tianjin-cement
Commits
7fdb6d42
Commit
7fdb6d42
authored
Oct 09, 2020
by
mengbali153
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into master
parents
7c6a177c
f040d952
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
247 additions
and
10 deletions
+247
-10
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+17
-0
ProjectController.java
...wise/sc/cement/business/controller/ProjectController.java
+10
-1
EntrustMapper.java
...java/cn/wise/sc/cement/business/mapper/EntrustMapper.java
+2
-0
ProjectMapper.java
...java/cn/wise/sc/cement/business/mapper/ProjectMapper.java
+2
-0
EntrustMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
+60
-0
ProjectMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/ProjectMapper.xml
+13
-1
PageQuery.java
...main/java/cn/wise/sc/cement/business/model/PageQuery.java
+1
-1
IEntrustService.java
...a/cn/wise/sc/cement/business/service/IEntrustService.java
+5
-0
IProjectService.java
...a/cn/wise/sc/cement/business/service/IProjectService.java
+7
-0
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+106
-0
NormProductionServiceImpl.java
...ment/business/service/impl/NormProductionServiceImpl.java
+5
-2
ProjectServiceImpl.java
...e/sc/cement/business/service/impl/ProjectServiceImpl.java
+11
-0
PageUtil.java
...c/main/java/cn/wise/sc/cement/business/util/PageUtil.java
+8
-5
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
7fdb6d42
...
@@ -13,6 +13,8 @@ import org.slf4j.Logger;
...
@@ -13,6 +13,8 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -57,6 +59,21 @@ public class EntrustController {
...
@@ -57,6 +59,21 @@ public class EntrustController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
@ApiOperation
(
"委托列表导出"
)
@PostMapping
(
"/export"
)
public
void
export
(
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
,
String
projectCode
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
entrustService
.
export
(
startDate
,
endDate
,
status
,
clientId
,
projectName
,
projectCode
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"委托列表导出{}"
,
e
);
}
}
@ApiOperation
(
value
=
"置顶取消置顶 (createTime = updateTime显示置顶,否则显示取消置顶)"
)
@ApiOperation
(
value
=
"置顶取消置顶 (createTime = updateTime显示置顶,否则显示取消置顶)"
)
@PostMapping
(
"/setTopping"
)
@PostMapping
(
"/setTopping"
)
public
BaseResponse
setTopping
(
Integer
id
)
{
public
BaseResponse
setTopping
(
Integer
id
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ProjectController.java
View file @
7fdb6d42
...
@@ -137,7 +137,16 @@ public class ProjectController {
...
@@ -137,7 +137,16 @@ public class ProjectController {
}
}
@ApiOperation
(
value
=
"根据委托单位id获取项目列表"
)
@GetMapping
(
"/getProjectList"
)
public
BaseResponse
getProjectList
(
Integer
clientId
)
{
try
{
return
projectService
.
getProjectList
(
clientId
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"根据委托单位id获取项目列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/EntrustMapper.java
View file @
7fdb6d42
...
@@ -42,4 +42,6 @@ public interface EntrustMapper extends BaseMapper<Entrust> {
...
@@ -42,4 +42,6 @@ public interface EntrustMapper extends BaseMapper<Entrust> {
List
<
QualityDetail
>
getQualityDetail
(
@Param
(
"entrustId"
)
Integer
entrustId
);
List
<
QualityDetail
>
getQualityDetail
(
@Param
(
"entrustId"
)
Integer
entrustId
);
List
<
Map
<
String
,
Object
>>
exportList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/ProjectMapper.java
View file @
7fdb6d42
...
@@ -24,6 +24,8 @@ public interface ProjectMapper extends BaseMapper<Project> {
...
@@ -24,6 +24,8 @@ public interface ProjectMapper extends BaseMapper<Project> {
List
<
ProjectVo
>
getList
();
List
<
ProjectVo
>
getList
();
List
<
ProjectVo
>
getProjectList
(
Integer
clientId
);
ProjectVo
getByName
(
String
name
);
ProjectVo
getByName
(
String
name
);
List
<
Map
<
String
,
Object
>>
exportList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
Map
<
String
,
Object
>>
exportList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
View file @
7fdb6d42
...
@@ -56,6 +56,66 @@
...
@@ -56,6 +56,66 @@
order by e.is_urgent desc, e.update_time desc
order by e.is_urgent desc, e.update_time desc
</select>
</select>
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
(@i:=@i+1) as 序号,
e.id as entrustId,
e.entrust_code as 委托编号,
(
CASE e.is_urgent
WHEN 0 THEN '不加急'
WHEN 1 THEN '加急'
ELSE NULL
END
) as 是否加急,
e.project_name as 项目名称,
e.project_code as 项目编号,
su.name as 委托人,
c.name as 委托单位,
e.entrust_date as 委托日期,
e.sample_num as 样品数量,
(
CASE e.status
WHEN 0 THEN '未评审'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
WHEN 3 THEN '样品处理中'
WHEN 4 THEN '样品处理完成'
WHEN 5 THEN '样品检测中'
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
ELSE ''
END
) as 状态
from entrust e
left join project p on p.id = e.project_id
left join client c on c.id = e.client_id
left join sys_user su on su.id = e.user_id
,(select @i:=0)aa
<include
refid=
"where"
/>
order by 序号,e.is_urgent desc, e.update_time desc
</select>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.EntrustVo"
>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.EntrustVo"
>
select e.*,
select e.*,
(
(
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/ProjectMapper.xml
View file @
7fdb6d42
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<if
test=
"params.code != null and params.code != ''"
>
<if
test=
"params.code != null and params.code != ''"
>
and t.code = #{params.code}
and t.code = #{params.code}
</if>
</if>
<if
test=
"params.clientId != null
and params.clientId != ''
"
>
<if
test=
"params.clientId != null"
>
and t.client_id = #{params.clientId}
and t.client_id = #{params.clientId}
</if>
</if>
<if
test=
"params.name != null and params.name != ''"
>
<if
test=
"params.name != null and params.name != ''"
>
...
@@ -32,6 +32,18 @@
...
@@ -32,6 +32,18 @@
order by t.id desc
order by t.id desc
</select>
</select>
<select
id=
"getProjectList"
resultType=
"cn.wise.sc.cement.business.model.vo.ProjectVo"
>
select t.*,
cl.id as clientId, cl.name clientName
FROM project t
left join client cl on cl.id = t.client_id
where t.status = 1
<if
test=
"clientId != null"
>
and t.client_id = #{clientId}
</if>
order by t.id desc
</select>
<select
id=
"getByName"
resultType=
"cn.wise.sc.cement.business.model.vo.ProjectVo"
>
<select
id=
"getByName"
resultType=
"cn.wise.sc.cement.business.model.vo.ProjectVo"
>
select t.*,
select t.*,
cl.id as clientId, cl.name clientName
cl.id as clientId, cl.name clientName
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/PageQuery.java
View file @
7fdb6d42
...
@@ -21,7 +21,7 @@ public class PageQuery implements Serializable {
...
@@ -21,7 +21,7 @@ public class PageQuery implements Serializable {
private
static
final
long
serialVersionUID
=
3979320797076183357L
;
private
static
final
long
serialVersionUID
=
3979320797076183357L
;
@ApiModelProperty
(
value
=
"当前所在页码"
)
@ApiModelProperty
(
value
=
"当前所在页码"
)
@NonNull
@NonNull
private
Integer
pageNo
=
0
;
private
Integer
pageNo
=
1
;
@ApiModelProperty
(
value
=
"每页显示数量"
)
@ApiModelProperty
(
value
=
"每页显示数量"
)
@NonNull
@NonNull
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEntrustService.java
View file @
7fdb6d42
...
@@ -11,6 +11,7 @@ import cn.wise.sc.cement.business.model.vo.*;
...
@@ -11,6 +11,7 @@ import cn.wise.sc.cement.business.model.vo.*;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -93,4 +94,8 @@ public interface IEntrustService extends IService<Entrust> {
...
@@ -93,4 +94,8 @@ public interface IEntrustService extends IService<Entrust> {
String
projectCode
);
String
projectCode
);
QualityDetailVo
getQualityDetail
(
Integer
entrustId
);
QualityDetailVo
getQualityDetail
(
Integer
entrustId
);
void
export
(
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
,
String
projectCode
,
String
fileName
,
HttpServletResponse
response
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IProjectService.java
View file @
7fdb6d42
...
@@ -39,6 +39,13 @@ public interface IProjectService extends IService<Project> {
...
@@ -39,6 +39,13 @@ public interface IProjectService extends IService<Project> {
*/
*/
BaseResponse
<
List
<
ProjectVo
>>
getList
();
BaseResponse
<
List
<
ProjectVo
>>
getList
();
/**
* 根据委托单位id获取项目列表
* @param clientId
* @return
*/
BaseResponse
<
List
<
ProjectVo
>>
getProjectList
(
Integer
clientId
);
/**
/**
* 新增项目
* 新增项目
*
*
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
7fdb6d42
...
@@ -11,10 +11,12 @@ import cn.wise.sc.cement.business.model.query.*;
...
@@ -11,10 +11,12 @@ import cn.wise.sc.cement.business.model.query.*;
import
cn.wise.sc.cement.business.model.vo.*
;
import
cn.wise.sc.cement.business.model.vo.*
;
import
cn.wise.sc.cement.business.service.*
;
import
cn.wise.sc.cement.business.service.*
;
import
cn.wise.sc.cement.business.util.CheckCountUtil
;
import
cn.wise.sc.cement.business.util.CheckCountUtil
;
import
cn.wise.sc.cement.business.util.ExcelUtil
;
import
cn.wise.sc.cement.business.util.RedisUtil
;
import
cn.wise.sc.cement.business.util.RedisUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -24,6 +26,7 @@ import org.springframework.stereotype.Service;
...
@@ -24,6 +26,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
...
@@ -1880,4 +1883,107 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1880,4 +1883,107 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
JSON
.
toJSONString
(
map
);
return
JSON
.
toJSONString
(
map
);
}
}
/**
* 委托列表导出
* @param startDate
* @param endDate
* @param status
* @param clientId
* @param projectName
* @param projectCode
* @param fileName
* @param response
*/
@Override
public
void
export
(
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
,
String
projectCode
,
String
fileName
,
HttpServletResponse
response
){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"startDate"
,
startDate
);
params
.
put
(
"endDate"
,
endDate
);
params
.
put
(
"status"
,
status
);
params
.
put
(
"clientId"
,
clientId
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectCode"
,
projectCode
);
List
<
Map
<
String
,
Object
>>
list
=
entrustMapper
.
exportList
(
params
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
String
[]
headers
=
new
String
[
map
.
size
()];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"委托编号"
;
headers
[
2
]
=
"是否加急"
;
headers
[
3
]
=
"项目名称"
;
headers
[
4
]
=
"项目编号"
;
headers
[
5
]
=
"委托人"
;
headers
[
6
]
=
"委托单位"
;
headers
[
7
]
=
"委托日期"
;
headers
[
8
]
=
"样品数量"
;
headers
[
9
]
=
"检测项目"
;
headers
[
10
]
=
"检测依据编号"
;
headers
[
11
]
=
"状态"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
for
(
Map
<
String
,
Object
>
m
:
list
)
{
Object
[]
objects
=
new
Object
[
headers
.
length
];
for
(
int
j
=
0
;
j
<
headers
.
length
;
j
++)
{
String
obj
=
m
.
get
(
headers
[
j
]).
toString
();
//如果序号带小数点 去除.0,保留整数
if
(
j
==
0
){
obj
=
obj
.
split
(
"\\."
)[
0
];
}
objects
[
j
]
=
obj
;
}
//根据委托编号id 获取所有样品的检测项目 和 检测依据编号
Integer
entrustId
=
Integer
.
valueOf
(
m
.
get
(
"entrustId"
).
toString
());
System
.
out
.
println
(
entrustId
);
QueryWrapper
<
SampleTmp
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"entrust_id"
,
entrustId
);
List
<
SampleTmp
>
sampleTmpList
=
sampleTmpService
.
list
(
queryWrapper
);
//检测项目名称
String
sampleNames
=
""
;
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()
>
0
)
{
//样品名称 列表中的拼接
for
(
SampleTmp
sampleTmp
:
sampleTmpList
)
{
sampleNames
=
sampleNames
.
equals
(
""
)
?
sampleTmp
.
getName
()
:
(
sampleNames
+
"、"
+
sampleTmp
.
getName
());
}
// entrustVo.setSampleNames(sampleNames);
//检测项 和检测依据 列表里只显示第一个样品的
SampleTmp
sampleTmp
=
sampleTmpList
.
get
(
0
);
String
teamIds
=
sampleTmp
.
getTeamIds
();
String
checkTeam
=
""
;
if
(
teamIds
!=
null
)
{
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
)
{
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
)
{
checkTeam
=
checkTeam
.
equals
(
""
)
?
team
.
getName
()
:
(
checkTeam
+
"、"
+
team
.
getName
());
}
}
}
// entrustVo.setCheckTeam(checkTeam);
// entrustVo.setCheckMethodNumber(sampleTmp.getMethodNumbers());
}
datas
.
add
(
objects
);
}
ExcelUtil
.
excelExport
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托列表"
:
fileName
,
headers
,
datas
,
response
);
}
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/NormProductionServiceImpl.java
View file @
7fdb6d42
...
@@ -242,7 +242,9 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -242,7 +242,9 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
normProductionDetails
(
null
,
start
,
end
);
normProductionDetails
(
null
,
start
,
end
);
if
(
normProductionDetails
.
size
()
==
0
)
{
if
(
normProductionDetails
.
size
()
==
0
)
{
return
BaseResponse
.
errorMsg
(
"没找到相关数据!"
);
BaseResponse
<
List
<
NormProductionStatistics
>>
rts
=
BaseResponse
.
errorMsg
(
"没找到相关数据!"
);
rts
.
setData
(
new
ArrayList
<>());
return
rts
;
}
}
Map
<
Integer
,
BigDecimal
>
coefficientMap
=
new
HashMap
<>(
normProductionDetails
.
size
());
Map
<
Integer
,
BigDecimal
>
coefficientMap
=
new
HashMap
<>(
normProductionDetails
.
size
());
...
@@ -411,8 +413,9 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -411,8 +413,9 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
List
<
SysUser
>
users
=
iSysUserService
.
list
(
qw
);
List
<
SysUser
>
users
=
iSysUserService
.
list
(
qw
);
List
<
SysPost
>
sysPosts
=
iSysPostService
.
list
();
List
<
SysPost
>
sysPosts
=
iSysPostService
.
list
();
Date
finalStartDate
=
startDate
;
Date
finalStartDate
=
startDate
;
Date
finalEndDate
=
endDate
;
rts
.
forEach
(
arg
->
{
rts
.
forEach
(
arg
->
{
arg
.
setTime
(
finalStartDate
==
null
?
"
"
:
finalStartDate
.
toString
()
+
" — "
+
end
.
toString
());
arg
.
setTime
(
finalStartDate
==
null
?
"
--"
+
finalEndDate
.
toString
()
:
finalStartDate
.
toString
()
+
"--"
+
finalEndDate
.
toString
());
if
(
StrUtil
.
isBlank
(
arg
.
getUserName
()))
{
if
(
StrUtil
.
isBlank
(
arg
.
getUserName
()))
{
//关联用户信息
//关联用户信息
users
.
stream
().
filter
(
opt
->
arg
.
getUserId
().
equals
(
opt
.
getId
()
+
""
)).
findFirst
()
users
.
stream
().
filter
(
opt
->
arg
.
getUserId
().
equals
(
opt
.
getId
()
+
""
)).
findFirst
()
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/ProjectServiceImpl.java
View file @
7fdb6d42
...
@@ -70,6 +70,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
...
@@ -70,6 +70,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
return
BaseResponse
.
okData
(
list
);
return
BaseResponse
.
okData
(
list
);
}
}
@Override
public
BaseResponse
<
List
<
ProjectVo
>>
getProjectList
(
Integer
clientId
)
{
List
<
ProjectVo
>
list
=
projectMapper
.
getProjectList
(
clientId
);
return
BaseResponse
.
okData
(
list
);
}
@Override
@Override
@Transactional
@Transactional
public
BaseResponse
<
Project
>
create
(
ProjectQuery
query
)
{
public
BaseResponse
<
Project
>
create
(
ProjectQuery
query
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/util/PageUtil.java
View file @
7fdb6d42
...
@@ -13,13 +13,16 @@ import java.util.List;
...
@@ -13,13 +13,16 @@ import java.util.List;
public
class
PageUtil
{
public
class
PageUtil
{
public
static
<
T
>
Page
<
T
>
listConvertToPage
(
List
<
T
>
list
,
PageQuery
pageQuery
)
{
public
static
<
T
>
Page
<
T
>
listConvertToPage
(
List
<
T
>
list
,
PageQuery
pageQuery
)
{
int
start
=
pageQuery
.
getPageNo
();
int
start
=
pageQuery
.
getPageNo
()
>
0
?
pageQuery
.
getPageNo
()
:
1
;
int
end
=
Math
.
min
((
start
+
pageQuery
.
getPageSize
()),
list
.
size
());
int
pageSize
=
pageQuery
.
getPageSize
()
>
0
?
pageQuery
.
getPageSize
()
:
10
;
Page
<
T
>
page
=
new
Page
<>(
start
,
pageQuery
.
getPageSize
(),
list
.
size
());
int
end
=
Math
.
min
((
start
*
pageSize
),
list
.
size
());
if
(
start
*
page
.
getSize
()
>
list
.
size
())
{
long
pageStart
=
(
start
-
1
)
*
pageSize
;
Page
<
T
>
page
=
new
Page
<>(
start
,
pageSize
,
list
.
size
());
if
(
pageStart
>=
list
.
size
())
{
return
page
;
return
page
;
}
}
page
.
setRecords
(
list
.
subList
((
int
)(
start
*
page
.
getSize
()),
end
));
page
.
setRecords
(
list
.
subList
((
int
)
(
pageStart
),
end
));
return
page
;
return
page
;
}
}
}
}
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