Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zhmes-agecal
Project
Project
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
耿迪迪
zhmes-agecal
Commits
f8c178a3
Commit
f8c178a3
authored
Sep 16, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 给层单独设置 上电 断电 命令
parent
19078cc7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
2 deletions
+63
-2
TStoreyInfoController.java
...ehong/web/controller/equipment/TStoreyInfoController.java
+8
-0
ITStoreyInfoService.java
...n/java/com/zehong/system/service/ITStoreyInfoService.java
+2
-0
TStoreyInfoServiceImpl.java
...om/zehong/system/service/impl/TStoreyInfoServiceImpl.java
+33
-0
storey.js
zhmes-agecal-web/src/api/storey/storey.js
+8
-0
index.vue
zhmes-agecal-web/src/views/storey/index.vue
+12
-2
No files found.
zhmes-agecal-admin/src/main/java/com/zehong/web/controller/equipment/TStoreyInfoController.java
View file @
f8c178a3
...
...
@@ -72,6 +72,14 @@ public class TStoreyInfoController extends BaseController
return
tStoreyInfoService
.
powerOn
(
tStoreyInfo
);
}
/**
* 给设备上电
*/
@GetMapping
(
value
=
"/powerOutage"
)
public
AjaxResult
powerOutage
(
TStoreyInfo
tStoreyInfo
)
{
return
tStoreyInfoService
.
powerOutage
(
tStoreyInfo
);
}
/**
* 获取老化层信息详细信息
*/
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/ITStoreyInfoService.java
View file @
f8c178a3
...
...
@@ -41,6 +41,8 @@ public interface ITStoreyInfoService
public
AjaxResult
powerOn
(
TStoreyInfo
tStoreyInfo
);
public
AjaxResult
powerOutage
(
TStoreyInfo
tStoreyInfo
);
/**
* 新增老化层信息
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/TStoreyInfoServiceImpl.java
View file @
f8c178a3
...
...
@@ -169,6 +169,39 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService
return
tStoreyInfoMapper
.
queryByDepartmentId
(
fEquipmentId
);
}
/**
* 给设备断电
* @param tStoreyInfo t
* @return r
*/
@Override
public
AjaxResult
powerOutage
(
TStoreyInfo
tStoreyInfo
)
{
if
(
tStoreyInfo
.
getfEquipmentId
()
==
null
||
tStoreyInfo
.
getfStoreyCode
()
==
null
)
{
return
AjaxResult
.
error
(
"参数异常!!!"
);
}
TEquipmentInfo
tEquipmentInfo
=
equipmentInfoMapper
.
selectTEquipmentInfoById
(
tStoreyInfo
.
getfEquipmentId
());
String
registerOffset
=
tStoreyInfo
.
getfStoreyCode
().
split
(
"-"
)[
1
];
try
{
ModbusMaster
master
=
Modbus4jUtils
.
getMaster
(
tEquipmentInfo
.
getfPowerOutageIp
(),
tEquipmentInfo
.
getfPowerOutagePort
());
Boolean
aBoolean
=
Modbus4jUtils
.
readCoilStatus
(
master
,
1
,
Integer
.
parseInt
(
registerOffset
));
if
(
aBoolean
)
{
Modbus4jUtils
.
writeCoil
(
master
,
1
,
Integer
.
parseInt
(
registerOffset
),
false
);
tStoreyInfo
.
setfStatus
(
"0"
);
tStoreyInfo
.
setfAgingStartTime
(
null
);
tStoreyInfoMapper
.
updateTStoreyInfo
(
tStoreyInfo
);
}
return
AjaxResult
.
success
();
}
catch
(
ModbusInitException
|
ModbusTransportException
|
ErrorResponseException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
/**
* 给设备上电
* @param tStoreyInfo t
...
...
zhmes-agecal-web/src/api/storey/storey.js
View file @
f8c178a3
...
...
@@ -68,3 +68,11 @@ export function PowerOn(query) {
params
:
query
})
}
export
function
PowerOutage
(
query
)
{
return
request
({
url
:
'/storey/powerOutage'
,
method
:
'get'
,
params
:
query
})
}
zhmes-agecal-web/src/views/storey/index.vue
View file @
f8c178a3
...
...
@@ -175,7 +175,7 @@
<
/template
>
<
script
>
import
{
listStorey
,
getStorey
,
delStorey
,
addStorey
,
updateStorey
,
exportStorey
,
PowerOn
}
from
"@/api/storey/storey"
;
import
{
listStorey
,
getStorey
,
delStorey
,
addStorey
,
updateStorey
,
exportStorey
,
PowerOn
,
PowerOutage
}
from
"@/api/storey/storey"
;
export
default
{
name
:
"Info"
,
...
...
@@ -340,7 +340,17 @@ export default {
}
,
// 断电
handlePowerOutage
(
row
)
{
const
fIp
=
row
.
fIp
;
this
.
$confirm
(
'是否确认给设备IP为"'
+
fIp
+
'"的设备断电?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}
).
then
(
function
()
{
return
PowerOutage
(
row
);
}
).
then
(()
=>
{
this
.
getList
();
this
.
msgSuccess
(
"上电成功"
);
}
).
catch
(()
=>
{
}
);
}
,
/** 删除按钮操作 */
handleDelete
(
row
)
{
...
...
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