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
727d40d3
Commit
727d40d3
authored
Jan 13, 2025
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer_bw' into developer_bw
parents
bfb61503
18c69a38
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
132 additions
and
43 deletions
+132
-43
GolangRequestUtil.java
...eejoin/amos/api/householdapi/Utils/GolangRequestUtil.java
+3
-0
GoodWeRequestUtil.java
...eejoin/amos/api/householdapi/Utils/GoodWeRequestUtil.java
+1
-1
SofarRequestUtil.java
...yeejoin/amos/api/householdapi/Utils/SofarRequestUtil.java
+1
-1
SunlightUtil.java
...com/yeejoin/amos/api/householdapi/Utils/SunlightUtil.java
+1
-1
HouseholdTestController.java
.../api/householdapi/controller/HouseholdTestController.java
+15
-0
GoodWeDataAcquisitionServiceImpl.java
...i/face/service/impl/GoodWeDataAcquisitionServiceImpl.java
+19
-6
JpStationServiceImpl.java
.../householdapi/face/service/impl/JpStationServiceImpl.java
+36
-0
SunlightServiceImpl.java
...i/householdapi/face/service/impl/SunlightServiceImpl.java
+50
-28
application-dev.properties
...-housepvapi/src/main/resources/application-dev.properties
+5
-5
BusinessFieldMapper.xml
...i/src/main/resources/mapper/mysql/BusinessFieldMapper.xml
+1
-1
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/GolangRequestUtil.java
View file @
727d40d3
...
...
@@ -102,6 +102,9 @@ public class GolangRequestUtil {
JSONObject
page
=
data
.
getJSONObject
(
"page"
);
responePages
=
page
.
getInteger
(
"pages"
);
}
if
(
Objects
.
isNull
(
responePages
)){
responePages
=
0
;
}
if
(
responePages
<=
pageNo
){
break
;
}
else
{
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/GoodWeRequestUtil.java
View file @
727d40d3
...
...
@@ -96,7 +96,7 @@ public class GoodWeRequestUtil {
//处理其他页数的数据
JSONObject
responeJSON
=
JSONObject
.
parseObject
(
respone
);
JSONObject
data
=
responeJSON
.
getJSONObject
(
"data"
);
Integer
record
=
data
.
getInteger
(
"record"
);
Integer
record
=
data
.
getInteger
(
"record"
)
==
null
?
0
:
data
.
getInteger
(
"record"
)
;
Integer
pageSize
=
requestInfo
.
get
(
"page_size"
)==
null
||
(
Integer
)
requestInfo
.
get
(
"page_size"
)==
0
?
1
:(
Integer
)
requestInfo
.
get
(
"page_size"
);
Integer
responePages
=(
record
/
pageSize
)+
1
;
if
(
responePages
<=
pageNo
){
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/SofarRequestUtil.java
View file @
727d40d3
...
...
@@ -131,7 +131,7 @@ public class SofarRequestUtil {
thirdStationLogService
.
saveLog
(
hygfThirdStationLog
);
//处理其他页数的数据
JSONObject
responeJSON
=
JSONObject
.
parseObject
(
respone
);
Integer
total
=
responeJSON
.
getInteger
(
"total"
);
Integer
total
=
responeJSON
.
getInteger
(
"total"
)
==
null
?
0
:
responeJSON
.
getInteger
(
"total"
)
;
Integer
pageSize
=
requestInfo
.
get
(
"size"
)==
null
||
(
Integer
)
requestInfo
.
get
(
"size"
)==
0
?
1
:(
Integer
)
requestInfo
.
get
(
"size"
);
Integer
responePages
=(
total
/
pageSize
)+
1
;
if
(
responePages
<=
pageNo
){
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/SunlightUtil.java
View file @
727d40d3
...
...
@@ -253,7 +253,7 @@ public class SunlightUtil {
hygfThirdStationLog
.
setResBody
(
res
);
thirdStationLogService
.
saveLog
(
hygfThirdStationLog
);
//处理其他页数的数据
Integer
rowCount
=
resultData
.
getInt
(
"rowCount"
);
Integer
rowCount
=
resultData
.
getInt
(
"rowCount"
)
==
null
?
0
:
resultData
.
getInt
(
"rowCount"
)
;
Integer
pageSize
=
bodyparam
.
get
(
"size"
)==
null
||
(
Integer
)
bodyparam
.
get
(
"size"
)==
0
?
1
:(
Integer
)
bodyparam
.
get
(
"size"
);
Integer
responePages
=(
rowCount
/
pageSize
)+
1
;
if
(
responePages
<=
pageNo
){
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/controller/HouseholdTestController.java
View file @
727d40d3
...
...
@@ -7,6 +7,7 @@ import com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine.*;
import
com.yeejoin.amos.api.householdapi.face.service.*
;
import
com.yeejoin.amos.api.householdapi.face.service.business.*
;
import
com.yeejoin.amos.api.householdapi.face.service.impl.ImasterDataServiceImpl
;
import
com.yeejoin.amos.api.householdapi.face.service.impl.JpStationServiceImpl
;
import
com.yeejoin.amos.api.householdapi.face.service.impl.SofarDataAcquisitionServiceImpl
;
import
fastjson.JSON
;
import
io.swagger.annotations.Api
;
...
...
@@ -77,6 +78,20 @@ public class HouseholdTestController {
@Autowired
private
TanYinDataAcquisitionService
tanYinDataAcquisitionService
;
@Autowired
private
JpStationServiceImpl
jpStationService
;
/**
* 新增户用光伏-厂商API haders
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/testInitStation"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"测试初始化场站"
,
notes
=
"测试初始化场站"
)
public
void
testInitStation
()
throws
IOException
{
jpStationService
.
initStationValue
();
}
/**
* 新增户用光伏-厂商API haders
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/GoodWeDataAcquisitionServiceImpl.java
View file @
727d40d3
...
...
@@ -123,9 +123,13 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
BeanUtil
.
copyProperties
(
goodWeStationMonitorDto
,
goodWeStationList
);
goodWeStationList
.
setCreatedTime
(
System
.
currentTimeMillis
());
goodWeStationMonitorListMapper
.
insert
(
goodWeStationList
);
JpStation
jpStation
=
jpStationMapper
.
select
One
(
new
QueryWrapper
<
JpStation
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
GDW
.
getCode
())
List
<
JpStation
>
jpStationList
=
jpStationMapper
.
select
List
(
new
QueryWrapper
<
JpStation
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
GDW
.
getCode
())
.
eq
(
"third_station_id"
,
goodWeStationList
.
getPowerstation_id
()));
JpStation
jpStation
=
null
;
if
(
CollectionUtil
.
isNotEmpty
(
jpStationList
)){
jpStation
=
jpStationList
.
get
(
0
);
}
if
(
ObjectUtils
.
isEmpty
(
jpStation
))
{
jpStation
=
new
JpStation
();
}
...
...
@@ -258,11 +262,15 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
TdHYGFStationMonthGenerateMapper
.
insert
(
TdHYGFStationMonthGenerate
);
}
// 户用场站月发电量
TdHYGFStationYearGenerate
TdHYGFStationYearGenerate
=
TdHYGFStationYearGenerateMapper
.
select
One
(
new
QueryWrapper
<
TdHYGFStationYearGenerate
>()
List
<
TdHYGFStationYearGenerate
>
tdHYGFStationYearGenerateList
=
TdHYGFStationYearGenerateMapper
.
select
List
(
new
QueryWrapper
<
TdHYGFStationYearGenerate
>()
.
eq
(
"third_station_id"
,
jpStation
.
getThirdStationId
())
.
eq
(
"month_time"
,
DateUtil
.
format
(
today1
,
"yyyy-MM"
))
.
eq
(
"year"
,
DateUtil
.
format
(
today1
,
"yyyy"
)));
TdHYGFStationYearGenerate
TdHYGFStationYearGenerate
=
null
;
if
(
CollectionUtil
.
isNotEmpty
(
tdHYGFStationYearGenerateList
)){
TdHYGFStationYearGenerate
=
tdHYGFStationYearGenerateList
.
get
(
0
);
}
if
(
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
TdHYGFStationYearGenerate
))
{
TdHYGFStationYearGenerate
=
new
TdHYGFStationYearGenerate
();
}
...
...
@@ -287,11 +295,16 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
TdHYGFStationYearGenerateMapper
.
insert
(
TdHYGFStationYearGenerate
);
}
// 户用场站年发电量
TdHYGFStationAllGenerate
TdHYGFStationAllGenerate
=
TdHYGFStationAllGenerateMapper
.
select
One
(
new
QueryWrapper
<
TdHYGFStationAllGenerate
>()
List
<
TdHYGFStationAllGenerate
>
tdHYGFStationAllGenerateList
=
TdHYGFStationAllGenerateMapper
.
select
List
(
new
QueryWrapper
<
TdHYGFStationAllGenerate
>()
.
eq
(
"third_station_id"
,
jpStation
.
getThirdStationId
())
.
eq
(
"year_time"
,
DateUtil
.
format
(
today1
,
"yyyy"
))
.
eq
(
"year"
,
DateUtil
.
format
(
today1
,
"yyyy"
)));
TdHYGFStationAllGenerate
TdHYGFStationAllGenerate
=
null
;
if
(
CollectionUtil
.
isNotEmpty
(
tdHYGFStationAllGenerateList
)){
TdHYGFStationAllGenerate
=
tdHYGFStationAllGenerateList
.
get
(
0
);
}
if
(
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
TdHYGFStationAllGenerate
))
{
TdHYGFStationAllGenerate
=
new
TdHYGFStationAllGenerate
();
}
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/JpStationServiceImpl.java
0 → 100644
View file @
727d40d3
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpStation
;
import
com.yeejoin.amos.api.householdapi.face.orm.mapper.hygf.JpStationMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
@Service
public
class
JpStationServiceImpl
{
@Autowired
JpStationMapper
jpStationMapper
;
@Scheduled
(
cron
=
"${dataRequstScheduled.initStation:0 0 0 * * ?}"
)
@Async
public
void
initStationValue
(){
LambdaUpdateWrapper
<
JpStation
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
set
(
JpStation:
:
getCapacity
,
0.0
)
.
set
(
JpStation:
:
getRealTimePower
,
0.0
)
.
set
(
JpStation:
:
getAccumulatedPower
,
0.0
)
.
set
(
JpStation:
:
getDayGenerate
,
0.0
)
.
set
(
JpStation:
:
getMonthGenerate
,
0.0
)
.
set
(
JpStation:
:
getYearGenerate
,
0.0
)
.
set
(
JpStation:
:
getDayIncome
,
0.0
)
.
set
(
JpStation:
:
getMonthIncome
,
0.0
)
.
set
(
JpStation:
:
getYearIncome
,
0.0
)
.
set
(
JpStation:
:
getCumulativeIncome
,
0.0
)
.
set
(
JpStation:
:
getDayPowerUse
,
0.0
)
.
set
(
JpStation:
:
getMonthPowerUse
,
0.0
)
.
set
(
JpStation:
:
getYearPowerUse
,
0.0
)
.
set
(
JpStation:
:
getRatedPower
,
0.0
);
jpStationMapper
.
update
(
null
,
wrapper
);
}
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/SunlightServiceImpl.java
View file @
727d40d3
...
...
@@ -244,39 +244,61 @@ public class SunlightServiceImpl implements SunlightService {
jpStation
.
setSnCode
(
sunlightDto
.
getPs_id
().
toString
());
// sncode
try
{
Map
<
String
,
String
>
map
=
sunlightDto
.
getTotal_capcity
();
if
(
map
!=
null
&&
map
.
get
(
"unit"
)
!=
null
&&
!
map
.
get
(
"unit"
).
isEmpty
()
&&
!
"--"
.
equals
(
map
.
get
(
"value"
)))
{
jpStation
.
setCapacity
(
SunlightUtil
.
zj
.
get
(
String
.
valueOf
(
map
.
get
(
"unit"
)))
*
Double
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"value"
))));
// 装机容量
try
{
Map
<
String
,
String
>
map
=
sunlightDto
.
getTotal_capcity
();
if
(
map
!=
null
&&
map
.
get
(
"unit"
)
!=
null
&&
!
map
.
get
(
"unit"
).
isEmpty
()
&&
!
"--"
.
equals
(
map
.
get
(
"value"
)))
{
jpStation
.
setCapacity
(
SunlightUtil
.
zj
.
get
(
String
.
valueOf
(
map
.
get
(
"unit"
)))
*
Double
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"value"
))));
// 装机容量
}
}
catch
(
Exception
e
){
jpStation
.
setCapacity
(
0.0
);
}
Map
<
String
,
String
>
map1
=
sunlightDto
.
getCurr_power
();
if
(
map1
!=
null
&&
map1
.
get
(
"unit"
)
!=
null
&&
!
map1
.
get
(
"unit"
).
isEmpty
()
&&
!
"--"
.
equals
(
map1
.
get
(
"value"
)))
{
jpStation
.
setRealTimePower
(
SunlightUtil
.
GL
.
get
(
String
.
valueOf
(
map1
.
get
(
"unit"
)))
*
Double
.
valueOf
(
String
.
valueOf
(
map1
.
get
(
"value"
))));
// 实时功率
try
{
Map
<
String
,
String
>
map1
=
sunlightDto
.
getCurr_power
();
if
(
map1
!=
null
&&
map1
.
get
(
"unit"
)
!=
null
&&
!
map1
.
get
(
"unit"
).
isEmpty
()
&&
!
"--"
.
equals
(
map1
.
get
(
"value"
)))
{
jpStation
.
setRealTimePower
(
SunlightUtil
.
GL
.
get
(
String
.
valueOf
(
map1
.
get
(
"unit"
)))
*
Double
.
valueOf
(
String
.
valueOf
(
map1
.
get
(
"value"
))));
// 实时功率
}
}
catch
(
Exception
e
){
jpStation
.
setRealTimePower
(
0.0
);
}
Map
<
String
,
String
>
map2
=
sunlightDto
.
getToday_energy
();
if
(
map2
!=
null
&&
map2
.
get
(
"unit"
)
!=
null
&&
!
map2
.
get
(
"unit"
).
isEmpty
()
&&
!
"--"
.
equals
(
map2
.
get
(
"value"
)))
{
jpStation
.
setDayGenerate
(
SunlightUtil
.
fd
.
get
(
String
.
valueOf
(
map2
.
get
(
"unit"
)))
*
Double
.
valueOf
(
String
.
valueOf
(
map2
.
get
(
"value"
))));
// 日发电量
try
{
Map
<
String
,
String
>
map2
=
sunlightDto
.
getToday_energy
();
if
(
map2
!=
null
&&
map2
.
get
(
"unit"
)
!=
null
&&
!
map2
.
get
(
"unit"
).
isEmpty
()
&&
!
"--"
.
equals
(
map2
.
get
(
"value"
)))
{
jpStation
.
setDayGenerate
(
SunlightUtil
.
fd
.
get
(
String
.
valueOf
(
map2
.
get
(
"unit"
)))
*
Double
.
valueOf
(
String
.
valueOf
(
map2
.
get
(
"value"
))));
// 日发电量
}
}
catch
(
Exception
e
){
jpStation
.
setDayGenerate
(
0.0
);
}
Map
<
String
,
String
>
map3
=
sunlightDto
.
getTotal_energy
();
if
(
map3
!=
null
&&
map3
.
get
(
"unit"
)
!=
null
&&
!
map3
.
get
(
"unit"
).
isEmpty
()
&&
!
"--"
.
equals
(
map3
.
get
(
"value"
)))
{
jpStation
.
setAccumulatedPower
(
SunlightUtil
.
fd
.
get
(
String
.
valueOf
(
map3
.
get
(
"unit"
)))
*
Double
.
valueOf
(
String
.
valueOf
(
map3
.
get
(
"value"
))));
// 累计发电量
try
{
Map
<
String
,
String
>
map3
=
sunlightDto
.
getTotal_energy
();
if
(
map3
!=
null
&&
map3
.
get
(
"unit"
)
!=
null
&&
!
map3
.
get
(
"unit"
).
isEmpty
()
&&
!
"--"
.
equals
(
map3
.
get
(
"value"
)))
{
jpStation
.
setAccumulatedPower
(
SunlightUtil
.
fd
.
get
(
String
.
valueOf
(
map3
.
get
(
"unit"
)))
*
Double
.
valueOf
(
String
.
valueOf
(
map3
.
get
(
"value"
))));
// 累计发电量
}
}
catch
(
Exception
e
){
jpStation
.
setAccumulatedPower
(
0.0
);
}
Map
<
String
,
String
>
map4
=
sunlightDto
.
getToday_income
();
if
(
map4
!=
null
&&
map4
.
get
(
"unit"
)
!=
null
&&
!
map4
.
get
(
"unit"
).
isEmpty
()
&&
!
"--"
.
equals
(
map4
.
get
(
"value"
)))
{
jpStation
.
setDayIncome
(
SunlightUtil
.
sy
.
get
(
String
.
valueOf
(
map4
.
get
(
"unit"
)))
*
Double
.
valueOf
(
String
.
valueOf
(
map4
.
get
(
"value"
))));
// 日收益
try
{
Map
<
String
,
String
>
map4
=
sunlightDto
.
getToday_income
();
if
(
map4
!=
null
&&
map4
.
get
(
"unit"
)
!=
null
&&
!
map4
.
get
(
"unit"
).
isEmpty
()
&&
!
"--"
.
equals
(
map4
.
get
(
"value"
)))
{
jpStation
.
setDayIncome
(
SunlightUtil
.
sy
.
get
(
String
.
valueOf
(
map4
.
get
(
"unit"
)))
*
Double
.
valueOf
(
String
.
valueOf
(
map4
.
get
(
"value"
))));
// 日收益
}
}
catch
(
Exception
e
){
jpStation
.
setDayIncome
(
0.0
);
}
Map
<
String
,
String
>
map5
=
sunlightDto
.
getTotal_income
();
...
...
@@ -338,7 +360,7 @@ public class SunlightServiceImpl implements SunlightService {
bodyparamjp
.
put
(
"size"
,
3000
);
bodyparamjp
.
put
(
"curPage"
,
1
);
bodyparamjp
.
put
(
"device_type_list"
,
lif
);
JSONObject
jsonObject1data
=
SunlightUtil
.
get
DataList
(
SunlightUtil
.
getDeviceList
,
bodyparamjp
);
JSONObject
jsonObject1data
=
SunlightUtil
.
get
data
(
SunlightUtil
.
getDeviceList
,
bodyparamjp
);
List
<
Device
>
listd
=
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
jsonObject1data
.
get
(
"pageList"
)),
Device
.
class
);
// 获取电站,月发电量
...
...
@@ -473,11 +495,11 @@ public class SunlightServiceImpl implements SunlightService {
jpStationMapper
.
insert
(
jpStation
);
}
if
(
listd
!=
null
)
{
if
(
CollectionUtil
.
isNotEmpty
(
listd
)
)
{
this
.
setJpInverte
(
listd
,
jpStation
,
listdtx
);
}
if
(
listd
!=
null
)
{
if
(
CollectionUtil
.
isNotEmpty
(
listdtx
)
)
{
this
.
collectorDetail
(
listdtx
,
jpStation
);
}
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/resources/application-dev.properties
View file @
727d40d3
...
...
@@ -66,12 +66,12 @@ biz.lxyd.lift.url=http://39.106.181.149:8088/elevatorapi
# ??????????
dataRequstScheduled.jinlangyun
=
0 0/40
8
* *
dataRequstScheduled.huawei
=
0 0/40
8
* *
dataRequstScheduled.keshida
=
0 0/40
8
* *
dataRequstScheduled.jinlangyun
=
0 0/40
* *
* *
dataRequstScheduled.huawei
=
0 0/40
* *
* *
dataRequstScheduled.keshida
=
0 0/40
* *
* *
dataRequstScheduled.Sunlight
=
0 0/40
8
* *
dataRequstScheduled.GoodWe
=
0 0/40
8
* *
dataRequstScheduled.Sunlight
=
0 0/40
* *
* *
dataRequstScheduled.GoodWe
=
0 0/40
* *
* *
dataRequstScheduled.Sofar
=
0 0/20 * * * *
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/BusinessFieldMapper.xml
View file @
727d40d3
...
...
@@ -30,7 +30,7 @@
and hph.project_address like concat(concat('%',#{map.province}),'%')
</if>
GROUP BY hps.peasant_household_id
ORDER BY hps.
rec_date
desc
ORDER BY hps.
peasant_household_id
desc
</select>
<select
id=
"getBasicInformation"
resultType=
"java.util.Map"
>
...
...
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