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

usertest
嵇文龙 3 months ago
parent 0349681275
commit c4e38104bb

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

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

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

Loading…
Cancel
Save