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
4ce938c7
Commit
4ce938c7
authored
Apr 01, 2024
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.运行监盘全国地图、省份地图接口接入物联监盘。
parent
fa6882c4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
38 additions
and
9 deletions
+38
-9
StationBasic.java
...ejoin/amos/boot/module/jxiop/api/entity/StationBasic.java
+2
-2
CommonConstans.java
.../amos/boot/module/jxiop/biz/constants/CommonConstans.java
+2
-0
DemoController.java
...amos/boot/module/jxiop/biz/controller/DemoController.java
+2
-1
StationCacheInfoDto.java
...n/amos/boot/module/jxiop/biz/dto/StationCacheInfoDto.java
+5
-0
CoreCommonService.java
...amos/boot/module/jxiop/biz/service/CoreCommonService.java
+9
-0
MonitorService.java
...in/amos/boot/module/jxiop/biz/service/MonitorService.java
+5
-0
CoreCommonServiceImpl.java
.../module/jxiop/biz/service/impl/CoreCommonServiceImpl.java
+13
-6
MonitorServiceImpl.java
...oot/module/jxiop/biz/service/impl/MonitorServiceImpl.java
+0
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/entity/StationBasic.java
View file @
4ce938c7
...
...
@@ -163,12 +163,12 @@ public class StationBasic extends BaseEntity {
* 前置网关配置的场站名称
*/
@TableField
(
"station_core_name"
)
private
String
stationCoreName
;
private
String
stationCoreName
;
/**
* 前置配置的升压站名称
*/
@TableField
(
"booster_core_name"
)
private
String
boosterCoreName
;
private
String
boosterCoreName
;
/**
* 装机容量
*/
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/constants/CommonConstans.java
View file @
4ce938c7
...
...
@@ -177,6 +177,8 @@ public class CommonConstans {
public
static
final
String
YEAR_GEN_ATTAINMENT_RATE
=
"年计划完成率"
;
//年利用小时数
public
static
final
String
YEAR_GEN_HOURS
=
"年利用小时数"
;
public
static
final
String
WIND_SPEED_THIRTY_SECONDS
=
"30秒平均风速"
;
public
static
final
String
TOTAL_RADIATION
=
"辐照度"
;
//------------------监盘服务改造新增常量结束------------------------------
...
...
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 @
4ce938c7
...
...
@@ -516,7 +516,8 @@ public class DemoController extends BaseController {
@GetMapping
(
"/testFeignCall"
)
public
List
<
CoreValuesDto
>
testFeignCall
()
{
List
<
CoreValuesDto
>
coreValuesDtos
=
coreCommonService
.
getValuesByStationNamesAndPointsNames
(
null
,
null
);
monitorService
.
getTotalData
();
// monitorService.getTotalData();
monitorService
.
getNationWideInfo
(
"江西省"
,
"gis"
);
// Double sum = coreCommonService.getSumOfByPointName(coreValuesDtos, CommonConstans.DAY_POWER_GENERATION);
// Double avg = coreCommonService.getAverageOfByPointName(coreValuesDtos, CommonConstans.DAY_POWER_GENERATION);
return
coreValuesDtos
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/dto/StationCacheInfoDto.java
View file @
4ce938c7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -31,4 +32,8 @@ public class StationCacheInfoDto implements Serializable {
private
String
areaCode
;
//
private
String
address
;
private
String
stationCoreName
;
private
String
boosterCoreName
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/CoreCommonService.java
View file @
4ce938c7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.MapRegion
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.Region
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.CoreValuesDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.StationCacheInfoDto
;
import
org.springframework.util.ObjectUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
public
interface
CoreCommonService
{
/**
...
...
@@ -26,4 +34,5 @@ public interface CoreCommonService {
* @return
*/
Double
getAverageOfByPointName
(
List
<
CoreValuesDto
>
coreValuesDtoList
,
String
pointName
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/MonitorService.java
View file @
4ce938c7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.RegionNationWideDto
;
import
java.util.List
;
public
interface
MonitorService
{
public
void
getTotalData
();
public
List
<
RegionNationWideDto
>
getNationWideInfo
(
String
provinceName
,
String
type
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CoreCommonServiceImpl.java
View file @
4ce938c7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.MapRegion
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.Region
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.CoreValuesDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.StationCacheInfoDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.feign.CoreFeignClient
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.CoreCommonService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -19,14 +25,15 @@ import java.util.stream.Collectors;
public
class
CoreCommonServiceImpl
implements
CoreCommonService
{
private
final
CoreFeignClient
coreFeignClient
;
@Override
public
List
<
CoreValuesDto
>
getValuesByStationNamesAndPointsNames
(
String
stationNames
,
String
pointsNames
)
{
FeignClientResult
<
List
<
Object
>>
feignClientResult
=
coreFeignClient
.
getValues
(
stationNames
,
pointsNames
);
FeignClientResult
<
List
<
Object
>>
feignClientResult
=
coreFeignClient
.
getValues
(
stationNames
,
pointsNames
);
List
<
Object
>
list
=
feignClientResult
.
getResult
();
List
<
CoreValuesDto
>
result
=
new
ArrayList
<>();
list
.
forEach
(
o
->
{
CoreValuesDto
coreValuesDto
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
o
),
CoreValuesDto
.
class
);
coreValuesDto
.
setDataMap
(
coreValuesDto
.
getData
().
stream
().
flatMap
(
m
->
m
.
entrySet
().
stream
()).
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getKey
,
Map
.
Entry
::
getValue
,(
a
,
b
)->
b
)));
CoreValuesDto
coreValuesDto
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
o
),
CoreValuesDto
.
class
);
coreValuesDto
.
setDataMap
(
coreValuesDto
.
getData
().
stream
().
flatMap
(
m
->
m
.
entrySet
().
stream
()).
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getKey
,
Map
.
Entry
::
getValue
,
(
a
,
b
)
->
b
)));
result
.
add
(
coreValuesDto
);
});
return
result
;
...
...
@@ -35,7 +42,7 @@ public class CoreCommonServiceImpl implements CoreCommonService {
@Override
public
Double
getSumOfByPointName
(
List
<
CoreValuesDto
>
coreValuesDtoList
,
String
pointName
)
{
AtomicReference
<
Double
>
result
=
new
AtomicReference
<>(
0.0
);
coreValuesDtoList
=
coreValuesDtoList
.
stream
().
filter
(
coreValuesDto
->
coreValuesDto
.
getDataMap
().
size
()>
0
&&
coreValuesDto
.
getDataMap
().
containsKey
(
pointName
)).
collect
(
Collectors
.
toList
());
coreValuesDtoList
=
coreValuesDtoList
.
stream
().
filter
(
coreValuesDto
->
coreValuesDto
.
getDataMap
().
size
()
>
0
&&
coreValuesDto
.
getDataMap
().
containsKey
(
pointName
)).
collect
(
Collectors
.
toList
());
coreValuesDtoList
.
forEach
(
coreValuesDto
->
{
result
.
set
(
result
.
get
()
+
Double
.
parseDouble
(
coreValuesDto
.
getDataMap
().
get
(
pointName
).
toString
()));
});
...
...
@@ -45,11 +52,11 @@ public class CoreCommonServiceImpl implements CoreCommonService {
@Override
public
Double
getAverageOfByPointName
(
List
<
CoreValuesDto
>
coreValuesDtoList
,
String
pointName
)
{
AtomicReference
<
Double
>
result
=
new
AtomicReference
<>(
0.0
);
coreValuesDtoList
=
coreValuesDtoList
.
stream
().
filter
(
coreValuesDto
->
coreValuesDto
.
getDataMap
().
size
()>
0
&&
coreValuesDto
.
getDataMap
().
containsKey
(
pointName
)).
collect
(
Collectors
.
toList
());
coreValuesDtoList
=
coreValuesDtoList
.
stream
().
filter
(
coreValuesDto
->
coreValuesDto
.
getDataMap
().
size
()
>
0
&&
coreValuesDto
.
getDataMap
().
containsKey
(
pointName
)).
collect
(
Collectors
.
toList
());
coreValuesDtoList
.
forEach
(
coreValuesDto
->
{
result
.
set
(
result
.
get
()
+
Double
.
parseDouble
(
coreValuesDto
.
getDataMap
().
get
(
pointName
).
toString
()));
});
return
result
.
get
()
/
coreValuesDtoList
.
size
();
return
result
.
get
()
/
coreValuesDtoList
.
size
();
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorServiceImpl.java
View file @
4ce938c7
This diff is collapsed.
Click to expand it.
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