jianghaiqing 1 month ago
commit 8b4806bc07

@ -1,5 +1,6 @@
using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Invoice.Dtos;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Settlement.Entity;
namespace DS.WMS.Core.Settlement.Dtos
@ -35,6 +36,11 @@ namespace DS.WMS.Core.Settlement.Dtos
/// </summary>
public long Id { get; set; }
/// <summary>
/// 仅自由结算使用
/// </summary>
public BusinessType? BusinessType { get; set; }
/// <summary>
/// 费用对象ID
/// </summary>

@ -6,9 +6,9 @@ using DS.WMS.Core.Settlement.Entity;
namespace DS.WMS.Core.Settlement.Interface
{
/// <summary>
/// 付费自由结算
/// 自由结算
/// </summary>
public interface IFreeSettlementService : ISettlementService<Entity.ApplicationSettlement>
public interface IFreeSettlementService : ISettlementService<ApplicationSettlement>
{
/// <summary>
/// 获取待结算业务分页列表
@ -26,17 +26,24 @@ namespace DS.WMS.Core.Settlement.Interface
Task<DataResult<FeeForm>> GetFeesAsync(params FeeClient[] items);
/// <summary>
/// 获取付费自由结算单
/// 获取自由结算单
/// </summary>
/// <param name="id">结算单ID</param>
/// <returns></returns>
Task<DataResult<ApplicationSettlementDto>> GetAsync(long id);
/// <summary>
/// 获取付费结算明细
/// 获取结算明细
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult<FreeSettlement>> GetDetailsAsync(PageRequest<long> request);
/// <summary>
/// 根据业务编号及类型获取该票业务的币别
/// </summary>
/// <param name="items">业务ID与业务类型</param>
/// <returns></returns>
Task<DataResult<List<FeeClient>>> GetCurrenciesAsync(params FeeClient[] items);
}
}

@ -1,5 +1,4 @@
using DS.Module.Core;
using DS.WMS.Core.Application.Entity;
using DS.WMS.Core.Settlement.Dtos;
using DS.WMS.Core.Settlement.Entity;
@ -39,15 +38,5 @@ namespace DS.WMS.Core.Settlement.Interface
/// <param name="ids">结算ID</param>
/// <returns></returns>
Task<DataResult> SetLockAsync(bool isLocked, params long[] ids);
/// <summary>
/// 获取待结算的自由结算费用明细
/// 参数为选中的业务或费用明细
/// 返回值为结算明细
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult<List<SettlementDocument>>> GetExchangesAsync(SettlementRequest<TEntity> request);
}
}

