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
afc52e95
Commit
afc52e95
authored
Jul 08, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改造接口增加未接入场站的数据兼容
parent
00c98267
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
6 deletions
+23
-6
MonitoringMapController.java
.../module/jxiop/biz/controller/MonitoringMapController.java
+2
-2
MonitoringServiceIMQTTmpl.java
...ule/jxiop/biz/service/impl/MonitoringServiceIMQTTmpl.java
+1
-1
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+20
-3
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitoringMapController.java
View file @
afc52e95
...
...
@@ -43,14 +43,14 @@ public class MonitoringMapController extends BaseController {
@Autowired
MonitoringServiceImpl
monitoringServiceImpl
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"获取监盘全国地图数据"
)
@GetMapping
(
"/nationwide"
)
public
ResponseModel
<
List
<
RegionNationWideDto
>>
getNationWideInfo
(
@RequestParam
(
value
=
"provinceName"
,
required
=
false
)
String
provinceName
)
{
return
ResponseHelper
.
buildResponse
(
monitoringServiceImpl
.
getNationWideInfo
(
provinceName
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"获取区域电量指标完成情况"
)
@GetMapping
(
"/getCompletionOfPowerIndicatorsByProvinceName"
)
public
ResponseModel
<
ResultsData
>
getCompletionOfPowerIndicatorsByProvinceName
(
@RequestParam
(
required
=
true
)
int
current
,
@RequestParam
(
required
=
true
)
int
size
,
@RequestParam
(
required
=
true
)
String
provinceName
)
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceIMQTTmpl.java
View file @
afc52e95
...
...
@@ -95,7 +95,7 @@ public class MonitoringServiceIMQTTmpl {
logger
.
error
(
"--------------------------区域实时数据消息开始发送----------------------------------------------"
);
List
<
SocialContributionDto
>
socialContributionDtoList
=
new
ArrayList
<>();
Region
region
=
this
.
regionMapper
.
selectOne
(
new
QueryWrapper
<
Region
>().
eq
(
"level"
,
1
).
eq
(
"region_name"
,
"江西省"
));
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
like
(
"belong_area"
,
region
.
getRegionCode
()));
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
like
(
"belong_area"
,
region
.
getRegionCode
())
.
isNotNull
(
"fan_gateway_id"
)
);
//日发电量
AtomicReference
<
Double
>
dailyPower
=
new
AtomicReference
<>(
0.0
);
//月发电量
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceImpl.java
View file @
afc52e95
...
...
@@ -101,8 +101,14 @@ public class MonitoringServiceImpl {
});
regionNationWideDto
.
setFengdian
(
fengdian
.
toString
());
regionNationWideDto
.
setGuangfu
(
guangfu
.
toString
());
regionNationWideDto
.
setGuangfuMW
(
"0"
);
regionNationWideDto
.
setFengdianMV
(
"0"
);
if
(!
ObjectUtils
.
isEmpty
(
guangfuMW
.
get
()))
{
regionNationWideDto
.
setGuangfuMW
(
guangfuMW
.
toString
());
}
if
(!
ObjectUtils
.
isEmpty
(
fengdianMW
.
get
()))
{
regionNationWideDto
.
setFengdianMV
(
fengdianMW
.
toString
());
}
regionNationWideDto
.
setName
(
region
.
getRegionName
());
regionNationWideDtoList
.
add
(
regionNationWideDto
);
}
...
...
@@ -116,8 +122,8 @@ public class MonitoringServiceImpl {
}
Region
region
=
this
.
regionMapper
.
selectOne
(
new
QueryWrapper
<
Region
>().
eq
(
"level"
,
1
).
eq
(
"region_name"
,
provinceName
));
List
<
StationBasic
>
list
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
like
(
"belong_area"
,
region
.
getRegionCode
()));
HashMap
<
String
,
Double
>
hashMap
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
HashMap
<
String
,
Double
>
hashMap
=
new
HashMap
<>();
StationBasic
stationBasic
=
list
.
get
(
i
);
RegionNationWideDto
regionNationWideDto
=
new
RegionNationWideDto
();
regionNationWideDto
.
setStaitionId
(
String
.
valueOf
(
stationBasic
.
getSequenceNbr
()));
...
...
@@ -129,13 +135,13 @@ public class MonitoringServiceImpl {
speendOrirradiate
=
String
.
valueOf
(
commonServiceImpl
.
getAvgvalueByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"30秒平均风速"
));
regionNationWideDto
.
setSpeendOrirradiate
(
speendOrirradiate
);
}
else
{
regionNationWideDto
.
setSpeendOrirradiate
(
String
.
valueOf
(
Math
.
random
()
*
1000
));
regionNationWideDto
.
setSpeendOrirradiate
(
String
.
valueOf
(
Math
.
random
()
*
100
));
regionNationWideDto
.
setStationCapacity
(
"0"
);
}
StationCoordinate
stationCoordinate
=
stationCoordinateMapper
.
selectOne
(
new
QueryWrapper
<
StationCoordinate
>().
eq
(
"station_id"
,
stationBasic
.
getSequenceNbr
()).
eq
(
"is_main_coordinate"
,
0
));
hashMap
.
put
(
"lng"
,
Double
.
valueOf
(
stationCoordinate
.
getLongitude
()));
hashMap
.
put
(
"lat"
,
Double
.
valueOf
(
stationCoordinate
.
getLaitude
()));
regionNationWideDto
.
setPosition
(
hashMap
);
regionNationWideDtoList
.
add
(
regionNationWideDto
);
}
...
...
@@ -167,12 +173,23 @@ public class MonitoringServiceImpl {
stationBasicList
.
forEach
(
stationBasic
->
{
CompletionOfPowerIndicatorsDto
completionOfPowerIndicatorsDto
=
new
CompletionOfPowerIndicatorsDto
();
completionOfPowerIndicatorsDto
.
setStationName
(
stationBasic
.
getStationName
());
completionOfPowerIndicatorsDto
.
setInstallCapactity
(
"0"
);
if
(
getStationCaPACITYL
(
stationBasic
.
getStationNumber
())
!=
null
)
{
completionOfPowerIndicatorsDto
.
setInstallCapactity
(
String
.
valueOf
(
getStationCaPACITYL
(
stationBasic
.
getStationNumber
())));
}
try
{
completionOfPowerIndicatorsDto
.
setWindSpeedOrIrradiance
(
String
.
valueOf
(
commonServiceImpl
.
getAvgvalueByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"30秒平均风速"
)));
completionOfPowerIndicatorsDto
.
setActivePower
(
String
.
valueOf
(
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"有功功率"
)));
completionOfPowerIndicatorsDto
.
setDailyPower
(
String
.
valueOf
(
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"日发电量"
)));
completionOfPowerIndicatorsDto
.
setMonthlyPower
(
String
.
valueOf
(
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"月发电量"
)));
completionOfPowerIndicatorsDto
.
setAnnualPower
(
String
.
valueOf
(
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"年发电量"
)));
}
catch
(
Exception
exception
)
{
completionOfPowerIndicatorsDto
.
setWindSpeedOrIrradiance
(
"0"
);
completionOfPowerIndicatorsDto
.
setActivePower
(
"0"
);
completionOfPowerIndicatorsDto
.
setDailyPower
(
"0"
);
completionOfPowerIndicatorsDto
.
setMonthlyPower
(
"0"
);
completionOfPowerIndicatorsDto
.
setAnnualPower
(
"0"
);
}
completionOfPowerIndicatorsDtoList
.
add
(
completionOfPowerIndicatorsDto
);
});
Integer
allsize
=
completionOfPowerIndicatorsDtoList
.
size
();
...
...
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