|
|
|
@ -91,7 +91,8 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取船公司下拉列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<DataResult<List<CodeCarrierRes>>> GetCarrierSelectList(string queryKey = "") {
|
|
|
|
|
public async Task<DataResult<List<CodeCarrierRes>>> GetCarrierSelectList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var list = await tenantDb.Queryable<CodeCarrier>()
|
|
|
|
@ -1176,24 +1177,41 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
).Take(20).WithCache($"{SqlSugarCacheConst.InfoClient}{user.TenantId}").ToListAsync();
|
|
|
|
|
return await Task.FromResult(DataResult<List<ClientSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取所有往来单位下拉列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <param name="type"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<ClientSelectRes>> GetAllClientList()
|
|
|
|
|
public DataResult<List<ClientSelectRes>> GetAllClientList(long? id = null, string? type = null)
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var data = tenantDb.Queryable<InfoClient>()
|
|
|
|
|
.InnerJoin<InfoClientTag>((a, b) => a.Id == b.ClientId)
|
|
|
|
|
.Where((a, b) => a.Status == StatusEnum.Enable.ToEnumInt())
|
|
|
|
|
.Select((a, b) => new ClientSelectRes
|
|
|
|
|
|
|
|
|
|
List<IConditionalModel> conditions = [];
|
|
|
|
|
if (!string.IsNullOrEmpty(type))
|
|
|
|
|
{
|
|
|
|
|
conditions.Add(new ConditionalModel
|
|
|
|
|
{
|
|
|
|
|
FieldName = "b.Is" + type.ToUpperCamelCase(),
|
|
|
|
|
FieldValue = "1",
|
|
|
|
|
CSharpTypeName = "int",
|
|
|
|
|
ConditionalType = ConditionalType.Equal
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var data = tenantDb.Queryable<InfoClient>().InnerJoin<InfoClientTag>((a, b) => a.Id == b.ClientId)
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt())
|
|
|
|
|
.Where(conditions)
|
|
|
|
|
.WhereIF(id.GetValueOrDefault() > 0, a => a.Id != id)
|
|
|
|
|
.Select(a => new ClientSelectRes
|
|
|
|
|
{
|
|
|
|
|
Id = a.Id,
|
|
|
|
|
CodeName = a.CodeName,
|
|
|
|
|
ShortName = a.ShortName,
|
|
|
|
|
EnShortName = a.EnShortName
|
|
|
|
|
}
|
|
|
|
|
).ToList();
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
return DataResult<List<ClientSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|