@ -6,8 +6,8 @@ using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Application.Entity;
using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Invoice.Dtos;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.View;
using DS.WMS.Core.Settlement.Dtos;
using DS.WMS.Core.Settlement.Entity;
using DS.WMS.Core.Settlement.Interface;
@ -39,7 +39,7 @@ namespace DS.WMS.Core.Settlement.Method
public async Task<DataResult<List<SettlementBiz>>> GetBizListAsync(PageRequest request)
{
var whereList = request.GetConditionalModels(Db);
var result = await CreateBizQuery().Where(whereList).GroupBy(x => new { x.BusinessId, x.BusinessType })
var result = await CreateBizQuery().Where(whereList).GroupBy(x => new { x.BusinessId, x.BusinessType, x.CustomerId })
.Select<SettlementBiz>().ToQueryPageAsync(request.PageCondition);
if (result.Data.Count > 0)
@ -95,7 +95,6 @@ namespace DS.WMS.Core.Settlement.Method
//创建各项费用数据的查询并集
internal ISugarQueryable<FeeDto> CreateBizQuery()
{
/*
var query1 = TenantDb.Queryable<FeeRecord, SeaExport>((f, s) => new JoinQueryInfos(
JoinType.Inner, s.Id == f.BusinessId && f.BusinessType == BusinessType.OceanShippingExport && (f.FeeStatus == FeeStatus.AuditPassed || f.FeeStatus == FeeStatus.PartialSettlement) &&
(f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount) != 0))
@ -134,49 +133,8 @@ namespace DS.WMS.Core.Settlement.Method
BookingNo = s.BookingNo,
Enterprise = s.Enterprise,
});
*/
//海运进口
//20240929 邓羽 临时修改 改用vw_op_business
var query1 = TenantDb.Queryable<FeeRecord, VW_Op_Business>((f, s) => new JoinQueryInfos(
JoinType.Inner, s.BusinessId == f.BusinessId && f.BusinessType == BusinessType.OceanShippingExport && (f.FeeStatus == FeeStatus.AuditPassed || f.FeeStatus == FeeStatus.PartialSettlement) &&
(f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount) != 0))
.Select((f, s) => new FeeDto
{
Id = f.Id,
FeeId = f.FeeId,
FeeCode = f.FeeCode,
FeeName = f.FeeName,
FeeType = f.FeeType,
CustomerId = f.CustomerId,
CustomerName = f.CustomerName,
BusinessId = f.BusinessId,
BusinessType = BusinessType.OceanShippingExport,
Currency = f.Currency,
DebitNo = f.DebitNo,
SaleOrgId = f.SaleOrgId,
SaleOrg = f.SaleOrg,
CreateBy = f.CreateBy,
AccountDate = s.AccountDate,
BusinessDate = s.CreateTime,//业务日期
ClientName = s.CustomerName,//委托单位
CustomerNo = s.CustomerNo,
CustomNo = s.CustomNo,
DischargePort = s.DischargePort,
ETD = s.ETD,
HBLNO = s.HBLNO,
LoadPort = s.LoadPort,
MBLNO = s.MBLNO,
OperatorId = s.OperatorId,
SaleDeptId = s.SaleDeptId,
Sale = s.Sale,//揽货人
Vessel = s.Vessel,//船名
Voyage = s.Voyno,//航次
BookingNo = s.BookingNo,
Enterprise = s.Enterprise,
});
//海运进口
return TenantDb.UnionAll(new List<ISugarQueryable<FeeDto>> { query1 });
}
@ -194,7 +152,7 @@ namespace DS.WMS.Core.Settlement.Method
var list = await TenantDb.Queryable<FeeRecord>()
.Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && cIds.Contains(f.CustomerId) &&
f.FeeStatus == FeeStatus.AuditPassed && (f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount) != 0)
(f.FeeStatus == FeeStatus.AuditPassed || f.FeeStatus == FeeStatus.PartialSettlement) && (f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount) != 0)
.Select(f => new FeeItem
{
RecordId = f.Id,
@ -224,6 +182,44 @@ namespace DS.WMS.Core.Settlement.Method
return DataResult<FeeForm>.Success(new FeeForm(list));
}
/// <summary>
/// 根据业务编号及类型获取该票业务的币别
/// </summary>
/// <param name="items">业务ID与业务类型</param>
/// <returns></returns>
public async Task<DataResult<List<FeeClient>>> GetCurrenciesAsync(params FeeClient[] items)
{
var bizIds = items.Select(x => x.Id).Distinct();
var types = items.Select(x => x.BusinessType).Distinct();
var cIds = items.Select(x => x.CustomerId).Distinct();
var list = await TenantDb.Queryable<FeeRecord>()
.Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && cIds.Contains(f.CustomerId)
&& (f.FeeStatus == FeeStatus.AuditPassed || f.FeeStatus == FeeStatus.PartialSettlement))
.Select(f => new
{
f.BusinessId,
f.BusinessType,
f.CustomerId,
f.Currency,
f.ExchangeRate
}).ToListAsync();
var currencies = list.GroupBy(x => new { x.BusinessId, x.BusinessType, x.CustomerId }).Select(x => new FeeClient
{
Id = x.Key.BusinessId,
BusinessType = x.Key.BusinessType,
CustomerId = x.Key.CustomerId,
ExchangeRates = x.GroupBy(y => y.Currency).Select(y => new CurrencyExchangeRate
{
Currency = y.Key,
ExchangeRate = x.Where(z => z.Currency == y.Key).Select(z => z.ExchangeRate).FirstOrDefault()
}).ToList()
}).ToList();
return DataResult<List<FeeClient>>.Success(currencies);
}
/// <summary>
/// 获取付费自由结算单
/// </summary>
@ -274,7 +270,7 @@ namespace DS.WMS.Core.Settlement.Method
AdvanceRate = x.AdvanceRate,
}).FirstAsync(x => x.Id == id && x.Mode == SettlementMode.FreeSettlement);
var templist = await TenantDb.Queryable<ApplicationDetail>().Where(x => x.ApplicationId == id) .ToListAsync();
var templist = await TenantDb.Queryable<ApplicationDetail>().Where(x => x.ApplicationId == id).ToListAsync();
model.SettlementDetails = templist.Adapt<List<SettlementDetailDto>>();
@ -373,8 +369,7 @@ namespace DS.WMS.Core.Settlement.Method
return DataResult<FreeSettlement>.Success(model);
}
protected override async Task<DataResult> PreSaveAsync(Entity.ApplicationSettlement settlement)
protected override async Task<DataResult> PreSaveAsync(ApplicationSettlement settlement)
{
//settlement.Mode = SettlementMode.FreeSettlement;
//settlement.BillType = SettlementBillType.Payment;
@ -417,7 +412,7 @@ namespace DS.WMS.Core.Settlement.Method
return sb.Length > 0 ? DataResult.Failed(sb.ToString()) : DataResult.Success;
}
protected override DataResult PreDelete(List<Entity.ApplicationSettlement> settlements)
protected override DataResult PreDelete(List<ApplicationSettlement> settlements)
{
if (settlements.Any(x => x.IsLocked))
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.SettlementIsLocked));
@ -425,9 +420,5 @@ namespace DS.WMS.Core.Settlement.Method
return DataResult.Success;
}
//protected override Task OnSaveAsync(PaymentSettlement settlement)
//{
// return base.OnSaveAsync(settlement);
//}
}
}

