From e8f12a910740261f1db6eae27e08a17caf6dc998 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Wed, 13 Mar 2024 11:09:09 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E6=9C=88=E6=8A=A5=E7=BB=9F=E8=AE=A1=E5=AF=BC=E5=87=BA=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operational/defect/service/impl/OperPhenomenonServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java index 4032dff..bf8224d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java @@ -609,9 +609,6 @@ public class OperPhenomenonServiceImpl extends BaseServiceImpl res = new ArrayList<>(); if (CollectionUtil.isNotEmpty(operPhenomenonEntities)) { - CheckVoteChartVo all = getCheckVoteChartVo(operPhenomenonEntities); - all.setName("总计"); - res.add(all); Map> collect = Optional.ofNullable(operPhenomenonEntities).orElse(new ArrayList<>()).stream().collect(Collectors.groupingBy(OperPhenomenonEntity::getCreateDept)); for (Map.Entry> longListEntry : collect.entrySet()) { CheckVoteChartVo chartVo= getCheckVoteChartVo(longListEntry.getValue()); @@ -619,6 +616,9 @@ public class OperPhenomenonServiceImpl extends BaseServiceImpl Date: Wed, 13 Mar 2024 17:07:30 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E9=A1=B9=E6=9B=B4=E6=96=B0=E5=A4=B1=E8=B4=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safeproduct/service/impl/CarCheckRecordServiceImpl.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java index 12819bf..6c55284 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java @@ -162,11 +162,17 @@ public class CarCheckRecordServiceImpl extends ServiceImpl itemList = carCheckRecordDTO.getItemList(); - boolean updateItem = carCheckItemService.updateBatchById(itemList); - // 若更新检查项成功,则更新车检记录 - if (updateItem) { + itemList.forEach(x -> {x.setCarCheckRecordId(carCheckRecordDTO.getId()); + x.setId(null);}); + boolean b = carCheckItemService.saveBatch(itemList); + if (b) { + // 若更新检查项成功,则更新车检记录 CarCheckRecordEntity carCheckRecordEntity = new CarCheckRecordEntity(); BeanUtil.copyProperties(carCheckRecordDTO, carCheckRecordEntity); return this.updateById(carCheckRecordEntity); From 775d6ab71ab0a89e8db4e96477e47ab086316950 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Wed, 13 Mar 2024 18:37:32 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=8A=E6=96=AD?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=8E=BB=E9=99=A4=E6=95=85=E9=9A=9C=E5=BF=85?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java index 0e993d1..957d210 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java @@ -234,11 +234,12 @@ public class FdpTaskServiceImpl extends BaseServiceImpl Date: Thu, 14 Mar 2024 12:01:44 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=8D=AB=E7=94=9F=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E9=A1=B9-=E6=A3=80=E6=9F=A5=E4=BA=BA=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E5=A2=9E=E5=8A=A0=E5=88=B0100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java | 2 +- hzims-service/safeproduct/src/main/resources/db/2.0.0.sql.1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java index 933ecb9..7e294a8 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java @@ -39,7 +39,7 @@ public class HygieneRecordEntity extends BaseEntity { @ApiModelProperty("实际结束时间") private Date actualEndTime; - @Size(max = 20, message = "检查人字段长度不能超过20") + @Size(max = 100, message = "检查人字段长度不能超过20") @ApiModelProperty("检查人") private String checkUser; diff --git a/hzims-service/safeproduct/src/main/resources/db/2.0.0.sql.1 b/hzims-service/safeproduct/src/main/resources/db/2.0.0.sql.1 index 778d870..d54fb2a 100644 --- a/hzims-service/safeproduct/src/main/resources/db/2.0.0.sql.1 +++ b/hzims-service/safeproduct/src/main/resources/db/2.0.0.sql.1 @@ -222,7 +222,7 @@ CREATE TABLE `HZIMS_HYGIENE_RECORD` ( `ACTUAL_START_TIME` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际开始时间', `ACTUAL_END_TIME` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际结束时间', `CHECK_TIME` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '检查时间', - `CHECK_USER` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '检查人', + `CHECK_USER` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '检查人', `HYGIENE_ZONE_IDS` VARCHAR(1000) NOT NULL COMMENT '卫生自查区域ID', `CHECK_RESULT` MEDIUMTEXT NOT NULL COMMENT '检查结果', `COMPREHENSIVE_SCORE` VARCHAR(500) NOT NULL COMMENT '综合评分', From 713ccecfce20de7695749b6ef4f727bd7fe61917 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Thu, 14 Mar 2024 12:01:50 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=8D=AB=E7=94=9F=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E9=A1=B9-=E6=A3=80=E6=9F=A5=E4=BA=BA=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E5=A2=9E=E5=8A=A0=E5=88=B0100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java index 7e294a8..493f646 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java @@ -39,7 +39,7 @@ public class HygieneRecordEntity extends BaseEntity { @ApiModelProperty("实际结束时间") private Date actualEndTime; - @Size(max = 100, message = "检查人字段长度不能超过20") + @Size(max = 100, message = "检查人字段长度不能超过100") @ApiModelProperty("检查人") private String checkUser; From 9aab6c9bc995b26225614e07841776126ea2b49b Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 14 Mar 2024 13:59:11 +0800 Subject: [PATCH 6/6] =?UTF-8?q?#HZ3000=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/alarm/config/vo/SystemAlarmVo.java | 59 +++++++++++----------- .../monitor/service/impl/AlarmSaveServiceImpl.java | 18 +++++-- .../hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java | 9 ++-- .../java/com/hnac/hzims/alarm/mqtt/MqttConfig.java | 1 + .../alarm/source/service/SystemAlarmService.java | 1 + .../source/service/impl/FdpAlarmServiceImpl.java | 12 +---- .../service/impl/SystemAlarmServiceImpl.java | 37 ++++++-------- 7 files changed, 68 insertions(+), 69 deletions(-) diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/SystemAlarmVo.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/SystemAlarmVo.java index 833d0ef..ab422d0 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/SystemAlarmVo.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/SystemAlarmVo.java @@ -3,44 +3,45 @@ package com.hnac.hzims.alarm.config.vo; import io.swagger.annotations.ApiModel; import lombok.Data; +import java.io.Serializable; + /** * @author ysj */ @Data @ApiModel(value = "华自3000告警对象", description = "华自3000告警对象") -public class SystemAlarmVo { +public class SystemAlarmVo implements Serializable { private static final long serialVersionUID = 1L; - /** - * 告警时间 - */ - private String ts; - /** - * 告警ID,由平台生成,具有唯一性 - */ - private String id; - /** - * 告警内容 - */ - private String soeExplain; - /** - * 告警类型,对应数据字典 soe_alarm_type - */ - private Integer soeType; - private Integer soeStatus; - /** - * 告警动作,对应HZ3000的告警,如 {"分", "合"}, {"复归", "动作"} - */ - private Integer soeAlarmType; - /** - * 动作值 - */ - private String optionvals; - /** - * 站点id - */ + private Long ts; + private String station; + private String sid; + + private String id; + + private String realId; + + private Integer type; + + private String kind; + + private String level; + + private Integer state; + + private String stateLabel; + + private String context; + + private String opvalue; + + private String duration; + + private Boolean trace; + + private Integer traceCount; } \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java index a00ca41..90d5dc0 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java @@ -1,6 +1,7 @@ package com.hnac.hzims.alarm.monitor.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.hnac.hzims.alarm.config.service.AlarmConfigService; import com.hnac.hzims.alarm.config.entity.AlarmEntity; import com.hnac.hzims.alarm.monitor.service.AlarmSaveService; @@ -51,14 +52,23 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { // 步骤2.遍历保存告警数据 alarms.forEach(alarm->{ - // 步骤3.根据站点查询配置标识 + List stations = result.getData().stream().filter(o->o.getCode().equals(alarm.getStationId())).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(stations)){ + return; + } + // 步骤3.站点参数设置 + alarm.setCreateDept(stations.get(0).getCreateDept()); + alarm.setStationName(stations.get(0).getName()); + alarm.setTenantId(stations.get(0).getTenantId()); + alarm.setStatus(0); + // 步骤4.根据站点查询配置标识 AlarmHandleMarkVo mark = alarmConfigService.mark(alarm.getStationId(),alarm.getAlarmSource(),alarm.getAlarmType()); if(ObjectUtil.isEmpty(mark)){ log.error("alarm obtain mark is null : {}",alarm.getAlarmId()); return; } - // 步骤4.告警处理标识赋值 + // 步骤5.告警处理标识赋值 alarm.setIsRightTabulation(mark.getIsRightTabulation()); alarm.setIsBroadcast(mark.getIsBroadcast()); alarm.setIsMask(mark.getIsMask()); @@ -68,14 +78,14 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { alarm.setIsShortMessage(mark.getIsShortMessage()); alarm.setIsWxMessage(mark.getIsWxMessage()); - // 步骤5.保存当日告警数据 + // 步骤6.保存当日告警数据 boolean isSave = alarmService.save(alarm); if(!isSave){ log.error("alarm save fail : {}",alarm.getAlarmId()); return; } - // 步骤6.发生数据至redis告警队列 + // 步骤7.发生数据至redis告警队列 stringRedisTemplate.opsForList().rightPush("hzims:queue:alarm", JSON.toJSONString(alarm)); }); return true; diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java index 313583d..67c4895 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java @@ -6,9 +6,11 @@ import com.hnac.hzims.alarm.source.service.SystemAlarmService; import com.hnac.hzims.alarm.monitor.service.AlarmSaveService; import com.hnac.hzinfo.subscribe.SubscribeCallBack; import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Date; import java.util.List; import java.util.Map; @@ -26,10 +28,9 @@ public class HZ300MqttConsumer implements SubscribeCallBack { private AlarmSaveService alarmSaveService; @Override public void onMessage(Map data) { - System.out.println("监听到消息"+data.toString()); - String s = JSONObject.toJSONString(data); + log.error("HZ3000队列监听到消息 : {}",data); //消费代码 - List alarmEntities = systemAlarmService.receiveMessage(s); + List alarmEntities = systemAlarmService.receiveMessage(JSONObject.toJSONString(data)); //统一数据处理 try { alarmSaveService.save(alarmEntities); @@ -37,4 +38,4 @@ public class HZ300MqttConsumer implements SubscribeCallBack { log.error("HZ3000告警数据处理报错(HZ300Alarm):"+e); } } -} +} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/MqttConfig.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/MqttConfig.java index 01e2a01..9e8c483 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/MqttConfig.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/MqttConfig.java @@ -30,6 +30,7 @@ public class MqttConfig { HZ300MqttConsumer hz300MqttConsumer; @Autowired VideoMqttConsumer videoMqttConsumer; + @Value("${hzims.mqtt.url}") private String mqtt_fdp_url; @Value("${hzims.mqtt.group}") diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/SystemAlarmService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/SystemAlarmService.java index fa6264c..87f5782 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/SystemAlarmService.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/SystemAlarmService.java @@ -3,6 +3,7 @@ package com.hnac.hzims.alarm.source.service; import com.hnac.hzims.alarm.config.entity.AlarmEntity; import java.util.List; +import java.util.Map; /** * 告警处理接口 diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java index 2216534..930e4fa 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java @@ -74,10 +74,6 @@ public class FdpAlarmServiceImpl implements FdpAlarmService { return new ArrayList<>(); } AlarmEntity entity = getAlarmEntity(alarms); -// List res = alarms.stream().map(s -> { -// AlarmEntity entity = getAlarmEntity(s); -// return entity; -// }).collect(Collectors.toList()); return Collections.singletonList(entity); } @@ -87,6 +83,7 @@ public class FdpAlarmServiceImpl implements FdpAlarmService { entity.setRealId(item.getFaultId()); entity.setAlarmTime(item.getCreateTime()); entity.setAlarmContext(item.getFinfo()); + entity.setAlarmSource(EARLY_WARNING); entity.setAlarmType(EARLY); entity.setDeviceCode(item.getDeviceId()); entity.setDeviceName(item.getDeviceName()); @@ -95,13 +92,6 @@ public class FdpAlarmServiceImpl implements FdpAlarmService { entity.setStationId(item.getStation()); entity.setDiagReason(item.getDiagReason()); entity.setDiagSolution(item.getDiagSolution()); - entity.setAlarmSource(EARLY_WARNING); - entity.setTenantId("200000"); - R stationByCode = stationClient.getStationByCode(item.getStation()); - if (stationByCode.isSuccess()&& ObjectUtils.isNotEmpty(stationByCode.getData())){ - entity.setCreateDept(stationByCode.getData().getCreateDept()); - entity.setStationName(stationByCode.getData().getName()); - } return entity; } diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SystemAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SystemAlarmServiceImpl.java index a1f5c48..b8f14b2 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SystemAlarmServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SystemAlarmServiceImpl.java @@ -1,6 +1,7 @@ package com.hnac.hzims.alarm.source.service.impl; import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.hnac.hzims.alarm.config.constants.AlarmConstants; import com.hnac.hzims.alarm.config.entity.AlarmEntity; @@ -14,6 +15,7 @@ import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.feign.IStationClient; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.MapUtils; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.CollectionUtil; @@ -22,9 +24,7 @@ import org.springblade.system.feign.ISysClient; import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; @@ -73,33 +73,28 @@ public class SystemAlarmServiceImpl implements SystemAlarmService { @Override public List receiveMessage(String message) { // 对象转换 - List alarms = JSONObject.parseArray(message, SystemAlarmVo.class); - if (CollectionUtil.isEmpty(alarms)) { + SystemAlarmVo systemAlarm = JSONObject.parseObject(message, SystemAlarmVo.class); + log.error("HZ3000告警对象转换后:{}",systemAlarm); + if (ObjectUtils.isEmpty(systemAlarm)) { return new ArrayList<>(); } - List res = alarms.stream().map(s -> { - AlarmEntity entity = getAlarmEntity(s); - return entity; - }).collect(Collectors.toList()); - return res; + return Collections.singletonList(this.getAlarmEntity(systemAlarm)); } private AlarmEntity getAlarmEntity(SystemAlarmVo item) { AlarmEntity entity = new AlarmEntity(); entity.setAlarmId(item.getId()); - entity.setAlarmTime(DateUtil.parse(item.getTs(), "yyyy-MM-dd HH:mm:ss.s")); - entity.setAlarmContext(item.getSoeExplain()); - entity.setAlarmType(item.getSoeAlarmType()); - entity.setAlarmStatus(item.getSoeStatus()); - entity.setAlarmValue(item.getOptionvals()); + Date date = new Date(); + date.setTime(item.getTs()); + entity.setAlarmTime(DateUtil.parse(DateUtil.format(date,DateUtil.PATTERN_DATETIME),DateUtil.PATTERN_DATETIME)); + entity.setAlarmContext(item.getContext()); + entity.setAlarmType(item.getType()); + entity.setAlarmStatus(item.getState()); + entity.setAlarmValue(item.getOpvalue()); entity.setStationId(item.getStation()); + entity.setAlarmCount(item.getTraceCount()); + entity.setRealId(item.getRealId()); entity.setAlarmSource(AlarmConstants.HZ3000_ALARM); - entity.setTenantId("200000"); - R stationByCode = stationClient.getStationByCode(item.getStation()); - if (stationByCode.isSuccess() && ObjectUtils.isNotEmpty(stationByCode.getData())) { - entity.setCreateDept(stationByCode.getData().getCreateDept()); - entity.setStationName(stationByCode.getData().getName()); - } return entity; } }