设备状态看板

This commit is contained in:
赵正易 2024-06-11 13:35:43 +08:00
parent 27f1424158
commit a823f933ae
2 changed files with 23 additions and 2 deletions

View File

@ -24,7 +24,7 @@
"DbName": "GXAssembly" //,Oracle
},
"urls": "http://*.*.*.*:7000", //urldevServer
"corsUrls": [ "http://localhost:7001", "http://localhost:7001", "http://*.*.*.*:7001", "http://0.0.0.0:7001", "http://127.0.0.1:7001" ], //","
"corsUrls": [ "http://localhost:7001", "http://localhost:7002", "http://*.*.*.*:7001", "http://0.0.0.0:7001", "http://127.0.0.1:7001" ], //","
"JwtSettings": {
"Issuer": "DOAN.NET", //token
"Audience": "DOAN.NET", //token

View File

@ -26,11 +26,32 @@ namespace ZR.Service.MES.dev
/// <returns></returns>
public PagedInfo<DeviceAccountDto> GetList(DeviceAccountQueryDto parm)
{
// 全部设备parm.FkDeviceType == 1
// 提取parentId
DeviceType typeItem = Context.Queryable<DeviceType>()
.Where(it=>it.Id == parm.FkDeviceType)
.Where(it=>it.Status==1)
.First();
int[] typeIds = [];
// 二级菜单
if (typeItem != null && typeItem.ParentId == 1)
{
typeIds = Context.Queryable<DeviceType>()
.Where(it => it.ParentId == parm.FkDeviceType)
.Where(it => it.Status == 1)
.Select(it => it.Id)
.ToArray();
}
// 非全部设备
var predicate = Expressionable.Create<DeviceAccount>()
.AndIF(!string.IsNullOrEmpty(parm.DeviceName), it => it.DeviceName.Contains(parm.DeviceName))
.AndIF(!string.IsNullOrEmpty(parm.DeviceSpecification), it => it.DeviceSpecification.Contains(parm.DeviceSpecification))
.AndIF(parm.Status > -1, it => it.Status == parm.Status)
.AndIF(parm.FkDeviceType > 0, it => it.FkDeviceType == parm.FkDeviceType)
.AndIF(typeItem != null && typeItem.ParentId > 1, it => it.FkDeviceType == parm.FkDeviceType)
.AndIF(typeItem != null && typeItem.ParentId == 1, it => typeIds.Contains(it.FkDeviceType))
;
var response = Queryable()