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
4acb85ae
Commit
4acb85ae
authored
Oct 28, 2019
by
喻训浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: avi修改
parent
fe0b27c7
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
412 additions
and
9 deletions
+412
-9
PaintshopStation.java
...star/zhongtong/avi/equipment/domain/PaintshopStation.java
+5
-0
EquipmentService.java
...tar/zhongtong/avi/equipment/service/EquipmentService.java
+12
-0
LedController.java
...tstar/zhongtong/avi/ledlamp/controller/LedController.java
+1
-0
LedStationVO.java
.../vtstar/zhongtong/avi/ledlamp/domain/vo/LedStationVO.java
+3
-0
PDAController.java
...ar/zhongtong/avi/monitoring/controller/PDAController.java
+17
-4
Vehicle.java
...a/net/vtstar/zhongtong/avi/monitoring/domain/Vehicle.java
+27
-0
Warning.java
...a/net/vtstar/zhongtong/avi/monitoring/domain/Warning.java
+11
-0
AVIMonitorJob.java
...et/vtstar/zhongtong/avi/monitoring/job/AVIMonitorJob.java
+130
-4
ReportController.java
...tar/zhongtong/avi/report/controller/ReportController.java
+158
-0
EquStatePercent.java
...tstar/zhongtong/avi/report/domain/vo/EquStatePercent.java
+18
-0
TrendVO.java
...va/net/vtstar/zhongtong/avi/report/domain/vo/TrendVO.java
+27
-0
application-dev-yxh.properties
src/main/resources/config/application-dev-yxh.properties
+2
-0
application-quartz.properties
src/main/resources/config/application-quartz.properties
+1
-1
No files found.
src/main/java/net/vtstar/zhongtong/avi/equipment/domain/PaintshopStation.java
View file @
4acb85ae
...
...
@@ -82,4 +82,9 @@ public class PaintshopStation {
@ApiModelProperty
(
value
=
"车体类型"
)
private
ProductionType
busType
;
@ApiModelProperty
(
notes
=
"旧状态"
,
hidden
=
true
)
private
StationState
oldState
;
}
src/main/java/net/vtstar/zhongtong/avi/equipment/service/EquipmentService.java
View file @
4acb85ae
package
net
.
vtstar
.
zhongtong
.
avi
.
equipment
.
service
;
import
net.vtstar.user.mybatis.provider.Operation
;
import
net.vtstar.user.mybatis.provider.OrderBy
;
import
net.vtstar.user.mybatis.provider.WhereFilter
;
import
net.vtstar.user.search.controller.vo.SearchVo
;
import
net.vtstar.zhongtong.avi.equipment.domain.EquipInfo
;
import
net.vtstar.zhongtong.avi.equipment.domain.PaintshopStation
;
import
net.vtstar.zhongtong.avi.equipment.domain.RuntimeRecord
;
import
net.vtstar.zhongtong.avi.equipment.mapper.EquipmentDataMapper
;
import
net.vtstar.zhongtong.avi.stamping.domain.LaserCuttingMachine
;
import
org.apache.poi.hssf.util.HSSFColor
;
import
org.apache.poi.ss.usermodel.BorderStyle
;
...
...
@@ -27,6 +34,8 @@ public class EquipmentService {
@Autowired
private
EquipmentService
equipmentService
;
@Autowired
private
EquipmentDataMapper
dataMapper
;
public
<
T
>
T
findRealTimeData
(
SearchVo
pageFilter
)
{
List
<
LaserCuttingMachine
>
ma
=
new
ArrayList
<>();
...
...
@@ -39,6 +48,9 @@ public class EquipmentService {
machine
.
setCreateTime
(
new
Date
());
machine
.
setLaserPower
(
new
BigDecimal
(
77777
));
ma
.
add
(
machine
);
List
<
PaintshopStation
>
sequence
=
dataMapper
.
findList
(
new
WhereFilter
()
{{
addOrderBy
(
PaintshopStation
.
class
,
"sequence"
,
OrderBy
.
ASC
);
}},
PaintshopStation
.
class
);
return
(
T
)
ma
;
}
...
...
src/main/java/net/vtstar/zhongtong/avi/ledlamp/controller/LedController.java
View file @
4acb85ae
...
...
@@ -31,6 +31,7 @@ public class LedController {
@GetMapping
(
value
=
"/ledInfo"
)
private
Return
getLEDStationInfo
(
@RequestParam
(
value
=
"ledNo"
)
String
ledNo
)
{
LedStationVO
ledStationVO
=
new
LedStationVO
();
ledStationVO
.
setName
(
"电泳"
);
ArrayList
<
Warning
>
warnings
=
new
ArrayList
<>();
Warning
warning
=
new
Warning
();
warning
.
setInfo
(
"报警信息1111111111111111111111111111111111111"
);
...
...
src/main/java/net/vtstar/zhongtong/avi/ledlamp/domain/vo/LedStationVO.java
View file @
4acb85ae
...
...
@@ -16,6 +16,9 @@ public class LedStationVO {
@ApiModelProperty
(
value
=
""
)
private
Long
id
;
@ApiModelProperty
(
value
=
"大屏显示名字"
)
private
String
name
;
@ApiModelProperty
(
value
=
"进车数"
)
private
BigDecimal
busIn
;
...
...
src/main/java/net/vtstar/zhongtong/avi/monitoring/controller/PDAController.java
View file @
4acb85ae
...
...
@@ -20,11 +20,24 @@ public class PDAController {
@Autowired
private
PDAService
pdaService
;
@ApiOperation
(
value
=
"pda扫码请求"
)
@PostMapping
(
"/bound"
)
private
Return
Bound
(
@RequestParam
(
"busOrderNo"
)
String
busOrderNo
){
@ApiOperation
(
value
=
"焊装车间钣金上撬请求"
)
@PostMapping
(
"/hanzhuang/bound"
)
private
Return
hanZhuangBound
(
@RequestParam
(
"vehicleNo"
)
String
vehicleNo
,
@RequestParam
(
"busNo"
)
String
busNo
)
{
return
Return
.
success
();
}
@ApiOperation
(
value
=
"换撬请求"
)
@PostMapping
(
"/change/skid"
)
private
Return
changeSkid
(
@RequestParam
(
"sourceStation"
)
String
sourceStation
,
@RequestParam
(
"targetStation"
)
String
targetStation
)
{
return
Return
.
success
();
}
@ApiOperation
(
value
=
"返修车请求"
)
@PostMapping
(
"/repair"
)
private
Return
repair
(
@RequestParam
(
"busNo"
)
String
busNo
)
{
pdaService
.
bound
(
busOrderNo
);
return
Return
.
success
();
}
}
src/main/java/net/vtstar/zhongtong/avi/monitoring/domain/Vehicle.java
0 → 100644
View file @
4acb85ae
package
net
.
vtstar
.
zhongtong
.
avi
.
monitoring
.
domain
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@ApiModel
(
"平移车"
)
@Data
public
class
Vehicle
{
private
Long
id
;
@ApiModelProperty
(
notes
=
"平移车编号"
)
private
String
code
;
@ApiModelProperty
(
notes
=
"左侧有无车信号"
)
private
Boolean
leftSignal
;
@ApiModelProperty
(
notes
=
"右侧有无车信号"
)
private
Boolean
rightSignal
;
@ApiModelProperty
(
notes
=
"当前左侧所在车道"
)
private
String
leftLane
;
@ApiModelProperty
(
notes
=
"当前右侧所在车道"
)
private
String
rightLane
;
}
src/main/java/net/vtstar/zhongtong/avi/monitoring/domain/Warning.java
View file @
4acb85ae
...
...
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
@Data
@ApiModel
(
value
=
"报警信息"
)
public
class
Warning
{
...
...
@@ -15,4 +17,13 @@ public class Warning {
@ApiModelProperty
(
value
=
"警告名"
)
private
String
name
;
@ApiModelProperty
(
value
=
"时间(前端用)"
)
private
String
time
;
@ApiModelProperty
(
value
=
"设备名"
)
private
String
equipName
;
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Date
createTime
;
}
src/main/java/net/vtstar/zhongtong/avi/monitoring/job/AVIMonitorJob.java
View file @
4acb85ae
package
net
.
vtstar
.
zhongtong
.
avi
.
monitoring
.
job
;
import
lombok.extern.slf4j.Slf4j
;
import
net.vtstar.protocol.modbus.tcp.netty.packet.ReadCoilsResponse
;
import
net.vtstar.protocol.modbus.tcp.netty.packet.ReadMultipleRegistersResponse
;
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.*
;
import
net.vtstar.scada.base.equipmgt.service.EquipInfoService
;
import
net.vtstar.scada.base.gather.job.GatherJob
;
import
net.vtstar.scada.base.global.service.ModbusService
;
import
net.vtstar.user.mybatis.provider.Operation
;
import
net.vtstar.user.mybatis.provider.WhereFilter
;
import
net.vtstar.zhongtong.avi.equipment.domain.PaintshopStation
;
import
net.vtstar.zhongtong.avi.equipment.mapper.PaintshopStationMapper
;
import
net.vtstar.zhongtong.avi.monitoring.domain.Vehicle
;
import
net.vtstar.zhongtong.avi.monitoring.domain.enums.StationState
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.Cache
;
import
org.springframework.data.redis.core.HashOperations
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@Component
public
class
AVIMonitorJob
extends
GatherJob
{
private
static
final
String
NAME
=
"AVI_PLC"
;
private
static
final
String
EQUIPMENT_TYPE
=
"PLC"
;
@Autowired
private
EquipInfoService
equipInfoService
;
@Autowired
private
PaintshopStationMapper
stationMapper
;
@Autowired
private
ModbusService
modbusService
;
@Resource
(
name
=
"stationCache"
)
private
Cache
stationCache
;
@Resource
(
name
=
"redisTemplate"
)
protected
HashOperations
hashOperations
;
@Override
protected
void
executeInternal
(
JobExecutionContext
jobExecutionC
ontext
)
throws
JobExecutionException
{
protected
void
executeInternal
(
JobExecutionContext
c
ontext
)
throws
JobExecutionException
{
log
.
info
(
"_______________________________________________________________"
);
log
.
info
(
"AVIMonitorJob start..."
);
List
<
EquipInfo
>
equipInfoList
=
equipInfoService
.
getEquipInfoList
(
EQUIPMENT_TYPE
);
if
(
CollectionUtils
.
isEmpty
(
equipInfoList
))
{
return
;
}
equipInfoList
.
forEach
(
equipInfo
->
{
List
<
EquipCommunication
>
commList
=
equipInfoService
.
getCommunicationList
(
equipInfo
.
getEquipCode
(),
1
);
if
(
CollectionUtils
.
isEmpty
(
commList
))
{
return
;
}
for
(
EquipCommunication
communication
:
commList
)
{
EquipDataChannel
dataChannel
=
communication
.
getDataChannel
();
String
ip
=
dataChannel
.
getIp
();
Integer
port
=
dataChannel
.
getPort
();
PoolKey
poolKey
=
NettyUtils
.
wrapPoolKey
(
ip
,
port
);
Integer
slaveId
=
dataChannel
.
getNo
();
EquipDataTemplate
template
=
communication
.
getDataTemplate
();
if
(
template
==
null
)
{
log
.
info
(
"无法获取设备的数据模板,设备编号:{}"
,
dataChannel
.
getEquipCode
());
continue
;
}
List
<
EquipDataTemplateItem
>
templateItemList
=
template
.
getTemplateItemList
();
if
(
CollectionUtils
.
isEmpty
(
templateItemList
))
{
log
.
info
(
"无法获取数据模板的条目,设备编号:{},模板名称:{}"
,
dataChannel
.
getEquipCode
(),
template
.
getName
());
continue
;
}
List
<
List
<
EquipDataTemplateItem
>>
lists
=
modbusService
.
groupByAddress
(
templateItemList
);
for
(
List
<
EquipDataTemplateItem
>
itemList
:
lists
)
{
EquipDataTemplateItem
startTemplate
=
itemList
.
get
(
0
);
Integer
startAddress
=
startTemplate
.
getAddress
();
Integer
endAddress
=
itemList
.
get
(
itemList
.
size
()
-
1
).
getAddress
();
Integer
quantity
=
itemList
.
get
(
itemList
.
size
()
-
1
).
getLength
();
Integer
count
=
endAddress
+
quantity
-
startAddress
;
if
(
1
==
startTemplate
.
getFunctionCode
())
{
try
{
ReadCoilsResponse
response
=
modbusService
.
readCoilRegister
(
slaveId
,
poolKey
,
startAddress
,
count
);
Map
<
String
,
PaintshopStation
>
stationMap
=
stationCache
.
get
(
"station"
,
HashMap
.
class
);
for
(
EquipDataTemplateItem
item
:
itemList
)
{
String
fieldName
=
item
.
getFieldName
();
if
(
fieldName
.
startsWith
(
"stationState"
))
{
String
stationCode
=
fieldName
.
split
(
"_"
)[
1
];
PaintshopStation
station
=
stationCache
.
get
(
stationCode
,
PaintshopStation
.
class
);
byte
state
=
response
.
getBody
().
readByte
();
station
.
setOldState
(
station
.
getState
());
station
.
setState
(
state
==
0
?
StationState
.
FREE
:
StationState
.
USE
);
stationMap
.
put
(
stationCode
,
station
);
}
if
(
fieldName
.
startsWith
(
"vehicle_signal"
))
{
String
[]
split
=
fieldName
.
split
(
"_"
);
String
vehicleCode
=
split
[
3
];
Map
<
String
,
Vehicle
>
map
=
hashOperations
.
entries
(
"vehicle_signal"
);
Vehicle
vehicle
=
map
.
get
(
vehicleCode
);
byte
state
=
response
.
getBody
().
readByte
();
if
(
split
[
2
].
equals
(
"left"
))
{
vehicle
.
setLeftSignal
(
state
==
0
?
true
:
false
);
}
if
(
split
[
2
].
equals
(
"right"
))
{
vehicle
.
setRightSignal
(
state
==
0
?
true
:
false
);
}
}
}
stationCache
.
put
(
"station"
,
stationMap
);
}
catch
(
Exception
e
)
{
log
.
info
(
"读取失败。ip{},端口{},slave{},start{}"
,
poolKey
.
getHost
(),
poolKey
.
getPort
(),
slaveId
,
startAddress
);
}
}
if
(
3
==
startTemplate
.
getFunctionCode
())
{
try
{
ReadMultipleRegistersResponse
response
=
modbusService
.
readMultipleRegister
(
slaveId
,
poolKey
,
startAddress
,
count
);
}
catch
(
Exception
e
)
{
log
.
info
(
"读取失败。ip{},端口{},slave{},start{}"
,
poolKey
.
getHost
(),
poolKey
.
getPort
(),
slaveId
,
startAddress
);
}
}
}
}
});
}
public
Object
handleValue
(
String
fieldName
,
Object
value
)
{
if
(
fieldName
.
startsWith
(
"stationState"
))
{
String
stationCode
=
fieldName
.
split
(
"_"
)[
1
];
List
<
PaintshopStation
>
stationList
=
stationMapper
.
findList
(
new
WhereFilter
()
{{
addFilter
(
"code"
,
Operation
.
EQUAL
,
stationCode
);
}},
PaintshopStation
.
class
);
if
(
CollectionUtils
.
isEmpty
(
stationList
))
{
throw
new
IllegalArgumentException
(
"找不到编号为:"
+
stationCode
+
":的工位!"
);
}
PaintshopStation
station
=
stationList
.
get
(
0
);
Integer
state
=
(
Integer
)
value
;
station
.
setState
(
state
==
0
?
StationState
.
FREE
:
StationState
.
USE
);
}
//if (fieldName.startsWith())
return
value
;
}
}
src/main/java/net/vtstar/zhongtong/avi/report/controller/ReportController.java
0 → 100644
View file @
4acb85ae
package
net
.
vtstar
.
zhongtong
.
avi
.
report
.
controller
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
net.vtstar.utils.domain.Return
;
import
net.vtstar.zhongtong.avi.monitoring.domain.Warning
;
import
net.vtstar.zhongtong.avi.report.domain.vo.EquStatePercent
;
import
net.vtstar.zhongtong.avi.report.domain.vo.TrendVO
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
@Slf4j
@Api
(
description
=
"中控室监控页面"
)
@RestController
@RequestMapping
(
"/area"
)
public
class
ReportController
{
@ApiOperation
(
value
=
"设备利用率"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"beginTime"
,
value
=
"起始日期"
,
dataType
=
"date"
,
paramType
=
"query"
,
example
=
"2019-01-23T07:26:06.742Z"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"截止日期"
,
dataType
=
"date"
,
paramType
=
"query"
,
example
=
"2019-03-23T07:26:06.742Z"
)
})
@GetMapping
(
"/oeu"
)
private
Return
getOeu
(
@RequestParam
(
value
=
"beginTime"
,
required
=
false
)
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE_TIME
)
Date
beginTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE_TIME
)
Date
endTime
)
{
return
Return
.
success
(
new
BigDecimal
(
53.2
));
}
@ApiOperation
(
value
=
"设备故障率"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"beginTime"
,
value
=
"起始日期"
,
dataType
=
"date"
,
paramType
=
"query"
,
example
=
"2019-01-23T07:26:06.742Z"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"截止日期"
,
dataType
=
"date"
,
paramType
=
"query"
,
example
=
"2019-03-23T07:26:06.742Z"
)
})
@GetMapping
(
"/efr"
)
private
Return
getOeuTrend
(
@RequestParam
(
value
=
"beginTime"
,
required
=
false
)
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE_TIME
)
Date
beginTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE_TIME
)
Date
endTime
)
{
return
Return
.
success
(
new
BigDecimal
(
5.2
));
}
@ApiOperation
(
value
=
"设备利用率趋势图"
,
response
=
TrendVO
.
class
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"beginTime"
,
value
=
"起始日期"
,
dataType
=
"date"
,
paramType
=
"query"
,
example
=
"2019-01-23T07:26:06.742Z"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"截止日期"
,
dataType
=
"date"
,
paramType
=
"query"
,
example
=
"2019-03-23T07:26:06.742Z"
)
})
@GetMapping
(
"/oeuTrend"
)
private
Return
getEfr
(
@RequestParam
(
value
=
"beginTime"
,
required
=
false
)
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE_TIME
)
Date
beginTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE_TIME
)
Date
endTime
)
{
List
<
TrendVO
>
trendVOS
=
new
ArrayList
<>();
for
(
int
i
=
1
;
i
<
5
;
i
++)
{
TrendVO
trendVO
=
new
TrendVO
();
trendVO
.
setDate
(
"20190"
+
i
);
trendVO
.
setPercent
(
new
BigDecimal
(
i
));
trendVOS
.
add
(
trendVO
);
}
return
Return
.
success
(
trendVOS
);
}
@ApiOperation
(
value
=
"设备故障率趋势图"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"beginTime"
,
value
=
"起始日期"
,
dataType
=
"date"
,
paramType
=
"query"
,
example
=
"2019-01-23T07:26:06.742Z"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"截止日期"
,
dataType
=
"date"
,
paramType
=
"query"
,
example
=
"2019-03-23T07:26:06.742Z"
)
})
@GetMapping
(
"/efrTrend"
)
private
Return
getEfrTrend
(
@RequestParam
(
value
=
"beginTime"
,
required
=
false
)
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE_TIME
)
Date
beginTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE_TIME
)
Date
endTime
)
{
List
<
TrendVO
>
trendVOS
=
new
ArrayList
<>();
for
(
int
i
=
1
;
i
<
5
;
i
++)
{
TrendVO
trendVO
=
new
TrendVO
();
trendVO
.
setDate
(
"20190"
+
i
);
trendVO
.
setPercent
(
new
BigDecimal
(
i
));
trendVOS
.
add
(
trendVO
);
}
return
Return
.
success
(
trendVOS
);
}
@ApiOperation
(
value
=
"设备运行状态"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"beginTime"
,
value
=
"起始日期"
,
dataType
=
"date"
,
paramType
=
"query"
,
example
=
"2019-01-23T07:26:06.742Z"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"截止日期"
,
dataType
=
"date"
,
paramType
=
"query"
,
example
=
"2019-03-23T07:26:06.742Z"
)
})
@GetMapping
(
"/equState"
)
private
Return
getEquState
(
@RequestParam
(
value
=
"beginTime"
,
required
=
false
)
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE_TIME
)
Date
beginTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE_TIME
)
Date
endTime
)
{
ArrayList
<
EquStatePercent
>
percents
=
new
ArrayList
<>();
EquStatePercent
percent
=
new
EquStatePercent
();
percent
.
setName
(
"故障"
);
percent
.
setValue
(
BigDecimal
.
valueOf
(
8
));
EquStatePercent
percent2
=
new
EquStatePercent
();
percent2
.
setName
(
"运行"
);
percent2
.
setValue
(
BigDecimal
.
valueOf
(
70
));
EquStatePercent
percent3
=
new
EquStatePercent
();
percent3
.
setName
(
"待机"
);
percent3
.
setValue
(
BigDecimal
.
valueOf
(
22
));
percents
.
add
(
percent
);
percents
.
add
(
percent2
);
percents
.
add
(
percent3
);
return
Return
.
success
(
percents
);
}
@ApiOperation
(
value
=
"设备状态趋势图"
,
response
=
TrendVO
.
class
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"beginTime"
,
value
=
"起始日期"
,
dataType
=
"date"
,
paramType
=
"query"
,
example
=
"2019-01-23T07:26:06.742Z"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"截止日期"
,
dataType
=
"date"
,
paramType
=
"query"
,
example
=
"2019-03-23T07:26:06.742Z"
)
})
@GetMapping
(
"/stateTrend"
)
private
Return
getEquStateTrend
(
@RequestParam
(
value
=
"beginTime"
,
required
=
false
)
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE_TIME
)
Date
beginTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE_TIME
)
Date
endTime
)
{
ArrayList
<
TrendVO
>
percents
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
TrendVO
trendVO
=
new
TrendVO
();
trendVO
.
setDate
(
"20190"
+
i
);
trendVO
.
setRunStatePercent
(
BigDecimal
.
valueOf
(
30
));
trendVO
.
setErrorStatePercent
(
BigDecimal
.
valueOf
(
10
));
trendVO
.
setLoadStatePercent
(
BigDecimal
.
valueOf
(
60
));
percents
.
add
(
trendVO
);
}
return
Return
.
success
(
percents
);
}
@ApiOperation
(
"设备异常列表"
)
@GetMapping
(
"/warningList"
)
private
Return
getWarningList
(){
Date
date
=
new
Date
();
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"HH:mm"
);
String
time
=
format
.
format
(
date
);
List
<
Warning
>
warnings
=
new
ArrayList
<>();
Warning
warning
=
new
Warning
();
warning
.
setTime
(
time
);
warning
.
setInfo
(
"设备停止运动"
);
warning
.
setEquipName
(
"旋转棍床"
);
warning
.
setTime
(
time
);
Warning
warning1
=
new
Warning
();
warning1
.
setEquipName
(
"前处理"
);
warning1
.
setTime
(
time
);
warning1
.
setInfo
(
"设备发生异常"
);
warnings
.
add
(
warning
);
warnings
.
add
(
warning1
);
return
Return
.
success
(
warnings
);
}
}
src/main/java/net/vtstar/zhongtong/avi/report/domain/vo/EquStatePercent.java
0 → 100644
View file @
4acb85ae
package
net
.
vtstar
.
zhongtong
.
avi
.
report
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
@ApiModel
(
"设备运行时间占比"
)
public
class
EquStatePercent
{
@ApiModelProperty
(
"状态名"
)
private
String
name
;
@ApiModelProperty
(
"运行时占比"
)
private
BigDecimal
value
;
}
src/main/java/net/vtstar/zhongtong/avi/report/domain/vo/TrendVO.java
0 → 100644
View file @
4acb85ae
package
net
.
vtstar
.
zhongtong
.
avi
.
report
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
@ApiModel
(
"效率趋势vo"
)
public
class
TrendVO
{
@ApiModelProperty
(
"x轴文字显示"
)
private
String
date
;
@ApiModelProperty
(
"y轴百分比"
)
private
BigDecimal
percent
;
@ApiModelProperty
(
"运行状态百分比"
)
private
BigDecimal
runStatePercent
;
@ApiModelProperty
(
"故障状态百分比"
)
private
BigDecimal
errorStatePercent
;
@ApiModelProperty
(
"待机状态百分比"
)
private
BigDecimal
loadStatePercent
;
}
src/main/resources/config/application-dev-yxh.properties
View file @
4acb85ae
...
...
@@ -29,6 +29,8 @@ spring.torque.sqlserver.jdbc-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=At
spring.torque.sqlserver.username
=
admin
spring.torque.sqlserver.password
=
123456
spring.resources.static-locations
=
classpath:/META-INF/resources/,file:///D:/productWeb/zhongtong/static
# redis
spring.redis.host
=
10.100.172.14
spring.redis.port
=
6379
...
...
src/main/resources/config/application-quartz.properties
View file @
4acb85ae
...
...
@@ -45,7 +45,7 @@ quartz.job.taskInfos[8].jobName=net.vtstar.zhongtong.avi.gateway.parts.job.Dusti
quartz.job.taskInfos[8]
.jobGroup
=
DustingLineMachineJob
quartz.job.taskInfos[8]
.jobDescription
=
\u
55b7
\u
7c89
\u
7ebfJob
quartz.job.taskInfos[8]
.cronExpression
=
0 0/5 * * * ?
quartz.job.taskInfos[8]
.start
=
tru
e
quartz.job.taskInfos[8]
.start
=
fals
e
#前处理
quartz.job.taskInfos[9]
.jobName
=
net.vtstar.zhongtong.avi.gateway.parts.job.PretreamentMachineJob
...
...
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