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
0ba40fb7
Commit
0ba40fb7
authored
Mar 12, 2024
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工单推送
1.消息发送代码编写提交。 2.消息接收代码编写提交。
parent
6dc2be23
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
18 deletions
+33
-18
HYGFMaintenanceTicketsDto.java
...s/boot/module/hygf/api/dto/HYGFMaintenanceTicketsDto.java
+1
-1
TdHygfJpInverterWarnMapper.java
...e/hygf/api/tdenginemapper/TdHygfJpInverterWarnMapper.java
+10
-1
MaintenanceResultHandlerMessage.java
...module/hygf/biz/emqx/MaintenanceResultHandlerMessage.java
+18
-13
HYGFMaintenanceTicketsServiceImpl.java
...f/biz/service/impl/HYGFMaintenanceTicketsServiceImpl.java
+3
-2
TdHygfJpInverterWarnServiceImpl.java
...ygf/biz/service/impl/TdHygfJpInverterWarnServiceImpl.java
+1
-1
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/HYGFMaintenanceTicketsDto.java
View file @
0ba40fb7
...
...
@@ -49,7 +49,7 @@ public class HYGFMaintenanceTicketsDto extends BaseDto {
* 告警开始时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
DateTime
warningEndTime
;
private
String
warningEndTime
;
/**
* 告警时长
*/
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/tdenginemapper/TdHygfJpInverterWarnMapper.java
View file @
0ba40fb7
...
...
@@ -5,7 +5,9 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto;
import
com.yeejoin.amos.boot.module.hygf.api.entity.JpStation
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -19,11 +21,18 @@ public interface TdHygfJpInverterWarnMapper extends BaseMapper<TdHygfJpInverterW
List
<
Map
<
String
,
Object
>>
getCountTdHygfJpInverterWarn
(
@Param
(
"dto"
)
List
<
JpStation
>
dto
);
List
<
TdHygfJpInverterWarnDto
>
list
(
@Param
(
"param"
)
TdHygfJpInverterWarnDto
tdHygfJpInverterWarnDto
);
@Select
(
" SELECT * from house_pv_data. td_hygf_jp_inverter_warn limit 0,10"
)
List
<
TdHygfJpInverterWarnDto
>
listAll
();
TdHygfJpInverterWarnDto
getByTime
(
@Param
(
"createdTime"
)
long
createdTime
);
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
);
int
selectWarnListTotal
(
String
state
,
String
level
,
String
minvalue
,
String
maxValue
,
String
snCode
,
List
<
String
>
stationId
,
String
startTime
,
String
endTime
,
String
content
);
}
@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
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/emqx/MaintenanceResultHandlerMessage.java
View file @
0ba40fb7
...
...
@@ -22,6 +22,8 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
javax.annotation.PostConstruct
;
import
java.util.HashMap
;
import
java.util.Map
;
@Component
@Slf4j
...
...
@@ -57,23 +59,26 @@ public class MaintenanceResultHandlerMessage extends EmqxListener {
@Async
(
"async"
)
public
void
JxiopUpdateMaintenance
(
JSONObject
jsonObject
)
{
if
(
jsonObject
.
containsKey
(
"rawData"
))
{
if
(
jsonObject
.
containsKey
(
"rawData"
))
{
JSONObject
rawData
=
jsonObject
.
getJSONObject
(
"rawData"
);
JSONObject
bizInfo
=
rawData
.
getJSONObject
(
"bizInfo"
);
JSONArray
jsonArray
=
bizInfo
.
getJSONArray
(
"dynamicDetails"
);
Map
<
String
,
Object
>
specialMap
=
new
HashMap
<>();
if
(
jsonArray
.
size
()
>
0
)
{
jsonObject
=
(
JSONObject
)
jsonArray
.
get
(
0
);
specialMap
=
jsonObject
.
get
(
"specialMap"
)
==
null
?
null
:
jsonObject
.
getJSONObject
(
"specialMap"
).
toJavaObject
(
Map
.
class
);
}
HYGFMaintenanceTickets
hygfMaintenanceTickets
=
new
HYGFMaintenanceTickets
();
String
warningObjectName
=
""
;
String
warningObjectCode
=
""
;
//station_id@inverter_sn@maintenance_id@warn_id
String
[]
codes
=
warningObjectCode
.
split
(
"@"
);
JpStation
jpStation
=
jpStationMapper
.
selectOne
(
new
QueryWrapper
<
JpStation
>().
eq
(
"station_id"
,
codes
[
0
]));
TdHygfJpInverterWarn
tdHygfJpInverterWarn
=
tdHygfJpInverterWarnMapper
.
selectOne
(
new
QueryWrapper
<
TdHygfJpInverterWarn
>()
.
eq
(
"thrid_station_id"
,
codes
[
0
])
.
eq
(
"sn_code"
,
codes
[
1
])
.
eq
(
"created_time"
,
codes
[
3
])
);
String
stationid
=
specialMap
.
get
(
"stationId"
)
==
null
?
null
:
specialMap
.
get
(
"stationId"
).
toString
();
Long
warningId
=
Long
.
valueOf
(
specialMap
.
get
(
"warningId"
).
toString
());
String
sncode
=
specialMap
.
get
(
"inverterSncode"
).
toString
();
String
mantainancePersonId
=
specialMap
.
get
(
"maintenancePersonId"
).
toString
();
JpStation
jpStation
=
jpStationMapper
.
selectOne
(
new
QueryWrapper
<
JpStation
>().
eq
(
"third_station_id"
,
stationid
));
TdHygfJpInverterWarn
tdHygfJpInverterWarn
=
tdHygfJpInverterWarnMapper
.
getInverTerWarnByparams
(
warningId
,
sncode
,
stationid
);
hygfMaintenanceTickets
.
setHandlerStatus
(
"未处理"
);
Maintenance
maintenance
=
maintenanceMapper
.
select
ById
(
codes
[
2
]
);
Maintenance
maintenance
=
maintenanceMapper
.
select
One
(
new
QueryWrapper
<
Maintenance
>().
eq
(
"sequence_nbr"
,
mantainancePersonId
)
);
if
(
ObjectUtil
.
isNotEmpty
(
maintenance
))
{
hygfMaintenanceTickets
.
setMaintenancePersonId
(
codes
[
2
]
);
hygfMaintenanceTickets
.
setMaintenancePersonId
(
mantainancePersonId
);
hygfMaintenanceTickets
.
setMaintenancePersonName
(
maintenance
.
getName
());
hygfMaintenanceTickets
.
setMaintenancePersonPhone
(
maintenance
.
getTelephone
());
}
...
...
@@ -97,7 +102,7 @@ public class MaintenanceResultHandlerMessage extends EmqxListener {
}
if
(
ObjectUtil
.
isNotEmpty
(
tdHygfJpInverterWarn
))
{
//snCode
hygfMaintenanceTickets
.
setInverterSn
(
codes
[
1
]
);
hygfMaintenanceTickets
.
setInverterSn
(
sncode
);
//告警等级
hygfMaintenanceTickets
.
setWarningLevel
(
tdHygfJpInverterWarn
.
getLevel
());
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/HYGFMaintenanceTicketsServiceImpl.java
View file @
0ba40fb7
...
...
@@ -52,6 +52,7 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
specialMap
.
put
(
"stationId"
,
hygfMaintenanceTicketsDto
.
getStationId
());
//电站名称
specialMap
.
put
(
"stationName"
,
hygfMaintenanceTicketsDto
.
getStationName
());
specialMap
.
put
(
"inverterSncode"
,
hygfMaintenanceTicketsDto
.
getInverterSn
());
//告警id
specialMap
.
put
(
"warningId"
,
hygfMaintenanceTicketsDto
.
getWarningId
());
if
(
ObjectUtil
.
isNotEmpty
(
hygfMaintenanceTicketsDto
.
getWarningId
())){
...
...
@@ -64,7 +65,7 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
//告警开始时间
specialMap
.
put
(
"warningStartTime"
,
hygfMaintenanceTicketsDto
.
getWarningStartTime
());
}
specialMap
.
put
(
"maintenance
_person_i
d"
,
hygfMaintenanceTicketsDto
.
getMaintenancePersonId
());
specialMap
.
put
(
"maintenance
PersonI
d"
,
hygfMaintenanceTicketsDto
.
getMaintenancePersonId
());
//电站联系人
specialMap
.
put
(
"stationContact"
,
hygfMaintenanceTicketsDto
.
getStationContact
());
//电站电话
...
...
@@ -129,7 +130,7 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
// String traceId2 = idxBizPvWarningRecord.getSubarray()+"@"+idxBizPvWarningRecord.getHealthLevel()+"@"+idxBizPvWarningRecord.getWarningPeriod();
// bizMessage.setTraceId2(traceId2);
try
{
emqKeeper
.
getMqttClient
().
publish
(
WARNING_RESULT_MESSAGE
,
JSON
.
toJSONString
(
hygfMaintenanceTicketsDto
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
WARNING_RESULT_MESSAGE
,
JSON
.
toJSONString
(
messageMain
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
Exception
exception
)
{
exception
.
printStackTrace
();
}
...
...
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 @
0ba40fb7
...
...
@@ -86,7 +86,7 @@ public class TdHygfJpInverterWarnServiceImpl
* 列表查询 示例
*/
public
List
<
TdHygfJpInverterWarnDto
>
queryForTdHygfJpInverterWarnList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
getBaseMapper
().
listAll
(
);
}
public
TdHygfJpInverterWarnDto
queryByCreatedTime
(
long
createdTime
)
{
...
...
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