自动费用模板视图列表

dev
嵇文龙 4 weeks ago
parent 694bd228b0
commit 0a3a3c3e75

@ -18,6 +18,10 @@ namespace DS.WMS.Core.Fee.Dtos
/// </summary>
public long TemplateId { get; set; }
/// <summary>
/// 模板名称
/// </summary>
public string? TemplateName { get; set; }
/// <summary>
/// 结算对象Id
/// </summary>
public long CustomerId { get; set; }
@ -41,40 +45,32 @@ namespace DS.WMS.Core.Fee.Dtos
/// <summary>
/// 20GP
/// </summary>
public string? Unit20GP { get; set; }
public decimal? Unit20GP { get; set; }
/// <summary>
/// 40GP
/// </summary>
public string? Unit40GP { get; set; }
public decimal? Unit40GP { get; set; }
/// <summary>
/// 40HC
/// </summary>
public string? Unit40HC { get; set; }
public decimal? Unit40HC { get; set; }
/// <summary>
/// 45G0
/// </summary>
public string? Unit45G0 { get; set; }
public decimal? Unit45G0 { get; set; }
/// <summary>
/// TEU
/// </summary>
public string? UnitTEU { get; set; }
public decimal? UnitTEU { get; set; }
/// <summary>
/// 单票
/// </summary>
public string? UnitP { get; set; }
/// <summary>
/// 是否箱型
/// </summary>
public bool IsCtn { get; set; }
public decimal? UnitP { get; set; }
/// <summary>
/// 币别
/// </summary>
public string? Currency { get; set; }
/// <summary>
/// 单价
/// </summary>
public decimal? UnitPrice { get; set; }
/// <summary>
/// 汇率,为空时取默认汇率
/// </summary>
public decimal? ExchangeRate { get; set; }
@ -91,10 +87,6 @@ namespace DS.WMS.Core.Fee.Dtos
/// </summary>
public decimal? Tax { get; set; }
/// <summary>
/// 含税单价
/// </summary>
public decimal? TaxUnitPrice { get; set; }
/// <summary>
/// 是否开票
/// </summary>
public bool IsInvoice { get; set; }
@ -102,14 +94,6 @@ namespace DS.WMS.Core.Fee.Dtos
/// 是否垫付费用
/// </summary>
public bool IsAdvancedPay { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string? CreateBy { get; set; }
/// <summary>
/// 业务类型
@ -187,5 +171,17 @@ namespace DS.WMS.Core.Fee.Dtos
/// 分公司名称
/// </summary>
public string? DeptOrgName { get; set; }
/// <summary>
/// 是否共享
/// </summary>
public bool IsShared { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string? CreateUserName { get; set; }
}
}

@ -31,6 +31,13 @@ namespace DS.WMS.Core.Fee.Interface
/// <returns></returns>
Task<DataResult<List<FeeCustTemplate>>> GetListAsync(PageRequest request);
/// <summary>
/// 视图列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult<List<FeeCustTemplateView>>> GetListViewAsync(PageRequest request);
/// <summary>
/// 详情
/// </summary>

