diff --git a/ZR.Admin.WebApi/appsettings.Development.json b/ZR.Admin.WebApi/appsettings.Development.json
index 1ed9bb6..c2fc5c6 100644
--- a/ZR.Admin.WebApi/appsettings.Development.json
+++ b/ZR.Admin.WebApi/appsettings.Development.json
@@ -24,7 +24,7 @@
"DbName": "GXAssembly" //代码生成默认连接数据库,Oracle库是实例的名称
},
"urls": "http://*.*.*.*:7000", //项目启动url,如果改动端口前端对应devServer也需要进行修改
- "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是服务于哪个群体的(群体范围)
diff --git a/ZR.Service/MES/dev/DeviceAccountService.cs b/ZR.Service/MES/dev/DeviceAccountService.cs
index bd448a6..c40c2a6 100644
--- a/ZR.Service/MES/dev/DeviceAccountService.cs
+++ b/ZR.Service/MES/dev/DeviceAccountService.cs
@@ -26,11 +26,32 @@ namespace ZR.Service.MES.dev
///
public PagedInfo GetList(DeviceAccountQueryDto parm)
{
+ // 全部设备parm.FkDeviceType == 1
+ // 提取parentId
+ DeviceType typeItem = Context.Queryable()
+ .Where(it=>it.Id == parm.FkDeviceType)
+ .Where(it=>it.Status==1)
+ .First();
+ int[] typeIds = [];
+ // 二级菜单
+ if (typeItem != null && typeItem.ParentId == 1)
+ {
+ typeIds = Context.Queryable()
+ .Where(it => it.ParentId == parm.FkDeviceType)
+ .Where(it => it.Status == 1)
+ .Select(it => it.Id)
+ .ToArray();
+ }
+
+ // 非全部设备
+
+
var predicate = Expressionable.Create()
.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()