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
5706a380
Commit
5706a380
authored
May 08, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
电站监控接口
parent
e6900a0e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
117 additions
and
6 deletions
+117
-6
SofarDataAcquisitionServiceImpl.java
...pi/face/service/impl/SofarDataAcquisitionServiceImpl.java
+10
-0
JpStationMapper.java
...oin/amos/boot/module/hygf/api/mapper/JpStationMapper.java
+3
-0
JpInverterMapper.xml
...-api/src/main/resources/mapper/mysql/JpInverterMapper.xml
+6
-2
JpStationMapper.xml
...f-api/src/main/resources/mapper/mysql/JpStationMapper.xml
+34
-0
JpStationController.java
.../boot/module/hygf/biz/controller/JpStationController.java
+22
-0
TdHygfJpInverterWarnController.java
...e/hygf/biz/controller/TdHygfJpInverterWarnController.java
+4
-4
JpStationServiceImpl.java
...ot/module/hygf/biz/service/impl/JpStationServiceImpl.java
+38
-0
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/SofarDataAcquisitionServiceImpl.java
View file @
5706a380
...
...
@@ -1198,6 +1198,10 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
requestInfo
.
put
(
"endTime"
,
date
);
requestInfo
.
put
(
"stationId"
,
jpStation
.
getThirdStationId
());
if
(
jpStation
.
getThirdStationId
().
equals
(
"517021808701218816"
)){
System
.
out
.
println
(
"6666666666666666666666666"
);
}
String
param
=
JSON
.
toJSONString
(
requestInfo
);
List
<
SofarWarm
>
jsonObject2
=
requestUtil
.
getResPonse
(
SoFarConstant
.
alert
,
SoFarConstant
.
requestPost
,
param
,
SoFarConstant
.
stationAlertItems
,
SofarWarm
.
class
);
...
...
@@ -1248,6 +1252,12 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
hygfjpInverterWarn
.
setTimeLong
(
this
.
convertDate
(
hygfjpInverterWarn
.
getRecoverTime
())
-
this
.
convertDate
(
hygfjpInverterWarn
.
getStartTime
()));
}
if
(
ObjectUtils
.
isEmpty
(
hygfjpInverterWarn
.
getCreatedTime
()))
{
hygfjpInverterWarn
.
setCreatedTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarnMapper
.
insert
(
hygfjpInverterWarn
);
}
else
{
hygfjpInverterWarnMapper
.
insert
(
hygfjpInverterWarn
);
}
}
}
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/JpStationMapper.java
View file @
5706a380
...
...
@@ -80,4 +80,7 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
@UserEmpower
(
field
={
"hygf_jp_station.regional_companies_code"
},
dealerField
={
"hygf_jp_station.amos_company_code"
,
"hygf_jp_station.regional_companies_code"
}
,
fieldConditions
={
"eq"
,
"in"
}
,
relationship
=
"and"
)
List
<
JpStationDto
>
queryAllPowerStation
(
String
regionalCompaniesCode
,
String
amosCompanyCode
,
String
powerStationId
);
@UserEmpower
(
field
={
"hygf_jp_station.regional_companies_code"
},
dealerField
={
"hygf_jp_station.amos_company_code"
,
"hygf_jp_station.regional_companies_code"
}
,
fieldConditions
={
"eq"
,
"in"
}
,
relationship
=
"and"
)
List
<
Map
<
String
,
Object
>>
selectStateCount
(
String
regionalCompaniesCode
,
String
amosCompanyCode
,
String
type
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/JpInverterMapper.xml
View file @
5706a380
...
...
@@ -80,6 +80,9 @@
<if
test=
"dto.snCode != null and dto.snCode != ''"
>
AND hjc.sn_code like #{dto.snCode}
</if>
<if
test=
"dto.state != null and dto.state != ''"
>
AND hjc.state = #{dto.state}
</if>
<if
test=
"dto.minValue != null and dto.minValue !=''"
>
AND hjc.capacity >= #{dto.minValue}
</if>
...
...
@@ -101,6 +104,9 @@
<if
test=
"dto.snCode != null and dto.snCode != ''"
>
AND hjc.sn_code like #{dto.snCode}
</if>
<if
test=
"dto.state != null and dto.state != ''"
>
AND hjc.state = #{dto.state}
</if>
<if
test=
"dto.minValue != null and dto.minValue !=''"
>
AND hjc. capacity >= #{dto.minValue}
</if>
...
...
@@ -127,8 +133,6 @@
</foreach>
)
GROUP BY all_statuses.status
ORDER BY all_statuses.status;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/JpStationMapper.xml
View file @
5706a380
...
...
@@ -612,6 +612,9 @@
<if
test=
"dto.regionalCompaniesCode!=null"
>
and hygf_jp_station.regional_companies_code =#{dto.regionalCompaniesCode}
</if>
<if
test=
"dto.state!=null"
>
and hygf_jp_station.state =#{dto.state}
</if>
<if
test=
"dto.amosCompanyCode!=null"
>
and hygf_jp_station.amos_company_code =#{dto.amosCompanyCode}
</if>
...
...
@@ -692,6 +695,37 @@
<select
id=
"selectStateCount"
resultType=
"map"
>
SELECT
all_statuses.status,
COALESCE(COUNT(hygf_jp_station.state), 0) AS count
FROM (
SELECT '在线' AS status
UNION ALL
SELECT '离线' AS status
UNION ALL
SELECT '报警' AS status
) AS all_statuses
LEFT JOIN hygf_jp_station ON all_statuses.status = hygf_jp_station.state
<where>
hygf_jp_station.regional_companies_code is not null
<if
test=
"type!=null"
>
and hygf_jp_station.type =#{type}
</if>
<if
test=
"regionalCompaniesCode!=null"
>
and hygf_jp_station.regional_companies_code like concat('%',#{regionalCompaniesCode},'%')
</if>
<if
test=
"amosCompanyCode!=null"
>
and hygf_jp_station.amos_company_code =#{amosCompanyCode}
</if>
</where>
GROUP BY all_statuses.status
ORDER BY all_statuses.status;
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/JpStationController.java
View file @
5706a380
...
...
@@ -842,4 +842,26 @@ public class JpStationController extends BaseController {
return
ResponseHelper
.
buildResponse
(
poserStatisticsData
);
}
//查询经销商统计数据(根据区域公司orgCode)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询电站状态统计"
,
notes
=
"查询电站状态统计"
)
@GetMapping
(
value
=
"/selectStateCount"
)
@UserLimits
public
ResponseModel
<
Map
<
String
,
Object
>>
selectStateCount
(
@RequestParam
(
required
=
false
)
String
regionalCompaniesCode
,
@RequestParam
(
required
=
false
)
String
amosCompanyCode
,
@RequestParam
(
required
=
false
)
String
type
)
{
return
ResponseHelper
.
buildResponse
(
jpStationServiceImpl
.
selectStateCount
(
regionalCompaniesCode
,
amosCompanyCode
,
type
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询电站下设备详情"
,
notes
=
"查询电站下设备详情"
)
@GetMapping
(
value
=
"/queryEquipInfo"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
queryEquipInfo
(
String
thirdStationId
)
{
return
ResponseHelper
.
buildResponse
(
jpStationServiceImpl
.
queryEquipInfo
(
thirdStationId
));
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/TdHygfJpInverterWarnController.java
View file @
5706a380
...
...
@@ -323,9 +323,9 @@ public class TdHygfJpInverterWarnController extends BaseController {
@UserLimits
public
ResponseModel
<
Map
<
String
,
Object
>>
queryAlarmNumber
(
@RequestParam
(
required
=
false
)
String
regionalCompaniesCode
,
@RequestParam
(
required
=
false
)
String
amosCompanyCode
,
@RequestParam
(
required
=
false
)
String
power
StationId
@RequestParam
(
required
=
false
)
String
third
StationId
)
{
Map
<
String
,
Object
>
result
=
tdHygfJpInverterWarnServiceImpl
.
queryAlarmNumber
(
regionalCompaniesCode
,
amosCompanyCode
,
power
StationId
);
Map
<
String
,
Object
>
result
=
tdHygfJpInverterWarnServiceImpl
.
queryAlarmNumber
(
regionalCompaniesCode
,
amosCompanyCode
,
third
StationId
);
return
ResponseHelper
.
buildResponse
(
result
);
}
...
...
@@ -336,9 +336,9 @@ public class TdHygfJpInverterWarnController extends BaseController {
@UserLimits
public
ResponseModel
<
Map
<
String
,
Object
>>
queryStateNumber
(
@RequestParam
(
required
=
false
)
String
regionalCompaniesCode
,
@RequestParam
(
required
=
false
)
String
amosCompanyCode
,
@RequestParam
(
required
=
false
)
String
power
StationId
@RequestParam
(
required
=
false
)
String
third
StationId
)
{
Map
<
String
,
Object
>
result
=
tdHygfJpInverterWarnServiceImpl
.
queryStateNumber
(
regionalCompaniesCode
,
amosCompanyCode
,
power
StationId
);
Map
<
String
,
Object
>
result
=
tdHygfJpInverterWarnServiceImpl
.
queryStateNumber
(
regionalCompaniesCode
,
amosCompanyCode
,
third
StationId
);
return
ResponseHelper
.
buildResponse
(
result
);
}
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/JpStationServiceImpl.java
View file @
5706a380
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.map.MapBuilder
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -11,6 +12,7 @@ import com.github.pagehelper.PageInfo;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserLimits
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.*
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.JpCollectorMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.JpStationMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IJpStationService
;
...
...
@@ -18,6 +20,7 @@ import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.DayGenerateMapper;
import
com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.MonthGenerateMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.MonthPowerMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.YearGenerateMapper
;
import
org.apache.activemq.util.MapHelper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
...
...
@@ -48,6 +51,8 @@ public class JpStationServiceImpl extends BaseService<JpStationDto, JpStation, J
@Autowired
JpInverterMapper
jpInverterMapper
;
@Autowired
JpCollectorMapper
jpCollectorMapper
;
@Autowired
MonthPowerMapper
monthPowerMapper
;
@Autowired
MonthPowerServiceImpl
monthPowerServiceImpl
;
...
...
@@ -977,4 +982,36 @@ public class JpStationServiceImpl extends BaseService<JpStationDto, JpStation, J
List
<
JpStationDto
>
powerStationList
=
jpStationMapper
.
queryAllPowerStation
(
regionalCompaniesCode
,
amosCompanyCode
,
powerStationId
);
return
powerStationList
;
}
public
Map
<
String
,
Object
>
selectStateCount
(
String
regionalCompaniesCode
,
String
amosCompanyCode
,
String
type
){
Map
<
String
,
Object
>
resultNumMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
map
=
jpStationMapper
.
selectStateCount
(
regionalCompaniesCode
,
amosCompanyCode
,
type
);
map
.
forEach
(
e
->{
if
(
e
.
get
(
"status"
).
equals
(
"在线"
)){
resultNumMap
.
put
(
"online"
,(
Integer
.
valueOf
(
e
.
get
(
"count"
).
toString
())));
}
else
if
(
e
.
get
(
"status"
).
equals
(
"报警"
)){
resultNumMap
.
put
(
"warn"
,(
Integer
.
valueOf
(
e
.
get
(
"count"
).
toString
())));
}
else
{
resultNumMap
.
put
(
"offline"
,(
Integer
.
valueOf
(
e
.
get
(
"count"
).
toString
())));
}
});
return
resultNumMap
;
}
public
Map
<
String
,
Object
>
queryEquipInfo
(
String
thirdStationId
){
LambdaQueryWrapper
<
JpInverter
>
inverQuery
=
new
LambdaQueryWrapper
<>();
inverQuery
.
eq
(
JpInverter:
:
getThirdStationId
,
thirdStationId
);
List
<
JpInverter
>
jpInverters
=
jpInverterMapper
.
selectList
(
inverQuery
);
LambdaQueryWrapper
<
JpCollector
>
collectorQuery
=
new
LambdaQueryWrapper
<>();
collectorQuery
.
eq
(
JpCollector:
:
getThirdStationId
,
thirdStationId
);
List
<
JpCollector
>
jpCollectors
=
jpCollectorMapper
.
selectList
(
collectorQuery
);
Map
<
String
,
Object
>
map
=
MapBuilder
.<
String
,
Object
>
create
().
put
(
"inverter"
,
jpInverters
).
put
(
"collector"
,
jpCollectors
).
put
(
"ammeter"
,
new
ArrayList
<>()).
put
(
"meteorograph"
,
new
ArrayList
<>()).
build
();
return
map
;
}
}
\ No newline at end of file
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