zhangxiaofeng 2 months ago
commit a75711df45

@ -744,6 +744,7 @@ namespace DS.WMS.Core.Fee.Method
{ {
Id = x.Id, Id = x.Id,
BusinessId = x.BusinessId, BusinessId = x.BusinessId,
BusinessType = x.BusinessType,
BillAuditStatus = x.BillAuditStatus BillAuditStatus = x.BillAuditStatus
}).FirstAsync(); }).FirstAsync();
if (biz == null) if (biz == null)
@ -751,8 +752,14 @@ namespace DS.WMS.Core.Fee.Method
} }
else else
{ {
fee = await TenantDb.Queryable<FeeRecord>().Where(x => x.Id == callback.BusinessId && x.BusinessType == callback.BusinessType).Select( fee = await TenantDb.Queryable<FeeRecord>().Where(x => x.Id == callback.BusinessId).Select(
x => new FeeRecord { Id = x.Id, FeeStatus = x.FeeStatus }).FirstAsync(); x => new FeeRecord
{
Id = x.Id,
FeeStatus = x.FeeStatus,
BusinessId = x.BusinessId,
BusinessType = x.BusinessType
}).FirstAsync();
if (fee == null) if (fee == null)
return DataResult.Failed(MultiLanguageConst.Operation_Failed); return DataResult.Failed(MultiLanguageConst.Operation_Failed);
@ -881,7 +888,7 @@ namespace DS.WMS.Core.Fee.Method
.SetColumns(x => x.AuditBy == UserId) .SetColumns(x => x.AuditBy == UserId)
.SetColumns(x => x.AuditOperator == User.UserName) .SetColumns(x => x.AuditOperator == User.UserName)
.SetColumns(x => x.AuditDate == dtNow) .SetColumns(x => x.AuditDate == dtNow)
.Where(x => x.BusinessId == biz.BusinessId && x.BusinessType == callback.BusinessType && .Where(x => x.BusinessId == biz.BusinessId && x.BusinessType == biz.BusinessType &&
(x.FeeStatus == FeeStatus.Entering || x.FeeStatus == FeeStatus.RejectSubmission)).ExecuteCommandAsync(); (x.FeeStatus == FeeStatus.Entering || x.FeeStatus == FeeStatus.RejectSubmission)).ExecuteCommandAsync();
break; break;
@ -910,9 +917,10 @@ namespace DS.WMS.Core.Fee.Method
} }
finally finally
{ {
await feeService.WriteBackStatusAsync(callback.BusinessId, callback.BusinessType.Value); await feeService.WriteBackStatusAsync(
auditType == TaskBaseTypeEnum.FEE_BUSINESS_AUDIT ? biz.BusinessId : fee.BusinessId,
auditType == TaskBaseTypeEnum.FEE_BUSINESS_AUDIT ? biz.BusinessType : fee.BusinessType);
} }
} }
} }
} }

