diff --git a/Service/Plc/Client/PlcClient.cs b/Service/Plc/Client/PlcClient.cs index d2466ce..f465e78 100644 --- a/Service/Plc/Client/PlcClient.cs +++ b/Service/Plc/Client/PlcClient.cs @@ -140,7 +140,7 @@ public class PlcClient : ModbusTcpMaster { #region 有报警比较两边差异,新出现的报警就添加,消失的报警就处理并记录 - var lstEquipAlarmRecord=EquipAlarmRecordRepository.Query(); + var lstEquipAlarmRecord=EquipAlarmRecordRepository.QueryListByClause(e => e.EquipTypeCode == 3).ToList(); var sqllstAlarm=lstEquipAlarmRecord.Select(obj => obj.ErrorCode).ToList(); // 找出实时报警中存在但数据库中不存在的元素 @@ -200,7 +200,7 @@ public class PlcClient : ModbusTcpMaster { #region 没报警把已处理记录更新并删除实时报警 - var lstEquipAlarmRecord=EquipAlarmRecordRepository.Query(); + var lstEquipAlarmRecord = EquipAlarmRecordRepository.QueryListByClause(e => e.EquipTypeCode == 3).ToList(); if (lstEquipAlarmRecord.Count > 0) { foreach (var VARIABLE in lstEquipAlarmRecord) @@ -217,8 +217,8 @@ public class PlcClient : ModbusTcpMaster EquipAlarmProcessRecordRepository.Insert(EquipAlarmProcessRecord); } + EquipAlarmRecordRepository.Delete(e => e.EquipTypeCode == 3); } - EquipAlarmRecordRepository.Delete(i=>i.Id>0); #endregion diff --git a/WebStarter/db/lxw0607.sql b/WebStarter/db/lxw0607.sql index 829b9c6..17e53b8 100644 --- a/WebStarter/db/lxw0607.sql +++ b/WebStarter/db/lxw0607.sql @@ -49,6 +49,10 @@ ALTER TABLE bin_info ADD `in_time` datetime DEFAULT NULL COMMENT "入仓时间" -- 添加站外充电枪编号 ALTER TABLE charge_order ADD COLUMN out_charger_gun_no VARCHAR(255) COMMENT '站外充电枪编号,1枪或2枪'; +-- 设备故障表增加报警开始时间字段 +ALTER TABLE equip_alarm_record ADD COLUMN start_time DATETIME COMMENT '报警开始时间'; +-- 设备处理表增加报警开始时间字段 +ALTER TABLE equip_alarm_process_record ADD COLUMN start_time DATETIME COMMENT '报警开始时间'; -- 每日运行,double ALTER TABLE exchange_station_day_count_result MODIFY COLUMN toltal_swap_all_time DOUBLE; ALTER TABLE exchange_station_day_count_result MODIFY COLUMN toltal_time_count DOUBLE; diff --git a/WebStarter/db/充电机故障初始化.sql b/WebStarter/db/充电机故障初始化.sql new file mode 100644 index 0000000..9732d37 --- /dev/null +++ b/WebStarter/db/充电机故障初始化.sql @@ -0,0 +1,218 @@ +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4113', '1', '单体温度过高一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4114', '2', '单体温度过高二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4115', '3', '单体温度过高三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4129', '1', '单体温度过低一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4130', '2', '单体温度过低二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4131', '3', '单体温度过低三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4145', '1', '单体过压一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4146', '2', '单体过压二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4147', '3', '单体过压三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4161', '1', '单体欠压一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4162', '2', '单体欠压二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4163', '3', '单体欠压三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4257', '1', '电池包总压过高一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4258', '2', '电池包总压过高二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4259', '3', '电池包总压过高三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4273', '1', '电池包总压过低一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4274', '2', '电池包总压过低二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4275', '3', '电池包总压过低三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4193', '1', '放电过流一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4194', '2', '放电过流二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4195', '3', '放电过流三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4241', '1', '充电过流一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4242', '2', '充电过流二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4243', '3', '充电过流三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4321', '1', '单体压差过大一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4322', '2', '单体压差过大二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4323', '3', '单体压差过大三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4305', '1', '单体温差过大一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4306', '2', '单体温差过大二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4307', '3', '单体温差过大三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4291', '1', '绝缘过低一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4292', '2', '绝缘过低二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4293', '3', '绝缘过低三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4337', '1', 'SOC 过低一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4338', '2', 'SOC 过低二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4339', '3', 'SOC 过低三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4369', '1', '供电电压过低一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4370', '2', '供电电压过低二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4371', '3', '供电电压过低三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4385', '1', '供电电压过高一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4386', '2', '供电电压过高二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4387', '3', '供电电压过高三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4417', '1', '电池温升过快一级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4418', '2', '电池温升过快二级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4419', '3', '电池温升过快三级', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '4355', '1', 'Pack 回路断开', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '8211', '1', '从板通讯丢失', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '8243', '1', '充电机丢失', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '8259', '1', '绝缘仪通讯丢失', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '8275', '1', '电流传感器通讯丢失', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '8307', '1', '热管理机组通讯丢失', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '8419', '1', '电流传感器采样异常', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '8403', '1', '绝缘采样异常', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '16403', '1', '主正继电器开路故障', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '16419', '1', '主负继电器开路故障', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '16626', '1', '主正继电器粘连故障', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '16642', '1', '主负继电器粘连故障', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '20499', '1', '外部短路故障', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '20530', '1', '高压互锁故障', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '20563', '1', 'CC2 电压异常', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '20819', '1', '充电枪连接故障', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '24627', '1', '充电系统不匹配故障', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '24611', '1', '充电电流异常', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '28706', '1', '均衡故障', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '32803', '1', '火灾报警', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '32787', '1', '自保护故障', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '32819', '1', '电池过放', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '32835', '1', '电池过充', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '20771', '1', '预充故障', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '37043', '1', '电池电压采样线开路', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '37059', '1', '电池温度采样线开路', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '37091', '1', '电池电压采样异常', '2024-06-26 14:12:05', '2024-06-26 14:12:05'); + +INSERT INTO equip_alarm_define (equip_type_code, equip_code, error_code, error_level, error_msg, created_time, updated_time) +VALUES (0, 'charger', '37107', '1', '电池温度采样异常', '2024-06-26 14:12:05', '2024-06-26 14:12:05');