@ -1,22 +1,15 @@
using DS.Module.Core;
using DS.Module.Core.Enums;
using DS.Module.Core.Extensions;
using DS.Module.UserModule;
using DS.WMS.ContainerManagement.Info.Entity;
using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Application.Entity;
using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Fee.Method;
using DS.WMS.Core.Invoice.Dtos;
using DS.WMS.Core.Settlement.Dtos;
using DS.WMS.Core.Settlement.Entity;
using DS.WMS.Core.Settlement.Interface;
using DS.WMS.Core.Sys.Interface;
using Mapster;
using Microsoft.Extensions.DependencyInjection;
using Org.BouncyCastle.Ocsp;
using SqlSugar;
using System;
namespace DS.WMS.Core.Settlement.Method
{
@ -29,10 +22,6 @@ namespace DS.WMS.Core.Settlement.Method
{
readonly Lazy<ICommonService> CommonService;
//readonly Lazy<IFreeSettlementService> FreeSettlementService;
/// <summary>
/// 初始化
/// </summary>
@ -40,53 +29,6 @@ namespace DS.WMS.Core.Settlement.Method
public SettlementService(IServiceProvider serviceProvider) : base(serviceProvider)
{
CommonService = new Lazy<ICommonService>(serviceProvider.GetRequiredService<ICommonService>());
//FreeSettlementService = new Lazy<IFreeSettlementService>(serviceProvider.GetRequiredService<IFreeSettlementService>());
}
/// <summary>
/// 根据业务编号及类型获取关联费用记录
/// </summary>
/// <param name="items">业务ID与业务类型</param>
/// <returns></returns>
public async Task<DataResult<FeeForm>> GetFeesAsync(params FeeClient[] items)
{
var bizIds = items.Select(x => x.Id).Distinct();
var types = items.Select(x => x.BusinessType).Distinct();
var cIds = items.Select(x => x.CustomerId).Distinct();
var list = await TenantDb.Queryable<FeeRecord>()
.Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && cIds.Contains(f.CustomerId) &&
f.FeeStatus == FeeStatus.AuditPassed && (f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount) != 0)
.Select(f => new FeeItem
{
RecordId = f.Id,
BusinessId = f.BusinessId,
BusinessType = f.BusinessType,
CustomerId = f.CustomerId,
CustomerName = f.CustomerName,
FeeId = f.FeeId,
FeeName = f.FeeName,
FeeType = f.FeeType,
TotalAmount = f.Amount,
Currency = f.Currency,
OriginalRate = f.ExchangeRate,
RestAmount = f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount,
InvoiceAmount = f.InvoiceAmount,
AccTaxRate = f.AccTaxRate,
Remark = f.Remark
}).ToListAsync();
foreach (var item in list)
{
//本次结算金额默认等于剩余金额
item.Amount = item.RestAmount;
item.OriginalAmount = item.RestAmount;
}
return DataResult<FeeForm>.Success(new FeeForm(list));
}
@ -136,76 +78,25 @@ namespace DS.WMS.Core.Settlement.Method
settlement.CustomerName = first.CustomerName;
}
//var tempDetailList = request.Details.Select(x => new ApplicationDetail
//{
// RefId = x.ApplicationId,
// DetailId = x.Id,
// RecordId = x.RecordId,
// CustomerName = x.CustomerName ?? settlement.CustomerName,
// FeeId = x.FeeId,
// FeeName = x.FeeName,
// FeeType = x.FeeType,
// ApplyAmount = x.RestAmount.GetValueOrDefault(),
// Currency = x.Currency,
// ExchangeRate = x.ExchangeRate,
// OriginalAmount = x.OriginalAmount,
// OriginalCurrency = x.OriginalCurrency ?? (settlement.Currency.IsNullOrEmpty() ? x.Currency : settlement.Currency),
//}).ToList();
//if(tempDetailList.Count>0) details1 = new List<ApplicationDetail>();
//foreach (var tempDetail in tempDetailList)
//{
// if (tempDetail.DetailId != null)
// {
// details1.Add(tempDetail);
// }
// else {
// //20240929 该业务的所有符合条件的费用
// var feeClient = new FeeClient();
// var _detail = request.Details.First(x => x.BusinessId == tempDetail.BusinessId);
// feeClient.Id = _detail.BusinessId;
// feeClient.BusinessType = _detail.BusinessType;
// feeClient.CustomerId= request.Settlement.CustomerId;
// var paramarray = new FeeClient[]{ feeClient};
// var feeListResult = await GetFeesAsync(paramarray);
// var feeList = feeListResult.Data.Items;
// var _detailList = feeList.Where(x => x.FeeType == tempDetail.FeeType && x.RestAmount > 0)
// .Select(x => new ApplicationDetail
// {
// RefId = x.BusinessId,
// DetailId = 0,
// RecordId = x.RecordId,
// CustomerName = x.CustomerName ?? settlement.CustomerName,
// FeeId = x.FeeId,
// FeeName = x.FeeName,
// FeeType = x.FeeType,
// ApplyAmount = 0,
// Currency = x.Currency,
// ExchangeRate = tempDetail.ExchangeRate,
// OriginalAmount = 0,
// OriginalCurrency = x.Currency,
// })
// .ToList();
// details1.AddRange(_detailList);
// }
//}
details1 = await GetFeeDetailByBill(request);
details1 = request.Details.Select(x => new ApplicationDetail
{
RefId = x.ApplicationId,
DetailId = x.Id,
RecordId = x.RecordId,
CustomerName = x.CustomerName ?? settlement.CustomerName,
FeeId = x.FeeId,
FeeName = x.FeeName,
FeeType = x.FeeType,
ApplyAmount = x.RestAmount.GetValueOrDefault(),
Currency = x.Currency,
ExchangeRate = x.ExchangeRate,
OriginalAmount = x.OriginalAmount,
OriginalCurrency = x.OriginalCurrency ?? (settlement.Currency.IsNullOrEmpty() ? x.Currency : settlement.Currency),
}).ToList();
}
//按付费/发票申请结算
//按付费/发票申请/自由业务结算
if (request.Documents?.Count > 0)
{
if (settlement.Id == 0)
@ -303,6 +194,51 @@ namespace DS.WMS.Core.Settlement.Method
}
}
}
//按业务自由结算
else if (settlement.Mode == SettlementMode.FreeSettlement)
{
var types = request.Documents.Select(x => x.BusinessType.GetValueOrDefault());
var custIds = request.Documents.Select(x => x.CustomerId);
details1 = await TenantDb.Queryable<FeeRecord>().Where(f => ids.Contains(f.BusinessId) && types.Contains(f.BusinessType) && custIds.Contains(f.CustomerId) &&
(f.FeeStatus == FeeStatus.AuditPassed || f.FeeStatus == FeeStatus.PartialSettlement) && (f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount) != 0)
.Select(f => new ApplicationDetail
{
ApplicationId = settlement.Id,
BusinessId = f.BusinessId,
BusinessType = f.BusinessType,
RecordId = f.Id,
Category = f.FeeType == FeeType.Payable ? DetailCategory.PaidFreeSettlement : DetailCategory.ChargeFreeSettlement,
CustomerName = f.CustomerName ?? settlement.CustomerName,
FeeId = f.FeeId,
FeeName = f.FeeName,
FeeType = f.FeeType,
ApplyAmount = f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount,
Currency = f.Currency,
OriginalAmount = f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount,
OriginalCurrency = f.Currency,
ExchangeRate = f.ExchangeRate
}).ToListAsync();
if (!string.IsNullOrEmpty(settlement.Currency)) //指定结算币别
{
var details2 = details1.FindAll(x => x.OriginalCurrency != settlement.Currency);
foreach (var detail in details2)
{
detail.Currency = settlement.Currency;
var doc = request.Documents.Find(x => x.Id == detail.BusinessId && x.BusinessType == detail.BusinessType && x.CustomerName == x.CustomerName);
if (doc == null)
return DataResult<TEntity>.Failed("结算单据与费用明细不一致");
var exchange = doc.ExchangeRates?.Find(x => x.Currency == settlement.Currency);
if (exchange == null)
return DataResult<TEntity>.Failed($"未传入结算币别 {settlement.Currency} 与费用原币别 {detail.OriginalCurrency} 之间的汇率信息");
detail.ExchangeRate = exchange.ExchangeRate;
detail.ApplyAmount = Math.Round(exchange.ExchangeRate.GetValueOrDefault() * detail.OriginalAmount, 2, MidpointRounding.AwayFromZero);
}
}
}
//执行结算费用分配
foreach (var doc in request.Documents)
@ -395,7 +331,7 @@ namespace DS.WMS.Core.Settlement.Method
if (settlement.Id == 0)
{
//创建时需要生成申请单编号
var sequence = CommonService.Value. GetSequenceNext<TEntity>();
var sequence = CommonService.Value.GetSequenceNext<TEntity>();
if (!sequence.Succeeded)
{
return DataResult<TEntity>.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist);
@ -451,85 +387,6 @@ namespace DS.WMS.Core.Settlement.Method
}
}
/// <summary>
/// 通过前端传递的仅包含businessid的ApplicationDetail 获取这些业务的所有指定结算对象的费用明细
///
/// 如果参数的明细当中包含Detailid 代表传递的是具体费用
/// </summary>
/// <param name="BillList"></param>
/// <returns></returns>
private async Task< List<ApplicationDetail>> GetFeeDetailByBill(SettlementRequest<TEntity> request)
{
var result = new List<ApplicationDetail>();
var settlement = request.Settlement;
var tempDetailList = request.Details.Select(x => new ApplicationDetail
{
RefId = x.ApplicationId,
DetailId = x.Id,
RecordId = x.RecordId,
CustomerName = x.CustomerName ?? settlement.CustomerName,
FeeId = x.FeeId,
FeeName = x.FeeName,
FeeType = x.FeeType,
ApplyAmount = x.RestAmount.GetValueOrDefault(),
Currency = x.Currency,
ExchangeRate = x.ExchangeRate,
OriginalAmount = x.OriginalAmount,
OriginalCurrency = x.OriginalCurrency ?? (settlement.Currency.IsNullOrEmpty() ? x.Currency : settlement.Currency),
}).ToList();
foreach (var tempDetail in tempDetailList)
{
if (tempDetail.RecordId != null)
{
result.Add(tempDetail);
}
else
{
//20240929 该业务的所有符合条件的费用
var feeClient = new FeeClient();
var _detail = request.Details.First(x => x.BusinessId == tempDetail.BusinessId);
feeClient.Id = _detail.BusinessId;
feeClient.BusinessType = _detail.BusinessType;
feeClient.CustomerId = request.Settlement.CustomerId;
var paramarray = new FeeClient[] { feeClient };
var feeListResult = await GetFeesAsync(paramarray);
var feeList = feeListResult.Data.Items;
var _detailList = feeList.Where(x => x.FeeType == tempDetail.FeeType && x.RestAmount > 0)
.Select(x => new ApplicationDetail
{
RefId = x.BusinessId,
DetailId = 0,
RecordId = x.RecordId,
CustomerName = x.CustomerName ?? settlement.CustomerName,
FeeId = x.FeeId,
FeeName = x.FeeName,
FeeType = x.FeeType,
ApplyAmount = 0,
Currency = x.Currency,
ExchangeRate = tempDetail.ExchangeRate,
OriginalAmount = 0,
OriginalCurrency = x.Currency,
})
.ToList();
result.AddRange(_detailList);
}
}
return result;
}
/// <summary>
/// 用于结算单的状态检查
/// </summary>
@ -772,34 +629,5 @@ namespace DS.WMS.Core.Settlement.Method
return Task.FromResult(new List<SettlementDetailDto>());
}
/// <summary>
/// 获取待结算费用明细的原始币别
/// </summary>
/// <param name="documents"></param>
/// <returns></returns>
public async Task<DataResult<List<SettlementDocument>>> GetExchangesAsync(SettlementRequest<TEntity> request)
{
var details = await GetFeeDetailByBill(request);
var result = new List<SettlementDocument>();
foreach (var item in request.Details)
{
var document = item.Adapt<SettlementDocument>();
document.Id = item.BusinessId;
if (details.Exists(x => x.BusinessId == document.Id)) {
foreach (var detail in details.Where(x => x.BusinessId == document.Id))
{
if (!document.ExchangeRates.Exists(x => x.Currency == item.OriginalCurrency))
document.ExchangeRates.Add(new CurrencyExchangeRate { Currency = item.OriginalCurrency });
}
}
result.Add(document);
}
return DataResult<List<SettlementDocument>>.Success(result);
}
}
}

