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
c4a52869
Commit
c4a52869
authored
Aug 18, 2021
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.维保周期
parent
dbd1a819
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
15 deletions
+31
-15
CheckServiceImpl.java
...s/maintenance/business/service/impl/CheckServiceImpl.java
+15
-1
MqttGateway.java
...n/java/com/yeejoin/amos/maintenance/mqtt/MqttGateway.java
+14
-12
JobService.java
.../java/com/yeejoin/amos/maintenance/quartz/JobService.java
+2
-2
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/CheckServiceImpl.java
View file @
c4a52869
...
@@ -41,6 +41,7 @@ import com.yeejoin.amos.maintenance.core.util.DateUtil;
...
@@ -41,6 +41,7 @@ import com.yeejoin.amos.maintenance.core.util.DateUtil;
import
com.yeejoin.amos.maintenance.core.util.StringUtil
;
import
com.yeejoin.amos.maintenance.core.util.StringUtil
;
import
com.yeejoin.amos.maintenance.dao.entity.*
;
import
com.yeejoin.amos.maintenance.dao.entity.*
;
import
com.yeejoin.amos.maintenance.feign.RemoteSecurityService
;
import
com.yeejoin.amos.maintenance.feign.RemoteSecurityService
;
import
com.yeejoin.amos.maintenance.mqtt.MqttGateway
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.cxf.common.util.CollectionUtils
;
import
org.apache.cxf.common.util.CollectionUtils
;
import
org.assertj.core.util.Sets
;
import
org.assertj.core.util.Sets
;
...
@@ -101,9 +102,15 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -101,9 +102,15 @@ public class CheckServiceImpl implements ICheckService {
@Autowired
@Autowired
IPointDao
iPointDao
;
IPointDao
iPointDao
;
@Autowired
MqttGateway
mqttGateway
;
@Value
(
"${file.url}"
)
@Value
(
"${file.url}"
)
private
String
fileUrl
;
private
String
fileUrl
;
final
String
CHECK_UPDATE_TOPIC
=
"maintenance/date/update"
;
@Override
@Override
public
Page
<
CheckInfoVo
>
getCheckInfo
(
String
toke
,
String
product
,
String
appKey
,
CheckInfoPageParam
param
)
{
public
Page
<
CheckInfoVo
>
getCheckInfo
(
String
toke
,
String
product
,
String
appKey
,
CheckInfoPageParam
param
)
{
long
total
=
checkMapper
.
countCheckInfoData
(
param
);
long
total
=
checkMapper
.
countCheckInfoData
(
param
);
...
@@ -236,7 +243,14 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -236,7 +243,14 @@ public class CheckServiceImpl implements ICheckService {
}
}
planTaskDetailMapper
.
finishTaskDetail
(
Long
.
parseLong
(
detail
.
get
(
"planTaskDetailId"
).
toString
()),
recordParam
.
getPointId
(),
recordParam
.
getPlanTaskId
(),
mtUserSeq
);
planTaskDetailMapper
.
finishTaskDetail
(
Long
.
parseLong
(
detail
.
get
(
"planTaskDetailId"
).
toString
()),
recordParam
.
getPointId
(),
recordParam
.
getPlanTaskId
(),
mtUserSeq
);
//6.返回不合格记录
//6.消息广播最近维保日期
if
(
StringUtil
.
isNotEmpty
(
point
.
getOriginalId
())){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"facilityId"
,
point
.
getOriginalId
());
jsonObject
.
put
(
"checkTime"
,
check
.
getCheckTime
());
mqttGateway
.
publish
(
CHECK_UPDATE_TOPIC
,
jsonObject
.
toJSONString
());
}
//7.返回不合格记录
return
new
CheckDto
(
check
.
getId
(),
unqualifiedCheckItemList
);
return
new
CheckDto
(
check
.
getId
(),
unqualifiedCheckItemList
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
Exception
(
e
.
getMessage
());
throw
new
Exception
(
e
.
getMessage
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/mqtt/
WebMqttComponent
.java
→
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/mqtt/
MqttGateway
.java
View file @
c4a52869
package
com
.
yeejoin
.
amos
.
maintenance
.
mqtt
;
package
com
.
yeejoin
.
amos
.
maintenance
.
mqtt
;
import
lombok.extern.slf4j.Slf4j
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.eclipse.paho.client.mqttv3.MqttPersistenceException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
/**
* @author DELL
*/
@Component
@Component
public
class
WebMqttComponent
{
@Slf4j
@Autowired
public
class
MqttGateway
{
@Autowired
private
EmqKeeper
emqKeeper
;
private
EmqKeeper
emqKeeper
;
public
void
publish
(
String
topic
,
String
jsonStr
)
{
public
void
publish
(
String
topic
,
String
jsonStr
)
{
try
{
try
{
this
.
emqKeeper
.
getMqttClient
().
publish
(
topic
,
jsonStr
.
getBytes
(),
1
,
false
);
this
.
emqKeeper
.
getMqttClient
().
publish
(
topic
,
jsonStr
.
getBytes
(),
1
,
false
);
}
catch
(
MqttPersistenceException
e
)
{
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
log
.
error
(
"消息发送失败:{}、{}、{}"
,
e
.
getMessage
(),
topic
,
jsonStr
);
}
catch
(
MqttException
e
)
{
}
e
.
printStackTrace
();
}
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/quartz/JobService.java
View file @
c4a52869
...
@@ -14,7 +14,7 @@ import com.yeejoin.amos.maintenance.common.enums.*;
...
@@ -14,7 +14,7 @@ import com.yeejoin.amos.maintenance.common.enums.*;
import
com.yeejoin.amos.maintenance.core.async.AsyncTask
;
import
com.yeejoin.amos.maintenance.core.async.AsyncTask
;
import
com.yeejoin.amos.maintenance.dao.entity.*
;
import
com.yeejoin.amos.maintenance.dao.entity.*
;
import
com.yeejoin.amos.maintenance.feign.RemoteSecurityService
;
import
com.yeejoin.amos.maintenance.feign.RemoteSecurityService
;
import
com.yeejoin.amos.maintenance.mqtt.
WebMqttComponent
;
import
com.yeejoin.amos.maintenance.mqtt.
MqttGateway
;
import
org.quartz.Job
;
import
org.quartz.Job
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -76,7 +76,7 @@ public class JobService implements IJobService {
...
@@ -76,7 +76,7 @@ public class JobService implements IJobService {
@Value
(
"${amosRefresh.patrol.topic}"
)
@Value
(
"${amosRefresh.patrol.topic}"
)
private
String
patrolTopic
;
private
String
patrolTopic
;
@Autowired
@Autowired
private
WebMqttComponent
webMqttComponent
;
private
MqttGateway
webMqttComponent
;
@Override
@Override
@Transactional
@Transactional
...
...
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