Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
a9691c08
Commit
a9691c08
authored
Jul 01, 2024
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改部盾接口
parent
5d169bb4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
9 deletions
+44
-9
Constants.java
...om/yeejoin/amos/boot/module/jxiop/api/util/Constants.java
+3
-0
HttpRequestUtil.java
...join/amos/boot/module/jxiop/api/util/HttpRequestUtil.java
+14
-0
LargeScreenImpl.java
...s/boot/module/jxiop/biz/service/impl/LargeScreenImpl.java
+0
-0
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+27
-9
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/util/Constants.java
View file @
a9691c08
...
@@ -81,6 +81,9 @@ public class Constants {
...
@@ -81,6 +81,9 @@ public class Constants {
public
static
final
String
get_generated_quota_trend
=
"method=scene_screen.data_interface.get_generated_quota_trend"
;
public
static
final
String
get_generated_quota_trend
=
"method=scene_screen.data_interface.get_generated_quota_trend"
;
public
static
final
String
get_province_station_item
=
"method=scene_screen.data_interface.get_province_station_item"
;
public
static
final
String
get_province_station_item
=
"method=scene_screen.data_interface.get_province_station_item"
;
public
static
final
String
get_day_generation_trend
=
"method=scene_screen.data_interface.get_day_generation_trend"
;
public
static
final
String
get_day_generation_trend
=
"method=scene_screen.data_interface.get_day_generation_trend"
;
public
static
final
String
get_quota_info
=
"method=scene_screen.large_screen.get_quota_info"
;
public
static
final
String
get_station_actual_installed_capacity
=
"method=scene_screen.large_screen.get_station_actual_installed_capacity"
;
public
static
final
String
get_quota_complate_info
=
"method=scene_screen.large_screen.get_quota_complate_info"
;
public
static
final
String
resovleRule_data
=
"data"
;
public
static
final
String
resovleRule_data
=
"data"
;
public
static
final
String
areaChinese
=
"区域"
;
public
static
final
String
areaChinese
=
"区域"
;
}
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/util/HttpRequestUtil.java
View file @
a9691c08
...
@@ -66,4 +66,18 @@ public class HttpRequestUtil {
...
@@ -66,4 +66,18 @@ public class HttpRequestUtil {
}
}
return
result
;
return
result
;
}
}
public
JSONObject
getResPonse
(
String
apiurl
,
String
requestMethod
,
String
requestParmInfo
,
String
ResultResolveRule
)
{
String
response
=
""
;
String
params
=
""
;
JSONObject
jsonObject
=
null
;
try
{
response
=
sendRequest
(
requestMethod
,
apiurl
,
requestParmInfo
,
null
);
jsonObject
=
JSONObject
.
parseObject
(
response
);
jsonObject
=
jsonObject
.
getJSONObject
(
ResultResolveRule
);
}
catch
(
Exception
exception
)
{
return
jsonObject
;
}
return
jsonObject
;
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/LargeScreenImpl.java
View file @
a9691c08
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceImpl.java
View file @
a9691c08
...
@@ -3,11 +3,14 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
...
@@ -3,11 +3,14 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.*
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.*
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.*
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.*
;
import
com.yeejoin.amos.boot.module.jxiop.api.util.Constants
;
import
com.yeejoin.amos.boot.module.jxiop.api.util.HttpRequestUtil
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments
;
import
com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans
;
import
com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.*
;
...
@@ -26,6 +29,8 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
...
@@ -26,6 +29,8 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -75,6 +80,9 @@ public class MonitoringServiceImpl {
...
@@ -75,6 +80,9 @@ public class MonitoringServiceImpl {
// @Autowired
// @Autowired
// InfluxdbUtil influxdbUtil;
// InfluxdbUtil influxdbUtil;
@Autowired
private
HttpRequestUtil
httpRequestUtil
;
/**
/**
* 根据场站编号获取该场站的装机容量
* 根据场站编号获取该场站的装机容量
*
*
...
@@ -1054,27 +1062,23 @@ public class MonitoringServiceImpl {
...
@@ -1054,27 +1062,23 @@ public class MonitoringServiceImpl {
stringHashMap9
.
put
(
"title"
,
stringHashMap9
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfDayFD
.
get
()
+
powerOfDayGF
.
get
()));
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfDayFD
.
get
()
+
powerOfDayGF
.
get
()));
HashMap
<
String
,
String
>
resultMap
=
new
HashMap
<>();
HashMap
<
String
,
String
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"Day"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfDayFD
.
get
()
+
powerOfDayGF
.
get
()));
//
resultMap.put("Day", String.format(CommonConstans.Fourdecimalplaces, powerOfDayFD.get() + powerOfDayGF.get()));
list2
.
add
(
stringHashMap9
);
list2
.
add
(
stringHashMap9
);
HashMap
<
String
,
String
>
stringHashMap10
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap10
=
new
HashMap
<>();
stringHashMap10
.
put
(
"title"
,
stringHashMap10
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
()));
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
()));
resultMap
.
put
(
"Moon"
,
//resultMap.put("Moon",String.format(CommonConstans.Fourdecimalplaces, powerOfMonthFD.get() + powerOfMonthGF.get()));
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
()));
//resultMap.put("YJHWC", String.format(CommonConstans.Twodecimalplaces,(powerOfMonthFD.get() + powerOfMonthGF.get()) / moonValue * 100));
resultMap
.
put
(
"YJHWC"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
())
/
moonValue
*
100
));
list2
.
add
(
stringHashMap10
);
list2
.
add
(
stringHashMap10
);
HashMap
<
String
,
String
>
stringHashMap11
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap11
=
new
HashMap
<>();
stringHashMap11
.
put
(
"title"
,
stringHashMap11
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
()));
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
()));
resultMap
.
put
(
"Year"
,
//resultMap.put("Year",String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualFD.get() + powerOfAnnualGF.get()));
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
()));
list2
.
add
(
stringHashMap11
);
list2
.
add
(
stringHashMap11
);
HashMap
<
String
,
String
>
stringHashMap12
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap12
=
new
HashMap
<>();
stringHashMap12
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
stringHashMap12
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
())
/
yearValue
*
100
));
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
())
/
yearValue
*
100
));
resultMap
.
put
(
"NJHWC"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
//resultMap.put("NJHWC", String.format(CommonConstans.Twodecimalplaces,(powerOfAnnualFD.get() + powerOfAnnualGF.get()) / yearValue * 100));
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
())
/
yearValue
*
100
));
list2
.
add
(
stringHashMap12
);
list2
.
add
(
stringHashMap12
);
page2
.
setRecords
(
list2
);
page2
.
setRecords
(
list2
);
Double
totalAnnual
=
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
());
Double
totalAnnual
=
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
());
...
@@ -1099,6 +1103,20 @@ public class MonitoringServiceImpl {
...
@@ -1099,6 +1103,20 @@ public class MonitoringServiceImpl {
stringHashMap16
.
put
(
"unit"
,
"二氧化硫减排量(t)"
);
stringHashMap16
.
put
(
"unit"
,
"二氧化硫减排量(t)"
);
list3
.
add
(
stringHashMap16
);
list3
.
add
(
stringHashMap16
);
page3
.
setRecords
(
list3
);
page3
.
setRecords
(
list3
);
//改为部盾接口
String
requestUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_quota_info
;
LocalDate
currentDate
=
LocalDate
.
now
();
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
String
formattedDate
=
currentDate
.
format
(
formatter
);
JSONObject
data
=
httpRequestUtil
.
getResPonse
(
requestUrl
+
"&reporting_data="
+
formattedDate
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
);
resultMap
.
put
(
"Day"
,
data
.
getString
(
"day_generating_capacity"
));
resultMap
.
put
(
"Moon"
,
data
.
getString
(
"month_generating_capacity"
));
resultMap
.
put
(
"Year"
,
data
.
getString
(
"year_generating_capacity"
));
resultMap
.
put
(
"YJHWC"
,
data
.
getString
(
"year_quota_rate"
).
replace
(
"%"
,
""
));
resultMap
.
put
(
"NJHWC"
,
data
.
getString
(
"month_quota_rate"
).
replace
(
"%"
,
""
));
try
{
try
{
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_zjrl_topic"
,
JSON
.
toJSON
(
page
).
toString
().
getBytes
(
"UTF-8"
),
1
,
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_zjrl_topic"
,
JSON
.
toJSON
(
page
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
true
);
...
...
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