@ -395,6 +395,9 @@ public class ClientCommonService : IClientCommonService
case "J"://件数
data.Quantity = seaExport.PKGS;
break;
case "TEU"://TEU
data.Quantity = seaExport.TEU;
break;
case "JF"://计费吨
data.Quantity = seaExport.KGS / 1000 > seaExport.CBM ? seaExport.KGS / 1000 : seaExport.CBM;
break;
@ -1250,7 +1253,8 @@ public class ClientCommonService : IClientCommonService
public async Task<DataResult<List<ClientSelectRes>>> GetClientListByCode(string code = "", string queryKey = "")
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var sql = "select CreateBy As UserIds from info_client_stakeholder where SYSDATE() BETWEEN StartDate and EndDate AND ClientId ={0}";
//code = code.ToLower();
var data = await tenantDb.Queryable<InfoClient>()
.InnerJoin<InfoClientTag>((a, b) => a.Id == b.ClientId)
@ -1286,7 +1290,8 @@ public class ClientCommonService : IClientCommonService
BLContent = a.BLContent,
PinYinCode = a.ShortName + "(" + a.CodeName + ")"
}
).MergeTable().OrderBy(x => x.CodeName).Take(20).WithCache($"{SqlSugarCacheConst.InfoClient}{user.TenantId}", SqlSugarCacheConst.CacheDurationInSeconds).ToListAsync();
)
.MergeTable().OrderBy(x => x.CodeName).Take(20).WithCache($"{SqlSugarCacheConst.InfoClient}{user.TenantId}", SqlSugarCacheConst.CacheDurationInSeconds).ToListAsync();
return await Task.FromResult(DataResult<List<ClientSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess));
}

