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
0413cc73
Commit
0413cc73
authored
Nov 12, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 报警记录界面实现
2 在所有设备上下电的基础上,增加指定柜子上下电实现 3 实时数据界面增加位置编号字段,位置编号是在托盘上用记号笔记录的编号。 4 解绑时判断 如果都解绑了则更新托盘状态
parent
e42f2e1c
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
812 additions
and
286 deletions
+812
-286
TEquipmentAlarmDataController.java
...b/controller/equipment/TEquipmentAlarmDataController.java
+32
-0
TStoreyInfoController.java
...ehong/web/controller/equipment/TStoreyInfoController.java
+23
-0
PalletDeviceBindingMapper.java
...a/com/zehong/system/mapper/PalletDeviceBindingMapper.java
+2
-0
TEquipmentInfoMapper.java
...n/java/com/zehong/system/mapper/TEquipmentInfoMapper.java
+4
-0
ITStoreyInfoService.java
...n/java/com/zehong/system/service/ITStoreyInfoService.java
+5
-0
PalletDeviceBindingServiceImpl.java
...g/system/service/impl/PalletDeviceBindingServiceImpl.java
+7
-0
TStoreyInfoServiceImpl.java
...om/zehong/system/service/impl/TStoreyInfoServiceImpl.java
+337
-93
DeviceTaskScheduler.java
...main/java/com/zehong/system/task/DeviceTaskScheduler.java
+5
-3
PalletDeviceBindingMapper.xml
...ain/resources/mapper/system/PalletDeviceBindingMapper.xml
+6
-0
TEquipmentAlarmDataMapper.xml
...ain/resources/mapper/system/TEquipmentAlarmDataMapper.xml
+2
-4
TEquipmentInfoMapper.xml
...src/main/resources/mapper/system/TEquipmentInfoMapper.xml
+11
-1
equipmentAlarmData.js
...ecal-web/src/api/equipmentAlarmData/equipmentAlarmData.js
+1
-44
storey.js
zhmes-agecal-web/src/api/storey/storey.js
+19
-0
index.vue
zhmes-agecal-web/src/views/equipmentAlarmData/index.vue
+137
-0
RealTimeData.vue
...s-agecal-web/src/views/screen/components/RealTimeData.vue
+1
-1
RoboticArm.vue
zhmes-agecal-web/src/views/screen/components/RoboticArm.vue
+1
-1
index.vue
zhmes-agecal-web/src/views/storey/index.vue
+23
-132
index.vue
zhmes-agecal-web/src/views/testScheduledTasks/index.vue
+196
-7
No files found.
zhmes-agecal-admin/src/main/java/com/zehong/web/controller/equipment/TEquipmentAlarmDataController.java
0 → 100644
View file @
0413cc73
package
com
.
zehong
.
web
.
controller
.
equipment
;
import
com.zehong.common.core.controller.BaseController
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.core.page.TableDataInfo
;
import
com.zehong.system.domain.TEquipmentAlarmData
;
import
com.zehong.system.service.ITEquipmentAlarmDataService
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @author lenovo
* @date 2025/11/12
* @description 报警历史记录
*/
@RestController
@RequestMapping
(
"/equipmentAlarmData/record"
)
public
class
TEquipmentAlarmDataController
extends
BaseController
{
@Resource
private
ITEquipmentAlarmDataService
tEquipmentAlarmDataService
;
@RequestMapping
(
"/list"
)
public
TableDataInfo
list
(
TEquipmentAlarmData
tEquipmentAlarmData
)
{
startPage
();
List
<
TEquipmentAlarmData
>
list
=
tEquipmentAlarmDataService
.
selectTEquipmentAlarmDataList
(
tEquipmentAlarmData
);
return
getDataTable
(
list
);
}
}
zhmes-agecal-admin/src/main/java/com/zehong/web/controller/equipment/TStoreyInfoController.java
View file @
0413cc73
...
...
@@ -119,6 +119,21 @@ public class TStoreyInfoController extends BaseController
public
AjaxResult
powerOffAllStore
()
{
return
tStoreyInfoService
.
powerOffAllStore
();
}
/**
* 指定设备下电 逗号分隔
*/
@GetMapping
(
value
=
"/designatedDevicePowerOff/{equipmentCode}"
)
public
AjaxResult
designatedDevicePowerOff
(
@PathVariable
(
"equipmentCode"
)
String
equipmentCode
)
{
return
tStoreyInfoService
.
designatedDevicePowerOff
(
equipmentCode
);
}
/**
* 批量扫描并开始老化
*/
@GetMapping
(
value
=
"/scanAndStartAgingAllCabinetLayers"
)
public
AjaxResult
scanAndStartAgingAllCabinetLayers
()
{
return
tStoreyInfoService
.
scanAndStartAgingAllCabinetLayers
();
}
/**
* 给所有设备上电
...
...
@@ -128,6 +143,14 @@ public class TStoreyInfoController extends BaseController
return
tStoreyInfoService
.
powerOnAllStore
();
}
/**
* 指定设备上电 逗号分隔
*/
@GetMapping
(
value
=
"/designatedDevicePowerOn/{equipmentCode}"
)
public
AjaxResult
designatedDevicePowerOn
(
@PathVariable
(
"equipmentCode"
)
String
equipmentCode
)
{
return
tStoreyInfoService
.
designatedDevicePowerOn
(
equipmentCode
);
}
/**
* 获取老化层信息详细信息
*/
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/mapper/PalletDeviceBindingMapper.java
View file @
0413cc73
...
...
@@ -42,6 +42,8 @@ public interface PalletDeviceBindingMapper
public
int
countByTrayId
(
Long
trayId
);
public
int
countDeviceByTrayId
(
Long
trayId
);
/**
* 新增托盘绑定的设备列
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/mapper/TEquipmentInfoMapper.java
View file @
0413cc73
...
...
@@ -37,6 +37,10 @@ public interface TEquipmentInfoMapper
*/
public
List
<
TEquipmentInfo
>
selectTEquipmentList
(
@Param
(
"types"
)
List
<
String
>
types
);
public
List
<
TEquipmentInfo
>
getAll
();
public
List
<
TEquipmentInfo
>
getAllByEquipmentCodeList
(
@Param
(
"equipmentCodes"
)
List
<
String
>
equipmentCodes
);
/**
* 新增生产设备信息
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/ITStoreyInfoService.java
View file @
0413cc73
...
...
@@ -21,6 +21,9 @@ public interface ITStoreyInfoService
*/
public
TStoreyInfo
selectTStoreyInfoById
(
Long
fStoreyId
);
public
AjaxResult
designatedDevicePowerOn
(
String
equipmentCode
);
public
AjaxResult
designatedDevicePowerOff
(
String
equipmentCode
);
/**
* 查询老化层信息
*
...
...
@@ -49,6 +52,8 @@ public interface ITStoreyInfoService
public
AjaxResult
powerOffAllStore
();
public
AjaxResult
scanAndStartAgingAllCabinetLayers
();
public
AjaxResult
powerOnAllStore
();
public
AjaxResult
handleFeeding
(
String
command
);
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/PalletDeviceBindingServiceImpl.java
View file @
0413cc73
...
...
@@ -234,6 +234,13 @@ public class PalletDeviceBindingServiceImpl implements IPalletDeviceBindingServi
int
i
=
palletDeviceBindingMapper
.
unbindDevice
(
palletDeviceBindingDb
.
getPalletDeviceBindingId
());
if
(
i
>
0
)
{
// 成功之后 判断 是否还有设备,如果没有设备的话则 初始化托盘状态
int
count
=
palletDeviceBindingMapper
.
countDeviceByTrayId
(
palletDeviceBindingDb
.
getTrayId
());
if
(
count
==
0
)
{
tTrayInfoMapper
.
initStatusByTrayId
(
palletDeviceBindingDb
.
getTrayId
());
}
return
AjaxResult
.
success
();
}
return
AjaxResult
.
error
();
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/TStoreyInfoServiceImpl.java
View file @
0413cc73
...
...
@@ -7,25 +7,26 @@ 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.TEquipmentAlarmData
;
import
com.zehong.system.domain.TEquipmentInfo
;
import
com.zehong.system.domain.TStoreyInfo
;
import
com.zehong.system.domain.TTrayInfo
;
import
com.zehong.system.mapper.TEquipmentInfoMapper
;
import
com.zehong.system.mapper.TStoreyInfoMapper
;
import
com.zehong.system.mapper.TTrayInfoMapper
;
import
com.zehong.system.modbus.business.DeviceStatusReaderAndTimeSetter
;
import
com.zehong.system.modbus.handler.ModbusResultHandler
;
import
com.zehong.system.modbus.util.Modbus4jUtils
;
import
com.zehong.system.service.IRobotArmCommandService
;
import
com.zehong.system.service.ITEquipmentAlarmDataService
;
import
com.zehong.system.service.ITEquipmentInfoService
;
import
com.zehong.system.service.ITStoreyInfoService
;
import
com.zehong.system.service.websocket.RobotArmWebSocketHandler
;
import
com.zehong.system.service.websocket.AgingCabinetWebSocketHandler
;
import
com.zehong.system.task.CheckPowerOnCommandEvent
;
import
com.zehong.system.task.DeviceTaskScheduler
;
import
org.quartz.JobKey
;
import
org.quartz.SchedulerException
;
import
org.quartz.TriggerKey
;
import
org.quartz.*
;
import
org.quartz.impl.matchers.GroupMatcher
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.
beans.factory.annotation.Autowired
;
import
org.springframework.
context.ApplicationEventPublisher
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -35,6 +36,9 @@ import java.util.concurrent.ExecutorService;
import
java.util.concurrent.Executors
;
import
java.util.stream.Collectors
;
import
static
com
.
zehong
.
system
.
task
.
DeviceTaskScheduler
.
JOB_GROUP
;
import
static
com
.
zehong
.
system
.
task
.
DeviceTaskScheduler
.
TRIGGER_GROUP
;
/**
* 老化层信息Service业务层处理
*
...
...
@@ -60,6 +64,15 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService
@Resource
private
DeviceTaskScheduler
deviceTaskScheduler
;
@Resource
private
ITEquipmentAlarmDataService
tEquipmentAlarmDataService
;
@Resource
private
Scheduler
scheduler
;
@Resource
private
ITEquipmentInfoService
tEquipmentInfoService
;
private
final
ExecutorService
executor
=
Executors
.
newFixedThreadPool
(
10
);
@Resource
private
ApplicationEventPublisher
eventPublisher
;
// 新增事件发布器
private
final
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
10
);
/**
...
...
@@ -74,6 +87,169 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService
return
tStoreyInfoMapper
.
selectTStoreyInfoById
(
fStoreyId
);
}
/**
* 指定设备断电
*
* @param equipmentCode aging cabinet
* @return aging cabinet
*/
@Override
public
AjaxResult
designatedDevicePowerOff
(
String
equipmentCode
)
{
// 1.1 校验参数
List
<
TEquipmentInfo
>
equipmentInfos
=
checkEquipmentCodesReturnEquipmentInfos
(
equipmentCode
);
// 1.2 批量上电
powerOffToEquipments
(
equipmentInfos
);
return
AjaxResult
.
success
();
}
/**
* 指定设备上电
* @param equipmentCode e
* @return r
*/
@Override
public
AjaxResult
designatedDevicePowerOn
(
String
equipmentCode
)
{
// 1.1 校验参数
List
<
TEquipmentInfo
>
equipmentInfos
=
checkEquipmentCodesReturnEquipmentInfos
(
equipmentCode
);
// 1.2 批量上电
powerOnToEquipments
(
equipmentInfos
);
return
AjaxResult
.
success
();
}
/**
* 校验参数
* @return r r
*/
private
List
<
TEquipmentInfo
>
checkEquipmentCodesReturnEquipmentInfos
(
String
equipmentCodes
)
{
if
(
StringUtils
.
isBlank
(
equipmentCodes
))
{
throw
new
RuntimeException
(
"设备编号不能为空"
);
}
String
[]
split
=
equipmentCodes
.
split
(
"[,,]"
);
if
(
split
.
length
==
0
)
{
throw
new
RuntimeException
(
"设备编号格式错误"
);
}
List
<
String
>
equipmentCodeList
=
Arrays
.
stream
(
split
).
filter
(
StringUtils:
:
isNotBlank
).
collect
(
Collectors
.
toList
());
List
<
TEquipmentInfo
>
equipmentInfos
=
equipmentInfoMapper
.
getAllByEquipmentCodeList
(
equipmentCodeList
);
if
(
equipmentInfos
.
size
()
==
0
)
{
throw
new
RuntimeException
(
"设备不存在"
);
}
return
equipmentInfos
;
}
/**
* 批量断电
* @param equipmentInfos e
* @return r r
*/
private
void
powerOffToEquipments
(
List
<
TEquipmentInfo
>
equipmentInfos
)
{
// 收集所有异步任务
List
<
CompletableFuture
<
TEquipmentInfo
>>
futures
=
equipmentInfos
.
stream
()
.
map
(
equipmentInfo
->
CompletableFuture
.
supplyAsync
(()
->
{
ModbusMaster
master
=
null
;
List
<
Integer
>
registerOffsets
=
Arrays
.
asList
(
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
);
try
{
master
=
Modbus4jUtils
.
getMaster
(
equipmentInfo
.
getfPowerOutageIp
(),
equipmentInfo
.
getfPowerOutagePort
());
for
(
Integer
registerOffset
:
registerOffsets
)
{
Boolean
aBoolean
=
Modbus4jUtils
.
readCoilStatus
(
master
,
1
,
registerOffset
);
if
(
aBoolean
)
{
Modbus4jUtils
.
writeCoil
(
master
,
1
,
registerOffset
,
false
);
}
}
}
catch
(
ModbusInitException
|
ModbusTransportException
|
ErrorResponseException
e
)
{
log
.
info
(
"equipmentinfo -> ip = {} port = {}"
+
equipmentInfo
.
getfPowerOutageIp
(),
equipmentInfo
.
getfPowerOutagePort
());
throw
new
RuntimeException
(
e
);
}
finally
{
// 建议在这里关闭master连接,避免资源泄露
if
(
master
!=
null
)
{
try
{
master
.
destroy
();
}
catch
(
Exception
e
)
{
// 处理关闭异常
}
}
}
return
equipmentInfo
;
},
executorService
))
.
collect
(
Collectors
.
toList
());
// 等待所有异步任务完成
CompletableFuture
<
Void
>
allFutures
=
CompletableFuture
.
allOf
(
futures
.
toArray
(
new
CompletableFuture
[
0
])
);
// 所有任务完成后执行数据库更新
allFutures
.
thenRun
(()
->
{
TStoreyInfo
tStoreyInfo
=
new
TStoreyInfo
();
tStoreyInfo
.
setfStatus
(
"0"
);
tStoreyInfo
.
setfAgingStartTime
(
null
);
tStoreyInfoMapper
.
updateAllStatusAndAgingStartTime
(
tStoreyInfo
);
}).
join
();
// 阻塞等待所有操作完成
}
/**
* 批量上电
* @return r r
*/
private
void
powerOnToEquipments
(
List
<
TEquipmentInfo
>
equipmentInfos
)
{
// 收集所有异步任务
List
<
CompletableFuture
<
TEquipmentInfo
>>
futures
=
equipmentInfos
.
stream
()
.
map
(
equipmentInfo
->
CompletableFuture
.
supplyAsync
(()
->
{
ModbusMaster
master
=
null
;
List
<
Integer
>
registerOffsets
=
Arrays
.
asList
(
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
);
try
{
master
=
Modbus4jUtils
.
getMaster
(
equipmentInfo
.
getfPowerOutageIp
(),
equipmentInfo
.
getfPowerOutagePort
());
for
(
Integer
registerOffset
:
registerOffsets
)
{
Boolean
aBoolean
=
Modbus4jUtils
.
readCoilStatus
(
master
,
1
,
registerOffset
);
if
(!
aBoolean
)
{
Modbus4jUtils
.
writeCoil
(
master
,
1
,
registerOffset
,
true
);
}
}
}
catch
(
ModbusInitException
|
ModbusTransportException
|
ErrorResponseException
e
)
{
log
.
info
(
"equipmentinfo -> ip = {} port = {}"
+
equipmentInfo
.
getfPowerOutageIp
(),
equipmentInfo
.
getfPowerOutagePort
());
throw
new
RuntimeException
(
e
);
}
finally
{
// 建议在这里关闭master连接,避免资源泄露
if
(
master
!=
null
)
{
try
{
master
.
destroy
();
}
catch
(
Exception
e
)
{
// 处理关闭异常
}
}
}
return
equipmentInfo
;
},
executorService
))
.
collect
(
Collectors
.
toList
());
// 等待所有异步任务完成
CompletableFuture
<
Void
>
allFutures
=
CompletableFuture
.
allOf
(
futures
.
toArray
(
new
CompletableFuture
[
0
])
);
// 所有任务完成后执行数据库更新
allFutures
.
thenRun
(()
->
{
TStoreyInfo
tStoreyInfo
=
new
TStoreyInfo
();
tStoreyInfo
.
setfStatus
(
"1"
);
// 先不给 老化开始时间 只 上电
// tStoreyInfo.setfAgingStartTime(DateUtils.getNowDate());
tStoreyInfoMapper
.
updateAllStatusAndAgingStartTime
(
tStoreyInfo
);
}).
join
();
// 阻塞等待所有操作完成
}
/**
* 更新南边指令
*/
...
...
@@ -193,58 +369,168 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService
return
tStoreyInfoMapper
.
queryByDepartmentId
(
fEquipmentId
);
}
public
AjaxResult
powerOffAllStore
()
{
/**
* 批量扫描所有老化柜的层数据记录系统开始老化
* @return r
*/
@Override
public
AjaxResult
scanAndStartAgingAllCabinetLayers
()
{
List
<
String
>
types
=
Arrays
.
asList
(
"1"
,
"2"
);
List
<
TEquipmentInfo
>
equipmentInfos
=
equipmentInfoMapper
.
selectTEquipmentList
(
types
);
List
<
TEquipmentInfo
>
equipmentInfos
=
equipmentInfoMapper
.
getAll
();
if
(
equipmentInfos
.
size
()
==
0
)
{
return
AjaxResult
.
error
(
"无设备信息!!!"
);
}
// 收集所有异步任务
List
<
CompletableFuture
<
TEquipmentInfo
>>
futures
=
equipmentInfos
.
stream
()
.
map
(
equipmentInfo
->
CompletableFuture
.
supplyAsync
(()
->
{
ModbusMaster
master
=
null
;
List
<
Integer
>
registerOffsets
=
Arrays
.
asList
(
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
);
try
{
master
=
Modbus4jUtils
.
getMaster
(
equipmentInfo
.
getfPowerOutageIp
(),
equipmentInfo
.
getfPowerOutagePort
());
// 先清理所有定时任务和触发器
Set
<
JobKey
>
jobKeys
=
scheduler
.
getJobKeys
(
GroupMatcher
.
jobGroupEquals
(
JOB_GROUP
));
List
<
JobKey
>
jobKeysList
=
new
ArrayList
<>(
jobKeys
);
// 清理触发器
Set
<
TriggerKey
>
triggerKeys
=
scheduler
.
getTriggerKeys
(
GroupMatcher
.
triggerGroupEquals
(
TRIGGER_GROUP
));
List
<
TriggerKey
>
triggerKeysList
=
new
ArrayList
<>(
triggerKeys
);
scheduler
.
deleteJobs
(
jobKeysList
);
scheduler
.
unscheduleJobs
(
triggerKeysList
);
startScanAllCabinetLayers
(
equipmentInfos
);
}
catch
(
SchedulerException
e
)
{
throw
new
RuntimeException
(
e
);
}
for
(
Integer
registerOffset
:
registerOffsets
)
{
Boolean
aBoolean
=
Modbus4jUtils
.
readCoilStatus
(
master
,
1
,
registerOffset
);
if
(
aBoolean
)
{
Modbus4jUtils
.
writeCoil
(
master
,
1
,
registerOffset
,
false
);
return
null
;
}
/**
* 开始扫描所有老化柜的层数据记录系统开始老化
*/
private
void
startScanAllCabinetLayers
(
List
<
TEquipmentInfo
>
equipmentInfos
)
{
TEquipmentAlarmData
alarmData
=
new
TEquipmentAlarmData
();
List
<
CompletableFuture
<
TEquipmentInfo
>>
futures
=
equipmentInfos
.
stream
().
map
(
equipmentInfo
->
CompletableFuture
.
supplyAsync
(()
->
{
ModbusMaster
master
=
null
;
// 10 层
List
<
Integer
>
registerOffsets
=
Arrays
.
asList
(
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
);
try
{
master
=
Modbus4jUtils
.
getMaster
(
equipmentInfo
.
getfIp
(),
equipmentInfo
.
getfPort
());
Map
<
Integer
,
Object
>
integerObjectMap
=
Modbus4jUtils
.
batchReadAgingCabinetStatus
(
master
,
registerOffsets
);
equipmentInfo
.
setRegisterValues
(
integerObjectMap
);
}
catch
(
ModbusInitException
e
)
{
// 记录异常数据
alarmData
.
setfAlarmType
(
"01"
);
//01.老化柜 02.机械臂 03.老化层 04.点位
alarmData
.
setfEquipmentCode
(
equipmentInfo
.
getfEquipmentCode
());
alarmData
.
setfAlarmData
(
"定时任务巡检:Modbus初始化失败"
);
tEquipmentAlarmDataService
.
insertTEquipmentAlarmData
(
alarmData
);
// 更新老化柜状态(“0”空闲,“1”运行,“2”故障)
equipmentInfo
.
setfStatus
(
"2"
);
equipmentInfo
.
setErrorReason
(
"定时任务巡检:Modbus初始化失败"
);
equipmentInfo
.
setRegisterValues
(
new
HashMap
<>());
// 返回结果
return
equipmentInfo
;
// 层有错误返回 柜可能连不上也在这个报错里面
}
catch
(
ModbusTransportException
e
)
{
// 网线没插好通讯不上
if
(
e
.
getMessage
().
equals
(
"java.net.SocketTimeoutException: connect timed out"
))
{
// 记录异常数据
alarmData
.
setfAlarmType
(
"01"
);
//01.老化柜 02.机械臂 03.老化层 04.点位
alarmData
.
setfEquipmentCode
(
equipmentInfo
.
getfEquipmentCode
());
alarmData
.
setfAlarmData
(
"定时任务巡检:老化柜网线没插好"
);
equipmentInfo
.
setErrorReason
(
"定时任务巡检:老化柜网线没插好"
);
// 线接错误
}
else
{
// 记录异常数据
alarmData
.
setfAlarmType
(
"01"
);
//01.老化柜 02.机械臂 03.老化层 04.点位
alarmData
.
setfEquipmentCode
(
equipmentInfo
.
getfEquipmentCode
());
alarmData
.
setfAlarmData
(
"定时任务巡检:老化柜通信线路没接好"
);
equipmentInfo
.
setErrorReason
(
"定时任务巡检:老化柜通信线路没接好"
);
}
}
catch
(
ModbusInitException
|
ModbusTransportException
|
ErrorResponseException
e
)
{
log
.
info
(
"equipmentinfo -> ip = {} port = {}"
+
equipmentInfo
.
getfPowerOutageIp
(),
equipmentInfo
.
getfPowerOutagePort
());
throw
new
RuntimeException
(
e
);
tEquipmentAlarmDataService
.
insertTEquipmentAlarmData
(
alarmData
);
// 更新老化柜状态(“0”空闲,“1”运行,“2”故障)
equipmentInfo
.
setRegisterValues
(
new
HashMap
<>());
equipmentInfo
.
setfStatus
(
"2"
);
return
equipmentInfo
;
}
catch
(
ErrorResponseException
e
)
{
equipmentInfo
.
setfStatus
(
"2"
);
equipmentInfo
.
setRegisterValues
(
new
HashMap
<>());
equipmentInfo
.
setErrorReason
(
"定时任务巡检:ErrorResponseException"
);
return
equipmentInfo
;
}
finally
{
// 建议在这里关闭master连接,避免资源泄露
if
(
master
!=
null
)
{
try
{
master
.
destroy
();
}
catch
(
Exception
e
)
{
// 处理关闭异常
}
}
}
return
equipmentInfo
;
},
executorService
))
.
collect
(
Collectors
.
toList
());
},
executor
)).
collect
(
Collectors
.
toList
());
// 等待所有任务完成并收集结果
CompletableFuture
<
List
<
TEquipmentInfo
>>
listCompletableFuture
=
CompletableFuture
.
allOf
(
futures
.
toArray
(
new
CompletableFuture
[
0
]))
.
thenApply
(
v
->
futures
.
stream
()
.
map
(
CompletableFuture:
:
join
)
.
collect
(
Collectors
.
toList
()));
// 处理 老化柜 是 运行 开始 空闲
CompletableFuture
<
List
<
TEquipmentInfo
>>
processedFuture
=
listCompletableFuture
.
thenApply
(
this
::
processDeviceData
);
processedFuture
.
whenComplete
((
result
,
ex
)
->
{
tEquipmentInfoService
.
batchUpdate
(
result
);
// 执行WebSocket广播,推送最新老化柜状态
// if (result != null && !result.isEmpty()) {
// agingCabinetWebSocketHandler.broadcastAgingCabinetData(result);
// log.info("已通过WebSocket广播{}条老化柜状态数据", result.size());
// }
});
}
// 处理 老化柜 是 运行 开始 空闲
private
List
<
TEquipmentInfo
>
processDeviceData
(
List
<
TEquipmentInfo
>
deviceDataList
)
{
for
(
TEquipmentInfo
modbusDeviceData
:
deviceDataList
)
{
Map
<
Integer
,
Object
>
registerValues
=
modbusDeviceData
.
getRegisterValues
();
// 大于0 说明 柜能通信;小于0 说明柜 不能通信
if
(
registerValues
.
size
()
>
0
)
{
boolean
isRun
=
false
;
for
(
Map
.
Entry
<
Integer
,
Object
>
entry
:
registerValues
.
entrySet
())
{
Integer
registerOffset
=
entry
.
getKey
();
Object
registerValue
=
entry
.
getValue
();
log
.
info
(
"registerValue = "
+
registerValue
);
log
.
info
(
"true equals registerValue"
+
Boolean
.
TRUE
.
equals
(
registerValue
));
if
(
Boolean
.
TRUE
.
equals
(
registerValue
))
{
eventPublisher
.
publishEvent
(
new
CheckPowerOnCommandEvent
(
this
,
modbusDeviceData
.
getfEquipmentCode
(),
modbusDeviceData
.
getfPowerOutageIp
(),
modbusDeviceData
.
getfPowerOutagePort
(),
registerOffset
+
1
,
registerOffset
));
isRun
=
true
;
}
}
if
(
isRun
)
{
modbusDeviceData
.
setfStatus
(
"1"
);
}
else
{
modbusDeviceData
.
setfStatus
(
"0"
);
}
}
else
{
modbusDeviceData
.
setfStatus
(
"0"
);
}
}
return
deviceDataList
;
}
// 等待所有异步任务完成
CompletableFuture
<
Void
>
allFutures
=
CompletableFuture
.
allOf
(
futures
.
toArray
(
new
CompletableFuture
[
0
])
);
/**
* 所有设备断电
*/
public
AjaxResult
powerOffAllStore
()
{
// 所有任务完成后执行数据库更新
allFutures
.
thenRun
(()
->
{
TStoreyInfo
tStoreyInfo
=
new
TStoreyInfo
();
tStoreyInfo
.
setfStatus
(
"0"
);
tStoreyInfo
.
setfAgingStartTime
(
null
);
tStoreyInfoMapper
.
updateAllStatusAndAgingStartTime
(
tStoreyInfo
);
}).
join
();
// 阻塞等待所有操作完成
List
<
TEquipmentInfo
>
equipmentInfos
=
equipmentInfoMapper
.
getAll
();
if
(
equipmentInfos
.
size
()
==
0
)
{
return
AjaxResult
.
error
(
"无设备信息!!!"
);
}
// 批量处理
powerOffToEquipments
(
equipmentInfos
);
return
AjaxResult
.
success
();
}
...
...
@@ -308,49 +594,7 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService
return
AjaxResult
.
error
(
"无设备信息!!!"
);
}
// 收集所有异步任务
List
<
CompletableFuture
<
TEquipmentInfo
>>
futures
=
equipmentInfos
.
stream
()
.
map
(
equipmentInfo
->
CompletableFuture
.
supplyAsync
(()
->
{
ModbusMaster
master
=
null
;
List
<
Integer
>
registerOffsets
=
Arrays
.
asList
(
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
);
try
{
master
=
Modbus4jUtils
.
getMaster
(
equipmentInfo
.
getfPowerOutageIp
(),
equipmentInfo
.
getfPowerOutagePort
());
for
(
Integer
registerOffset
:
registerOffsets
)
{
Boolean
aBoolean
=
Modbus4jUtils
.
readCoilStatus
(
master
,
1
,
registerOffset
);
if
(!
aBoolean
)
{
Modbus4jUtils
.
writeCoil
(
master
,
1
,
registerOffset
,
true
);
}
}
}
catch
(
ModbusInitException
|
ModbusTransportException
|
ErrorResponseException
e
)
{
log
.
info
(
"equipmentinfo -> ip = {} port = {}"
+
equipmentInfo
.
getfPowerOutageIp
(),
equipmentInfo
.
getfPowerOutagePort
());
throw
new
RuntimeException
(
e
);
}
finally
{
// 建议在这里关闭master连接,避免资源泄露
if
(
master
!=
null
)
{
try
{
master
.
destroy
();
}
catch
(
Exception
e
)
{
// 处理关闭异常
}
}
}
return
equipmentInfo
;
},
executorService
))
.
collect
(
Collectors
.
toList
());
// 等待所有异步任务完成
CompletableFuture
<
Void
>
allFutures
=
CompletableFuture
.
allOf
(
futures
.
toArray
(
new
CompletableFuture
[
0
])
);
// 所有任务完成后执行数据库更新
allFutures
.
thenRun
(()
->
{
TStoreyInfo
tStoreyInfo
=
new
TStoreyInfo
();
tStoreyInfo
.
setfStatus
(
"1"
);
tStoreyInfo
.
setfAgingStartTime
(
DateUtils
.
getNowDate
());
tStoreyInfoMapper
.
updateAllStatusAndAgingStartTime
(
tStoreyInfo
);
}).
join
();
// 阻塞等待所有操作完成
powerOnToEquipments
(
equipmentInfos
);
return
AjaxResult
.
success
();
}
...
...
@@ -399,7 +643,7 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService
return
AjaxResult
.
success
(
integerObjectMap
);
}
catch
(
ModbusInitException
|
ModbusTransportException
|
ErrorResponseException
e
)
{
throw
new
RuntimeException
(
e
);
return
AjaxResult
.
error
(
"设备连接异常!!!"
);
}
}
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/task/DeviceTaskScheduler.java
View file @
0413cc73
...
...
@@ -6,6 +6,7 @@ import com.zehong.system.task.DeviceCommJob.DeviceComm501Device2Job;
import
com.zehong.system.task.DeviceCommJob.DeviceComm501Device3Job
;
import
org.quartz.*
;
import
org.quartz.impl.matchers.GroupMatcher
;
import
org.quartz.utils.Key
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -15,7 +16,9 @@ import javax.annotation.Resource;
import
java.time.Instant
;
import
java.time.temporal.ChronoUnit
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* @author lenovo
...
...
@@ -30,9 +33,9 @@ public class DeviceTaskScheduler {
private
Scheduler
scheduler
;
// 任务组名(统一固定,与原有逻辑保持一致)
p
rivate
static
final
String
JOB_GROUP
=
"DEVICE_TASKS"
;
p
ublic
static
final
String
JOB_GROUP
=
"DEVICE_TASKS"
;
// 触发器组名(统一固定,与原有逻辑保持一致)
p
rivate
static
final
String
TRIGGER_GROUP
=
"DEVICE_TRIGGERS"
;
p
ublic
static
final
String
TRIGGER_GROUP
=
"DEVICE_TRIGGERS"
;
// 新增:注入监控器
@Autowired
private
QuartzTaskMonitor
quartzTaskMonitor
;
...
...
@@ -91,7 +94,6 @@ public class DeviceTaskScheduler {
log
.
info
(
"清理现有任务: {}"
,
jobKey
.
getName
());
}
}
// 清理触发器
Set
<
TriggerKey
>
triggerKeys
=
scheduler
.
getTriggerKeys
(
GroupMatcher
.
triggerGroupEquals
(
TRIGGER_GROUP
));
for
(
TriggerKey
triggerKey
:
triggerKeys
)
{
...
...
zhmes-agecal-system/src/main/resources/mapper/system/PalletDeviceBindingMapper.xml
View file @
0413cc73
...
...
@@ -63,6 +63,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(1) from t_pallet_device_binding palDeviceBinding
where palDeviceBinding.f_tray_id = #{trayId}
</select>
<select
id=
"countDeviceByTrayId"
parameterType=
"long"
resultType=
"int"
>
select count(1) from t_pallet_device_binding palDeviceBinding
where palDeviceBinding.f_tray_id = #{trayId}
and palDeviceBinding.f_device_code is not null
and palDeviceBinding.f_device_code != ''
</select>
<select
id=
"selectPalletDeviceBindingList"
parameterType=
"PalletDeviceBinding"
resultMap=
"PalletDeviceBindingResult"
>
<include
refid=
"selectPalletDeviceBindingVo"
/>
<where>
...
...
zhmes-agecal-system/src/main/resources/mapper/system/TEquipmentAlarmDataMapper.xml
View file @
0413cc73
...
...
@@ -19,10 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectTEquipmentAlarmDataList"
parameterType=
"TEquipmentAlarmData"
resultMap=
"TEquipmentAlarmDataResult"
>
<include
refid=
"selectTEquipmentAlarmDataVo"
/>
<where>
<if
test=
"fEquipmentCode != null and fEquipmentCode != ''"
>
and f_equipment_code = #{fEquipmentCode}
</if>
<if
test=
"fAlarmType != null and fAlarmType != ''"
>
and f_alarm_type = #{fAlarmType}
</if>
<if
test=
"fAlarmData != null and fAlarmData != ''"
>
and f_alarm_data = #{fAlarmData}
</if>
<if
test=
"fCreateTime != null "
>
and f_create_time = #{fCreateTime}
</if>
<if
test=
"fEquipmentCode != null and fEquipmentCode != ''"
>
and f_equipment_code like concat ('%',#{fEquipmentCode},'%')
</if>
<if
test=
"fAlarmData != null and fAlarmData != ''"
>
and f_alarm_data like concat ('%', #{fAlarmData},'%')
</if>
</where>
</select>
...
...
zhmes-agecal-system/src/main/resources/mapper/system/TEquipmentInfoMapper.xml
View file @
0413cc73
...
...
@@ -61,7 +61,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</select>
<select
id=
"getAll"
resultMap=
"TEquipmentInfoResult"
>
<include
refid=
"selectTEquipmentInfoVo"
/>
</select>
<select
id=
"getAllByEquipmentCodeList"
parameterType=
"list"
resultMap=
"TEquipmentInfoResult"
>
<include
refid=
"selectTEquipmentInfoVo"
/>
where f_equipment_code in
<foreach
item=
"item"
collection=
"equipmentCodes"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
<select
id=
"selectTEquipmentInfoById"
parameterType=
"Long"
resultMap=
"TEquipmentInfoResult"
>
<include
refid=
"selectTEquipmentInfoVo"
/>
where f_equipment_id = #{fEquipmentId}
...
...
zhmes-agecal-web/src/api/equipmentAlarmData/equipmentAlarmData.js
View file @
0413cc73
...
...
@@ -3,50 +3,7 @@ import request from '@/utils/request'
// 查询生产设备报警信息列表
export
function
listEquipmentAlarmData
(
query
)
{
return
request
({
url
:
'/equipmentAlarmData/equipmentAlarmData/list'
,
method
:
'get'
,
params
:
query
})
}
// 查询生产设备报警信息详细
export
function
getEquipmentAlarmData
(
fEquipmentAlarmDataId
)
{
return
request
({
url
:
'/equipmentAlarmData/equipmentAlarmData/'
+
fEquipmentAlarmDataId
,
method
:
'get'
})
}
// 新增生产设备报警信息
export
function
addEquipmentAlarmData
(
data
)
{
return
request
({
url
:
'/equipmentAlarmData/equipmentAlarmData'
,
method
:
'post'
,
data
:
data
})
}
// 修改生产设备报警信息
export
function
updateEquipmentAlarmData
(
data
)
{
return
request
({
url
:
'/equipmentAlarmData/equipmentAlarmData'
,
method
:
'put'
,
data
:
data
})
}
// 删除生产设备报警信息
export
function
delEquipmentAlarmData
(
fEquipmentAlarmDataId
)
{
return
request
({
url
:
'/equipmentAlarmData/equipmentAlarmData/'
+
fEquipmentAlarmDataId
,
method
:
'delete'
})
}
// 导出生产设备报警信息
export
function
exportEquipmentAlarmData
(
query
)
{
return
request
({
url
:
'/equipmentAlarmData/equipmentAlarmData/export'
,
url
:
'/equipmentAlarmData/record/list'
,
method
:
'get'
,
params
:
query
})
...
...
zhmes-agecal-web/src/api/storey/storey.js
View file @
0413cc73
...
...
@@ -109,6 +109,18 @@ export function powerOnAllStore() {
method
:
'get'
})
}
export
function
designatedDevicePowerOn
(
equipmentCode
)
{
return
request
({
url
:
'/storey/designatedDevicePowerOn/'
+
equipmentCode
,
method
:
'get'
})
}
export
function
designatedDevicePowerOff
(
equipmentCode
)
{
return
request
({
url
:
'/storey/designatedDevicePowerOff/'
+
equipmentCode
,
method
:
'get'
})
}
export
function
powerOffAllStore
()
{
return
request
({
...
...
@@ -116,3 +128,10 @@ export function powerOffAllStore() {
method
:
'get'
})
}
export
function
scanAndStartAgingAllCabinetLayers
()
{
return
request
({
url
:
'/storey/scanAndStartAgingAllCabinetLayers'
,
method
:
'get'
})
}
zhmes-agecal-web/src/views/equipmentAlarmData/index.vue
0 → 100644
View file @
0413cc73
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"120px"
>
<el-form-item
label=
"报警设备编号"
prop=
"fEquipmentCode"
>
<el-input
v-model=
"queryParams.fEquipmentCode"
placeholder=
"请输入报警设备编号"
clearable
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-table
v-loading=
"loading"
:data=
"equipmentAlarmDataList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
label=
"报警设备编号"
align=
"center"
prop=
"fEquipmentCode"
/>
<el-table-column
label=
"报警数据"
align=
"center"
prop=
"fAlarmData"
/>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"fCreateTime"
width=
"180"
>
<template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
fCreateTime
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
pagination
v
-
show
=
"total>0"
:
total
=
"total"
:
page
.
sync
=
"queryParams.pageNum"
:
limit
.
sync
=
"queryParams.pageSize"
@
pagination
=
"getList"
/>
<
/div
>
<
/template
>
<
script
>
import
{
listEquipmentAlarmData
}
from
"@/api/equipmentAlarmData/equipmentAlarmData"
;
export
default
{
name
:
"EquipmentAlarmData"
,
components
:
{
}
,
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 导出遮罩层
exportLoading
:
false
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 生产设备报警信息表格数据
equipmentAlarmDataList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
fAlarmCode
:
null
,
fAlarmType
:
null
,
fAlarmData
:
null
,
fCreateTime
:
null
}
,
// 表单参数
form
:
{
}
,
// 表单校验
rules
:
{
}
}
;
}
,
created
()
{
this
.
getList
();
}
,
methods
:
{
/** 查询生产设备报警信息列表 */
getList
()
{
this
.
loading
=
true
;
listEquipmentAlarmData
(
this
.
queryParams
).
then
(
response
=>
{
this
.
equipmentAlarmDataList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
}
);
}
,
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
}
,
// 表单重置
reset
()
{
this
.
form
=
{
fEquipmentAlarmDataId
:
null
,
fAlarmCode
:
null
,
fAlarmType
:
null
,
fAlarmData
:
null
,
fCreateTime
:
null
}
;
this
.
resetForm
(
"form"
);
}
,
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
}
,
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
}
,
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
fEquipmentAlarmDataId
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
}
,
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加生产设备报警信息"
;
}
}
}
;
<
/script
>
zhmes-agecal-web/src/views/screen/components/RealTimeData.vue
View file @
0413cc73
...
...
@@ -65,7 +65,7 @@
</el-table-column>
<el-table-column
label=
"行"
prop=
"row"
align=
"center"
width=
"80"
/>
<el-table-column
label=
"列"
prop=
"col"
align=
"center"
width=
"80"
/>
<el-table-column
label=
"位置编号"
prop=
"number"
align=
"center"
width=
"
8
0"
/>
<el-table-column
label=
"位置编号"
prop=
"number"
align=
"center"
width=
"
15
0"
/>
<el-table-column
label=
"绑定时间"
align=
"center"
width=
"150"
>
<
template
slot-scope=
"scope"
>
<div
class=
"binding-time"
>
{{
scope
.
row
.
bindingTime
?
formatDate
(
scope
.
row
.
bindingTime
)
:
'-'
}}
</div>
...
...
zhmes-agecal-web/src/views/screen/components/RoboticArm.vue
View file @
0413cc73
...
...
@@ -83,7 +83,7 @@
<div
class=
"priority-control"
>
<div
class=
"priority-display"
>
{{
priorityDisplayText
}}
</div>
<button
class=
"priority-toggle-btn"
@
click=
"togglePriority"
>
{{
priorityToggleText
}}
<!--
{{
priorityToggleText
}}
-->点击切换
</button>
</div>
...
...
zhmes-agecal-web/src/views/storey/index.vue
View file @
0413cc73
...
...
@@ -54,43 +54,8 @@
@
click=
"handleExport"
>
导出
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"info"
plain
icon=
"el-icon-reading"
size=
"mini"
@
click=
"handleReading"
>
批量读取设备状态
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"info"
plain
icon=
"el-icon-reading"
size=
"mini"
@
click=
"handleHoldingRegister"
>
测试501端口
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-circle-plus"
size=
"mini"
@
click=
"handleAllPowerOn"
>
所有设备上电
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-remove"
size=
"mini"
@
click=
"handleAllPowerOff"
>
所有设备断电
</el-button>
</el-col>
<!-- 移除的功能按钮 -->
<el-col
:span=
"1.5"
>
<el-button
...
...
@@ -111,15 +76,7 @@
@
click=
"handleStop"
>
机械臂停止
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-circle-close"
size=
"mini"
@
click=
"handleWriteHour"
>
写时间测试
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
...
...
@@ -181,12 +138,12 @@
@
click
=
"handlePowerOutage(scope.row)"
>
断电
<
/el-button
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-delete"
@
click
=
"handleFeeding(scope.row)"
>
上料
<
/el-button
>
<!--
<
el
-
button
-->
<!--
size
=
"mini"
-->
<!--
type
=
"text"
-->
<!--
icon
=
"el-icon-delete"
-->
<!--
@
click
=
"handleFeeding(scope.row)"
-->
<!--
>
上料
<
/el-button>--
>
<
el
-
button
size
=
"mini"
type
=
"text"
...
...
@@ -256,9 +213,8 @@
<
script
>
import
{
listStorey
,
getStorey
,
delStorey
,
addStorey
,
updateStorey
,
exportStorey
,
PowerOn
,
PowerOutage
,
batchReadingCabinetStatus
,
powerOnAllStore
,
powerOffAllStore
,
feeding
,
blanking
,
readingHoldingRegister
}
from
"@/api/storey/storey"
;
import
{
sendHomeCommand
,
sendStopCommand
,
sendWriteHour
}
from
"@/api/robotArm/robotArmCommand"
;
feeding
,
blanking
}
from
"@/api/storey/storey"
;
import
{
sendHomeCommand
,
sendStopCommand
}
from
"@/api/robotArm/robotArmCommand"
;
export
default
{
name
:
"Info"
,
...
...
@@ -477,57 +433,6 @@ export default {
this
.
msgSuccess
(
"删除成功"
);
}
).
catch
(()
=>
{
}
);
}
,
// 测试 某个设备的 501,502,503端口号
handleHoldingRegister
()
{
this
.
$prompt
(
'请输入ip加端口号 逗号分隔'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
}
).
then
(({
value
}
)
=>
{
readingHoldingRegister
(
value
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
msgSuccess
(
"msg = "
+
response
.
data
);
}
}
)
}
).
catch
(()
=>
{
}
);
}
,
handleReading
()
{
this
.
$prompt
(
'请输入老化柜编号'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
}
).
then
(({
value
}
)
=>
{
batchReadingCabinetStatus
(
value
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
msgSuccess
(
"msg = "
+
response
.
data
);
}
}
)
}
).
catch
(()
=>
{
}
);
}
,
handleAllPowerOff
()
{
this
.
$confirm
(
'是否确认给所有设备断电?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}
).
then
(
function
()
{
return
powerOffAllStore
();
}
).
then
(()
=>
{
this
.
getList
();
this
.
msgSuccess
(
"断电成功"
);
}
).
catch
(()
=>
{
}
);
}
,
handleAllPowerOn
()
{
this
.
$confirm
(
'是否确认给所有设备上电?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}
).
then
(
function
()
{
return
powerOnAllStore
();
}
).
then
(()
=>
{
this
.
getList
();
this
.
msgSuccess
(
"上电成功"
);
}
).
catch
(()
=>
{
}
);
}
,
// 回零
handleHome
()
{
...
...
@@ -536,20 +441,6 @@ export default {
}
)
}
,
/** 写时钟 */
handleWriteHour
()
{
this
.
$prompt
(
'请输入ip加端口号 逗号分隔'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
}
).
then
(({
value
}
)
=>
{
sendWriteHour
(
value
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
msgSuccess
(
"msg = "
+
response
.
data
);
}
}
)
}
).
catch
(()
=>
{
}
);
}
,
// 停止
handleStop
()
{
sendStopCommand
().
then
(
response
=>
{
...
...
zhmes-agecal-web/src/views/testScheduledTasks/index.vue
View file @
0413cc73
<
template
>
<div
class=
"app-container"
>
<el-row
:gutter=
"10"
class=
"mb8"
>
<!--
<el-col
:span=
"1.5"
>
-->
<!--
<el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- size="mini"-->
<!-- @click="testAgingCabinetAndPowerCheck"-->
<!-- >测试老化柜状态获取-->
<!--
</el-button>
-->
<!--
</el-col>
-->
<!-- 新增的批量操作按钮 -->
<el-col
:span=
"1.5"
>
<el-button
type=
"
primary
"
type=
"
info
"
plain
icon=
"el-icon-reading"
size=
"mini"
@
click=
"testAgingCabinetAndPowerCheck"
>
测试老化柜状态获取
</el-button>
@
click=
"handleReading"
>
批量读取设备状态
</el-button>
</el-col>
<!--
<el-col
:span=
"1.5"
>
-->
<!--
<el-button-->
<!-- type="info"-->
<!-- plain-->
<!-- icon="el-icon-reading"-->
<!-- size="mini"-->
<!-- @click="handleHoldingRegister"-->
<!-- >测试501端口
</el-button>
-->
<!--
</el-col>
-->
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-circle-close"
size=
"mini"
@
click=
"handleWriteHour"
>
写时间测试
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-circle-check"
size=
"mini"
@
click=
"handleScanAndStartAgingAllCabinetLayers"
>
扫描并老化
</el-button>
</el-col>
</el-row>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-circle-plus"
size=
"mini"
@
click=
"handleAllPowerOn"
>
所有设备上电
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-circle-plus"
size=
"mini"
@
click=
"handleDesignatedDevicePowerOn"
>
指定设备上电
</el-button>
</el-col>
</el-row>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-remove"
size=
"mini"
@
click=
"handleAllPowerOff"
>
所有设备断电
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-remove"
size=
"mini"
@
click=
"handleDesignatedDevicePowerOff"
>
指定设备断电
</el-button>
</el-col>
</el-row>
<el-input
type=
"textarea"
:rows=
"
2
5"
:rows=
"
1
5"
placeholder=
"返回内容信息"
v-model=
"textarea"
>
</el-input>
...
...
@@ -21,8 +99,12 @@
</
template
>
<
script
>
import
{
getAgingCabinetAndPowerCheck
}
from
"@/api/testScheduledTasks/testTasks"
;
import
{
batchReadingCabinetStatus
,
readingHoldingRegister
,
powerOnAllStore
,
powerOffAllStore
,
scanAndStartAgingAllCabinetLayers
,
designatedDevicePowerOn
,
designatedDevicePowerOff
}
from
"@/api/storey/storey"
;
import
{
sendWriteHour
}
from
"@/api/robotArm/robotArmCommand"
;
export
default
{
name
:
"TestScheduledTasks"
,
...
...
@@ -51,6 +133,113 @@ export default {
}
}
);
},
// 从原组件提取的功能方法
handleReading
()
{
this
.
$prompt
(
'请输入老化柜编号'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
}).
then
(({
value
})
=>
{
batchReadingCabinetStatus
(
value
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
textarea
=
"批量读取设备状态成功:"
+
response
.
data
;
this
.
$message
.
success
(
"读取成功"
);
}
})
}).
catch
(()
=>
{});
},
handleHoldingRegister
()
{
this
.
$prompt
(
'请输入ip加端口号 逗号分隔'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
}).
then
(({
value
})
=>
{
readingHoldingRegister
(
value
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
textarea
=
"测试501端口成功:"
+
response
.
data
;
this
.
$message
.
success
(
"测试成功"
);
}
})
}).
catch
(()
=>
{});
},
handleAllPowerOn
()
{
this
.
$confirm
(
'是否确认给所有设备上电?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}).
then
(
function
()
{
return
powerOnAllStore
();
}).
then
(()
=>
{
this
.
textarea
=
"所有设备上电操作执行成功"
;
this
.
$message
.
success
(
"上电成功"
);
}).
catch
(()
=>
{});
},
handleDesignatedDevicePowerOff
()
{
this
.
$prompt
(
'请输入需要断电的柜子设备编号北1-15,南16-30,英文逗号分隔'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
}).
then
(({
value
})
=>
{
designatedDevicePowerOff
(
value
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
textarea
=
"指定设备已断电成功:"
+
response
.
data
;
this
.
$message
.
success
(
"指定设备已断电成功"
);
}
})
}).
catch
(()
=>
{});
},
handleDesignatedDevicePowerOn
()
{
this
.
$prompt
(
'请输入需要上电的柜子设备编号北1-15,南16-30,英文逗号分隔'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
}).
then
(({
value
})
=>
{
designatedDevicePowerOn
(
value
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
textarea
=
"指定设备已上电成功:"
+
response
.
data
;
this
.
$message
.
success
(
"指定设备已上电成功"
);
}
})
}).
catch
(()
=>
{});
},
handleAllPowerOff
()
{
this
.
$confirm
(
'是否确认给所有设备断电?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}).
then
(
function
()
{
return
powerOffAllStore
();
}).
then
(()
=>
{
this
.
textarea
=
"所有设备断电操作执行成功"
;
this
.
$message
.
success
(
"断电成功"
);
}).
catch
(()
=>
{});
},
// 扫描并老化
handleScanAndStartAgingAllCabinetLayers
()
{
this
.
$confirm
(
'警示:此操作将清理所有已存在的任务并重新扫描所有老化柜的层信息去生成任务,确认操作请点击确定!!!'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}).
then
(
function
()
{
return
scanAndStartAgingAllCabinetLayers
();
}).
then
(()
=>
{
this
.
$message
.
success
(
"我想好了"
);
}).
catch
(()
=>
{});
},
handleWriteHour
()
{
this
.
$prompt
(
'请输入ip加端口号 逗号分隔'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
}).
then
(({
value
})
=>
{
sendWriteHour
(
value
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
textarea
=
"写时间测试成功:"
+
response
.
data
;
this
.
$message
.
success
(
"写时间成功"
);
}
})
}).
catch
(()
=>
{});
}
}
};
...
...
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