|
|
|
@ -53,12 +53,14 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取商品下拉列表-客户端
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<DataResult<List<CodeGoodsSelectRes>>> GetClientGoodsList(string code ="")
|
|
|
|
|
public async Task<DataResult<List<CodeGoodsSelectRes>>> GetClientGoodsList(string queryKey ="")
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var list = await tenantDb.Queryable<CodeGoods>()
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code), a => a.GoodsCode.Contains(code))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.GoodsCode.Contains(queryKey) || a.GoodName.Contains(queryKey))
|
|
|
|
|
.Select<CodeGoodsSelectRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.Goods)
|
|
|
|
|
.ToListAsync();
|
|
|
|
|
return await Task.FromResult(DataResult<List<CodeGoodsSelectRes>>.Success("获取数据成功!", list));
|
|
|
|
|
}
|
|
|
|
@ -84,8 +86,10 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
public async Task<DataResult<List<UserSelectRes>>> GetUseEmailListByIds(long[] ids)
|
|
|
|
|
{
|
|
|
|
|
var data = await db.Queryable<SysUser>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && ids.Contains(a.Id))
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && ids.Contains(a.Id))
|
|
|
|
|
.Select<UserSelectRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.User)
|
|
|
|
|
.ToListAsync();
|
|
|
|
|
return await Task.FromResult(DataResult<List<UserSelectRes>>.Success(data));
|
|
|
|
|
}
|
|
|
|
@ -94,7 +98,7 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 根据类型获取用户下拉列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<DataResult<List<ApiSelectViewModel>>> GetUserListByCode(string code = "")
|
|
|
|
|
public async Task<DataResult<List<ApiSelectViewModel>>> GetUserListByCode(string code, string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
code = code.ToLower();
|
|
|
|
|
var data = await db.Queryable<SysUser>()
|
|
|
|
@ -107,11 +111,15 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
.WhereIF(code == "service", a => a.IsCustomerService == true)
|
|
|
|
|
.WhereIF(code == "driver", a => a.IsDriver == true)
|
|
|
|
|
.WhereIF(code == "dispatcher", a => a.IsDispatcher == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
|
|
|
|
|
.Select(a => new ApiSelectViewModel
|
|
|
|
|
{
|
|
|
|
|
Label = a.UserName,
|
|
|
|
|
Label = a.PinYinCode,
|
|
|
|
|
Value = a.Id,
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
})
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.User)
|
|
|
|
|
.ToListAsync();
|
|
|
|
|
return DataResult<List<ApiSelectViewModel>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
@ -974,10 +982,13 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取揽货人信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<SaleSelectListRes>> GetSaleList()
|
|
|
|
|
public DataResult<List<SaleSelectListRes>> GetSaleList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var list = db.Queryable<SysUser>().Where(x => x.Status == StatusEnum.Enable.ToEnumInt() && x.IsSale == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
|
|
|
|
|
.Select<SaleSelectListRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.User)
|
|
|
|
|
.ToList();
|
|
|
|
|
if (list.Count > 0)
|
|
|
|
|
{
|
|
|
|
@ -1553,36 +1564,48 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取包装类型下拉列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList()
|
|
|
|
|
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList(string queryKey ="")
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var data = tenantDb.Queryable<CodePackage>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable)
|
|
|
|
|
.Select<CodePackageSelectRes>().ToList();
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.PackageName.Contains(queryKey) || a.EdiCode.Contains(queryKey))
|
|
|
|
|
.Select<CodePackageSelectRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.Package)
|
|
|
|
|
.ToList();
|
|
|
|
|
return DataResult<List<CodePackageSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取船名下拉列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<CodeVesselSelectRes>> GetVesselSelectList()
|
|
|
|
|
public DataResult<List<CodeVesselSelectRes>> GetVesselSelectList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var data = tenantDb.Queryable<CodeVessel>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable)
|
|
|
|
|
.Select<CodeVesselSelectRes>().ToList();
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.VesselName.Contains(queryKey) || a.EdiCode.Contains(queryKey))
|
|
|
|
|
.Select<CodeVesselSelectRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.Vessel)
|
|
|
|
|
.ToList();
|
|
|
|
|
return DataResult<List<CodeVesselSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取航次下拉列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<CodeVoynoSelectRes>> GetVoynoSelectList()
|
|
|
|
|
public DataResult<List<CodeVoynoSelectRes>> GetVoynoSelectList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var data = tenantDb.Queryable<CodeVoyno>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable)
|
|
|
|
|
.Select<CodeVoynoSelectRes>().ToList();
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.VoyNo.Contains(queryKey))
|
|
|
|
|
.Select<CodeVoynoSelectRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.Voyno)
|
|
|
|
|
.ToList();
|
|
|
|
|
return DataResult<List<CodeVoynoSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
@ -1615,11 +1638,14 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取操作员列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetOperatorUserList()
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetOperatorUserList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var data = db.Queryable<SysUser>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsOperator == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
|
|
|
|
|
.Select<UserSelectRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.User)
|
|
|
|
|
.ToList();
|
|
|
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
@ -1628,11 +1654,14 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取单证员列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetVouchingClerkList()
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetVouchingClerkList(string queryKey ="")
|
|
|
|
|
{
|
|
|
|
|
var data = db.Queryable<SysUser>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsVouchingClerk == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
|
|
|
|
|
.Select<UserSelectRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.User)
|
|
|
|
|
.ToList();
|
|
|
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
@ -1640,11 +1669,14 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取销售员列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetSaleUserList()
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetSaleUserList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var data = db.Queryable<SysUser>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsSale == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
|
|
|
|
|
.Select<UserSelectRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.User)
|
|
|
|
|
.ToList();
|
|
|
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
@ -1653,11 +1685,14 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取报关员列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetCustomUserList()
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetCustomUserList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var data = db.Queryable<SysUser>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsCustom == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
|
|
|
|
|
.Select<UserSelectRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.User)
|
|
|
|
|
.ToList();
|
|
|
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
@ -1666,11 +1701,14 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取财务员列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetFinancialStaffList()
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetFinancialStaffList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var data = db.Queryable<SysUser>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsFinancialStaff == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
|
|
|
|
|
.Select<UserSelectRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.User)
|
|
|
|
|
.ToList();
|
|
|
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
@ -1679,11 +1717,14 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取客服列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetCustomerServiceList()
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetCustomerServiceList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var data = db.Queryable<SysUser>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsCustomerService == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
|
|
|
|
|
.Select<UserSelectRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.User)
|
|
|
|
|
.ToList();
|
|
|
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
@ -1692,11 +1733,14 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取司机列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetDiverList()
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetDiverList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var data = db.Queryable<SysUser>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsDriver == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
|
|
|
|
|
.Select<UserSelectRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.User)
|
|
|
|
|
.ToList();
|
|
|
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
@ -1704,11 +1748,14 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取派车调度人员列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetDispatcherList()
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetDispatcherList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var data = db.Queryable<SysUser>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsDispatcher == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
|
|
|
|
|
.Select<UserSelectRes>()
|
|
|
|
|
.Take(20)
|
|
|
|
|
.WithCache(SqlSugarCacheConst.User)
|
|
|
|
|
.ToList();
|
|
|
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
|