|
|
|
@ -83,7 +83,7 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
{
|
|
|
|
|
Id = a.Id,
|
|
|
|
|
PinYinCode = a.ShortName + "(" + a.CodeName + ")"
|
|
|
|
|
},true
|
|
|
|
|
}, true
|
|
|
|
|
).Take(20).WithCache($"{SqlSugarCacheConst.InfoClient}{user.TenantId}").ToListAsync();
|
|
|
|
|
return await Task.FromResult(DataResult<List<ControllerClientRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess));
|
|
|
|
|
}
|
|
|
|
@ -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>()
|
|
|
|
@ -128,10 +129,10 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取商品下拉列表-客户端
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<DataResult<List<CodeGoodsSelectRes>>> GetClientGoodsList(string queryKey ="")
|
|
|
|
|
public async Task<DataResult<List<CodeGoodsSelectRes>>> GetClientGoodsList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var list = await tenantDb.Queryable<CodeGoods>().Where(a=> a.Status == StatusEnum.Enable)
|
|
|
|
|
var list = await tenantDb.Queryable<CodeGoods>().Where(a => a.Status == StatusEnum.Enable)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.GoodsCode.Contains(queryKey) || a.GoodName.Contains(queryKey))
|
|
|
|
|
.Select(a => new CodeGoodsSelectRes()
|
|
|
|
|
{
|
|
|
|
@ -234,7 +235,7 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
|
|
|
|
|
var dictvalue = db.Queryable<SysDictData>().InnerJoin<SysDictType>((a, b) => a.TypeId == b.Id)
|
|
|
|
|
.Where((a, b) => b.Code == "fee_unit").Select((a, b) => a.Value).ToList();
|
|
|
|
|
if (dictvalue.Where(x=>x ==req.Code).Any())
|
|
|
|
|
if (dictvalue.Where(x => x == req.Code).Any())
|
|
|
|
|
{
|
|
|
|
|
var data = GetSeaExportUnit(info, req.Code);
|
|
|
|
|
return DataResult<UnitSelectInfoRes>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
@ -290,7 +291,7 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
data.Quantity = seaExport.PKGS;
|
|
|
|
|
break;
|
|
|
|
|
case "JF"://计费吨
|
|
|
|
|
data.Quantity = seaExport.KGS/1000> seaExport.CBM? seaExport.KGS/1000: seaExport.CBM;
|
|
|
|
|
data.Quantity = seaExport.KGS / 1000 > seaExport.CBM ? seaExport.KGS / 1000 : seaExport.CBM;
|
|
|
|
|
break;
|
|
|
|
|
//默认
|
|
|
|
|
default:
|
|
|
|
@ -355,7 +356,7 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
return DataResult<ClientSelectInfoRes>.Failed("业务信息不存在!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var data = GetSeaExportClientInfo(info,code);
|
|
|
|
|
var data = GetSeaExportClientInfo(info, code);
|
|
|
|
|
data.ClientList = list;
|
|
|
|
|
return DataResult<ClientSelectInfoRes>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
@ -1134,7 +1135,7 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 根据类型获取往来单位下拉列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<DataResult<List<ClientSelectRes>>> GetClientListByCode(string code,string queryKey ="")
|
|
|
|
|
public async Task<DataResult<List<ClientSelectRes>>> GetClientListByCode(string code, string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
@ -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>
|
|
|
|
@ -1645,7 +1663,7 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取包装类型下拉列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList(string queryKey ="")
|
|
|
|
|
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var data = tenantDb.Queryable<CodePackage>()
|
|
|
|
@ -1735,7 +1753,7 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
/// 获取单证员列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetVouchingClerkList(string queryKey ="")
|
|
|
|
|
public DataResult<List<UserSelectRes>> GetVouchingClerkList(string queryKey = "")
|
|
|
|
|
{
|
|
|
|
|
var data = db.Queryable<SysUser>()
|
|
|
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsVouchingClerk == true)
|
|
|
|
@ -1852,7 +1870,7 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
public DataResult<SysQuerySet> GetUserQuerySet(string permissionId, int tagNo = 0)
|
|
|
|
|
{
|
|
|
|
|
var info = db.Queryable<SysQuerySet>()
|
|
|
|
|
.Where(x => x.UserId == long.Parse(user.UserId) && x.PermissionId == long.Parse(permissionId)&& x.TagNo == tagNo).First();
|
|
|
|
|
.Where(x => x.UserId == long.Parse(user.UserId) && x.PermissionId == long.Parse(permissionId) && x.TagNo == tagNo).First();
|
|
|
|
|
|
|
|
|
|
return DataResult<SysQuerySet>.Success(info);
|
|
|
|
|
}
|
|
|
|
|