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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
23 deletions
+38
-23
HYGFMaintenanceTicketsDto.java
...s/boot/module/hygf/api/dto/HYGFMaintenanceTicketsDto.java
+1
-1
TdHygfJpInverterWarnMapper.java
...e/hygf/api/tdenginemapper/TdHygfJpInverterWarnMapper.java
+15
-6
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 {
...
@@ -49,7 +49,7 @@ public class HYGFMaintenanceTicketsDto extends BaseDto {
* 告警开始时间
* 告警开始时间
*/
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@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;
...
@@ -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.JpStation
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -17,13 +19,20 @@ import java.util.Map;
...
@@ -17,13 +19,20 @@ import java.util.Map;
*/
*/
public
interface
TdHygfJpInverterWarnMapper
extends
BaseMapper
<
TdHygfJpInverterWarn
>
{
public
interface
TdHygfJpInverterWarnMapper
extends
BaseMapper
<
TdHygfJpInverterWarn
>
{
List
<
Map
<
String
,
Object
>>
getCountTdHygfJpInverterWarn
(
@Param
(
"dto"
)
List
<
JpStation
>
dto
);
List
<
Map
<
String
,
Object
>>
getCountTdHygfJpInverterWarn
(
@Param
(
"dto"
)
List
<
JpStation
>
dto
);
List
<
TdHygfJpInverterWarnDto
>
list
(
@Param
(
"param"
)
TdHygfJpInverterWarnDto
tdHygfJpInverterWarnDto
);
TdHygfJpInverterWarnDto
getByTime
(
@Param
(
"createdTime"
)
long
createdTime
);
List
<
TdHygfJpInverterWarnDto
>
list
(
@Param
(
"param"
)
TdHygfJpInverterWarnDto
tdHygfJpInverterWarnDto
);
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
);
@Select
(
" SELECT * from house_pv_data. td_hygf_jp_inverter_warn limit 0,10"
)
List
<
TdHygfJpInverterWarnDto
>
listAll
();
int
selectWarnListTotal
(
String
state
,
String
level
,
String
minvalue
,
String
maxValue
,
String
snCode
,
List
<
String
>
stationId
,
String
startTime
,
String
endTime
,
String
content
);
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;
...
@@ -22,6 +22,8 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.util.HashMap
;
import
java.util.Map
;
@Component
@Component
@Slf4j
@Slf4j
...
@@ -57,23 +59,26 @@ public class MaintenanceResultHandlerMessage extends EmqxListener {
...
@@ -57,23 +59,26 @@ public class MaintenanceResultHandlerMessage extends EmqxListener {
@Async
(
"async"
)
@Async
(
"async"
)
public
void
JxiopUpdateMaintenance
(
JSONObject
jsonObject
)
{
public
void
JxiopUpdateMaintenance
(
JSONObject
jsonObject
)
{
if
(
jsonObject
.
containsKey
(
"rawData"
))
{
if
(
jsonObject
.
containsKey
(
"rawData"
))
{
JSONObject
rawData
=
jsonObject
.
getJSONObject
(
"rawData"
);
JSONObject
rawData
=
jsonObject
.
getJSONObject
(
"rawData"
);
JSONObject
bizInfo
=
rawData
.
getJSONObject
(
"bizInfo"
);
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
();
HYGFMaintenanceTickets
hygfMaintenanceTickets
=
new
HYGFMaintenanceTickets
();
String
warningObjectName
=
""
;
String
stationid
=
specialMap
.
get
(
"stationId"
)
==
null
?
null
:
specialMap
.
get
(
"stationId"
).
toString
();
String
warningObjectCode
=
""
;
//station_id@inverter_sn@maintenance_id@warn_id
Long
warningId
=
Long
.
valueOf
(
specialMap
.
get
(
"warningId"
).
toString
());
String
[]
codes
=
warningObjectCode
.
split
(
"@"
);
String
sncode
=
specialMap
.
get
(
"inverterSncode"
).
toString
();
JpStation
jpStation
=
jpStationMapper
.
selectOne
(
new
QueryWrapper
<
JpStation
>().
eq
(
"station_id"
,
codes
[
0
]));
String
mantainancePersonId
=
specialMap
.
get
(
"maintenancePersonId"
).
toString
();
TdHygfJpInverterWarn
tdHygfJpInverterWarn
=
tdHygfJpInverterWarnMapper
.
selectOne
(
new
QueryWrapper
<
TdHygfJpInverterWarn
>()
JpStation
jpStation
=
jpStationMapper
.
selectOne
(
new
QueryWrapper
<
JpStation
>().
eq
(
"third_station_id"
,
stationid
));
.
eq
(
"thrid_station_id"
,
codes
[
0
])
TdHygfJpInverterWarn
tdHygfJpInverterWarn
=
tdHygfJpInverterWarnMapper
.
getInverTerWarnByparams
(
warningId
,
sncode
,
stationid
);
.
eq
(
"sn_code"
,
codes
[
1
])
.
eq
(
"created_time"
,
codes
[
3
])
);
hygfMaintenanceTickets
.
setHandlerStatus
(
"未处理"
);
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
))
{
if
(
ObjectUtil
.
isNotEmpty
(
maintenance
))
{
hygfMaintenanceTickets
.
setMaintenancePersonId
(
codes
[
2
]
);
hygfMaintenanceTickets
.
setMaintenancePersonId
(
mantainancePersonId
);
hygfMaintenanceTickets
.
setMaintenancePersonName
(
maintenance
.
getName
());
hygfMaintenanceTickets
.
setMaintenancePersonName
(
maintenance
.
getName
());
hygfMaintenanceTickets
.
setMaintenancePersonPhone
(
maintenance
.
getTelephone
());
hygfMaintenanceTickets
.
setMaintenancePersonPhone
(
maintenance
.
getTelephone
());
}
}
...
@@ -97,7 +102,7 @@ public class MaintenanceResultHandlerMessage extends EmqxListener {
...
@@ -97,7 +102,7 @@ public class MaintenanceResultHandlerMessage extends EmqxListener {
}
}
if
(
ObjectUtil
.
isNotEmpty
(
tdHygfJpInverterWarn
))
{
if
(
ObjectUtil
.
isNotEmpty
(
tdHygfJpInverterWarn
))
{
//snCode
//snCode
hygfMaintenanceTickets
.
setInverterSn
(
codes
[
1
]
);
hygfMaintenanceTickets
.
setInverterSn
(
sncode
);
//告警等级
//告警等级
hygfMaintenanceTickets
.
setWarningLevel
(
tdHygfJpInverterWarn
.
getLevel
());
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
...
@@ -52,6 +52,7 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
specialMap
.
put
(
"stationId"
,
hygfMaintenanceTicketsDto
.
getStationId
());
specialMap
.
put
(
"stationId"
,
hygfMaintenanceTicketsDto
.
getStationId
());
//电站名称
//电站名称
specialMap
.
put
(
"stationName"
,
hygfMaintenanceTicketsDto
.
getStationName
());
specialMap
.
put
(
"stationName"
,
hygfMaintenanceTicketsDto
.
getStationName
());
specialMap
.
put
(
"inverterSncode"
,
hygfMaintenanceTicketsDto
.
getInverterSn
());
//告警id
//告警id
specialMap
.
put
(
"warningId"
,
hygfMaintenanceTicketsDto
.
getWarningId
());
specialMap
.
put
(
"warningId"
,
hygfMaintenanceTicketsDto
.
getWarningId
());
if
(
ObjectUtil
.
isNotEmpty
(
hygfMaintenanceTicketsDto
.
getWarningId
())){
if
(
ObjectUtil
.
isNotEmpty
(
hygfMaintenanceTicketsDto
.
getWarningId
())){
...
@@ -64,7 +65,7 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
...
@@ -64,7 +65,7 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
//告警开始时间
//告警开始时间
specialMap
.
put
(
"warningStartTime"
,
hygfMaintenanceTicketsDto
.
getWarningStartTime
());
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
());
specialMap
.
put
(
"stationContact"
,
hygfMaintenanceTicketsDto
.
getStationContact
());
//电站电话
//电站电话
...
@@ -129,7 +130,7 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
...
@@ -129,7 +130,7 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
// String traceId2 = idxBizPvWarningRecord.getSubarray()+"@"+idxBizPvWarningRecord.getHealthLevel()+"@"+idxBizPvWarningRecord.getWarningPeriod();
// String traceId2 = idxBizPvWarningRecord.getSubarray()+"@"+idxBizPvWarningRecord.getHealthLevel()+"@"+idxBizPvWarningRecord.getWarningPeriod();
// bizMessage.setTraceId2(traceId2);
// bizMessage.setTraceId2(traceId2);
try
{
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
)
{
}
catch
(
Exception
exception
)
{
exception
.
printStackTrace
();
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
...
@@ -86,7 +86,7 @@ public class TdHygfJpInverterWarnServiceImpl
* 列表查询 示例
* 列表查询 示例
*/
*/
public
List
<
TdHygfJpInverterWarnDto
>
queryForTdHygfJpInverterWarnList
()
{
public
List
<
TdHygfJpInverterWarnDto
>
queryForTdHygfJpInverterWarnList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
getBaseMapper
().
listAll
(
);
}
}
public
TdHygfJpInverterWarnDto
queryByCreatedTime
(
long
createdTime
)
{
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