This commit is contained in:
2023-12-04 11:19:57 +08:00
parent 9988efc501
commit 6cd9d5d26d
3 changed files with 12 additions and 3 deletions

View File

@@ -36,6 +36,11 @@ public interface ZlConstant {
*/
String WAVE_PARAM_RCDKEEPTIME = "Wave_Param_RcdKeepTime";
/**
* 暂态持续时间
*/
String EVT_PARAM_TM = "Evt_Param_Tm";
}

View File

@@ -134,6 +134,9 @@ public class EventServiceImpl implements IEventService {
}
csEvent.setLocation(param.getData().toString());
} else {
if (Objects.equals(param.getName(),ZlConstant.EVT_PARAM_TM)){
csEvent.setPersistTime(Double.parseDouble(param.getData().toString()));
}
fields.put(param.getName(),param.getData());
}
//fixme 这边前置传递的应该是UTC时间,但是前置说是传递的北京时间,讨论了一下没太理解。这边暂时先这样处理,influx入库处理成北京时间,减去8小时。

View File

@@ -87,6 +87,7 @@ public class SendEventUtils {
public void sendUser(Integer eventType,String type,String devId, String eventName, LocalDateTime eventTime, String id) {
int code;
List<User> users = new ArrayList<>();
List<String> devCodeList;
List<CsEventSendMsg> csEventSendMsgList = new ArrayList<>();
NoticeUserDto noticeUserDto = new NoticeUserDto();
@@ -116,7 +117,7 @@ public class SendEventUtils {
code = 0;
//暂态事件
users = getEventUser(devId,0);
devCodeList = users.stream().map(User::getDevCode).collect(Collectors.toList());
devCodeList = users.stream().map(User::getDevCode).distinct().collect(Collectors.toList());
noticeUserDto.setPushClientId(devCodeList);
noticeUserDto.setTitle("暂态事件");
//记录需要通知的用户和事件关系
@@ -133,7 +134,7 @@ public class SendEventUtils {
code = 1;
//稳态事件
users = getEventUser(devId,1);
devCodeList = users.stream().map(User::getDevCode).collect(Collectors.toList());
devCodeList = users.stream().map(User::getDevCode).distinct().collect(Collectors.toList());
noticeUserDto.setPushClientId(devCodeList);
noticeUserDto.setTitle("稳态事件");
//记录需要通知的用户和事件关系
@@ -182,7 +183,7 @@ public class SendEventUtils {
case "3":
//Ⅱ、Ⅲ级告警推送相关用户及业务管理员
users = getEventUser(devId,3);
devCodeList = users.stream().map(User::getDevCode).collect(Collectors.toList());
devCodeList = users.stream().map(User::getDevCode).distinct().collect(Collectors.toList());
noticeUserDto.setPushClientId(devCodeList);
//记录需要通知的用户和事件关系
List<String> list4 = users.stream().map(User::getId).collect(Collectors.toList());