|
|
@@ -3,6 +3,7 @@ using BPA.SAAS.Manage.Application.Device.Interface; |
|
|
|
using BPA.SAAS.Manage.Comm.Const; |
|
|
|
using BPA.SAAS.Manage.Comm.Enum; |
|
|
|
using BPA.SAAS.Manage.Core.Base; |
|
|
|
using BPA.SAAS.Manage.Core.Device; |
|
|
|
using BPA.SAAS.Manage.Core.Product; |
|
|
|
using Microsoft.AspNetCore.Server.IISIntegration; |
|
|
|
using Newtonsoft.Json; |
|
|
@@ -87,6 +88,42 @@ namespace BPA.SAAS.Manage.Application.Device.Services |
|
|
|
.ToListAsync(); |
|
|
|
return res; |
|
|
|
} |
|
|
|
public async Task<List<ProductFunctionView>> GetProductFunction(string deviceId) |
|
|
|
{ |
|
|
|
var device=_db.Queryable<BPA_DeviceInfo>().Where(x => x.Id == deviceId).First(); |
|
|
|
var res = await _db.Queryable<BPA_ProductFunction>().Where(x => x.DeviceVersionKey == device.ProductVersionId) |
|
|
|
.OrderBy(i => i.CreateAt, OrderByType.Desc) |
|
|
|
.Select(x => new ProductFunctionView() |
|
|
|
{ |
|
|
|
Id = x.Id.SelectAll(), |
|
|
|
Name = x.Name, |
|
|
|
//IsBatch = SqlFunc.Subqueryable<BPA_ProductFunctionAction>().Where(p => p.ProductFunctionId == x.Id).Any() |
|
|
|
}) |
|
|
|
.Mapper(x => |
|
|
|
{ |
|
|
|
x.ProductFunctionValue = _db.Queryable<BPA_ProductFunctionAction>().Where(p => p.ProductFunctionId == x.Id).ToList(); |
|
|
|
}) |
|
|
|
.ToListAsync(); |
|
|
|
return res; |
|
|
|
} |
|
|
|
public async Task<List<ProductFunctionView>> GetProductFunction_alm(string deviceId) |
|
|
|
{ |
|
|
|
var device = _db.Queryable<BPA_DeviceInfo>().Where(x => x.Id == deviceId).First(); |
|
|
|
var res = await _db.Queryable<BPA_ProductFunction>().Where(x => x.DeviceVersionKey == device.ProductVersionId) |
|
|
|
.OrderBy(i => i.CreateAt, OrderByType.Desc) |
|
|
|
.Select(x => new ProductFunctionView() |
|
|
|
{ |
|
|
|
Id = x.Id.SelectAll(), |
|
|
|
Name = x.Name, |
|
|
|
//IsBatch = SqlFunc.Subqueryable<BPA_ProductFunctionAction>().Where(p => p.ProductFunctionId == x.Id).Any() |
|
|
|
}) |
|
|
|
.Mapper(x => |
|
|
|
{ |
|
|
|
x.ProductFunctionValue = _db.Queryable<BPA_ProductFunctionAction>().Where(p => p.ProductFunctionId == x.Id).ToList(); |
|
|
|
}) |
|
|
|
.ToListAsync(); |
|
|
|
return res; |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 添加功能 |
|
|
|
/// </summary> |
|
|
|