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
e6900a0e
Commit
e6900a0e
authored
May 07, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev0124' into developer
parents
6d11a1ea
c863acac
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
144 additions
and
37 deletions
+144
-37
JpCollectorMapper.java
...n/amos/boot/module/hygf/api/mapper/JpCollectorMapper.java
+2
-0
JpInverterMapper.java
...in/amos/boot/module/hygf/api/mapper/JpInverterMapper.java
+2
-0
TdHygfJpInverterWarnMapper.java
...e/hygf/api/tdenginemapper/TdHygfJpInverterWarnMapper.java
+4
-1
JpCollectorMapper.xml
...api/src/main/resources/mapper/mysql/JpCollectorMapper.xml
+21
-0
JpInverterMapper.xml
...-api/src/main/resources/mapper/mysql/JpInverterMapper.xml
+24
-0
JpStationMapper.xml
...f-api/src/main/resources/mapper/mysql/JpStationMapper.xml
+3
-1
TdHygfJpInverterWarnMapper.xml
.../resources/mapper/tdengine/TdHygfJpInverterWarnMapper.xml
+4
-5
JpStationController.java
.../boot/module/hygf/biz/controller/JpStationController.java
+0
-24
TdHygfJpInverterWarnController.java
...e/hygf/biz/controller/TdHygfJpInverterWarnController.java
+13
-0
TdHygfJpInverterWarnServiceImpl.java
...ygf/biz/service/impl/TdHygfJpInverterWarnServiceImpl.java
+71
-6
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/JpCollectorMapper.java
View file @
e6900a0e
...
...
@@ -25,4 +25,6 @@ public interface JpCollectorMapper extends BaseMapper<JpCollector> {
@UserEmpower
(
field
={
"sta.regional_companies_code"
}
,
dealerField
=
{
"sta.amos_company_code"
,
"sta.regional_companies_code"
},
fieldConditions
={
"in"
,
"in"
}
,
relationship
=
"and"
)
int
selectPageDataTota
(
@Param
(
"dto"
)
JpCollectorDto
reviewDto
);
List
<
Map
<
String
,
Object
>>
selectInverterState
(
@Param
(
"thirdStationIds"
)
List
<
String
>
thirdStationIds
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/JpInverterMapper.java
View file @
e6900a0e
...
...
@@ -28,4 +28,6 @@ public interface JpInverterMapper extends BaseMapper<JpInverter> {
@UserEmpower
(
field
={
"sta.regional_companies_code"
}
,
dealerField
={
"sta.amos_company_code"
,
"sta.regional_companies_code"
}
,
fieldConditions
={
"eq"
,
"in"
}
,
relationship
=
"and"
)
int
selectPageDataTotal
(
@Param
(
"dto"
)
JpInverterDto
reviewDto
);
List
<
Map
<
String
,
Object
>>
selectInverterState
(
@Param
(
"thirdStationIds"
)
List
<
String
>
thirdStationIds
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/tdenginemapper/TdHygfJpInverterWarnMapper.java
View file @
e6900a0e
...
...
@@ -11,6 +11,7 @@ import org.apache.ibatis.annotations.Select;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* 户用光伏监盘逆变器报警表 Mapper 接口
...
...
@@ -42,5 +43,7 @@ public interface TdHygfJpInverterWarnMapper extends BaseMapper<TdHygfJpInverterW
// @UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List
<
TdHygfJpInverterWarnDto
>
queryAlarmNumber
(
@Param
(
"thirdStationIds"
)
List
<
String
>
thirdStationIds
);
List
<
TdHygfJpInverterWarnDto
>
queryAlarmNumber
(
@Param
(
"regionalCompaniesCode"
)
Set
<
String
>
regionalCompaniesCodes
);
List
<
TdHygfJpInverterWarnDto
>
queryAlarmNumberS
(
@Param
(
"thirdStationIds"
)
String
thirdStationIds
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/JpCollectorMapper.xml
View file @
e6900a0e
...
...
@@ -90,4 +90,25 @@
</if>
</where>
</select>
<select
id=
"selectInverterState"
resultType=
"java.util.Map"
>
SELECT
all_statuses.status,
COALESCE(COUNT(hygf_jp_collector.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_collector ON all_statuses.status = hygf_jp_collector.state and hygf_jp_collector.third_station_id
in(
<foreach
collection=
"thirdStationIds"
item=
"item"
separator=
","
>
(#{item})
</foreach>
)
GROUP BY all_statuses.status
ORDER BY all_statuses.status;
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/JpInverterMapper.xml
View file @
e6900a0e
...
...
@@ -109,4 +109,28 @@
</if>
</where>
</select>
<select
id=
"selectInverterState"
resultType=
"java.util.Map"
>
SELECT
all_statuses.status,
COALESCE(COUNT(hygf_jp_inverter.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_inverter ON all_statuses.status = hygf_jp_inverter.state and hygf_jp_inverter.third_station_id
in(
<foreach
collection=
"thirdStationIds"
item=
"item"
separator=
","
>
(#{item})
</foreach>
)
GROUP BY all_statuses.status
ORDER BY all_statuses.status;
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/JpStationMapper.xml
View file @
e6900a0e
...
...
@@ -672,9 +672,11 @@
<select
id=
"queryAllPowerStation"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto"
>
select
name,
third_station_id
third_station_id,
regional_companies_code
from hygf_jp_station
<where>
hygf_jp_station.regional_companies_code is not null
<if
test=
"powerStationId!=null"
>
and hygf_jp_station.sequence_nbr =#{powerStationId}
</if>
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/tdengine/TdHygfJpInverterWarnMapper.xml
View file @
e6900a0e
...
...
@@ -165,13 +165,12 @@
`state`
FROM house_pv_data.td_hygf_jp_inverter_warn
<where>
<if
test=
"
thirdStationIds != null and thirdStationIds
.size > 0 "
>
third_station_id in
<foreach
collection=
"
thirdStationIds"
item=
"item"
open=
'('
close=
')'
separator=
",
"
>
#{item}
<if
test=
"
regionalCompaniesCode != null and regionalCompaniesCode
.size > 0 "
>
`state` is not null and
<foreach
collection=
"
regionalCompaniesCode"
item=
"item"
open=
"("
close=
")"
separator=
"or
"
>
regional_companies_code like
#{item}
</foreach>
</if>
</where>
</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 @
e6900a0e
...
...
@@ -842,28 +842,4 @@ public class JpStationController extends BaseController {
return
ResponseHelper
.
buildResponse
(
poserStatisticsData
);
}
//查询当前登录人权限区域公司统计数据
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前登录人权限区域公司统计数据"
,
notes
=
"查询当前登录人权限区域公司统计数据"
)
@GetMapping
(
value
=
"/getRegionStatistics"
)
// @UserLimits
public
ResponseModel
<
Page
<
PowerStationStatistics
>>
getRegionStatistics
(
@RequestParam
(
defaultValue
=
"1"
)
Integer
current
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
size
,
@RequestParam
(
required
=
false
)
String
regionName
)
{
Page
<
PowerStationStatistics
>
poserStatisticsData
=
jpStationServiceImpl
.
getRegionStatistics
(
current
,
size
,
regionName
);
return
ResponseHelper
.
buildResponse
(
poserStatisticsData
);
}
//查询经销商统计数据(根据区域公司orgCode)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询经销商统计数据"
,
notes
=
"查询经销商统计数据"
)
@GetMapping
(
value
=
"/getDealerStatistics"
)
// @UserLimits
public
ResponseModel
<
Page
<
PowerStationStatistics
>>
getDealerStatistics
(
@RequestParam
(
defaultValue
=
"1"
)
Integer
current
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
size
,
String
regionCompanyOrgCode
,
@RequestParam
(
required
=
false
)
String
dealerName
)
{
Page
<
PowerStationStatistics
>
poserStatisticsData
=
jpStationServiceImpl
.
getDealerStatistics
(
current
,
size
,
regionCompanyOrgCode
,
dealerName
);
return
ResponseHelper
.
buildResponse
(
poserStatisticsData
);
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/TdHygfJpInverterWarnController.java
View file @
e6900a0e
...
...
@@ -330,4 +330,17 @@ public class TdHygfJpInverterWarnController extends BaseController {
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"户用光伏统计数据查询"
,
notes
=
"户用光伏统计数据查询"
)
@GetMapping
(
value
=
"/queryStateNumber"
)
@UserLimits
public
ResponseModel
<
Map
<
String
,
Object
>>
queryStateNumber
(
@RequestParam
(
required
=
false
)
String
regionalCompaniesCode
,
@RequestParam
(
required
=
false
)
String
amosCompanyCode
,
@RequestParam
(
required
=
false
)
String
powerStationId
)
{
Map
<
String
,
Object
>
result
=
tdHygfJpInverterWarnServiceImpl
.
queryStateNumber
(
regionalCompaniesCode
,
amosCompanyCode
,
powerStationId
);
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/TdHygfJpInverterWarnServiceImpl.java
View file @
e6900a0e
...
...
@@ -10,10 +10,10 @@ import com.github.pagehelper.PageInfo;
import
com.yeejoin.amos.boot.module.hygf.api.dto.HYGFMaintenanceTicketsDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.JpStation
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.HYGFMaintenanceTicketsMapper
;
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.service.ITdHygfJpInverterWarnService
;
import
com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.util.TimeUtil
;
...
...
@@ -44,7 +44,10 @@ public class TdHygfJpInverterWarnServiceImpl
HYGFMaintenanceTicketsMapper
hygfMaintenanceTicketsMapper
;
@Autowired
TdHygfJpInverterWarnMapper
tdHygfJpInverterWarnMapper
;
@Autowired
JpInverterMapper
jpInverterMapper
;
@Autowired
JpCollectorMapper
jpCollectorMapper
;
/**
* 分页查询
*/
...
...
@@ -196,10 +199,10 @@ public class TdHygfJpInverterWarnServiceImpl
if
(!
CollectionUtils
.
isEmpty
(
jpStationDtos
))
{
// 获取thirdStationId集合
List
<
String
>
thirdStationIds
=
jpStationDtos
.
stream
().
map
(
JpStation
->
JpStation
.
getThirdStationId
()).
collect
(
Collectors
.
toLis
t
());
Set
<
String
>
regionalCompaniesCodes
=
jpStationDtos
.
stream
().
map
(
JpStation
->
JpStation
.
getRegionalCompaniesCode
()).
collect
(
Collectors
.
toSe
t
());
List
<
TdHygfJpInverterWarnDto
>
tdHygfJpInverterWarnDtos
=
tdHygfJpInverterWarnMapper
.
queryAlarmNumber
(
thirdStationId
s
);
List
<
TdHygfJpInverterWarnDto
>
tdHygfJpInverterWarnDtos
=
tdHygfJpInverterWarnMapper
.
queryAlarmNumber
(
regionalCompaniesCode
s
);
ArrayList
<
String
>
yclArray
=
new
ArrayList
<>();
...
...
@@ -225,4 +228,65 @@ public class TdHygfJpInverterWarnServiceImpl
return
result
;
}
public
Map
<
String
,
Object
>
queryStateNumber
(
String
regionalCompaniesCode
,
String
amosCompanyCode
,
String
powerStationId
)
{
// 查询所有场站
List
<
JpStationDto
>
jpStationDtos
=
jpStationServiceImpl
.
queryAllPowerStation
(
regionalCompaniesCode
,
amosCompanyCode
,
powerStationId
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
if
(!
CollectionUtils
.
isEmpty
(
jpStationDtos
))
{
// 获取thirdStationId集合
List
<
String
>
thirdStationIds
=
jpStationDtos
.
stream
().
map
(
JpStation
->
JpStation
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
//在线
List
<
Integer
>
online
=
new
ArrayList
<>();
//报警
List
<
Integer
>
warn
=
new
ArrayList
<>();
//离线
List
<
Integer
>
offline
=
new
ArrayList
<>();
//逆变器
List
<
Map
<
String
,
Object
>>
map
=
jpInverterMapper
.
selectInverterState
(
thirdStationIds
);
map
.
forEach
(
e
->{
if
(
e
.
get
(
"status"
).
equals
(
"在线"
)){
online
.
add
(
Integer
.
valueOf
(
e
.
get
(
"count"
).
toString
()));
}
else
if
(
e
.
get
(
"status"
).
equals
(
"报警"
)){
warn
.
add
(
Integer
.
valueOf
(
e
.
get
(
"count"
).
toString
()));
}
else
{
offline
.
add
(
Integer
.
valueOf
(
e
.
get
(
"count"
).
toString
()));
}
});
//采集器
List
<
Map
<
String
,
Object
>>
maps
=
jpCollectorMapper
.
selectInverterState
(
thirdStationIds
);
maps
.
forEach
(
e
->{
if
(
e
.
get
(
"status"
).
equals
(
"在线"
)){
online
.
add
(
Integer
.
valueOf
(
e
.
get
(
"count"
).
toString
()));
}
else
if
(
e
.
get
(
"status"
).
equals
(
"报警"
)){
warn
.
add
(
Integer
.
valueOf
(
e
.
get
(
"count"
).
toString
()));
}
else
{
offline
.
add
(
Integer
.
valueOf
(
e
.
get
(
"count"
).
toString
()));
}
});
//目前系统无气象仪及电表
List
<
Integer
>
kong
=
new
ArrayList
<>(
Arrays
.
asList
(
0
,
0
));
online
.
addAll
(
kong
);
warn
.
addAll
(
kong
);
offline
.
addAll
(
kong
);
Map
<
String
,
Object
>
resultNumMap
=
new
HashMap
<>();
resultNumMap
.
put
(
"online"
,
online
);
resultNumMap
.
put
(
"warn"
,
warn
);
resultNumMap
.
put
(
"offline"
,
offline
);
result
.
put
(
"xData"
,
Arrays
.
asList
(
"在线"
,
"报警"
,
"离线"
));
result
.
put
(
"yData"
,
resultNumMap
);
}
return
result
;
}
}
\ 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