@ -1,5 +1,4 @@
using AngleSharp.Css;
using DS.Module.Core;
using DS.Module.Core;
using DS.Module.Core.Condition;
using DS.Module.Core.Extensions;
using DS.WMS.Core.Code.Entity;
@ -498,78 +497,95 @@ namespace DS.WMS.Core.Fee.Method
return await TenantDb.Queryable<FeeCustTemplate>().Where(whereList).ToQueryPageAsync(request.PageCondition);
}
///// <summary>
///// 视图列表
///// </summary>
///// <param name="request"></param>
///// <returns></returns>
//public async Task<DataResult<List<FeeCustTemplateView>>> GetListViewAsync(PageRequest request)
//{
// var list = TenantDb.Queryable<FeeCustTemplateDetail>()
// .InnerJoin<FeeCustTemplate>((d, t) => d.TemplateId == t.Id)
// .LeftJoin<CodeCarrier>((d, t, cc) => t.CarrierId == cc.Id)
// .LeftJoin<CodeLanes>((d, t, cc, cl) => t.LaneId == cl.Id)
// .LeftJoin<CodeSource>((d, t, cc, cl, cs) => t.SourceId == cs.Id)
// .LeftJoin<CodeSourceDetail>((d, t, cc, cl, cs, csd) => t.SourceDetailId == csd.Id)
// .LeftJoin<InfoClient>((d, t, cc, cl, cs, csd, c) => t.ForwarderId == c.Id)
// .LeftJoin<SysOrg>((d, t, cc, cl, cs, csd, c, so) => t.DeptOrgId == so.Id, "shippingweb8_dev.sys_org")
// .GroupBy((d, t, cc, cl, cs, csd, c, so) => new
// {
// d.TemplateId,
// d.FeeId,
// d.FeeName,
// d.CustomerType,
// d.CustomerId,
// d.CustomerName,
// t.BusinessType,
// t.FeeType,
// t.StartTime,
// t.EndTime,
// t.IsDisabled,
// t.FeeCategoryName,
// t.Priority,
// t.POLCode,
// t.PODCode,
// t.MBLFrtCode,
// cl.LaneName,
// CarrierName = cc.CnName,
// cs.SourceName,
// SourceDetailName = csd.DetailName,
// ForwarderName = c.ShortName,
// DeptOrgName = so.OrgName
// }).Select((d, t, cc, cl, cs, csd, c, so) => new FeeCustTemplateView
// {
// Id = d.Id,
// TemplateId = d.TemplateId,
// CustomerType = d.CustomerType,
// CustomerId = d.CustomerId,
// CustomerName = d.CustomerName,
// FeeId = d.FeeId,
// FeeName = d.FeeName,
// BusinessType = t.BusinessType,
// FeeType = t.FeeType,
// StartTime = t.StartTime,
// EndTime = t.EndTime,
// IsDisabled = t.IsDisabled,
// FeeCategoryName = t.FeeCategoryName,
// Priority = t.Priority,
// POLCode = t.POLCode,
// PODCode = t.PODCode,
// MBLFrtCode = t.MBLFrtCode,
// LaneName = cl.LaneName,
// CarrierName = cc.CnName,
// SourceName = cs.SourceName,
// SourceDetailName = csd.DetailName,
// ForwarderName = c.ShortName,
// DeptOrgName = so.OrgName
// });
//}
/// <summary>
/// 视图列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult<List<FeeCustTemplateView>>> GetListViewAsync(PageRequest request)
{
var query = TenantDb.Queryable<FeeCustTemplateDetail>()
.InnerJoin<FeeCustTemplate>((d, t) => d.TemplateId == t.Id)
.LeftJoin<CodeCarrier>((d, t, cc) => t.CarrierId == cc.Id)
.LeftJoin<CodeLanes>((d, t, cc, cl) => t.LaneId == cl.Id)
.LeftJoin<CodeSource>((d, t, cc, cl, cs) => t.SourceId == cs.Id)
.LeftJoin<CodeSourceDetail>((d, t, cc, cl, cs, csd) => t.SourceDetailId == csd.Id)
.LeftJoin<InfoClient>((d, t, cc, cl, cs, csd, c) => t.ForwarderId == c.Id)
.LeftJoin<SysOrg>((d, t, cc, cl, cs, csd, c, so) => t.DeptOrgId == so.Id, "shippingweb8_dev.sys_org")
.GroupBy((d, t, cc, cl, cs, csd, c, so) => new
{
d.TemplateId,
d.FeeId,
d.FeeName,
d.CustomerType,
d.CustomerId,
d.CustomerName,
//t.BusinessType,
//t.FeeType,
//t.StartTime,
//t.EndTime,
//t.FeeCategoryName,
//t.Priority,
//t.POLCode,
//t.PODCode,
//t.MBLFrtCode,
//cl.LaneName,
//CarrierName = cc.CnName,
//cs.SourceName,
//SourceDetailName = csd.DetailName,
//ForwarderName = c.ShortName,
//DeptOrgName = so.OrgName
}).Select((d, t, cc, cl, cs, csd, c, so) => new FeeCustTemplateView
{
Id = d.Id,
TemplateId = d.TemplateId,
CustomerType = d.CustomerType,
CustomerId = d.CustomerId,
CustomerName = d.CustomerName,
FeeId = d.FeeId,
FeeName = d.FeeName,
Currency = d.Currency,
ExchangeRate = d.ExchangeRate,
TaxRate = d.TaxRate,
AccTaxRate = d.AccTaxRate,
Tax = d.Tax,
IsInvoice = d.IsInvoice,
IsAdvancedPay = d.IsAdvancedPay,
Unit20GP = SqlFunc.AggregateSum(d.Unit == "20GP" ? SqlFunc.Round(d.TaxUnitPrice, 2) : null),
Unit40GP = SqlFunc.AggregateSum(d.Unit == "40GP" ? SqlFunc.Round(d.TaxUnitPrice, 2) : null),
Unit40HC = SqlFunc.AggregateSum(d.Unit == "40HC" ? SqlFunc.Round(d.TaxUnitPrice, 2) : null),
Unit45G0 = SqlFunc.AggregateSum(d.Unit == "45G0" ? SqlFunc.Round(d.TaxUnitPrice, 2) : null),
UnitTEU = SqlFunc.AggregateSum(d.Unit == "TEU" ? SqlFunc.Round(d.TaxUnitPrice, 2) : null),
UnitP = SqlFunc.AggregateSum(d.Unit == "P" ? SqlFunc.Round(d.TaxUnitPrice, 2) : null),
TemplateName = t.Name,
BusinessType = t.BusinessType,
FeeType = t.FeeType,
StartTime = t.StartTime,
EndTime = t.EndTime,
IsDisabled = t.IsDisabled,
IsShared = t.IsShared,
FeeCategoryName = t.FeeCategoryName,
Priority = t.Priority,
POLCode = t.POLCode,
PODCode = t.PODCode,
MBLFrtCode = t.MBLFrtCode,
CreateUserName = t.CreateUserName,
CreateTime = t.CreateTime,
LaneName = cl.LaneName,
CarrierName = cc.CnName,
SourceName = cs.SourceName,
SourceDetailName = csd.DetailName,
ForwarderName = c.ShortName,
DeptOrgName = so.OrgName
}).MergeTable();
var whereList = request.GetConditionalModels(Db);
return await query.Where(whereList).ToQueryPageAsync(request.PageCondition);
}
/// <summary>
/// 详情
@ -670,6 +686,8 @@ namespace DS.WMS.Core.Fee.Method
{
int rows = await TenantDb.Updateable(list).UpdateColumns(x => new
{
x.CustomerId,
x.CustomerName,
x.StartTime,
x.EndTime,
x.IsDisabled,

@ -125,6 +125,17 @@ namespace DS.WMS.FeeApi.Controllers
return await _invokeService.GetListAsync(request);
}
/// <summary>
/// 视图列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("GetListView")]
public async Task<DataResult<List<FeeCustTemplateView>>> GetListViewAsync([FromBody] PageRequest request)
{
return await _invokeService.GetListViewAsync(request);
}
/// <summary>
/// 编辑
/// </summary>

Loading…
Cancel
Save