Commit f8a802c3 authored by KeYong's avatar KeYong

修改bug

parent 85ce1d63
......@@ -44,6 +44,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.io.Resource;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
......@@ -125,6 +126,7 @@ public class ContingencyAction implements CustomerAction {
@Autowired
private IPlanStepService planStepService;
@Lazy
@Autowired
private IEmergencyTaskService emergencyTaskService;
......
......@@ -12,6 +12,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......
......@@ -234,10 +234,10 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
//更新模型状态
PlanDetail planDetail = PlanDetailOp.get();
planDetail.setStatus(vo.getStatus());
PlanDetail detail = planDetailDao.save(planDetail);
PlanDetail detail = planDetailDao.saveAndFlush(planDetail);
//更新预案执行记录表的批次号
operationRecord.setBatchNo(batchNo);
PlanOperationRecord record = planOperationRecordDao.save(operationRecord);
PlanOperationRecord record = planOperationRecordDao.saveAndFlush(operationRecord);
// 保存预案基本信息
instanceInfo.setId(batchNo);
instanceInfo.setName(detail.getPlanName());
......
......@@ -191,20 +191,20 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen
String fireEquipId = String.valueOf(map.get("fireEquipId"));
List<Long> fireEquipments = new ArrayList<>();
// 若是停运本极对端换流器,则需查出本极对应的电力设备列表,暂用电力设备名称过滤出本极电力设备,注意此处的电力设备按照标准有两极(极I,极II)
// if (stepIndex == index) {
// Optional<Equipment> equipment = iEquipmentDao.findById(Long.valueOf(fireEquipId));
// if (equipment.get() != null) {
// String fireEquipNamePrefix = equipment.get().getName().substring(0, 2);
// List<String> fireEquipIdList = equipmentSpecificMapper.getFireEquipIdsByNamePrefix(fireEquipNamePrefix);
// String[] strings = fireEquipIdList.toArray(new String[fireEquipIdList.size()]);
// // 获取消防设备id列表
// fireEquipments = equipmentFireEquipmentService.findFireEquipmentIdsByEquipmentId(strings);
// }
// } else {
if (stepIndex == index) {
Optional<Equipment> equipment = iEquipmentDao.findById(Long.valueOf(fireEquipId));
if (equipment.get() != null) {
String fireEquipNamePrefix = equipment.get().getName().substring(0, 2);
List<String> fireEquipIdList = equipmentSpecificMapper.getFireEquipIdsByNamePrefix(fireEquipNamePrefix);
String[] strings = fireEquipIdList.toArray(new String[fireEquipIdList.size()]);
// 获取消防设备id列表
fireEquipments = equipmentFireEquipmentService.findFireEquipmentIdsByEquipmentId(strings);
}
} else {
String[] fireEquipIds = new String[]{fireEquipId};
// 获取消防设备id列表
fireEquipments = equipmentFireEquipmentService.findFireEquipmentIdsByEquipmentId(fireEquipIds);
// }
}
PlanStepJsonVO vo = result.stream().filter(x -> x.getIndex() == index).collect(Collectors.toList()).get(0);
List<ConditionVO> list = vo.getCondition();
......@@ -232,11 +232,11 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen
planMessageDao.save(message);
}
}
// if (pumpStepIndex == index) {
// return 0 < resultSize;
// } else {
if (pumpStepIndex == index) {
return 0 < resultSize;
} else {
return (0 < resultSize && num == resultSize);
// }
}
} else {
return false;
}
......
......@@ -557,7 +557,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
ContingencyOriginalData contingencyOriginalData = new ContingencyOriginalData();
BeanUtils.copyProperties(contingencyRo, contingencyOriginalData);
contingencyOriginalData.setFireEquipmentPosition(contingencyRo.getPosition());
iContingencyOriginalDataDao.save(contingencyOriginalData);
iContingencyOriginalDataDao.saveAndFlush(contingencyOriginalData);
log.info("开始调用规则 参数 contingencyRo{},reservePlan{},equipmentNames" + contingencyRo.toString() + "," + equipment.getReservePlan() + "," + ArrayUtils.toArray(equipment.getName()));
Object result = ruleTrigger.publish(contingencyRo, equipment.getReservePlan(), ArrayUtils.toArray(equipment.getName()));
......
......@@ -4,9 +4,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sun.media.jfxmedia.logging.Logger;
import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.fas.business.action.model.ContingencyRo;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.constants.FasConstant;
......@@ -20,7 +17,6 @@ import com.yeejoin.amos.fas.business.service.intfc.IEmergencyTaskService;
import com.yeejoin.amos.fas.business.service.intfc.IPlanStepService;
import com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService;
import com.yeejoin.amos.fas.business.service.model.ToipResponse;
import com.yeejoin.amos.fas.business.util.DateUtils;
import com.yeejoin.amos.fas.business.util.JSONUtil;
import com.yeejoin.amos.fas.business.util.StringUtil;
import com.yeejoin.amos.fas.business.vo.*;
......@@ -38,14 +34,13 @@ import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
......@@ -127,6 +122,7 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Autowired
JcsFeign jcsFeign;
@Lazy
@Autowired
private IEmergencyTaskService emergencyTaskService;
......
......@@ -954,4 +954,17 @@
ALTER TABLE `contingency_plan_instance` MODIFY COLUMN `category` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '一级分类' AFTER `record_type`;
</sql>
</changeSet>
<changeSet author="keyong" id="1682647357-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="c_emergency_relation" columnName="id" />
</not>
</preConditions>
<comment>c_emergency_relation</comment>
<sql>
ALTER TABLE `c_emergency_relation` MODIFY COLUMN `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
[
{
"stepCode": "0",
"stepName": "检查确认火情",
"stepName": "确认火情",
"stepStatus": "0",
"buttonCode": "FIRE_CONFIRM",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_A",
"index": 0,
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "1",
"stepName": "检查相应阀组是否停用、交流进线开关是否已跳开",
"stepCode": "15",
"stepName": "全站广播通报火情,通知驻站消防队",
"stepStatus": "0",
"buttonCode": "STOP_COMMUTATION",
"buttonCode": "ALL_STATION_PA",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_A",
"index": 1,
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "2",
"stepName": "向各级领导、调度汇报火情",
"stepName": "拨打火警电话",
"stepStatus": "0",
"buttonCode": "LEADER_REPORT_FIRE",
"buttonCode": "CALL_PHONE",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"roleCode": "Digital_Responsing_Plan_A",
"index": 2,
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "3",
"stepName": "申请主控站转移、停用本级对端换流器",
"stepCode": "16",
"stepName": "停运起火换流器,驻站消防队开始灭火",
"stepStatus": "0",
"buttonCode": "STOP_LOCAL_END_TRANSVERTER",
"buttonCode": "STOP_FIRE_TRANSVERTER",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"roleCode": "Digital_Responsing_Plan_A",
"index": 3,
"condition": [
{
"equipName": "开关",
"equipCode": "590000003EB44",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "Running_Alarm",
"standardValue": "false",
"inAndOr": "and"
}
],
"outAndOr": "and",
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "4",
"stepName": "通知专职消防队、值班领导或驻站检修负责人及保安人员",
"stepCode": "3",
"stepName": "确认油枕排油系统已开启",
"stepStatus": "0",
"buttonCode": "NOTICE_STATION_ALL_PERSON",
"buttonCode": "DRAIN_OIL_CONFIRM",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"roleCode": "Digital_Responsing_Plan_A",
"index": 4,
"condition": [
{
"equipName": "排油阀",
"equipCode": "92100400VWE44",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "ONL_DrainOilValve_Open",
"standardValue": "true",
"inAndOr": "and"
}
],
"outAndOr": "and",
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "5",
"stepName": "拨打119火警电话、全站广播通报火情",
"stepCode": "4",
"stepName": "泡沫喷淋系统已开启",
"stepStatus": "0",
"buttonCode": "CALL_PHONE",
"buttonCode": "OPEN_WATERSYSTEM",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"index": 5,
"condition": [
{
"equipName": "主机",
"equipCode": "92030100TGX44",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "CAFS_CompAirFoamHost_Outfire",
"standardValue": "true",
"inAndOr": "and"
}
],
"outAndOr": "and",
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "6",
"stepName": "起火换流变转检修",
"stepCode": "7",
"stepName": "一键启动消防炮",
"stepStatus": "0",
"buttonCode": "FIRE_TRANSVERTER_TO_OVERHAUL",
"buttonCode": "MONITOR_START",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"roleCode": "Digital_Responsing_Plan_A",
"index": 6,
"condition": [
{
"equipName": "CAFS消防炮",
"equipCode": "92032200BUX44",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "CAFS_GunValve_Open",
"standardValue": "true",
"inAndOr": "and"
}
],
"outAndOr": "and",
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "7",
"stepName": "驻站消防队开始灭火",
"stepCode": "17",
"stepName": "消防泵正常启动",
"stepStatus": "0",
"buttonCode": "FIRETEAM_START_OUTFIRE",
"buttonCode": "FIRE_PUMP_START",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_A",
"index": 7,
"condition": [
{
"equipName": "消防泵",
"equipCode": "920106007GV44",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "FHS_FirePump_Start",
"standardValue": "true",
"inAndOr": "or"
}
],
"outAndOr": "and",
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "8",
"stepName": "调整工业视频监视工业水池、现场火势情况",
"stepStatus": "1",
"buttonCode": "ADJUST_VIDEO_TO_POOL",
"stepCode": "18",
"stepName": "向各级调度、领导汇报火情",
"stepStatus": "0",
"buttonCode": "LEADER_REPORT_FIRE",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"roleCode": "Digital_Responsing_Plan_B",
"index": 8,
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "9",
"stepName": "CAFS喷淋系统已开启",
"stepCode": "19",
"stepName": "停运本极对端换流器",
"stepStatus": "0",
"buttonCode": "OPEN_WATERSYSTEM",
"buttonCode": "STOP_LOCAL_END_TRANSVERTER",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"roleCode": "Digital_Responsing_Plan_B",
"index": 9,
"checkYesOrNo": "",
"condition": [
{
"equipName": "雨淋阀",
"equipCode": "92130300BH644",
"equipName": "开关",
"equipCode": "590000003EB44",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "WSS_DelugeValve_Start",
"standardValue": "true",
"equipSpeIndexKey": "Running_Alarm",
"standardValue": "false",
"inAndOr": "and"
}
],
"outAndOr": "and",
"isAuto": 0
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "10",
"stepName": "开启换流变挑檐炮",
"stepCode": "20",
"stepName": "停运阀冷系统",
"stepStatus": "0",
"buttonCode": "MONITOR_START",
"buttonCode": "STOP_VALVE_COOL_SYS",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"roleCode": "Digital_Responsing_Plan_B",
"index": 10,
"condition": [
{
"equipName": "CAFS消防炮",
"equipCode": "92032200BUX44",
"equipName": "阀冷系统主机",
"equipCode": "59000000H9G44",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "CAFS_GunValve_Open",
"standardValue": "true",
"equipSpeIndexKey": "normal_running_state",
"standardValue": "false",
"inAndOr": "and"
}
],
......@@ -136,14 +205,13 @@
"checkYesOrNo": ""
},
{
"stepCode": "11",
"stepName": "停运阀冷系统、阀厅空调系统",
"stepCode": "6",
"stepName": "停运阀厅空调系统",
"stepStatus": "0",
"buttonCode": "STOP_VALVE_COOL_SYS",
"buttonCode": "STOP_AIRCON",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"roleCode": "Digital_Responsing_Plan_B",
"index": 11,
"checkYesOrNo": "",
"condition": [
{
"equipName": "AIRCS-风机",
......@@ -156,99 +224,107 @@
}
],
"outAndOr": "and",
"isAuto": 0
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "12",
"stepName": "断开交直流电源",
"stepCode": "5",
"stepName": "断开冷却器上级电源",
"stepStatus": "0",
"buttonCode": "OFF_POWER",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"roleCode": "Digital_Responsing_Plan_B",
"index": 12,
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "13",
"stepName": "启动着火换流变排油装置",
"stepCode": "21",
"stepName": "起火换流器转检修",
"stepStatus": "0",
"buttonCode": "DRAIN_OIL_CONFIRM",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_A",
"buttonCode": "FIRE_TRANSVERTER_TO_OVERHAUL",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 13,
"checkYesOrNo": "",
"condition": [
{
"equipName": "排油阀",
"equipCode": "92102700EBA44",
"equipName": "地刀",
"equipCode": "59000000SAT44",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "ONL_OilDischargeDeviceOilPillowDischargeOpen",
"equipSpeIndexKey": "Running_Alarm",
"standardValue": "true",
"inAndOr": "and"
}
],
"outAndOr": "and",
"isAuto": 0
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "14",
"stepCode": "22",
"stepName": "对阀侧套管、阀厅进行降温",
"stepStatus": "0",
"buttonCode": "COOL_SYS_COOL_DOWN",
"isParallel": "0",
"buttonCode": "VALVE_HALL_COOL",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_B",
"index": 14,
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "15",
"stepCode": "8",
"stepName": "驻站消防队指挥权交接",
"stepStatus": "0",
"buttonCode": "HANDOVER_COMMAND",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 15,
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "16",
"stepCode": "13",
"stepName": "确认明火扑灭",
"stepStatus": "0",
"buttonCode": "FIRE_EXTINCT",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 16,
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "17",
"stepCode": "23",
"stepName": "确认无复燃情况",
"stepStatus": "0",
"buttonCode": "CONFIRM_REKINDLE",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 17,
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "18",
"stepName": "向各级领导、调度、指挥中心汇报已灭火",
"stepCode": "24",
"stepName": "向各级调度、领导汇报已灭火",
"stepStatus": "0",
"buttonCode": "LEADER_REPORT_FIRE_EXTINCT",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 18,
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "19",
"stepCode": "14",
"stepName": "应急处置结束",
"stepStatus": "0",
"buttonCode": "END_EMERGENCY",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_B",
"index": 19,
"isAuto": 0,
"checkYesOrNo": ""
}
]
\ 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