Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
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
pseer
gxpt_ht
Commits
98b38478
Commit
98b38478
authored
Nov 07, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改设备网关信息分页
parent
d74f34ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
19 deletions
+18
-19
DeviceGatewayServiceImpl.java
...a/share/system/service/impl/DeviceGatewayServiceImpl.java
+18
-19
No files found.
share-system/src/main/java/share/system/service/impl/DeviceGatewayServiceImpl.java
View file @
98b38478
package
share
.
system
.
service
.
impl
;
package
share
.
system
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
share.common.core.page.PageDomain
;
import
share.common.core.page.PageDomain
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableSupport
;
import
share.common.core.page.TableSupport
;
import
share.common.enums.DeviceStatusEnum
;
import
share.common.enums.DeviceStatusEnum
;
import
share.common.enums.YesNoEnum
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
share.system.domain.DeviceGateway
;
import
org.springframework.stereotype.Service
;
import
share.system.domain.DeviceGatewayDto
;
import
share.system.domain.
*
;
import
share.system.domain.
SStore
;
import
share.system.domain.vo.DeviceGatewayVo
;
import
share.system.domain.vo.DeviceGatewayVo
;
import
share.system.domain.vo.DeviceVo
;
import
share.system.mapper.DeviceGatewayMapper
;
import
share.system.mapper.DeviceGatewayMapper
;
import
share.system.mapper.SStoreMapper
;
import
share.system.mapper.SStoreMapper
;
import
share.system.service.DeviceGatewayService
;
import
share.system.service.DeviceGatewayService
;
import
share.system.service.ISysConfigService
;
import
share.system.service.ISysConfigService
;
import
share.system.service.SmsService
;
import
share.system.service.SmsService
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* 设备网关信息Service业务层处理
* 设备网关信息Service业务层处理
*
*
...
@@ -159,7 +158,13 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D
...
@@ -159,7 +158,13 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D
@Override
@Override
public
TableDataInfo
deviceGatewayPage
(
DeviceGatewayDto
deviceGatewayDto
)
{
public
TableDataInfo
deviceGatewayPage
(
DeviceGatewayDto
deviceGatewayDto
)
{
List
<
DeviceGateway
>
deviceGateways
=
deviceGatewayMapper
.
selectDeviceGatewayList
(
deviceGatewayDto
);
List
<
DeviceGateway
>
deviceGateways
=
deviceGatewayMapper
.
selectDeviceGatewayList
(
deviceGatewayDto
);
List
<
DeviceGatewayVo
>
deviceGatewayVoList
=
convertDosToVos
(
deviceGateways
);
TableDataInfo
tableDataInfo
=
new
TableDataInfo
();
tableDataInfo
.
setTotal
(
deviceGateways
.
size
());
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
int
start
=
(
pageDomain
.
getPageNum
()
-
1
)
*
pageDomain
.
getPageSize
();
int
end
=
Math
.
min
(
start
+
pageDomain
.
getPageSize
(),
deviceGateways
.
size
());
List
<
DeviceGateway
>
deviceGatewayVos
=
deviceGateways
.
subList
(
start
,
end
);
List
<
DeviceGatewayVo
>
deviceGatewayVoList
=
convertDosToVos
(
deviceGatewayVos
);
if
(
CollectionUtils
.
isNotEmpty
(
deviceGatewayVoList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
deviceGatewayVoList
))
{
List
<
SStore
>
sStoreList
=
storeMapper
.
selectList
(
new
LambdaQueryWrapper
<>());
List
<
SStore
>
sStoreList
=
storeMapper
.
selectList
(
new
LambdaQueryWrapper
<>());
deviceGatewayVoList
.
stream
().
forEach
(
item
->
{
deviceGatewayVoList
.
stream
().
forEach
(
item
->
{
...
@@ -172,13 +177,7 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D
...
@@ -172,13 +177,7 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D
});
});
}
}
deviceGatewayVoList
.
sort
(
Comparator
.
comparing
(
DeviceGatewayVo:
:
getCreateTime
).
reversed
());
deviceGatewayVoList
.
sort
(
Comparator
.
comparing
(
DeviceGatewayVo:
:
getCreateTime
).
reversed
());
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
tableDataInfo
.
setRows
(
deviceGatewayVoList
);
int
start
=
(
pageDomain
.
getPageNum
()
-
1
)
*
pageDomain
.
getPageSize
();
int
end
=
Math
.
min
(
start
+
pageDomain
.
getPageSize
(),
deviceGatewayVoList
.
size
());
List
<
DeviceGatewayVo
>
deviceGatewayVos
=
deviceGatewayVoList
.
subList
(
start
,
end
);
TableDataInfo
tableDataInfo
=
new
TableDataInfo
();
tableDataInfo
.
setRows
(
deviceGatewayVos
);
tableDataInfo
.
setTotal
(
deviceGatewayVoList
.
size
());
tableDataInfo
.
setCode
(
200
);
tableDataInfo
.
setCode
(
200
);
tableDataInfo
.
setMsg
(
"查询成功"
);
tableDataInfo
.
setMsg
(
"查询成功"
);
return
tableDataInfo
;
return
tableDataInfo
;
...
...
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