Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
94eb0740
Commit
94eb0740
authored
Jul 13, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口增加
parent
bf67ec0e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
182 additions
and
2 deletions
+182
-2
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+51
-0
IndicatorsDto.java
...yeejoin/amos/boot/module/jxiop/biz/dto/IndicatorsDto.java
+1
-0
SjglZsjZsbtzMapper.java
...mos/boot/module/jxiop/biz/mapper2/SjglZsjZsbtzMapper.java
+6
-0
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+109
-2
SjglZsjZsbtzMapper.xml
.../src/main/resources/mapper/cluster/SjglZsjZsbtzMapper.xml
+15
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
94eb0740
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.RunRecord
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.RunRecord
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto
;
...
@@ -248,5 +250,54 @@ public class MonitorFanIdxController extends BaseController {
...
@@ -248,5 +250,54 @@ public class MonitorFanIdxController extends BaseController {
return
ResponseHelper
.
buildResponse
(
result
);
return
ResponseHelper
.
buildResponse
(
result
);
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"升压站光字牌/开关-通用"
)
@GetMapping
(
"/getStatusGzp"
)
public
ResponseModel
<
IPage
<
Map
<
String
,
Object
>>>
getStatusGzp
(
@RequestParam
(
value
=
"stationId"
,
required
=
true
)
String
stationId
,
String
frontModule
,
String
systemType
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
gatewayId
=
stationBasic
.
getBoosterGatewayId
();
List
<
Map
<
String
,
Object
>>
statusMonitoring
=
monitorFanIndicator
.
getStatusGzp
(
gatewayId
,
systemType
,
frontModule
);
IPage
<
Map
<
String
,
Object
>>
result
=
new
Page
<>();
result
.
setRecords
(
statusMonitoring
);
result
.
setCurrent
(
1
);
result
.
setTotal
(
statusMonitoring
.
size
());
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"集电线路图左侧 集电线列表"
)
@GetMapping
(
"/jdTree"
)
public
ResponseModel
<
IPage
<
Map
<
String
,
Object
>>>
getStatusJDX
(
@RequestParam
(
value
=
"stationId"
,
required
=
true
)
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
gatewayId
=
stationBasic
.
getBoosterGatewayId
();
String
werks
=
stationBasic
.
getStationNumber
();
monitorFanIndicator
.
getStatusJDX
(
gatewayId
,
"集电线"
,
werks
,
stationBasic
.
getSequenceNbr
().
toString
());
return
CommonResponseUtil
.
success
();
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"集电线路图右侧 风机列表"
)
@GetMapping
(
"/fjList"
)
public
ResponseModel
getListByFJ
()
{
LambdaQueryWrapper
<
StationBasic
>
wrapper
=
new
LambdaQueryWrapper
<>();
List
<
StationBasic
>
stationBasics
=
stationBasicMapper
.
selectList
(
wrapper
);
for
(
StationBasic
stationBasic
:
stationBasics
)
{
String
gatewayId
=
stationBasic
.
getFanGatewayId
();
String
werks
=
stationBasic
.
getStationNumber
();
monitorFanIndicator
.
getListByFJ
(
gatewayId
,
werks
,
stationBasic
.
getSequenceNbr
().
toString
());
}
return
CommonResponseUtil
.
success
();
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/dto/IndicatorsDto.java
View file @
94eb0740
...
@@ -25,6 +25,7 @@ public class IndicatorsDto {
...
@@ -25,6 +25,7 @@ public class IndicatorsDto {
private
String
valueLabel
;
private
String
valueLabel
;
private
String
distinct
;
private
String
distinct
;
private
String
time
;
private
String
time
;
private
String
displayName
;
public
String
getTime
()
{
public
String
getTime
()
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/SjglZsjZsbtzMapper.java
View file @
94eb0740
...
@@ -4,6 +4,9 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
...
@@ -4,6 +4,9 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 设备基本信息 Mapper 接口
* 设备基本信息 Mapper 接口
*
*
...
@@ -19,4 +22,7 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
...
@@ -19,4 +22,7 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
*/
*/
Double
getStationCapactityByStationWerks
(
String
WERKS
);
Double
getStationCapactityByStationWerks
(
String
WERKS
);
List
<
Map
<
String
,
Object
>>
getStationInfoMapByStationWerks
(
String
WERKS
,
String
DATAID
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
94eb0740
...
@@ -26,11 +26,15 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.TemporaryDataMapper;
...
@@ -26,11 +26,15 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.TemporaryDataMapper;
import
com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils
;
import
com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IMonitorFanIndicator
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IMonitorFanIndicator
;
import
com.yeejoin.amos.component.robot.BadRequest
;
import
com.yeejoin.amos.component.robot.BadRequest
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.elasticsearch.common.recycler.Recycler
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.*
;
...
@@ -43,6 +47,7 @@ import java.util.stream.Collectors;
...
@@ -43,6 +47,7 @@ import java.util.stream.Collectors;
*/
*/
@Service
@Service
@EnableScheduling
@EnableScheduling
@Slf4j
public
class
MonitorFanIndicatorImpl
implements
IMonitorFanIndicator
{
public
class
MonitorFanIndicatorImpl
implements
IMonitorFanIndicator
{
@Autowired
@Autowired
...
@@ -73,6 +78,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -73,6 +78,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
@Autowired
@Autowired
TemporaryDataServiceImpl
temporaryDataService
;
TemporaryDataServiceImpl
temporaryDataService
;
@Autowired
EmqKeeper
emqKeeper
;
@Override
@Override
public
void
UpdateMonitorFanIndicator
(
List
<
IndexDto
>
list
)
{
public
void
UpdateMonitorFanIndicator
(
List
<
IndexDto
>
list
)
{
...
@@ -559,5 +567,105 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -559,5 +567,105 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
}
public
List
<
Map
<
String
,
Object
>>
getStatusGzp
(
String
gatewayId
,
String
systemType
,
String
frontModule
){
String
sql
=
" SELECT displayName , value as state FROM indicators_"
+
gatewayId
+
" WHERE frontModule =~/"
+
frontModule
+
"/ and systemType = '"
+
systemType
+
"'"
;
List
<
IndicatorsDto
>
listData
=
influxDButils
.
getListData
(
sql
,
IndicatorsDto
.
class
);
List
<
Map
<
String
,
Object
>>
statusMaps
=
new
ArrayList
<>();
for
(
IndicatorsDto
listDatum
:
listData
)
{
Map
<
String
,
Object
>
statusMap
=
new
HashMap
<>();
statusMap
.
put
(
"data"
,
statusMap
.
get
(
"displayName"
));
statusMap
.
put
(
"title"
,
statusMap
.
get
(
"displayName"
));
statusMap
.
put
(
"state"
,
statusMap
.
get
(
"state"
).
equals
(
"true"
)?
1
:
0
);
statusMap
.
put
(
"title"
,
statusMap
.
get
(
"state"
).
equals
(
"true"
)?
"断"
:
"通"
);
statusMaps
.
add
(
statusMap
);
}
return
statusMaps
;
}
public
void
getStatusJDX
(
String
gatewayId
,
String
dataName
,
String
werks
,
String
stationId
){
String
sql
=
" SELECT * FROM indicators_"
+
gatewayId
+
" WHERE frontModule =~/集电线路/ and systemType = '光字牌'"
;
List
<
IndicatorsDto
>
listData
=
influxDButils
.
getListData
(
sql
,
IndicatorsDto
.
class
);
TpriDmpDatabook
tpriDmpDatabookByDataName
=
tpriDmpDatabookServiceImpl
.
getTpriDmpDatabookByDataName
(
dataName
);
List
<
SjglZsjZsbtz
>
sjglZsjZsbtzList
=
sjglZsjZsbtzServiceImpl
.
getSjglZsjZsbtzList
(
tpriDmpDatabookByDataName
.
getDataid
(),
werks
);
List
<
Map
<
String
,
Object
>>
statusMaps
=
new
ArrayList
<>();
Map
<
String
,
List
<
IndicatorsDto
>>
collect
=
listData
.
stream
().
collect
(
Collectors
.
groupingBy
(
IndicatorsDto:
:
getFrontModule
));
for
(
String
s
:
collect
.
keySet
())
{
Map
<
String
,
Object
>
statusMap
=
new
HashMap
<>();
String
[]
split
=
s
.
replace
(
"#"
,
""
).
replace
(
"保护测控装置"
,
""
).
split
(
"集电线路"
);
for
(
SjglZsjZsbtz
listDatum
:
sjglZsjZsbtzList
)
{
statusMap
.
put
(
"title"
,
listDatum
.
getSbmc
().
replace
(
"风机系统"
,
""
));
String
[]
strings
=
listDatum
.
getSbbm
().
split
(
" "
);
if
(
Integer
.
parseInt
(
strings
[
1
])
==
Integer
.
parseInt
(
split
[
0
]))
{
String
sql1
=
" SELECT * FROM indicators_"
+
gatewayId
+
" WHERE displayName = '"
+
split
[
1
]+
"断路器合位'"
;
List
<
IndicatorsDto
>
listData1
=
influxDButils
.
getListData
(
sql1
,
IndicatorsDto
.
class
);
statusMap
.
put
(
"type"
,
listData1
.
get
(
0
).
getValue
());
statusMap
.
put
(
"position"
,
split
[
1
]+
"开关位置"
);
}
statusMap
.
put
(
"power"
,
"有功 (kW)"
);
statusMap
.
put
(
"windSpeed"
,
"风速 (m/s)"
);
}
statusMaps
.
add
(
statusMap
);
}
IPage
<
Map
<
String
,
Object
>>
result
=
new
Page
<>();
result
.
setRecords
(
statusMaps
);
result
.
setCurrent
(
1
);
result
.
setTotal
(
statusMaps
.
size
());
try
{
emqKeeper
.
getMqttClient
().
publish
(
stationId
+
"/fxqTree"
,
JSON
.
toJSONString
(
result
).
getBytes
(),
0
,
false
);
}
catch
(
MqttException
e
)
{
log
.
info
(
"消息发送失败"
);
e
.
printStackTrace
();
}
}
public
void
getListByFJ
(
String
gatewayId
,
String
werks
,
String
stationId
){
String
sql
=
" SELECT * FROM indicators_"
+
gatewayId
+
" WHERE equipmentIndexName ='瞬时风速' "
;
String
sql1
=
" SELECT * FROM indicators_"
+
gatewayId
+
" WHERE equipmentIndexName ='有功功率'"
;
List
<
IndicatorsDto
>
listData
=
influxDButils
.
getListData
(
sql
,
IndicatorsDto
.
class
);
List
<
IndicatorsDto
>
listData1
=
influxDButils
.
getListData
(
sql1
,
IndicatorsDto
.
class
);
TpriDmpDatabook
tpriDmpDatabook
=
tpriDmpDatabookServiceImpl
.
getTpriDmpDatabookByDataName
(
"风机"
);
List
<
Map
<
String
,
Object
>>
dataMaps
=
sjglZsjZsbtzServiceImpl
.
sjglZsjZsbtzMapper
.
getStationInfoMapByStationWerks
(
werks
,
tpriDmpDatabook
.
getDataid
().
toString
());
int
i
=
0
;
for
(
Map
<
String
,
Object
>
dataMap
:
dataMaps
)
{
List
<
String
>
numList
=
Arrays
.
asList
(
dataMap
.
get
(
"equipNum"
).
toString
().
split
(
","
));
List
<
Map
<
String
,
Object
>>
statusMaps
=
new
ArrayList
<>();
for
(
IndicatorsDto
listDatum
:
listData
)
{
for
(
IndicatorsDto
indicatorsDto
:
listData1
)
{
if
(
listDatum
.
getEquipmentNumber
().
equals
(
indicatorsDto
.
getEquipmentNumber
())){
listDatum
.
setValueLabel
(
indicatorsDto
.
getValue
());
}
}
for
(
String
num
:
numList
)
{
if
(
Integer
.
parseInt
(
num
)
==
Integer
.
parseInt
(
listDatum
.
getEquipmentNumber
())){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"title"
,
listDatum
.
getEquipmentNumber
());
map
.
put
(
"power"
,
listDatum
.
getValue
());
map
.
put
(
"windSpeed"
,
listDatum
.
getValueLabel
());
statusMaps
.
add
(
map
);
}
}
}
IPage
<
Map
<
String
,
Object
>>
result
=
new
Page
<>();
result
.
setRecords
(
statusMaps
);
result
.
setCurrent
(
1
);
result
.
setTotal
(
statusMaps
.
size
());
i
+=
1
;
try
{
emqKeeper
.
getMqttClient
().
publish
(
stationId
+
"/fj/group"
+
i
,
JSON
.
toJSONString
(
result
).
getBytes
(),
0
,
false
);
}
catch
(
MqttException
e
)
{
log
.
info
(
"消息发送失败"
);
e
.
printStackTrace
();
}
}
}
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/resources/mapper/cluster/SjglZsjZsbtzMapper.xml
View file @
94eb0740
...
@@ -4,4 +4,19 @@
...
@@ -4,4 +4,19 @@
<select
id=
"getStationCapactityByStationWerks"
resultType=
"Double"
>
<select
id=
"getStationCapactityByStationWerks"
resultType=
"Double"
>
select SUM(CAPACITYL) from sjgl_zsj_zsbtz where WERKS = #{WERKS}
select SUM(CAPACITYL) from sjgl_zsj_zsbtz where WERKS = #{WERKS}
</select>
</select>
<select
id=
"getStationInfoMapByStationWerks"
resultType=
"map"
>
SELECT LEFT
( SBMC, 4 ) AS NAME,
GROUP_CONCAT(REPLACE (REPLACE( substring( SBMC, 5 ),'风机系统', '' ) ,"#","" )) as equipNum
FROM
`sjgl_zsj_zsbtz`
WHERE
MACHGENRE = #{DATAID} and WERKS = #{WERKS}
GROUP BY
FSB
</select>
</mapper>
</mapper>
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