Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhongtong-avi-service
Project
Project
Details
Activity
Releases
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
中通客车项目
zhongtong-avi-service
Commits
dfd97c83
Commit
dfd97c83
authored
Sep 07, 2020
by
夏东伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新加设备适配
parent
efb13c3a
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
397 additions
and
23 deletions
+397
-23
CleanMachineStatusDataJob.java
...hongtong/avi/equipment/job/CleanMachineStatusDataJob.java
+4
-2
CleanStatusDataJob.java
...tstar/zhongtong/avi/equipment/job/CleanStatusDataJob.java
+7
-3
BasicInfoService.java
...tar/zhongtong/avi/equipment/service/BasicInfoService.java
+1
-0
EquipStatusRealTimeService.java
...ong/avi/equipment/service/EquipStatusRealTimeService.java
+4
-1
EquipmentService.java
...tar/zhongtong/avi/equipment/service/EquipmentService.java
+16
-5
PaintingRobotMachineJob.java
...ong/avi/gateway/painting/job/PaintingRobotMachineJob.java
+1
-1
SprayBoothMachineJob.java
...ngtong/avi/gateway/painting/job/SprayBoothMachineJob.java
+95
-0
WeldingRobotWorkstationMachine.java
.../gateway/parts/domain/WeldingRobotWorkstationMachine.java
+175
-0
WeldingRobotWorkMachineJob.java
...ong/avi/gateway/parts/job/WeldingRobotWorkMachineJob.java
+55
-0
FlatLaserCuttingMachineJob.java
.../avi/gateway/stamping/job/FlatLaserCuttingMachineJob.java
+8
-2
LaserCutting3DMachineJob.java
...ng/avi/gateway/stamping/job/LaserCutting3DMachineJob.java
+7
-1
LaserCuttingMachineJob.java
...tong/avi/gateway/stamping/job/LaserCuttingMachineJob.java
+12
-6
RfidMessageHandler.java
.../vtstar/zhongtong/avi/mqtt/handle/RfidMessageHandler.java
+3
-0
ExpertUtils.java
...main/java/net/vtstar/zhongtong/avi/utils/ExpertUtils.java
+1
-1
application-quartz2.properties
src/main/resources/config/application-quartz2.properties
+8
-1
No files found.
src/main/java/net/vtstar/zhongtong/avi/equipment/job/CleanMachineStatusDataJob.java
View file @
dfd97c83
...
@@ -48,9 +48,11 @@ public class CleanMachineStatusDataJob extends QuartzJobBean {
...
@@ -48,9 +48,11 @@ public class CleanMachineStatusDataJob extends QuartzJobBean {
if
(
null
!=
info
.
getRemarks
())
{
if
(
null
!=
info
.
getRemarks
())
{
continue
;
continue
;
}
}
EquipmentData
data
;
EquipmentData
data
=
(
EquipmentData
)
valueOperations
.
get
(
EquipDataUtil
.
getLastStatusKey
(
info
.
getAlias
()));
data
=
(
EquipmentData
)
valueOperations
.
get
(
EquipDataUtil
.
getLastStatusKey
(
info
.
getAlias
()));
if
(
null
==
data
||
null
==
data
.
getEquipStatus
())
{
if
(
null
==
data
||
null
==
data
.
getEquipStatus
())
{
if
(
info
.
getEquipType
().
contains
(
"LASER_CUTTING"
)){
continue
;
}
realTimeService
.
saveEquip
(
info
.
getWorkshopName
(),
info
.
getEquipCode
(),
info
.
getAlias
(),
"关机"
);
realTimeService
.
saveEquip
(
info
.
getWorkshopName
(),
info
.
getEquipCode
(),
info
.
getAlias
(),
"关机"
);
continue
;
continue
;
}
}
...
...
src/main/java/net/vtstar/zhongtong/avi/equipment/job/CleanStatusDataJob.java
View file @
dfd97c83
...
@@ -18,6 +18,7 @@ import org.springframework.data.redis.core.ValueOperations;
...
@@ -18,6 +18,7 @@ import org.springframework.data.redis.core.ValueOperations;
import
org.springframework.scheduling.quartz.QuartzJobBean
;
import
org.springframework.scheduling.quartz.QuartzJobBean
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.List
;
...
@@ -61,7 +62,10 @@ public class CleanStatusDataJob extends QuartzJobBean {
...
@@ -61,7 +62,10 @@ public class CleanStatusDataJob extends QuartzJobBean {
}
}
EquipmentData
data
=
dataList
.
get
(
0
);
EquipmentData
data
=
dataList
.
get
(
0
);
String
equipType
=
data
.
getEquipType
();
String
equipType
=
data
.
getEquipType
();
if
(
null
!=
equipType
&&
equipType
.
contains
(
"DRYING_ROOM_TEMP"
))
{
if
(
StringUtils
.
isEmpty
(
equipType
)){
continue
;
}
if
(
equipType
.
contains
(
"DRYING_ROOM_TEMP"
))
{
//插入设备监控数据
//插入设备监控数据
equipmentDataMapper
.
insert
(
data
);
equipmentDataMapper
.
insert
(
data
);
}
else
{
}
else
{
...
@@ -70,11 +74,11 @@ public class CleanStatusDataJob extends QuartzJobBean {
...
@@ -70,11 +74,11 @@ public class CleanStatusDataJob extends QuartzJobBean {
if
(
CollectionUtils
.
isEmpty
(
collect
)){
if
(
CollectionUtils
.
isEmpty
(
collect
)){
continue
;
continue
;
}
}
if
(
null
!=
equipType
&&
!
equipType
.
contains
(
"LASER_CUTTING"
)){
if
(!
equipType
.
contains
(
"LASER_CUTTING"
)){
equipmentDataMapper
.
insertList
(
collect
);
equipmentDataMapper
.
insertList
(
collect
);
}
}
}
}
if
(
(
null
!=
equipType
&&
equipType
.
contains
(
"DRYING_ROOM_TEMP"
))
||
(
null
!=
equipType
&&
equipType
.
contains
(
"SPRAY_BOOTH"
)
))
{
if
(
equipType
.
contains
(
"SPRAY_BOOTH"
))
{
continue
;
continue
;
}
}
equipDataService
.
updateLastStatus
(
dataList
.
get
(
dataList
.
size
()
-
1
));
equipDataService
.
updateLastStatus
(
dataList
.
get
(
dataList
.
size
()
-
1
));
...
...
src/main/java/net/vtstar/zhongtong/avi/equipment/service/BasicInfoService.java
View file @
dfd97c83
...
@@ -306,6 +306,7 @@ public class BasicInfoService {
...
@@ -306,6 +306,7 @@ public class BasicInfoService {
PageHelper
.
startPage
(
pageFilter
.
getIntValue
(
"pageNum"
),
pageFilter
.
getIntValue
(
"pageSize"
));
PageHelper
.
startPage
(
pageFilter
.
getIntValue
(
"pageNum"
),
pageFilter
.
getIntValue
(
"pageSize"
));
return
mesWorkOrderMapper
.
findList
(
searchService
.
pageFilter2Filter
(
pageFilter
,
new
WhereFilter
(){{
return
mesWorkOrderMapper
.
findList
(
searchService
.
pageFilter2Filter
(
pageFilter
,
new
WhereFilter
(){{
addFilter
(
"status"
,
Operation
.
EQUAL
,
"4"
);
addFilter
(
"status"
,
Operation
.
EQUAL
,
"4"
);
addOrderBy
(
"delivery_date"
,
OrderBy
.
DESC
);
}}),
MesWorkOrderInfo
.
class
);
}}),
MesWorkOrderInfo
.
class
);
}
}
}
}
src/main/java/net/vtstar/zhongtong/avi/equipment/service/EquipStatusRealTimeService.java
View file @
dfd97c83
...
@@ -13,6 +13,7 @@ import net.vtstar.zhongtong.avi.equipment.domain.enums.WorkshopNames;
...
@@ -13,6 +13,7 @@ import net.vtstar.zhongtong.avi.equipment.domain.enums.WorkshopNames;
import
net.vtstar.zhongtong.avi.equipment.mapper.EquipStatusRealTimeMapper
;
import
net.vtstar.zhongtong.avi.equipment.mapper.EquipStatusRealTimeMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -44,7 +45,9 @@ public class EquipStatusRealTimeService {
...
@@ -44,7 +45,9 @@ public class EquipStatusRealTimeService {
* 新增/更新设备状态
* 新增/更新设备状态
*/
*/
public
void
saveEquip
(
String
equipWorkshop
,
String
equipCode
,
String
equipName
,
String
equipState
)
{
public
void
saveEquip
(
String
equipWorkshop
,
String
equipCode
,
String
equipName
,
String
equipState
)
{
if
(
StringUtils
.
isEmpty
(
equipCode
)){
return
;
}
List
<
EquipStatusRealTime
>
list
=
mapper
.
findList
(
new
WhereFilter
()
{{
List
<
EquipStatusRealTime
>
list
=
mapper
.
findList
(
new
WhereFilter
()
{{
addFilter
(
"equip_workshop"
,
Operation
.
EQUAL
,
equipWorkshop
);
addFilter
(
"equip_workshop"
,
Operation
.
EQUAL
,
equipWorkshop
);
addFilter
(
"equip_code"
,
Operation
.
EQUAL
,
equipCode
);
addFilter
(
"equip_code"
,
Operation
.
EQUAL
,
equipCode
);
...
...
src/main/java/net/vtstar/zhongtong/avi/equipment/service/EquipmentService.java
View file @
dfd97c83
...
@@ -214,21 +214,27 @@ public class EquipmentService {
...
@@ -214,21 +214,27 @@ public class EquipmentService {
ip
=
"10.1.4.106"
;
ip
=
"10.1.4.106"
;
path
=
"smb://"
+
ip
+
"/数控下料/"
;
path
=
"smb://"
+
ip
+
"/数控下料/"
;
break
;
break
;
//三维激光切割机
//三维激光切割机
case
"076707-105"
:
case
"076707-105"
:
ip
=
"10.1.25.175"
;
ip
=
"10.1.25.175"
;
path
=
"smb://"
+
ip
+
"/NCPrg/"
;
path
=
"smb://"
+
ip
+
"/NCPrg/"
;
break
;
break
;
//激光切管机
//激光切管机
01
case
"076707-1
46
"
:
case
"076707-1
74
"
:
ip
=
"10.1.25.1
77
"
;
ip
=
"10.1.25.1
82
"
;
path
=
"smb://"
+
ip
+
"
/NCPrg/"
;
path
=
"smb://"
+
ip
+
"/NCPrg/"
;
break
;
break
;
//激光切管机
//激光切管机
02
case
"076707-166"
:
case
"076707-166"
:
ip
=
"10.1.25.176"
;
ip
=
"10.1.25.176"
;
path
=
"smb://"
+
ip
+
"/NCProg/"
;
path
=
"smb://"
+
ip
+
"/NCProg/"
;
break
;
break
;
//激光切管机03(待定)
case
"076707-175"
:
ip
=
"10.1.25.183"
;
path
=
"smb://"
+
ip
+
"/NCPrg/"
;
break
;
//平板激光切割机
//平板激光切割机
case
"076707-114"
:
case
"076707-114"
:
//NCPrg, PA8000
//NCPrg, PA8000
...
@@ -250,6 +256,11 @@ public class EquipmentService {
...
@@ -250,6 +256,11 @@ public class EquipmentService {
ip
=
"10.1.25.181"
;
ip
=
"10.1.25.181"
;
path
=
"smb://"
+
ip
+
"/NcProng/"
;
path
=
"smb://"
+
ip
+
"/NcProng/"
;
break
;
break
;
//平板激光切割机05
case
"076707-146"
:
ip
=
"10.1.25.177"
;
path
=
"smb://"
+
ip
+
"/NCPrg/"
;
break
;
}
}
return
SmbFileUtil
.
smbPut
(
path
,
transferVO
.
getFilePath
(),
auth
);
return
SmbFileUtil
.
smbPut
(
path
,
transferVO
.
getFilePath
(),
auth
);
}
}
...
...
src/main/java/net/vtstar/zhongtong/avi/gateway/painting/job/PaintingRobotMachineJob.java
View file @
dfd97c83
...
@@ -38,7 +38,7 @@ public class PaintingRobotMachineJob extends GatherJob {
...
@@ -38,7 +38,7 @@ public class PaintingRobotMachineJob extends GatherJob {
equipmentData
.
setEquipStatus
(
EquipStatusEnum
.
RUN
);
equipmentData
.
setEquipStatus
(
EquipStatusEnum
.
RUN
);
}
}
if
(
null
!=
data
.
getErrorState
()
&&
data
.
getErrorState
()
==
1
){
if
(
null
!=
data
.
getErrorState
()
&&
data
.
getErrorState
()
==
1
){
equipmentData
.
setEquipStatus
(
EquipStatusEnum
.
ALARM
);
equipmentData
.
setEquipStatus
(
EquipStatusEnum
.
IDLE
);
}
}
if
(
null
!=
data
.
getRunStatusR11
()
&&
data
.
getRunStatusR11
()
==
1
){
if
(
null
!=
data
.
getRunStatusR11
()
&&
data
.
getRunStatusR11
()
==
1
){
equipmentData
.
setEquipStatus
(
EquipStatusEnum
.
RUN
);
equipmentData
.
setEquipStatus
(
EquipStatusEnum
.
RUN
);
...
...
src/main/java/net/vtstar/zhongtong/avi/gateway/painting/job/SprayBoothMachineJob.java
0 → 100644
View file @
dfd97c83
package
net
.
vtstar
.
zhongtong
.
avi
.
gateway
.
painting
.
job
;
import
com.alibaba.fastjson.JSONObject
;
import
io.netty.channel.ConnectTimeoutException
;
import
lombok.extern.slf4j.Slf4j
;
import
net.vtstar.protocol.modbus.tcp.netty.utils.NettyUtils
;
import
net.vtstar.protocol.modbus.tcp.netty.utils.PoolKey
;
import
net.vtstar.scada.base.equipmgt.domain.EquipCommunication
;
import
net.vtstar.scada.base.equipmgt.domain.EquipDataChannel
;
import
net.vtstar.scada.base.equipmgt.domain.EquipDataTemplate
;
import
net.vtstar.scada.base.equipmgt.domain.EquipDataTemplateItem
;
import
net.vtstar.scada.base.equipmgt.service.EquipInfoService
;
import
net.vtstar.scada.base.gather.job.GatherJob
;
import
net.vtstar.scada.base.global.exception.EquipConnectException
;
import
net.vtstar.scada.base.global.service.ModbusService
;
import
net.vtstar.zhongtong.avi.gateway.painting.domain.SprayBoothMachine
;
import
net.vtstar.zhongtong.avi.gateway.painting.mapper.SprayBoothMapper
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
java.util.Date
;
import
java.util.List
;
/**
* 新加喷漆房数据采集JOB
*/
@Slf4j
@Component
public
class
SprayBoothMachineJob
extends
GatherJob
{
@Autowired
private
EquipInfoService
equipInfoService
;
@Autowired
private
ModbusService
modbusService
;
@Autowired
private
SprayBoothMapper
mapper
;
@Override
protected
void
executeInternal
(
JobExecutionContext
context
)
throws
JobExecutionException
{
List
<
EquipCommunication
>
commList
=
equipInfoService
.
getCommunicationList
(
"喷涂房温室度"
,
1
);
if
(
CollectionUtils
.
isEmpty
(
commList
))
{
return
;
}
SprayBoothMachine
equipmentData
=
new
SprayBoothMachine
();
boolean
hasConnError
=
false
;
for
(
EquipCommunication
comm
:
commList
)
{
EquipDataChannel
dataChannel
=
comm
.
getDataChannel
();
String
ip
=
dataChannel
.
getIp
();
Integer
port
=
dataChannel
.
getPort
();
PoolKey
poolKey
=
NettyUtils
.
wrapPoolKey
(
ip
,
port
);
EquipDataTemplate
template
=
comm
.
getDataTemplate
();
if
(
template
==
null
)
{
log
.
error
(
"无法获取设备的数据模板,设备编号:{}"
,
dataChannel
.
getEquipCode
());
continue
;
}
List
<
EquipDataTemplateItem
>
templateItemList
=
template
.
getTemplateItemList
();
if
(
CollectionUtils
.
isEmpty
(
templateItemList
))
{
log
.
error
(
"无法获取数据模板的条目,设备编号:{},模板名称:{}"
,
dataChannel
.
getEquipCode
(),
template
.
getName
());
continue
;
}
try
{
modbusService
.
getMachineAllValue
(
equipmentData
,
templateItemList
,
poolKey
,
dataChannel
.
getNo
(),
this
);
log
.
info
(
"设备:{}, 采集模板:{}"
,
equipmentData
.
getEquipCode
(),
JSONObject
.
toJSONString
(
templateItemList
));
}
catch
(
EquipConnectException
e
)
{
log
.
error
(
"设备连接异常:"
,
e
);
hasConnError
=
true
;
break
;
}
catch
(
ConnectTimeoutException
e
)
{
log
.
error
(
"设备连接超时异常:"
,
e
);
hasConnError
=
true
;
break
;
}
catch
(
IllegalStateException
e
){
log
.
error
(
e
.
getMessage
());
hasConnError
=
true
;
break
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
hasConnError
=
true
;
}
}
if
(
hasConnError
){
log
.
error
(
"获取设备:喷漆房 的采集数据失败!{}"
,
JSONObject
.
toJSONString
(
equipmentData
));
}
else
{
equipmentData
.
setEquipCode
(
"喷漆房"
);
equipmentData
.
setEquipFactory
(
""
);
equipmentData
.
setCreateTime
(
new
Date
());
mapper
.
insert
(
equipmentData
);
}
}
}
src/main/java/net/vtstar/zhongtong/avi/gateway/parts/domain/WeldingRobotWorkstationMachine.java
0 → 100644
View file @
dfd97c83
package
net
.
vtstar
.
zhongtong
.
avi
.
gateway
.
parts
.
domain
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
net.vtstar.scada.base.gather.domain.EquipmentData
;
import
net.vtstar.user.search.Search
;
import
net.vtstar.zhongtong.avi.global.web.Show
;
import
net.vtstar.zhongtong.avi.global.web.domain.enums.FieldType
;
import
javax.persistence.Column
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.util.Date
;
@Data
@Search
(
code
=
"WELDING_ROBOT_WORKSTATION"
)
@ApiModel
(
value
=
"焊接机器人工作站"
,
description
=
"焊接机器人工作站监控数据表"
)
@Table
(
name
=
"eqp_data_welding_robot_workstation"
)
public
class
WeldingRobotWorkstationMachine
extends
EquipmentData
{
@Id
private
Long
id
;
@Show
(
label
=
"设备名称"
)
@Column
(
name
=
"eqp_code"
)
@ApiModelProperty
(
notes
=
"设备名称"
)
private
String
equipCode
;
@Show
(
label
=
"设备编号"
)
@Column
(
name
=
"eqp_name"
)
@ApiModelProperty
(
notes
=
"设备编号"
)
@Search
private
String
alias
;
@Show
(
label
=
"开机时间"
)
@Column
(
name
=
"turn_on_time"
)
@ApiModelProperty
(
notes
=
"开机时间"
)
private
String
turnOnTime
;
@Show
(
label
=
"故障时间"
)
@Column
(
name
=
"fault_time"
)
@ApiModelProperty
(
notes
=
"故障时间"
)
private
String
faultTime
;
@Show
(
label
=
"故障次数"
)
@Column
(
name
=
"fault_num"
)
@ApiModelProperty
(
notes
=
"故障次数"
)
private
Integer
faultNum
;
@Show
(
label
=
"焊接时间"
)
@Column
(
name
=
"welding_time"
)
@ApiModelProperty
(
notes
=
"焊接时间"
)
private
String
weldingTime
;
@Show
(
label
=
"A焊接时间"
)
@Column
(
name
=
"welding_time_a"
)
@ApiModelProperty
(
notes
=
"A焊接时间"
)
private
String
weldingTimeA
;
@Show
(
label
=
"B焊接时间"
)
@Column
(
name
=
"welding_time_b"
)
@ApiModelProperty
(
notes
=
"B焊接时间"
)
private
String
weldingTimeB
;
@Show
(
label
=
"C焊接时间"
)
@Column
(
name
=
"welding_time_c"
)
@ApiModelProperty
(
notes
=
"C焊接时间"
)
private
String
weldingTimeC
;
@Show
(
label
=
"D焊接时间"
)
@Column
(
name
=
"welding_time_d"
)
@ApiModelProperty
(
notes
=
"D焊接时间"
)
private
String
weldingTimeD
;
@Show
(
label
=
"E焊接时间"
)
@Column
(
name
=
"welding_time_e"
)
@ApiModelProperty
(
notes
=
"E焊接时间"
)
private
String
weldingTimeE
;
@Show
(
label
=
"F焊接时间"
)
@Column
(
name
=
"welding_time_f"
)
@ApiModelProperty
(
notes
=
"F焊接时间"
)
private
String
weldingTimeF
;
@Show
(
label
=
"G焊接时间"
)
@Column
(
name
=
"welding_time_g"
)
@ApiModelProperty
(
notes
=
"G焊接时间"
)
private
String
weldingTimeG
;
@Show
(
label
=
"H焊接时间"
)
@Column
(
name
=
"welding_time_h"
)
@ApiModelProperty
(
notes
=
"H焊接时间"
)
private
String
weldingTimeH
;
@Show
(
label
=
"I焊接时间"
)
@Column
(
name
=
"welding_time_i"
)
@ApiModelProperty
(
notes
=
"I焊接时间"
)
private
String
weldingTimeI
;
@Show
(
label
=
"J焊接时间"
)
@Column
(
name
=
"welding_time_j"
)
@ApiModelProperty
(
notes
=
"J焊接时间"
)
private
String
weldingTimeJ
;
@Show
(
label
=
"K焊接时间"
)
@Column
(
name
=
"welding_time_k"
)
@ApiModelProperty
(
notes
=
"K焊接时间"
)
private
String
weldingTimeK
;
@Show
(
label
=
"L焊接时间"
)
@Column
(
name
=
"welding_time_l"
)
@ApiModelProperty
(
notes
=
"L焊接时间"
)
private
String
weldingTimeL
;
@Show
(
label
=
"M焊接时间"
)
@Column
(
name
=
"welding_time_m"
)
@ApiModelProperty
(
notes
=
"M焊接时间"
)
private
String
weldingTimeM
;
@Show
(
label
=
"N焊接时间"
)
@Column
(
name
=
"welding_time_n"
)
@ApiModelProperty
(
notes
=
"N焊接时间"
)
private
String
weldingTimeN
;
@Show
(
label
=
"O焊接时间"
)
@Column
(
name
=
"welding_time_o"
)
@ApiModelProperty
(
notes
=
"O焊接时间"
)
private
String
weldingTimeO
;
@Show
(
label
=
"P焊接时间"
)
@Column
(
name
=
"welding_time_p"
)
@ApiModelProperty
(
notes
=
"P焊接时间"
)
private
String
weldingTimeP
;
@Show
(
label
=
"Q焊接时间"
)
@Column
(
name
=
"welding_time_q"
)
@ApiModelProperty
(
notes
=
"Q焊接时间"
)
private
String
weldingTimeQ
;
@Show
(
label
=
"R焊接时间"
)
@Column
(
name
=
"welding_time_r"
)
@ApiModelProperty
(
notes
=
"R焊接时间"
)
private
String
weldingTimeR
;
@Show
(
label
=
"S焊接时间"
)
@Column
(
name
=
"welding_time_s"
)
@ApiModelProperty
(
notes
=
"S焊接时间"
)
private
String
weldingTimeS
;
@Show
(
label
=
"焊接电流"
)
@Column
(
name
=
"welding_current"
)
@ApiModelProperty
(
notes
=
"焊接电流"
)
private
Integer
weldingCurrent
;
@Show
(
label
=
"耗电量"
)
@Column
(
name
=
"power_consumption"
)
@ApiModelProperty
(
notes
=
"耗电量"
)
private
Integer
powerConsumption
;
@Show
(
label
=
"采集时间"
,
dataType
=
FieldType
.
DATETIME
)
@ApiModelProperty
(
"时间"
)
@Column
(
name
=
"create_time"
)
@Search
private
Date
createTime
;
@Show
(
label
=
"设备位置"
)
@Column
(
name
=
"equip_factory"
)
@ApiModelProperty
(
notes
=
"设备位置"
)
private
String
equipFactory
;
@ApiModelProperty
(
"采集状态"
)
@Column
(
name
=
"status"
)
private
String
status
;
}
src/main/java/net/vtstar/zhongtong/avi/gateway/parts/job/WeldingRobotWorkMachineJob.java
0 → 100644
View file @
dfd97c83
package
net
.
vtstar
.
zhongtong
.
avi
.
gateway
.
parts
.
job
;
import
io.netty.util.internal.StringUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
net.vtstar.scada.base.equipmgt.domain.Enum.EquipStatusEnum
;
import
net.vtstar.scada.base.gather.domain.EquipmentData
;
import
net.vtstar.scada.base.gather.job.GatherJob
;
import
net.vtstar.zhongtong.avi.gateway.parts.domain.DustingLineMachine
;
import
net.vtstar.zhongtong.avi.gateway.parts.domain.WeldingRobotWorkstationMachine
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
/**
* 焊接机器人工作站数据采集JOB
*/
@Slf4j
@Component
public
class
WeldingRobotWorkMachineJob
extends
GatherJob
{
private
static
final
String
NAME
=
"WELDING_ROBOT_WORKSTATION"
;
@Override
protected
void
executeInternal
(
JobExecutionContext
context
)
throws
JobExecutionException
{
super
.
gatherByModbus
(
NAME
,
WeldingRobotWorkstationMachine
.
class
);
}
@Override
public
boolean
handleObject
(
EquipmentData
equipmentData
)
{
WeldingRobotWorkstationMachine
data
=
(
WeldingRobotWorkstationMachine
)
equipmentData
;
String
state
=
data
.
getStatus
();
if
(
state
==
null
||
"0"
.
equals
(
state
))
{
return
false
;
}
equipmentData
.
setEquipStatus
(
EquipStatusEnum
.
RUN
);
return
true
;
}
@Override
public
Object
handleValue
(
String
fieldName
,
Object
value
)
{
//TODO: 对采集数据进行解析
if
(
"turnOnTime"
.
equals
(
fieldName
)
&&
null
!=
value
){
return
null
;
}
return
value
;
}
@Override
protected
void
postHandle
(
EquipmentData
equipmentData
)
{
((
DustingLineMachine
)
equipmentData
).
setCreateTime
(
new
Date
());
}
}
src/main/java/net/vtstar/zhongtong/avi/gateway/stamping/job/FlatLaserCuttingMachineJob.java
View file @
dfd97c83
...
@@ -34,6 +34,7 @@ public class FlatLaserCuttingMachineJob extends QuartzJobBean {
...
@@ -34,6 +34,7 @@ public class FlatLaserCuttingMachineJob extends QuartzJobBean {
private
String
ipAddress2
=
"10.1.25.179"
;
private
String
ipAddress2
=
"10.1.25.179"
;
private
String
ipAddress3
=
"10.1.25.180"
;
private
String
ipAddress3
=
"10.1.25.180"
;
private
String
ipAddress4
=
"10.1.25.181"
;
private
String
ipAddress4
=
"10.1.25.181"
;
private
String
ipAddress5
=
"10.1.25.177"
;
@Value
(
"${zt.ip.pingtimes}"
)
@Value
(
"${zt.ip.pingtimes}"
)
private
int
pingTimes
;
private
int
pingTimes
;
@Value
(
"${zt.ip.timeout}"
)
@Value
(
"${zt.ip.timeout}"
)
...
@@ -50,7 +51,7 @@ public class FlatLaserCuttingMachineJob extends QuartzJobBean {
...
@@ -50,7 +51,7 @@ public class FlatLaserCuttingMachineJob extends QuartzJobBean {
@Override
@Override
protected
void
executeInternal
(
JobExecutionContext
context
)
throws
JobExecutionException
{
protected
void
executeInternal
(
JobExecutionContext
context
)
throws
JobExecutionException
{
List
<
String
>
ipAddressList
=
Arrays
.
asList
(
ipAddress1
,
ipAddress2
,
ipAddress3
,
ipAddress4
);
List
<
String
>
ipAddressList
=
Arrays
.
asList
(
ipAddress1
,
ipAddress2
,
ipAddress3
,
ipAddress4
,
ipAddress5
);
for
(
String
ipAddress
:
ipAddressList
)
{
for
(
String
ipAddress
:
ipAddressList
)
{
String
equipCode
=
""
;
String
equipCode
=
""
;
String
equipName
=
""
;
String
equipName
=
""
;
...
@@ -76,6 +77,11 @@ public class FlatLaserCuttingMachineJob extends QuartzJobBean {
...
@@ -76,6 +77,11 @@ public class FlatLaserCuttingMachineJob extends QuartzJobBean {
equipName
=
"平板激光切割机04"
;
equipName
=
"平板激光切割机04"
;
equipFactory
=
"03北门右侧"
;
equipFactory
=
"03北门右侧"
;
break
;
break
;
case
"10.1.25.177"
:
equipCode
=
"076707-146"
;
equipName
=
"平板激光切割机05"
;
equipFactory
=
"东南门右侧"
;
break
;
}
}
FlatLaserCuttingMachine
machine
=
new
FlatLaserCuttingMachine
();
FlatLaserCuttingMachine
machine
=
new
FlatLaserCuttingMachine
();
machine
.
setAlias
(
equipName
);
machine
.
setAlias
(
equipName
);
...
@@ -103,7 +109,7 @@ public class FlatLaserCuttingMachineJob extends QuartzJobBean {
...
@@ -103,7 +109,7 @@ public class FlatLaserCuttingMachineJob extends QuartzJobBean {
String
laserPower
=
ClientSocketUtil
.
send
(
ipAddress
,
"P102"
);
String
laserPower
=
ClientSocketUtil
.
send
(
ipAddress
,
"P102"
);
//气体压力
//气体压力
String
gasPressure
=
ClientSocketUtil
.
send
(
ipAddress
,
"P107"
);
String
gasPressure
=
ClientSocketUtil
.
send
(
ipAddress
,
"P107"
);
if
(
"0"
.
equals
(
cuttingSpeed
)
&&
"0"
.
equals
(
laserPower
)
&&
"0"
.
equals
(
gasPressure
)){
if
(
"0"
.
equals
(
cuttingSpeed
)
&&
"0"
.
equals
(
laserPower
)
&&
"0"
.
equals
(
gasPressure
))
{
log
.
error
(
"ip: {}能ping通, 但62944端口连接不上"
,
ipAddress
);
log
.
error
(
"ip: {}能ping通, 但62944端口连接不上"
,
ipAddress
);
continue
;
continue
;
}
}
...
...
src/main/java/net/vtstar/zhongtong/avi/gateway/stamping/job/LaserCutting3DMachineJob.java
View file @
dfd97c83
...
@@ -31,6 +31,7 @@ import java.util.List;
...
@@ -31,6 +31,7 @@ import java.util.List;
public
class
LaserCutting3DMachineJob
extends
QuartzJobBean
{
public
class
LaserCutting3DMachineJob
extends
QuartzJobBean
{
private
String
ipAddress1
=
"10.1.25.175"
;
private
String
ipAddress1
=
"10.1.25.175"
;
private
String
ipAddress2
=
"192.168.214.120"
;
@Value
(
"${zt.ip.pingtimes}"
)
@Value
(
"${zt.ip.pingtimes}"
)
private
int
pingTimes
;
private
int
pingTimes
;
@Value
(
"${zt.ip.timeout}"
)
@Value
(
"${zt.ip.timeout}"
)
...
@@ -48,7 +49,7 @@ public class LaserCutting3DMachineJob extends QuartzJobBean {
...
@@ -48,7 +49,7 @@ public class LaserCutting3DMachineJob extends QuartzJobBean {
@Override
@Override
protected
void
executeInternal
(
JobExecutionContext
context
)
throws
JobExecutionException
{
protected
void
executeInternal
(
JobExecutionContext
context
)
throws
JobExecutionException
{
List
<
String
>
ipAddressList
=
Arrays
.
asList
(
ipAddress1
);
List
<
String
>
ipAddressList
=
Arrays
.
asList
(
ipAddress1
,
ipAddress2
);
for
(
String
ipAddress
:
ipAddressList
)
{
for
(
String
ipAddress
:
ipAddressList
)
{
String
equipCode
=
""
;
String
equipCode
=
""
;
String
equipName
=
""
;
String
equipName
=
""
;
...
@@ -59,6 +60,11 @@ public class LaserCutting3DMachineJob extends QuartzJobBean {
...
@@ -59,6 +60,11 @@ public class LaserCutting3DMachineJob extends QuartzJobBean {
equipName
=
"三维激光切割机"
;
equipName
=
"三维激光切割机"
;
equipFactory
=
"01跨东南"
;
equipFactory
=
"01跨东南"
;
break
;
break
;
case
"192.168.214.120"
:
equipCode
=
"076707-176"
;
equipName
=
"五轴三维数控激光切割机"
;
equipFactory
=
"东南门右侧"
;
break
;
}
}
LaserCutting3DMachine
machine
=
new
LaserCutting3DMachine
();
LaserCutting3DMachine
machine
=
new
LaserCutting3DMachine
();
machine
.
setAlias
(
equipName
);
machine
.
setAlias
(
equipName
);
...
...
src/main/java/net/vtstar/zhongtong/avi/gateway/stamping/job/LaserCuttingMachineJob.java
View file @
dfd97c83
...
@@ -30,8 +30,9 @@ import java.util.List;
...
@@ -30,8 +30,9 @@ import java.util.List;
@Component
@Component
public
class
LaserCuttingMachineJob
extends
QuartzJobBean
{
public
class
LaserCuttingMachineJob
extends
QuartzJobBean
{
private
String
ipAddress1
=
"10.1.25.1
77
"
;
private
String
ipAddress1
=
"10.1.25.1
82
"
;
private
String
ipAddress2
=
"10.1.25.176"
;
private
String
ipAddress2
=
"10.1.25.176"
;
private
String
ipAddress3
=
"10.1.25.183"
;
@Value
(
"${zt.ip.pingtimes}"
)
@Value
(
"${zt.ip.pingtimes}"
)
private
int
pingTimes
;
private
int
pingTimes
;
@Value
(
"${zt.ip.timeout}"
)
@Value
(
"${zt.ip.timeout}"
)
...
@@ -48,21 +49,26 @@ public class LaserCuttingMachineJob extends QuartzJobBean {
...
@@ -48,21 +49,26 @@ public class LaserCuttingMachineJob extends QuartzJobBean {
@Override
@Override
protected
void
executeInternal
(
JobExecutionContext
context
)
throws
JobExecutionException
{
protected
void
executeInternal
(
JobExecutionContext
context
)
throws
JobExecutionException
{
List
<
String
>
ipAddressList
=
Arrays
.
asList
(
ipAddress1
,
ipAddress2
);
List
<
String
>
ipAddressList
=
Arrays
.
asList
(
ipAddress1
,
ipAddress2
,
ipAddress3
);
for
(
String
ipAddress
:
ipAddressList
)
{
for
(
String
ipAddress
:
ipAddressList
)
{
String
equipCode
=
""
;
String
equipCode
=
""
;
String
equipName
=
""
;
String
equipName
=
""
;
String
equipFactory
=
""
;
String
equipFactory
=
""
;
switch
(
ipAddress
)
{
switch
(
ipAddress
)
{
case
"10.1.25.1
77
"
:
case
"10.1.25.1
82
"
:
equipCode
=
"076707-1
46
"
;
equipCode
=
"076707-1
74
"
;
equipName
=
"激光切管机01"
;
equipName
=
"激光切管机01"
;
equipFactory
=
"03西北"
;
equipFactory
=
"03西北
门
"
;
break
;
break
;
case
"10.1.25.176"
:
case
"10.1.25.176"
:
equipCode
=
"076707-166"
;
equipCode
=
"076707-166"
;
equipName
=
"激光切管机02"
;
equipName
=
"激光切管机02"
;
equipFactory
=
"03西南"
;
equipFactory
=
"03西南门"
;
break
;
case
"10.1.25.183"
:
equipCode
=
"076707-175"
;
equipName
=
"激光切管机03"
;
equipFactory
=
"04门"
;
break
;
break
;
}
}
LaserCuttingMachine
machine
=
new
LaserCuttingMachine
();
LaserCuttingMachine
machine
=
new
LaserCuttingMachine
();
...
...
src/main/java/net/vtstar/zhongtong/avi/mqtt/handle/RfidMessageHandler.java
View file @
dfd97c83
...
@@ -103,6 +103,9 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
...
@@ -103,6 +103,9 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
if
(
null
==
vehicle
)
{
if
(
null
==
vehicle
)
{
vehicle
=
vehicleCache
.
get
(
vehicleCode
,
Vehicle
.
class
);
vehicle
=
vehicleCache
.
get
(
vehicleCode
,
Vehicle
.
class
);
}
}
if
(
null
==
vehicle
)
{
return
;
}
if
(!
StringUtil
.
isNullOrEmpty
(
id
))
{
if
(!
StringUtil
.
isNullOrEmpty
(
id
))
{
if
(
id
.
length
()
==
30
)
{
if
(
id
.
length
()
==
30
)
{
id
=
id
.
substring
(
0
,
29
);
id
=
id
.
substring
(
0
,
29
);
...
...
src/main/java/net/vtstar/zhongtong/avi/utils/ExpertUtils.java
View file @
dfd97c83
...
@@ -123,7 +123,7 @@ public class ExpertUtils {
...
@@ -123,7 +123,7 @@ public class ExpertUtils {
public
static
File
createNewFile
(){
public
static
File
createNewFile
(){
//读取模板,并赋值到新文件************************************************************
//读取模板,并赋值到新文件************************************************************
//文件模板路径
//文件模板路径
String
fileName
=
"
向阳
生产计划模板"
;
String
fileName
=
"生产计划模板"
;
File
file
=
new
File
(
tempFileHomePath
,
fileName
+
".xls"
);
File
file
=
new
File
(
tempFileHomePath
,
fileName
+
".xls"
);
//新的文件名
//新的文件名
...
...
src/main/resources/config/application-quartz2.properties
View file @
dfd97c83
...
@@ -382,3 +382,10 @@ quartz.job.taskInfos[50].jobGroup=CleanMachineStatusDataJob
...
@@ -382,3 +382,10 @@ quartz.job.taskInfos[50].jobGroup=CleanMachineStatusDataJob
quartz.job.taskInfos[50]
.jobDescription
=
\u
55b7
\u
6d82
\u
673a
\u5668\u
4ebaJob
quartz.job.taskInfos[50]
.jobDescription
=
\u
55b7
\u
6d82
\u
673a
\u5668\u
4ebaJob
quartz.job.taskInfos[50]
.cronExpression
=
0/10 * * * * ?
quartz.job.taskInfos[50]
.cronExpression
=
0/10 * * * * ?
quartz.job.taskInfos[50]
.start
=
true
quartz.job.taskInfos[50]
.start
=
true
#新加喷漆房数据
quartz.job.taskInfos[51]
.jobName
=
net.vtstar.zhongtong.avi.gateway.painting.job.SprayBoothMachineJob
quartz.job.taskInfos[51]
.jobGroup
=
SprayBoothMachineJob
quartz.job.taskInfos[51]
.jobDescription
=
\u
6d82
\u
88c5
\u
55b7
\u
6d82
\u
5ba4Job
quartz.job.taskInfos[51]
.cronExpression
=
0 0/5 * * * ?
quartz.job.taskInfos[51]
.start
=
true
\ No newline at end of file
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