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
927302a7
Commit
927302a7
authored
Oct 16, 2023
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接第三方北向数据
parent
673b0758
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
267 additions
and
43 deletions
+267
-43
CalendarAdjust.java
...m/yeejoin/amos/api/householdapi/Utils/CalendarAdjust.java
+161
-0
ImasterUtils.java
...com/yeejoin/amos/api/householdapi/Utils/ImasterUtils.java
+13
-8
ImasterConstant.java
...ejoin/amos/api/householdapi/constant/ImasterConstant.java
+12
-0
HouseholdTestController.java
.../api/householdapi/controller/HouseholdTestController.java
+4
-10
ImasterInverterListDetails.java
...houseapi/entity/tdeingine/ImasterInverterListDetails.java
+1
-1
ImasterInverterMonth.java
...e/orm/houseapi/entity/tdeingine/ImasterInverterMonth.java
+17
-0
ImasterInverterYear.java
...ce/orm/houseapi/entity/tdeingine/ImasterInverterYear.java
+17
-0
ImasterStationDetailsMonth.java
...houseapi/entity/tdeingine/ImasterStationDetailsMonth.java
+7
-12
ImasterStationDetailsYear.java
.../houseapi/entity/tdeingine/ImasterStationDetailsYear.java
+7
-12
ImasterInverterMonthMapper.java
.../face/orm/mapper/tdengine/ImasterInverterMonthMapper.java
+7
-0
ImasterInverterYearMapper.java
...i/face/orm/mapper/tdengine/ImasterInverterYearMapper.java
+7
-0
ImasterStationMonthMapper.java
...i/face/orm/mapper/tdengine/ImasterStationMonthMapper.java
+7
-0
ImasterStationYearMapper.java
...pi/face/orm/mapper/tdengine/ImasterStationYearMapper.java
+7
-0
ImasterDataServiceImpl.java
...ouseholdapi/face/service/impl/ImasterDataServiceImpl.java
+0
-0
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/CalendarAdjust.java
0 → 100644
View file @
927302a7
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
Utils
;
import
java.time.Instant
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.util.Calendar
;
import
java.util.TimeZone
;
public
class
CalendarAdjust
{
/**
* 获取指定某一天的开始时间戳
*
* @param timeStamp 毫秒级时间戳
* @param timeZone 如 GMT+8:00
* @return
*/
public
static
Long
getDailyStartTime
(
Long
timeStamp
,
String
timeZone
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTimeZone
(
TimeZone
.
getTimeZone
(
timeZone
));
calendar
.
setTimeInMillis
(
timeStamp
);
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
calendar
.
set
(
Calendar
.
SECOND
,
0
);
calendar
.
set
(
Calendar
.
MINUTE
,
0
);
calendar
.
set
(
Calendar
.
MILLISECOND
,
0
);
return
calendar
.
getTimeInMillis
();
}
/**
* 获取指定某一天的结束时间戳
*
* @param timeStamp 毫秒级时间戳
* @param timeZone 如 GMT+8:00
* @return
*/
public
static
Long
getDailyEndTime
(
Long
timeStamp
,
String
timeZone
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTimeZone
(
TimeZone
.
getTimeZone
(
timeZone
));
calendar
.
setTimeInMillis
(
timeStamp
);
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
23
);
calendar
.
set
(
Calendar
.
MINUTE
,
59
);
calendar
.
set
(
Calendar
.
SECOND
,
59
);
calendar
.
set
(
Calendar
.
MILLISECOND
,
999
);
return
calendar
.
getTimeInMillis
();
}
/**
* 获取当月开始时间戳
*
* @param timeStamp 毫秒级时间戳
* @param timeZone 如 GMT+8:00
* @return
*/
public
static
Long
getMonthStartTime
(
Long
timeStamp
,
String
timeZone
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
// 获取当前日期
calendar
.
setTimeZone
(
TimeZone
.
getTimeZone
(
timeZone
));
calendar
.
setTimeInMillis
(
timeStamp
);
calendar
.
add
(
Calendar
.
YEAR
,
0
);
calendar
.
add
(
Calendar
.
MONTH
,
0
);
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
// 设置为1号,当前日期既为本月第一天
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
calendar
.
set
(
Calendar
.
MINUTE
,
0
);
calendar
.
set
(
Calendar
.
SECOND
,
0
);
calendar
.
set
(
Calendar
.
MILLISECOND
,
0
);
return
calendar
.
getTimeInMillis
();
}
/**
* 获取当月的结束时间戳
*
* @param timeStamp 毫秒级时间戳
* @param timeZone 如 GMT+8:00
* @return
*/
public
static
Long
getMonthEndTime
(
Long
timeStamp
,
String
timeZone
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
// 获取当前日期
calendar
.
setTimeZone
(
TimeZone
.
getTimeZone
(
timeZone
));
calendar
.
setTimeInMillis
(
timeStamp
);
calendar
.
add
(
Calendar
.
YEAR
,
0
);
calendar
.
add
(
Calendar
.
MONTH
,
0
);
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
// 获取当前月最后一天
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
23
);
calendar
.
set
(
Calendar
.
MINUTE
,
59
);
calendar
.
set
(
Calendar
.
SECOND
,
59
);
calendar
.
set
(
Calendar
.
MILLISECOND
,
999
);
return
calendar
.
getTimeInMillis
();
}
/**
* 获取当年的开始时间戳
*
* @param timeStamp 毫秒级时间戳
* @param timeZone 如 GMT+8:00
* @return
*/
public
static
Long
getYearStartTime
(
Long
timeStamp
,
String
timeZone
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
// 获取当前日期
calendar
.
setTimeZone
(
TimeZone
.
getTimeZone
(
timeZone
));
calendar
.
setTimeInMillis
(
timeStamp
);
calendar
.
add
(
Calendar
.
YEAR
,
0
);
calendar
.
add
(
Calendar
.
DATE
,
0
);
calendar
.
add
(
Calendar
.
MONTH
,
0
);
calendar
.
set
(
Calendar
.
DAY_OF_YEAR
,
1
);
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
calendar
.
set
(
Calendar
.
MINUTE
,
0
);
calendar
.
set
(
Calendar
.
SECOND
,
0
);
calendar
.
set
(
Calendar
.
MILLISECOND
,
0
);
return
calendar
.
getTimeInMillis
();
}
/**
* 获取当年的最后时间戳
*
* @param timeStamp 毫秒级时间戳
* @param timeZone 如 GMT+8:00
* @return
*/
public
static
Long
getYearEndTime
(
Long
timeStamp
,
String
timeZone
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
// 获取当前日期
calendar
.
setTimeZone
(
TimeZone
.
getTimeZone
(
timeZone
));
calendar
.
setTimeInMillis
(
timeStamp
);
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
calendar
.
clear
();
calendar
.
set
(
Calendar
.
YEAR
,
year
);
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
23
);
calendar
.
set
(
Calendar
.
MINUTE
,
59
);
calendar
.
set
(
Calendar
.
SECOND
,
59
);
calendar
.
set
(
Calendar
.
MILLISECOND
,
999
);
calendar
.
roll
(
Calendar
.
DAY_OF_YEAR
,
-
1
);
return
calendar
.
getTimeInMillis
();
}
/**
* 时间戳转字符串
*
* @param timestamp 毫秒级时间戳
* @param zoneId 如 GMT+8或UTC+08:00
* @return
*/
public
static
String
timestampToStr
(
long
timestamp
,
String
zoneId
)
{
ZoneId
timezone
=
ZoneId
.
of
(
zoneId
);
LocalDateTime
localDateTime
=
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
timestamp
),
timezone
);
return
localDateTime
.
toString
();
}
public
static
void
main
(
String
[]
args
)
{
Long
currentTime
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"Current Time : "
+
currentTime
+
" = "
+
timestampToStr
(
currentTime
,
"GMT+8"
));
Long
dailyStart
=
getDailyStartTime
(
currentTime
,
"GMT+8:00"
);
Long
dailyEnd
=
getDailyEndTime
(
currentTime
,
"GMT+8:00"
);
Long
monthStart
=
getMonthStartTime
(
currentTime
,
"GMT+8:00"
);
Long
monthEnd
=
getMonthEndTime
(
currentTime
,
"GMT+8:00"
);
Long
yearStart
=
getYearStartTime
(
currentTime
,
"GMT+8:00"
);
Long
yearEnd
=
getYearEndTime
(
currentTime
,
"GMT+8:00"
);
System
.
out
.
println
(
"Daily Start : "
+
dailyStart
+
" = "
+
timestampToStr
(
dailyStart
,
"GMT+8"
)
+
" Daily End : "
+
dailyEnd
+
" = "
+
timestampToStr
(
dailyEnd
,
"GMT+8"
));
System
.
out
.
println
(
"Month Start : "
+
monthStart
+
" = "
+
timestampToStr
(
monthStart
,
"GMT+8"
)
+
" Month End : "
+
monthEnd
+
" = "
+
timestampToStr
(
monthEnd
,
"GMT+8"
));
System
.
out
.
println
(
"Year Start : "
+
yearStart
+
" = "
+
timestampToStr
(
yearStart
,
"GMT+8"
)
+
" Year End : "
+
yearEnd
+
" = "
+
timestampToStr
(
yearEnd
,
"GMT+8"
));
}
}
\ No newline at end of file
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/ImasterUtils.java
View file @
927302a7
...
...
@@ -207,15 +207,20 @@ public class ImasterUtils {
if
(
jsonArray
.
size
()
!=
0
)
{
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++
)
{
JSONObject
jsonObject1
=
(
JSONObject
)
jsonArray
.
get
(
i
);
JSONObject
jsonObject2
=
(
JSONObject
)
jsonObject1
.
get
(
"dataItemMap"
);
if
(
jsonObject1
.
get
(
"sn"
)
!=
null
)
{
jsonObject2
.
put
(
"inverterId"
,
jsonObject1
.
get
(
"sn"
).
toString
());
}
if
(
jsonObject1
.
get
(
"stationCode"
)
!=
null
)
{
jsonObject2
.
put
(
"stationCode"
,
jsonObject1
.
get
(
"stationCode"
).
toString
());
}
if
(
jsonObject1
.
get
(
"dataItemMap"
)
!=
null
)
{
JSONObject
jsonObject2
=
(
JSONObject
)
jsonObject1
.
get
(
"dataItemMap"
);
if
(
jsonObject1
.
get
(
"sn"
)
!=
null
)
{
jsonObject2
.
put
(
"inverterId"
,
jsonObject1
.
get
(
"sn"
).
toString
());
}
if
(
jsonObject1
.
get
(
"stationCode"
)
!=
null
)
{
jsonObject2
.
put
(
"stationCode"
,
jsonObject1
.
get
(
"stationCode"
).
toString
());
}
if
(
jsonObject1
.
get
(
"collectTime"
)
!=
null
)
{
jsonObject2
.
put
(
"collectTime"
,
jsonObject1
.
get
(
"collectTime"
).
toString
());
}
jsonArrayRet
.
add
(
jsonObject2
);
jsonArrayRet
.
add
(
jsonObject2
);
}
}
}
}
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/constant/ImasterConstant.java
View file @
927302a7
...
...
@@ -15,6 +15,13 @@ public class ImasterConstant {
}
};
public
static
final
HashMap
<
String
,
String
>
inverterStaus
=
new
HashMap
<
String
,
String
>()
{
{
put
(
"0"
,
"离线"
);
put
(
"1"
,
"在线"
);
}
};
public
static
final
HashMap
<
String
,
String
>
alarmstatus
=
new
HashMap
<
String
,
String
>()
{
{
put
(
"1"
,
"未处理"
);
...
...
@@ -41,12 +48,17 @@ public class ImasterConstant {
public
static
String
requestGET
=
"GET"
;
public
static
String
stationListUrl
=
"/thirdData/stations"
;
public
static
String
stationDetailUrl
=
"/thirdData/getStationRealKpi"
;
public
static
String
stationDetailMonthUrl
=
"/thirdData/getKpiStationMonth"
;
public
static
String
stationDetailYearUrl
=
"/thirdData/getKpiStationYear"
;
public
static
String
collectorListUrl
=
"/thirdData/getDevList"
;
public
static
String
collectorDetailUrl
=
"/thirdData/getDevRealKpi"
;
public
static
String
collectorDetailMonthUrl
=
"/thirdData/getDevKpiMonth"
;
public
static
String
collectorDetailYearUrl
=
"/thirdData/getDevKpiYear"
;
public
static
String
alarmListUrl
=
"/thirdData/getAlarmList"
;
public
static
String
resovleRule_data_page_records
=
"data"
;
public
static
String
resovle_rows
=
"rows"
;
public
static
int
devTypeC
=
62
;
public
static
int
devTypeI
=
1
;
public
static
Double
kwhToMwh
=
0.0001
;
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/controller/HouseholdTestController.java
View file @
927302a7
...
...
@@ -135,16 +135,10 @@ public class HouseholdTestController {
@PostMapping
(
value
=
"/imasterNew"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"北向"
,
notes
=
"北向"
)
public
void
imasterNew
()
throws
IOException
{
//
imasterDataService.stationList();
//
imasterDataService.stationDetail();
//
imasterDataService.collectorList();
//
imasterDataService.inverterList();
imasterDataService
.
stationList
();
imasterDataService
.
stationDetail
();
imasterDataService
.
collectorList
();
imasterDataService
.
inverterList
();
imasterDataService
.
inverterDetail
();
// goLangDataAcquisitionService.collectorList();
//// goLangDataAcquisitionService.inverterList();
// goLangDataAcquisitionService.collectorDetail();
// goLangDataAcquisitionService.inverterDetail();
// goLangDataAcquisitionService.inverAlramInfo();
}
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/houseapi/entity/tdeingine/ImasterInverterListDetails.java
View file @
927302a7
...
...
@@ -42,7 +42,7 @@ public class ImasterInverterListDetails {
Double
pv11_u
;
Double
mppt_power
;
Double
pv13_u
;
Double
run_state
;
int
run_state
;
Double
close_time
;
Double
pv19_i
;
Double
mppt_7_cap
;
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/houseapi/entity/tdeingine/ImasterInverterMonth.java
0 → 100644
View file @
927302a7
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
houseapi
.
entity
.
tdeingine
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
@Data
@TableName
(
value
=
"imaster_inverter_details_month"
,
autoResultMap
=
true
)
public
class
ImasterInverterMonth
{
private
Long
createdTime
;
private
String
stationCode
;
private
Double
installed_capacity
;
// 装机容量
private
Double
product_power
;
// 发电量
private
Double
power_profit
;
// 发电收益
private
String
collectTime
;
private
String
inverterId
;
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/houseapi/entity/tdeingine/ImasterInverterYear.java
0 → 100644
View file @
927302a7
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
houseapi
.
entity
.
tdeingine
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
@Data
@TableName
(
value
=
"imaster_inverter_details_year"
,
autoResultMap
=
true
)
public
class
ImasterInverterYear
{
private
Long
createdTime
;
private
String
stationCode
;
private
Double
installed_capacity
;
// 装机容量
private
Double
product_power
;
// 发电量
private
Double
power_profit
;
// 发电收益
private
String
collectTime
;
private
String
inverterId
;
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/houseapi/entity/tdeingine/ImasterStationDetailsMonth.java
View file @
927302a7
...
...
@@ -9,16 +9,11 @@ public class ImasterStationDetailsMonth {
private
Long
createdTime
;
private
String
stationCode
;
private
Double
installedCapacity
;
private
Double
radiationIntensity
;
private
Double
theoryPower
;
private
Double
performanceRatio
;
private
Double
inverterPower
;
private
Double
ongridPower
;
private
Double
usePower
;
private
Double
powerProfit
;
private
Double
perpowerRatio
;
private
Double
reductionTotalCo2
;
private
Double
reductionTotalCoal
;
private
Double
reductionTotalTree
;
private
Double
installed_capacity
;
// 装机容量
private
Double
inverter_power
;
// 逆变器发电量
private
Double
power_profit
;
// 发电收益
private
Double
reduction_total_coal
;
// 标准煤节省量
private
Double
perpower_ratio
;
/// 等效利用小时数
private
Double
reduction_total_co2
;
// 二氧化碳减排量
private
String
collectTime
;
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/houseapi/entity/tdeingine/ImasterStationDetailsYear.java
View file @
927302a7
...
...
@@ -9,17 +9,12 @@ public class ImasterStationDetailsYear {
private
Long
createdTime
;
private
String
stationCode
;
private
Double
installedCapacity
;
private
Double
radiationIntensity
;
private
Double
theoryPower
;
private
Double
performanceRatio
;
private
Double
inverterPower
;
private
Double
ongridPower
;
private
Double
usePower
;
private
Double
powerProfit
;
private
Double
perpowerRatio
;
private
Double
reductionTotalCo2
;
private
Double
reductionTotalCoal
;
private
Double
reductionTotalTree
;
private
Double
installed_capacity
;
private
Double
inverter_power
;
private
Double
power_profit
;
private
Double
reduction_total_coal
;
private
Double
perpower_ratio
;
private
Double
reduction_total_co2
;
private
String
collectTime
;
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/mapper/tdengine/ImasterInverterMonthMapper.java
0 → 100644
View file @
927302a7
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
mapper
.
tdengine
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.ImasterInverterMonth
;
public
interface
ImasterInverterMonthMapper
extends
BaseMapper
<
ImasterInverterMonth
>
{
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/mapper/tdengine/ImasterInverterYearMapper.java
0 → 100644
View file @
927302a7
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
mapper
.
tdengine
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.ImasterInverterYear
;
public
interface
ImasterInverterYearMapper
extends
BaseMapper
<
ImasterInverterYear
>
{
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/mapper/tdengine/ImasterStationMonthMapper.java
0 → 100644
View file @
927302a7
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
mapper
.
tdengine
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.ImasterStationDetailsMonth
;
public
interface
ImasterStationMonthMapper
extends
BaseMapper
<
ImasterStationDetailsMonth
>
{
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/mapper/tdengine/ImasterStationYearMapper.java
0 → 100644
View file @
927302a7
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
mapper
.
tdengine
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.ImasterStationDetailsYear
;
public
interface
ImasterStationYearMapper
extends
BaseMapper
<
ImasterStationDetailsYear
>
{
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/ImasterDataServiceImpl.java
View file @
927302a7
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