往来单位费用模板结构更新

usertest
嵇文龙 2 months ago
parent 0349681275
commit c4e38104bb

@ -25,16 +25,22 @@ namespace DS.WMS.Core.Fee.Entity
public string BusinessTypeText => BusinessType.GetDescription();
/// <summary>
/// 费用类型
/// 结算对象Id
/// </summary>
[SugarColumn(ColumnDescription = "费用类型")]
public FeeType FeeType { get; set; }
[SugarColumn(ColumnDescription = "结算对象Id")]
public long? CustomerId { get; set; }
/// <summary>
/// 费用类型文本
/// 结算对象
/// </summary>
[SugarColumn(IsIgnore = true)]
public string FeeTypeText => FeeType.GetDescription();
[SugarColumn(ColumnDescription = "结算对象", Length = 100, IsNullable = true)]
public string? CustomerName { get; set; }
/// <summary>
/// 结算对象类型
/// </summary>
[SugarColumn(ColumnDescription = "结算对象类型", IsNullable = true)]
public CustomerTypeEnum? CustomerType { get; set; }
/// <summary>
/// 名称

@ -1,4 +1,5 @@
using DS.Module.Core;
using Masuit.Tools.Systems;
using SqlSugar;
namespace DS.WMS.Core.Fee.Entity
@ -14,6 +15,7 @@ namespace DS.WMS.Core.Fee.Entity
/// </summary>
[SugarColumn(ColumnDescription = "模板ID", IsNullable = false)]
public long TemplateId { get; set; }
/// <summary>
/// 所属模板
/// </summary>
@ -24,21 +26,23 @@ namespace DS.WMS.Core.Fee.Entity
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
/// <summary>
/// 结算对象Id
/// </summary>
[SugarColumn(ColumnDescription = "结算对象Id")]
[SugarColumn(ColumnDescription = "结算对象Id", IsNullable = false)]
public long CustomerId { get; set; }
/// <summary>
/// 结算对象
/// </summary>
[SugarColumn(ColumnDescription = "结算对象", Length = 100, IsNullable = true)]
public string? CustomerName { get; set; }
[SugarColumn(ColumnDescription = "结算对象", Length = 100, IsNullable = false)]
public string CustomerName { get; set; } = string.Empty;
/// <summary>
/// 结算对象类型
/// </summary>
[SugarColumn(ColumnDescription = "结算对象类型", IsNullable = true)]
public CustomerTypeEnum? CustomerType { get; set; }
/// <summary>
/// 费用Id
/// </summary>
@ -52,14 +56,19 @@ namespace DS.WMS.Core.Fee.Entity
/// <summary>
/// 费用名称
/// </summary>
[SugarColumn(ColumnDescription = "费用名称", Length = 100, IsNullable = true)]
public string? FeeName { get; set; }
[SugarColumn(ColumnDescription = "费用名称", Length = 100, IsNullable = false)]
public string FeeName { get; set; } = string.Empty;
/// <summary>
/// 收付类型(收、付)
/// 费用类型
/// </summary>
[SugarColumn(ColumnDescription = "收付类型(收、付)", IsNullable = false, DefaultValue = "1")]
[SugarColumn(ColumnDescription = "费用类型", IsNullable = false)]
public FeeType FeeType { get; set; }
/// <summary>
/// 费用类型文本
/// </summary>
[SugarColumn(IsIgnore = true)]
public string FeeTypeText => FeeType.GetDescription();
/// <summary>
/// 费用标准
/// </summary>
[SugarColumn(ColumnDescription = "费用标准", Length = 20, IsNullable = true)]

@ -46,10 +46,16 @@ namespace DS.WMS.Core.Fee.Method
// break;
//}
var order = await TenantDb.Queryable<SeaExport>().Where(x => x.Id == bsId).Select(
x => new { x.CustomerId }).FirstAsync();
if (order == null)
return;
try
{
var list = await TenantDb.Queryable<FeeCustTemplate>()
.Where(x => x.BusinessType == businessType && !SqlFunc.IsNullOrEmpty(x.Condition))
.Where(x => x.BusinessType == businessType && !SqlFunc.IsNullOrEmpty(x.Condition) &&
(x.IsShared || x.CustomerId == order.CustomerId))
.Select(x => new
{
x.Id,
@ -152,7 +158,9 @@ namespace DS.WMS.Core.Fee.Method
{
Id = x.Id,
BusinessType = x.BusinessType,
FeeType = x.FeeType,
CustomerId = x.CustomerId,
CustomerName = x.CustomerName,
CustomerType = x.CustomerType,
Name = x.Name,
IsShared = x.IsShared,
Note = x.Note,
@ -187,7 +195,13 @@ namespace DS.WMS.Core.Fee.Method
foreach (var item in model.Details)
{
item.TemplateId = model.Id;
item.FeeType = model.FeeType;
if (item.CustomerId == 0 && model.CustomerId.HasValue)
item.CustomerId = model.CustomerId.Value;
if (item.CustomerName.IsNullOrEmpty() && !model.CustomerName.IsNullOrEmpty())
item.CustomerName = model.CustomerName;
item.CustomerType = model.CustomerType;
item.CreateBy = userId;
item.CreateTime = dt;
}

Loading…
Cancel
Save