Commit af6c2e91 authored by maoying's avatar maoying

Merge branch 'dev_bitmap' of http://39.98.45.134:8090/moa/amos-boot-biz into dev_bitmap

parents 7cfab757 96384660
...@@ -83,4 +83,7 @@ public class EquipmentAlarmReportDay extends BaseEntity { ...@@ -83,4 +83,7 @@ public class EquipmentAlarmReportDay extends BaseEntity {
@ApiModelProperty(value = "指标最新值") @ApiModelProperty(value = "指标最新值")
private String value; private String value;
@ApiModelProperty(value = "是否告警:0-否;1-是")
private Integer isAlarm;
} }
...@@ -268,9 +268,8 @@ public class EquipmentStateUtil { ...@@ -268,9 +268,8 @@ public class EquipmentStateUtil {
public static String judgeEquipState(EquipmentSpecificIndex index) { public static String judgeEquipState(EquipmentSpecificIndex index) {
if (TrueOrFalseEnum.real.value.toUpperCase().equals(String.valueOf(index.getValue()).toUpperCase())) { if (TrueOrFalseEnum.real.value.toUpperCase().equals(String.valueOf(index.getValue()).toUpperCase())) {
return StringUtils.isNotEmpty(index.getEmergencyLevelColor()) ? index.getEmergencyLevelColor() : "#49AA19"; return index.getEmergencyLevelColor();
} else {
return "#49AA19";
} }
return "";
} }
} }
...@@ -185,7 +185,8 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -185,7 +185,8 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
LocalDateTime createDate = (LocalDateTime) x.get("createDate"); LocalDateTime createDate = (LocalDateTime) x.get("createDate");
x.put("createDate", Date.from(createDate.atZone(ZoneId.systemDefault()).toInstant())); x.put("createDate", Date.from(createDate.atZone(ZoneId.systemDefault()).toInstant()));
x.put("handleType", ConfirmAlamEnum.getTypeByCode(String.valueOf(x.get("handleType")))); x.put("handleType", ConfirmAlamEnum.getTypeByCode(String.valueOf(x.get("handleType"))));
x.put("fireEquipmentName", x.get("fireEquipmentName")); // 冗余统一跑马灯显示字段取值
x.put("equipmentSpecificIndexName", x.get("fireEquipmentSpecificIndexName"));
} }
} }
return resultPage; return resultPage;
......
...@@ -542,7 +542,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -542,7 +542,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
SpeIndexVo latestVo = statusList.get(0); SpeIndexVo latestVo = statusList.get(0);
BeanUtils.copyProperties(latestVo, spe); BeanUtils.copyProperties(latestVo, spe);
spe.setName("当前状态"); spe.setName("当前状态");
spe.setValue(getStatus(statusList)); Map<String, String> map = getStatus(statusList);
spe.setValue(map.get("runStatus"));
spe.setColor(map.get("color"));
statusList.clear(); statusList.clear();
statusList.add(spe); statusList.add(spe);
statusList.addAll(newList); statusList.addAll(newList);
...@@ -555,12 +557,28 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -555,12 +557,28 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
* @param statusList * @param statusList
* @return * @return
*/ */
private String getStatus(List<SpeIndexVo> statusList) { private Map<String, String> getStatus(List<SpeIndexVo> statusList) {
Map<String, String> map = new HashMap<>();
SpeIndexVo indexVo = statusList.get(0); SpeIndexVo indexVo = statusList.get(0);
int i = 0;
for (SpeIndexVo x : statusList) {
if (StringUtil.isNotEmpty(x.getIndexValue())) {
i = i + 1;
}
}
if (0 == i) {
map.put("runStatus", "无");
map.put("color", "");
return map;
}
if (StringUtil.isNotEmpty(indexVo.getIndexValue()) && TrueOrFalseEnum.real.value.toUpperCase().equals(indexVo.getIndexValue().toUpperCase())) { if (StringUtil.isNotEmpty(indexVo.getIndexValue()) && TrueOrFalseEnum.real.value.toUpperCase().equals(indexVo.getIndexValue().toUpperCase())) {
return indexVo.getIndexName(); map.put("runStatus", indexVo.getIndexName());
map.put("color", indexVo.getColor());
return map;
} }
return "运行"; map.put("runStatus", "运行");
map.put("color", "");
return map;
} }
@Override @Override
......
...@@ -404,17 +404,19 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -404,17 +404,19 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
wrapper.eq(EquipmentAlarmReportDay::getReportDate, sdf.format(x.getReportDate())).eq(EquipmentAlarmReportDay::getIndexId, x.getIndexId()) wrapper.eq(EquipmentAlarmReportDay::getReportDate, sdf.format(x.getReportDate())).eq(EquipmentAlarmReportDay::getIndexId, x.getIndexId())
.eq(EquipmentAlarmReportDay::getEquipmentSpecificId, x.getEquipmentSpecificId()); .eq(EquipmentAlarmReportDay::getEquipmentSpecificId, x.getEquipmentSpecificId());
List<EquipmentAlarmReportDay> reportDayList = iEquipmentAlarmReportDayService.list(wrapper); List<EquipmentAlarmReportDay> reportDayList = iEquipmentAlarmReportDayService.list(wrapper);
if (reportDayList.isEmpty()) { if (1 == x.getIsAlarm()) {
x.setReportDate(new Date()); if (reportDayList.isEmpty()) {
x.setFrequency(1); x.setReportDate(new Date());
iEquipmentAlarmReportDayService.save(x); x.setFrequency(1);
} else { iEquipmentAlarmReportDayService.save(x);
EquipmentAlarmReportDay reportDay = reportDayList.get(0); } else {
reportDay.setLastReportDate(new Date()); EquipmentAlarmReportDay reportDay = reportDayList.get(0);
reportDay.setValue(x.getValue()); reportDay.setLastReportDate(new Date());
reportDay.setFrequency(reportDay.getFrequency() + 1); reportDay.setValue(x.getValue());
reportDay.setIndexTrueNum(reportDay.getIndexTrueNum() == null ? x.getIndexTrueNum() : reportDay.getIndexTrueNum() + x.getIndexTrueNum()); reportDay.setFrequency(reportDay.getFrequency() + 1);
iEquipmentAlarmReportDayService.updateById(reportDay); reportDay.setIndexTrueNum(reportDay.getIndexTrueNum() == null ? x.getIndexTrueNum() : reportDay.getIndexTrueNum() + x.getIndexTrueNum());
iEquipmentAlarmReportDayService.updateById(reportDay);
}
} }
}); });
mqttSendGateway.sendToMqtt(TopicEnum.EQXXTJ.getTopic(), ""); mqttSendGateway.sendToMqtt(TopicEnum.EQXXTJ.getTopic(), "");
...@@ -774,7 +776,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -774,7 +776,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
if (TrueOrFalseEnum.real.value.toUpperCase().equals(index.getValue().toUpperCase())) { if (TrueOrFalseEnum.real.value.toUpperCase().equals(index.getValue().toUpperCase())) {
topicObject.put("color", equipmentStateVo.getColor()); topicObject.put("color", equipmentStateVo.getColor());
} else { } else {
topicObject.put("color", "#49AA19"); topicObject.put("color", "");
} }
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(equipmentStateVo)); Map<String, Object> map = JSON.parseObject(JSON.toJSONString(equipmentStateVo));
map.put(canvasTopic, topicObject); map.put(canvasTopic, topicObject);
...@@ -893,6 +895,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -893,6 +895,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentAlarmReportDay.setIndexName(equipmentSpecificIndex.getEquipmentSpecificIndexName()); equipmentAlarmReportDay.setIndexName(equipmentSpecificIndex.getEquipmentSpecificIndexName());
equipmentAlarmReportDay.setIndexType(equipmentSpecificIndex.getNameKey()); equipmentAlarmReportDay.setIndexType(equipmentSpecificIndex.getNameKey());
equipmentAlarmReportDay.setValue(equipmentSpecificIndex.getValue()); equipmentAlarmReportDay.setValue(equipmentSpecificIndex.getValue());
equipmentAlarmReportDay.setIsAlarm(equipmentSpecificIndex.getIsAlarm());
return equipmentAlarmReportDay; return equipmentAlarmReportDay;
} }
...@@ -1375,7 +1378,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1375,7 +1378,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
/** /**
* 发送数据至换流站 * 发送数据至换流站
* @param equipmentSpecificIndex * @param
*/ */
private void sendEquipSpecIndexToAutosysTopic(EquipmentSpecificIndex equipmentSpeIndex){ private void sendEquipSpecIndexToAutosysTopic(EquipmentSpecificIndex equipmentSpeIndex){
......
...@@ -336,7 +336,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -336,7 +336,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
} }
list.add(alertHandlerInfoDto); list.add(alertHandlerInfoDto);
} }
map.put("agReturnVisit",dispatchPaper.getFeedbackTime()); map.put("agReturnVisit",dispatchPaper.getFeedbackFinishTime()); // 修复BUG 3439 by kongfm
} else { } else {
for(String s:str) { for(String s:str) {
AlertHandlerInfoDto alertHandlerInfoDto = new AlertHandlerInfoDto(); AlertHandlerInfoDto alertHandlerInfoDto = new AlertHandlerInfoDto();
......
...@@ -2227,5 +2227,59 @@ ...@@ -2227,5 +2227,59 @@
ALTER TABLE `wl_equipment_alarm_report_day` ADD COLUMN `is_alarm` bit(1) DEFAULT b'0' COMMENT '是否告警:0-否;1-是'; ALTER TABLE `wl_equipment_alarm_report_day` ADD COLUMN `is_alarm` bit(1) DEFAULT b'0' COMMENT '是否告警:0-否;1-是';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="keyong" id="1645149948-7">
<preConditions onFail="MARK_RAN">
<tableExists tableName="wl_signal_classify"/>
</preConditions>
<comment>插入基础数据 wl_signal_classify</comment>
<sql>
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220218, 'BreakDown', '故障', '#D87A16', b'1', '2', '严重', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220219, 'Shield', '屏蔽', '#177DDC', b'1', '6', '一般', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220220, 'RunState', '运行状态', '#49AA19', b'0', '4', '正常', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220221, 'Alarm', '告警', '#D32029', b'1', '1', '紧急', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220222, 'HearBeat', '心跳', '#49AA19', b'0', '4', '正常', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220223, 'Action', '动作', '#E8D639', b'1', '3', '轻微', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220224, 'Reset', '复位', '#49AA19', b'0', '4', '正常', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220225, 'FireAlarm', '火警', '#D32029', b'1', '1', '紧急', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220226, 'Abnormal', '异常', '#D87A16', b'1', '2', '严重', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220227, 'FeedBack', '反馈', '#D87A16', b'1', '2', '严重', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220228, 'PowerLoss', '失电', '#D87A16', b'1', '2', '严重', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220229, 'StartStop', '启停', '#D87A16', b'1', '2', '严重', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220230, 'Activation', '激活', '#D87A16', b'1', '2', '严重', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220231, 'Status', '状态信号', '#49AA19', b'0', '4', '正常', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220232, 'Normal', '正常信号', '#49AA19', b'0', '4', '正常', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220233, 'Indicate', '指示信号', '#E8D639', b'1', '3', '轻微', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220234, 'Tripping', '跳闸', '#D87A16', b'1', '2', '严重', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220235, 'OilLeak', '漏油', '#D32029', b'1', '1', '紧急', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220236, 'Recovery', '恢复', '#49AA19', b'1', '4', '正常', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220237, 'Quarantine', '隔离', '#E8D639', b'1', '3', '轻微', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220238, 'Release', '释放', '#E8D639', b'1', '3', '轻微', now());
INSERT INTO `wl_signal_classify`(`id`, `type_code`, `type_name`, `emergency_level_color`, `is_alarm`, `emergency_level`, `emergency_level_describe`, `create_date`) VALUES (20220239, 'Control', '控制', '#E8D639', b'1', '3', '轻微', now());
UPDATE wl_car_property cp
SET cp.emergency_level_color = ( SELECT emergency_level_color FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND cp.equipment_index_id = wei.id ),
cp.is_alarm = ( SELECT is_alarm FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND cp.equipment_index_id = wei.id ),
cp.emergency_level = ( SELECT emergency_level FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND cp.equipment_index_id = wei.id ),
cp.emergency_level_describe = ( SELECT emergency_level_describe FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND cp.equipment_index_id = wei.id );
UPDATE wl_equipment_specific_index esi
SET esi.emergency_level_color = ( SELECT emergency_level_color FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND esi.equipment_index_id = wei.id ),
esi.is_alarm = ( SELECT is_alarm FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND esi.equipment_index_id = wei.id ),
esi.emergency_level = ( SELECT emergency_level FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND esi.equipment_index_id = wei.id ),
esi.emergency_level_describe = ( SELECT emergency_level_describe FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND esi.equipment_index_id = wei.id );
UPDATE wl_equipment_specific_alarm esa
SET esa.emergency_level_color = ( SELECT emergency_level_color FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND esa.equipment_index_id = wei.id ),
esa.emergency_level = ( SELECT emergency_level FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND esa.equipment_index_id = wei.id ),
esa.emergency_level_describe = ( SELECT emergency_level_describe FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND esa.equipment_index_id = wei.id );
UPDATE wl_equipment_specific_alarm_log esal
SET esal.emergency_level_color = ( SELECT emergency_level_color FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND esal.equipment_index_id = wei.id ),
esal.emergency_level = ( SELECT emergency_level FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND esal.equipment_index_id = wei.id ),
esal.emergency_level_describe = ( SELECT emergency_level_describe FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND esal.equipment_index_id = wei.id );
UPDATE wl_equipment_alarm_report_day eard
SET eard.is_alarm = ( SELECT is_alarm FROM wl_signal_classify wsc, wl_equipment_index wei WHERE upper(wsc.type_code) = upper(wei.type_code) AND eard.index_id = wei.id );
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -199,16 +199,17 @@ ...@@ -199,16 +199,17 @@
AS fireEquipmentPointValue, AS fireEquipmentPointValue,
wlesal.type AS type, wlesal.type AS type,
wlesal.create_date AS createDate, wlesal.create_date AS createDate,
wlesal.location AS warehouseStructureName, CONCAT_WS(' ', wles.position,wled.area) AS warehouseStructureName, /*告警列表拼接详细地址*/
(select (select
group_concat(fet.`name`) group_concat(fet.`name`)
from f_equipment_fire_equipment as fefe from f_equipment_fire_equipment as fefe
left join f_equipment as fet on fet.id = fefe.equipment_id left join f_equipment as fet on fet.id = fefe.equipment_id
where fefe.fire_equipment_id = wlesal.equipment_specific_id where fefe.fire_equipment_id = wlesal.equipment_specific_id
) as equipmentName ) as equipmentName,
wlesal.equipment_specific_name as equipmentSpecificName,
wles.position
FROM wl_equipment_specific_alarm_log wlesal FROM wl_equipment_specific_alarm_log wlesal
LEFT JOIN wl_equipment_specific wles ON wlesal.equipment_specific_id = wles.id LEFT JOIN wl_equipment_specific wles ON wlesal.equipment_specific_id = wles.id
left join wl_stock_detail as wsd on wsd.equipment_specific_id = wlesal.equipment_specific_id
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment we ON wled.equipment_id = we.id LEFT JOIN wl_equipment we ON wled.equipment_id = we.id
) d ) d
......
...@@ -325,7 +325,7 @@ ...@@ -325,7 +325,7 @@
wl_signal_classify sc wl_signal_classify sc
WHERE WHERE
es.realtime_iot_index_id = ei.id es.realtime_iot_index_id = ei.id
AND upper(sc.type_code) = ei.type_code AND upper(ei.type_code) = upper(sc.type_code)
AND find_in_set( AND find_in_set(
es.id, es.id,
( (
......
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