Browse Source

Merge branch 'master' into kitchenmanage

tmp
zhaoy 6 months ago
parent
commit
e9beef72fb
7 changed files with 47 additions and 2 deletions
  1. +1
    -0
      BPA.SAAS.Manage.Application/DataBase/Dtos/GoodsTechnology/GoodsTechnologDelete.cs
  2. +2
    -2
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsTechnologyService.cs
  3. +4
    -0
      BPA.SAAS.Manage.Application/Device/Dtos/ProductFunction/ProductFunctionBaseDto.cs
  4. +1
    -0
      BPA.SAAS.Manage.Application/Device/Dtos/ProductFunction/ProductFunctionPageBase.cs
  5. +4
    -0
      BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs
  6. +31
    -0
      BPA.SAAS.Manage.Comm/Enum/EventTypeEnum.cs
  7. +4
    -0
      BPA.SAAS.Manage.Core/Product/BPA_ProductFunction.cs

+ 1
- 0
BPA.SAAS.Manage.Application/DataBase/Dtos/GoodsTechnology/GoodsTechnologDelete.cs View File

@@ -10,5 +10,6 @@ namespace BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsTechnology
{
public string devideId { get; set; }
public string goodsId { get; set; }
public string goodsAttributeId { get; set; }
}
}

+ 2
- 2
BPA.SAAS.Manage.Application/DataBase/Services/GoodsTechnologyService.cs View File

@@ -31,7 +31,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services
try
{
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.Deleteable(list).ExecuteCommand();
//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)
{
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)
{
return await _db.Deleteable(item).ExecuteCommandAsync() > 0;


+ 4
- 0
BPA.SAAS.Manage.Application/Device/Dtos/ProductFunction/ProductFunctionBaseDto.cs View File

@@ -59,5 +59,9 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.ProductFunction
public string Description { get; set; }
public string ProductId { get; set; }
public string DataJson { get; set; }
/// <summary>
/// 事件类型 0信息 1告警 2故障
/// </summary>
public EventTypeEnum EventType { get; set; }
}
}

+ 1
- 0
BPA.SAAS.Manage.Application/Device/Dtos/ProductFunction/ProductFunctionPageBase.cs View File

@@ -16,6 +16,7 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.ProductFunction
public string Vesion { get; set; }
public string ProductVesionId { get; set; }
public string ProductId { get; set; }
public bool? IsDefault { get; set; }
public CommonStatus? Status { get; set; }
}
}

+ 4
- 0
BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs View File

@@ -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.Type), (x, b) => x.Type==Convert.ToInt32(inputDto.Type))
.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)
.OrderBy((x, b) => x.CreateAt, OrderByType.Desc)
.Select((x, b) => new
@@ -63,6 +64,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services
ReadWrite = x.ReadWrite,
Description= x.Description,
IsDefault= x.IsDefault,
EventType= x.EventType,
})
.ToPageListAsync(inputDto.Current, inputDto.PageSize, total);
return new PageUtil()
@@ -164,6 +166,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services
ReadWrite = inputDto.ReadWrite,
Description=inputDto.Description,
ProductId= inputDto.ProductId,
EventType= inputDto.EventType,
DataJson= inputDto.DataJson?.Replace("\n",""),
}).CallEntityMethod(m => m.Create()).ExecuteCommandAsync();
return res > 0;
@@ -195,6 +198,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services
data.BoolLabel = inputDto.BoolLabel;
data.ReadWrite = inputDto.ReadWrite;
data.Description= inputDto.Description;
data.EventType = inputDto.EventType;
data.DataJson= inputDto.DataJson?.Replace("\n", "");
data.Status = (CommonStatus)Enum.ToObject(typeof(CommonStatus), inputDto.Status);
var res =await _db.Updateable(data).ExecuteCommandAsync();


+ 31
- 0
BPA.SAAS.Manage.Comm/Enum/EventTypeEnum.cs View File

@@ -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,
}
}

+ 4
- 0
BPA.SAAS.Manage.Core/Product/BPA_ProductFunction.cs View File

@@ -78,5 +78,9 @@ namespace BPA.SAAS.Manage.Core.Product
public string ProductId { get; set; }
public string DataJson { get; set; }
public bool IsDefault { get; set; }
/// <summary>
/// 事件类型 0信息 1告警 2故障
/// </summary>
public EventTypeEnum EventType { get; set; }
}
}

Loading…
Cancel
Save