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
3d54697d
Commit
3d54697d
authored
Apr 30, 2024
by
朱晨阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加告警统计接口
parent
e92867f6
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
129 additions
and
21 deletions
+129
-21
JpStationMapper.java
...oin/amos/boot/module/hygf/api/mapper/JpStationMapper.java
+2
-0
TdHygfJpInverterWarnMapper.java
...e/hygf/api/tdenginemapper/TdHygfJpInverterWarnMapper.java
+9
-4
JpStationMapper.xml
...f-api/src/main/resources/mapper/mysql/JpStationMapper.xml
+23
-0
TdHygfJpInverterWarnMapper.xml
.../resources/mapper/tdengine/TdHygfJpInverterWarnMapper.xml
+16
-0
TdHygfJpInverterWarnController.java
...e/hygf/biz/controller/TdHygfJpInverterWarnController.java
+16
-3
JpStationServiceImpl.java
...ot/module/hygf/biz/service/impl/JpStationServiceImpl.java
+6
-0
TdHygfJpInverterWarnServiceImpl.java
...ygf/biz/service/impl/TdHygfJpInverterWarnServiceImpl.java
+57
-14
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/JpStationMapper.java
View file @
3d54697d
...
...
@@ -78,4 +78,6 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List
<
PowerStationStatistics
>
getDealerPage
(
String
regionalCompaniesCode
,
String
dealerName
);
@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
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/tdenginemapper/TdHygfJpInverterWarnMapper.java
View file @
3d54697d
...
...
@@ -31,11 +31,16 @@ public interface TdHygfJpInverterWarnMapper extends BaseMapper<TdHygfJpInverterW
TdHygfJpInverterWarnDto
getByTime
(
@Param
(
"createdTime"
)
long
createdTime
);
@UserEmpower
(
field
={
"regional_companies_code"
},
dealerField
={
"amos_company_code"
,
"regional_companies_code"
}
,
fieldConditions
={
"eq"
,
"in"
}
,
relationship
=
"and"
)
List
<
TdHygfJpInverterWarnDto
>
selectWarnList
(
String
state
,
String
level
,
String
minvalue
,
String
maxValue
,
String
snCode
,
List
<
String
>
stationId
,
String
startTime
,
String
endTime
,
String
content
,
Integer
current
,
Integer
size
,
String
handlerStatus
,
String
stationName
);
@UserEmpower
(
field
={
"regional_companies_code"
},
dealerField
={
"amos_company_code"
,
"regional_companies_code"
}
,
fieldConditions
={
"eq"
,
"in"
}
,
relationship
=
"and"
)
int
selectWarnListTotal
(
String
state
,
String
level
,
String
minvalue
,
String
maxValue
,
String
snCode
,
List
<
String
>
stationId
,
String
startTime
,
String
endTime
,
String
content
,
String
handlerStatus
,
String
stationName
);
@UserEmpower
(
field
=
{
"regional_companies_code"
},
dealerField
=
{
"amos_company_code"
,
"regional_companies_code"
},
fieldConditions
=
{
"eq"
,
"in"
},
relationship
=
"and"
)
List
<
TdHygfJpInverterWarnDto
>
selectWarnList
(
String
state
,
String
level
,
String
minvalue
,
String
maxValue
,
String
snCode
,
List
<
String
>
stationId
,
String
startTime
,
String
endTime
,
String
content
,
Integer
current
,
Integer
size
,
String
handlerStatus
,
String
stationName
);
@UserEmpower
(
field
=
{
"regional_companies_code"
},
dealerField
=
{
"amos_company_code"
,
"regional_companies_code"
},
fieldConditions
=
{
"eq"
,
"in"
},
relationship
=
"and"
)
int
selectWarnListTotal
(
String
state
,
String
level
,
String
minvalue
,
String
maxValue
,
String
snCode
,
List
<
String
>
stationId
,
String
startTime
,
String
endTime
,
String
content
,
String
handlerStatus
,
String
stationName
);
@Select
(
"SELECT * from td_hygf_jp_inverter_warn WHERE (third_station_id = #{thirdStationId} AND sn_code = #{sncode} AND created_time = #{createdTime})"
)
TdHygfJpInverterWarn
getInverTerWarnByparams
(
@Param
(
"createdTime"
)
long
createdTime
,
@Param
(
"sncode"
)
String
snCode
,
@Param
(
"thirdStationId"
)
String
thirdStationId
);
// @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
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/JpStationMapper.xml
View file @
3d54697d
...
...
@@ -658,5 +658,28 @@
</select>
<!-- 查询所有场站-->
<select
id=
"queryAllPowerStation"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto"
>
select
name,
third_station_id
from hygf_jp_station
<where>
<if
test=
"powerStationId!=null"
>
and hygf_jp_station.sequence_nbr =#{powerStationId}
</if>
<if
test=
"regionalCompaniesCode!=null"
>
and hygf_jp_station.regional_companies_code =#{regionalCompaniesCode}
</if>
<if
test=
"amosCompanyCode!=null"
>
and hygf_jp_station.amos_company_code =#{amosCompanyCode}
</if>
</where>
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/tdengine/TdHygfJpInverterWarnMapper.xml
View file @
3d54697d
...
...
@@ -158,4 +158,20 @@
</where>
</select>
<select
id=
"queryAlarmNumber"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto"
>
SELECT
`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}
</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/TdHygfJpInverterWarnController.java
View file @
3d54697d
...
...
@@ -286,8 +286,7 @@ public class TdHygfJpInverterWarnController extends BaseController {
}
List
<
TdHygfJpInverterWarnDto
>
maps
=
tdHygfJpInverterWarnServiceImpl
.
selectWarnList
(
state
,
level
,
minvalue
,
maxValue
,
snCode
,
stationId
,
startTime
,
endTime
,
content
,
current
,
size
,
handlerStatus
,
stationName
);
List
<
TdHygfJpInverterWarnDto
>
maps
=
tdHygfJpInverterWarnServiceImpl
.
selectWarnList
(
state
,
level
,
minvalue
,
maxValue
,
snCode
,
stationId
,
startTime
,
endTime
,
content
,
current
,
size
,
handlerStatus
,
stationName
);
for
(
TdHygfJpInverterWarnDto
map
:
maps
)
{
// if (nameMaps.containsKey(map.getThirdStationId())) {
// map.setStationName(nameMaps.get(map.getThirdStationId()));
...
...
@@ -296,7 +295,7 @@ public class TdHygfJpInverterWarnController extends BaseController {
map
.
setTimeLongFormat
(
te
);
}
result
.
setTotal
(
tdHygfJpInverterWarnServiceImpl
.
selectWarnListTotal
(
state
,
level
,
minvalue
,
maxValue
,
snCode
,
stationId
,
startTime
,
endTime
,
content
,
handlerStatus
,
stationName
));
result
.
setTotal
(
tdHygfJpInverterWarnServiceImpl
.
selectWarnListTotal
(
state
,
level
,
minvalue
,
maxValue
,
snCode
,
stationId
,
startTime
,
endTime
,
content
,
handlerStatus
,
stationName
));
List
<
Long
>
waringIds
=
maps
.
stream
().
map
(
tdHygfJpInverterWarnDto
->
tdHygfJpInverterWarnDto
.
getCreatedTime
()).
collect
(
Collectors
.
toList
());
if
(
waringIds
.
size
()
==
0
)
{
waringIds
=
Arrays
.
asList
(
0L
);
...
...
@@ -317,4 +316,18 @@ public class TdHygfJpInverterWarnController extends BaseController {
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"户用光伏逆变器报警表统计数据查询"
,
notes
=
"户用光伏逆变器报警表统计数据查询"
)
@GetMapping
(
value
=
"/queryAlarmNumber"
)
@UserLimits
public
ResponseModel
<
Map
<
String
,
Object
>>
queryAlarmNumber
(
@RequestParam
(
required
=
false
)
String
regionalCompaniesCode
,
@RequestParam
(
required
=
false
)
String
amosCompanyCode
,
@RequestParam
(
required
=
false
)
String
powerStationId
)
{
Map
<
String
,
Object
>
result
=
tdHygfJpInverterWarnServiceImpl
.
queryAlarmNumber
(
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/JpStationServiceImpl.java
View file @
3d54697d
...
...
@@ -964,4 +964,9 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
}
public
List
<
JpStationDto
>
queryAllPowerStation
(
String
regionalCompaniesCode
,
String
amosCompanyCode
,
String
powerStationId
)
{
List
<
JpStationDto
>
powerStationList
=
jpStationMapper
.
queryAllPowerStation
(
regionalCompaniesCode
,
amosCompanyCode
,
powerStationId
);
return
powerStationList
;
}
}
\ No newline at end of file
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 @
3d54697d
...
...
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.github.pagehelper.PageHelper
;
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
;
...
...
@@ -19,6 +20,7 @@ import com.yeejoin.amos.boot.module.hygf.api.util.TimeUtil;
import
jdk.nashorn.internal.ir.annotations.Ignore
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.*
;
...
...
@@ -42,6 +44,7 @@ public class TdHygfJpInverterWarnServiceImpl
HYGFMaintenanceTicketsMapper
hygfMaintenanceTicketsMapper
;
@Autowired
TdHygfJpInverterWarnMapper
tdHygfJpInverterWarnMapper
;
/**
* 分页查询
*/
...
...
@@ -96,18 +99,18 @@ public class TdHygfJpInverterWarnServiceImpl
}
List
<
HYGFMaintenanceTickets
>
hygfMaintenanceTicketsList
=
hygfMaintenanceTicketsMapper
.
selectList
(
new
QueryWrapper
<
HYGFMaintenanceTickets
>().
in
(
"warning_id"
,
waringIds
));
if
(
hygfMaintenanceTicketsList
.
size
()
>
0
)
{
list
.
forEach
(
i
->
{
List
<
HYGFMaintenanceTickets
>
ticketsList
=
hygfMaintenanceTicketsList
.
stream
().
filter
(
hygfmaintenanceTickets
->
i
.
getCreatedTime
().
equals
(
hygfmaintenanceTickets
.
getWarningId
())).
collect
(
Collectors
.
toList
());
if
(
ObjectUtil
.
isNotEmpty
(
ticketsList
))
{
Set
<
String
>
status
=
ticketsList
.
stream
().
map
(
HYGFMaintenanceTickets:
:
getHandlerStatus
).
collect
(
Collectors
.
toSet
());
if
(
status
.
contains
(
"未处理"
))
{
i
.
setTicketStatus
(
"处理中"
);
}
if
(
status
.
contains
(
"已处理"
)
&&
status
.
size
()
==
1
)
{
i
.
setTicketStatus
(
"已处理"
);
}
}
});
list
.
forEach
(
i
->
{
List
<
HYGFMaintenanceTickets
>
ticketsList
=
hygfMaintenanceTicketsList
.
stream
().
filter
(
hygfmaintenanceTickets
->
i
.
getCreatedTime
().
equals
(
hygfmaintenanceTickets
.
getWarningId
())).
collect
(
Collectors
.
toList
());
if
(
ObjectUtil
.
isNotEmpty
(
ticketsList
))
{
Set
<
String
>
status
=
ticketsList
.
stream
().
map
(
HYGFMaintenanceTickets:
:
getHandlerStatus
).
collect
(
Collectors
.
toSet
());
if
(
status
.
contains
(
"未处理"
))
{
i
.
setTicketStatus
(
"处理中"
);
}
if
(
status
.
contains
(
"已处理"
)
&&
status
.
size
()
==
1
)
{
i
.
setTicketStatus
(
"已处理"
);
}
}
});
}
PageInfo
<
TdHygfJpInverterWarnDto
>
page
=
new
PageInfo
(
list
);
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
TdHygfJpInverterWarnDto
>
pagenew
=
new
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
TdHygfJpInverterWarnDto
>();
...
...
@@ -166,7 +169,7 @@ public class TdHygfJpInverterWarnServiceImpl
return
tdHygfJpInverterWarnDto
;
}
public
List
<
TdHygfJpInverterWarnDto
>
selectWarnList
(
String
state
,
String
level
,
String
minvalue
,
String
maxValue
,
String
snCode
,
List
<
String
>
stationId
,
String
startTime
,
String
endTime
,
String
content
,
Integer
current
,
Integer
size
,
String
handlerStatus
,
String
stationName
)
{
public
List
<
TdHygfJpInverterWarnDto
>
selectWarnList
(
String
state
,
String
level
,
String
minvalue
,
String
maxValue
,
String
snCode
,
List
<
String
>
stationId
,
String
startTime
,
String
endTime
,
String
content
,
Integer
current
,
Integer
size
,
String
handlerStatus
,
String
stationName
)
{
List
<
TdHygfJpInverterWarnDto
>
list
=
tdHygfJpInverterWarnMapper
.
selectWarnList
(
state
,
level
,
minvalue
,
maxValue
,
snCode
,
stationId
,
startTime
,
endTime
,
content
,
(
current
-
1
)
*
size
,
size
,
handlerStatus
,
stationName
);
list
.
forEach
(
i
->
{
JpStation
jpStation
=
jpStationServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
JpStation
>()
...
...
@@ -180,7 +183,46 @@ public class TdHygfJpInverterWarnServiceImpl
return
list
;
}
public
int
selectWarnListTotal
(
String
state
,
String
level
,
String
minvalue
,
String
maxValue
,
String
snCode
,
List
<
String
>
stationId
,
String
startTime
,
String
endTime
,
String
content
,
String
handlerStatus
,
String
stationName
)
{
public
int
selectWarnListTotal
(
String
state
,
String
level
,
String
minvalue
,
String
maxValue
,
String
snCode
,
List
<
String
>
stationId
,
String
startTime
,
String
endTime
,
String
content
,
String
handlerStatus
,
String
stationName
)
{
return
tdHygfJpInverterWarnMapper
.
selectWarnListTotal
(
state
,
level
,
minvalue
,
maxValue
,
snCode
,
stationId
,
startTime
,
endTime
,
content
,
handlerStatus
,
stationName
);
}
public
Map
<
String
,
Object
>
queryAlarmNumber
(
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
<
TdHygfJpInverterWarnDto
>
tdHygfJpInverterWarnDtos
=
tdHygfJpInverterWarnMapper
.
queryAlarmNumber
(
thirdStationIds
);
ArrayList
<
String
>
yclArray
=
new
ArrayList
<>();
ArrayList
<
String
>
wclArray
=
new
ArrayList
<>();
tdHygfJpInverterWarnDtos
.
stream
().
forEach
(
tdHygfJpInverterWarnDto
->
{
if
(
tdHygfJpInverterWarnDto
.
getState
().
equals
(
"已恢复"
)
||
tdHygfJpInverterWarnDto
.
getState
().
equals
(
"已处理"
))
{
yclArray
.
add
(
tdHygfJpInverterWarnDto
.
getState
());
}
else
{
wclArray
.
add
(
tdHygfJpInverterWarnDto
.
getState
());
}
});
result
.
put
(
"ycl"
,
yclArray
.
size
());
result
.
put
(
"wcl"
,
wclArray
.
size
());
}
else
{
result
.
put
(
"ycl"
,
0
);
result
.
put
(
"wcl"
,
0
);
}
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