| | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 补录多条 |
| | | /// </summary> |
| | | //[Route("InsertsSupplement@V1.0")] |
| | | //[HttpPost] |
| | | //public bool InsertsSupplement([Required] List<SupplementMonitorRealRecordInput> list) |
| | | //{ |
| | | // var corpIds = list.Select(x => x.CorpID).Distinct().ToList(); |
| | | // if (corpIds.Count > 1) |
| | | // { |
| | | // return false; |
| | | // } |
| | | |
| | | // var record_list = new List<Model.MonitorRealRecordPure>(); |
| | | // foreach (var item in list) |
| | | // { |
| | | // var monitor = new Service.MonitorPoint().GetExSignalWithSignalTypeByID(item.CorpID, item.MonitorPointID); |
| | | // if (monitor == null) |
| | | // { |
| | | // continue; |
| | | // } |
| | | // if (monitor.CronType != Model.Monitor.eCronType.Real) |
| | | // { |
| | | // continue; |
| | | // } |
| | | // switch (monitor.MonitorType) |
| | | // { |
| | | // case Model.eMonitorType.General: |
| | | // { |
| | | // var signal = monitor.SignalList?.FirstOrDefault(); |
| | | // if (signal != null) |
| | | // { |
| | | // var data_status = new List<string>(); |
| | | // var data_value = MonitorHandleHelper.Handle(monitor, signal, lastRecord: null, item.SrcTime, item.SrcValue, data_status); |
| | | // if (!string.IsNullOrEmpty(data_value)) |
| | | // { |
| | | // var record = new Model.MonitorRealRecordPure(); |
| | | // record.CorpID = item.CorpID; |
| | | // record.MonitorPointID = item.MonitorPointID; |
| | | // record.SignalID = signal.ID; |
| | | // record.RecordType = monitor.MonitorType; |
| | | // record.SrcTime = item.SrcTime; |
| | | // record.SrcValue = item.SrcValue; |
| | | // record.DataTime = item.DataTime; |
| | | // record.DataValue = data_value; |
| | | // record.DataStatus = data_status; |
| | | // record_list.Add(record); |
| | | // } |
| | | // } |
| | | // } |
| | | // break; |
| | | // case Model.eMonitorType.Vibration: |
| | | // { |
| | | // var sub_record_list = AddMonitorSubRecordInput.ToList(item.SrcValue); |
| | | // if (sub_record_list != null && sub_record_list.Count > 0) |
| | | // { |
| | | // foreach (var sub_record in sub_record_list) |
| | | // { |
| | | // var signal = monitor.SignalList?.FirstOrDefault(x => x.ID == sub_record.SignalID); |
| | | // if (signal == null) |
| | | // continue; |
| | | // var data_status = new List<string>(); |
| | | // var data_value = MonitorHandleHelper.Handle(monitor, signal, lastRecord: null, item.SrcTime, sub_record.SrcValue, data_status); |
| | | // if (string.IsNullOrEmpty(data_value)) |
| | | // continue; |
| | | // var record = new Model.MonitorRealRecordPure(); |
| | | // record.CorpID = item.CorpID; |
| | | // record.MonitorPointID = item.MonitorPointID; |
| | | // record.SignalID = signal.ID; |
| | | // record.RecordType = monitor.MonitorType; |
| | | // record.SrcTime = item.SrcTime; |
| | | // record.SrcValue = item.SrcValue; |
| | | // record.DataTime = item.DataTime; |
| | | // record.DataValue = data_value; |
| | | // record.DataStatus = data_status; |
| | | // record_list.Add(record); |
| | | // } |
| | | // } |
| | | // } |
| | | // break; |
| | | // default: break; |
| | | // } |
| | | // } |
| | | |
| | | // if (record_list.Count < 1) |
| | | // { |
| | | // return false; |
| | | // } |
| | | // var bol = _service.InsertsSupplement(record_list); |
| | | // return bol; |
| | | //} |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |