sqlserver版本 数据库接口测试;朔黄中期项目座谈会代码;
This commit is contained in:
parent
3b60397ae1
commit
6ba1af2f60
@ -41,12 +41,12 @@ namespace Yunda.SOMS.OperationsMainSiteGatewayServer
|
||||
public override void PreInitialize()
|
||||
{
|
||||
// 预初始化阶段,可以进行一些配置
|
||||
Console.WriteLine("PreInitialize: ABP Module Setup");
|
||||
Debug.WriteLine("PreInitialize: ABP Module Setup");
|
||||
var _appConfiguration = new ConfigurationBuilder()
|
||||
.AddJsonFile("appsettings.json")
|
||||
.Build();
|
||||
.AddJsonFile("appsettings.json")
|
||||
.Build();
|
||||
// 后初始化阶段
|
||||
Console.WriteLine("PostInitialize: ABP Module Post Initialization");
|
||||
Debug.WriteLine("PostInitialize: ABP Module Post Initialization");
|
||||
Configuration.DefaultNameOrConnectionString = _appConfiguration.GetConnectionString(
|
||||
ISASConsts.ConnectionMysqlStringKey
|
||||
);
|
||||
|
@ -147,10 +147,21 @@ namespace YunDa.ISAS.Application.Core.Auditing
|
||||
if (method == null) return null;
|
||||
try
|
||||
{
|
||||
var methodDesc = (DescriptionAttribute)method.GetCustomAttribute(typeof(DescriptionAttribute));
|
||||
var typeDesc = (DescriptionAttribute)type?.GetCustomAttribute(typeof(DescriptionAttribute));
|
||||
|
||||
if (methodDesc == null || typeDesc == null) return null;
|
||||
// 方法描述处理
|
||||
DescriptionAttribute methodDescription = method.GetCustomAttribute<DescriptionAttribute>();
|
||||
if (methodDescription == null)
|
||||
{
|
||||
methodDescription = new DescriptionAttribute(
|
||||
$"未定义描述的方法: {method.Name} (参数: {string.Join(", ", method.GetParameters().Select(p => p.ParameterType.Name))})"
|
||||
);
|
||||
}
|
||||
// 类型描述处理(带null传播运算符)
|
||||
DescriptionAttribute typeDescription = type?.GetCustomAttribute<DescriptionAttribute>();
|
||||
typeDescription ??= new DescriptionAttribute(
|
||||
type != null
|
||||
? $"未定义描述的类型: {type.Name}"
|
||||
: "未指定类型"
|
||||
);
|
||||
|
||||
if (arguments.ContainsKey("password"))
|
||||
arguments["password"] = "******";
|
||||
@ -161,8 +172,8 @@ namespace YunDa.ISAS.Application.Core.Auditing
|
||||
UserId = AbpSession.UserId,
|
||||
ImpersonatorUserId = AbpSession.ImpersonatorUserId,
|
||||
ImpersonatorTenantId = AbpSession.ImpersonatorTenantId,
|
||||
ServiceName = typeDesc.Description,
|
||||
MethodName = methodDesc.Description,
|
||||
ServiceName = typeDescription.Description,
|
||||
MethodName = methodDescription.Description,
|
||||
Parameters = ConvertArgumentsToJson(arguments),
|
||||
ExecutionTime = Clock.Now
|
||||
};
|
||||
|
@ -11,10 +11,10 @@ using YunDa.ISAS.DataTransferObject;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.DMAlarmCategoryDto;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.DMAlarmCategoryDto.SearchCondition;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.EnvironmentLiveDataDto;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.Entities.GeneralInformation;
|
||||
using YunDa.ISAS.Redis.Entities.AlarmCategory;
|
||||
using YunDa.ISAS.Redis.Repositories;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData;
|
||||
|
||||
namespace YunDa.ISAS.Application.DataMonitoring
|
||||
{
|
||||
|
@ -0,0 +1,265 @@
|
||||
using Abp.Auditing;
|
||||
using Abp.Collections.Extensions;
|
||||
using Abp.Domain.Repositories;
|
||||
using Abp.Linq.Extensions;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.JsonPatch.Operations;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using ToolLibrary.LogHelper;
|
||||
using YunDa.ISAS.Application.Core;
|
||||
using YunDa.ISAS.Application.Core.Session;
|
||||
using YunDa.ISAS.Application.Core.SwaggerHelper;
|
||||
using YunDa.ISAS.DataTransferObject;
|
||||
using YunDa.ISAS.DataTransferObject.CommonDto;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.ManufacturerInfoDto;
|
||||
using YunDa.ISAS.Entities.GeneralInformation;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto;
|
||||
using YunDa.SOMS.Entities.GeneralInformation;
|
||||
|
||||
namespace YunDa.ISAS.Application.GeneralInformation
|
||||
{
|
||||
public class EquipmentIndicatorConfigAppService : ISASAppServiceBase, IEquipmentIndicatorConfigAppService
|
||||
{
|
||||
private readonly IRepository<EquipmentIndicatorConfig, Guid> _equipmentIndicatorConfigRepository;
|
||||
private readonly IRepository<EquipmentIndicatorComment, string> _equipmentIndicatorCommentRepository;
|
||||
private readonly IRepository<EquipmentInfo, Guid> _equipmentInfoRepository;
|
||||
|
||||
|
||||
public EquipmentIndicatorConfigAppService(
|
||||
ISessionAppService sessionAppService,
|
||||
IRepository<EquipmentIndicatorConfig, Guid> equipmentIndicatorConfigRepository,
|
||||
IRepository<EquipmentIndicatorComment, string> equipmentIndicatorCommentRepository,
|
||||
IRepository<EquipmentInfo, Guid> equipmentInfoRepository
|
||||
) : base(sessionAppService)
|
||||
{
|
||||
_equipmentIndicatorConfigRepository = equipmentIndicatorConfigRepository;
|
||||
_equipmentIndicatorCommentRepository = equipmentIndicatorCommentRepository;
|
||||
_equipmentInfoRepository = equipmentInfoRepository;
|
||||
}
|
||||
/// <summary>
|
||||
/// 指标配置增加或修改
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
[HttpPost]
|
||||
[Audited]
|
||||
[Description("指标配置增加或修改")]
|
||||
public async Task<RequestResult<EquipmentIndicatorConfigOutput>> CreateOrUpdateAsync(EditEquipmentIndicatorConfigInput input)
|
||||
{
|
||||
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||
|
||||
return input.Id.HasValue
|
||||
? await UpdateAsync(input)
|
||||
: await CreateAsync(input);
|
||||
}
|
||||
private async Task<RequestResult<EquipmentIndicatorConfigOutput>> UpdateAsync(EditEquipmentIndicatorConfigInput input)
|
||||
{
|
||||
var rst = new RequestResult<EquipmentIndicatorConfigOutput>();
|
||||
try
|
||||
{
|
||||
var entity = await _equipmentIndicatorConfigRepository.GetAsync(input.Id.Value);
|
||||
input.CreationTime = entity.CreationTime;
|
||||
input.CreatorUserId = entity.CreatorUserId;
|
||||
input.LastModificationTime = DateTime.Now;
|
||||
input.LastModifierUserId = base.GetCurrentUser().Id;
|
||||
ObjectMapper.Map(input, entity);
|
||||
await _equipmentIndicatorConfigRepository.UpdateAsync(entity);
|
||||
rst.Flag = true;
|
||||
rst.ResultData = ObjectMapper.Map<EquipmentIndicatorConfigOutput>(entity);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(rst, ex, "更新指标配置");
|
||||
}
|
||||
return rst;
|
||||
}
|
||||
private async Task<RequestResult<EquipmentIndicatorConfigOutput>> CreateAsync(EditEquipmentIndicatorConfigInput input)
|
||||
{
|
||||
var rst = new RequestResult<EquipmentIndicatorConfigOutput>();
|
||||
try
|
||||
{
|
||||
var entity = ObjectMapper.Map<EquipmentIndicatorConfig>(input);
|
||||
entity.CreationTime = DateTime.Now;
|
||||
entity.CreatorUserId = base.GetCurrentUser().Id;
|
||||
entity.LastModifierUserId = base.GetCurrentUser().Id;
|
||||
entity.LastModificationTime = DateTime.Now;
|
||||
entity = await _equipmentIndicatorConfigRepository.InsertAsync(entity);
|
||||
rst.ResultData = ObjectMapper.Map<EquipmentIndicatorConfigOutput>(entity);
|
||||
rst.Flag = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(rst, ex, "创建指标配置");
|
||||
}
|
||||
return rst;
|
||||
}
|
||||
[HttpPost]
|
||||
[Audited]
|
||||
[Description("删除单个配置")]
|
||||
public async Task<RequestEasyResult> DeleteByIdAsync(Guid id)
|
||||
{
|
||||
var rst = new RequestEasyResult();
|
||||
try
|
||||
{
|
||||
await _equipmentIndicatorConfigRepository.DeleteAsync(id);
|
||||
rst.Flag = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
rst.Message = ex.Message;
|
||||
rst.Flag = false;
|
||||
Log4Helper.Error(GetType(), "删除指标配置", ex);
|
||||
}
|
||||
return rst;
|
||||
}
|
||||
[HttpPost]
|
||||
[Audited]
|
||||
[Description("删除多个配置")]
|
||||
public async Task<RequestEasyResult> DeleteByIdsAsync(List<Guid> ids)
|
||||
{
|
||||
var rst = new RequestEasyResult();
|
||||
try
|
||||
{
|
||||
await _equipmentIndicatorConfigRepository.DeleteAsync(item => ids.Contains(item.Id));
|
||||
rst.Flag = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
rst.Message = ex.Message;
|
||||
rst.Flag = false;
|
||||
Log4Helper.Error(GetType(), "批量删除指标配置", ex);
|
||||
}
|
||||
return rst;
|
||||
}
|
||||
[HttpPost]
|
||||
[Description("指标配置查询")]
|
||||
public RequestPageResult<EquipmentIndicatorConfigOutput> FindDatas(
|
||||
PageSearchCondition<EquipmentIndicatorConfigSearchConditionInput> searchCondition)
|
||||
{
|
||||
var rst = new RequestPageResult<EquipmentIndicatorConfigOutput> { Flag = false };
|
||||
try
|
||||
{
|
||||
var query = _equipmentIndicatorConfigRepository.GetAllIncluding(t=>t.EquipmentType)
|
||||
.WhereIf(searchCondition.SearchCondition.IsActive.HasValue,
|
||||
x => x.IsActive == searchCondition.SearchCondition.IsActive)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(searchCondition.SearchCondition.Name),
|
||||
x => x.Name.Contains(searchCondition.SearchCondition.Name))
|
||||
.WhereIf(searchCondition.SearchCondition.EquipmentTypeId.HasValue,
|
||||
x => x.EquipmentTypeId == searchCondition.SearchCondition.EquipmentTypeId);
|
||||
// 排序处理
|
||||
query = query.OrderBy(x => x.SeqNo).ThenBy(x => x.CreationTime);
|
||||
// 分页处理
|
||||
var totalCount = query.Count();
|
||||
|
||||
int skipCount = searchCondition.PageIndex <= 0 ? -1 : ((searchCondition.PageIndex - 1) * searchCondition.PageSize);
|
||||
|
||||
if (skipCount != -1)
|
||||
query = query.PageBy(skipCount, searchCondition.PageSize);
|
||||
|
||||
rst.TotalCount = totalCount;
|
||||
rst.ResultData = ObjectMapper.Map<List<EquipmentIndicatorConfigOutput>>(query.ToList());
|
||||
rst.Flag = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandlePageException(rst, ex, "查询指标配置");
|
||||
}
|
||||
return rst;
|
||||
}
|
||||
#region 私有方法
|
||||
private void HandleException<T>(RequestResult<T> result, Exception ex, string operation)
|
||||
{
|
||||
result.Flag = false;
|
||||
result.Message = ex.Message;
|
||||
Log4Helper.Error(GetType(), operation, ex);
|
||||
}
|
||||
private void HandlePageException<T>(RequestPageResult<T> result, Exception ex, string operation)
|
||||
{
|
||||
result.Flag = false;
|
||||
result.Message = ex.Message;
|
||||
Log4Helper.Error(GetType(), operation, ex);
|
||||
}
|
||||
#endregion
|
||||
|
||||
[HttpPost]
|
||||
public RequestResult<List<SelectModelOutput>> FindEquipmentIndicatorCommentForSelect()
|
||||
{
|
||||
var rst = new RequestResult<List<SelectModelOutput>> { Flag = false };
|
||||
|
||||
try
|
||||
{
|
||||
rst.ResultData = _equipmentIndicatorCommentRepository.GetAll().Select(t=>new SelectModelOutput
|
||||
{
|
||||
Key = t.Id,
|
||||
Text =t.Id,
|
||||
Value = t.Id
|
||||
}).ToList();
|
||||
rst.Flag = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
rst.Message = ex.Message;
|
||||
Log4Helper.Error(this.GetType(), "根据查询条件查询设备类型等级数据", ex);
|
||||
}
|
||||
|
||||
return rst;
|
||||
}
|
||||
[HttpPost]
|
||||
public async Task<RequestEasyResult> CreateEquipmentIndicatorCommentAsync(EditEquipmentIndicatorCommentInput input)
|
||||
{
|
||||
var rst = new RequestEasyResult();
|
||||
try
|
||||
{
|
||||
var entity = ObjectMapper.Map<EquipmentIndicatorComment>(input);
|
||||
|
||||
entity = await _equipmentIndicatorCommentRepository.InsertAsync(entity);
|
||||
|
||||
rst.Flag = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log4Helper.Error(this.GetType(), "根据查询条件查询设备类型等级数据", ex);
|
||||
|
||||
}
|
||||
return rst;
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[ShowApi]
|
||||
[HttpGet]
|
||||
[Description("根据设备ID获取健康评分")]
|
||||
public RequestResult<List<EquipmentIndicatorConfigOutput>> GetEquipmentHealthScore(Guid equipmentId)
|
||||
{
|
||||
var rst = new RequestResult<List<EquipmentIndicatorConfigOutput>> { Flag = false };
|
||||
try
|
||||
{
|
||||
var equipment = _equipmentInfoRepository.GetAll().FirstOrDefault(t=>t.Id == equipmentId);
|
||||
if (equipment!=null)
|
||||
{
|
||||
var query = _equipmentIndicatorConfigRepository.GetAllIncluding()
|
||||
.Where(t => t.EquipmentTypeId == equipment.EquipmentTypeId);
|
||||
rst.ResultData = ObjectMapper.Map<List<EquipmentIndicatorConfigOutput>>(query.ToList());
|
||||
foreach (var item in rst.ResultData)
|
||||
{
|
||||
if (item.Value<(decimal)0.1)
|
||||
{
|
||||
item.Value = 100;
|
||||
}
|
||||
}
|
||||
rst.Flag = true;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log4Helper.Error(GetType(), "operation", ex);
|
||||
}
|
||||
return rst;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using YunDa.ISAS.Application.Core;
|
||||
using YunDa.ISAS.DataTransferObject;
|
||||
using YunDa.ISAS.DataTransferObject.CommonDto;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.ManufacturerInfoDto;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto;
|
||||
|
||||
namespace YunDa.ISAS.Application.GeneralInformation
|
||||
{
|
||||
|
||||
public interface IEquipmentIndicatorConfigAppService : IAppServiceBase<EquipmentIndicatorConfigSearchConditionInput, EquipmentIndicatorConfigOutput, EditEquipmentIndicatorConfigInput, Guid>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -26,7 +26,6 @@ using Abp.Linq.Extensions;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentDataCategoryDto;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using YunDa.ISAS.Entities.System;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using AutoMapper;
|
||||
using YunDa.SOMS.DataTransferObject.Iec104;
|
||||
using Abp.Auditing;
|
||||
@ -34,6 +33,7 @@ using Abp.Domain.Uow;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using YunDa.SOMS.Entities.GeneralInformation;
|
||||
using YunDa.SOMS.BASE.Entities.Models;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto;
|
||||
|
||||
namespace YunDa.ISAS.Application.GeneralInformation
|
||||
{
|
||||
|
@ -28,7 +28,6 @@ using YunDa.ISAS.Application.Core.SwaggerHelper;
|
||||
using YunDa.ISAS.Core.Helper;
|
||||
using YunDa.ISAS.DataTransferObject;
|
||||
using YunDa.ISAS.DataTransferObject.Account;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto.SearchCondition;
|
||||
using YunDa.ISAS.DataTransferObject.VideoSurveillance.VideoDevDto;
|
||||
@ -41,7 +40,7 @@ using YunDa.ISAS.MongoDB.Repositories;
|
||||
using YunDa.ISAS.Redis.Entities.AlarmCategory;
|
||||
using YunDa.ISAS.Redis.Repositories;
|
||||
using YunDa.SOMS.DataTransferObject.AlarmDataDto;
|
||||
using YunDa.SOMS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto;
|
||||
using YunDa.SOMS.DataTransferObject.MainStationMaintenanceInfo.OperationReport;
|
||||
using YunDa.SOMS.DataTransferObject.ThirdPartyData.NJJW;
|
||||
using YunDa.SOMS.Entities.GeneralInformation;
|
||||
@ -1131,5 +1130,126 @@ namespace YunDa.ISAS.Application.GeneralInformation
|
||||
}
|
||||
return rst;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[AbpAllowAnonymous]
|
||||
[ShowApi]
|
||||
[DisableRequestSizeLimit]
|
||||
[RequestFormLimits(ValueLengthLimit = int.MaxValue, MultipartBodyLengthLimit = int.MaxValue)]
|
||||
[Route("/soms/api/voiceprint/upload")]
|
||||
public async Task<RequestResult<VoiceprintData>> UploadVoiceprintAsync(
|
||||
[FromForm] IFormFile voiceprint_data,
|
||||
[FromForm] string image_data,
|
||||
[FromForm] string analysis_result)
|
||||
{
|
||||
var result = new RequestResult<VoiceprintData>();
|
||||
try
|
||||
{
|
||||
// Validate required parameters
|
||||
if (voiceprint_data == null)
|
||||
{
|
||||
result.Message = "缺少必要参数: voiceprint_data";
|
||||
return result;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(image_data))
|
||||
{
|
||||
result.Message = "缺少必要参数: image_data";
|
||||
return result;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(analysis_result))
|
||||
{
|
||||
result.Message = "缺少必要参数: analysis_result";
|
||||
return result;
|
||||
}
|
||||
|
||||
// Validate file type
|
||||
var extension = Path.GetExtension(voiceprint_data.FileName).ToLowerInvariant();
|
||||
if (!new[] { ".wav", ".pcm" }.Contains(extension))
|
||||
{
|
||||
result.Message = "不支持的文件类型,仅支持.wav和.pcm格式";
|
||||
return result;
|
||||
}
|
||||
|
||||
// Validate file size (100MB limit)
|
||||
if (voiceprint_data.Length > 100 * 1024 * 1024)
|
||||
{
|
||||
result.Message = "文件大小超过限制(100MB)";
|
||||
return result;
|
||||
}
|
||||
|
||||
// Parse analysis result
|
||||
VoiceprintData voiceprintData;
|
||||
try
|
||||
{
|
||||
voiceprintData = JsonSerializer.Deserialize<VoiceprintData>(analysis_result);
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
result.Message = "JSON解析失败";
|
||||
return result;
|
||||
}
|
||||
|
||||
// Generate unique ID if not provided
|
||||
if (string.IsNullOrEmpty(voiceprintData.VoiceprintId))
|
||||
{
|
||||
voiceprintData.VoiceprintId = $"VP_{DateTime.Now:yyyyMMdd_HHmmss}";
|
||||
}
|
||||
|
||||
// Create storage directory
|
||||
var uploadDir = Path.Combine(
|
||||
base.GetAttachmentDirectory(),
|
||||
"Uploads",
|
||||
"Voiceprints",
|
||||
DateTime.Now.ToString("yyyy-MM-dd"));
|
||||
|
||||
Directory.CreateDirectory(uploadDir);
|
||||
|
||||
// Save voiceprint file
|
||||
var fileName = $"{voiceprintData.VoiceprintId}{extension}";
|
||||
var fullPath = Path.Combine(uploadDir, fileName);
|
||||
using (var stream = new FileStream(fullPath, FileMode.Create))
|
||||
{
|
||||
await voiceprint_data.CopyToAsync(stream);
|
||||
}
|
||||
|
||||
// Save image if provided
|
||||
if (image_data.StartsWith("data:image/"))
|
||||
{
|
||||
try
|
||||
{
|
||||
var base64Data = image_data.Split(',')[1];
|
||||
var imageBytes = Convert.FromBase64String(base64Data);
|
||||
var imagePath = Path.Combine(uploadDir, $"{voiceprintData.VoiceprintId}.png");
|
||||
await File.WriteAllBytesAsync(imagePath, imageBytes);
|
||||
voiceprintData.ImageSaved = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
result.Message = "Base64解码失败";
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// Update paths
|
||||
voiceprintData.SavedPath = fullPath.Replace(base.GetAttachmentDirectory(), "");
|
||||
voiceprintData.Timestamp = DateTime.Now;
|
||||
|
||||
// Save to MongoDB
|
||||
_bsonDocumentResultRepository.CollectionName = nameof(VoiceprintData);
|
||||
await _bsonDocumentResultRepository.InsertOneAsync(voiceprintData.ToBsonDocument());
|
||||
|
||||
result.ResultData = voiceprintData;
|
||||
result.Flag = true;
|
||||
result.Message = "操作成功";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log4Helper.Error(this.GetType(), "上传声纹数据失败", ex);
|
||||
result.Message = "服务器存储失败";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
@ -6,10 +6,10 @@ using System.Threading.Tasks;
|
||||
using YunDa.ISAS.Application.Core;
|
||||
using YunDa.ISAS.DataTransferObject;
|
||||
using YunDa.ISAS.DataTransferObject.CommonDto;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto.SearchCondition;
|
||||
using YunDa.ISAS.Entities.GeneralInformation;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto;
|
||||
|
||||
namespace YunDa.ISAS.Application.GeneralInformation
|
||||
{
|
||||
|
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace YunDa.ISAS.Application.GeneralInformation
|
||||
{
|
||||
public class VoiceprintData
|
||||
{
|
||||
[JsonPropertyName("voiceprint_id")]
|
||||
public string VoiceprintId { get; set; }
|
||||
|
||||
[JsonPropertyName("saved_path")]
|
||||
public string SavedPath { get; set; }
|
||||
|
||||
[JsonPropertyName("image_saved")]
|
||||
public bool ImageSaved { get; set; }
|
||||
|
||||
[JsonPropertyName("timestamp")]
|
||||
public DateTime Timestamp { get; set; }
|
||||
|
||||
[JsonPropertyName("frequency_peak")]
|
||||
public int FrequencyPeak { get; set; }
|
||||
|
||||
[JsonPropertyName("amplitude_range")]
|
||||
public double[] AmplitudeRange { get; set; }
|
||||
|
||||
[JsonPropertyName("metadata")]
|
||||
public VoiceprintMetadata Metadata { get; set; }
|
||||
}
|
||||
|
||||
public class VoiceprintMetadata
|
||||
{
|
||||
[JsonPropertyName("device_id")]
|
||||
public string DeviceId { get; set; }
|
||||
|
||||
[JsonPropertyName("sample_rate")]
|
||||
public int SampleRate { get; set; }
|
||||
}
|
||||
}
|
@ -926,7 +926,7 @@ namespace YunDa.ISAS.Application.GeneralInformation
|
||||
/// <returns></returns>
|
||||
[HttpPost, Audited, Description("导入遥测、遥信、遥控配置文档,并修改数据库对应配置项")]
|
||||
[UnitOfWork(isTransactional: false)]
|
||||
public async Task<RequestEasyResult> ImportTeleConfigurationExcelAsync([FromForm] IFormCollection formCollection, [FromQuery] Guid? id)
|
||||
public async Task<RequestEasyResult> ImportTeleConfigurationExcelOldAsync([FromForm] IFormCollection formCollection, [FromQuery] Guid? id)
|
||||
{
|
||||
RequestEasyResult requestEasyResult = new RequestEasyResult();
|
||||
try
|
||||
@ -1458,6 +1458,592 @@ namespace YunDa.ISAS.Application.GeneralInformation
|
||||
|
||||
return requestEasyResult;
|
||||
}
|
||||
|
||||
|
||||
// ... existing code ...
|
||||
|
||||
[HttpPost, Audited, Description("导入遥测、遥信、遥控配置文档,并修改数据库对应配置项")]
|
||||
[UnitOfWork(isTransactional: false)]
|
||||
public async Task<RequestEasyResult> ImportTeleConfigurationExcelAsync([FromForm] IFormCollection formCollection, [FromQuery] Guid? id)
|
||||
{
|
||||
RequestEasyResult requestEasyResult = new RequestEasyResult();
|
||||
try
|
||||
{
|
||||
FormFileCollection fileCollection = (FormFileCollection)formCollection.Files;
|
||||
if (fileCollection == null || fileCollection.Count != 1)
|
||||
{
|
||||
return requestEasyResult;
|
||||
}
|
||||
|
||||
IFormFile file = fileCollection[0];
|
||||
ExcelHandler excelRead = new DataConfigurationExcelHandle();
|
||||
string ext = file.FileName.Split('.')?.LastOrDefault();
|
||||
|
||||
// 获取基础数据
|
||||
var equipmentRepo = await _equipmentInfoRepository.GetAll().ToListAsync();
|
||||
var equipmentTypeRepo = await _equipmentTypeRepository.GetAll().ToListAsync();
|
||||
var selfCheckingConfigurationRepo = await _selfCheckingConfigurationResitory.GetAll().ToListAsync();
|
||||
var telemeteringRepo = await _telemeteringConfigurationResitory.GetAllIncluding(t => t.EquipmentInfo).ToListAsync();
|
||||
var dmalarmCategoryRepo = await _dmalarmCategoryResitory.GetAll().ToListAsync();
|
||||
|
||||
// 处理遥测配置
|
||||
await ProcessTelemeteringConfigurations(file, excelRead, ext, id, equipmentRepo, equipmentTypeRepo, telemeteringRepo);
|
||||
|
||||
// 处理遥测报警配置
|
||||
await ProcessTelemeteringAlarmStrategies(file, excelRead, ext, telemeteringRepo, dmalarmCategoryRepo);
|
||||
|
||||
// 处理遥信配置
|
||||
await ProcessTelesignalisationConfigurations(file, excelRead, ext, id, equipmentRepo, equipmentTypeRepo, selfCheckingConfigurationRepo, dmalarmCategoryRepo);
|
||||
|
||||
// 处理遥控配置
|
||||
await ProcessTelecommandConfigurations(file, excelRead, ext, id, equipmentRepo, equipmentTypeRepo);
|
||||
|
||||
requestEasyResult.Flag = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log4Helper.Error(this.GetType(), "变电所管理服务-导入配置", ex);
|
||||
requestEasyResult.Flag = false;
|
||||
requestEasyResult.Message = ex.Message;
|
||||
}
|
||||
|
||||
return requestEasyResult;
|
||||
}
|
||||
|
||||
private async Task ProcessTelemeteringConfigurations(IFormFile file, ExcelHandler excelRead, string ext, Guid? id,
|
||||
List<EquipmentInfo> equipmentRepo, List<EquipmentType> equipmentTypeRepo, List<TelemeteringConfiguration> telemeteringRepo)
|
||||
{
|
||||
try
|
||||
{
|
||||
var telemeteringStr = excelRead.ReadExcel(file.OpenReadStream(), "遥测", ext)?.ToString();
|
||||
if (telemeteringStr == null) return;
|
||||
|
||||
JObject rss = JObject.Parse(telemeteringStr);
|
||||
var results = rss["data"].Children().ToList();
|
||||
|
||||
var entitiesToUpdate = new List<TelemeteringConfiguration>();
|
||||
var entitiesToInsert = new List<TelemeteringConfiguration>();
|
||||
|
||||
foreach (JToken result in results)
|
||||
{
|
||||
var item = result.ToObject<TelemeteringConfigurationExcel>();
|
||||
if (string.IsNullOrEmpty(item.Name)) continue;
|
||||
|
||||
TelemeteringConfiguration existingConfig = null;
|
||||
if (item.Id != null)
|
||||
{
|
||||
existingConfig = telemeteringRepo.FirstOrDefault(t => t.Id == item.Id);
|
||||
}
|
||||
if (existingConfig == null)
|
||||
{
|
||||
existingConfig = telemeteringRepo.FirstOrDefault(t =>
|
||||
t.TransformerSubstationId == id &&
|
||||
t.EquipmentInfo?.Name == result["关联监控设备"].ToString() &&
|
||||
t.Name == item.Name);
|
||||
}
|
||||
|
||||
if (existingConfig != null)
|
||||
{
|
||||
// 更新现有记录
|
||||
UpdateTelemeteringConfiguration(existingConfig, item, result, equipmentRepo, equipmentTypeRepo);
|
||||
entitiesToUpdate.Add(existingConfig);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 创建新记录
|
||||
var newConfig = CreateTelemeteringConfiguration(item, result, id, equipmentRepo, equipmentTypeRepo);
|
||||
if (newConfig != null)
|
||||
{
|
||||
entitiesToInsert.Add(newConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 批量更新和插入
|
||||
if (entitiesToUpdate.Any())
|
||||
{
|
||||
_telemeteringConfigurationResitory.GetDbContext().UpdateRange(entitiesToUpdate);
|
||||
}
|
||||
|
||||
if (entitiesToInsert.Any())
|
||||
{
|
||||
_telemeteringConfigurationResitory.GetDbContext().AddRange(entitiesToInsert);
|
||||
}
|
||||
|
||||
await _telemeteringConfigurationResitory.GetDbContext().SaveChangesAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log4Helper.Error(this.GetType(), "变电所管理服务-遥测导入", ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTelemeteringConfiguration(TelemeteringConfiguration config, TelemeteringConfigurationExcel item,
|
||||
JToken result, List<EquipmentInfo> equipmentRepo, List<EquipmentType> equipmentTypeRepo)
|
||||
{
|
||||
config.Name = item.Name;
|
||||
config.SeqNo = item.SeqNo;
|
||||
config.IsActive = item.IsActive;
|
||||
config.IsSave = item.IsSave;
|
||||
config.IsSendDispatcher = item.IsSendDispatcher;
|
||||
config.IsVisible = item.IsVisible;
|
||||
config.DispatcherAddress = item.DispatcherAddress;
|
||||
config.CPUSector = item.CPUSector;
|
||||
config.DeviceAddress = item.DeviceAddress;
|
||||
config.InfoAddress = item.InfoAddress;
|
||||
config.InfoCPUSector = item.InfoCPUSector;
|
||||
config.InfoDeviceAddress = item.InfoDeviceAddress;
|
||||
config.IsVirtualDevice = item.IsVirtualDevice;
|
||||
config.IsSelfCheckingValue = item.IsSelfCheckingValue;
|
||||
config.DecimalDigits = item.DecimalDigits;
|
||||
config.Coefficient = item.Coefficient;
|
||||
config.UpperLimit = item.UpperLimit;
|
||||
config.LowerLimit = item.LowerLimit;
|
||||
config.Unit = item.Unit;
|
||||
config.DataSourceCategory = (DataSourceCategoryEnum)item.DataSourceCategory;
|
||||
|
||||
var equipment = equipmentRepo.FirstOrDefault(t => t.Name == result["关联监控设备"].ToString());
|
||||
var equipmentType = equipmentTypeRepo.FirstOrDefault(t => t.Name == result["关联监控设备类型"].ToString());
|
||||
|
||||
if (equipment != null && equipmentType != null && equipment.EquipmentTypeId == equipmentType.Id)
|
||||
{
|
||||
config.EquipmentInfoId = equipment.Id;
|
||||
config.EquipmentTypeId = equipmentType.Id;
|
||||
}
|
||||
}
|
||||
|
||||
private TelemeteringConfiguration CreateTelemeteringConfiguration(TelemeteringConfigurationExcel item,
|
||||
JToken result, Guid? id, List<EquipmentInfo> equipmentRepo, List<EquipmentType> equipmentTypeRepo)
|
||||
{
|
||||
var config = new TelemeteringConfiguration
|
||||
{
|
||||
Name = item.Name,
|
||||
DispatcherAddress = item.DispatcherAddress,
|
||||
CPUSector = item.CPUSector,
|
||||
DeviceAddress = item.DeviceAddress,
|
||||
InfoAddress = item.InfoAddress,
|
||||
InfoCPUSector = item.InfoCPUSector,
|
||||
InfoDeviceAddress = item.InfoDeviceAddress,
|
||||
IsVirtualDevice = item.IsVirtualDevice,
|
||||
IsSelfCheckingValue = item.IsSelfCheckingValue,
|
||||
SeqNo = item.SeqNo,
|
||||
IsActive = item.IsActive,
|
||||
IsSave = item.IsSave,
|
||||
IsSendDispatcher = item.IsSendDispatcher,
|
||||
IsVisible = item.IsVisible,
|
||||
UpperLimit = item.UpperLimit,
|
||||
LowerLimit = item.LowerLimit,
|
||||
DecimalDigits = item.DecimalDigits,
|
||||
Coefficient = item.Coefficient,
|
||||
Unit = item.Unit,
|
||||
TransformerSubstationId = id,
|
||||
DataSourceCategory = (DataSourceCategoryEnum)item.DataSourceCategory
|
||||
};
|
||||
|
||||
var equipment = equipmentRepo.FirstOrDefault(t => t.Name == result["关联监控设备"].ToString());
|
||||
var equipmentType = equipmentTypeRepo.FirstOrDefault(t => t.Name == result["关联监控设备类型"].ToString());
|
||||
if (equipment != null && equipmentType != null && equipment.EquipmentTypeId == equipmentType.Id)
|
||||
{
|
||||
config.EquipmentInfoId = equipment.Id;
|
||||
config.EquipmentTypeId = equipmentType.Id;
|
||||
return config;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private async Task ProcessTelemeteringAlarmStrategies(IFormFile file, ExcelHandler excelRead, string ext,
|
||||
List<TelemeteringConfiguration> telemeteringRepo, List<DMAlarmCategory> dmalarmCategoryRepo)
|
||||
{
|
||||
try
|
||||
{
|
||||
var telemeteringAlarmStr = excelRead.ReadExcel(file.OpenReadStream(), "遥测报警", ext)?.ToString();
|
||||
if (telemeteringAlarmStr == null) return;
|
||||
|
||||
JObject rss = JObject.Parse(telemeteringAlarmStr);
|
||||
var results = rss["data"].Children().ToList();
|
||||
var existingStrategies = await _telemeteringAlarmStrategyResitory.GetAll().ToListAsync();
|
||||
|
||||
foreach (JToken result in results)
|
||||
{
|
||||
var item = result.ToObject<TelemeteringAlarmStrategyExcel>();
|
||||
if (!item.TelemeteringConfigurationId.HasValue && !string.IsNullOrWhiteSpace(item.TelemeteringConfigurationName))
|
||||
{
|
||||
var telemeterItem = telemeteringRepo.FirstOrDefault(t =>
|
||||
t.Name == item.TelemeteringConfigurationName &&
|
||||
t.EquipmentInfo?.Name == item.EquipmentInfoName);
|
||||
if (telemeterItem != null)
|
||||
{
|
||||
item.TelemeteringConfigurationId = telemeterItem.Id;
|
||||
}
|
||||
}
|
||||
|
||||
if (item.Id != null)
|
||||
{
|
||||
var entity = existingStrategies.FirstOrDefault(t => t.Id == item.Id);
|
||||
if (entity != null)
|
||||
{
|
||||
UpdateTelemeteringAlarmStrategy(entity, item);
|
||||
await _telemeteringAlarmStrategyResitory.UpdateAsync(entity);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await CreateTelemeteringAlarmStrategy(item, telemeteringRepo, dmalarmCategoryRepo);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log4Helper.Error(this.GetType(), "变电所管理服务-遥测报警导入", ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTelemeteringAlarmStrategy(TelemeteringAlarmStrategy entity, TelemeteringAlarmStrategyExcel item)
|
||||
{
|
||||
entity.SeqNo = (int)item.SeqNo;
|
||||
entity.IsActive = (bool)item.IsActive;
|
||||
entity.LastModificationTime = DateTime.Now;
|
||||
entity.LastModifierUserId = base.GetCurrentUser().Id;
|
||||
entity.MaxValue = (float)item.MaxValue;
|
||||
entity.MinValue = (float)item.MinValue;
|
||||
}
|
||||
|
||||
private async Task CreateTelemeteringAlarmStrategy(TelemeteringAlarmStrategyExcel item,
|
||||
List<TelemeteringConfiguration> telemeteringRepo, List<DMAlarmCategory> dmalarmCategoryRepo)
|
||||
{
|
||||
if (item.AlarmLevel == null || string.IsNullOrEmpty(item.AlarmName)) return;
|
||||
|
||||
var telemetering = telemeteringRepo.FirstOrDefault(t => t.Id == item.TelemeteringConfigurationId);
|
||||
if (telemetering == null) return;
|
||||
|
||||
var entity = new TelemeteringAlarmStrategy
|
||||
{
|
||||
SeqNo = (int)item.SeqNo,
|
||||
IsActive = (bool)item.IsActive,
|
||||
CreationTime = DateTime.Now,
|
||||
CreatorUserId = base.GetCurrentUser().Id,
|
||||
MaxValue = (float)item.MaxValue,
|
||||
MinValue = (float)item.MinValue,
|
||||
TelemeteringConfigurationId = telemetering.Id,
|
||||
Id = Guid.NewGuid()
|
||||
};
|
||||
|
||||
var dma = dmalarmCategoryRepo.FirstOrDefault(t => t.Name == item.AlarmName && t.Level == item.AlarmLevel);
|
||||
if (dma != null)
|
||||
{
|
||||
entity.DMAlarmCategoryId = dma.Id;
|
||||
await _telemeteringAlarmStrategyResitory.InsertAsync(entity);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ProcessTelesignalisationConfigurations(IFormFile file, ExcelHandler excelRead, string ext, Guid? id,
|
||||
List<EquipmentInfo> equipmentRepo, List<EquipmentType> equipmentTypeRepo,
|
||||
List<SelfCheckingConfiguration> selfCheckingConfigurationRepo, List<DMAlarmCategory> dmalarmCategoryRepo)
|
||||
{
|
||||
try
|
||||
{
|
||||
var telesignalStr = excelRead.ReadExcel(file.OpenReadStream(), "遥信", ext)?.ToString();
|
||||
if (telesignalStr == null) return;
|
||||
|
||||
JObject rss = JObject.Parse(telesignalStr);
|
||||
var results = rss["data"].Children().ToList();
|
||||
var existingConfigs = await _telesignalisationConfigurationResitory.GetAll().ToListAsync();
|
||||
|
||||
var entitiesToUpdate = new List<TelesignalisationConfiguration>();
|
||||
var entitiesToInsert = new List<TelesignalisationConfiguration>();
|
||||
|
||||
foreach (JToken result in results)
|
||||
{
|
||||
var item = result.ToObject<TelesignalisationConfigurationExcel>();
|
||||
if (string.IsNullOrEmpty(item.Name)) continue;
|
||||
|
||||
// 查找现有配置
|
||||
var existingConfig = existingConfigs.FirstOrDefault(t =>
|
||||
t.TransformerSubstationId == id &&
|
||||
t.EquipmentInfo?.Name == result["关联监控设备"].ToString() &&
|
||||
t.Name == item.Name);
|
||||
|
||||
if (existingConfig != null)
|
||||
{
|
||||
UpdateTelesignalisationConfiguration(existingConfig, item, result, equipmentRepo,
|
||||
equipmentTypeRepo, selfCheckingConfigurationRepo, dmalarmCategoryRepo);
|
||||
entitiesToUpdate.Add(existingConfig);
|
||||
}
|
||||
else
|
||||
{
|
||||
var newConfig = CreateTelesignalisationConfiguration(item, result, id, equipmentRepo,
|
||||
equipmentTypeRepo, selfCheckingConfigurationRepo, dmalarmCategoryRepo);
|
||||
if (newConfig != null)
|
||||
{
|
||||
entitiesToInsert.Add(newConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (entitiesToUpdate.Any())
|
||||
{
|
||||
_telesignalisationConfigurationResitory.GetDbContext().UpdateRange(entitiesToUpdate);
|
||||
}
|
||||
|
||||
if (entitiesToInsert.Any())
|
||||
{
|
||||
_telesignalisationConfigurationResitory.GetDbContext().AddRange(entitiesToInsert);
|
||||
}
|
||||
|
||||
await _telesignalisationConfigurationResitory.GetDbContext().SaveChangesAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log4Helper.Error(this.GetType(), "变电所管理服务-遥信导入", ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTelesignalisationConfiguration(TelesignalisationConfiguration config,
|
||||
TelesignalisationConfigurationExcel item, JToken result, List<EquipmentInfo> equipmentRepo,
|
||||
List<EquipmentType> equipmentTypeRepo, List<SelfCheckingConfiguration> selfCheckingConfigurationRepo,
|
||||
List<DMAlarmCategory> dmalarmCategoryRepo)
|
||||
{
|
||||
config.Name = item.Name;
|
||||
config.DispatcherAddress = item.DispatcherAddress;
|
||||
config.CPUSector = item.CPUSector;
|
||||
config.DeviceAddress = item.DeviceAddress;
|
||||
config.InfoAddress = item.InfoAddress;
|
||||
config.InfoCPUSector = item.InfoCPUSector;
|
||||
config.InfoDeviceAddress = item.InfoDeviceAddress;
|
||||
config.IsVirtualDevice = item.IsVirtualDevice;
|
||||
config.IsSelfCheckingValue = item.IsSelfCheckingValue;
|
||||
config.SeqNo = item.SeqNo;
|
||||
config.IsActive = item.IsActive;
|
||||
config.IsSave = item.IsSave;
|
||||
config.IsSendDispatcher = item.IsSendDispatcher;
|
||||
config.IsVisible = item.IsVisible;
|
||||
config.RemoteType = item.RemoteType;
|
||||
config.YesContent = item.YesContent;
|
||||
config.NoContent = item.NoContent;
|
||||
config.UnsurenessContent = string.IsNullOrWhiteSpace(item.UnsurenessContent) ? "不定" : item.UnsurenessContent;
|
||||
config.IsCommStatus = item.IsCommStatus;
|
||||
config.DataSourceCategory = (DataSourceCategoryEnum)item.DataSourceCategory;
|
||||
|
||||
if (item.DMAlarmCategoryId.HasValue)
|
||||
{
|
||||
var dm = dmalarmCategoryRepo.FirstOrDefault(t => t.Id == item.DMAlarmCategoryId);
|
||||
config.DMAlarmCategoryId = dm?.Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
var dm = dmalarmCategoryRepo.FirstOrDefault(t => t.Name == item.AlarmName && t.Level == item.AlarmLevel);
|
||||
config.DMAlarmCategoryId = dm?.Id;
|
||||
}
|
||||
|
||||
var selfChecking = selfCheckingConfigurationRepo.FirstOrDefault(t => t.Name == result["自检策略名称"].ToString());
|
||||
if (selfChecking != null)
|
||||
{
|
||||
config.SelfCheckingConfigurationId = selfChecking.Id;
|
||||
}
|
||||
|
||||
var equipment = equipmentRepo.FirstOrDefault(t => t.Name == result["关联监控设备"].ToString());
|
||||
var equipmentType = equipmentTypeRepo.FirstOrDefault(t => t.Name == result["关联监控设备类型"].ToString());
|
||||
if (equipment != null && equipmentType != null && equipment.EquipmentTypeId == equipmentType.Id)
|
||||
{
|
||||
config.EquipmentInfoId = equipment.Id;
|
||||
config.EquipmentTypeId = equipmentType.Id;
|
||||
}
|
||||
}
|
||||
|
||||
private TelesignalisationConfiguration CreateTelesignalisationConfiguration(TelesignalisationConfigurationExcel item,
|
||||
JToken result, Guid? id, List<EquipmentInfo> equipmentRepo, List<EquipmentType> equipmentTypeRepo,
|
||||
List<SelfCheckingConfiguration> selfCheckingConfigurationRepo, List<DMAlarmCategory> dmalarmCategoryRepo)
|
||||
{
|
||||
var config = new TelesignalisationConfiguration
|
||||
{
|
||||
Name = item.Name,
|
||||
DispatcherAddress = item.DispatcherAddress,
|
||||
CPUSector = item.CPUSector,
|
||||
DeviceAddress = item.DeviceAddress,
|
||||
InfoAddress = item.InfoAddress,
|
||||
InfoCPUSector = item.InfoCPUSector,
|
||||
InfoDeviceAddress = item.InfoDeviceAddress,
|
||||
IsVirtualDevice = item.IsVirtualDevice,
|
||||
IsSelfCheckingValue = item.IsSelfCheckingValue,
|
||||
SeqNo = item.SeqNo,
|
||||
IsActive = item.IsActive,
|
||||
IsSave = item.IsSave,
|
||||
IsSendDispatcher = item.IsSendDispatcher,
|
||||
IsVisible = item.IsVisible,
|
||||
RemoteType = item.RemoteType,
|
||||
YesContent = item.YesContent,
|
||||
NoContent = item.NoContent,
|
||||
UnsurenessContent = string.IsNullOrWhiteSpace(item.UnsurenessContent) ? "不定" : item.UnsurenessContent,
|
||||
IsCommStatus = item.IsCommStatus,
|
||||
TransformerSubstationId = id,
|
||||
DataSourceCategory = (DataSourceCategoryEnum)item.DataSourceCategory
|
||||
};
|
||||
|
||||
if (item.DMAlarmCategoryId.HasValue)
|
||||
{
|
||||
var dm = dmalarmCategoryRepo.FirstOrDefault(t => t.Id == item.DMAlarmCategoryId);
|
||||
config.DMAlarmCategoryId = dm?.Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
var dm = dmalarmCategoryRepo.FirstOrDefault(t => t.Name == item.AlarmName && t.Level == item.AlarmLevel);
|
||||
config.DMAlarmCategoryId = dm?.Id;
|
||||
}
|
||||
|
||||
var equipment = equipmentRepo.FirstOrDefault(t => t.Name == result["关联监控设备"].ToString());
|
||||
var equipmentType = equipmentTypeRepo.FirstOrDefault(t => t.Name == result["关联监控设备类型"].ToString());
|
||||
if (equipment != null && equipmentType != null && equipment.EquipmentTypeId == equipmentType.Id)
|
||||
{
|
||||
config.EquipmentInfoId = equipment.Id;
|
||||
config.EquipmentTypeId = equipmentType.Id;
|
||||
}
|
||||
|
||||
var selfChecking = selfCheckingConfigurationRepo.FirstOrDefault(t => t.Name == result["自检策略名称"].ToString());
|
||||
if (selfChecking != null)
|
||||
{
|
||||
config.SelfCheckingConfigurationId = selfChecking.Id;
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
private async Task ProcessTelecommandConfigurations(IFormFile file, ExcelHandler excelRead, string ext, Guid? id,
|
||||
List<EquipmentInfo> equipmentRepo, List<EquipmentType> equipmentTypeRepo)
|
||||
{
|
||||
try
|
||||
{
|
||||
var telecommandStr = excelRead.ReadExcel(file.OpenReadStream(), "遥控", ext)?.ToString();
|
||||
if (telecommandStr == null) return;
|
||||
|
||||
JObject rss = JObject.Parse(telecommandStr);
|
||||
var results = rss["data"].Children().ToList();
|
||||
var existingConfigs = await _telecommandConfigurationResitory.GetAll().ToListAsync();
|
||||
|
||||
foreach (JToken result in results)
|
||||
{
|
||||
var item = result.ToObject<TelecommandConfigurationExcel>();
|
||||
if (string.IsNullOrEmpty(item.Name)) continue;
|
||||
|
||||
// 查找现有配置
|
||||
var existingConfig = existingConfigs.FirstOrDefault(t =>
|
||||
t.TransformerSubstationId == id &&
|
||||
t.EquipmentInfo?.Name == result["关联监控设备"].ToString() &&
|
||||
t.Name == item.Name);
|
||||
|
||||
if (existingConfig != null)
|
||||
{
|
||||
UpdateTelecommandConfiguration(existingConfig, item, result, equipmentRepo, equipmentTypeRepo);
|
||||
await _telecommandConfigurationResitory.UpdateAsync(existingConfig);
|
||||
}
|
||||
else
|
||||
{
|
||||
var newConfig = CreateTelecommandConfiguration(item, result, id, equipmentRepo, equipmentTypeRepo);
|
||||
if (newConfig != null)
|
||||
{
|
||||
await _telecommandConfigurationResitory.InsertAsync(newConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log4Helper.Error(this.GetType(), "变电所管理服务-遥控导入", ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTelecommandConfiguration(TelecommandConfiguration config, TelecommandConfigurationExcel item,
|
||||
JToken result, List<EquipmentInfo> equipmentRepo, List<EquipmentType> equipmentTypeRepo)
|
||||
{
|
||||
config.Name = item.Name;
|
||||
config.DispatcherAddress = item.DispatcherAddress;
|
||||
config.CPUSector = item.CPUSector;
|
||||
config.DeviceAddress = item.DeviceAddress;
|
||||
config.InfoAddress = item.InfoAddress;
|
||||
config.InfoCPUSector = item.InfoCPUSector;
|
||||
config.InfoDeviceAddress = item.InfoDeviceAddress;
|
||||
config.IsVirtualDevice = item.IsVirtualDevice;
|
||||
config.SeqNo = item.SeqNo;
|
||||
config.IsActive = item.IsActive;
|
||||
config.IsSave = item.IsSave;
|
||||
config.IsSendDispatcher = item.IsSendDispatcher;
|
||||
config.IsVisible = item.IsVisible;
|
||||
config.RemoteType = item.RemoteType;
|
||||
config.YesContent = item.YesContent;
|
||||
config.NoContent = item.NoContent;
|
||||
config.UnsurenessContent = string.IsNullOrWhiteSpace(item.UnsurenessContent) ? "不定" : item.UnsurenessContent;
|
||||
config.RelatedTelesignalisationId = item.RelatedTelesignalisationId;
|
||||
|
||||
var equipment = equipmentRepo.FirstOrDefault(t => t.Name == result["关联监控设备"].ToString());
|
||||
var equipmentType = equipmentTypeRepo.FirstOrDefault(t => t.Name == result["关联监控设备类型"].ToString());
|
||||
if (equipment != null && equipmentType != null)
|
||||
{
|
||||
if (equipment.EquipmentTypeId == equipmentType.Id)
|
||||
{
|
||||
if (config.EquipmentInfoId != equipment.Id)
|
||||
{
|
||||
config.EquipmentInfoId = equipment.Id;
|
||||
}
|
||||
if (config.EquipmentTypeId != equipmentType.Id)
|
||||
{
|
||||
config.EquipmentTypeId = equipmentType.Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private TelecommandConfiguration CreateTelecommandConfiguration(TelecommandConfigurationExcel item,
|
||||
JToken result, Guid? id, List<EquipmentInfo> equipmentRepo, List<EquipmentType> equipmentTypeRepo)
|
||||
{
|
||||
var config = new TelecommandConfiguration
|
||||
{
|
||||
Name = item.Name,
|
||||
DispatcherAddress = item.DispatcherAddress,
|
||||
CPUSector = item.CPUSector,
|
||||
DeviceAddress = item.DeviceAddress,
|
||||
InfoAddress = item.InfoAddress,
|
||||
InfoCPUSector = item.InfoCPUSector,
|
||||
InfoDeviceAddress = item.InfoDeviceAddress,
|
||||
IsVirtualDevice = item.IsVirtualDevice,
|
||||
SeqNo = item.SeqNo,
|
||||
IsActive = item.IsActive,
|
||||
IsSave = item.IsSave,
|
||||
IsSendDispatcher = item.IsSendDispatcher,
|
||||
IsVisible = item.IsVisible,
|
||||
RemoteType = item.RemoteType,
|
||||
YesContent = item.YesContent,
|
||||
NoContent = item.NoContent,
|
||||
UnsurenessContent = item.UnsurenessContent,
|
||||
RelatedTelesignalisationId = item.RelatedTelesignalisationId,
|
||||
TransformerSubstationId = id
|
||||
};
|
||||
|
||||
var equipment = equipmentRepo.FirstOrDefault(t => t.Name == result["关联监控设备"].ToString());
|
||||
var equipmentType = equipmentTypeRepo.FirstOrDefault(t => t.Name == result["关联监控设备类型"].ToString());
|
||||
if (equipment != null && equipmentType != null)
|
||||
{
|
||||
if (equipment.EquipmentTypeId == equipmentType.Id)
|
||||
{
|
||||
if (config.EquipmentInfoId != equipment.Id)
|
||||
{
|
||||
config.EquipmentInfoId = equipment.Id;
|
||||
}
|
||||
if (config.EquipmentTypeId != equipmentType.Id)
|
||||
{
|
||||
config.EquipmentTypeId = equipmentType.Id;
|
||||
}
|
||||
return config;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// ... existing code ...
|
||||
#endregion 数据配置导入导出
|
||||
|
||||
#region 基础数据文件
|
||||
|
@ -5,6 +5,7 @@ using Abp.Domain.Repositories;
|
||||
using Abp.Domain.Uow;
|
||||
using Abp.Extensions;
|
||||
using Abp.Linq.Extensions;
|
||||
using Abp.UI;
|
||||
using Castle.Core.Resource;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
@ -874,7 +875,7 @@ namespace YunDa.ISAS.Application.VideoSurveillance
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Audited, Description("导入摄像头信息")]
|
||||
public RequestEasyResult ImportExcelData([FromForm] IFormCollection formCollection, [FromQuery] Guid? id)
|
||||
public RequestEasyResult ImportExcelDataOld([FromForm] IFormCollection formCollection, [FromQuery] Guid? id)
|
||||
{
|
||||
RequestEasyResult requestEasyResult = new RequestEasyResult();
|
||||
FormFileCollection fileCollection = (FormFileCollection)formCollection.Files;
|
||||
@ -1100,6 +1101,357 @@ namespace YunDa.ISAS.Application.VideoSurveillance
|
||||
return requestEasyResult;
|
||||
}
|
||||
|
||||
[HttpPost, Audited, Description("导入摄像头信息与预置位信息")]
|
||||
public RequestEasyResult ImportExcelData([FromForm] IFormCollection formCollection, [FromQuery] Guid? id)
|
||||
{
|
||||
var requestEasyResult = new RequestEasyResult { Flag = false };
|
||||
var currentUser = base.GetCurrentUser();
|
||||
|
||||
try
|
||||
{
|
||||
// 参数验证
|
||||
if (formCollection?.Files == null || !(formCollection.Files is FormFileCollection fileCollection) || fileCollection.Count == 0)
|
||||
{
|
||||
requestEasyResult.Message = "请上传有效的Excel文件";
|
||||
return requestEasyResult;
|
||||
}
|
||||
|
||||
var excelFile = fileCollection[0];
|
||||
var fileExtension = Path.GetExtension(excelFile.FileName).TrimStart('.');
|
||||
|
||||
// 处理摄像头数据
|
||||
ProcessCameraData(excelFile.OpenReadStream(), id, currentUser, fileExtension);
|
||||
|
||||
// 处理预置位数据
|
||||
ProcessPresetPointData(excelFile.OpenReadStream(), id, currentUser, fileExtension);
|
||||
|
||||
requestEasyResult.Flag = true;
|
||||
UpdateRedisVideoData();
|
||||
}
|
||||
catch (UserFriendlyException ex)
|
||||
{
|
||||
requestEasyResult.Message = ex.Message;
|
||||
Log4Helper.Warn(GetType(), $"业务校验异常: {ex.Message}", ex);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
requestEasyResult.Message = "系统处理过程中发生错误";
|
||||
Log4Helper.Error(GetType(), "导入数据异常", ex);
|
||||
}
|
||||
|
||||
return requestEasyResult;
|
||||
}
|
||||
|
||||
#region 摄像头处理
|
||||
private void ProcessCameraData(Stream excelStream, Guid? substationId, LoginUserOutput currentUser, string fileExtension)
|
||||
{
|
||||
excelStream.Position = 0;
|
||||
var excelHandler = new VideoCameraImportExcelHandle();
|
||||
var jsonData = excelHandler.ReadExcel(excelStream, "摄像头表格", fileExtension)?.ToString();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(jsonData)) return;
|
||||
|
||||
var cameraList = JObject.Parse(jsonData)["data"]?
|
||||
.ToObject<List<VideoCameraExcel>>()
|
||||
.Where(IsValidCameraRecord)
|
||||
.ToList();
|
||||
|
||||
if (cameraList == null || cameraList.Count == 0) return;
|
||||
|
||||
// 预加载数据
|
||||
var existingCameras = _videoDevRepository.GetAll()
|
||||
.Where(x => x.TransformerSubstationId == substationId)
|
||||
.ToList();
|
||||
|
||||
var cameraById = existingCameras.ToDictionary(x => x.Id);
|
||||
var cameraByName = existingCameras.ToDictionary(x => x.DevName, StringComparer.OrdinalIgnoreCase);
|
||||
var manufacturers = _manufacturerInfoRepository.GetAll()
|
||||
.ToDictionary(x => x.ManufacturerName, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
foreach (var excelItem in cameraList)
|
||||
{
|
||||
VideoDev targetCamera = null;
|
||||
|
||||
// 优先通过ID查找
|
||||
if (excelItem.Id.HasValue)
|
||||
{
|
||||
cameraById.TryGetValue(excelItem.Id.Value, out targetCamera);
|
||||
}
|
||||
if (targetCamera==null)
|
||||
{
|
||||
cameraByName.TryGetValue(excelItem.DevName, out targetCamera);
|
||||
|
||||
}
|
||||
|
||||
if (targetCamera != null)
|
||||
{
|
||||
UpdateExistingCamera(targetCamera, excelItem, manufacturers);
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateNewCamera(excelItem, substationId, manufacturers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsValidCameraRecord(VideoCameraExcel item)
|
||||
{
|
||||
return !string.IsNullOrWhiteSpace(item.ManufacturerInfoName)
|
||||
&& !string.IsNullOrWhiteSpace(item.VideoDevName)
|
||||
&& !string.IsNullOrWhiteSpace(item.DevName)
|
||||
&& !string.IsNullOrWhiteSpace(item.DevTypeName)
|
||||
&& !string.IsNullOrWhiteSpace(item.CodeStreamTypeName)
|
||||
&& item.ChannelNo.HasValue
|
||||
&& item.DevNo.HasValue;
|
||||
}
|
||||
|
||||
private void UpdateExistingCamera(VideoDev entity, VideoCameraExcel item, Dictionary<string, ManufacturerInfo> manufacturerDict)
|
||||
{
|
||||
var nvrDevice = FindNvrDevice(item.VideoDevName);
|
||||
if (nvrDevice == null) return;
|
||||
|
||||
entity.VideoDevId = nvrDevice.Id;
|
||||
entity.IP = item.IP;
|
||||
entity.SeqNo = item.SeqNo;
|
||||
entity.Port = item.Port;
|
||||
entity.InstallationArea = item.InstallationArea;
|
||||
entity.ChannelNo = item.ChannelNo;
|
||||
entity.DevName = item.DevName;
|
||||
entity.DevCode = item.DevCode;
|
||||
entity.DevNo = item.DevNo;
|
||||
entity.DevPassword = item.DevPassword;
|
||||
entity.DevUserName = item.DevUserName;
|
||||
entity.IsActive = item.IsActive;
|
||||
entity.PostionDescription = item.PostionDescription;
|
||||
entity.IsPTZ = item.IsPTZ;
|
||||
|
||||
if (manufacturerDict.TryGetValue(item.ManufacturerInfoName, out var manufacturer))
|
||||
{
|
||||
entity.ManufacturerInfoId = manufacturer.Id;
|
||||
}
|
||||
|
||||
entity.CodeStreamType = GetEnumByDescription<CodeStreamTypeEnum>(item.CodeStreamTypeName);
|
||||
entity.DevType = GetEnumByDescription<VideoDevTypeEnum>(item.DevTypeName);
|
||||
|
||||
_videoDevRepository.Update(entity);
|
||||
}
|
||||
|
||||
private void CreateNewCamera(VideoCameraExcel item, Guid? substationId, Dictionary<string, ManufacturerInfo> manufacturerDict)
|
||||
{
|
||||
var nvrDevice = FindNvrDevice(item.VideoDevName);
|
||||
if (nvrDevice == null) return;
|
||||
|
||||
var newCamera = new VideoDev
|
||||
{
|
||||
VideoDevId = nvrDevice.Id,
|
||||
TransformerSubstationId = substationId,
|
||||
IP = item.IP,
|
||||
SeqNo = item.SeqNo,
|
||||
Port = item.Port,
|
||||
InstallationArea = item.InstallationArea,
|
||||
ChannelNo = item.ChannelNo,
|
||||
DevName = item.DevName,
|
||||
DevCode = item.DevCode,
|
||||
DevNo = item.DevNo,
|
||||
DevPassword = item.DevPassword,
|
||||
DevUserName = item.DevUserName,
|
||||
IsActive = item.IsActive,
|
||||
PostionDescription = item.PostionDescription,
|
||||
IsPTZ = item.IsPTZ,
|
||||
CodeStreamType = GetEnumByDescription<CodeStreamTypeEnum>(item.CodeStreamTypeName),
|
||||
DevType = GetEnumByDescription<VideoDevTypeEnum>(item.DevTypeName)
|
||||
};
|
||||
|
||||
if (manufacturerDict.TryGetValue(item.ManufacturerInfoName, out var manufacturer))
|
||||
{
|
||||
newCamera.ManufacturerInfoId = manufacturer.Id;
|
||||
}
|
||||
|
||||
_videoDevRepository.Insert(newCamera);
|
||||
}
|
||||
|
||||
private VideoDev FindNvrDevice(string videoDevName)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(videoDevName)) return null;
|
||||
return _videoDevRepository.FirstOrDefault(x => x.DevName == videoDevName);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 预置位处理
|
||||
private void ProcessPresetPointData(Stream excelStream, Guid? substationId, LoginUserOutput currentUser, string fileExtension)
|
||||
{
|
||||
excelStream.Position = 0;
|
||||
var excelHandler = new VideoCameraImportExcelHandle();
|
||||
var jsonData = excelHandler.ReadExcel(excelStream, "预置位表", fileExtension)?.ToString();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(jsonData)) return;
|
||||
|
||||
var presetList = JObject.Parse(jsonData)["data"]?
|
||||
.ToObject<List<PresetPointExcel>>()
|
||||
.Where(IsValidPresetPoint)
|
||||
.ToList();
|
||||
|
||||
if (presetList == null || presetList.Count == 0) return;
|
||||
|
||||
// 预加载数据
|
||||
var existingPresetPoints = _presetPointRepository.GetAllIncluding(
|
||||
p => p.VideoDev,
|
||||
p => p.EquipmentInfo,
|
||||
p => p.EquipmentType,
|
||||
p => p.EquipmentViewPoint
|
||||
).ToList();
|
||||
|
||||
var cameras = _videoDevRepository.GetAll()
|
||||
.Where(x => x.TransformerSubstationId == substationId)
|
||||
.ToList();
|
||||
|
||||
var presetById = existingPresetPoints.ToDictionary(x => x.Id);
|
||||
var presetByCameraAndNumber = existingPresetPoints
|
||||
.Where(x => x.VideoDev != null)
|
||||
.ToDictionary(x => new PresetKey(x.VideoDev.DevName, x.Number));
|
||||
|
||||
var equipmentDict = _equipmentInfoRepository.GetAll()
|
||||
.Where(x => x.TransformerSubstationId == substationId)
|
||||
.ToDictionary(x => x.Name, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
var equipmentTypeDict = _equipmentTypeRepository.GetAll()
|
||||
.ToDictionary(x => x.Name, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
var viewPointDict = _equipmentViewPointRepository.GetAll()
|
||||
.ToDictionary(x => x.Name, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
foreach (var excelItem in presetList)
|
||||
{
|
||||
PresetPoint targetPreset = null;
|
||||
|
||||
// 优先通过ID查找
|
||||
if (excelItem.Id.HasValue)
|
||||
{
|
||||
presetById.TryGetValue(excelItem.Id.Value, out targetPreset);
|
||||
}
|
||||
if (targetPreset == null)
|
||||
{
|
||||
var key = new PresetKey(excelItem.CameraName, excelItem.Number.Value);
|
||||
presetByCameraAndNumber.TryGetValue(key, out targetPreset);
|
||||
}
|
||||
|
||||
|
||||
if (targetPreset != null)
|
||||
{
|
||||
UpdateExistingPreset(targetPreset, excelItem, equipmentDict, equipmentTypeDict, viewPointDict, currentUser);
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateNewPreset(excelItem, cameras, equipmentDict, equipmentTypeDict, viewPointDict, currentUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class PresetKey
|
||||
{
|
||||
public string CameraName { get; }
|
||||
public int Number { get; }
|
||||
|
||||
public PresetKey(string cameraName, int number)
|
||||
{
|
||||
CameraName = cameraName;
|
||||
Number = number;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return obj is PresetKey other &&
|
||||
CameraName == other.CameraName &&
|
||||
Number == other.Number;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(CameraName, Number);
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsValidPresetPoint(PresetPointExcel item)
|
||||
{
|
||||
return !string.IsNullOrWhiteSpace(item.CameraName)
|
||||
&& item.Number.HasValue
|
||||
;
|
||||
}
|
||||
|
||||
private void UpdateExistingPreset(PresetPoint entity, PresetPointExcel item,
|
||||
Dictionary<string, EquipmentInfo> equipmentDict,
|
||||
Dictionary<string, EquipmentType> equipmentTypeDict,
|
||||
Dictionary<string, EquipmentViewPoint> viewPointDict,
|
||||
LoginUserOutput currentUser)
|
||||
{
|
||||
entity.Name = item.PresetName;
|
||||
entity.Number = item.Number.Value;
|
||||
entity.IsImageRecognition = item.IsImageRecognition.Value;
|
||||
entity.SeqNo = int.TryParse(item.SeqNo, out int seqNo) ? seqNo : 0;
|
||||
entity.LastModificationTime = DateTime.Now;
|
||||
entity.LastModifierUserId = currentUser.Id;
|
||||
entity.Remark = "批量修改";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(item.EquipmentInfoName) && equipmentDict.TryGetValue(item.EquipmentInfoName, out var equipment))
|
||||
{
|
||||
entity.EquipmentInfoId = equipment.Id;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(item.EquipmentTypeName) && equipmentTypeDict.TryGetValue(item.EquipmentTypeName, out var equipmentType))
|
||||
{
|
||||
entity.EquipmentTypeId = equipmentType.Id;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(item.ViewPointName) && viewPointDict.TryGetValue(item.ViewPointName, out var viewPoint))
|
||||
{
|
||||
entity.EquipmentViewPointId = viewPoint.Id;
|
||||
}
|
||||
|
||||
_presetPointRepository.Update(entity);
|
||||
}
|
||||
|
||||
private void CreateNewPreset(PresetPointExcel item, List<VideoDev> cameras,
|
||||
Dictionary<string, EquipmentInfo> equipmentDict,
|
||||
Dictionary<string, EquipmentType> equipmentTypeDict,
|
||||
Dictionary<string, EquipmentViewPoint> viewPointDict,
|
||||
LoginUserOutput currentUser)
|
||||
{
|
||||
var camera = cameras.FirstOrDefault(x => x.DevName == item.CameraName);
|
||||
if (camera == null) return;
|
||||
|
||||
var newPreset = new PresetPoint
|
||||
{
|
||||
VideoDevId = camera.Id,
|
||||
Name = item.PresetName,
|
||||
Number = item.Number.Value,
|
||||
IsImageRecognition = item.IsImageRecognition.Value,
|
||||
SeqNo = int.TryParse(item.SeqNo, out int seqNo) ? seqNo : 0,
|
||||
CreationTime = DateTime.Now,
|
||||
CreatorUserId = currentUser.Id,
|
||||
Remark = "批量新增",
|
||||
IsActive = true
|
||||
};
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(item.EquipmentInfoName) && equipmentDict.TryGetValue(item.EquipmentInfoName, out var equipment))
|
||||
{
|
||||
newPreset.EquipmentInfoId = equipment.Id;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(item.EquipmentTypeName) && equipmentTypeDict.TryGetValue(item.EquipmentTypeName, out var equipmentType))
|
||||
{
|
||||
newPreset.EquipmentTypeId = equipmentType.Id;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(item.ViewPointName) && viewPointDict.TryGetValue(item.ViewPointName, out var viewPoint))
|
||||
{
|
||||
newPreset.EquipmentViewPointId = viewPoint.Id;
|
||||
}
|
||||
|
||||
_presetPointRepository.Insert(newPreset);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 导出摄像头数据
|
||||
/// </summary>
|
||||
|
@ -2565,7 +2565,7 @@
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:YunDa.ISAS.Application.VideoSurveillance.VideoDevAppService.ImportExcelData(Microsoft.AspNetCore.Http.IFormCollection,System.Nullable{System.Guid})">
|
||||
<member name="M:YunDa.ISAS.Application.VideoSurveillance.VideoDevAppService.ImportExcelDataOld(Microsoft.AspNetCore.Http.IFormCollection,System.Nullable{System.Guid})">
|
||||
<summary>
|
||||
导入摄像头信息
|
||||
</summary>
|
||||
@ -2645,6 +2645,14 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:YunDa.ISAS.Application.GeneralInformation.EquipmentIndicatorConfigAppService.CreateOrUpdateAsync(YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto.EditEquipmentIndicatorConfigInput)">
|
||||
<summary>
|
||||
指标配置增加或修改
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.ArgumentNullException"></exception>
|
||||
</member>
|
||||
<member name="T:YunDa.ISAS.Application.GeneralInformation.EquipmentInfoAppService">
|
||||
<summary>
|
||||
设备信息
|
||||
@ -3871,18 +3879,6 @@
|
||||
<param name="equipmentInfoId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:YunDa.ISAS.Application.GeneralInformation.ProtectionDeviceAppService.UpdateProtetionInfoForTest">
|
||||
<summary>
|
||||
填充出厂编号
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:YunDa.ISAS.Application.GeneralInformation.ProtectionDeviceAppService.UpdateProtetionInfoForHistoryTest">
|
||||
<summary>
|
||||
填充出厂编号
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:YunDa.ISAS.Application.GeneralInformation.ProtectionDeviceAppService.SpawnDeviceinfoHistory">
|
||||
<summary>
|
||||
生成装置的初始历史记录
|
||||
@ -3998,12 +3994,6 @@
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:YunDa.ISAS.Application.GeneralInformation.SecondaryCircuitInfo.SecondaryCircuitAppService.GenerateSecondaryCircuitTestData">
|
||||
<summary>
|
||||
生成10个测试回路信息
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:YunDa.ISAS.Application.GeneralInformation.SecondaryCircuitInfo.SecondaryCircuitLogicExpressionAppService">
|
||||
<summary>
|
||||
二次回路逻辑表达式类
|
||||
@ -4315,7 +4305,7 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:YunDa.ISAS.Application.GeneralInformation.TransformerSubstationAppService.ImportTeleConfigurationExcelAsync(Microsoft.AspNetCore.Http.IFormCollection,System.Nullable{System.Guid})">
|
||||
<member name="M:YunDa.ISAS.Application.GeneralInformation.TransformerSubstationAppService.ImportTeleConfigurationExcelOldAsync(Microsoft.AspNetCore.Http.IFormCollection,System.Nullable{System.Guid})">
|
||||
<summary>
|
||||
导入遥测、遥信、遥控配置文档,并修改数据库对应配置项
|
||||
</summary>
|
||||
|
@ -0,0 +1,30 @@
|
||||
using Abp.AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using YunDa.ISAS.Entities.AuditCommon;
|
||||
using YunDa.ISAS.Entities.CommonDto;
|
||||
using YunDa.SOMS.Entities.GeneralInformation;
|
||||
|
||||
namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto
|
||||
{
|
||||
[AutoMapTo(typeof(EquipmentIndicatorComment))]
|
||||
public class EditEquipmentIndicatorCommentInput
|
||||
{
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// 顺序号
|
||||
/// </summary>
|
||||
public virtual int SeqNo { get; set; }
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public virtual string Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 是否在用
|
||||
/// </summary>
|
||||
public virtual bool IsActive { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
using Abp.AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using YunDa.ISAS.Entities.AuditCommon;
|
||||
using YunDa.ISAS.Entities.CommonDto;
|
||||
using YunDa.SOMS.Entities.GeneralInformation;
|
||||
|
||||
namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto
|
||||
{
|
||||
[AutoMapTo(typeof(EquipmentIndicatorConfig))]
|
||||
public class EditEquipmentIndicatorConfigInput : ISASAuditedEntityDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 顺序号
|
||||
/// </summary>
|
||||
public virtual int SeqNo { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string CalculationFormula { get; set; }
|
||||
public virtual decimal Weight { get; set; }
|
||||
public virtual decimal DataPrecision { get; set; }
|
||||
public virtual decimal Value { get; set; }
|
||||
/// <summary>
|
||||
/// 所属设别类别
|
||||
/// </summary>
|
||||
public virtual Guid? EquipmentTypeId { get; set; }
|
||||
public virtual bool IsActive { get; set; }
|
||||
public virtual string Remark { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
using Abp.AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text;
|
||||
using YunDa.ISAS.Entities.GeneralInformation;
|
||||
using YunDa.SOMS.Entities.GeneralInformation;
|
||||
using Abp.Application.Services.Dto;
|
||||
namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto
|
||||
{
|
||||
[AutoMapFrom(typeof(EquipmentIndicatorConfig))]
|
||||
public class EquipmentIndicatorConfigOutput : EntityDto<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// 顺序号
|
||||
/// </summary>
|
||||
public virtual int SeqNo { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string CalculationFormula { get; set; }
|
||||
public virtual decimal Weight { get; set; }
|
||||
public virtual decimal DataPrecision { get; set; }
|
||||
public virtual decimal Value { get; set; }
|
||||
/// <summary>
|
||||
/// 所属设别类别
|
||||
/// </summary>
|
||||
public virtual Guid? EquipmentTypeId { get; set; }
|
||||
public virtual bool IsActive { get; set; }
|
||||
public virtual string Remark { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using YunDa.ISAS.DataTransferObject.CommonDto;
|
||||
|
||||
namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto
|
||||
{
|
||||
public class EquipmentIndicatorConfigSearchConditionInput : ISASMySQLSearchInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备名称
|
||||
/// </summary>
|
||||
public virtual string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属设备类别Id
|
||||
/// </summary>
|
||||
public virtual Guid? EquipmentTypeId { get; set; }
|
||||
public bool? IsActive { get; set; }
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData
|
||||
namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto
|
||||
{
|
||||
public class ConstantModel
|
||||
{
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData
|
||||
namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto
|
||||
{
|
||||
public class EquimentOverviewOutput
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto;
|
||||
namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData
|
||||
namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto
|
||||
{
|
||||
public class EquipmentDataModel : MonitoringEquipmentInfoOutput
|
||||
{
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YunDa.SOMS.DataTransferObject.EquipmentLiveData
|
||||
namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 诊断结果
|
||||
@ -52,7 +52,7 @@ namespace YunDa.SOMS.DataTransferObject.EquipmentLiveData
|
||||
/// 建议内容
|
||||
/// </summary>
|
||||
public string Suggest { get; set; }
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 点位数据
|
@ -5,11 +5,11 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YunDa.SOMS.DataTransferObject.EquipmentLiveData
|
||||
namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto
|
||||
{
|
||||
public class NJJWPP
|
||||
{
|
||||
[JsonProperty("设备名称")]public string DeviceName { get; set; }
|
||||
[JsonProperty("设备名称")] public string DeviceName { get; set; }
|
||||
public int UID { get; set; }
|
||||
[JsonProperty("描述")] public string Description { get; set; }
|
||||
}
|
@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
using static Google.Protobuf.WellKnownTypes.Field.Types;
|
||||
using Yunda.ISAS.MongoDB.Entities.DataMonitoring;
|
||||
|
||||
namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData
|
||||
namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto
|
||||
{
|
||||
[AutoMapTo(typeof(TelemeteringHourStatisticsResult))]
|
||||
public class TelemeteringHourStatisticsModel
|
@ -6,7 +6,7 @@ using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringAlarmStrategyDto;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringConfigurationDto;
|
||||
using YunDa.SOMS.DataTransferObject;
|
||||
|
||||
namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData
|
||||
namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto
|
||||
{
|
||||
[MessagePackObject(keyAsPropertyName: true)]
|
||||
public class TelemeteringModel : TelemeteringConfigurationProperty
|
||||
@ -73,7 +73,7 @@ namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData
|
||||
/// 获取当前 值 触发的报警策略
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
|
||||
public TelemeteringAlarmStrategyProperty AnalysisAlarm()
|
||||
{
|
||||
TelemeteringAlarmStrategyProperty alarmStrategy = null;
|
@ -4,7 +4,7 @@ using YunDa.ISAS.DataTransferObject.DataMonitoring.TelesignalisationConfiguratio
|
||||
using YunDa.ISAS.Entities.DataMonitoring;
|
||||
using YunDa.SOMS.DataTransferObject;
|
||||
|
||||
namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData
|
||||
namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto
|
||||
{
|
||||
[MessagePackObject(keyAsPropertyName: true)]
|
||||
public class TelesignalisationModel : TelesignalisationConfigurationProperty
|
||||
@ -15,7 +15,7 @@ namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData
|
||||
///
|
||||
/// </summary>
|
||||
public int ResultValue { get; set; } = ConstantModel.DegaultValue;
|
||||
public bool IsSendSelfCheck { get; set; }
|
||||
public bool IsSendSelfCheck { get; set; }
|
||||
|
||||
public virtual string ResultValueStr
|
||||
{
|
||||
@ -73,7 +73,7 @@ namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData
|
||||
/// <summary>
|
||||
/// 遥信是否报警
|
||||
/// </summary>
|
||||
|
||||
|
||||
public bool IsAlarm
|
||||
{
|
||||
get
|
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto
|
||||
{
|
||||
public class VoiceprintData
|
||||
{
|
||||
[JsonPropertyName("voiceprint_id")]
|
||||
public string VoiceprintId { get; set; }
|
||||
|
||||
[JsonPropertyName("saved_path")]
|
||||
public string SavedPath { get; set; }
|
||||
|
||||
[JsonPropertyName("image_saved")]
|
||||
public bool ImageSaved { get; set; }
|
||||
|
||||
[JsonPropertyName("timestamp")]
|
||||
public DateTime Timestamp { get; set; }
|
||||
|
||||
[JsonPropertyName("frequency_peak")]
|
||||
public int FrequencyPeak { get; set; }
|
||||
|
||||
[JsonPropertyName("amplitude_range")]
|
||||
public double[] AmplitudeRange { get; set; }
|
||||
|
||||
[JsonPropertyName("metadata")]
|
||||
public VoiceprintMetadata Metadata { get; set; }
|
||||
}
|
||||
|
||||
public class VoiceprintMetadata
|
||||
{
|
||||
[JsonPropertyName("device_id")]
|
||||
public string DeviceId { get; set; }
|
||||
|
||||
[JsonPropertyName("sample_rate")]
|
||||
public int SampleRate { get; set; }
|
||||
}
|
||||
}
|
@ -5639,140 +5639,6 @@
|
||||
是否在用
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.EquimentOverviewOutput.SeqNo">
|
||||
<summary>
|
||||
序号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.EquimentOverviewOutput.TypeName">
|
||||
<summary>
|
||||
类型名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.EquimentOverviewOutput.Count">
|
||||
<summary>
|
||||
总数量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.EquimentOverviewOutput.LineCount">
|
||||
<summary>
|
||||
在线数量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.EquimentOverviewOutput.Description">
|
||||
<summary>
|
||||
描述
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.EquimentOverviewOutput.IsVisable">
|
||||
<summary>
|
||||
是否显示
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.EquipmentDataModel.Telemeterings">
|
||||
<summary>
|
||||
遥测数据List
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.EquipmentDataModel.Telesignalisations">
|
||||
<summary>
|
||||
遥信数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringHourStatisticsModel.Min">
|
||||
<summary>
|
||||
结果最小值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringHourStatisticsModel.Max">
|
||||
<summary>
|
||||
结果最大值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringHourStatisticsModel.First">
|
||||
<summary>
|
||||
小时之内第一个值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringHourStatisticsModel.Last">
|
||||
<summary>
|
||||
小时之内最后一个值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringHourStatisticsModel.AVG">
|
||||
<summary>
|
||||
小时之内平均值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringHourStatisticsModel.StatisticsCount">
|
||||
<summary>
|
||||
统计数量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringHourStatisticsModel._statisticsDateTime">
|
||||
<summary>
|
||||
时间,格式("yyyy-MM-dd HH")
|
||||
</summary>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringHourStatisticsModel.StatisticsDateTime" -->
|
||||
<member name="M:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringHourStatisticsModel.InitValue">
|
||||
<summary>
|
||||
初始化数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringModel.ResultValue">
|
||||
<summary>
|
||||
测量结果值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringModel.LastResultValue">
|
||||
<summary>
|
||||
上次结果值测量结果值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringModel.ResultTime">
|
||||
<summary>
|
||||
测量时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringModel.AlarmLevel">
|
||||
<summary>
|
||||
报警等级
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringModel.LastAlarmLevel">
|
||||
<summary>
|
||||
上次报警等级
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringModel.TelemeteringAlarmStrategys">
|
||||
<summary>
|
||||
报警策略
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelemeteringModel.AnalysisAlarm">
|
||||
<summary>
|
||||
获取当前 值 触发的报警策略
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelesignalisationModel.ResultValue">
|
||||
<summary>
|
||||
单点 测量结果值1:合;0:分;其它:非法值
|
||||
双点 测量结果值0:不定;1:分;2:合;其它:非法值
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelesignalisationModel.ResultTime">
|
||||
<summary>
|
||||
测量时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.EquipmentLiveData.TelesignalisationModel.IsAlarm">
|
||||
<summary>
|
||||
遥信是否报警
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentDataCategoryDto.EditEquipmentDataCategoryInput.SeqNo">
|
||||
<summary>
|
||||
顺序号
|
||||
@ -14572,51 +14438,230 @@
|
||||
诊断数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YunDa.SOMS.DataTransferObject.EquipmentLiveData.EquipmentInfoDiagnoseResult">
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto.EditEquipmentIndicatorCommentInput.SeqNo">
|
||||
<summary>
|
||||
顺序号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto.EditEquipmentIndicatorCommentInput.Remark">
|
||||
<summary>
|
||||
备注
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto.EditEquipmentIndicatorCommentInput.IsActive">
|
||||
<summary>
|
||||
是否在用
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto.EditEquipmentIndicatorConfigInput.SeqNo">
|
||||
<summary>
|
||||
顺序号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto.EditEquipmentIndicatorConfigInput.EquipmentTypeId">
|
||||
<summary>
|
||||
所属设别类别
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto.EquipmentIndicatorConfigOutput.SeqNo">
|
||||
<summary>
|
||||
顺序号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto.EquipmentIndicatorConfigOutput.EquipmentTypeId">
|
||||
<summary>
|
||||
所属设别类别
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto.EquipmentIndicatorConfigSearchConditionInput.Name">
|
||||
<summary>
|
||||
设备名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto.EquipmentIndicatorConfigSearchConditionInput.EquipmentTypeId">
|
||||
<summary>
|
||||
所属设备类别Id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquimentOverviewOutput.SeqNo">
|
||||
<summary>
|
||||
序号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquimentOverviewOutput.TypeName">
|
||||
<summary>
|
||||
类型名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquimentOverviewOutput.Count">
|
||||
<summary>
|
||||
总数量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquimentOverviewOutput.LineCount">
|
||||
<summary>
|
||||
在线数量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquimentOverviewOutput.Description">
|
||||
<summary>
|
||||
描述
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquimentOverviewOutput.IsVisable">
|
||||
<summary>
|
||||
是否显示
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquipmentDataModel.Telemeterings">
|
||||
<summary>
|
||||
遥测数据List
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquipmentDataModel.Telesignalisations">
|
||||
<summary>
|
||||
遥信数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquipmentInfoDiagnoseResult">
|
||||
<summary>
|
||||
诊断结果
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.EquipmentLiveData.EquipmentInfoDiagnoseContent.Name">
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquipmentInfoDiagnoseContent.Name">
|
||||
<summary>
|
||||
诊断名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.EquipmentLiveData.EquipmentInfoDiagnoseContent.Score">
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquipmentInfoDiagnoseContent.Score">
|
||||
<summary>
|
||||
评分
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.EquipmentLiveData.EquipmentInfoDiagnoseContent.DiaStatus">
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquipmentInfoDiagnoseContent.DiaStatus">
|
||||
<summary>
|
||||
诊断状态
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.EquipmentLiveData.EquipmentInfoDiagnoseContent.ErrorCode">
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquipmentInfoDiagnoseContent.ErrorCode">
|
||||
<summary>
|
||||
错误代码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.EquipmentLiveData.EquipmentInfoDiagnoseContent.ErrorType">
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquipmentInfoDiagnoseContent.ErrorType">
|
||||
<summary>
|
||||
错误类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.EquipmentLiveData.EquipmentInfoDiagnoseContent.SuggestCode">
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquipmentInfoDiagnoseContent.SuggestCode">
|
||||
<summary>
|
||||
建议代码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.EquipmentLiveData.EquipmentInfoDiagnoseContent.Suggest">
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.EquipmentInfoDiagnoseContent.Suggest">
|
||||
<summary>
|
||||
建议内容
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YunDa.SOMS.DataTransferObject.EquipmentLiveData.PointData">
|
||||
<member name="T:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.PointData">
|
||||
<summary>
|
||||
点位数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringHourStatisticsModel.Min">
|
||||
<summary>
|
||||
结果最小值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringHourStatisticsModel.Max">
|
||||
<summary>
|
||||
结果最大值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringHourStatisticsModel.First">
|
||||
<summary>
|
||||
小时之内第一个值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringHourStatisticsModel.Last">
|
||||
<summary>
|
||||
小时之内最后一个值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringHourStatisticsModel.AVG">
|
||||
<summary>
|
||||
小时之内平均值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringHourStatisticsModel.StatisticsCount">
|
||||
<summary>
|
||||
统计数量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringHourStatisticsModel._statisticsDateTime">
|
||||
<summary>
|
||||
时间,格式("yyyy-MM-dd HH")
|
||||
</summary>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringHourStatisticsModel.StatisticsDateTime" -->
|
||||
<member name="M:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringHourStatisticsModel.InitValue">
|
||||
<summary>
|
||||
初始化数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringModel.ResultValue">
|
||||
<summary>
|
||||
测量结果值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringModel.LastResultValue">
|
||||
<summary>
|
||||
上次结果值测量结果值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringModel.ResultTime">
|
||||
<summary>
|
||||
测量时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringModel.AlarmLevel">
|
||||
<summary>
|
||||
报警等级
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringModel.LastAlarmLevel">
|
||||
<summary>
|
||||
上次报警等级
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringModel.TelemeteringAlarmStrategys">
|
||||
<summary>
|
||||
报警策略
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelemeteringModel.AnalysisAlarm">
|
||||
<summary>
|
||||
获取当前 值 触发的报警策略
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelesignalisationModel.ResultValue">
|
||||
<summary>
|
||||
单点 测量结果值1:合;0:分;其它:非法值
|
||||
双点 测量结果值0:不定;1:分;2:合;其它:非法值
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelesignalisationModel.ResultTime">
|
||||
<summary>
|
||||
测量时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto.TelesignalisationModel.IsAlarm">
|
||||
<summary>
|
||||
遥信是否报警
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto.BoardCardInfoOutput">
|
||||
<summary>
|
||||
保护装置输出接口
|
||||
|
@ -27,7 +27,7 @@ namespace YunDa.ISAS.Entities.GeneralInformation
|
||||
public virtual int SeqNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备名称,命名规则:运行编号_安装区域_位置描述_设备子类。
|
||||
/// 设备名称
|
||||
/// </summary>
|
||||
[Required]
|
||||
[StringLength(MaxNameLength)]
|
||||
|
@ -0,0 +1,35 @@
|
||||
using Abp.Domain.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using YunDa.ISAS.Entities.AuditCommon.IAdudit;
|
||||
|
||||
namespace YunDa.SOMS.Entities.GeneralInformation
|
||||
{
|
||||
[Table("gi_equipment_indicator_comment")]
|
||||
|
||||
public class EquipmentIndicatorComment : Entity<string>, IISASPassivable
|
||||
{
|
||||
/// <summary>
|
||||
/// 顺序号
|
||||
/// </summary>
|
||||
public virtual int SeqNo { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public virtual string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否在用
|
||||
/// </summary>
|
||||
[DefaultValue(true)]
|
||||
public virtual bool IsActive { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
using YunDa.ISAS.Entities.AuditCommon.IAdudit;
|
||||
using YunDa.ISAS.Entities.AuditCommon;
|
||||
using YunDa.ISAS.Entities.GeneralInformation;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace YunDa.SOMS.Entities.GeneralInformation
|
||||
{
|
||||
[Table("gi_equipment_indicator_config")]
|
||||
public class EquipmentIndicatorConfig : ISASAuditedEntity, IISASPassivable
|
||||
{
|
||||
private const int MaxNameLength = 200;
|
||||
/// <summary>
|
||||
/// 顺序号
|
||||
/// </summary>
|
||||
public virtual int SeqNo { get; set; }
|
||||
[Required]
|
||||
[StringLength(MaxNameLength)]
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string CalculationFormula { get; set; }
|
||||
public virtual decimal Weight { get; set; }
|
||||
public virtual decimal DataPrecision { get; set; }
|
||||
public virtual decimal Value { get; set; }
|
||||
/// <summary>
|
||||
/// 所属设别类别
|
||||
/// </summary>
|
||||
public virtual Guid? EquipmentTypeId { get; set; }
|
||||
[ForeignKey("EquipmentTypeId")]
|
||||
public virtual EquipmentType EquipmentType { get; set; }
|
||||
public virtual bool IsActive { get; set; }
|
||||
public virtual string Remark { get; set; }
|
||||
[ForeignKey("Name")]
|
||||
public virtual EquipmentIndicatorComment EquipmentIndicatorComment { get; set; }
|
||||
}
|
||||
}
|
@ -2,10 +2,6 @@
|
||||
using Pomelo.EntityFrameworkCore.MySql.Storage;
|
||||
using Pomelo.EntityFrameworkCore.MySql.Storage.Internal;
|
||||
using System;
|
||||
|
||||
//using Pomelo.EntityFrameworkCore.MySql.Infrastructure;
|
||||
//using System;
|
||||
|
||||
namespace YunDa.ISAS.EntityFrameworkCore.EntityFrameworkCore
|
||||
{
|
||||
public static class DbContextOptionsConfigurer
|
||||
|
@ -326,7 +326,9 @@ namespace YunDa.ISAS.EntityFrameworkCore.EntityFrameworkCore
|
||||
#endregion
|
||||
public virtual DbSet<EquipmentDataCategoryBase> EquipmentDataCategoryBaseDbSet { get; set; }
|
||||
|
||||
|
||||
public virtual DbSet<EquipmentIndicatorComment> EquipmentIndicatorCommentDbSet { get; set; }
|
||||
public virtual DbSet<EquipmentIndicatorConfig> EquipmentIndicatorConfigDbSet { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -330,6 +330,7 @@ namespace YunDa.ISAS.EntityFrameworkCore.EntityFrameworkCore.Seed
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 运维客户端
|
||||
int seq = 0;
|
||||
string code = "02" + seq.ToString("00");
|
||||
fun = funs.FirstOrDefault(f => f.Code == code && f.Type == FunctionType.MaintenanceSystemClient);
|
||||
@ -379,8 +380,13 @@ namespace YunDa.ISAS.EntityFrameworkCore.EntityFrameworkCore.Seed
|
||||
{
|
||||
AddMaintenanceSystemFunction(seq, "版本管理与板卡诊断", code);
|
||||
}
|
||||
#region 运维客户端
|
||||
|
||||
seq = 07;
|
||||
code = "02" + seq.ToString("00");
|
||||
fun = funs.FirstOrDefault(f => f.Code == code && f.Type == FunctionType.MaintenanceSystemClient);
|
||||
if (fun == null)
|
||||
{
|
||||
AddMaintenanceSystemFunction(seq, "主动安全", code);
|
||||
}
|
||||
#endregion
|
||||
_context.SaveChanges();
|
||||
}
|
||||
@ -799,7 +805,24 @@ namespace YunDa.ISAS.EntityFrameworkCore.EntityFrameworkCore.Seed
|
||||
{
|
||||
fun.Name = "二次回路";
|
||||
}
|
||||
|
||||
sysFunction = new SysFunction
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
SeqNo = 13,
|
||||
Name = "设备诊断指标",
|
||||
Code = code + 13,
|
||||
Type = FunctionType.Web,
|
||||
LoadUrl = @"/GeneralInformation/EquipmentIndicatorConfig",
|
||||
IsActive = true,
|
||||
IsOperatorPage = true,
|
||||
SysFunctionId = ID
|
||||
};
|
||||
fun = funs.FirstOrDefault(f => f.Code == sysFunction.Code && f.Type == FunctionType.Web);
|
||||
if (fun == null)
|
||||
{
|
||||
_context.SysFunctionDbSet.Add(sysFunction);
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加视频监控模块
|
||||
|
@ -30,8 +30,8 @@ namespace YunDa.ISAS.EntityFrameworkCore.EntityFrameworkCore.Seed
|
||||
{
|
||||
try
|
||||
{
|
||||
//var context = uowManager.Object.Current.GetDbContext<TDbContext>();
|
||||
//contextAction(context);
|
||||
var context = uowManager.Object.Current.GetDbContext<TDbContext>();
|
||||
contextAction(context);
|
||||
uow.Complete();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
5198
src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/Migrations/20250417030739_update_table_v100.Designer.cs
generated
Normal file
5198
src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/Migrations/20250417030739_update_table_v100.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace YunDa.ISAS.Migrations
|
||||
{
|
||||
public partial class update_table_v100 : Migration
|
||||
{
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "gi_equipment_indicator_config");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "gi_equipment_indicator_comment");
|
||||
|
||||
}
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "gi_equipment_indicator_comment",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(nullable: false),
|
||||
SeqNo = table.Column<int>(nullable: false),
|
||||
Description = table.Column<string>(nullable: true),
|
||||
Remark = table.Column<string>(nullable: true),
|
||||
IsActive = table.Column<bool>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_gi_equipment_indicator_comment", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "gi_equipment_indicator_config",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(nullable: false, type: "char(36) CHARACTER SET utf8mb4", maxLength: 36),
|
||||
CreatorUserId = table.Column<Guid>(nullable: true, type: "char(36) CHARACTER SET utf8mb4", maxLength: 36),
|
||||
CreationTime = table.Column<DateTime>(nullable: false),
|
||||
LastModificationTime = table.Column<DateTime>(nullable: true),
|
||||
LastModifierUserId = table.Column<Guid>(type: "char(36) CHARACTER SET utf8mb4", maxLength: 36),
|
||||
SeqNo = table.Column<int>(nullable: false),
|
||||
Name = table.Column<string>(maxLength: 200, nullable: false),
|
||||
CalculationFormula = table.Column<string>(nullable: true),
|
||||
Weight = table.Column<decimal>(nullable: false),
|
||||
DataPrecision = table.Column<decimal>(nullable: false),
|
||||
Value = table.Column<decimal>(nullable: false),
|
||||
EquipmentTypeId = table.Column<Guid>(nullable: true, type: "char(36) CHARACTER SET utf8mb4", maxLength: 36),
|
||||
IsActive = table.Column<bool>(nullable: false),
|
||||
Remark = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_gi_equipment_indicator_config", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_gi_equipment_indicator_config_gi_equipment_type_EquipmentTyp~",
|
||||
column: x => x.EquipmentTypeId,
|
||||
principalTable: "gi_equipment_type",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_gi_equipment_indicator_config_gi_equipment_indicator_comment~",
|
||||
column: x => x.Name,
|
||||
principalTable: "gi_equipment_indicator_comment",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -13,4 +13,8 @@
|
||||
<code><strong>Get-Migration</strong></code>
|
||||
<code><strong>dotnet ef migrations remove</strong></code>
|
||||
### 幂等生成SQL
|
||||
<code><strong>dotnet ef migrations script --idempotent > ../../YunDa.Quick/ISASUpdateProgram/updatescript.sql</strong></code>
|
||||
<code><strong>dotnet ef migrations script --idempotent > ../../YunDa.Quick/ISASUpdateProgram/updatescript.sql</strong></code>
|
||||
|
||||
解决EF迁移数据报No mapping to a relational type can be found for property 'xxx.FieldName' with the CLR type 'string'.错误一例
|
||||
|
||||
删除ISASDbContextModelSnapshot.cs;手动处理表
|
@ -4,7 +4,6 @@ using Abp.Reflection.Extensions;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto;
|
||||
using YunDa.ISAS.DataTransferObject.VideoSurveillance.InspectionPlanTaskDto;
|
||||
using YunDa.ISAS.DataTransferObject.VideoSurveillance.VideoDevDto;
|
||||
@ -20,7 +19,7 @@ using YunDa.ISAS.Redis.Entities.SortDefines;
|
||||
using YunDa.ISAS.Redis.Factory;
|
||||
using YunDa.ISAS.Redis.Repositories;
|
||||
using YunDa.SOMS.DataTransferObject.CommonDto;
|
||||
using YunDa.SOMS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionSettingDto;
|
||||
using YunDa.SOMS.DataTransferObject.MainStationMaintenanceInfo.OperationReport;
|
||||
|
@ -11,30 +11,30 @@ namespace YunDa.ISMS.BASE.Entities
|
||||
{
|
||||
/* This class is needed to run EF Core PMC commands. Not used anywhere else */
|
||||
|
||||
public class ISMSDbContextFactory : IDesignTimeDbContextFactory<ISMS_BASEContext>
|
||||
{
|
||||
public static readonly ILoggerFactory MyLoggerFactory
|
||||
= LoggerFactory.Create(builder =>
|
||||
{
|
||||
builder
|
||||
.SetMinimumLevel(LogLevel.Information)
|
||||
.AddConsole(); // 启用控制台日志输出
|
||||
//public class ISMSDbContextFactory : IDesignTimeDbContextFactory<ISMS_BASEContext>
|
||||
//{
|
||||
// public static readonly ILoggerFactory MyLoggerFactory
|
||||
// = LoggerFactory.Create(builder =>
|
||||
// {
|
||||
// builder
|
||||
// .SetMinimumLevel(LogLevel.Information)
|
||||
// .AddConsole(); // 启用控制台日志输出
|
||||
|
||||
});
|
||||
public ISMS_BASEContext CreateDbContext(string[] args)
|
||||
{
|
||||
// });
|
||||
// public ISMS_BASEContext CreateDbContext(string[] args)
|
||||
// {
|
||||
|
||||
var builder = new DbContextOptionsBuilder<ISMS_BASEContext>();
|
||||
string connectionString = "Server=192.168.61.230;User ID=sa;Password=sa;Database=ISMS_BASE;Trusted_Connection=False;TrustServerCertificate=True";
|
||||
builder.UseSqlServer(connectionString, builder => { builder.CommandTimeout(60); })
|
||||
.UseLoggerFactory(MyLoggerFactory)
|
||||
.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking)
|
||||
.EnableSensitiveDataLogging()
|
||||
.EnableDetailedErrors()
|
||||
; // 启用详细日志
|
||||
return new ISMS_BASEContext(builder.Options);
|
||||
}
|
||||
}
|
||||
// var builder = new DbContextOptionsBuilder<ISMS_BASEContext>();
|
||||
// string connectionString = "Server=192.168.61.230;User ID=sa;Password=sa;Database=ISMS_BASE;Trusted_Connection=False;TrustServerCertificate=True";
|
||||
// builder.UseSqlServer(connectionString, builder => { builder.CommandTimeout(60); })
|
||||
// .UseLoggerFactory(MyLoggerFactory)
|
||||
// .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking)
|
||||
// .EnableSensitiveDataLogging()
|
||||
// .EnableDetailedErrors()
|
||||
// ; // 启用详细日志
|
||||
// return new ISMS_BASEContext(builder.Options);
|
||||
// }
|
||||
//}
|
||||
|
||||
/* This class is needed to run EF Core PMC commands. Not used anywhere else */
|
||||
}
|
@ -7,9 +7,14 @@ using YunDa.SOMS.BASE.Entities.Models;
|
||||
|
||||
namespace YunDa.SOMS.BASE.Entities
|
||||
{
|
||||
#if Mysql
|
||||
public partial class ISMS_BASEContext : DbContext, ISMS_BASE_Dasets
|
||||
|
||||
#else
|
||||
public partial class ISMS_BASEContext : AbpDbContext, ISMS_BASE_Dasets
|
||||
#endif
|
||||
{
|
||||
|
||||
|
||||
public ISMS_BASEContext(DbContextOptions<ISMS_BASEContext> options)
|
||||
: base(options)
|
||||
{
|
||||
@ -7680,7 +7685,9 @@ namespace YunDa.SOMS.BASE.Entities
|
||||
public DbSet<ImDeviceYxSrcDevice> ImDeviceYxSrcDevice { get; set; }
|
||||
public DbSet<ImDeviceYxTmp> ImDeviceYxTmp { get; set; }
|
||||
public DbSet<ImDiagram> ImDiagram { get; set; }
|
||||
#if Mysql
|
||||
public DbSet<ImDzcheckrule> ImDzcheckrule { get; set; }
|
||||
#endif
|
||||
public DbSet<ImDztype> ImDztype { get; set; }
|
||||
public DbSet<ImEventFlag> ImEventFlag { get; set; }
|
||||
public DbSet<ImEventParam> ImEventParam { get; set; }
|
||||
|
@ -32,7 +32,14 @@ namespace YunDa.ISMS.BASE.Entities
|
||||
Logger.Info("Loading configuration for ISMS_BASEEntityFrameworkCoreModule...");
|
||||
|
||||
// 获取数据库连接字符串
|
||||
|
||||
#if Mysql
|
||||
var connectionString = configuration.GetConnectionString(ISASConsts.ISMS_BASEMysqlSettingStringKey);
|
||||
#else
|
||||
var connectionString = configuration.GetConnectionString(ISASConsts.ISMS_BASESqlServerSettingStringKey);
|
||||
|
||||
#endif
|
||||
|
||||
if (string.IsNullOrEmpty(connectionString))
|
||||
{
|
||||
throw new ApplicationException("Database connection string is not configured for ISMS_BASE.");
|
||||
|
@ -46,8 +46,11 @@ namespace YunDa.SOMS.BASE.Entities
|
||||
public DbSet<ImDeviceYxSrcDevice> ImDeviceYxSrcDevice { get; set; }
|
||||
public DbSet<ImDeviceYxTmp> ImDeviceYxTmp { get; set; }
|
||||
public DbSet<ImDiagram> ImDiagram { get; set; }
|
||||
#if Mysql
|
||||
|
||||
public DbSet<ImDzcheckrule> ImDzcheckrule { get; set; }
|
||||
public DbSet<ImDztype> ImDztype { get; set; }
|
||||
#endif
|
||||
public DbSet<ImDztype> ImDztype { get; set; }
|
||||
public DbSet<ImEventFlag> ImEventFlag { get; set; }
|
||||
public DbSet<ImEventParam> ImEventParam { get; set; }
|
||||
public DbSet<ImEventType> ImEventType { get; set; }
|
||||
|
@ -3,14 +3,20 @@ using Microsoft.EntityFrameworkCore;
|
||||
using YunDa.SOMS.BASE.Entities.Models;
|
||||
namespace YunDa.SOMS.BASE.Entities
|
||||
{
|
||||
|
||||
#if Mysql
|
||||
public partial class ISMS_BASE_Mysql_Context : AbpDbContext, ISMS_BASE_Dasets
|
||||
#else
|
||||
public partial class ISMS_BASE_Mysql_Context : DbContext, ISMS_BASE_Dasets
|
||||
#endif
|
||||
{
|
||||
|
||||
|
||||
|
||||
public ISMS_BASE_Mysql_Context(DbContextOptions<ISMS_BASE_Mysql_Context> options)
|
||||
: base(options)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
@ -3358,12 +3364,14 @@ namespace YunDa.SOMS.BASE.Entities
|
||||
entity.Property(e => e.SupportVersion)
|
||||
.HasColumnName("supportversion")
|
||||
.HasColumnType("int(11)");
|
||||
|
||||
entity.Property(e => e.Wavepath)
|
||||
#if Mysql
|
||||
entity.Property(e => e.Wavepath)
|
||||
.HasColumnName("wavepath")
|
||||
.HasColumnType("varchar(100)")
|
||||
.HasCharSet("utf8mb4")
|
||||
.HasCollation("utf8mb4_0900_ai_ci");
|
||||
#endif
|
||||
|
||||
|
||||
});
|
||||
|
||||
@ -6189,7 +6197,10 @@ namespace YunDa.SOMS.BASE.Entities
|
||||
public DbSet<ImDeviceYxSrcDevice> ImDeviceYxSrcDevice { get; set; }
|
||||
public DbSet<ImDeviceYxTmp> ImDeviceYxTmp { get; set; }
|
||||
public DbSet<ImDiagram> ImDiagram { get; set; }
|
||||
#if Mysql
|
||||
public DbSet<ImDzcheckrule> ImDzcheckrule { get; set; }
|
||||
|
||||
#endif
|
||||
public DbSet<ImDztype> ImDztype { get; set; }
|
||||
public DbSet<ImEventFlag> ImEventFlag { get; set; }
|
||||
public DbSet<ImEventParam> ImEventParam { get; set; }
|
||||
|
@ -27,7 +27,9 @@ namespace YunDa.SOMS.BASE.Entities.Models
|
||||
public int? StartOfDkjl { get; set; }
|
||||
public int? EndOfDkjl { get; set; }
|
||||
public string? DeviceType { get; set; }
|
||||
#if Mysql
|
||||
public string Wavepath { get; set; }
|
||||
#endif
|
||||
|
||||
public virtual ImGateWay GateWay { get; set; } = null!;
|
||||
public virtual ImPuCtgy PuctgyCodeNavigation { get; set; } = null!;
|
||||
|
@ -6,13 +6,9 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>$(DefineConstants);Mysql</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" />
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DefineConstants>$(DefineConstants);Mysql</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Abp.EntityFrameworkCore" Version="5.14.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.32" />
|
||||
|
Binary file not shown.
@ -14,11 +14,11 @@ using Yunda.ISAS.DataMonitoringServer.WebSocket.Model;
|
||||
using Yunda.ISAS.MongoDB.Entities.DataMonitoring;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.DMAlarmCategoryDto;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringAlarmStrategyDto;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentTypeDto;
|
||||
using YunDa.ISAS.Entities.DataMonitoring;
|
||||
using YunDa.ISAS.Entities.MySQL.DataMonitoring;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData;
|
||||
|
||||
namespace Yunda.ISAS.DataMonitoringServer.DataAnalysis
|
||||
{
|
||||
|
@ -13,11 +13,11 @@ using Yunda.ISAS.DataMonitoringServer.WebSocket;
|
||||
using Yunda.ISAS.DataMonitoringServer.WebSocket.Model;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.LinkageExecuteActivityDto;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringAlarmStrategyDto;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentTypeDto;
|
||||
using YunDa.ISAS.DataTransferObject.VideoSurveillance.VideoDevDto;
|
||||
using YunDa.ISAS.Entities.DataMonitoring;
|
||||
using YunDa.ISAS.Redis.Entities.AlarmCategory;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData;
|
||||
|
||||
namespace Yunda.ISAS.DataMonitoringServer.DataAnalysis.AlarmQueue
|
||||
{
|
||||
|
@ -16,9 +16,9 @@ using ToolLibrary.LogHelper;
|
||||
using Yunda.ISAS.DataMonitoringServer.DataAnalysis.DataCollection.Dlls;
|
||||
using Yunda.ISAS.DataMonitoringServer.DataCenter;
|
||||
using Yunda.ISAS.DataMonitoringServer.WPF.ViewModel;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.Entities.DataMonitoring;
|
||||
using YunDa.ISAS.Redis.Entities.DataMonitorCategory;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData;
|
||||
|
||||
namespace Yunda.ISAS.DataMonitoringServer.DataAnalysis.DataCollection
|
||||
{
|
||||
|
@ -30,7 +30,6 @@ using Yunda.ISAS.MongoDB.Entities.DataMonitoring;
|
||||
using Yunda.SOMS.DataMonitoringServer.DataAnalysis.Model;
|
||||
using Yunda.SOMS.MongoDB.Entities.MainStationMaintenanceInfo;
|
||||
using YunDa.ISAS.DataTransferObject.CommonDto;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.DataTransferObject.Iec104;
|
||||
using YunDa.ISAS.Entities.DataMonitoring;
|
||||
using YunDa.ISAS.Entities.GeneralInformation;
|
||||
@ -38,6 +37,7 @@ using YunDa.ISAS.Entities.VideoSurveillance;
|
||||
using YunDa.ISAS.Redis.Entities.AlarmCategory;
|
||||
using YunDa.ISAS.Redis.Entities.DataMonitorCategory;
|
||||
using YunDa.ISAS.Redis.Repositories;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.SecondaryCircuitDto;
|
||||
using YunDa.SOMS.DataTransferObject.MainStationMaintenanceInfo.OperationReport;
|
||||
using YunDa.SOMS.Entities.GeneralInformation;
|
||||
|
@ -15,8 +15,8 @@ using Yunda.ISAS.DataMonitoringServer.DataCenter;
|
||||
using Yunda.ISAS.DataMonitoringServer.WebSocket;
|
||||
using Yunda.ISAS.DataMonitoringServer.WebSocket.Model;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.LinkageConditionDto;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.Entities.MySQL.DataMonitoring;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData;
|
||||
using Z.Expressions;
|
||||
using ConstantModel = Yunda.ISAS.DataMonitoringServer.DataAnalysis.Model.ConstantModel;
|
||||
|
||||
|
@ -10,7 +10,7 @@ using Yunda.ISAS.DataMonitoringServer.DataAnalysis.Model;
|
||||
using Yunda.ISAS.DataMonitoringServer.DataCenter;
|
||||
using Yunda.ISAS.DataMonitoringServer.WPF.ViewModel;
|
||||
using Yunda.ISAS.MongoDB.Entities.DataMonitoring;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData;
|
||||
using ConstantModel = Yunda.ISAS.DataMonitoringServer.DataAnalysis.Model.ConstantModel;
|
||||
|
||||
namespace Yunda.ISAS.DataMonitoringServer.DataAnalysis.TeleInfoSave
|
||||
|
@ -17,7 +17,6 @@ using YunDa.ISAS.DataTransferObject.DataMonitoring.TelecommandConfigurationDto.S
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.TelecommandPlanDto.TelecommandPlanTimeDto;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringAlarmStrategyDto;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringConfigurationDto;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentTypeDto;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.TransformerSubstationDto;
|
||||
@ -31,6 +30,7 @@ using YunDa.ISAS.Entities.DataMonitoring;
|
||||
using YunDa.ISAS.Entities.GeneralInformation;
|
||||
using YunDa.ISAS.ExternalInteraction.DataTransferObject.InspectionEquipment;
|
||||
using YunDa.ISAS.ExternalInteraction.DataTransferObject.InspectionEquipment.RequestInput;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionSettingDto;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.SecondaryCircuitDto;
|
||||
|
@ -2,13 +2,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.Redis.Entities.AlarmCategory;
|
||||
using YunDa.ISAS.Redis.Entities.CameraAuthCategory;
|
||||
using YunDa.ISAS.Redis.Entities.DataMonitorCategory;
|
||||
using YunDa.ISAS.Redis.Entities.LinkageCategory;
|
||||
using YunDa.ISAS.Redis.Repositories;
|
||||
using YunDa.SOMS.DataTransferObject.CommonDto;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto;
|
||||
using YunDa.SOMS.DataTransferObject.MainStationMaintenanceInfo.OperationReport;
|
||||
|
||||
|
@ -10,15 +10,15 @@ using Yunda.ISAS.DataMonitoringServer.DataAnalysis.Model;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.DMAlarmCategoryDto;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.LinkageExecuteActivityDto;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringAlarmStrategyDto;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentTypeDto;
|
||||
using YunDa.ISAS.DataTransferObject.GeneralInformation.TransformerSubstationDto;
|
||||
using YunDa.ISAS.Redis.Repositories;
|
||||
using ConstantModel = YunDa.ISAS.DataTransferObject.EquipmentLiveData.ConstantModel;
|
||||
using ConstantModel = YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData.ConstantModel;
|
||||
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.SecondaryCircuitDto;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringConfigurationDto;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData;
|
||||
namespace Yunda.ISAS.DataMonitoringServer.DataCenter
|
||||
{
|
||||
public class RunningDataCache : ISingletonDependency
|
||||
|
@ -11,9 +11,9 @@ using Yunda.ISAS.DataMonitoringServer.DataAnalysis.Helper;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringConfigurationDto;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringConfigurationDto.SearchCondition;
|
||||
using YunDa.ISAS.DataTransferObject.DataMonitoring.TelesignalisationConfigurationDto;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.DataTransferObject.Iec104;
|
||||
using YunDa.ISAS.Entities.DataMonitoring;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData;
|
||||
using ConstantModel = Yunda.ISAS.DataMonitoringServer.DataAnalysis.Model.ConstantModel;
|
||||
|
||||
namespace Yunda.ISAS.DataMonitoringServer.DataCenter
|
||||
|
@ -16,8 +16,8 @@ using Yunda.ISAS.DataMonitoringServer.DataCenter;
|
||||
using Yunda.ISAS.DataMonitoringServer.WebSocket.DotNetty.Server;
|
||||
using Yunda.ISAS.DataMonitoringServer.WebSocket.Model;
|
||||
using YunDa.ISAS.DataTransferObject.CommonDto;
|
||||
using YunDa.ISAS.DataTransferObject.EquipmentLiveData;
|
||||
using YunDa.ISAS.Redis.Entities.AlarmCategory;
|
||||
using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData;
|
||||
|
||||
namespace Yunda.ISAS.DataMonitoringServer.WebSocket
|
||||
{
|
||||
|
@ -66,7 +66,16 @@ namespace YunDa.ISAS.Web.MVC.Controllers
|
||||
ViewData["IsEdit"] = isEdit;
|
||||
return View();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备指标配置
|
||||
/// </summary>
|
||||
/// <param name="isEdit"></param>
|
||||
/// <returns></returns>
|
||||
public IActionResult EquipmentIndicatorConfig(bool isEdit = false)
|
||||
{
|
||||
ViewData["IsEdit"] = isEdit;
|
||||
return View();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,183 @@
|
||||
@{
|
||||
ViewData["Title"] = "设备诊断指标";
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
<div class="animated fadeIn full-height" style="padding-right:0px;margin-right:0px;">
|
||||
<div class="col-sm-2 border-right full-height" style="padding-right: 0px; padding-left: 0px;margin-right: 0px;">
|
||||
@await Html.PartialAsync("~/Views/GeneralInformation/_TranSubstationEquipmentTree.cshtml")
|
||||
</div>
|
||||
<div class="col-sm-10 full-height" style="padding-right:0px;margin-right:0px;">
|
||||
<div class="form-inline hidden-xs" id="equipmentIndicatorConfigToolbar" role="group">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> 指标名称:</label>
|
||||
<input type="text" class="form-control" v-model="name" placeholder="请输入指标名称">
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary" v-on:click="search">
|
||||
<i class="fa fa-search" aria-hidden="true"></i> 查询
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" v-on:click="add">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
添加
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger" v-on:click="deleteFunc" style="display:none" authority-management="true">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
删除
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger" v-on:click="addBaseData">
|
||||
<i class="fa fa-circle-o" aria-hidden="true"></i>
|
||||
添加基础数据
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<table id="equipmentIndicatorConfigTable" data-height="100%" data-mobile-responsive="true" authority-management="true"></table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal inmodal fade" id="equipmentIndicatorConfigEditModal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
|
||||
<div class="modal-dialog modal-lg" style="width:450px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title">编辑设备诊断指标</h4>
|
||||
<input type="hidden" v-model="id" />
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="editEquipmentIndicatorConfigForm">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">顺序号</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="number" class="form-control" v-model.number="seqNo">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">指标名称</label>
|
||||
<div class="col-sm-9">
|
||||
<vue-chosen :placeholder="'请选择指标'" :default_value="name" :options="names" v-on:change="setNameAction"></vue-chosen>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">计算方式描述</label>
|
||||
<div class="col-sm-9">
|
||||
<textarea class="form-control" v-model="calculationFormula"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">权重</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="number" class="form-control" v-model.number="weight" name="weight">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">数据精度</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="number" class="form-control" v-model.number="dataPrecision" name="dataPrecision">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备类型</label>
|
||||
<div class="col-sm-9">
|
||||
<vue-chosen :placeholder="'请选择指标'" :default_value="equipmentTypeId" :options="equipmentTypes" v-on:change="setEquipmentTypeIdAction"></vue-chosen>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" v-on:click="save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal inmodal fade" id="equipmentIndicatorCommentEditModal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
|
||||
<div class="modal-dialog modal-lg" style="width:450px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title">添加基础数据</h4>
|
||||
<input type="hidden" v-model="id" />
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="editEquipmentIndicatorConfigForm">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">顺序号</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="number" class="form-control" v-model.number="seqNo">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">指标名称</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" v-model="id" name="id">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">描述</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" v-model="description">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" v-model="remark">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" v-on:click="save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@section scripts{
|
||||
<script src="~/view-resources/Views/GeneralInformation/EquipmentIndicatorConfig.js"></script>
|
||||
<!-- Chosen -->
|
||||
<script src="~/js/plugins/chosen/chosen.jquery.min.js"></script>
|
||||
<script src="~/js/plugins/chosen/vue.chosen.js"></script>
|
||||
<!-- jsTree -->
|
||||
<script src="~/js/plugins/jsTree/jstree.min.js"></script>
|
||||
<script src="~/view-resources/Views/GeneralInformation/_TranSubstationEquipmentTreeCategory.js" type="text/javascript"></script>
|
||||
}
|
||||
@section styles{
|
||||
<link href="~/css/plugins/chosen/chosen.min.css" rel="stylesheet">
|
||||
<link href="~/css/plugins/colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
.headLable {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.blackboard {
|
||||
background: radial-gradient(#415E3D, #132D1C);
|
||||
border: 8px solid #C7945C;
|
||||
overflow-y: auto;
|
||||
height: 100%;
|
||||
padding: 30px 10px;
|
||||
}
|
||||
|
||||
.blackboard_img {
|
||||
background-image: url(../../img/blackboard.png);
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
}
|
||||
|
||||
.equipment-substation {
|
||||
padding-right: 0px;
|
||||
border-color: #39aef5 !important;
|
||||
border-width: 2px !important;
|
||||
}
|
||||
|
||||
.editInput-width {
|
||||
width: 190px;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
@ -250,6 +250,10 @@
|
||||
<Content Update="Resources\Static\panoramaconfiguration.json">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="Views\GeneralInformation\EquipmentIndicatorConfig.cshtml">
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Update="Views\GeneralInformation\SecondaryCircuit.cshtml">
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
|
@ -1,11 +1,22 @@
|
||||
{
|
||||
"Abp": {
|
||||
"WebCommon": {
|
||||
"WrapResult": false,
|
||||
"ShowStackTrace": true
|
||||
}
|
||||
},
|
||||
"AbpExceptionHandling": {
|
||||
"SendExceptionsDetailsToClients": true, // 显示详细错误
|
||||
"SendStackTraceToClients": true // 显示堆栈跟踪
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"MysqlSetting": "server=127.0.0.1;port=3306;uid=root;pwd=123456; Database=soms_sys_db;SslMode=none;Max Pool Size=200;Connection Timeout=180;Pooling=True;",
|
||||
"MysqlSetting": "server=192.168.81.229;port=3306;uid=root;pwd=123456; Database=soms_sys_db;SslMode=none;Max Pool Size=200;Connection Timeout=60;Pooling=True;",
|
||||
"ISMS_BASE_MysqlSetting": "server=192.168.81.229;port=3306;uid=root;pwd=123456; Database=isms_l_base;SslMode=none;Max Pool Size=200;Connection Timeout=60;Pooling=True;",
|
||||
"ISMS_BASESqlServerSetting": "Server=192.168.65.33;User ID=sa;Password=sa;Database=ISMS_BASE;Trusted_Connection=False;TrustServerCertificate=True;Max Pool Size=200;Connection Timeout=60;",
|
||||
"ISMS_YcSqlServerSetting": "Server=127.0.0.1;User ID=sa;Password=sa;Database=ISMS_Yc;Trusted_Connection=False;TrustServerCertificate=True",
|
||||
"ISMS_DataSqlServerSetting": "Server=127.0.0.1;User ID=sa;Password=sa;Database=ISMS_Data;Trusted_Connection=False;TrustServerCertificate=True",
|
||||
"ISMS_ReportServerSqlServerSetting": "Server=127.0.0.1;User ID=sa;Password=sa;Database=ReportServer;Trusted_Connection=False;TrustServerCertificate=True",
|
||||
"ISMS_ReportServerTempDBSqlServerSetting": "Server=127.0.0.1;User ID=sa;Password=sa;Database=ReportServerTempDB;Trusted_Connection=False;TrustServerCertificate=True",
|
||||
"ISMS_YcSqlServerSetting": "Server=192.168.110.161;User ID=sa;Password=sa;Database=ISMS_Yc;Trusted_Connection=False;TrustServerCertificate=True",
|
||||
"ISMS_DataSqlServerSetting": "Server=192.168.110.161;User ID=sa;Password=sa;Database=ISMS_Data;Trusted_Connection=False;TrustServerCertificate=True",
|
||||
"ISMS_ReportServerSqlServerSetting": "Server=192.168.110.161;User ID=sa;Password=sa;Database=ReportServer;Trusted_Connection=False;TrustServerCertificate=True",
|
||||
"ISMS_ReportServerTempDBSqlServerSetting": "Server=192.168.110.161;User ID=sa;Password=sa;Database=ReportServerTempDB;Trusted_Connection=False;TrustServerCertificate=True",
|
||||
"MongoDBSetting": {
|
||||
"Host": "127.0.0.1",
|
||||
"Port": "37017",
|
||||
@ -50,7 +61,7 @@
|
||||
"Http": {
|
||||
"Url": "http://0.0.0.0:38090"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
"App": {
|
||||
|
@ -0,0 +1,351 @@
|
||||
$(document).ready(function () {
|
||||
substationTree.isShowEquipment = false;
|
||||
substationTree.initTree(subTreeChanged);
|
||||
// 原有代码保持不变...
|
||||
equipmentIndicatorConfigList.initListFunc();
|
||||
$(".refresh-btn").click(function () {
|
||||
substationTree.initTree(subTreeChanged);
|
||||
substationTree.refreshTree();
|
||||
})
|
||||
});
|
||||
var treeNode = { type: null };
|
||||
function subTreeChanged(node) {
|
||||
treeNode = node;
|
||||
equipmentIndicatorConfigList.refreshTable();
|
||||
}
|
||||
|
||||
function showExcelExportImport() {
|
||||
$("#excelExport").toggle();
|
||||
}
|
||||
var treeNode = null;
|
||||
|
||||
var equipmentIndicatorConfigList = {
|
||||
mainTableId: "equipmentIndicatorConfigTable",
|
||||
toolBarId: "equipmentIndicatorConfigToolbar",
|
||||
toolBarVue: null,
|
||||
editModalId: "equipmentIndicatorConfigEditModal",
|
||||
editModalVue: null,
|
||||
editFormId: "editEquipmentIndicatorConfigForm",
|
||||
lastExpandRowIndex: -1,
|
||||
|
||||
initListFunc: function () {
|
||||
equipmentIndicatorConfigList.initToolBarVue();
|
||||
equipmentIndicatorConfigList.initEditModalByVue();
|
||||
equipmentIndicatorConfigList.initTable();
|
||||
equipmentIndicatorConfigList.initEditFormValidate();
|
||||
equipmentIndicatorConfigList.refreshTable();
|
||||
equipmentIndicatorConfigList.initBaseDataVue();
|
||||
},
|
||||
|
||||
initToolBarVue: function () {
|
||||
equipmentIndicatorConfigList.toolBarVue = new Vue({
|
||||
el: '#' + equipmentIndicatorConfigList.toolBarId,
|
||||
data: {
|
||||
name: "",
|
||||
isShowAddBtn: true
|
||||
},
|
||||
methods: {
|
||||
search: function () {
|
||||
equipmentIndicatorConfigList.refreshTable();
|
||||
},
|
||||
add: function () {
|
||||
equipmentIndicatorConfigList.initEditModalValues("");
|
||||
$(equipmentIndicatorConfigList.editModalVue.$el).modal('show');
|
||||
},
|
||||
deleteFunc: function () {
|
||||
let row = equipmentIndicatorConfigList.getSelectItem();
|
||||
if (!row || row.length == 0) {
|
||||
layer.alert("请选择要删除的行!");
|
||||
return;
|
||||
}
|
||||
let arrIds = new Array();
|
||||
row.forEach(r => arrIds.push(r.id));
|
||||
isas.ajax({
|
||||
url: AppServiceUrl.EquipmentIndicatorConfig_DeleteByIds,
|
||||
data: JSON.stringify(arrIds),
|
||||
confirm: true,
|
||||
success: function (rst) {
|
||||
if (rst.result?.flag) {
|
||||
equipmentIndicatorConfigList.refreshTable();
|
||||
layer.alert(rst.result.message);
|
||||
} else if (!rst.success) {
|
||||
layer.alert(rst.error.message);
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
addBaseData: function () {
|
||||
$('#equipmentIndicatorCommentEditModal').modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
initBaseDataVue: function () {
|
||||
equipmentIndicatorConfigList.toolBarVue = new Vue({
|
||||
el: '#equipmentIndicatorCommentEditModal',
|
||||
data: {
|
||||
id: null,
|
||||
seqNo: 0,
|
||||
description: "",
|
||||
remark: "",
|
||||
isActive: true,
|
||||
},
|
||||
methods: {
|
||||
save: function () {
|
||||
let data = {
|
||||
id: this.id,
|
||||
seqNo: this.seqNo,
|
||||
description: this.description,
|
||||
remark: this.remark,
|
||||
isActive: true,
|
||||
};
|
||||
isas.ajax({
|
||||
url: AppServiceUrl.EquipmentIndicatorConfig_CreateEquipmentIndicatorComment,
|
||||
data: JSON.stringify(data),
|
||||
confirm: true,
|
||||
success: function (rst) {
|
||||
if (rst.result?.flag) {
|
||||
equipmentIndicatorConfigList.editModalVue.loadequipmentIndicatorComment();
|
||||
layer.alert(rst.result.message);
|
||||
} else if (!rst.success) {
|
||||
layer.alert(rst.error.message);
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
initEditModalByVue: function () {
|
||||
equipmentIndicatorConfigList.editModalVue = new Vue({
|
||||
el: '#' + equipmentIndicatorConfigList.editModalId,
|
||||
data: {
|
||||
header: '添加',
|
||||
id: null,
|
||||
seqNo: 0,
|
||||
name: "",
|
||||
names: [],
|
||||
calculationFormula: "",
|
||||
weight: 0,
|
||||
dataPrecision: 2,
|
||||
value: 0,
|
||||
remark: "",
|
||||
isActive: true,
|
||||
equipmentTypes: [],
|
||||
equipmentTypeId: null,
|
||||
},
|
||||
mounted: function () {
|
||||
this.loadEquipmentTypes();
|
||||
this.loadequipmentIndicatorComment();
|
||||
},
|
||||
methods: {
|
||||
loadEquipmentTypes: function () {
|
||||
let bar = this;
|
||||
isas.ajax({
|
||||
url: AppServiceUrl.EquipmentType_FindEquipmentTypeForSelectByLevel + "?equipmentTypeLevel=20",
|
||||
data: JSON.stringify(
|
||||
{
|
||||
searchCondition: {
|
||||
equipmentTypeLevel: 20
|
||||
}
|
||||
}
|
||||
),
|
||||
type: 'get',
|
||||
isHideSuccessMsg: true,
|
||||
success: function (rst) {
|
||||
if (rst.result) {
|
||||
if (rst.result.flag) {
|
||||
bar.equipmentTypes = rst.result.resultData;
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
loadequipmentIndicatorComment: function () {
|
||||
let bar = this;
|
||||
isas.ajax({
|
||||
url: AppServiceUrl.EquipmentIndicatorConfig_FindEquipmentIndicatorCommentForSelect,
|
||||
|
||||
type: 'post',
|
||||
isHideSuccessMsg: true,
|
||||
success: function (rst) {
|
||||
if (rst.result) {
|
||||
if (rst.result.flag) {
|
||||
bar.names = rst.result.resultData;
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
setEquipmentTypeIdAction: function (para) {
|
||||
this.equipmentTypeId = para;
|
||||
|
||||
},
|
||||
setNameAction: function (para) {
|
||||
this.name = para;
|
||||
},
|
||||
save: function () {
|
||||
if (!$("#" + equipmentIndicatorConfigList.editFormId).valid()) return;
|
||||
|
||||
const data = {
|
||||
id: this.id,
|
||||
seqNo: this.seqNo,
|
||||
name: this.name,
|
||||
calculationFormula: this.calculationFormula,
|
||||
weight: this.weight,
|
||||
dataPrecision: this.dataPrecision,
|
||||
value: this.value,
|
||||
remark: this.remark,
|
||||
isActive: this.isActive,
|
||||
equipmentTypeId: this.equipmentTypeId
|
||||
};
|
||||
|
||||
isas.ajax({
|
||||
url: AppServiceUrl.EquipmentIndicatorConfig_CreateOrUpdate,
|
||||
data: JSON.stringify(data),
|
||||
success: (rst) => {
|
||||
if (rst.result?.flag) {
|
||||
equipmentIndicatorConfigList.refreshTable();
|
||||
$(this.$el).modal('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
initEditFormValidate: function () {
|
||||
$("#" + equipmentIndicatorConfigList.editFormId).validate({
|
||||
rules: {
|
||||
name: { required: true, maxlength: 200 },
|
||||
equipmentType: { required: true },
|
||||
weight: { required: true, number: true },
|
||||
dataPrecision: { required: true, number: true }
|
||||
},
|
||||
messages: {
|
||||
name: {
|
||||
required: "指标名称不能为空",
|
||||
maxlength: "名称长度不能超过200个字符"
|
||||
},
|
||||
equipmentType: { required: "请选择设备类型" },
|
||||
weight: {
|
||||
required: "权重不能为空",
|
||||
number: "请输入有效数字"
|
||||
},
|
||||
dataPrecision: {
|
||||
required: "数据精度不能为空",
|
||||
number: "请输入有效数字"
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
initEditModalValues: function (uniqueId) {
|
||||
const vueInstance = equipmentIndicatorConfigList.editModalVue;
|
||||
equipmentIndicatorConfigList.resetFormValidate();
|
||||
|
||||
if (!uniqueId) {
|
||||
vueInstance.$data = {
|
||||
header: '添加',
|
||||
id: null,
|
||||
seqNo: 0,
|
||||
name: "",
|
||||
calculationFormula: "",
|
||||
weight: 0,
|
||||
dataPrecision: 2,
|
||||
value: 0,
|
||||
remark: "",
|
||||
isActive: true,
|
||||
equipmentType: null
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
const rowData = $('#' + this.mainTableId).bootstrapTable('getRowByUniqueId', uniqueId);
|
||||
vueInstance.header = '编辑';
|
||||
vueInstance.id = rowData.id;
|
||||
vueInstance.seqNo = rowData.seqNo;
|
||||
vueInstance.name = rowData.name;
|
||||
vueInstance.calculationFormula = rowData.calculationFormula;
|
||||
vueInstance.weight = rowData.weight;
|
||||
vueInstance.dataPrecision = rowData.dataPrecision;
|
||||
vueInstance.value = rowData.value;
|
||||
vueInstance.remark = rowData.remark;
|
||||
vueInstance.isActive = rowData.isActive;
|
||||
vueInstance.equipmentType = rowData.equipmentType?.id;
|
||||
},
|
||||
|
||||
initTable: function () {
|
||||
isas.bootstrapTable({
|
||||
el: '#' + this.mainTableId,
|
||||
url: AppServiceUrl.EquipmentIndicatorConfig_FindDatas,
|
||||
toolBarEl: "#" + equipmentIndicatorConfigList.toolBarVueId,
|
||||
isInitData: false,
|
||||
singleSelect: false,
|
||||
pageList: [12,24,48,96],
|
||||
pageSize: 12,
|
||||
showColumns: false,
|
||||
showToggle: false,
|
||||
toolbarAlign: 'right',
|
||||
detailView: false,
|
||||
columns: [
|
||||
{ checkbox: true, align: 'center', width: 50 },
|
||||
{ title: '行号', align: 'center', formatter: (value, row, index) => index + 1 },
|
||||
{ field: 'seqNo', title: '序号', align: 'center' },
|
||||
{ field: 'name', title: '指标名称', align: 'center' },
|
||||
{
|
||||
field: 'calculationFormula',
|
||||
title: '计算方式描述',
|
||||
formatter: value => value || '-'
|
||||
},
|
||||
{ field: 'weight', title: '权重', align: 'center' },
|
||||
{ field: 'dataPrecision', title: '数据精度', align: 'center' },
|
||||
{ field: 'value', title: '基准值', align: 'center' },
|
||||
{
|
||||
field: 'equipmentType',
|
||||
title: '设备类型',
|
||||
formatter: value => value?.name || '-'
|
||||
},
|
||||
{
|
||||
field: 'isActive',
|
||||
title: '状态',
|
||||
formatter: value =>
|
||||
`<span class="text-${value ? 'success' : 'danger'}">
|
||||
<i class="fa fa-${value ? 'check' : 'close'}"></i>
|
||||
</span>`
|
||||
},
|
||||
{
|
||||
field: 'operation',
|
||||
title: "操作",
|
||||
formatter: (value, row) =>
|
||||
`<button class="btn-link" data-toggle="modal"
|
||||
data-target="#equipmentIndicatorConfigEditModal"
|
||||
onclick="equipmentIndicatorConfigList.initEditModalValues('${row.id}')">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</button>`
|
||||
}
|
||||
],
|
||||
queryParams: params => ({
|
||||
pageIndex: Math.floor(params.offset / params.limit) + 1,
|
||||
pageSize: params.limit,
|
||||
searchCondition: {
|
||||
name: this.toolBarVue.name,
|
||||
equipmentTypeId: treeNode?.type === 'equipment' ? treeNode.id : null
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
refreshTable: function () {
|
||||
$('#' + this.mainTableId).bootstrapTable('refresh');
|
||||
},
|
||||
|
||||
getSelectItem: () => $('#' + equipmentIndicatorConfigList.mainTableId).bootstrapTable('getSelections'),
|
||||
resetFormValidate: function () {
|
||||
$("#" + this.editFormId).validate().resetForm();
|
||||
$("#" + this.editFormId).find('.form-group').removeClass('has-success has-error');
|
||||
}
|
||||
};
|
@ -526,6 +526,12 @@ var AppServiceUrl = {
|
||||
BoardCardInfo_SpwanBoardMancfactoryJDYDList: BaseUrl + "BoardCardInfo/SpwanBoardInfoList",
|
||||
SecondaryElectricalEquipmentInfo_MergerDeviceData: BaseUrl + "SecondaryElectricalEquipmentInfo/MergerDeviceData",
|
||||
|
||||
EquipmentIndicatorConfig_DeleteByIds: BaseUrl + "EquipmentIndicatorConfig/DeleteByIds",
|
||||
EquipmentIndicatorConfig_CreateOrUpdate: BaseUrl + "EquipmentIndicatorConfig/CreateOrUpdate",
|
||||
EquipmentIndicatorConfig_FindDatas: BaseUrl + "EquipmentIndicatorConfig/FindDatas",
|
||||
EquipmentIndicatorConfig_FindEquipmentIndicatorCommentForSelect: BaseUrl + "EquipmentIndicatorConfig/FindEquipmentIndicatorCommentForSelect",
|
||||
EquipmentIndicatorConfig_CreateEquipmentIndicatorComment: BaseUrl + "EquipmentIndicatorConfig/CreateEquipmentIndicatorComment",
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user