diff --git a/ds-wms-service/DS.WMS.Core/Code/Method/ColumnSetService.cs b/ds-wms-service/DS.WMS.Core/Code/Method/ColumnSetService.cs index ea35af31..cf621eb4 100644 --- a/ds-wms-service/DS.WMS.Core/Code/Method/ColumnSetService.cs +++ b/ds-wms-service/DS.WMS.Core/Code/Method/ColumnSetService.cs @@ -40,14 +40,14 @@ namespace DS.WMS.Core.Code.Method { var tenantDb = saasService.GetBizDbScopeById(user.TenantId); //var orgId = user.GetOrgId(); - if (req.Id == 0) + if (tenantDb.Queryable() + .Where(x => x.ColumnNo == req.ColumnNo && x.PermissionId == req.PermissionId + && x.CreateBy == long.Parse(user.UserId) && x.Id != req.Id).Any()) { - if (tenantDb.Queryable() - .Where(x => x.ColumnNo == req.ColumnNo && x.PermissionId == req.PermissionId).Any()) - { - return DataResult.Failed("列表字段设置已存在!", MultiLanguageConst.ColumnSetExist); - } - + return DataResult.Failed("列表字段设置已存在!", MultiLanguageConst.ColumnSetExist); + } + if (req.Id == 0) + { var data = req.Adapt(); data.DefaultContent = req.Content; @@ -89,7 +89,7 @@ namespace DS.WMS.Core.Code.Method { var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var data = tenantDb.Queryable() - .Where(x => x.PermissionId == long.Parse(permissionId) && x.ColumnNo == columnNo && x.Status == StatusEnum.Enable) + .Where(x => x.PermissionId == long.Parse(permissionId) && x.ColumnNo == columnNo && x.CreateBy == long.Parse(user.UserId) && x.Status == StatusEnum.Enable) .Select() .First(); return DataResult.Success(data, MultiLanguageConst.DataQuerySuccess);