自动费用模板视图列表

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

@ -18,6 +18,10 @@ namespace DS.WMS.Core.Fee.Dtos
/// </summary> /// </summary>
public long TemplateId { get; set; } public long TemplateId { get; set; }
/// <summary> /// <summary>
/// 模板名称
/// </summary>
public string? TemplateName { get; set; }
/// <summary>
/// 结算对象Id /// 结算对象Id
/// </summary> /// </summary>
public long CustomerId { get; set; } public long CustomerId { get; set; }
@ -41,40 +45,32 @@ namespace DS.WMS.Core.Fee.Dtos
/// <summary> /// <summary>
/// 20GP /// 20GP
/// </summary> /// </summary>
public string? Unit20GP { get; set; } public decimal? Unit20GP { get; set; }
/// <summary> /// <summary>
/// 40GP /// 40GP
/// </summary> /// </summary>
public string? Unit40GP { get; set; } public decimal? Unit40GP { get; set; }
/// <summary> /// <summary>
/// 40HC /// 40HC
/// </summary> /// </summary>
public string? Unit40HC { get; set; } public decimal? Unit40HC { get; set; }
/// <summary> /// <summary>
/// 45G0 /// 45G0
/// </summary> /// </summary>
public string? Unit45G0 { get; set; } public decimal? Unit45G0 { get; set; }
/// <summary> /// <summary>
/// TEU /// TEU
/// </summary> /// </summary>
public string? UnitTEU { get; set; } public decimal? UnitTEU { get; set; }
/// <summary> /// <summary>
/// 单票 /// 单票
/// </summary> /// </summary>
public string? UnitP { get; set; } public decimal? UnitP { get; set; }
/// <summary>
/// 是否箱型
/// </summary>
public bool IsCtn { get; set; }
/// <summary> /// <summary>
/// 币别 /// 币别
/// </summary> /// </summary>
public string? Currency { get; set; } public string? Currency { get; set; }
/// <summary> /// <summary>
/// 单价
/// </summary>
public decimal? UnitPrice { get; set; }
/// <summary>
/// 汇率,为空时取默认汇率 /// 汇率,为空时取默认汇率
/// </summary> /// </summary>
public decimal? ExchangeRate { get; set; } public decimal? ExchangeRate { get; set; }
@ -91,10 +87,6 @@ namespace DS.WMS.Core.Fee.Dtos
/// </summary> /// </summary>
public decimal? Tax { get; set; } public decimal? Tax { get; set; }
/// <summary> /// <summary>
/// 含税单价
/// </summary>
public decimal? TaxUnitPrice { get; set; }
/// <summary>
/// 是否开票 /// 是否开票
/// </summary> /// </summary>
public bool IsInvoice { get; set; } public bool IsInvoice { get; set; }
@ -102,14 +94,6 @@ namespace DS.WMS.Core.Fee.Dtos
/// 是否垫付费用 /// 是否垫付费用
/// </summary> /// </summary>
public bool IsAdvancedPay { get; set; } public bool IsAdvancedPay { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string? CreateBy { get; set; }
/// <summary> /// <summary>
/// 业务类型 /// 业务类型
@ -187,5 +171,17 @@ namespace DS.WMS.Core.Fee.Dtos
/// 分公司名称 /// 分公司名称
/// </summary> /// </summary>
public string? DeptOrgName { get; set; } 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> /// <returns></returns>
Task<DataResult<List<FeeCustTemplate>>> GetListAsync(PageRequest request); Task<DataResult<List<FeeCustTemplate>>> GetListAsync(PageRequest request);
/// <summary>
/// 视图列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult<List<FeeCustTemplateView>>> GetListViewAsync(PageRequest request);
/// <summary> /// <summary>
/// 详情 /// 详情
/// </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.Condition;
using DS.Module.Core.Extensions; using DS.Module.Core.Extensions;
using DS.WMS.Core.Code.Entity; 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); return await TenantDb.Queryable<FeeCustTemplate>().Where(whereList).ToQueryPageAsync(request.PageCondition);
} }
///// <summary> /// <summary>
///// 视图列表 /// 视图列表
///// </summary> /// </summary>
///// <param name="request"></param> /// <param name="request"></param>
///// <returns></returns> /// <returns></returns>
//public async Task<DataResult<List<FeeCustTemplateView>>> GetListViewAsync(PageRequest request) public async Task<DataResult<List<FeeCustTemplateView>>> GetListViewAsync(PageRequest request)
//{ {
// var list = TenantDb.Queryable<FeeCustTemplateDetail>() var query = TenantDb.Queryable<FeeCustTemplateDetail>()
// .InnerJoin<FeeCustTemplate>((d, t) => d.TemplateId == t.Id) .InnerJoin<FeeCustTemplate>((d, t) => d.TemplateId == t.Id)
// .LeftJoin<CodeCarrier>((d, t, cc) => t.CarrierId == cc.Id) .LeftJoin<CodeCarrier>((d, t, cc) => t.CarrierId == cc.Id)
// .LeftJoin<CodeLanes>((d, t, cc, cl) => t.LaneId == cl.Id) .LeftJoin<CodeLanes>((d, t, cc, cl) => t.LaneId == cl.Id)
// .LeftJoin<CodeSource>((d, t, cc, cl, cs) => t.SourceId == cs.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<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<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") .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 .GroupBy((d, t, cc, cl, cs, csd, c, so) => new
// { {
// d.TemplateId, d.TemplateId,
// d.FeeId, d.FeeId,
// d.FeeName, d.FeeName,
// d.CustomerType, d.CustomerType,
// d.CustomerId, d.CustomerId,
// d.CustomerName, d.CustomerName,
// t.BusinessType, //t.BusinessType,
// t.FeeType, //t.FeeType,
// t.StartTime, //t.StartTime,
// t.EndTime, //t.EndTime,
// t.IsDisabled, //t.FeeCategoryName,
// t.FeeCategoryName, //t.Priority,
// t.Priority, //t.POLCode,
// t.POLCode, //t.PODCode,
// t.PODCode, //t.MBLFrtCode,
// t.MBLFrtCode,
//cl.LaneName,
// cl.LaneName, //CarrierName = cc.CnName,
// CarrierName = cc.CnName, //cs.SourceName,
// cs.SourceName, //SourceDetailName = csd.DetailName,
// SourceDetailName = csd.DetailName, //ForwarderName = c.ShortName,
// ForwarderName = c.ShortName, //DeptOrgName = so.OrgName
// DeptOrgName = so.OrgName }).Select((d, t, cc, cl, cs, csd, c, so) => new FeeCustTemplateView
// }).Select((d, t, cc, cl, cs, csd, c, so) => new FeeCustTemplateView {
// { Id = d.Id,
// Id = d.Id, TemplateId = d.TemplateId,
// TemplateId = d.TemplateId, CustomerType = d.CustomerType,
// CustomerType = d.CustomerType, CustomerId = d.CustomerId,
// CustomerId = d.CustomerId, CustomerName = d.CustomerName,
// CustomerName = d.CustomerName, FeeId = d.FeeId,
// FeeId = d.FeeId, FeeName = d.FeeName,
// FeeName = d.FeeName, Currency = d.Currency,
ExchangeRate = d.ExchangeRate,
TaxRate = d.TaxRate,
AccTaxRate = d.AccTaxRate,
Tax = d.Tax,
// BusinessType = t.BusinessType, IsInvoice = d.IsInvoice,
// FeeType = t.FeeType, IsAdvancedPay = d.IsAdvancedPay,
// StartTime = t.StartTime,
// EndTime = t.EndTime, Unit20GP = SqlFunc.AggregateSum(d.Unit == "20GP" ? SqlFunc.Round(d.TaxUnitPrice, 2) : null),
// IsDisabled = t.IsDisabled, Unit40GP = SqlFunc.AggregateSum(d.Unit == "40GP" ? SqlFunc.Round(d.TaxUnitPrice, 2) : null),
// FeeCategoryName = t.FeeCategoryName, Unit40HC = SqlFunc.AggregateSum(d.Unit == "40HC" ? SqlFunc.Round(d.TaxUnitPrice, 2) : null),
// Priority = t.Priority, Unit45G0 = SqlFunc.AggregateSum(d.Unit == "45G0" ? SqlFunc.Round(d.TaxUnitPrice, 2) : null),
// POLCode = t.POLCode, UnitTEU = SqlFunc.AggregateSum(d.Unit == "TEU" ? SqlFunc.Round(d.TaxUnitPrice, 2) : null),
// PODCode = t.PODCode, UnitP = SqlFunc.AggregateSum(d.Unit == "P" ? SqlFunc.Round(d.TaxUnitPrice, 2) : null),
// MBLFrtCode = t.MBLFrtCode,
// LaneName = cl.LaneName, TemplateName = t.Name,
// CarrierName = cc.CnName, BusinessType = t.BusinessType,
// SourceName = cs.SourceName, FeeType = t.FeeType,
// SourceDetailName = csd.DetailName, StartTime = t.StartTime,
// ForwarderName = c.ShortName, EndTime = t.EndTime,
// DeptOrgName = so.OrgName 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> /// <summary>
/// 详情 /// 详情
@ -670,6 +686,8 @@ namespace DS.WMS.Core.Fee.Method
{ {
int rows = await TenantDb.Updateable(list).UpdateColumns(x => new int rows = await TenantDb.Updateable(list).UpdateColumns(x => new
{ {
x.CustomerId,
x.CustomerName,
x.StartTime, x.StartTime,
x.EndTime, x.EndTime,
x.IsDisabled, x.IsDisabled,

@ -125,6 +125,17 @@ namespace DS.WMS.FeeApi.Controllers
return await _invokeService.GetListAsync(request); 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>
/// 编辑 /// 编辑
/// </summary> /// </summary>

Loading…
Cancel
Save