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
ae624c7a
Commit
ae624c7a
authored
Nov 09, 2023
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备网关代码
parent
eab4e680
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
0 deletions
+73
-0
DeviceGatewayController.java
.../share/web/controller/system/DeviceGatewayController.java
+26
-0
DeviceOpService.java
...m/src/main/java/share/system/service/DeviceOpService.java
+15
-0
DeviceOpServiceImpl.java
...n/java/share/system/service/impl/DeviceOpServiceImpl.java
+32
-0
No files found.
share-admin/src/main/java/share/web/controller/system/DeviceGatewayController.java
View file @
ae624c7a
...
...
@@ -20,6 +20,7 @@ import share.system.domain.DeviceGateway;
import
share.system.service.DeviceGatewayService
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.core.page.TableDataInfo
;
import
share.system.service.DeviceOpService
;
/**
* 设备网关信息Controller
...
...
@@ -33,6 +34,8 @@ public class DeviceGatewayController extends BaseController
{
@Autowired
private
DeviceGatewayService
deviceGatewayService
;
@Autowired
private
DeviceOpService
deviceOpService
;
/**
* 查询设备网关信息列表
...
...
@@ -102,5 +105,28 @@ public class DeviceGatewayController extends BaseController
return
toAjax
(
deviceGatewayService
.
deleteDeviceGatewayByIds
(
ids
));
}
/**
* 清除网关设备列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:gateway:edit')"
)
@Log
(
title
=
"设备网关信息"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
value
=
"/clearGatewayDevice"
)
public
AjaxResult
clearGatewayDevice
(
@RequestBody
DeviceGateway
deviceGateway
)
{
deviceOpService
.
clearGatewayDevice
(
deviceGateway
.
getDevId
());
return
toAjax
(
true
);
}
/**
* 绑定网关设备列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:gateway:edit')"
)
@Log
(
title
=
"设备网关信息"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
value
=
"/addGatewayDevice"
)
public
AjaxResult
addGatewayDevice
(
@RequestBody
DeviceGateway
deviceGateway
)
{
deviceOpService
.
addGatewayDevice
(
deviceGateway
.
getDevId
());
return
toAjax
(
true
);
}
}
share-system/src/main/java/share/system/service/DeviceOpService.java
View file @
ae624c7a
...
...
@@ -22,4 +22,19 @@ public interface DeviceOpService {
* @param phone 操作用户
*/
void
openDoor
(
Long
roomId
,
String
phone
);
/**
* 清除网关锁id列表
* @param devId 网关设备dev_id
* @return
*/
void
clearGatewayDevice
(
String
devId
);
/**
* 下发组号、锁id/取电开关id列表
* @param devId 网关设备dev_id
* @return
*/
void
addGatewayDevice
(
String
devId
);
}
share-system/src/main/java/share/system/service/impl/DeviceOpServiceImpl.java
View file @
ae624c7a
...
...
@@ -94,4 +94,36 @@ public class DeviceOpServiceImpl implements DeviceOpService {
deviceLogService
.
addDeviceLog
(
mqttxVo
);
}
/**
* 清除网关锁id列表
* @param devId 网关设备dev_id
* @return
*/
@Override
public
void
clearGatewayDevice
(
String
devId
)
{
// 获取mqtt的topic、payload
MqttxVo
mqttxVo
=
mqttxService
.
clearGatewayDevice
(
devId
);
// 发送mqtt消息
mqttGatewayComponent
.
sendToMqtt
(
mqttxVo
.
getTopic
(),
0
,
mqttxVo
.
getPayload
());
// 写日志记录
deviceLogService
.
addDeviceLog
(
mqttxVo
);
}
/**
* 下发组号、锁id/取电开关id列表
* @param devId 网关设备dev_id
* @return
*/
@Override
public
void
addGatewayDevice
(
String
devId
)
{
// 获取mqtt的topic、payload
MqttxVo
mqttxVo
=
mqttxService
.
addGatewayDevice
(
devId
);
// 发送mqtt消息
mqttGatewayComponent
.
sendToMqtt
(
mqttxVo
.
getTopic
(),
0
,
mqttxVo
.
getPayload
());
// 写日志记录
deviceLogService
.
addDeviceLog
(
mqttxVo
);
}
}
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