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
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
7 deletions
+36
-7
StationBasic.java
...ejoin/amos/boot/module/jxiop/api/entity/StationBasic.java
+0
-0
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
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 {
...
@@ -177,6 +177,8 @@ public class CommonConstans {
public
static
final
String
YEAR_GEN_ATTAINMENT_RATE
=
"年计划完成率"
;
public
static
final
String
YEAR_GEN_ATTAINMENT_RATE
=
"年计划完成率"
;
//年利用小时数
//年利用小时数
public
static
final
String
YEAR_GEN_HOURS
=
"年利用小时数"
;
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 {
...
@@ -516,7 +516,8 @@ public class DemoController extends BaseController {
@GetMapping
(
"/testFeignCall"
)
@GetMapping
(
"/testFeignCall"
)
public
List
<
CoreValuesDto
>
testFeignCall
()
{
public
List
<
CoreValuesDto
>
testFeignCall
()
{
List
<
CoreValuesDto
>
coreValuesDtos
=
coreCommonService
.
getValuesByStationNamesAndPointsNames
(
null
,
null
);
List
<
CoreValuesDto
>
coreValuesDtos
=
coreCommonService
.
getValuesByStationNamesAndPointsNames
(
null
,
null
);
monitorService
.
getTotalData
();
// monitorService.getTotalData();
monitorService
.
getNationWideInfo
(
"江西省"
,
"gis"
);
// Double sum = coreCommonService.getSumOfByPointName(coreValuesDtos, CommonConstans.DAY_POWER_GENERATION);
// Double sum = coreCommonService.getSumOfByPointName(coreValuesDtos, CommonConstans.DAY_POWER_GENERATION);
// Double avg = coreCommonService.getAverageOfByPointName(coreValuesDtos, CommonConstans.DAY_POWER_GENERATION);
// Double avg = coreCommonService.getAverageOfByPointName(coreValuesDtos, CommonConstans.DAY_POWER_GENERATION);
return
coreValuesDtos
;
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
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -31,4 +32,8 @@ public class StationCacheInfoDto implements Serializable {
...
@@ -31,4 +32,8 @@ public class StationCacheInfoDto implements Serializable {
private
String
areaCode
;
private
String
areaCode
;
//
//
private
String
address
;
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
;
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.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.List
;
import
java.util.stream.Collectors
;
public
interface
CoreCommonService
{
public
interface
CoreCommonService
{
/**
/**
...
@@ -26,4 +34,5 @@ public interface CoreCommonService {
...
@@ -26,4 +34,5 @@ public interface CoreCommonService {
* @return
* @return
*/
*/
Double
getAverageOfByPointName
(
List
<
CoreValuesDto
>
coreValuesDtoList
,
String
pointName
);
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
;
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
interface
MonitorService
{
public
void
getTotalData
();
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
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
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.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.feign.CoreFeignClient
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.CoreCommonService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.CoreCommonService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -19,14 +25,15 @@ import java.util.stream.Collectors;
...
@@ -19,14 +25,15 @@ import java.util.stream.Collectors;
public
class
CoreCommonServiceImpl
implements
CoreCommonService
{
public
class
CoreCommonServiceImpl
implements
CoreCommonService
{
private
final
CoreFeignClient
coreFeignClient
;
private
final
CoreFeignClient
coreFeignClient
;
@Override
@Override
public
List
<
CoreValuesDto
>
getValuesByStationNamesAndPointsNames
(
String
stationNames
,
String
pointsNames
)
{
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
<
Object
>
list
=
feignClientResult
.
getResult
();
List
<
CoreValuesDto
>
result
=
new
ArrayList
<>();
List
<
CoreValuesDto
>
result
=
new
ArrayList
<>();
list
.
forEach
(
o
->
{
list
.
forEach
(
o
->
{
CoreValuesDto
coreValuesDto
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
o
),
CoreValuesDto
.
class
);
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
.
setDataMap
(
coreValuesDto
.
getData
().
stream
().
flatMap
(
m
->
m
.
entrySet
().
stream
()).
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getKey
,
Map
.
Entry
::
getValue
,
(
a
,
b
)
->
b
)));
result
.
add
(
coreValuesDto
);
result
.
add
(
coreValuesDto
);
});
});
return
result
;
return
result
;
...
@@ -35,7 +42,7 @@ public class CoreCommonServiceImpl implements CoreCommonService {
...
@@ -35,7 +42,7 @@ public class CoreCommonServiceImpl implements CoreCommonService {
@Override
@Override
public
Double
getSumOfByPointName
(
List
<
CoreValuesDto
>
coreValuesDtoList
,
String
pointName
)
{
public
Double
getSumOfByPointName
(
List
<
CoreValuesDto
>
coreValuesDtoList
,
String
pointName
)
{
AtomicReference
<
Double
>
result
=
new
AtomicReference
<>(
0.0
);
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
->
{
coreValuesDtoList
.
forEach
(
coreValuesDto
->
{
result
.
set
(
result
.
get
()
+
Double
.
parseDouble
(
coreValuesDto
.
getDataMap
().
get
(
pointName
).
toString
()));
result
.
set
(
result
.
get
()
+
Double
.
parseDouble
(
coreValuesDto
.
getDataMap
().
get
(
pointName
).
toString
()));
});
});
...
@@ -45,11 +52,11 @@ public class CoreCommonServiceImpl implements CoreCommonService {
...
@@ -45,11 +52,11 @@ public class CoreCommonServiceImpl implements CoreCommonService {
@Override
@Override
public
Double
getAverageOfByPointName
(
List
<
CoreValuesDto
>
coreValuesDtoList
,
String
pointName
)
{
public
Double
getAverageOfByPointName
(
List
<
CoreValuesDto
>
coreValuesDtoList
,
String
pointName
)
{
AtomicReference
<
Double
>
result
=
new
AtomicReference
<>(
0.0
);
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
->
{
coreValuesDtoList
.
forEach
(
coreValuesDto
->
{
result
.
set
(
result
.
get
()
+
Double
.
parseDouble
(
coreValuesDto
.
getDataMap
().
get
(
pointName
).
toString
()));
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