|
|
|
@ -386,7 +386,7 @@ public class CommonService : ICommonService
|
|
|
|
|
{
|
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("账号不存在或账号禁用,请检查!"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (userInfo.MD5Password != model.Password)
|
|
|
|
|
{
|
|
|
|
@ -864,7 +864,7 @@ public class CommonService : ICommonService
|
|
|
|
|
|
|
|
|
|
#region 客户端通用
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取权限树列表-客户端
|
|
|
|
|
/// </summary>
|
|
|
|
@ -1450,10 +1450,10 @@ public class CommonService : ICommonService
|
|
|
|
|
return db.Queryable<T>(); //超级管理员特权
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var moduleName = typeof(T).Name.ToLower();
|
|
|
|
|
var moduleName = typeof(T).Name.ToLower();
|
|
|
|
|
|
|
|
|
|
var rule = tenantDb.Queryable<CodeDataRule>()
|
|
|
|
|
.First(u => u.UserId == long.Parse(user.UserId) && u.PermissionEntity.ToLower() == moduleName && u.Status == StatusEnum.Enable);
|
|
|
|
|
.First(u => u.UserId == long.Parse(user.UserId) && u.PermissionEntity.ToLower() == moduleName && u.Status == StatusEnum.Enable);
|
|
|
|
|
if (rule == null) return db.Queryable<T>(); //没有设置数据规则,那么视为该资源允许被任何主体查看
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1613,9 +1613,10 @@ public class CommonService : ICommonService
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
var tenantId = long.Parse(user.TenantId);
|
|
|
|
|
var tagNoList = tagNoDic.Select(x => x.Key);
|
|
|
|
|
var infoList = await db.Queryable<SysFieldSet>()
|
|
|
|
|
.Where(x => x.PermissionId == long.Parse(query.PermissionId) && tagNoList.Contains(x.TagNo))
|
|
|
|
|
.Where(x => x.PermissionId == long.Parse(query.PermissionId) && x.TenantId == tenantId && tagNoList.Contains(x.TagNo))
|
|
|
|
|
.WhereIF(query.IsGetDefault, x => x.UserId == 0)
|
|
|
|
|
.WhereIF(!query.IsGetDefault, x => (x.UserId == userId || x.UserId == 0))
|
|
|
|
|
.Select(x => new SysFieldSetTaskPlatResultDto(), true)
|
|
|
|
@ -1695,21 +1696,23 @@ public class CommonService : ICommonService
|
|
|
|
|
{
|
|
|
|
|
throw new Exception(nameof(req.TaskTypeCode) + "取值有误:" + req.TaskTypeCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var tenantId = long.Parse(user.TenantId);
|
|
|
|
|
var userId = long.Parse(user.UserId);
|
|
|
|
|
var info = await db.Queryable<SysFieldSet>()
|
|
|
|
|
.Where(x => x.PermissionId == req.PermissionId && x.TagNo == tagNo)
|
|
|
|
|
.Where(x => x.PermissionId == req.PermissionId && x.TenantId == tenantId && x.TagNo == tagNo)
|
|
|
|
|
.WhereIF(req.IsSetDefault, x => x.UserId == 0)
|
|
|
|
|
.WhereIF(!req.IsSetDefault, x => x.UserId == long.Parse(user.UserId))
|
|
|
|
|
.WhereIF(!req.IsSetDefault, x => x.UserId == userId)
|
|
|
|
|
.FirstAsync();
|
|
|
|
|
|
|
|
|
|
if (info.IsNull())
|
|
|
|
|
{
|
|
|
|
|
var entity = new SysFieldSet
|
|
|
|
|
{
|
|
|
|
|
UserId = req.IsSetDefault ? 0 : long.Parse(user.UserId),
|
|
|
|
|
TagNo = tagNo,
|
|
|
|
|
UserId = req.IsSetDefault ? 0 : userId,
|
|
|
|
|
PermissionId = req.PermissionId,
|
|
|
|
|
Content = req.Content
|
|
|
|
|
Content = req.Content,
|
|
|
|
|
TenantId = tenantId,
|
|
|
|
|
TagNo = tagNo,
|
|
|
|
|
};
|
|
|
|
|
await db.Insertable(entity).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
@ -2127,7 +2130,7 @@ public class CommonService : ICommonService
|
|
|
|
|
/// 获取最新业务单据编码
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<DataResult<string>> GetSequenceNextAsync<T>(SqlSugarScopeProvider tenantDb, IUser user,long saleId = 0)
|
|
|
|
|
public async Task<DataResult<string>> GetSequenceNextAsync<T>(SqlSugarScopeProvider tenantDb, IUser user, long saleId = 0)
|
|
|
|
|
{
|
|
|
|
|
//生成编号
|
|
|
|
|
string sequenceNewNo = "";
|
|
|
|
|