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
88a83e94
Commit
88a83e94
authored
Nov 08, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:站端到中心级同步修改
parent
8c045a59
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
4 deletions
+96
-4
PlanTaskSyncBo.java
...a/com/yeejoin/amos/patrol/business/bo/PlanTaskSyncBo.java
+82
-0
PatrolDataSyncServiceImpl.java
...trol/business/service/impl/PatrolDataSyncServiceImpl.java
+14
-4
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/bo/PlanTaskSyncBo.java
0 → 100644
View file @
88a83e94
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
bo
;
import
lombok.Data
;
/**
* The persistent class for the p_plan_task database table.
*/
@Data
public
class
PlanTaskSyncBo
extends
BasicEntityBo
{
/**
* 批次号(该字段暂时无效,取值为表id)
*/
private
long
batchNo
;
/**
* 开始时间
*/
private
String
beginTime
;
/**
* 巡检日期
*/
private
String
checkDate
;
/**
* 结束时间
*/
private
String
endTime
;
/**
* 已完成数量
*/
private
int
finishNum
;
/**
* 完成状态:0-尚未开始;1-正在进行;2-已经结束;3-超时漏检;4-已完成
*/
private
int
finishStatus
;
/**
* 公司Id
*/
private
String
orgCode
;
/**
* 计划编号
*/
private
long
planId
;
/**
* 计划巡检点数
*/
private
int
pointNum
;
/**
* 路线编号
*/
private
long
routeId
;
/**
* 状态:0-有效;1-无效
*/
private
int
status
;
/**
* 可执行人,一个或多个,多个用,隔开
*/
private
String
userId
;
/**
* 是否按排序0-否;1-是
*/
private
String
inOrder
;
/**
* 用户部门
*/
private
String
userDept
;
/**
* 用户姓名
*/
private
String
userName
;
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PatrolDataSyncServiceImpl.java
View file @
88a83e94
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.patrol.business.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.yeejoin.amos.patrol.business.bo.CheckInputSyncBo
;
import
com.yeejoin.amos.patrol.business.bo.PlanTaskSyncBo
;
import
com.yeejoin.amos.patrol.business.dao.repository.IPlanTaskDao
;
import
com.yeejoin.amos.patrol.business.dao.repository.IPlanTaskDetailDao
;
import
com.yeejoin.amos.patrol.business.service.intfc.IPatrolDataSyncService
;
...
...
@@ -11,6 +12,7 @@ import com.yeejoin.amos.patrol.dao.entity.*;
import
com.yeejoin.amos.patrol.mqtt.WebMqttComponent
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
...
...
@@ -150,9 +152,10 @@ public class PatrolDataSyncServiceImpl implements IPatrolDataSyncService {
public
void
planTaskDataSync
(
PlanTask
planTask
)
{
try
{
if
(
planTask
!=
null
)
{
String
message
=
buildSyncMessage
(
PatrolDataSyncTopicEnum
.
PLAN_TASK
.
getTopic
(),
planTask
);
PlanTaskSyncBo
planTaskSyncBo
=
buildPlanTaskBo
(
planTask
);
String
message
=
buildSyncMessage
(
PatrolDataSyncTopicEnum
.
PLAN_TASK
.
getTopic
(),
planTaskSyncBo
);
webMqttComponent
.
publish
(
PatrolDataSyncTopicEnum
.
EQM_PATROL_CREATED
.
getTopic
(),
message
);
webMqttComponent
.
publish
(
PatrolDataSyncTopicEnum
.
PLAN_TASK
.
getTopic
(),
JSON
.
toJSONString
(
planTask
,
SerializerFeature
.
WriteMapNullValue
));
webMqttComponent
.
publish
(
PatrolDataSyncTopicEnum
.
PLAN_TASK
.
getTopic
(),
JSON
.
toJSONString
(
planTask
SyncBo
,
SerializerFeature
.
WriteMapNullValue
));
}
}
catch
(
Exception
e
)
{
log
.
error
(
"站端与中心级巡检数据【planTask】同步推送失败-----------"
+
e
.
getMessage
());
...
...
@@ -164,9 +167,10 @@ public class PatrolDataSyncServiceImpl implements IPatrolDataSyncService {
try
{
if
(
CollectionUtils
.
isNotEmpty
(
planTaskList
))
{
planTaskList
.
forEach
(
x
->
{
String
message
=
buildSyncMessage
(
PatrolDataSyncTopicEnum
.
PLAN_TASK
.
getTopic
(),
x
);
PlanTaskSyncBo
planTaskSyncBo
=
buildPlanTaskBo
(
x
);
String
message
=
buildSyncMessage
(
PatrolDataSyncTopicEnum
.
PLAN_TASK
.
getTopic
(),
planTaskSyncBo
);
webMqttComponent
.
publish
(
PatrolDataSyncTopicEnum
.
EQM_PATROL_CREATED
.
getTopic
(),
message
);
webMqttComponent
.
publish
(
PatrolDataSyncTopicEnum
.
PLAN_TASK
.
getTopic
(),
JSON
.
toJSONString
(
x
,
SerializerFeature
.
WriteMapNullValue
));
webMqttComponent
.
publish
(
PatrolDataSyncTopicEnum
.
PLAN_TASK
.
getTopic
(),
JSON
.
toJSONString
(
planTaskSyncBo
,
SerializerFeature
.
WriteMapNullValue
));
});
}
}
catch
(
Exception
e
)
{
...
...
@@ -180,4 +184,10 @@ public class PatrolDataSyncServiceImpl implements IPatrolDataSyncService {
map
.
put
(
"data"
,
object
);
return
JSON
.
toJSONString
(
map
,
SerializerFeature
.
WriteMapNullValue
);
}
public
PlanTaskSyncBo
buildPlanTaskBo
(
PlanTask
planTask
)
{
PlanTaskSyncBo
taskSyncBo
=
new
PlanTaskSyncBo
();
BeanUtils
.
copyProperties
(
planTask
,
taskSyncBo
);
return
taskSyncBo
;
}
}
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