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
bdce2596
Commit
bdce2596
authored
Nov 30, 2023
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备操作枚举代码
parent
74b5e660
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
24 deletions
+18
-24
DeviceOpServiceImpl.java
...n/java/share/system/service/impl/DeviceOpServiceImpl.java
+1
-1
MqttxServiceImpl.java
...main/java/share/system/service/impl/MqttxServiceImpl.java
+17
-23
No files found.
share-system/src/main/java/share/system/service/impl/DeviceOpServiceImpl.java
View file @
bdce2596
...
...
@@ -61,7 +61,7 @@ public class DeviceOpServiceImpl implements DeviceOpService {
}
if
(
DeviceType
.
DEVICE_0001
.
getCode
().
equals
(
device
.
getDevType
()))
{
// 取电开关
this
.
deviceOpInit
(
device
.
getDevId
(),
deviceParam
.
getPhone
(),
OpTypeEnum
.
GET_ELECTRIC
.
getCode
(),
true
,
2
L
);
this
.
deviceOpInit
(
device
.
getDevId
(),
deviceParam
.
getPhone
(),
OpTypeEnum
.
GET_ELECTRIC
.
getCode
(),
true
,
3
L
);
}
}
...
...
share-system/src/main/java/share/system/service/impl/MqttxServiceImpl.java
View file @
bdce2596
...
...
@@ -12,6 +12,7 @@ import share.common.constant.MqttConstants;
import
share.common.enums.MqttOpType
;
import
share.common.enums.MqttOpenType
;
import
share.common.enums.MqttReportType
;
import
share.common.enums.OpTypeEnum
;
import
share.common.utils.DateUtils
;
import
share.system.domain.Device
;
import
share.system.domain.DeviceGateway
;
...
...
@@ -153,29 +154,22 @@ public class MqttxServiceImpl implements MqttxService {
@Override
public
MqttxVo
openOrCloseDevice
(
String
devId
,
String
phone
,
String
opType
)
{
MqttxVo
mqttxVo
=
null
;
switch
(
opType
)
{
case
"10"
:
// 开锁
mqttxVo
=
this
.
openOrCloseDeviceInit
(
devId
,
phone
,
MqttOpenType
.
OPEN
.
getCode
(),
MqttConstants
.
MQTT_DESCRIBE_DEVICE_OPEN
);
break
;
case
"20"
:
// 取电
mqttxVo
=
this
.
openOrCloseDeviceInit
(
devId
,
phone
,
MqttOpenType
.
OPEN
.
getCode
(),
MqttConstants
.
MQTT_DESCRIBE_DEVICE_ELECTRICITY_INTAKE
);
break
;
case
"30"
:
// 锁门
mqttxVo
=
this
.
openOrCloseDeviceInit
(
devId
,
phone
,
MqttOpenType
.
CLOSE
.
getCode
(),
MqttConstants
.
MQTT_DESCRIBE_DEVICE_CLOSE
);
break
;
case
"40"
:
// 断电
mqttxVo
=
this
.
openOrCloseDeviceInit
(
devId
,
phone
,
MqttOpenType
.
CLOSE
.
getCode
(),
MqttConstants
.
MQTT_DESCRIBE_DEVICE_ELECTRICITY_CLOSE
);
break
;
default
:
break
;
if
(
OpTypeEnum
.
OPEN_DOOR
.
getCode
().
equals
(
opType
))
{
// 开锁
mqttxVo
=
this
.
openOrCloseDeviceInit
(
devId
,
phone
,
MqttOpenType
.
OPEN
.
getCode
(),
MqttConstants
.
MQTT_DESCRIBE_DEVICE_OPEN
);
}
else
if
(
OpTypeEnum
.
GET_ELECTRIC
.
getCode
().
equals
(
opType
))
{
// 取电
mqttxVo
=
this
.
openOrCloseDeviceInit
(
devId
,
phone
,
MqttOpenType
.
OPEN
.
getCode
(),
MqttConstants
.
MQTT_DESCRIBE_DEVICE_ELECTRICITY_INTAKE
);
}
else
if
(
OpTypeEnum
.
LOCK_DOOR
.
getCode
().
equals
(
opType
))
{
// 锁门
mqttxVo
=
this
.
openOrCloseDeviceInit
(
devId
,
phone
,
MqttOpenType
.
CLOSE
.
getCode
(),
MqttConstants
.
MQTT_DESCRIBE_DEVICE_CLOSE
);
}
else
if
(
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
().
equals
(
opType
))
{
// 断电
mqttxVo
=
this
.
openOrCloseDeviceInit
(
devId
,
phone
,
MqttOpenType
.
CLOSE
.
getCode
(),
MqttConstants
.
MQTT_DESCRIBE_DEVICE_ELECTRICITY_CLOSE
);
}
return
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