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
4b85f56f
Commit
4b85f56f
authored
Jan 25, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决开门报错的问题
parent
0af9a2db
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
31 additions
and
31 deletions
+31
-31
DeviceController.java
...in/java/share/web/controller/system/DeviceController.java
+2
-2
DeviceGatewayMapper.java
...rc/main/java/share/system/mapper/DeviceGatewayMapper.java
+2
-1
DeviceMapper.java
...ystem/src/main/java/share/system/mapper/DeviceMapper.java
+2
-1
DeviceGatewayService.java
.../main/java/share/system/service/DeviceGatewayService.java
+2
-1
DeviceService.java
...tem/src/main/java/share/system/service/DeviceService.java
+2
-1
DeviceGatewayServiceImpl.java
...a/share/system/service/impl/DeviceGatewayServiceImpl.java
+3
-2
DeviceOpServiceImpl.java
...n/java/share/system/service/impl/DeviceOpServiceImpl.java
+7
-6
DeviceServiceImpl.java
...ain/java/share/system/service/impl/DeviceServiceImpl.java
+2
-5
MqttxServiceImpl.java
...main/java/share/system/service/impl/MqttxServiceImpl.java
+7
-10
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+1
-1
DeviceGatewayMapper.xml
.../src/main/resources/mapper/system/DeviceGatewayMapper.xml
+1
-1
No files found.
share-admin/src/main/java/share/web/controller/system/DeviceController.java
View file @
4b85f56f
...
...
@@ -65,7 +65,7 @@ public class DeviceController extends BaseController
@PreAuthorize
(
"@ss.hasPermi('system:device:export')"
)
@Log
(
title
=
"设备信息"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
Device
device
)
public
void
export
(
HttpServletResponse
response
,
Device
Dto
device
)
{
List
<
Device
>
list
=
deviceService
.
selectDeviceList
(
device
);
ExcelUtil
<
Device
>
util
=
new
ExcelUtil
<
Device
>(
Device
.
class
);
...
...
@@ -138,7 +138,7 @@ public class DeviceController extends BaseController
* 已绑定房间的设备
*/
@GetMapping
(
"/listByRoom"
)
public
TableDataInfo
listByRoom
(
Device
device
)
public
TableDataInfo
listByRoom
(
Device
Dto
device
)
{
startPage
();
List
<
Device
>
list
=
deviceService
.
selectDeviceList
(
device
);
...
...
share-system/src/main/java/share/system/mapper/DeviceGatewayMapper.java
View file @
4b85f56f
...
...
@@ -3,6 +3,7 @@ package share.system.mapper;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
share.system.domain.DeviceGateway
;
import
share.system.domain.DeviceGatewayDto
;
/**
* 设备网关信息Mapper接口
...
...
@@ -26,7 +27,7 @@ public interface DeviceGatewayMapper extends BaseMapper<DeviceGateway>
* @param deviceGateway 设备网关信息
* @return 设备网关信息集合
*/
public
List
<
DeviceGateway
>
selectDeviceGatewayList
(
DeviceGateway
deviceGateway
);
public
List
<
DeviceGateway
>
selectDeviceGatewayList
(
DeviceGateway
Dto
deviceGateway
);
/**
* 新增设备网关信息
...
...
share-system/src/main/java/share/system/mapper/DeviceMapper.java
View file @
4b85f56f
...
...
@@ -3,6 +3,7 @@ package share.system.mapper;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
share.system.domain.Device
;
import
share.system.domain.DeviceDto
;
/**
* 设备信息Mapper接口
...
...
@@ -26,7 +27,7 @@ public interface DeviceMapper extends BaseMapper<Device>
* @param device 设备信息
* @return 设备信息集合
*/
public
List
<
Device
>
selectDeviceList
(
Device
device
);
public
List
<
Device
>
selectDeviceList
(
Device
Dto
device
);
/**
* 新增设备信息
...
...
share-system/src/main/java/share/system/service/DeviceGatewayService.java
View file @
4b85f56f
...
...
@@ -3,6 +3,7 @@ package share.system.service;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.DeviceGateway
;
import
share.system.domain.DeviceGatewayDto
;
/**
* 设备网关信息Service接口
...
...
@@ -26,7 +27,7 @@ public interface DeviceGatewayService extends IService<DeviceGateway>
* @param deviceGateway 设备网关信息
* @return 设备网关信息集合
*/
public
List
<
DeviceGateway
>
selectDeviceGatewayList
(
DeviceGateway
deviceGateway
);
public
List
<
DeviceGateway
>
selectDeviceGatewayList
(
DeviceGateway
Dto
deviceGateway
);
/**
* 新增设备网关信息
...
...
share-system/src/main/java/share/system/service/DeviceService.java
View file @
4b85f56f
...
...
@@ -3,6 +3,7 @@ package share.system.service;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.Device
;
import
share.system.domain.DeviceDto
;
/**
* 设备信息Service接口
...
...
@@ -26,7 +27,7 @@ public interface DeviceService extends IService<Device>
* @param device 设备信息
* @return 设备信息集合
*/
public
List
<
Device
>
selectDeviceList
(
Device
device
);
public
List
<
Device
>
selectDeviceList
(
Device
Dto
device
);
/**
* 新增设备信息
...
...
share-system/src/main/java/share/system/service/impl/DeviceGatewayServiceImpl.java
View file @
4b85f56f
...
...
@@ -11,6 +11,7 @@ import share.common.enums.DeviceStatusEnum;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.system.domain.DeviceGatewayDto
;
import
share.system.mapper.DeviceGatewayMapper
;
import
share.system.domain.DeviceGateway
;
import
share.system.service.DeviceGatewayService
;
...
...
@@ -49,7 +50,7 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D
* @return 设备网关信息
*/
@Override
public
List
<
DeviceGateway
>
selectDeviceGatewayList
(
DeviceGateway
deviceGateway
)
public
List
<
DeviceGateway
>
selectDeviceGatewayList
(
DeviceGateway
Dto
deviceGateway
)
{
return
deviceGatewayMapper
.
selectDeviceGatewayList
(
deviceGateway
);
}
...
...
@@ -110,7 +111,7 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D
*/
@Override
public
boolean
deviceGatewayStatusMonitor
()
{
List
<
DeviceGateway
>
list
=
deviceGatewayMapper
.
selectDeviceGatewayList
(
new
DeviceGateway
());
List
<
DeviceGateway
>
list
=
deviceGatewayMapper
.
selectDeviceGatewayList
(
new
DeviceGateway
Dto
());
list
.
stream
().
forEach
(
gateway
->
{
Date
lastReportDate
=
gateway
.
getLastReportDate
();
// 网关上报(最近10分钟内没有上报数据,网关设备离线)
...
...
share-system/src/main/java/share/system/service/impl/DeviceOpServiceImpl.java
View file @
4b85f56f
...
...
@@ -8,6 +8,7 @@ import org.springframework.stereotype.Service;
import
share.common.enums.DeviceType
;
import
share.common.enums.OpTypeEnum
;
import
share.common.utils.SecurityUtils
;
import
share.system.domain.DeviceDto
;
import
share.system.mqtt.MqttGatewayComponent
;
import
share.system.domain.Device
;
import
share.system.domain.SRoom
;
...
...
@@ -51,7 +52,7 @@ public class DeviceOpServiceImpl implements DeviceOpService {
public
void
openDoor
(
DeviceParamVo
deviceParam
)
{
SRoom
room
=
roomMapper
.
selectSRoomById
(
deviceParam
.
getRoomId
());
if
(
room
!=
null
)
{
Device
param
=
new
Device
();
Device
Dto
param
=
new
DeviceDto
();
param
.
setRoomId
(
room
.
getId
());
List
<
Device
>
list
=
deviceMapper
.
selectDeviceList
(
param
);
for
(
Device
device
:
list
)
{
...
...
@@ -76,7 +77,7 @@ public class DeviceOpServiceImpl implements DeviceOpService {
public
void
openDoor
(
Long
roomId
,
String
phone
)
{
SRoom
room
=
roomMapper
.
selectSRoomById
(
roomId
);
if
(
room
!=
null
)
{
Device
param
=
new
Device
();
Device
Dto
param
=
new
DeviceDto
();
param
.
setRoomId
(
room
.
getId
());
List
<
Device
>
list
=
deviceMapper
.
selectDeviceList
(
param
);
for
(
Device
device
:
list
)
{
...
...
@@ -167,7 +168,7 @@ public class DeviceOpServiceImpl implements DeviceOpService {
String
startTime
,
String
endTime
,
String
number
)
{
SRoom
room
=
roomMapper
.
selectSRoomById
(
roomId
);
if
(
room
!=
null
)
{
Device
param
=
new
Device
();
Device
Dto
param
=
new
DeviceDto
();
param
.
setRoomId
(
room
.
getId
());
param
.
setDevType
(
DeviceType
.
DEVICE_0001
.
getCode
());
List
<
Device
>
list
=
deviceMapper
.
selectDeviceList
(
param
);
...
...
@@ -203,7 +204,7 @@ public class DeviceOpServiceImpl implements DeviceOpService {
// 延时执行操作
try
{
Thread
.
sleep
(
m
*
1000
);
Device
param
=
new
Device
();
Device
Dto
param
=
new
DeviceDto
();
param
.
setRoomId
(
room
.
getId
());
param
.
setDevType
(
DeviceType
.
DEVICE_0001
.
getCode
());
List
<
Device
>
list
=
deviceMapper
.
selectDeviceList
(
param
);
...
...
@@ -291,7 +292,7 @@ public class DeviceOpServiceImpl implements DeviceOpService {
String
phone
,
String
opType
)
{
SRoom
room
=
roomMapper
.
selectSRoomById
(
roomId
);
if
(
room
!=
null
)
{
Device
queryParams
=
new
Device
();
Device
Dto
queryParams
=
new
DeviceDto
();
queryParams
.
setRoomId
(
room
.
getId
());
queryParams
.
setDevType
(
DeviceType
.
DEVICE_CCEE
.
getCode
());
List
<
Device
>
list
=
deviceMapper
.
selectDeviceList
(
queryParams
);
...
...
@@ -318,7 +319,7 @@ public class DeviceOpServiceImpl implements DeviceOpService {
public
void
deleteDevicePassword
(
Long
roomId
,
String
param
,
String
phone
,
String
opType
)
{
SRoom
room
=
roomMapper
.
selectSRoomById
(
roomId
);
if
(
room
!=
null
)
{
Device
queryParams
=
new
Device
();
Device
Dto
queryParams
=
new
DeviceDto
();
queryParams
.
setRoomId
(
room
.
getId
());
queryParams
.
setDevType
(
DeviceType
.
DEVICE_CCEE
.
getCode
());
List
<
Device
>
list
=
deviceMapper
.
selectDeviceList
(
queryParams
);
...
...
share-system/src/main/java/share/system/service/impl/DeviceServiceImpl.java
View file @
4b85f56f
...
...
@@ -9,11 +9,8 @@ import share.common.utils.DateUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.common.utils.SecurityUtils
;
import
share.system.domain.SPack
;
import
share.system.domain.SRoom
;
import
share.system.domain.SStore
;
import
share.system.domain.*
;
import
share.system.mapper.DeviceMapper
;
import
share.system.domain.Device
;
import
share.system.mapper.SRoomMapper
;
import
share.system.mapper.SStoreMapper
;
import
share.system.service.DeviceService
;
...
...
@@ -51,7 +48,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
* @return 设备信息
*/
@Override
public
List
<
Device
>
selectDeviceList
(
Device
device
)
{
public
List
<
Device
>
selectDeviceList
(
Device
Dto
device
)
{
return
deviceMapper
.
selectDeviceList
(
device
);
}
...
...
share-system/src/main/java/share/system/service/impl/MqttxServiceImpl.java
View file @
4b85f56f
...
...
@@ -13,10 +13,7 @@ import org.springframework.stereotype.Service;
import
share.common.constant.MqttConstants
;
import
share.common.enums.*
;
import
share.common.utils.DateUtils
;
import
share.system.domain.Device
;
import
share.system.domain.DeviceGateway
;
import
share.system.domain.DeviceLog
;
import
share.system.domain.DeviceStatusLog
;
import
share.system.domain.*
;
import
share.system.domain.vo.MqttxVo
;
import
share.system.mapper.DeviceGatewayMapper
;
import
share.system.mapper.DeviceLogMapper
;
...
...
@@ -97,7 +94,7 @@ public class MqttxServiceImpl implements MqttxService {
public
MqttxVo
addGatewayDevice
(
String
devId
)
{
DeviceGateway
deviceGateway
=
deviceGatewayMapper
.
selectDeviceGatewayByDevId
(
devId
);
if
(
deviceGateway
!=
null
)
{
Device
device
=
new
Device
();
Device
Dto
device
=
new
DeviceDto
();
device
.
setGroup
(
deviceGateway
.
getGroup
());
List
<
Device
>
deviceList
=
deviceMapper
.
selectDeviceList
(
device
);
if
(
deviceList
.
size
()
>
0
)
{
...
...
@@ -195,7 +192,7 @@ public class MqttxServiceImpl implements MqttxService {
private
MqttxVo
openOrCloseDeviceInit
(
String
devId
,
String
phone
,
String
openType
,
String
mqttDescribe
)
{
Device
device
=
deviceMapper
.
selectDeviceByDevId
(
devId
);
if
(
device
!=
null
)
{
DeviceGateway
gatewayParam
=
new
DeviceGateway
();
DeviceGateway
Dto
gatewayParam
=
new
DeviceGatewayDto
();
gatewayParam
.
setGroup
(
device
.
getGroup
());
List
<
DeviceGateway
>
deviceGateways
=
deviceGatewayMapper
.
selectDeviceGatewayList
(
gatewayParam
);
if
(
deviceGateways
.
size
()
>
0
)
{
...
...
@@ -275,7 +272,7 @@ public class MqttxServiceImpl implements MqttxService {
String
phone
,
String
opType
,
String
mqttDescribe
)
{
Device
device
=
deviceMapper
.
selectDeviceByDevId
(
devId
);
if
(
device
!=
null
)
{
DeviceGateway
gatewayParam
=
new
DeviceGateway
();
DeviceGateway
Dto
gatewayParam
=
new
DeviceGatewayDto
();
gatewayParam
.
setGroup
(
device
.
getGroup
());
List
<
DeviceGateway
>
deviceGateways
=
deviceGatewayMapper
.
selectDeviceGatewayList
(
gatewayParam
);
if
(
deviceGateways
.
size
()
>
0
)
{
...
...
@@ -355,7 +352,7 @@ public class MqttxServiceImpl implements MqttxService {
String
phone
,
String
opType
,
String
mqttDescribe
)
{
Device
device
=
deviceMapper
.
selectDeviceByDevId
(
devId
);
if
(
device
!=
null
)
{
DeviceGateway
gatewayParam
=
new
DeviceGateway
();
DeviceGateway
Dto
gatewayParam
=
new
DeviceGatewayDto
();
gatewayParam
.
setGroup
(
device
.
getGroup
());
List
<
DeviceGateway
>
deviceGateways
=
deviceGatewayMapper
.
selectDeviceGatewayList
(
gatewayParam
);
if
(
deviceGateways
.
size
()
>
0
)
{
...
...
@@ -429,7 +426,7 @@ public class MqttxServiceImpl implements MqttxService {
String
mqttDescribe
)
{
Device
device
=
deviceMapper
.
selectDeviceByDevId
(
devId
);
if
(
device
!=
null
)
{
DeviceGateway
gatewayParam
=
new
DeviceGateway
();
DeviceGateway
Dto
gatewayParam
=
new
DeviceGatewayDto
();
gatewayParam
.
setGroup
(
device
.
getGroup
());
List
<
DeviceGateway
>
deviceGateways
=
deviceGatewayMapper
.
selectDeviceGatewayList
(
gatewayParam
);
if
(
deviceGateways
.
size
()
>
0
)
{
...
...
@@ -482,7 +479,7 @@ public class MqttxServiceImpl implements MqttxService {
String
startTime
,
String
endTime
,
String
number
)
{
Device
device
=
deviceMapper
.
selectDeviceByDevId
(
devId
);
if
(
device
!=
null
)
{
DeviceGateway
gatewayParam
=
new
DeviceGateway
();
DeviceGateway
Dto
gatewayParam
=
new
DeviceGatewayDto
();
gatewayParam
.
setGroup
(
device
.
getGroup
());
List
<
DeviceGateway
>
deviceGateways
=
deviceGatewayMapper
.
selectDeviceGatewayList
(
gatewayParam
);
if
(
deviceGateways
.
size
()
>
0
)
{
...
...
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
4b85f56f
...
...
@@ -295,7 +295,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
if
(
Objects
.
isNull
(
room
))
{
throw
new
RuntimeException
(
"房间不存在"
);
}
Device
device
=
new
Device
();
Device
Dto
device
=
new
DeviceDto
();
device
.
setRoomId
(
id
);
device
.
setDevType
(
DeviceType
.
DEVICE_CCEE
.
getCode
());
List
<
Device
>
deviceList
=
deviceService
.
selectDeviceList
(
device
);
...
...
share-system/src/main/resources/mapper/system/DeviceGatewayMapper.xml
View file @
4b85f56f
...
...
@@ -35,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from s_device_gateway
</sql>
<select
id=
"selectDeviceGatewayList"
parameterType=
"DeviceGateway"
resultMap=
"DeviceGatewayResult"
>
<select
id=
"selectDeviceGatewayList"
parameterType=
"DeviceGateway
Dto
"
resultMap=
"DeviceGatewayResult"
>
select
t1.id,
t1.dev_name,
...
...
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