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
8eadab49
Commit
8eadab49
authored
Sep 16, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 批量读取 设备层状态
parent
d3c955a8
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
5 deletions
+71
-5
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
+27
-4
storey.js
zhmes-agecal-web/src/api/storey/storey.js
+7
-0
index.vue
zhmes-agecal-web/src/views/storey/index.vue
+27
-1
No files found.
zhmes-agecal-admin/src/main/java/com/zehong/web/controller/equipment/TStoreyInfoController.java
View file @
8eadab49
...
@@ -80,6 +80,14 @@ public class TStoreyInfoController extends BaseController
...
@@ -80,6 +80,14 @@ public class TStoreyInfoController extends BaseController
return
tStoreyInfoService
.
powerOutage
(
tStoreyInfo
);
return
tStoreyInfoService
.
powerOutage
(
tStoreyInfo
);
}
}
/**
* 批量读取老化柜状态
*/
@GetMapping
(
value
=
"/batchReadingCabinetStatus"
)
public
AjaxResult
batchReadingCabinetStatus
(
String
fEquipmentCode
)
{
return
tStoreyInfoService
.
batchReadingCabinetStatus
(
fEquipmentCode
);
}
/**
/**
* 获取老化层信息详细信息
* 获取老化层信息详细信息
*/
*/
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/ITStoreyInfoService.java
View file @
8eadab49
...
@@ -43,6 +43,8 @@ public interface ITStoreyInfoService
...
@@ -43,6 +43,8 @@ public interface ITStoreyInfoService
public
AjaxResult
powerOutage
(
TStoreyInfo
tStoreyInfo
);
public
AjaxResult
powerOutage
(
TStoreyInfo
tStoreyInfo
);
public
AjaxResult
batchReadingCabinetStatus
(
String
fEquipmentCode
);
/**
/**
* 新增老化层信息
* 新增老化层信息
*
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/TStoreyInfoServiceImpl.java
View file @
8eadab49
package
com
.
zehong
.
system
.
service
.
impl
;
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
com.serotonin.modbus4j.ModbusMaster
;
import
com.serotonin.modbus4j.ModbusMaster
;
import
com.serotonin.modbus4j.exception.ErrorResponseException
;
import
com.serotonin.modbus4j.exception.ErrorResponseException
;
...
@@ -169,6 +166,32 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService
...
@@ -169,6 +166,32 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService
return
tStoreyInfoMapper
.
queryByDepartmentId
(
fEquipmentId
);
return
tStoreyInfoMapper
.
queryByDepartmentId
(
fEquipmentId
);
}
}
/**
* 批量读取设备状态
* @param fEquipmentCode f
* @return r
*/
@Override
public
AjaxResult
batchReadingCabinetStatus
(
String
fEquipmentCode
)
{
TEquipmentInfo
tEquipmentInfo
=
equipmentInfoMapper
.
selectTEquipmentInfoByCode
(
fEquipmentCode
);
if
(
tEquipmentInfo
==
null
)
{
return
AjaxResult
.
error
(
"设备不存在!!!"
);
}
List
<
Integer
>
integers
=
Arrays
.
asList
(
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
);
try
{
ModbusMaster
master
=
Modbus4jUtils
.
getMaster
(
tEquipmentInfo
.
getfPowerOutageIp
(),
tEquipmentInfo
.
getfPowerOutagePort
());
Map
<
Integer
,
Object
>
integerObjectMap
=
Modbus4jUtils
.
batchReadAgingCabinetStatus
(
master
,
integers
);
return
AjaxResult
.
success
(
integerObjectMap
);
}
catch
(
ModbusInitException
|
ModbusTransportException
|
ErrorResponseException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
/**
/**
* 给设备断电
* 给设备断电
* @param tStoreyInfo t
* @param tStoreyInfo t
...
...
zhmes-agecal-web/src/api/storey/storey.js
View file @
8eadab49
...
@@ -76,3 +76,10 @@ export function PowerOutage( query) {
...
@@ -76,3 +76,10 @@ export function PowerOutage( query) {
params
:
query
params
:
query
})
})
}
}
export
function
batchReadingCabinetStatus
(
fEquipmentCode
)
{
return
request
({
url
:
'/storey/batchReadingCabinetStatus/'
+
fEquipmentCode
,
method
:
'get'
})
}
zhmes-agecal-web/src/views/storey/index.vue
View file @
8eadab49
...
@@ -54,6 +54,15 @@
...
@@ -54,6 +54,15 @@
@
click=
"handleExport"
@
click=
"handleExport"
>
导出
</el-button>
>
导出
</el-button>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-reading"
size=
"mini"
@
click=
"handleReading"
>
批量读取设备状态
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
</el-row>
...
@@ -175,7 +184,7 @@
...
@@ -175,7 +184,7 @@
<
/template
>
<
/template
>
<
script
>
<
script
>
import
{
listStorey
,
getStorey
,
delStorey
,
addStorey
,
updateStorey
,
exportStorey
,
PowerOn
,
PowerOutage
}
from
"@/api/storey/storey"
;
import
{
listStorey
,
getStorey
,
delStorey
,
addStorey
,
updateStorey
,
exportStorey
,
PowerOn
,
PowerOutage
,
batchReadingCabinetStatus
}
from
"@/api/storey/storey"
;
export
default
{
export
default
{
name
:
"Info"
,
name
:
"Info"
,
...
@@ -366,6 +375,23 @@ export default {
...
@@ -366,6 +375,23 @@ export default {
this
.
msgSuccess
(
"删除成功"
);
this
.
msgSuccess
(
"删除成功"
);
}
).
catch
(()
=>
{
}
);
}
).
catch
(()
=>
{
}
);
}
,
}
,
handleReading
()
{
this
.
$prompt
(
'请输入老化柜编号'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
}
).
then
(({
value
}
)
=>
{
batchReadingCabinetStatus
(
value
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
msgSuccess
(
"msg = "
+
response
.
data
);
}
}
)
}
).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'取消输入'
}
);
}
);
}
,
/** 导出按钮操作 */
/** 导出按钮操作 */
handleExport
()
{
handleExport
()
{
const
queryParams
=
this
.
queryParams
;
const
queryParams
=
this
.
queryParams
;
...
...
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