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
4dbce8d7
Commit
4dbce8d7
authored
Sep 16, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 给层单独设置 上电 断电 命令
parent
c189bebc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
1 deletion
+94
-1
TStoreyInfoController.java
...ehong/web/controller/equipment/TStoreyInfoController.java
+8
-0
ITStoreyInfoService.java
...n/java/com/zehong/system/service/ITStoreyInfoService.java
+4
-0
TStoreyInfoServiceImpl.java
...om/zehong/system/service/impl/TStoreyInfoServiceImpl.java
+40
-0
storey.js
zhmes-agecal-web/src/api/storey/storey.js
+9
-0
index.vue
zhmes-agecal-web/src/views/storey/index.vue
+33
-1
No files found.
zhmes-agecal-admin/src/main/java/com/zehong/web/controller/equipment/TStoreyInfoController.java
View file @
4dbce8d7
...
...
@@ -64,6 +64,14 @@ public class TStoreyInfoController extends BaseController
return
AjaxResult
.
success
(
tStoreyInfoService
.
queryByDepartmentId
(
fEquipmentId
));
}
/**
* 给设备上电
*/
@GetMapping
(
value
=
"/powerOn"
)
public
AjaxResult
powerOn
(
TStoreyInfo
tStoreyInfo
)
{
return
tStoreyInfoService
.
powerOn
(
tStoreyInfo
);
}
/**
* 获取老化层信息详细信息
*/
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/ITStoreyInfoService.java
View file @
4dbce8d7
package
com
.
zehong
.
system
.
service
;
import
java.util.List
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.system.domain.TStoreyInfo
;
/**
...
...
@@ -37,6 +39,8 @@ public interface ITStoreyInfoService
public
List
<
TStoreyInfo
>
queryByDepartmentId
(
Long
fDepartmentId
);
public
AjaxResult
powerOn
(
TStoreyInfo
tStoreyInfo
);
/**
* 新增老化层信息
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/TStoreyInfoServiceImpl.java
View file @
4dbce8d7
...
...
@@ -5,10 +5,16 @@ import java.util.Arrays;
import
java.util.Date
;
import
java.util.List
;
import
com.serotonin.modbus4j.ModbusMaster
;
import
com.serotonin.modbus4j.exception.ErrorResponseException
;
import
com.serotonin.modbus4j.exception.ModbusInitException
;
import
com.serotonin.modbus4j.exception.ModbusTransportException
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.system.domain.TEquipmentInfo
;
import
com.zehong.system.mapper.TEquipmentInfoMapper
;
import
com.zehong.system.modbus.util.Modbus4jUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TStoreyInfoMapper
;
...
...
@@ -163,6 +169,40 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService
return
tStoreyInfoMapper
.
queryByDepartmentId
(
fEquipmentId
);
}
/**
* 给设备上电
* @param tStoreyInfo t
* @return r
*/
@Override
public
AjaxResult
powerOn
(
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
),
true
);
tStoreyInfo
.
setfStatus
(
"1"
);
tStoreyInfo
.
setfAgingStartTime
(
new
Date
());
tStoreyInfoMapper
.
updateTStoreyInfo
(
tStoreyInfo
);
}
return
AjaxResult
.
success
();
}
catch
(
ModbusInitException
|
ModbusTransportException
|
ErrorResponseException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
/**
* 新增老化层信息
*
...
...
zhmes-agecal-web/src/api/storey/storey.js
View file @
4dbce8d7
...
...
@@ -59,3 +59,12 @@ export function exportStorey(query) {
params
:
query
})
}
export
function
PowerOn
(
query
)
{
return
request
({
url
:
'/storey/PowerOn/'
,
method
:
'get'
,
params
:
query
})
}
zhmes-agecal-web/src/views/storey/index.vue
View file @
4dbce8d7
...
...
@@ -100,6 +100,20 @@
icon
=
"el-icon-delete"
@
click
=
"handleDelete(scope.row)"
>
删除
<
/el-button
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-delete"
@
click
=
"handlePowerOn(scope.row)"
>
上电
<
/el-button
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-delete"
@
click
=
"handlePowerOutage(scope.row)"
>
断电
<
/el-button
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
...
...
@@ -161,7 +175,7 @@
<
/template
>
<
script
>
import
{
listStorey
,
getStorey
,
delStorey
,
addStorey
,
updateStorey
,
exportStorey
}
from
"@/api/storey/storey"
;
import
{
listStorey
,
getStorey
,
delStorey
,
addStorey
,
updateStorey
,
exportStorey
,
PowerOn
}
from
"@/api/storey/storey"
;
export
default
{
name
:
"Info"
,
...
...
@@ -309,6 +323,24 @@ export default {
}
}
}
);
}
,
//上电
handlePowerOn
(
row
)
{
const
fIp
=
row
.
fIp
;
this
.
$confirm
(
'是否确认给设备IP为"'
+
fIp
+
'"的设备上电?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}
).
then
(
function
()
{
return
PowerOn
(
row
);
}
).
then
(()
=>
{
this
.
getList
();
this
.
msgSuccess
(
"上电成功"
);
}
).
catch
(()
=>
{
}
);
}
,
// 断电
handlePowerOutage
(
row
)
{
}
,
/** 删除按钮操作 */
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