@@ -10,5 +10,6 @@ namespace BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsTechnology | |||||
{ | { | ||||
public string devideId { get; set; } | public string devideId { get; set; } | ||||
public string goodsId { get; set; } | public string goodsId { get; set; } | ||||
public string goodsAttributeId { get; set; } | |||||
} | } | ||||
} | } |
@@ -31,7 +31,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
try | try | ||||
{ | { | ||||
var addlist = new List<BPA_GoodsTechnologyAction>(); | var addlist = new List<BPA_GoodsTechnologyAction>(); | ||||
var list = _db.Queryable<BPA_GoodsTechnologyAction>().Where(x => x.DeviceId == inputDto[0].DeviceId && x.GoodsId == inputDto[0].GoodsId).ToList(); | |||||
var list = _db.Queryable<BPA_GoodsTechnologyAction>().Where(x => x.DeviceId == inputDto[0].DeviceId && x.GoodsId == inputDto[0].GoodsId && x.GoodsAttributeId == inputDto[0].GoodsAttributeId).ToList(); | |||||
_db.Ado.BeginTran(); | _db.Ado.BeginTran(); | ||||
_db.Deleteable(list).ExecuteCommand(); | _db.Deleteable(list).ExecuteCommand(); | ||||
//var list = _db.Queryable<BPA_GoodsTechnologyAction>().Where(x => x.GroupId == groupId && x.IsDeleted == 0).ToList(); | //var list = _db.Queryable<BPA_GoodsTechnologyAction>().Where(x => x.GroupId == groupId && x.IsDeleted == 0).ToList(); | ||||
@@ -175,7 +175,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
} | } | ||||
public async Task<bool> DeleteGoodsTechnologyAction(GoodsTechnologDelete dto) | public async Task<bool> DeleteGoodsTechnologyAction(GoodsTechnologDelete dto) | ||||
{ | { | ||||
var item = await _db.Queryable<BPA_GoodsTechnologyAction>().Where(x => x.DeviceId == dto.devideId && x.GoodsId == dto.goodsId).ToListAsync(); | |||||
var item = await _db.Queryable<BPA_GoodsTechnologyAction>().Where(x => x.DeviceId == dto.devideId && x.GoodsId == dto.goodsId && x.GoodsAttributeId== dto.goodsAttributeId).ToListAsync(); | |||||
if (item.Count > 0) | if (item.Count > 0) | ||||
{ | { | ||||
return await _db.Deleteable(item).ExecuteCommandAsync() > 0; | return await _db.Deleteable(item).ExecuteCommandAsync() > 0; | ||||
@@ -59,5 +59,9 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.ProductFunction | |||||
public string Description { get; set; } | public string Description { get; set; } | ||||
public string ProductId { get; set; } | public string ProductId { get; set; } | ||||
public string DataJson { get; set; } | public string DataJson { get; set; } | ||||
/// <summary> | |||||
/// 事件类型 0信息 1告警 2故障 | |||||
/// </summary> | |||||
public EventTypeEnum EventType { get; set; } | |||||
} | } | ||||
} | } |
@@ -16,6 +16,7 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.ProductFunction | |||||
public string Vesion { get; set; } | public string Vesion { get; set; } | ||||
public string ProductVesionId { get; set; } | public string ProductVesionId { get; set; } | ||||
public string ProductId { get; set; } | public string ProductId { get; set; } | ||||
public bool? IsDefault { get; set; } | |||||
public CommonStatus? Status { get; set; } | public CommonStatus? Status { get; set; } | ||||
} | } | ||||
} | } |
@@ -39,6 +39,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.Name), (x, b) => x.Name.Contains(inputDto.Name)) | .WhereIF(!string.IsNullOrWhiteSpace(inputDto.Name), (x, b) => x.Name.Contains(inputDto.Name)) | ||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.Type), (x, b) => x.Type==Convert.ToInt32(inputDto.Type)) | .WhereIF(!string.IsNullOrWhiteSpace(inputDto.Type), (x, b) => x.Type==Convert.ToInt32(inputDto.Type)) | ||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.Vesion), (x, b) => x.DeviceVersionKey == inputDto.Vesion) | .WhereIF(!string.IsNullOrWhiteSpace(inputDto.Vesion), (x, b) => x.DeviceVersionKey == inputDto.Vesion) | ||||
//.WhereIF(inputDto.IsDefault!=null, (x, b) => x.IsDefault == inputDto.IsDefault) | |||||
.WhereIF(inputDto.Status != null, (x, b) => x.Status == inputDto.Status) | .WhereIF(inputDto.Status != null, (x, b) => x.Status == inputDto.Status) | ||||
.OrderBy((x, b) => x.CreateAt, OrderByType.Desc) | .OrderBy((x, b) => x.CreateAt, OrderByType.Desc) | ||||
.Select((x, b) => new | .Select((x, b) => new | ||||
@@ -63,6 +64,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
ReadWrite = x.ReadWrite, | ReadWrite = x.ReadWrite, | ||||
Description= x.Description, | Description= x.Description, | ||||
IsDefault= x.IsDefault, | IsDefault= x.IsDefault, | ||||
EventType= x.EventType, | |||||
}) | }) | ||||
.ToPageListAsync(inputDto.Current, inputDto.PageSize, total); | .ToPageListAsync(inputDto.Current, inputDto.PageSize, total); | ||||
return new PageUtil() | return new PageUtil() | ||||
@@ -164,6 +166,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
ReadWrite = inputDto.ReadWrite, | ReadWrite = inputDto.ReadWrite, | ||||
Description=inputDto.Description, | Description=inputDto.Description, | ||||
ProductId= inputDto.ProductId, | ProductId= inputDto.ProductId, | ||||
EventType= inputDto.EventType, | |||||
DataJson= inputDto.DataJson?.Replace("\n",""), | DataJson= inputDto.DataJson?.Replace("\n",""), | ||||
}).CallEntityMethod(m => m.Create()).ExecuteCommandAsync(); | }).CallEntityMethod(m => m.Create()).ExecuteCommandAsync(); | ||||
return res > 0; | return res > 0; | ||||
@@ -195,6 +198,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
data.BoolLabel = inputDto.BoolLabel; | data.BoolLabel = inputDto.BoolLabel; | ||||
data.ReadWrite = inputDto.ReadWrite; | data.ReadWrite = inputDto.ReadWrite; | ||||
data.Description= inputDto.Description; | data.Description= inputDto.Description; | ||||
data.EventType = inputDto.EventType; | |||||
data.DataJson= inputDto.DataJson?.Replace("\n", ""); | data.DataJson= inputDto.DataJson?.Replace("\n", ""); | ||||
data.Status = (CommonStatus)Enum.ToObject(typeof(CommonStatus), inputDto.Status); | data.Status = (CommonStatus)Enum.ToObject(typeof(CommonStatus), inputDto.Status); | ||||
var res =await _db.Updateable(data).ExecuteCommandAsync(); | var res =await _db.Updateable(data).ExecuteCommandAsync(); | ||||
@@ -0,0 +1,31 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.ComponentModel; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Comm.Enum | |||||
{ | |||||
/// <summary> | |||||
/// 事件类型 | |||||
/// </summary> | |||||
public enum EventTypeEnum | |||||
{ | |||||
/// <summary> | |||||
/// 信息 | |||||
/// </summary> | |||||
[Description("信息")] | |||||
Info =0, | |||||
/// <summary> | |||||
/// 告警 | |||||
/// </summary> | |||||
[Description("告警")] | |||||
Alarm = 1, | |||||
/// <summary> | |||||
/// 故障 | |||||
/// </summary> | |||||
[Description("故障")] | |||||
Breakdown = 2, | |||||
} | |||||
} |
@@ -78,5 +78,9 @@ namespace BPA.SAAS.Manage.Core.Product | |||||
public string ProductId { get; set; } | public string ProductId { get; set; } | ||||
public string DataJson { get; set; } | public string DataJson { get; set; } | ||||
public bool IsDefault { get; set; } | public bool IsDefault { get; set; } | ||||
/// <summary> | |||||
/// 事件类型 0信息 1告警 2故障 | |||||
/// </summary> | |||||
public EventTypeEnum EventType { get; set; } | |||||
} | } | ||||
} | } |