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
c8f05382
Commit
c8f05382
authored
Sep 22, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
a0d84e90
e610372d
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
81 additions
and
23 deletions
+81
-23
GolangRequestUtil.java
...eejoin/amos/api/householdapi/Utils/GolangRequestUtil.java
+12
-5
GoLangConstant.java
...eejoin/amos/api/householdapi/constant/GoLangConstant.java
+2
-1
HouseholdTestController.java
.../api/householdapi/controller/HouseholdTestController.java
+1
-1
CollectorDetailDto.java
...in/amos/api/householdapi/face/dto/CollectorDetailDto.java
+2
-0
JpCollector.java
...useholdapi/face/orm/houseapi/entity/hygf/JpCollector.java
+11
-0
JpInverter.java
...ouseholdapi/face/orm/houseapi/entity/hygf/JpInverter.java
+10
-0
JpStation.java
...householdapi/face/orm/houseapi/entity/hygf/JpStation.java
+2
-0
GolangCollectorListMapper.java
...i/face/orm/mapper/tdengine/GolangCollectorListMapper.java
+1
-1
GolangInverterListMapper.java
...pi/face/orm/mapper/tdengine/GolangInverterListMapper.java
+1
-3
GoLangDataAcquisitionServiceImpl.java
...i/face/service/impl/GoLangDataAcquisitionServiceImpl.java
+21
-11
TdHygfJpInverterWarnServiceImpl.java
...ygf/biz/service/impl/TdHygfJpInverterWarnServiceImpl.java
+18
-1
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/GolangRequestUtil.java
View file @
c8f05382
...
@@ -44,19 +44,21 @@ public class GolangRequestUtil {
...
@@ -44,19 +44,21 @@ public class GolangRequestUtil {
}
}
/**
/**
* @desc 根据请求参数发送http请求并且对于返回的数据进行处理
* @param apiurl 请求url
* @param apiurl 请求url
* @param requestMethod 请求方式
* @param requestMethod 请求方式
* @param requestParmInfo 请求参数mapper
* @param requestParmInfo 请求参数mapper
* @param ResultResolveRule 请求的解析
* @param ResultResolveRule 请求的解析
* @param tClass 需要转换成的bean
* @param tClass 需要转换成的bean
* @return List<T> list<Result>
* @param <T> 泛型数据
* @param <T> 泛型数据
* @return List<T> list<Result>
* @desc 根据请求参数发送http请求并且对于返回的数据进行处理
*/
*/
public
<
T
>
List
<
T
>
getResPonse
(
String
apiurl
,
String
requestMethod
,
String
requestParmInfo
,
String
ResultResolveRule
,
Class
<
T
>
tClass
)
{
public
<
T
>
List
<
T
>
getResPonse
(
String
apiurl
,
String
requestMethod
,
String
requestParmInfo
,
String
ResultResolveRule
,
Class
<
T
>
tClass
)
{
String
respone
=
""
;
String
respone
=
""
;
String
params
=
""
;
String
params
=
""
;
JSONArray
jsonArray
=
null
;
JSONArray
jsonArray
=
null
;
List
<
T
>
result
=
new
ArrayList
<>();
try
{
HashMap
<
String
,
Object
>
producerInfo
=
getHeaderOfGolang
();
HashMap
<
String
,
Object
>
producerInfo
=
getHeaderOfGolang
();
String
baseurl
=
(
String
)
producerInfo
.
get
(
"apiurl"
);
String
baseurl
=
(
String
)
producerInfo
.
get
(
"apiurl"
);
HashMap
<
String
,
String
>
headMap
=
(
HashMap
<
String
,
String
>)
producerInfo
.
get
(
"header"
);
HashMap
<
String
,
String
>
headMap
=
(
HashMap
<
String
,
String
>)
producerInfo
.
get
(
"header"
);
...
@@ -66,15 +68,20 @@ public class GolangRequestUtil {
...
@@ -66,15 +68,20 @@ public class GolangRequestUtil {
JLYHeaderMapHandler
(
params
,
headMap
,
orginalAuthorization
,
appsecret
,
apiurl
);
JLYHeaderMapHandler
(
params
,
headMap
,
orginalAuthorization
,
appsecret
,
apiurl
);
respone
=
sendRequest
(
requestMethod
,
url
,
requestParmInfo
,
headMap
);
respone
=
sendRequest
(
requestMethod
,
url
,
requestParmInfo
,
headMap
);
jsonArray
=
handlerResponseByResultResolverule
(
ResultResolveRule
,
respone
);
jsonArray
=
handlerResponseByResultResolverule
(
ResultResolveRule
,
respone
);
List
<
T
>
result
=
JSONArray
.
parseArray
(
jsonArray
.
toJSONString
(),
tClass
);
if
(!
ObjectUtils
.
isEmpty
(
jsonArray
))
{
result
=
JSONArray
.
parseArray
(
jsonArray
.
toJSONString
(),
tClass
);
}
}
catch
(
Exception
exception
)
{
return
result
;
}
return
result
;
return
result
;
}
}
/**
/**
* @desc 根据解析规则解析请求返回数据
* @param resultResovle 请求返回的解析规则 来源与数据库
* @param resultResovle 请求返回的解析规则 来源与数据库
* @param response 请求返回的字符串
* @param response 请求返回的字符串
* @return 解析后的数据
* @return 解析后的数据
* @desc 根据解析规则解析请求返回数据
*/
*/
public
JSONArray
handlerResponseByResultResolverule
(
String
resultResovle
,
String
response
)
{
public
JSONArray
handlerResponseByResultResolverule
(
String
resultResovle
,
String
response
)
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
response
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
response
);
...
@@ -136,10 +143,10 @@ public class GolangRequestUtil {
...
@@ -136,10 +143,10 @@ public class GolangRequestUtil {
}
}
/**
/**
* @desc 根据分页规则 获取分页数
* @param pageSizeResovle
* @param pageSizeResovle
* @param response
* @param response
* @return
* @return
* @desc 根据分页规则 获取分页数
*/
*/
public
Integer
getPagesize
(
String
pageSizeResovle
,
String
response
)
{
public
Integer
getPagesize
(
String
pageSizeResovle
,
String
response
)
{
Integer
pageSize
=
0
;
Integer
pageSize
=
0
;
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/constant/GoLangConstant.java
View file @
c8f05382
...
@@ -56,5 +56,6 @@ public class GoLangConstant {
...
@@ -56,5 +56,6 @@ public class GoLangConstant {
public
static
String
requestPost
=
"POST"
;
public
static
String
requestPost
=
"POST"
;
public
static
String
datePattern
=
"yyyy-MM-dd HH:mm:ss.SSS"
;
public
static
String
datePattern
=
"yyyy-MM-dd HH:mm:ss.SSS"
;
public
static
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
datePattern
);
public
static
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
datePattern
);
public
static
Double
kwhToMwh
=
0.0001
;
public
static
Double
kwhToMwh
=
0.0001
;
public
static
Double
mwhTokwh
=
1000.0
;
}
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/controller/HouseholdTestController.java
View file @
c8f05382
...
@@ -56,7 +56,7 @@ public class HouseholdTestController {
...
@@ -56,7 +56,7 @@ public class HouseholdTestController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"锦浪云"
,
notes
=
"锦浪云"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"锦浪云"
,
notes
=
"锦浪云"
)
public
void
golangnew
()
throws
IOException
{
public
void
golangnew
()
throws
IOException
{
// goLangDataAcquisitionService.stationList();
// goLangDataAcquisitionService.stationList();
//
goLangDataAcquisitionService.stationDetail();
goLangDataAcquisitionService
.
stationDetail
();
// goLangDataAcquisitionService.collectorList();
// goLangDataAcquisitionService.collectorList();
//// goLangDataAcquisitionService.inverterList();
//// goLangDataAcquisitionService.inverterList();
goLangDataAcquisitionService
.
collectorDetail
();
goLangDataAcquisitionService
.
collectorDetail
();
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/dto/CollectorDetailDto.java
View file @
c8f05382
...
@@ -13,4 +13,6 @@ public class CollectorDetailDto {
...
@@ -13,4 +13,6 @@ public class CollectorDetailDto {
private
String
stationId
;
private
String
stationId
;
private
String
rssiLevel
;
private
String
rssiLevel
;
private
String
model
;
private
String
model
;
private
String
addr
;
private
String
stationName
;
}
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/houseapi/entity/hygf/JpCollector.java
View file @
c8f05382
...
@@ -115,5 +115,16 @@ public class JpCollector implements Serializable {
...
@@ -115,5 +115,16 @@ public class JpCollector implements Serializable {
*/
*/
@TableField
(
"third_code"
)
@TableField
(
"third_code"
)
private
String
thirdCode
;
private
String
thirdCode
;
/**
* 场站名称
*/
@TableField
(
"station_name"
)
private
String
stationName
;
/**
* 场站地址
*/
@TableField
(
"addr"
)
private
String
addr
;
}
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/houseapi/entity/hygf/JpInverter.java
View file @
c8f05382
...
@@ -174,5 +174,15 @@ public class JpInverter implements Serializable {
...
@@ -174,5 +174,15 @@ public class JpInverter implements Serializable {
*/
*/
@TableField
(
"total_power_generation"
)
@TableField
(
"total_power_generation"
)
private
Double
totalPowerGeneration
;
private
Double
totalPowerGeneration
;
/**
* 场站名称
*/
@TableField
(
"station_name"
)
private
String
stationName
;
/**
* 场站地址
*/
@TableField
(
"addr"
)
private
String
addr
;
}
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/houseapi/entity/hygf/JpStation.java
View file @
c8f05382
...
@@ -217,4 +217,6 @@ public class JpStation implements Serializable {
...
@@ -217,4 +217,6 @@ public class JpStation implements Serializable {
private
Double
yearPowerUse
;
// 年用电量
private
Double
yearPowerUse
;
// 年用电量
@TableField
(
"email"
)
@TableField
(
"email"
)
private
String
email
;
// 电子邮箱
private
String
email
;
// 电子邮箱
@TableField
(
"rated_power"
)
private
Double
ratedPower
;
// 额定功率
}
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/mapper/tdengine/GolangCollectorListMapper.java
View file @
c8f05382
...
@@ -7,6 +7,6 @@ import org.apache.ibatis.annotations.Select;
...
@@ -7,6 +7,6 @@ import org.apache.ibatis.annotations.Select;
import
java.util.List
;
import
java.util.List
;
public
interface
GolangCollectorListMapper
extends
BaseMapper
<
GolangCollectorList
>
{
public
interface
GolangCollectorListMapper
extends
BaseMapper
<
GolangCollectorList
>
{
@Select
(
"select id from golang_collector_list group by id"
)
@Select
(
"select id from golang_collector_list
where sn is not null
group by id"
)
List
<
Long
>
getCollectIds
();
List
<
Long
>
getCollectIds
();
}
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/mapper/tdengine/GolangInverterListMapper.java
View file @
c8f05382
...
@@ -7,8 +7,6 @@ import org.apache.ibatis.annotations.Select;
...
@@ -7,8 +7,6 @@ import org.apache.ibatis.annotations.Select;
import
java.util.List
;
import
java.util.List
;
public
interface
GolangInverterListMapper
extends
BaseMapper
<
GolangInverterList
>
{
public
interface
GolangInverterListMapper
extends
BaseMapper
<
GolangInverterList
>
{
@Select
(
"select id from golang_inveter_list group by id"
)
@Select
(
"select sn from golang_inveter_list where sn is not null group by sn"
)
List
<
Long
>
getInverterIds
();
@Select
(
"select sn from golang_inveter_list group by sn"
)
List
<
String
>
getInverterSns
();
List
<
String
>
getInverterSns
();
}
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/GoLangDataAcquisitionServiceImpl.java
View file @
c8f05382
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateTime;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateTime;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.fasterxml.jackson.core.JsonParser
;
import
com.yeejoin.amos.api.householdapi.Utils.GolangRequestUtil
;
import
com.yeejoin.amos.api.householdapi.Utils.GolangRequestUtil
;
import
com.yeejoin.amos.api.householdapi.constant.GoLangConstant
;
import
com.yeejoin.amos.api.householdapi.constant.GoLangConstant
;
import
com.yeejoin.amos.api.householdapi.face.dto.AlarmDto
;
import
com.yeejoin.amos.api.householdapi.face.dto.AlarmDto
;
...
@@ -27,6 +28,7 @@ import org.springframework.scheduling.annotation.Async;
...
@@ -27,6 +28,7 @@ import org.springframework.scheduling.annotation.Async;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -146,23 +148,28 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
...
@@ -146,23 +148,28 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpStation
.
setLatitude
(
golangStationDetail
.
getLatitude
());
jpStation
.
setLatitude
(
golangStationDetail
.
getLatitude
());
jpStation
.
setUserName
(
golangStationDetail
.
getUsername
());
jpStation
.
setUserName
(
golangStationDetail
.
getUsername
());
jpStation
.
setUserPhone
(
String
.
valueOf
(
golangStationDetail
.
getUsermobile
()));
jpStation
.
setUserPhone
(
String
.
valueOf
(
golangStationDetail
.
getUsermobile
()));
jpStation
.
setStationContact
(
String
.
valueOf
(
golangStationDetail
.
getMobile
()).
toLowerCase
().
replace
(
"null"
,
""
));
jpStation
.
setStationContact
(
String
.
valueOf
(
golangStationDetail
.
getMobile
()).
toLowerCase
().
replace
(
"null"
,
""
));
jpStation
.
setModuleCount
(
Math
.
toIntExact
(
golangStationDetail
.
getModule
()));
jpStation
.
setModuleCount
(
ObjectUtils
.
isEmpty
(
Math
.
toIntExact
(
golangStationDetail
.
getModule
()))?
0
:
Math
.
toIntExact
(
golangStationDetail
.
getModule
()));
//并网类型
//并网类型
jpStation
.
setOnGridType
(
GoLangConstant
.
stationStaus
.
get
(
String
.
valueOf
(
golangStationDetail
.
getState
())));
jpStation
.
setOnGridType
(
GoLangConstant
.
stationStaus
.
get
(
String
.
valueOf
(
golangStationDetail
.
getState
())));
jpStation
.
setThirdStationId
(
String
.
valueOf
(
golangStationDetail
.
getId
()));
jpStation
.
setThirdStationId
(
String
.
valueOf
(
golangStationDetail
.
getId
()));
jpStation
.
setThirdCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
jpStation
.
setThirdCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
jpStation
.
setRealTimePower
(
golangStationDetail
.
getPower
());
jpStation
.
setRealTimePower
(
golangStationDetail
.
getPower
());
jpStation
.
setState
(
GoLangConstant
.
intoNetWorkStatus
.
get
(
String
.
valueOf
(
golangStationDetail
.
getStationtypenew
())));
jpStation
.
setState
(
GoLangConstant
.
intoNetWorkStatus
.
get
(
String
.
valueOf
(
golangStationDetail
.
getStationtypenew
())));
jpStation
.
setDayGenerate
(
golangStationDetail
.
getDayenergy
()*
GoLangConstant
.
kwhToMwh
);
jpStation
.
setDayGenerate
(
golangStationDetail
.
getDayenergy
());
jpStation
.
setMonthGenerate
(
golangStationDetail
.
getMonthenergy
());
jpStation
.
setMonthGenerate
(
golangStationDetail
.
getMonthenergy
()
*
GoLangConstant
.
mwhTokwh
);
jpStation
.
setYearGenerate
(
golangStationDetail
.
getYearenergy
());
jpStation
.
setYearGenerate
(
golangStationDetail
.
getYearenergy
()
*
GoLangConstant
.
mwhTokwh
);
jpStation
.
setAccumulatedPower
(
golangStationDetail
.
getAllenergy
()
*
GoLangConstant
.
mwhTokwh
);
jpStation
.
setDayIncome
(
golangStationDetail
.
getDayincome
());
jpStation
.
setDayIncome
(
golangStationDetail
.
getDayincome
());
jpStation
.
setMonthIncome
(
golangStationDetail
.
getMonthincome
());
jpStation
.
setMonthIncome
(
golangStationDetail
.
getMonthincome
());
jpStation
.
setYearIncome
(
golangStationDetail
.
getYearincome
());
jpStation
.
setYearIncome
(
golangStationDetail
.
getYearincome
());
jpStation
.
setCumulativeIncome
(
golangStationDetail
.
getAllincome
());
jpStation
.
setCumulativeIncome
(
golangStationDetail
.
getAllincome
());
jpStation
.
setArea
(
golangStationDetail
.
getRegionstr
());
jpStation
.
setArea
(
golangStationDetail
.
getRegionstr
());
jpStation
.
setEmail
(
golangStationDetail
.
getUseremail
());
jpStation
.
setEmail
(
golangStationDetail
.
getUseremail
());
jpStation
.
setOnGridTime
(
new
Date
(
golangStationDetail
.
getFispowertime
()));
jpStation
.
setAccessTime
(
new
Date
(
golangStationDetail
.
getFisgeneratetime
()));
jpStation
.
setCreateTime
(
new
Date
(
golangStationDetail
.
getCreatedate
()));
jpStation
.
setRatedPower
(
Double
.
valueOf
(
golangStationDetail
.
getInverterpower
()));
if
(!
ObjectUtils
.
isEmpty
(
jpStation
.
getSequenceNbr
()))
{
if
(!
ObjectUtils
.
isEmpty
(
jpStation
.
getSequenceNbr
()))
{
jpStationMapper
.
updateById
(
jpStation
);
jpStationMapper
.
updateById
(
jpStation
);
}
else
{
}
else
{
...
@@ -171,7 +178,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
...
@@ -171,7 +178,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
HYGFJPStationPowerHistory
hygfjpStationPowerHistory
=
new
HYGFJPStationPowerHistory
();
HYGFJPStationPowerHistory
hygfjpStationPowerHistory
=
new
HYGFJPStationPowerHistory
();
hygfjpStationPowerHistory
.
setCreatedTime
(
System
.
currentTimeMillis
());
hygfjpStationPowerHistory
.
setCreatedTime
(
System
.
currentTimeMillis
());
hygfjpStationPowerHistory
.
setThirdStationId
(
jpStation
.
getThirdStationId
());
hygfjpStationPowerHistory
.
setThirdStationId
(
jpStation
.
getThirdStationId
());
hygfjpStationPowerHistory
.
setPower
(
jpStation
.
getRealTime
Power
());
hygfjpStationPowerHistory
.
setPower
(
golangStationDetail
.
get
Power
());
hygfjpStationPowerHistory
.
setThirdCode
(
jpStation
.
getThirdCode
());
hygfjpStationPowerHistory
.
setThirdCode
(
jpStation
.
getThirdCode
());
hygfjpStationPowerHistory
.
setTime
(
System
.
currentTimeMillis
());
hygfjpStationPowerHistory
.
setTime
(
System
.
currentTimeMillis
());
hygfjpStationPowerHistoryMapper
.
insert
(
hygfjpStationPowerHistory
);
hygfjpStationPowerHistoryMapper
.
insert
(
hygfjpStationPowerHistory
);
...
@@ -278,6 +285,8 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
...
@@ -278,6 +285,8 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpCollector
.
setThirdCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
jpCollector
.
setThirdCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
//第三方厂商标识
//第三方厂商标识
jpCollector
.
setState
(
GoLangConstant
.
stationStaus
.
get
(
collectorDetailDto
.
getState
()));
jpCollector
.
setState
(
GoLangConstant
.
stationStaus
.
get
(
collectorDetailDto
.
getState
()));
jpCollector
.
setStationName
(
collectorDetailDto
.
getStationName
());
jpCollector
.
setAddr
(
collectorDetailDto
.
getAddr
());
if
(
ObjectUtils
.
isEmpty
(
jpCollector
.
getSequenceNbr
()))
{
if
(
ObjectUtils
.
isEmpty
(
jpCollector
.
getSequenceNbr
()))
{
jpCollectorMapper
.
insert
(
jpCollector
);
jpCollectorMapper
.
insert
(
jpCollector
);
}
else
{
}
else
{
...
@@ -359,10 +368,10 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
...
@@ -359,10 +368,10 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpInverter
.
setCollectorSnCode
(
inverterDetailDto
.
getCollectorsn
());
jpInverter
.
setCollectorSnCode
(
inverterDetailDto
.
getCollectorsn
());
jpInverter
.
setUpdateTime
(
new
Date
());
jpInverter
.
setUpdateTime
(
new
Date
());
jpInverter
.
setCurrentPower
(
inverterDetailDto
.
getPac
());
jpInverter
.
setCurrentPower
(
inverterDetailDto
.
getPac
());
jpInverter
.
setDayPowerGeneration
(
inverterDetailDto
.
getEToday
()
*
GoLangConstant
.
kwhToMwh
);
jpInverter
.
setDayPowerGeneration
(
inverterDetailDto
.
getEToday
());
jpInverter
.
setMonthPowerGeneration
(
inverterDetailDto
.
getEMonth
());
jpInverter
.
setMonthPowerGeneration
(
inverterDetailDto
.
getEMonth
()
*
GoLangConstant
.
mwhTokwh
);
jpInverter
.
setYearPowerGeneration
(
inverterDetailDto
.
getEYear
());
jpInverter
.
setYearPowerGeneration
(
inverterDetailDto
.
getEYear
()
*
GoLangConstant
.
mwhTokwh
);
jpInverter
.
setTotalPowerGeneration
(
inverterDetailDto
.
getETotal
());
jpInverter
.
setTotalPowerGeneration
(
inverterDetailDto
.
getETotal
()
*
GoLangConstant
.
mwhTokwh
);
jpInverter
.
setBrand
(
inverterDetailDto
.
getName
());
jpInverter
.
setBrand
(
inverterDetailDto
.
getName
());
jpInverter
.
setModel
(
inverterDetailDto
.
getProductModel
());
jpInverter
.
setModel
(
inverterDetailDto
.
getProductModel
());
jpInverter
.
setNationalStandard
(
inverterDetailDto
.
getNationalStandards
());
jpInverter
.
setNationalStandard
(
inverterDetailDto
.
getNationalStandards
());
...
@@ -372,6 +381,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
...
@@ -372,6 +381,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpInverter
.
setCapacity
(
inverterDetailDto
.
getPower
().
intValue
());
jpInverter
.
setCapacity
(
inverterDetailDto
.
getPower
().
intValue
());
jpInverter
.
setThirdStationId
(
String
.
valueOf
(
inverterDetailDto
.
getStationId
()));
jpInverter
.
setThirdStationId
(
String
.
valueOf
(
inverterDetailDto
.
getStationId
()));
jpInverter
.
setThirdCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
jpInverter
.
setThirdCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
jpInverter
.
setStationName
(
inverterDetailDto
.
getStationName
());
if
(!
ObjectUtils
.
isEmpty
(
jpInverter
.
getSequenceNbr
()))
{
if
(!
ObjectUtils
.
isEmpty
(
jpInverter
.
getSequenceNbr
()))
{
jpInverterMapper
.
updateById
(
jpInverter
);
jpInverterMapper
.
updateById
(
jpInverter
);
}
else
{
}
else
{
...
@@ -449,7 +459,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
...
@@ -449,7 +459,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
hygfjpInverterHistory
.
setSnCode
(
inverterDetailDto
.
getSn
());
hygfjpInverterHistory
.
setSnCode
(
inverterDetailDto
.
getSn
());
hygfjpInverterHistory
.
setThirdCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
hygfjpInverterHistory
.
setThirdCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
hygfjpInverterHistory
.
setGenerationHours
(
inverterDetailDto
.
getFullHour
());
hygfjpInverterHistory
.
setGenerationHours
(
inverterDetailDto
.
getFullHour
());
hygfjpInverterHistory
.
setPowerGeneration
(
inverterDetailDto
.
getEToday
()
*
GoLangConstant
.
kwhToMwh
);
hygfjpInverterHistory
.
setPowerGeneration
(
inverterDetailDto
.
getEToday
());
if
(
ObjectUtils
.
isEmpty
(
hygfjpInverterHistory
.
getCreatedTime
()))
{
if
(
ObjectUtils
.
isEmpty
(
hygfjpInverterHistory
.
getCreatedTime
()))
{
hygfjpInverterHistory
.
setCreatedTime
(
System
.
currentTimeMillis
());
hygfjpInverterHistory
.
setCreatedTime
(
System
.
currentTimeMillis
());
hygfjpInverterHistoryMapper
.
insert
(
hygfjpInverterHistory
);
hygfjpInverterHistoryMapper
.
insert
(
hygfjpInverterHistory
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/TdHygfJpInverterWarnServiceImpl.java
View file @
c8f05382
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
java.lang.reflect.Array
;
import
java.lang.reflect.Array
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -52,7 +54,21 @@ public class TdHygfJpInverterWarnServiceImpl
...
@@ -52,7 +54,21 @@ public class TdHygfJpInverterWarnServiceImpl
String
[]
s
=
tdHygfJpInverterWarnDto
.
getState
().
split
(
","
);
String
[]
s
=
tdHygfJpInverterWarnDto
.
getState
().
split
(
","
);
tdHygfJpInverterWarnDto
.
setStates
(
Arrays
.
asList
(
s
));
tdHygfJpInverterWarnDto
.
setStates
(
Arrays
.
asList
(
s
));
}
}
List
<
TdHygfJpInverterWarnDto
>
list
=
this
.
baseMapper
.
list
(
tdHygfJpInverterWarnDto
);
if
(
tdHygfJpInverterWarnDto
.
getStationName
()
!=
null
)
{
LambdaQueryWrapper
<
JpStation
>
wapper
=
new
LambdaQueryWrapper
<
JpStation
>().
like
(
JpStation:
:
getName
,
tdHygfJpInverterWarnDto
.
getStationName
());
if
(!
tdHygfJpInverterWarnDto
.
getStationIds
().
isEmpty
())
{
wapper
.
in
(
JpStation:
:
getThirdStationId
,
tdHygfJpInverterWarnDto
.
getStationIds
());
}
List
<
JpStation
>
sList
=
jpStationServiceImpl
.
list
(
wapper
);
List
<
String
>
ids
=
sList
.
stream
().
map
(
i
->
i
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
tdHygfJpInverterWarnDto
.
setStationIds
(
ids
);
}
List
<
TdHygfJpInverterWarnDto
>
list
=
new
ArrayList
<>();
if
(
tdHygfJpInverterWarnDto
.
getStationIds
().
isEmpty
())
{
}
else
{
list
=
this
.
baseMapper
.
list
(
tdHygfJpInverterWarnDto
);
if
(!
list
.
isEmpty
())
{
if
(!
list
.
isEmpty
())
{
list
.
forEach
(
i
->
{
list
.
forEach
(
i
->
{
JpStation
jpStation
=
jpStationServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
JpStation
>()
JpStation
jpStation
=
jpStationServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
JpStation
>()
...
@@ -67,6 +83,7 @@ public class TdHygfJpInverterWarnServiceImpl
...
@@ -67,6 +83,7 @@ public class TdHygfJpInverterWarnServiceImpl
}
}
});
});
}
}
}
PageInfo
<
TdHygfJpInverterWarnDto
>
page
=
new
PageInfo
(
list
);
PageInfo
<
TdHygfJpInverterWarnDto
>
page
=
new
PageInfo
(
list
);
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
TdHygfJpInverterWarnDto
>
pagenew
=
new
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
TdHygfJpInverterWarnDto
>();
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
TdHygfJpInverterWarnDto
>
pagenew
=
new
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
TdHygfJpInverterWarnDto
>();
pagenew
.
setCurrent
(
pageNum
);
pagenew
.
setCurrent
(
pageNum
);
...
...
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