@ -165,6 +165,8 @@ namespace DS.WMS.Core.Fee.Method
}).ToListAsync(); }).ToListAsync();
foreach (var item in items) foreach (var item in items)
{
if (item.Quantity == 0)
{ {
//逐个判定处理标准 //逐个判定处理标准
switch (item.Unit) switch (item.Unit)
@ -220,6 +222,7 @@ namespace DS.WMS.Core.Fee.Method
item.Quantity = ctn == null ? 0 : ctn.CtnNum.GetValueOrDefault(); item.Quantity = ctn == null ? 0 : ctn.CtnNum.GetValueOrDefault();
break; break;
} }
}
//计算税费 //计算税费
item.SetTax(); item.SetTax();
@ -1038,7 +1041,7 @@ namespace DS.WMS.Core.Fee.Method
/// <returns></returns> /// <returns></returns>
public async Task WriteBackStatusAsync(long businessId, BusinessType businessType) public async Task WriteBackStatusAsync(long businessId, BusinessType businessType)
{ {
var fees = await TenantDb.Queryable<FeeRecord>().Where(x => x.BusinessId == businessId && x.BusinessType == businessType) var fees = await TenantDb.Queryable<FeeRecord>().Where(x => x.BusinessId == businessId)
.Select(x => new FeeRecord .Select(x => new FeeRecord
{ {
FeeType = x.FeeType, FeeType = x.FeeType,

@ -113,6 +113,15 @@ public interface IClientFlowInstanceService
Task<DataResult> WithdrawAsync(TaskBaseTypeEnum taskType, long[] bsIds, Task<DataResult> WithdrawAsync(TaskBaseTypeEnum taskType, long[] bsIds,
BusinessType? businessType = null, string? note = null); BusinessType? businessType = null, string? note = null);
/// <summary>
/// 运行回调更新
/// </summary>
/// <param name="bsId">业务ID</param>
/// <param name="businessType">业务类型</param>
/// <param name="callbackURL">回调URL</param>
/// <returns></returns>
Task<DataResult> RunCallbackAsync(long bsId, BusinessType? businessType = null, string? callbackURL = null);
/// <summary> /// <summary>
/// 获取流程操作历史 /// 获取流程操作历史
/// </summary> /// </summary>

@ -1,6 +1,5 @@
using DS.Module.Core; using DS.Module.Core;
using DS.WMS.Core.Flow.Dtos; using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Flow.Entity;
using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Op.Entity;
namespace DS.WMS.Core.Flow.Interface; namespace DS.WMS.Core.Flow.Interface;
@ -58,7 +57,6 @@ public interface IFlowInstanceService
/// <returns></returns> /// <returns></returns>
public DataResult WithdrawFlowInstance(CancelFlowInstanceReq req); public DataResult WithdrawFlowInstance(CancelFlowInstanceReq req);
/// <summary> /// <summary>
/// 获取流程操作历史 /// 获取流程操作历史
/// </summary> /// </summary>

@ -4,6 +4,7 @@ using DS.Module.Core.Extensions;
using DS.WMS.Core.Flow.Dtos; using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Flow.Entity; using DS.WMS.Core.Flow.Entity;
using DS.WMS.Core.Flow.Interface; using DS.WMS.Core.Flow.Interface;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Sys.Entity; using DS.WMS.Core.Sys.Entity;
using Mapster; using Mapster;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -535,6 +536,37 @@ public class FlowInstanceService : ServiceBase, IFlowInstanceService
} }
} }
/// <summary>
/// 运行回调更新
/// </summary>
/// <param name="bsId">业务ID</param>
/// <param name="businessType">业务类型</param>
/// <param name="callbackURL">回调URL</param>
/// <returns></returns>
public async Task<DataResult> RunCallbackAsync(long bsId, BusinessType? businessType = null, string? callbackURL = null)
{
var instance = await Db.Queryable<FlowInstance>().Where(x => x.BusinessId == bsId && x.BusinessType == businessType)
.InnerJoin<FlowTemplateTenant>((f, ft) => f.TemplateId == ft.Id).Select((f, ft) => new FlowInstance
{
BusinessId = f.BusinessId,
BusinessType = f.BusinessType,
CallbackURL = ft.CallbackURL,
MarkerNotifyURL = ft.MarkerNotifyURL,
FlowStatus = f.FlowStatus,
Id = f.Id,
AuditType = ft.AuditType
}).FirstAsync();
if (instance == null)
return DataResult.FailedWithDesc(MultiLanguageConst.EmptyData);
if (!string.IsNullOrEmpty(callbackURL))
instance.CallbackURL = callbackURL;
await RunCallbackAsync(instance);
return DataResult.Success;
}
/// <summary> /// <summary>
/// 获取运行实例信息 /// 获取运行实例信息
/// </summary> /// </summary>

@ -113,6 +113,20 @@ public class ClientFlowInstanceController : ApiController
return res; return res;
} }
/// <summary>
/// 运行回调更新
/// </summary>
/// <param name="bsId">业务ID</param>
/// <param name="businessType">业务类型(可选)</param>
/// <param name="callbackURL">回调URL可选</param>
/// <returns></returns>
/// <remarks>若未指定<paramref name="callbackURL"/>,则使用工作流默认的回调地址</remarks>
[HttpGet, HttpPost, Route("RunCallback")]
public async Task<DataResult> RunCallbackAsync(long bsId, BusinessType? businessType = null, string? callbackURL = null)
{
return await _invokeService.RunCallbackAsync(bsId, businessType, callbackURL);
}
/// <summary> /// <summary>
/// 获取流程运行实例的内容 /// 获取流程运行实例的内容
/// </summary> /// </summary>

Loading…
Cancel
Save