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
1b23f90a
Commit
1b23f90a
authored
Feb 18, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备信息增加所属门店与房间字段,设备网关信息页面,增加所属门店
parent
a6b30a3d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
144 additions
and
8 deletions
+144
-8
DeviceController.java
...in/java/share/web/controller/system/DeviceController.java
+1
-3
DeviceGatewayController.java
.../share/web/controller/system/DeviceGatewayController.java
+1
-3
DeviceGatewayVo.java
...src/main/java/share/system/domain/vo/DeviceGatewayVo.java
+10
-0
DeviceVo.java
...system/src/main/java/share/system/domain/vo/DeviceVo.java
+12
-0
DeviceGatewayService.java
.../main/java/share/system/service/DeviceGatewayService.java
+2
-0
DeviceService.java
...tem/src/main/java/share/system/service/DeviceService.java
+3
-0
DeviceGatewayServiceImpl.java
...a/share/system/service/impl/DeviceGatewayServiceImpl.java
+56
-0
DeviceServiceImpl.java
...ain/java/share/system/service/impl/DeviceServiceImpl.java
+56
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+2
-2
SOrderMapper.xml
...-system/src/main/resources/mapper/system/SOrderMapper.xml
+1
-0
No files found.
share-admin/src/main/java/share/web/controller/system/DeviceController.java
View file @
1b23f90a
...
@@ -53,9 +53,7 @@ public class DeviceController extends BaseController
...
@@ -53,9 +53,7 @@ public class DeviceController extends BaseController
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
DeviceDto
device
)
public
TableDataInfo
list
(
DeviceDto
device
)
{
{
startPage
();
return
deviceService
.
devicePage
(
device
);
List
<
Device
>
list
=
deviceService
.
selectDeviceList
(
device
);
return
getDataTable
(
list
);
}
}
/**
/**
...
...
share-admin/src/main/java/share/web/controller/system/DeviceGatewayController.java
View file @
1b23f90a
...
@@ -46,9 +46,7 @@ public class DeviceGatewayController extends BaseController
...
@@ -46,9 +46,7 @@ public class DeviceGatewayController extends BaseController
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
DeviceGatewayDto
deviceGatewayDto
)
public
TableDataInfo
list
(
DeviceGatewayDto
deviceGatewayDto
)
{
{
startPage
();
return
deviceGatewayService
.
deviceGatewayPage
(
deviceGatewayDto
);
List
<
DeviceGateway
>
list
=
deviceGatewayService
.
selectDeviceGatewayList
(
deviceGatewayDto
);
return
getDataTable
(
list
);
}
}
/**
/**
...
...
share-system/src/main/java/share/system/domain/vo/DeviceGatewayVo.java
0 → 100644
View file @
1b23f90a
package
share
.
system
.
domain
.
vo
;
import
lombok.Data
;
import
share.system.domain.DeviceGateway
;
@Data
public
class
DeviceGatewayVo
extends
DeviceGateway
{
//门店名称
private
String
storeName
;
}
share-system/src/main/java/share/system/domain/vo/DeviceVo.java
0 → 100644
View file @
1b23f90a
package
share
.
system
.
domain
.
vo
;
import
lombok.Data
;
import
share.system.domain.Device
;
@Data
public
class
DeviceVo
extends
Device
{
//门店名称
private
String
storeName
;
//房间名称
private
String
roomName
;
}
share-system/src/main/java/share/system/service/DeviceGatewayService.java
View file @
1b23f90a
...
@@ -2,6 +2,7 @@ package share.system.service;
...
@@ -2,6 +2,7 @@ package share.system.service;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.common.core.page.TableDataInfo
;
import
share.system.domain.DeviceGateway
;
import
share.system.domain.DeviceGateway
;
import
share.system.domain.DeviceGatewayDto
;
import
share.system.domain.DeviceGatewayDto
;
...
@@ -67,4 +68,5 @@ public interface DeviceGatewayService extends IService<DeviceGateway>
...
@@ -67,4 +68,5 @@ public interface DeviceGatewayService extends IService<DeviceGateway>
*/
*/
boolean
deviceGatewayStatusMonitor
();
boolean
deviceGatewayStatusMonitor
();
TableDataInfo
deviceGatewayPage
(
DeviceGatewayDto
deviceGatewayDto
);
}
}
share-system/src/main/java/share/system/service/DeviceService.java
View file @
1b23f90a
...
@@ -2,6 +2,7 @@ package share.system.service;
...
@@ -2,6 +2,7 @@ package share.system.service;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.common.core.page.TableDataInfo
;
import
share.system.domain.Device
;
import
share.system.domain.Device
;
import
share.system.domain.DeviceDto
;
import
share.system.domain.DeviceDto
;
...
@@ -81,4 +82,6 @@ public interface DeviceService extends IService<Device>
...
@@ -81,4 +82,6 @@ public interface DeviceService extends IService<Device>
* @return 设备信息
* @return 设备信息
*/
*/
Device
selectDeviceByDevId
(
String
devId
);
Device
selectDeviceByDevId
(
String
devId
);
TableDataInfo
devicePage
(
DeviceDto
device
);
}
}
share-system/src/main/java/share/system/service/impl/DeviceGatewayServiceImpl.java
View file @
1b23f90a
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.Date
;
import
java.util.List
;
import
java.util.List
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
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.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
share.common.core.page.PageDomain
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableSupport
;
import
share.common.enums.DeviceStatusEnum
;
import
share.common.enums.DeviceStatusEnum
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
share.system.domain.Device
;
import
share.system.domain.DeviceGatewayDto
;
import
share.system.domain.DeviceGatewayDto
;
import
share.system.domain.SStore
;
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.domain.DeviceGateway
;
import
share.system.domain.DeviceGateway
;
import
share.system.mapper.SStoreMapper
;
import
share.system.service.DeviceGatewayService
;
import
share.system.service.DeviceGatewayService
;
/**
/**
...
@@ -30,6 +44,8 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D
...
@@ -30,6 +44,8 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D
@Value
(
"${mqtt.device-gateway-last-report-time}"
)
@Value
(
"${mqtt.device-gateway-last-report-time}"
)
private
Integer
deviceGatewayLastReportTime
;
private
Integer
deviceGatewayLastReportTime
;
@Autowired
private
SStoreMapper
storeMapper
;
/**
/**
* 查询设备网关信息
* 查询设备网关信息
...
@@ -124,4 +140,44 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D
...
@@ -124,4 +140,44 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D
});
});
return
this
.
updateBatchById
(
list
);
return
this
.
updateBatchById
(
list
);
}
}
@Override
public
TableDataInfo
deviceGatewayPage
(
DeviceGatewayDto
deviceGatewayDto
)
{
List
<
DeviceGateway
>
deviceGateways
=
deviceGatewayMapper
.
selectDeviceGatewayList
(
deviceGatewayDto
);
List
<
DeviceGatewayVo
>
deviceGatewayVoList
=
convertDosToVos
(
deviceGateways
);
if
(
CollectionUtils
.
isNotEmpty
(
deviceGatewayVoList
))
{
List
<
SStore
>
sStoreList
=
storeMapper
.
selectList
(
new
LambdaQueryWrapper
<>());
deviceGatewayVoList
.
stream
().
forEach
(
item
->
{
if
(
StringUtils
.
isNoneEmpty
(
item
.
getGroup
()))
{
SStore
sStore
=
sStoreList
.
stream
().
filter
(
store
->
store
.
getDeviceGroup
().
equals
(
item
.
getGroup
())).
findFirst
().
orElse
(
null
);
if
(
ObjectUtil
.
isNotEmpty
(
sStore
))
{
item
.
setStoreName
(
sStore
.
getName
());
}
}
});
}
deviceGatewayVoList
.
sort
(
Comparator
.
comparing
(
DeviceGatewayVo:
:
getCreateTime
).
reversed
());
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
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
.
setMsg
(
"查询成功"
);
return
tableDataInfo
;
}
private
List
<
DeviceGatewayVo
>
convertDosToVos
(
List
<
DeviceGateway
>
deviceGateways
)
{
List
<
DeviceGatewayVo
>
voList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
deviceGateways
))
{
deviceGateways
.
stream
().
forEach
(
o
->
{
DeviceGatewayVo
vo
=
new
DeviceGatewayVo
();
org
.
springframework
.
beans
.
BeanUtils
.
copyProperties
(
o
,
vo
);
voList
.
add
(
vo
);
});
}
return
voList
;
}
}
}
share-system/src/main/java/share/system/service/impl/DeviceServiceImpl.java
View file @
1b23f90a
package
share
.
system
.
service
.
impl
;
package
share
.
system
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.List
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
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
share.common.core.page.PageDomain
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableSupport
;
import
share.common.utils.BaseUtil
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
share.common.utils.SecurityUtils
;
import
share.common.utils.SecurityUtils
;
import
share.common.utils.bean.BeanUtils
;
import
share.system.domain.*
;
import
share.system.domain.*
;
import
share.system.domain.vo.DeviceVo
;
import
share.system.domain.vo.SStoreVo
;
import
share.system.mapper.DeviceMapper
;
import
share.system.mapper.DeviceMapper
;
import
share.system.mapper.SRoomMapper
;
import
share.system.mapper.SRoomMapper
;
import
share.system.mapper.SStoreMapper
;
import
share.system.mapper.SStoreMapper
;
...
@@ -132,6 +143,39 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
...
@@ -132,6 +143,39 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
}
}
@Override
@Override
public
TableDataInfo
devicePage
(
DeviceDto
device
)
{
List
<
Device
>
devices
=
deviceMapper
.
selectDeviceList
(
device
);
List
<
DeviceVo
>
deviceVoList
=
convertDosToVos
(
devices
);
if
(
CollectionUtils
.
isNotEmpty
(
deviceVoList
))
{
List
<
SStore
>
sStoreList
=
storeMapper
.
selectList
(
new
LambdaQueryWrapper
<>());
List
<
SRoom
>
sRoomList
=
roomMapper
.
selectList
(
new
LambdaQueryWrapper
<>());
deviceVoList
.
stream
().
forEach
(
item
->
{
if
(
ObjectUtil
.
isNotEmpty
(
item
.
getRoomId
()))
{
SRoom
sRoom
=
sRoomList
.
stream
().
filter
(
room
->
room
.
getId
().
equals
(
item
.
getRoomId
())).
findFirst
().
orElse
(
null
);
if
(
ObjectUtil
.
isNotEmpty
(
sRoom
))
{
SStore
sStore
=
sStoreList
.
stream
().
filter
(
store
->
store
.
getId
().
equals
(
sRoom
.
getStoreId
())).
findFirst
().
orElse
(
null
);
if
(
ObjectUtil
.
isNotEmpty
(
sStore
))
{
item
.
setStoreName
(
sStore
.
getName
());
}
item
.
setRoomName
(
sRoom
.
getName
());
}
}
});
}
deviceVoList
.
sort
(
Comparator
.
comparing
(
DeviceVo:
:
getCreateTime
).
reversed
());
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
int
start
=
(
pageDomain
.
getPageNum
()
-
1
)
*
pageDomain
.
getPageSize
();
int
end
=
Math
.
min
(
start
+
pageDomain
.
getPageSize
(),
deviceVoList
.
size
());
List
<
DeviceVo
>
deviceVos
=
deviceVoList
.
subList
(
start
,
end
);
TableDataInfo
tableDataInfo
=
new
TableDataInfo
();
tableDataInfo
.
setRows
(
deviceVos
);
tableDataInfo
.
setTotal
(
deviceVoList
.
size
());
tableDataInfo
.
setCode
(
200
);
tableDataInfo
.
setMsg
(
"查询成功"
);
return
tableDataInfo
;
}
@Override
public
List
<
Device
>
notRoomIdList
(
Device
device
)
{
public
List
<
Device
>
notRoomIdList
(
Device
device
)
{
SRoom
room
=
roomMapper
.
selectSRoomById
(
device
.
getRoomId
());
SRoom
room
=
roomMapper
.
selectSRoomById
(
device
.
getRoomId
());
if
(
room
!=
null
)
{
if
(
room
!=
null
)
{
...
@@ -147,4 +191,16 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
...
@@ -147,4 +191,16 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
return
deviceMapper
.
notRoomIdList
(
device
);
return
deviceMapper
.
notRoomIdList
(
device
);
}
}
private
List
<
DeviceVo
>
convertDosToVos
(
List
<
Device
>
devices
)
{
List
<
DeviceVo
>
voList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
devices
))
{
devices
.
stream
().
forEach
(
o
->
{
DeviceVo
vo
=
new
DeviceVo
();
org
.
springframework
.
beans
.
BeanUtils
.
copyProperties
(
o
,
vo
);
voList
.
add
(
vo
);
});
}
return
voList
;
}
}
}
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
1b23f90a
...
@@ -255,8 +255,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -255,8 +255,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
FIVE
);
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
FIVE
);
}
}
}
}
//当前时间加
90分钟
//当前时间加
1年
Date
date
=
DateUtils
.
add
Minutes
(
new
Date
(),
90
);
Date
date
=
DateUtils
.
add
Years
(
new
Date
(),
1
);
sOrder
.
setPreStartDate
(
date
);
sOrder
.
setPreStartDate
(
date
);
sOrder
.
setPreEndDate
(
date
);
sOrder
.
setPreEndDate
(
date
);
sOrder
.
setStatus
(
OrderStatusEnum
.
UNUSED
.
getCode
());
sOrder
.
setStatus
(
OrderStatusEnum
.
UNUSED
.
getCode
());
...
...
share-system/src/main/resources/mapper/system/SOrderMapper.xml
View file @
1b23f90a
...
@@ -244,6 +244,7 @@
...
@@ -244,6 +244,7 @@
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = NOW(),
</if>
<if
test=
"updateTime != null"
>
update_time = NOW(),
</if>
<if
test=
"arrivalTime != null"
>
arrival_time = #{arrivalTime},
</if>
<if
test=
"arrivalTime != null"
>
arrival_time = #{arrivalTime},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
</trim>
</trim>
where id = #{id}
where id = #{id}
</update>
</update>
...
...
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