@ -15,8 +15,10 @@ using DS.WMS.Core.Flow.Entity;
using DS.WMS.Core.Map.Dtos;
using DS.WMS.Core.Map.Interface;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Dtos.Cargoo;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.Sys.Interface;
using DS.WMS.Core.TaskPlat.Dtos;
@ -3603,6 +3605,25 @@ namespace DS.WMS.Core.TaskPlat.Method
.Where(x => x.Id == waitUpdateFlowInstanceId)
.ExecuteCommandAsync();
}
// 4. 如果任务类型为退舱确认当任务完成时需要发送Cargoo
if (model.TASK_TYPE == TaskBaseTypeEnum.RETURN_CABIN.ToString())
{
try
{
// 退舱完成后推送Cargoo
var cargooService = serviceProvider.GetRequiredService<ICargooService>();
await cargooService.SendCargoo(new CargooShipmentReqDto()
{
bookingId = (long)model.OUT_BS_NO,
cargooStatusEnum = CargooStatusEnum.Cancelled
});
}
catch (Exception ex)
{
logger.LogError(ex, "退舱确认任务完成时推送Cargoo的过程中发生异常");
}
}
}
await tenantDb.Updateable(model).UpdateColumns(it => new

@ -7,9 +7,22 @@ namespace DS.Module.Core.Utils
/// </summary>
public static class PDFUtil
{
public static void AddStramp(Stream stream)
public static async void AddStrampAsync(this Stream stream)
{
ArgumentNullException.ThrowIfNull(stream, nameof(stream));
if (!stream.CanRead)
throw new ArgumentException("流不支持读取", nameof(stream));
var pdfStream = stream;
if (!stream.CanWrite)
{
pdfStream = new MemoryStream();
await stream.CopyToAsync(pdfStream);
}
var pdfReader = new PdfReader(stream);
}
}
}

