|
|
|
@ -43,7 +43,30 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
user = _serviceProvider.GetRequiredService<IUser>();
|
|
|
|
|
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据类型获取用户下拉列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<DataResult<List<ApiSelectViewModel>>> GetUserListByCode(string code = "")
|
|
|
|
|
{
|
|
|
|
|
code = code.ToLower();
|
|
|
|
|
var data = await db.Queryable<SysUser>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt())
|
|
|
|
|
.WhereIF(code == "operator", a => a.IsOperator == true)
|
|
|
|
|
.WhereIF(code == "doc", a => a.IsVouchingClerk == true)
|
|
|
|
|
.WhereIF(code == "sale", a => a.IsSale == true)
|
|
|
|
|
.WhereIF(code == "custom", a => a.IsCustom == true)
|
|
|
|
|
.WhereIF(code == "finance", a => a.IsFinancialStaff == true)
|
|
|
|
|
.WhereIF(code == "service", a => a.IsCustomerService == true)
|
|
|
|
|
.WhereIF(code == "driver", a => a.IsDriver == true)
|
|
|
|
|
.WhereIF(code == "dispatcher", a => a.IsDispatcher == true)
|
|
|
|
|
.Select(a => new ApiSelectViewModel
|
|
|
|
|
{
|
|
|
|
|
Label = a.UserName,
|
|
|
|
|
Value = a.Id,
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
return DataResult<List<ApiSelectViewModel>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取工厂信息下拉列表-客户端
|
|
|
|
|
/// </summary>
|
|
|
|
|