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
9d2e04a8
Commit
9d2e04a8
authored
Aug 30, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
功率曲线新增风机、光伏的负载率计算
parent
7faa34f3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
10 deletions
+27
-10
DemoController.java
...amos/boot/module/jxiop/biz/controller/DemoController.java
+2
-1
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+6
-6
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+4
-1
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+15
-2
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/DemoController.java
View file @
9d2e04a8
...
...
@@ -64,6 +64,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
import
java.text.SimpleDateFormat
;
...
...
@@ -83,7 +84,7 @@ public class DemoController extends BaseController {
@Autowired
TestServiceImpl
testServiceimpl
;
@
Autowired
@
Resource
InfluxDbConnection
influxDbConnection
;
@Autowired
...
...
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 @
9d2e04a8
...
...
@@ -688,12 +688,12 @@ public class MonitorFanIdxController extends BaseController {
public
ResponseModel
<
Map
<
String
,
String
>>
getStatisticsInfo
(
@RequestParam
(
value
=
"equipmentIndexName"
,
required
=
false
)
String
equipmentIndexName
,
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
,
@RequestParam
(
value
=
"stationType"
,
required
=
false
)
String
stationType
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
gatewayId
=
stationBasic
.
getFanGatewayId
();
if
(
null
!=
stationType
){
gatewayId
=
stationBasic
.
getBoosterGatewayId
();
}
return
ResponseHelper
.
buildResponse
(
monitorFanIndicator
.
getStatisticsInfo
(
gatewayId
,
equipmentIndexName
));
//
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
//
String gatewayId = stationBasic.getFanGatewayId();
//
if (null != stationType){
//
gatewayId = stationBasic.getBoosterGatewayId();
//
}
return
ResponseHelper
.
buildResponse
(
monitorFanIndicator
.
getStatisticsInfo
(
stationId
,
equipmentIndexName
));
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
9d2e04a8
...
...
@@ -33,6 +33,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.ObjectUtils
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
public
class
CommonServiceImpl
{
...
...
@@ -308,9 +309,11 @@ public class CommonServiceImpl {
throw
new
RuntimeException
(
e
);
}
}
return
stationCacheInfoDtoList
;
}
public
StationCacheInfoDto
getStationCacheInfoDtoByStationId
(
String
stationId
){
return
getListStationCacheInfoDto
().
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getStationId
().
equals
(
stationId
)).
collect
(
Collectors
.
toList
()).
get
(
0
);
}
public
String
getFanDevicePrefix
(
String
stationid
){
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationid
);
return
PinyinUtil
.
getFirstLetter
(
stationBasic
.
getStationName
().
split
(
"风"
)[
0
],
""
).
toUpperCase
(
Locale
.
ROOT
);
...
...
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 @
9d2e04a8
...
...
@@ -28,6 +28,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SystemEnumMapper;
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.service.IMonitorFanIndicator
;
import
com.yeejoin.amos.component.influxdb.InfluxdbUtil
;
import
com.yeejoin.amos.component.robot.BadRequest
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -71,6 +72,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
@Autowired
InfluxDButils
influxDButils
;
@Autowired
InfluxdbUtil
influxdbUtil
;
@Autowired
SystemEnumMapper
systemEnumMapper
;
...
...
@@ -1473,8 +1476,18 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
return
resultMap
;
}
public
Map
<
String
,
String
>
getStatisticsInfo
(
String
gatewayId
,
String
equipmentIndexName
)
{
return
temporaryDataMapper
.
getStatisticsInfo
(
gatewayId
,
equipmentIndexName
);
public
Map
<
String
,
String
>
getStatisticsInfo
(
String
equipmentIndexName
,
String
stationId
)
{
StationCacheInfoDto
stationCacheInfoDto
=
commonServiceImpl
.
getStationCacheInfoDtoByStationId
(
stationId
);
String
gatewayId
=
stationCacheInfoDto
.
getFanGatewayId
();
if
(!
"FDZ"
.
equals
(
stationCacheInfoDto
.
getStationType
())){
gatewayId
=
stationCacheInfoDto
.
getBoosterGatewayId
();
}
String
sql
=
"SELECT value FROM indicators_"
+
stationCacheInfoDto
.
getBoosterGatewayId
()
+
" WHERE equipmentIndexName='220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值' or equipmentIndexName='南瑞光差保护_313P'"
;
List
<
Map
<
String
,
Object
>>
resultList
=
influxdbUtil
.
query
(
sql
);
String
load
=
String
.
format
(
"%.2f"
,
Double
.
parseDouble
(
String
.
valueOf
(
resultList
.
get
(
0
).
get
(
"value"
)))/
Double
.
parseDouble
(
stationCacheInfoDto
.
getInstalledCapacity
()));
Map
<
String
,
String
>
result
=
temporaryDataMapper
.
getStatisticsInfo
(
gatewayId
,
equipmentIndexName
);
result
.
put
(
"load"
,
load
);
return
result
;
}
...
...
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