@ -1,5 +1,6 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Enums;
using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Settlement.Dtos;
using DS.WMS.Core.Settlement.Entity;
@ -9,7 +10,7 @@ using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.FeeApi.Controllers
{
/// <summary>
/// 付费自由结算API
/// 自由结算API
/// </summary>
public class PaymentFreeSettlementController : ApiController
{
@ -47,7 +48,7 @@ namespace DS.WMS.FeeApi.Controllers
}
/// <summary>
/// 获取付费自由结算单
/// 获取自由结算单
/// </summary>
/// <param name="id">结算单ID</param>
/// <returns></returns>
@ -58,7 +59,7 @@ namespace DS.WMS.FeeApi.Controllers
}
/// <summary>
/// 获取付费自由结算明细
/// 获取自由结算明细
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
@ -70,23 +71,28 @@ namespace DS.WMS.FeeApi.Controllers
}
/// <summary>
/// 根据费申请创建结算单
/// 根据申请创建结算单
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("Save")]
public async Task<DataResult<ApplicationSettlement>> SaveAsync([FromBody] SettlementRequest<ApplicationSettlement> request)
{
request.Settlement.Mode = SettlementMode.FreeSettlement;
return await _service.SaveAsync(request);
}
[HttpPost, Route("GetExchangesAsync")]
public async Task<DataResult<List<SettlementDocument>>> GetExchangesAsync([FromBody] SettlementRequest<ApplicationSettlement> request)
/// <summary>
/// 根据业务编号及类型获取该票业务的币别
/// </summary>
/// <param name="items">业务ID与业务类型</param>
/// <returns></returns>
[HttpPost, Route("GetCurrencies")]
public async Task<DataResult<List<FeeClient>>> GetCurrenciesAsync([FromBody] FeeClient[] items)
{
return await _service.GetExchangesAsync(request);
return await _service.GetCurrenciesAsync(items);
}
/// <summary>
/// 删除申请单明细
/// </summary>

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl>
<History>True|2024-10-12T05:33:32.4412583Z||;True|2024-10-11T17:00:54.0916209+08:00||;True|2024-10-11T10:54:50.3307087+08:00||;True|2024-10-11T10:45:07.8181500+08:00||;True|2024-10-11T10:40:44.2066046+08:00||;True|2024-10-11T10:21:25.7226983+08:00||;True|2024-10-11T10:09:05.5257478+08:00||;True|2024-10-10T14:58:29.1228618+08:00||;True|2024-10-10T14:05:59.4501659+08:00||;True|2024-10-10T11:08:58.9765455+08:00||;True|2024-10-08T17:59:07.5583287+08:00||;True|2024-09-27T19:01:59.6945760+08:00||;True|2024-09-27T18:45:48.2812860+08:00||;True|2024-09-27T18:10:25.5697467+08:00||;True|2024-09-27T17:39:06.3169139+08:00||;True|2024-09-27T17:30:14.1043193+08:00||;True|2024-09-27T16:02:09.0703159+08:00||;True|2024-09-27T15:53:05.1789245+08:00||;True|2024-09-27T15:32:52.1934490+08:00||;True|2024-09-27T13:51:24.9197626+08:00||;True|2024-09-27T13:48:17.2817346+08:00||;True|2024-09-27T11:51:46.8193040+08:00||;True|2024-09-27T10:58:33.1059648+08:00||;True|2024-09-27T10:37:35.0336563+08:00||;False|2024-09-27T10:31:52.6302264+08:00||;True|2024-09-26T19:50:15.5513195+08:00||;True|2024-09-26T19:47:14.0781788+08:00||;True|2024-09-26T19:01:26.5428388+08:00||;True|2024-09-26T18:35:28.7455319+08:00||;True|2024-09-26T18:24:30.8084807+08:00||;True|2024-09-26T18:20:47.3005460+08:00||;True|2024-09-26T18:04:39.8012913+08:00||;True|2024-09-26T17:48:13.8526872+08:00||;True|2024-09-26T16:08:20.1746970+08:00||;True|2024-09-26T16:01:01.1501975+08:00||;False|2024-09-26T16:00:34.1516745+08:00||;True|2024-09-26T14:33:03.4007570+08:00||;True|2024-09-25T19:14:27.8906774+08:00||;True|2024-09-25T18:57:40.1435131+08:00||;True|2024-09-25T17:38:44.0915841+08:00||;True|2024-09-25T15:33:58.4630618+08:00||;True|2024-09-25T15:10:31.3022063+08:00||;False|2024-09-25T14:14:40.9640545+08:00||;True|2024-09-25T10:09:32.2558600+08:00||;True|2024-09-25T09:59:17.1525160+08:00||;False|2024-09-25T09:57:58.7265103+08:00||;False|2024-09-25T09:53:36.7732713+08:00||;False|2024-09-24T18:40:10.0166224+08:00||;True|2024-09-24T08:59:56.1995425+08:00||;True|2024-09-23T18:07:54.7222163+08:00||;True|2024-09-23T17:23:57.7568406+08:00||;True|2024-09-23T16:28:49.3169826+08:00||;True|2024-09-23T15:57:31.8052490+08:00||;True|2024-09-23T11:47:21.1445419+08:00||;True|2024-09-23T09:24:36.0732229+08:00||;True|2024-09-21T11:59:19.0549926+08:00||;True|2024-09-21T11:24:32.4451752+08:00||;True|2024-09-21T10:39:11.5297411+08:00||;True|2024-09-20T18:24:31.7827684+08:00||;True|2024-09-19T17:55:53.1666689+08:00||;True|2024-09-19T17:42:47.9061485+08:00||;True|2024-09-19T16:08:21.7225571+08:00||;False|2024-09-19T14:15:42.9318446+08:00||;True|2024-09-19T11:20:03.5567568+08:00||;True|2024-09-18T11:35:18.1509724+08:00||;True|2024-09-18T09:08:59.1152574+08:00||;True|2024-09-14T15:48:22.9374486+08:00||;True|2024-09-14T15:42:19.0503983+08:00||;True|2024-09-14T11:51:53.3339222+08:00||;True|2024-09-14T11:41:38.3542237+08:00||;True|2024-09-14T11:19:13.1037012+08:00||;True|2024-09-13T14:31:12.4598160+08:00||;True|2024-09-13T10:44:56.1241214+08:00||;False|2024-09-13T10:44:26.6088271+08:00||;False|2024-09-13T10:44:06.1615137+08:00||;False|2024-09-13T10:43:19.2432517+08:00||;False|2024-09-13T10:38:18.1663387+08:00||;True|2024-09-06T18:49:17.9435308+08:00||;True|2024-09-06T17:01:39.6646353+08:00||;True|2024-09-06T10:27:36.9990456+08:00||;True|2024-09-06T09:48:23.4236094+08:00||;True|2024-09-05T13:57:23.8452431+08:00||;True|2024-09-05T10:21:34.6675149+08:00||;True|2024-09-05T09:12:44.5610882+08:00||;True|2024-09-04T10:07:38.3707398+08:00||;True|2024-09-04T09:52:47.0574599+08:00||;True|2024-09-03T16:41:23.7516960+08:00||;True|2024-09-03T15:22:31.8718097+08:00||;True|2024-09-03T10:01:09.7656702+08:00||;False|2024-09-03T09:46:46.8956531+08:00||;True|2024-09-02T17:07:41.0268500+08:00||;True|2024-09-02T13:50:22.0203254+08:00||;True|2024-09-02T13:34:23.3441546+08:00||;True|2024-08-30T11:25:14.7431645+08:00||;True|2024-08-29T16:38:26.3491372+08:00||;True|2024-08-29T16:32:31.8580864+08:00||;False|2024-08-29T16:30:41.4763198+08:00||;True|2024-08-09T09:18:05.8484398+08:00||;True|2024-08-09T08:45:38.7858906+08:00||;True|2024-08-05T11:37:07.3133020+08:00||;</History>
<History>True|2024-10-15T09:39:40.4090324Z||;True|2024-10-15T17:06:43.0181578+08:00||;True|2024-10-15T15:07:38.9601925+08:00||;True|2024-10-12T13:33:32.4412583+08:00||;True|2024-10-11T17:00:54.0916209+08:00||;True|2024-10-11T10:54:50.3307087+08:00||;True|2024-10-11T10:45:07.8181500+08:00||;True|2024-10-11T10:40:44.2066046+08:00||;True|2024-10-11T10:21:25.7226983+08:00||;True|2024-10-11T10:09:05.5257478+08:00||;True|2024-10-10T14:58:29.1228618+08:00||;True|2024-10-10T14:05:59.4501659+08:00||;True|2024-10-10T11:08:58.9765455+08:00||;True|2024-10-08T17:59:07.5583287+08:00||;True|2024-09-27T19:01:59.6945760+08:00||;True|2024-09-27T18:45:48.2812860+08:00||;True|2024-09-27T18:10:25.5697467+08:00||;True|2024-09-27T17:39:06.3169139+08:00||;True|2024-09-27T17:30:14.1043193+08:00||;True|2024-09-27T16:02:09.0703159+08:00||;True|2024-09-27T15:53:05.1789245+08:00||;True|2024-09-27T15:32:52.1934490+08:00||;True|2024-09-27T13:51:24.9197626+08:00||;True|2024-09-27T13:48:17.2817346+08:00||;True|2024-09-27T11:51:46.8193040+08:00||;True|2024-09-27T10:58:33.1059648+08:00||;True|2024-09-27T10:37:35.0336563+08:00||;False|2024-09-27T10:31:52.6302264+08:00||;True|2024-09-26T19:50:15.5513195+08:00||;True|2024-09-26T19:47:14.0781788+08:00||;True|2024-09-26T19:01:26.5428388+08:00||;True|2024-09-26T18:35:28.7455319+08:00||;True|2024-09-26T18:24:30.8084807+08:00||;True|2024-09-26T18:20:47.3005460+08:00||;True|2024-09-26T18:04:39.8012913+08:00||;True|2024-09-26T17:48:13.8526872+08:00||;True|2024-09-26T16:08:20.1746970+08:00||;True|2024-09-26T16:01:01.1501975+08:00||;False|2024-09-26T16:00:34.1516745+08:00||;True|2024-09-26T14:33:03.4007570+08:00||;True|2024-09-25T19:14:27.8906774+08:00||;True|2024-09-25T18:57:40.1435131+08:00||;True|2024-09-25T17:38:44.0915841+08:00||;True|2024-09-25T15:33:58.4630618+08:00||;True|2024-09-25T15:10:31.3022063+08:00||;False|2024-09-25T14:14:40.9640545+08:00||;True|2024-09-25T10:09:32.2558600+08:00||;True|2024-09-25T09:59:17.1525160+08:00||;False|2024-09-25T09:57:58.7265103+08:00||;False|2024-09-25T09:53:36.7732713+08:00||;False|2024-09-24T18:40:10.0166224+08:00||;True|2024-09-24T08:59:56.1995425+08:00||;True|2024-09-23T18:07:54.7222163+08:00||;True|2024-09-23T17:23:57.7568406+08:00||;True|2024-09-23T16:28:49.3169826+08:00||;True|2024-09-23T15:57:31.8052490+08:00||;True|2024-09-23T11:47:21.1445419+08:00||;True|2024-09-23T09:24:36.0732229+08:00||;True|2024-09-21T11:59:19.0549926+08:00||;True|2024-09-21T11:24:32.4451752+08:00||;True|2024-09-21T10:39:11.5297411+08:00||;True|2024-09-20T18:24:31.7827684+08:00||;True|2024-09-19T17:55:53.1666689+08:00||;True|2024-09-19T17:42:47.9061485+08:00||;True|2024-09-19T16:08:21.7225571+08:00||;False|2024-09-19T14:15:42.9318446+08:00||;True|2024-09-19T11:20:03.5567568+08:00||;True|2024-09-18T11:35:18.1509724+08:00||;True|2024-09-18T09:08:59.1152574+08:00||;True|2024-09-14T15:48:22.9374486+08:00||;True|2024-09-14T15:42:19.0503983+08:00||;True|2024-09-14T11:51:53.3339222+08:00||;True|2024-09-14T11:41:38.3542237+08:00||;True|2024-09-14T11:19:13.1037012+08:00||;True|2024-09-13T14:31:12.4598160+08:00||;True|2024-09-13T10:44:56.1241214+08:00||;False|2024-09-13T10:44:26.6088271+08:00||;False|2024-09-13T10:44:06.1615137+08:00||;False|2024-09-13T10:43:19.2432517+08:00||;False|2024-09-13T10:38:18.1663387+08:00||;True|2024-09-06T18:49:17.9435308+08:00||;True|2024-09-06T17:01:39.6646353+08:00||;True|2024-09-06T10:27:36.9990456+08:00||;True|2024-09-06T09:48:23.4236094+08:00||;True|2024-09-05T13:57:23.8452431+08:00||;True|2024-09-05T10:21:34.6675149+08:00||;True|2024-09-05T09:12:44.5610882+08:00||;True|2024-09-04T10:07:38.3707398+08:00||;True|2024-09-04T09:52:47.0574599+08:00||;True|2024-09-03T16:41:23.7516960+08:00||;True|2024-09-03T15:22:31.8718097+08:00||;True|2024-09-03T10:01:09.7656702+08:00||;False|2024-09-03T09:46:46.8956531+08:00||;True|2024-09-02T17:07:41.0268500+08:00||;True|2024-09-02T13:50:22.0203254+08:00||;True|2024-09-02T13:34:23.3441546+08:00||;True|2024-08-30T11:25:14.7431645+08:00||;True|2024-08-29T16:38:26.3491372+08:00||;True|2024-08-29T16:32:31.8580864+08:00||;False|2024-08-29T16:30:41.4763198+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

@ -96,9 +96,12 @@ namespace DS.WMS.MainApi.Controllers
return DataResult.Failed("请联系站点管理员配置邮件服务URL");
var userEmail = await userEmailService.GetCurrentUserEmailAsync();
if (!userEmail.Succeeded || userEmail.Data == null)
if (!userEmail.Succeeded || userEmail.Data == null || string.IsNullOrEmpty(userEmail.Data.MailAccount))
return DataResult.Failed("你尚未配置邮箱设置,请到系统设置中维护后重试此操作");
if (string.IsNullOrEmpty(userEmail.Data.Password))
return DataResult.Failed("你尚未配置邮箱账户密码,请到系统设置中维护后重试此操作");
if (model.Attachments?.Length > 0)
{
for (int i = 0; i < model.Attachments.Length; i++)

Loading…
Cancel
Save