diff --git a/PVDEMCS/.vs/PVDEMCS/v17/.suo b/PVDEMCS/.vs/PVDEMCS/v17/.suo
index e318c28..b8763c0 100644
Binary files a/PVDEMCS/.vs/PVDEMCS/v17/.suo and b/PVDEMCS/.vs/PVDEMCS/v17/.suo differ
diff --git a/PVDEMCS/PVDEMCS/Services/IDeviceService.cs b/PVDEMCS/PVDEMCS/Services/IDeviceService.cs
index 3a9a847..566f9bb 100644
--- a/PVDEMCS/PVDEMCS/Services/IDeviceService.cs
+++ b/PVDEMCS/PVDEMCS/Services/IDeviceService.cs
@@ -19,6 +19,7 @@ namespace PVDEMCS.Services
///
/// 控制器编号
/// 控制器名称
+ /// 是否启用
/// 当前页
/// 页大小
///
@@ -29,6 +30,7 @@ namespace PVDEMCS.Services
///
/// 控制器编号
/// 控制器名称
+ /// 是否启用
///
Result> GetDeviceInfoList(string deviceCode="", string deviceName = "", bool? activated = false);
@@ -72,6 +74,7 @@ namespace PVDEMCS.Services
/// 设备类型
/// 点位编号
/// 点位列表
+ /// 是否启用
/// 当前页
/// 页大小
///
@@ -87,6 +90,7 @@ namespace PVDEMCS.Services
/// 设备类型
/// 点位编号
/// 点位列表
+ /// 是否启用
///
Result> GetDevicePointList(string deviceName="", string deviceCode = "", string equipmentName = "", string equipmentCode = "", string equipmentType = "", string pointCode = "", string pointName = "", bool? activated = true);
diff --git a/PVDEMCS/PVDEMCS/Services/IEquipmentRecordService.cs b/PVDEMCS/PVDEMCS/Services/IEquipmentRecordService.cs
index 0f1cba1..0e8574a 100644
--- a/PVDEMCS/PVDEMCS/Services/IEquipmentRecordService.cs
+++ b/PVDEMCS/PVDEMCS/Services/IEquipmentRecordService.cs
@@ -6,9 +6,9 @@ using PVDEMCS.Services.Repositories.Entities;
namespace PVDEMCS.Services
{
- /*
- * 设备数据记录与统计 服务层 接口
- */
+ ///
+ /// 设备数据记录与统计 服务层 接口
+ ///
public interface IEquipmentRecordService : IDependency
{
#region 设备状态记录
@@ -51,6 +51,7 @@ namespace PVDEMCS.Services
///
/// 设备Id
/// 设备状态,运行:Run,待机:Stop,报警:Alarm
+ /// 记录时间
///
Result AddUpdateEquipmentRecord(string equipmentId, string state, DateTime dateTime);
diff --git a/PVDEMCS/PVDEMCS/Services/IEquipmentService.cs b/PVDEMCS/PVDEMCS/Services/IEquipmentService.cs
index 7d2fa9c..42d30f1 100644
--- a/PVDEMCS/PVDEMCS/Services/IEquipmentService.cs
+++ b/PVDEMCS/PVDEMCS/Services/IEquipmentService.cs
@@ -6,9 +6,9 @@ using PVDEMCS.Services.Models;
namespace PVDEMCS.Services
{
- /*
- * 设备管理 服务层 接口
- */
+ ///
+ /// 设备管理 服务层 接口
+ ///
public interface IEquipmentService : IDependency
{
///
@@ -28,6 +28,7 @@ namespace PVDEMCS.Services
///
/// 设备名称
/// 设备编号
+ /// 设备类型
/// 是否启用
Result> GetEquipmentList(string equipmentName = "", string equipmentCode = "", string equipmentType = "", bool? activated = true);
@@ -41,21 +42,21 @@ namespace PVDEMCS.Services
///
/// 添加设备信息
///
- ///
+ ///
///
Result AddEquipment(EquipmentInfo info);
///
/// 更新设备信息
///
- ///
+ ///
///
Result UpdateEquipment(EquipmentInfo info);
///
/// 删除设备信息
///
- ///
+ ///
///
Result DeleteEquipment(string id);
}
diff --git a/PVDEMCS/PVDEMCS/Services/ISysConfigService.cs b/PVDEMCS/PVDEMCS/Services/ISysConfigService.cs
index 862cc2c..d792d01 100644
--- a/PVDEMCS/PVDEMCS/Services/ISysConfigService.cs
+++ b/PVDEMCS/PVDEMCS/Services/ISysConfigService.cs
@@ -6,9 +6,9 @@ using PVDEMCS.Services.Models;
namespace PVDEMCS.Services
{
- /*
- * 系统参数设置 服务层 接口
- */
+ ///
+ /// 系统参数设置 服务层 接口
+ ///
public interface ISysConfigService : IDependency
{
///
@@ -39,21 +39,22 @@ namespace PVDEMCS.Services
///
/// 获取获取系统参数设置明细
///
- ///
+ ///
+ ///
///
Result GetSysConfigDetailNameOrKey(string name, string key = "");
///
/// 添加系统参数设置
///
- ///
+ ///
///
Result AddSysConfig(SysConfig info);
///
/// 更新系统参数设置
///
- ///
+ ///
Result UpdateSysConfig(SysConfig info);
diff --git a/PVDEMCS/PVDEMCS/Services/Impl/DeviceService.cs b/PVDEMCS/PVDEMCS/Services/Impl/DeviceService.cs
index 8d80cc9..686866f 100644
--- a/PVDEMCS/PVDEMCS/Services/Impl/DeviceService.cs
+++ b/PVDEMCS/PVDEMCS/Services/Impl/DeviceService.cs
@@ -30,6 +30,7 @@ namespace PVDEMCS.Services.Impl
///
/// 控制器编号
/// 控制器名称
+ /// 是否启用
/// 当前页
/// 页大小
///
@@ -45,6 +46,7 @@ namespace PVDEMCS.Services.Impl
///
/// 控制器编号
/// 控制器名称
+ /// 是否启用
///
public Result> GetDeviceInfoList(string deviceCode, string deviceName, bool? activated = false)
{
@@ -120,6 +122,7 @@ namespace PVDEMCS.Services.Impl
/// 设备类型
/// 点位编号
/// 点位列表
+ /// 是否启用
/// 当前页
/// 页大小
///
@@ -140,6 +143,7 @@ namespace PVDEMCS.Services.Impl
/// 设备类型
/// 点位编号
/// 点位列表
+ /// 是否启用
///
public Result> GetDevicePointList(string deviceName, string deviceCode, string equipmentName, string equipmentCode, string equipmentType, string pointCode, string pointName, bool? activated)
{
@@ -171,7 +175,7 @@ namespace PVDEMCS.Services.Impl
///
/// 添加PLC控制器点位
///
- ///
+ ///
///
public Result AddDevicePoint(DevicePoint info)
{
@@ -183,7 +187,7 @@ namespace PVDEMCS.Services.Impl
///
/// 更新PLC控制器点位
///
- ///
+ ///
///
public Result UpdateDevicePoint(DevicePoint info)
{
diff --git a/PVDEMCS/PVDEMCS/Services/Impl/EquipmentRecordService.cs b/PVDEMCS/PVDEMCS/Services/Impl/EquipmentRecordService.cs
index dcf79c5..a1436de 100644
--- a/PVDEMCS/PVDEMCS/Services/Impl/EquipmentRecordService.cs
+++ b/PVDEMCS/PVDEMCS/Services/Impl/EquipmentRecordService.cs
@@ -11,9 +11,9 @@ using PVDEMCS.Services.Repositories.Entities;
namespace PVDEMCS.Services.Impl
{
- /*
- * 设备数据记录与统计 服务层 实现
- */
+ ///
+ /// 设备数据记录与统计 服务层 实现
+ ///
internal class EquipmentRecordService : IEquipmentRecordService
{
private readonly IEquipmentRecordRepository _equipmentRecordRepository;
diff --git a/PVDEMCS/PVDEMCS/Services/Impl/EquipmentService.cs b/PVDEMCS/PVDEMCS/Services/Impl/EquipmentService.cs
index 33673d7..6692703 100644
--- a/PVDEMCS/PVDEMCS/Services/Impl/EquipmentService.cs
+++ b/PVDEMCS/PVDEMCS/Services/Impl/EquipmentService.cs
@@ -13,9 +13,9 @@ using Masuit.Tools;
namespace PVDEMCS.Services.Impl
{
- /*
- * 设备管理 服务层 接口
- */
+ ///
+ /// 设备管理 服务层 接口
+ ///
internal class EquipmentService : IEquipmentService
{
private readonly IEquipmentRepository _equipmentRepository;
@@ -123,7 +123,7 @@ namespace PVDEMCS.Services.Impl
///
/// 添加设备信息
///
- ///
+ ///
///
public Result AddEquipment(EquipmentInfo info)
{
@@ -135,7 +135,7 @@ namespace PVDEMCS.Services.Impl
///
/// 更新设备信息
///
- ///
+ ///
///
public Result UpdateEquipment(EquipmentInfo info)
{
@@ -147,7 +147,7 @@ namespace PVDEMCS.Services.Impl
///
/// 删除设备信息
///
- ///
+ ///
///
public Result DeleteEquipment(string id)
{
diff --git a/PVDEMCS/PVDEMCS/Services/Impl/SysConfigService.cs b/PVDEMCS/PVDEMCS/Services/Impl/SysConfigService.cs
index 98dfc47..d284b6a 100644
--- a/PVDEMCS/PVDEMCS/Services/Impl/SysConfigService.cs
+++ b/PVDEMCS/PVDEMCS/Services/Impl/SysConfigService.cs
@@ -10,9 +10,9 @@ using PVDEMCS.Services.Repositories.Impl;
namespace PVDEMCS.Services.Impl
{
- /*
- * 系统参数设置 服务层 实现
- */
+ ///
+ /// 系统参数设置 服务层 实现
+ ///
internal class SysConfigService : ISysConfigService
{
private readonly ISysConfigRepository _sysConfigRepository;
@@ -70,7 +70,8 @@ namespace PVDEMCS.Services.Impl
///
/// 获取获取系统参数设置明细
///
- ///
+ /// 名称
+ /// 键值
///
public Result GetSysConfigDetailNameOrKey(string name, string key = "")
{
@@ -90,7 +91,7 @@ namespace PVDEMCS.Services.Impl
///
/// 添加系统参数设置
///
- ///
+ ///
///
public Result AddSysConfig(SysConfig info)
{
@@ -102,7 +103,7 @@ namespace PVDEMCS.Services.Impl
///
/// 更新系统参数设置
///
- ///
+ ///
public Result UpdateSysConfig(SysConfig info)
{
diff --git a/PVDEMCS/PVDEMCS/Services/Repositories/IDeviceRepository.cs b/PVDEMCS/PVDEMCS/Services/Repositories/IDeviceRepository.cs
index e6ddea4..ab6bbd5 100644
--- a/PVDEMCS/PVDEMCS/Services/Repositories/IDeviceRepository.cs
+++ b/PVDEMCS/PVDEMCS/Services/Repositories/IDeviceRepository.cs
@@ -7,10 +7,10 @@ using PVDEMCS.Services.Models;
namespace PVDEMCS.Services.Repositories
{
- /*
- * PLC控制器 数据层 接口
- */
- public interface IDeviceRepository: IDependency
+ ///
+ /// PLC控制器 数据层 接口
+ ///
+ public interface IDeviceRepository : IDependency
{
#region PLC控制器
@@ -19,6 +19,7 @@ namespace PVDEMCS.Services.Repositories
///
/// 控制器编号
/// 控制器名称
+ /// 是否启用
/// 当前页
/// 页大小
///
@@ -29,6 +30,7 @@ namespace PVDEMCS.Services.Repositories
///
/// 控制器编号
/// 控制器名称
+ /// 是否启用
///
Result> GetDeviceInfoList(string deviceCode, string deviceName, bool? activated = false);
diff --git a/PVDEMCS/PVDEMCS/Services/Repositories/IEquipmentRecordRepository.cs b/PVDEMCS/PVDEMCS/Services/Repositories/IEquipmentRecordRepository.cs
index 5f34159..4355a1b 100644
--- a/PVDEMCS/PVDEMCS/Services/Repositories/IEquipmentRecordRepository.cs
+++ b/PVDEMCS/PVDEMCS/Services/Repositories/IEquipmentRecordRepository.cs
@@ -9,9 +9,9 @@ using Microsoft.EntityFrameworkCore;
namespace PVDEMCS.Services.Repositories
{
- /*
- * 设备数据记录与统计 数据层 接口
- */
+ ///
+ /// 设备数据记录与统计 数据层 接口
+ ///
public interface IEquipmentRecordRepository : IDependency
{
#region 设备状态记录
@@ -47,6 +47,7 @@ namespace PVDEMCS.Services.Repositories
///
/// 设备Id
/// 设备状态,运行:Run,待机:Stop,报警:Alarm
+ /// 记录时间
///
Result AddUpdateEquipmentRecord(string equipmentId, string state, DateTime dateTime);
diff --git a/PVDEMCS/PVDEMCS/Services/Repositories/IEquipmentRepository.cs b/PVDEMCS/PVDEMCS/Services/Repositories/IEquipmentRepository.cs
index 5d5affe..c0320c0 100644
--- a/PVDEMCS/PVDEMCS/Services/Repositories/IEquipmentRepository.cs
+++ b/PVDEMCS/PVDEMCS/Services/Repositories/IEquipmentRepository.cs
@@ -7,9 +7,9 @@ using PVDEMCS.Services.Models;
namespace PVDEMCS.Services.Repositories
{
- /*
- * 设备管理 数据层 接口
- */
+ ///
+ /// 设备管理 数据层 接口
+ ///
public interface IEquipmentRepository : IDependency
{
///
@@ -56,7 +56,7 @@ namespace PVDEMCS.Services.Repositories
///
/// 删除设备信息
///
- ///
+ ///
///
Result DeleteEquipment(string id);
}
diff --git a/PVDEMCS/PVDEMCS/Services/Repositories/ISysConfigRepository.cs b/PVDEMCS/PVDEMCS/Services/Repositories/ISysConfigRepository.cs
index d6c69db..f09ebc0 100644
--- a/PVDEMCS/PVDEMCS/Services/Repositories/ISysConfigRepository.cs
+++ b/PVDEMCS/PVDEMCS/Services/Repositories/ISysConfigRepository.cs
@@ -7,9 +7,9 @@ using PVDEMCS.Services.Models;
namespace PVDEMCS.Services.Repositories
{
- /*
- * 系统参数设置 数据层 接口
- */
+ ///
+ /// 系统参数设置 数据层 接口
+ ///
public interface ISysConfigRepository : IDependency
{
///
@@ -40,7 +40,8 @@ namespace PVDEMCS.Services.Repositories
///
/// 获取获取系统参数设置明细
///
- ///
+ ///
+ ///
///
Result GetSysConfigDetailNameOrKey(string name, string key = "");
diff --git a/PVDEMCS/PVDEMCS/Services/Repositories/Impl/DeviceRepository.cs b/PVDEMCS/PVDEMCS/Services/Repositories/Impl/DeviceRepository.cs
index 7e631e8..33e95a1 100644
--- a/PVDEMCS/PVDEMCS/Services/Repositories/Impl/DeviceRepository.cs
+++ b/PVDEMCS/PVDEMCS/Services/Repositories/Impl/DeviceRepository.cs
@@ -13,9 +13,9 @@ using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
namespace PVDEMCS.Services.Repositories.Impl
{
- /*
- * PLC控制器 数据层 实现
- */
+ ///
+ /// PLC控制器 数据层 实现
+ ///
internal class DeviceRepository : IDeviceRepository
{
#region PLC控制器
@@ -25,6 +25,7 @@ namespace PVDEMCS.Services.Repositories.Impl
///
/// 控制器编号
/// 控制器名称
+ /// 是否启用
/// 当前页
/// 页大小
///
@@ -46,6 +47,7 @@ namespace PVDEMCS.Services.Repositories.Impl
///
/// 控制器编号
/// 控制器名称
+ /// 是否启用
///
public Result> GetDeviceInfoList(string deviceCode, string deviceName, bool? activated = false)
{
diff --git a/PVDEMCS/PVDEMCS/Services/Repositories/Impl/EquipmentRecordRepository.cs b/PVDEMCS/PVDEMCS/Services/Repositories/Impl/EquipmentRecordRepository.cs
index 44aeb45..6be12ec 100644
--- a/PVDEMCS/PVDEMCS/Services/Repositories/Impl/EquipmentRecordRepository.cs
+++ b/PVDEMCS/PVDEMCS/Services/Repositories/Impl/EquipmentRecordRepository.cs
@@ -108,7 +108,7 @@ namespace PVDEMCS.Services.Repositories.Impl
///
/// 设备Id
/// 设备状态,运行:Run,待机:Stop,报警:Alarm
- /// 设备Id
+ /// 记录时间
///
public Result AddUpdateEquipmentRecord(string equipmentId, string state, DateTime dateTime)
{
@@ -333,38 +333,40 @@ namespace PVDEMCS.Services.Repositories.Impl
TotalAlarmTime = f.Sum(f => f.TotalAlarmTime),
TotalStopTime = f.Sum(f => f.TotalStopTime),
}).ToList();
- if (values.Count > 0)
+ if (values.Count == 0)
{
- if (list.IsNullOrEmpty())
+ return new Result("没有汇总数据");
+ }
+
+ if (list.IsNullOrEmpty())
+ {
+ foreach (var item in values)
{
- foreach (var item in values)
- {
- item.Create();
- }
- context.EquipmentRecordTotals.AddRange(values);
+ item.Create();
}
- else
+ context.EquipmentRecordTotals.AddRange(values);
+ }
+ else
+ {
+ foreach (var item in list)
{
- foreach (var item in list)
+ var value = values.Where(f => f.EquipmentId == item.EquipmentId).FirstOrDefault();
+ if (value.IsNullOrEmpty())
{
- var value = values.Where(f => f.EquipmentId == item.EquipmentId).FirstOrDefault();
- if (value.IsNullOrEmpty())
- {
- value.Create();
- context.EquipmentRecordTotals.Add(value);
- }
- else
- {
- item.FurnaceNum += value.FurnaceNum;
- item.TotalAlarmTime += value.TotalAlarmTime;
- item.TotalRunningTime += value.TotalRunningTime;
- item.TotalStopTime += value.TotalStopTime;
- item.Update();
- }
+ value.Create();
+ context.EquipmentRecordTotals.Add(value);
+ }
+ else
+ {
+ item.FurnaceNum += value.FurnaceNum;
+ item.TotalAlarmTime += value.TotalAlarmTime;
+ item.TotalRunningTime += value.TotalRunningTime;
+ item.TotalStopTime += value.TotalStopTime;
+ item.Update();
}
}
- context.SaveChanges();
}
+ context.SaveChanges();
return new Result();
@@ -603,9 +605,6 @@ namespace PVDEMCS.Services.Repositories.Impl
}
}
-
-
-
#endregion
}
}
diff --git a/PVDEMCS/PVDEMCS/Services/Repositories/Impl/EquipmentRepository.cs b/PVDEMCS/PVDEMCS/Services/Repositories/Impl/EquipmentRepository.cs
index b89e750..10fcee0 100644
--- a/PVDEMCS/PVDEMCS/Services/Repositories/Impl/EquipmentRepository.cs
+++ b/PVDEMCS/PVDEMCS/Services/Repositories/Impl/EquipmentRepository.cs
@@ -8,9 +8,9 @@ using PVDEMCS.Services.Repositories.Entities;
namespace PVDEMCS.Services.Repositories
{
- /*
- * 设备信息 数据层 实现
- */
+ ///
+ /// 设备信息 数据层 实现
+ ///
internal class EquipmentRepository : IEquipmentRepository
{
///
diff --git a/PVDEMCS/PVDEMCS/Services/Repositories/Impl/SysConfigRepository.cs b/PVDEMCS/PVDEMCS/Services/Repositories/Impl/SysConfigRepository.cs
index 6176eea..b430501 100644
--- a/PVDEMCS/PVDEMCS/Services/Repositories/Impl/SysConfigRepository.cs
+++ b/PVDEMCS/PVDEMCS/Services/Repositories/Impl/SysConfigRepository.cs
@@ -7,9 +7,9 @@ using PVDEMCS.Services.Repositories.Entities;
namespace PVDEMCS.Services.Repositories.Impl
{
- /*
- * 系统参数设置 数据层 实现
- */
+ ///
+ /// 系统参数设置 数据层 实现
+ ///
internal class SysConfigRepository : ISysConfigRepository
{
///
@@ -101,7 +101,8 @@ namespace PVDEMCS.Services.Repositories.Impl
///
/// 获取获取系统参数设置明细
///
- ///
+ ///
+ ///
///
public Result GetSysConfigDetailNameOrKey(string name, string key)
{