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
944b78d2
Commit
944b78d2
authored
Oct 30, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 标定完成状态下 重置所有时判断 错误板子 是否被解除
parent
04c19f2a
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
180 additions
and
28 deletions
+180
-28
PalletDeviceBindingController.java
...b/controller/equipment/PalletDeviceBindingController.java
+1
-1
PalletDeviceBinding.java
...in/java/com/zehong/system/domain/PalletDeviceBinding.java
+12
-1
PalletDeviceBindingMapper.java
...a/com/zehong/system/mapper/PalletDeviceBindingMapper.java
+4
-0
TTrayInfoMapper.java
...c/main/java/com/zehong/system/mapper/TTrayInfoMapper.java
+2
-0
IPalletDeviceBindingService.java
...om/zehong/system/service/IPalletDeviceBindingService.java
+3
-1
PalletDeviceBindingServiceImpl.java
...g/system/service/impl/PalletDeviceBindingServiceImpl.java
+18
-2
DeviceCommunicationJob.java
...n/java/com/zehong/system/task/DeviceCommunicationJob.java
+4
-0
PalletDeviceBindingMapper.xml
...ain/resources/mapper/system/PalletDeviceBindingMapper.xml
+53
-14
TTrayInfoMapper.xml
...stem/src/main/resources/mapper/system/TTrayInfoMapper.xml
+5
-0
RealTimeData.vue
...s-agecal-web/src/views/screen/components/RealTimeData.vue
+13
-0
TrayBinding.vue
zhmes-agecal-web/src/views/screen/components/TrayBinding.vue
+65
-9
No files found.
zhmes-agecal-admin/src/main/java/com/zehong/web/controller/equipment/PalletDeviceBindingController.java
View file @
944b78d2
...
...
@@ -77,7 +77,7 @@ public class PalletDeviceBindingController extends BaseController
*/
@GetMapping
(
"/resetAll/{trayId}"
)
public
AjaxResult
resetAll
(
@PathVariable
(
"trayId"
)
Long
trayId
)
{
return
AjaxResult
.
success
(
palletDeviceBindingService
.
resetAll
(
trayId
)
);
return
palletDeviceBindingService
.
resetAll
(
trayId
);
}
/**
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/domain/PalletDeviceBinding.java
View file @
944b78d2
...
...
@@ -24,6 +24,9 @@ public class PalletDeviceBinding extends BaseEntity
@Excel
(
name
=
"托盘id"
)
private
Long
trayId
;
/** 托盘编号 */
private
String
fTrayCode
;
/** 绑定的设备编号 */
@Excel
(
name
=
"绑定的设备编号"
)
private
String
deviceCode
;
...
...
@@ -52,7 +55,7 @@ public class PalletDeviceBinding extends BaseEntity
private
Date
unbindingTime
;
/**
* 状态 0-预热;1-正常;3-传感器故障;4-报警;5-通讯故障
;6-程序写时间失败
* 状态 0-预热;1-正常;3-传感器故障;4-报警;5-通讯故障
*/
private
String
status
;
...
...
@@ -253,6 +256,14 @@ public class PalletDeviceBinding extends BaseEntity
this
.
concentration
=
concentration
;
}
public
String
getfTrayCode
()
{
return
fTrayCode
;
}
public
void
setfTrayCode
(
String
fTrayCode
)
{
this
.
fTrayCode
=
fTrayCode
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/mapper/PalletDeviceBindingMapper.java
View file @
944b78d2
...
...
@@ -36,6 +36,8 @@ public interface PalletDeviceBindingMapper
*/
public
List
<
PalletDeviceBinding
>
selectPalletDeviceBindingList
(
PalletDeviceBinding
palletDeviceBinding
);
public
int
countErrorByTrayId
(
Long
trayId
);
/**
* 新增托盘绑定的设备列
*
...
...
@@ -46,6 +48,8 @@ public interface PalletDeviceBindingMapper
public
int
resetAll
(
Long
trayId
);
public
int
deleteAllByTrayId
(
Long
trayId
);
public
int
batchInsertPalletDeviceBinding
(
@Param
(
"palletDeviceBindingList"
)
List
<
PalletDeviceBinding
>
palletDeviceBindingList
);
/**
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/mapper/TTrayInfoMapper.java
View file @
944b78d2
...
...
@@ -25,6 +25,8 @@ public interface TTrayInfoMapper
public
int
clearStoreyCodeByStoreyCode
(
String
storeyCode
);
public
int
initStatusByTrayId
(
Long
trayId
);
/**
* 查询托盘信息列表
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/IPalletDeviceBindingService.java
View file @
944b78d2
package
com
.
zehong
.
system
.
service
;
import
java.util.List
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.system.domain.PalletDeviceBinding
;
/**
...
...
@@ -35,7 +37,7 @@ public interface IPalletDeviceBindingService
*/
public
int
insertPalletDeviceBinding
(
PalletDeviceBinding
palletDeviceBinding
);
public
in
t
resetAll
(
Long
trayId
);
public
AjaxResul
t
resetAll
(
Long
trayId
);
public
int
batchInsertPalletDeviceBinding
(
List
<
PalletDeviceBinding
>
palletDeviceBindingList
);
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/PalletDeviceBindingServiceImpl.java
View file @
944b78d2
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.List
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.system.mapper.TTrayInfoMapper
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.PalletDeviceBindingMapper
;
import
com.zehong.system.domain.PalletDeviceBinding
;
...
...
@@ -21,6 +24,9 @@ public class PalletDeviceBindingServiceImpl implements IPalletDeviceBindingServi
@Resource
private
PalletDeviceBindingMapper
palletDeviceBindingMapper
;
@Resource
private
TTrayInfoMapper
tTrayInfoMapper
;
/**
* 查询托盘绑定的设备列
*
...
...
@@ -65,8 +71,18 @@ public class PalletDeviceBindingServiceImpl implements IPalletDeviceBindingServi
* @return 结果
*/
@Override
public
int
resetAll
(
Long
trayId
)
{
return
palletDeviceBindingMapper
.
resetAll
(
trayId
);
public
AjaxResult
resetAll
(
Long
trayId
)
{
int
i
=
palletDeviceBindingMapper
.
countErrorByTrayId
(
trayId
);
if
(
i
>
0
)
{
return
AjaxResult
.
error
(
"有错误设备未解除绑定,不允许重置"
);
}
palletDeviceBindingMapper
.
deleteAllByTrayId
(
trayId
);
tTrayInfoMapper
.
initStatusByTrayId
(
trayId
);
return
AjaxResult
.
success
();
}
/**
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/task/DeviceCommunicationJob.java
View file @
944b78d2
...
...
@@ -172,6 +172,9 @@ public class DeviceCommunicationJob implements Job {
// 3. 更新设备状态
binding
.
setStatus
(
String
.
valueOf
(
result
[
1
]));
// 3. 更新浓度值
binding
.
setConcentration
(
String
.
valueOf
(
result
[
0
]));
// 4. 条件写入时间
if
(
result
[
1
]
==
1
||
result
[
1
]
==
3
||
result
[
1
]
==
4
)
{
// 重用之前的master连接进行写操作
...
...
@@ -191,6 +194,7 @@ public class DeviceCommunicationJob implements Job {
binding
=
palletDeviceBindingMapper
.
selectByTrayIdAndIndex
(
ip
,
deviceId
);
}
binding
.
setStatus
(
"5"
);
binding
.
setWriteTimeStatus
(
"0"
);
palletDeviceBindingMapper
.
updatePalletDeviceBinding
(
binding
);
errorCount
.
incrementAndGet
();
return
false
;
...
...
zhmes-agecal-system/src/main/resources/mapper/system/PalletDeviceBindingMapper.xml
View file @
944b78d2
...
...
@@ -28,29 +28,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql
id=
"selectPalletDeviceBindingVo"
>
select f_pallet_device_binding_id, f_tray_id, f_device_code, f_row, f_col, f_index,f_binding_time,
f_unbinding_time, f_create_time,f_status,f_record_year,f_record_month,f_record_date,f_record_hour,
f_record_minute, f_write_time_status, f_adjustment_zero_ad, f_calibration_ad, f_concentration from t_pallet_device_binding
select palDeviceBinding.f_pallet_device_binding_id,
palDeviceBinding.f_tray_id,
trayInfo.f_tray_code,
palDeviceBinding.f_device_code,
palDeviceBinding.f_row,
palDeviceBinding.f_col,
palDeviceBinding.f_index,
palDeviceBinding.f_binding_time,
palDeviceBinding.f_unbinding_time,
palDeviceBinding.f_create_time,
palDeviceBinding.f_status,
palDeviceBinding.f_record_year,
palDeviceBinding.f_record_month,
palDeviceBinding.f_record_date,
palDeviceBinding.f_record_hour,
palDeviceBinding.f_record_minute,
palDeviceBinding.f_write_time_status,
palDeviceBinding.f_adjustment_zero_ad,
palDeviceBinding.f_calibration_ad,
palDeviceBinding.f_concentration
from t_pallet_device_binding palDeviceBinding
left join t_tray_info trayInfo on trayInfo.f_tray_id = palDeviceBinding.f_tray_id
</sql>
<select
id=
"countErrorByTrayId"
parameterType=
"Long"
resultType=
"int"
>
select count(1) from t_pallet_device_binding palDeviceBinding
where palDeviceBinding.f_tray_id = #{trayId}
and (palDeviceBinding.f_status = '0' or palDeviceBinding.f_status = '5')
</select>
<select
id=
"selectPalletDeviceBindingList"
parameterType=
"PalletDeviceBinding"
resultMap=
"PalletDeviceBindingResult"
>
<include
refid=
"selectPalletDeviceBindingVo"
/>
<where>
<if
test=
"trayId != null "
>
and f_tray_id = #{trayId}
</if>
<if
test=
"deviceCode != null and deviceCode != ''"
>
and f_device_code = #{deviceCode}
</if>
<if
test=
"row != null "
>
and f_row = #{row}
</if>
<if
test=
"col != null "
>
and f_col = #{col}
</if>
<if
test=
"index != null "
>
and f_index = #{index}
</if>
<if
test=
"bindingTime != null "
>
and f_binding_time = #{bindingTime}
</if>
<if
test=
"unbindingTime != null "
>
and f_unbinding_time = #{unbindingTime}
</if>
<if
test=
"createTime != null "
>
and f_create_time = #{createTime}
</if>
<if
test=
"status != null "
>
and f_status = #{status}
</if>
<if
test=
"trayId != null "
>
and
palDeviceBinding.
f_tray_id = #{trayId}
</if>
<if
test=
"deviceCode != null and deviceCode != ''"
>
and
palDeviceBinding.
f_device_code = #{deviceCode}
</if>
<if
test=
"row != null "
>
and
palDeviceBinding.
f_row = #{row}
</if>
<if
test=
"col != null "
>
and
palDeviceBinding.
f_col = #{col}
</if>
<if
test=
"index != null "
>
and
palDeviceBinding.
f_index = #{index}
</if>
<if
test=
"bindingTime != null "
>
and
palDeviceBinding.
f_binding_time = #{bindingTime}
</if>
<if
test=
"unbindingTime != null "
>
and
palDeviceBinding.
f_unbinding_time = #{unbindingTime}
</if>
<if
test=
"createTime != null "
>
and
palDeviceBinding.
f_create_time = #{createTime}
</if>
<if
test=
"status != null "
>
and
palDeviceBinding.
f_status = #{status}
</if>
</where>
</select>
<select
id=
"selectPalletDeviceBindingById"
parameterType=
"Long"
resultMap=
"PalletDeviceBindingResult"
>
<include
refid=
"selectPalletDeviceBindingVo"
/>
where f_pallet_device_binding_id = #{palletDeviceBindingId}
where
palDeviceBinding.
f_pallet_device_binding_id = #{palletDeviceBindingId}
</select>
<select
id=
"selectByTrayIdAndIndex"
resultMap=
"PalletDeviceBindingResult"
>
select f_pallet_device_binding_id,
...
...
@@ -96,7 +120,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<update
id=
"resetAll"
parameterType=
"long"
>
update t_pallet_device_binding
set f_device_code = null,f_binding_time = null
set f_device_code = null,
f_binding_time = null,
f_unbinding_time = null,
f_status = null,
f_record_year = null,
f_record_month = null,
f_record_date = null,
f_record_hour = null,
f_record_minute = null,
f_write_time_status = null,
f_adjustment_zero_ad = null,
f_calibration_ad = null,
f_concentration = null
where f_tray_id = #{trayId}
</update>
<insert
id=
"insertPalletDeviceBinding"
parameterType=
"PalletDeviceBinding"
useGeneratedKeys=
"true"
keyProperty=
"palletDeviceBindingId"
>
...
...
@@ -163,6 +199,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete
id=
"deletePalletDeviceBindingById"
parameterType=
"Long"
>
delete from t_pallet_device_binding where f_pallet_device_binding_id = #{palletDeviceBindingId}
</delete>
<delete
id=
"deleteAllByTrayId"
parameterType=
"Long"
>
delete from t_pallet_device_binding where f_tray_id = #{trayId}
</delete>
<delete
id=
"deletePalletDeviceBindingByIds"
parameterType=
"String"
>
delete from t_pallet_device_binding where f_pallet_device_binding_id in
...
...
zhmes-agecal-system/src/main/resources/mapper/system/TTrayInfoMapper.xml
View file @
944b78d2
...
...
@@ -99,6 +99,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
set f_storey_code = null
where f_storey_code = #{fStoreyCode}
</update>
<update
id=
"initStatusByTrayId"
parameterType=
"long"
>
update t_tray_info
set f_status = '0'
where f_tray_id = #{fTrayId}
</update>
<update
id=
"updateTTrayInfo"
parameterType=
"TTrayInfo"
>
update t_tray_info
<trim
prefix=
"SET"
suffixOverrides=
","
>
...
...
zhmes-agecal-web/src/views/screen/components/RealTimeData.vue
View file @
944b78d2
...
...
@@ -6,19 +6,32 @@
<
script
>
import
{
listBinding
}
from
"@/api/palletDeviceBinding/binding"
export
default
{
name
:
"RealTimeData"
,
data
()
{
return
{
list
:
null
,
total
:
0
,
loading
:
true
,
};
},
created
()
{
this
.
getList
();
},
computed
:
{
},
mounted
()
{
},
methods
:
{
getList
()
{
listBinding
().
then
(
response
=>
{
this
.
list
=
response
.
data
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
}
}
};
</
script
>
...
...
zhmes-agecal-web/src/views/screen/components/TrayBinding.vue
View file @
944b78d2
...
...
@@ -89,6 +89,14 @@
<i
class=
"fas fa-paper-plane"
></i>
{{
trayStatus
===
'3'
?
'提交修复'
:
'提交绑定'
}}
</button>
<!-- 一键解绑按钮 - 仅status=3时显示 -->
<button
v-if=
"trayStatus === '3'"
class=
"unbind-btn"
@
click=
"unbindAll"
>
<i
class=
"fas fa-unlink"
></i>
一键解绑
</button>
</div>
<!-- 使用说明区域 -->
...
...
@@ -201,9 +209,9 @@ export default {
trayStatusTagType
()
{
const
map
=
{
'0'
:
'success'
,
// 空闲 - 绿色
'1'
:
'
warning
'
,
// 运行中 - 黄色
'1'
:
'
primary
'
,
// 运行中 - 黄色
'2'
:
'danger'
,
// 老化完成 - 红色
'3'
:
'
primary
'
// 标定完成
'3'
:
'
warning
'
// 标定完成
};
return
map
[
this
.
trayStatus
]
||
'info'
;
},
...
...
@@ -316,11 +324,12 @@ export default {
this
.
$message
.
success
(
`设备
${
this
.
deviceInput
}
修复成功!`
);
// 自动移动到下一个单元格
if
(
this
.
activeCell
<
71
)
{
this
.
activeCell
++
;
}
else
{
this
.
activeCell
=
0
;
}
// if (this.activeCell
<
71
)
{
// this.activeCell++;
// } else {
// this.activeCell = 0;
// }
this
.
activeCell
=
deviceIndex
;
}
else
{
// 非异常设备提示
this
.
$message
.
warning
(
`设备
${
this
.
deviceInput
}
不是异常设备或不存在`
);
...
...
@@ -347,7 +356,32 @@ export default {
const
col
=
(
index
%
9
)
+
1
;
return
`
${
row
}
-
${
col
}
`
;
},
// 一键解绑所有设备
unbindAll
()
{
this
.
$confirm
(
'确定要解绑当前托盘下所有设备吗?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'error'
}).
then
(()
=>
{
// 调用解绑接口(假设后端有对应的解绑接口,若无则需根据实际逻辑调整)
// 这里复用现有resetAll接口或替换为实际解绑接口
this
.
$message
.
success
(
"好的,已经解绑了"
);
// resetAll(this.fTrayId).then(res => {
// if (res.code === 200) {
// // 解绑成功后重置设备矩阵
// this.devices = this.devices.map(d => ({ ...d, deviceCode: '', status: '0' }));
// this.abnormalCount = this.devices.length; // 重置异常计数为总设备数
// this.initialAbnormalCount = this.abnormalCount;
// this.deviceInput = '';
// this.activeCell = 0;
// this.$message.success("一键解绑成功");
// } else {
// this.$message.error("解绑失败");
// }
// })
}).
catch
(()
=>
{});
},
// 绑定托盘
bindTray
:
function
()
{
if
(
this
.
trayStatus
===
'0'
)
{
...
...
@@ -401,7 +435,7 @@ export default {
});
this
.
msgSuccess
(
"已重置"
);
}
else
{
this
.
msgError
(
"重置失败"
);
this
.
msgError
(
res
.
msg
);
}
})
}).
catch
(()
=>
{
...
...
@@ -854,4 +888,26 @@ body {
padding-top
:
5px
;
padding-right
:
15px
;
}
/* 一键解绑按钮样式 */
.unbind-btn
{
background
:
linear-gradient
(
to
right
,
#9d4edd
,
#7b2cbf
);
color
:
white
;
border
:
none
;
padding
:
18px
45px
;
font-size
:
1.4rem
;
font-weight
:
bold
;
border-radius
:
50px
;
cursor
:
pointer
;
display
:
flex
;
align-items
:
center
;
gap
:
15px
;
transition
:
all
0.3s
;
box-shadow
:
0
5px
15px
rgba
(
0
,
0
,
0
,
0.3
);
}
.unbind-btn
:hover
{
transform
:
translateY
(
-5px
);
box-shadow
:
0
8px
20px
rgba
(
157
,
78
,
221
,
0.5
);
}
</
style
>
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