Commit c783b2d3 authored by litengwei's avatar litengwei

Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6

parents fc72ef76 bc9bdd36
......@@ -3,7 +3,9 @@ package com.yeejoin.amos.boot.module.common.api.enums;
public enum DataSyncTopicEnum {
EQM_PATROL_CREATED("user", "emq.user.created"),
ORG_USR_DEL("userDel", "user/sync/orgUsrDel"),
ORG_USR("orgUsr", "user/sync/orgUsr");
ORG_USR("orgUsr", "user/sync/orgUsr"),
STATION_USER_UPDATE("sattionUserUpdate", "station/user/update"),
STATION_USER_DELETE("sattionUserDelete", "station/user/delete");
private String type;
private String topic;
......
......@@ -29,9 +29,6 @@ public class DataSyncServiceImpl implements IDataSyncService {
@Autowired
private OrgUsrMapper orgUsrMapper;
@Value("${emq.orgUsr.sync.switch}")
private Boolean orgUsrSyncSwitch;
@Override
public void OrgUsrSyncDtoDataSync(Long id) {
try {
......@@ -43,9 +40,10 @@ public class DataSyncServiceImpl implements IDataSyncService {
for (OrgUsrSyncDto x : list) {
String message = buildSyncMessage(DataSyncTopicEnum.ORG_USR.getTopic(), x);
emqKeeper.getMqttClient().publish(DataSyncTopicEnum.EQM_PATROL_CREATED.getTopic(), message.getBytes(), RuleConfig.DEFAULT_QOS, false);
if (orgUsrSyncSwitch) {
emqKeeper.getMqttClient().publish(DataSyncTopicEnum.ORG_USR.getTopic(), JSONObject.toJSONString(x).getBytes(), RuleConfig.DEFAULT_QOS, false);
}
//站端人员信息同步
emqKeeper.getMqttClient().publish(DataSyncTopicEnum.STATION_USER_UPDATE.getTopic(), JSONObject.toJSONString(x).getBytes(), RuleConfig.DEFAULT_QOS, false);
}
}
}
......@@ -63,9 +61,10 @@ public class DataSyncServiceImpl implements IDataSyncService {
orgUsrSyncDto.setSequenceNbr(id);
String message = buildSyncMessage(DataSyncTopicEnum.ORG_USR_DEL.getTopic(), orgUsrSyncDto);
emqKeeper.getMqttClient().publish(DataSyncTopicEnum.EQM_PATROL_CREATED.getTopic(), message.getBytes(), RuleConfig.DEFAULT_QOS, false);
if (orgUsrSyncSwitch) {
emqKeeper.getMqttClient().publish(DataSyncTopicEnum.ORG_USR_DEL.getTopic(), JSONObject.toJSONString(orgUsrSyncDto).getBytes(), RuleConfig.DEFAULT_QOS, false);
}
//站端人员信息删除同步
emqKeeper.getMqttClient().publish(DataSyncTopicEnum.STATION_USER_DELETE.getTopic(), JSONObject.toJSONString(orgUsrSyncDto).getBytes(), RuleConfig.DEFAULT_QOS, false);
}
} catch (Exception e) {
log.error("站端与中心级人员数据【OrgUsrSyncDto】同步推送失败-----------" + e.getMessage());
......
......@@ -46,5 +46,3 @@ video.url=https://11.11.16.4:443/
ifc.url=http://11.11.16.17/IFCInterface
ifc.call-back.localIp=11.11.16.1
#人员消息数据同步开关
emq.orgUsr.sync.switch=true
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment