|
|
|
@ -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,
|
|
|
|
|