列表列设置定位到个人

dev
cjy 3 weeks ago
parent 1e1837b9ed
commit c3d24d3540

@ -40,14 +40,14 @@ namespace DS.WMS.Core.Code.Method
{ {
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//var orgId = user.GetOrgId(); //var orgId = user.GetOrgId();
if (req.Id == 0) if (tenantDb.Queryable<CodeColumnSet>()
.Where(x => x.ColumnNo == req.ColumnNo && x.PermissionId == req.PermissionId
&& x.CreateBy == long.Parse(user.UserId) && x.Id != req.Id).Any())
{ {
if (tenantDb.Queryable<CodeColumnSet>() return DataResult.Failed("列表字段设置已存在!", MultiLanguageConst.ColumnSetExist);
.Where(x => x.ColumnNo == req.ColumnNo && x.PermissionId == req.PermissionId).Any()) }
{ if (req.Id == 0)
return DataResult.Failed("列表字段设置已存在!", MultiLanguageConst.ColumnSetExist); {
}
var data = req.Adapt<CodeColumnSet>(); var data = req.Adapt<CodeColumnSet>();
data.DefaultContent = req.Content; data.DefaultContent = req.Content;
@ -89,7 +89,7 @@ namespace DS.WMS.Core.Code.Method
{ {
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<CodeColumnSet>() var data = tenantDb.Queryable<CodeColumnSet>()
.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<ColumnSetRes>() .Select<ColumnSetRes>()
.First(); .First();
return DataResult<ColumnSetRes>.Success(data, MultiLanguageConst.DataQuerySuccess); return DataResult<ColumnSetRes>.Success(data, MultiLanguageConst.DataQuerySuccess);

Loading…
Cancel
Save