zhangxiaofeng 2 months ago
commit a75711df45

@ -744,6 +744,7 @@ namespace DS.WMS.Core.Fee.Method
{
Id = x.Id,
BusinessId = x.BusinessId,
BusinessType = x.BusinessType,
BillAuditStatus = x.BillAuditStatus
}).FirstAsync();
if (biz == null)
@ -751,8 +752,14 @@ namespace DS.WMS.Core.Fee.Method
}
else
{
fee = await TenantDb.Queryable<FeeRecord>().Where(x => x.Id == callback.BusinessId && x.BusinessType == callback.BusinessType).Select(
x => new FeeRecord { Id = x.Id, FeeStatus = x.FeeStatus }).FirstAsync();
fee = await TenantDb.Queryable<FeeRecord>().Where(x => x.Id == callback.BusinessId).Select(
x => new FeeRecord
{
Id = x.Id,
FeeStatus = x.FeeStatus,
BusinessId = x.BusinessId,
BusinessType = x.BusinessType
}).FirstAsync();
if (fee == null)
return DataResult.Failed(MultiLanguageConst.Operation_Failed);
@ -881,7 +888,7 @@ namespace DS.WMS.Core.Fee.Method
.SetColumns(x => x.AuditBy == UserId)
.SetColumns(x => x.AuditOperator == User.UserName)
.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();
break;
@ -910,9 +917,10 @@ namespace DS.WMS.Core.Fee.Method
}
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);
}
}
}
}

@ -166,60 +166,63 @@ namespace DS.WMS.Core.Fee.Method
foreach (var item in items)
{
//逐个判定处理标准
switch (item.Unit)
if (item.Quantity == 0)
{
case "HOUR": //小时
goto case "P";
//逐个判定处理标准
switch (item.Unit)
{
case "HOUR": //小时
goto case "P";
case "GE": //个
goto case "P";
case "GE": //个
goto case "P";
case "DAY": //天
goto case "P";
case "DAY": //天
goto case "P";
//case "XX": //箱型
// goto default;
//case "XX": //箱型
// goto default;
case "JJZL": //计价重量
goto case "Z";
case "JJZL": //计价重量
goto case "Z";
case "ZJ": //总价
goto case "P";
case "ZJ": //总价
goto case "P";
case "JZ": //净重
item.Quantity = 0;
break;
case "JZ": //净重
item.Quantity = 0;
break;
case "TEU": //TEU
item.Quantity = order.TEU;
break;
case "TEU": //TEU
item.Quantity = order.TEU;
break;
case "JF": //计费吨
item.Quantity = order.KGS.GetValueOrDefault() / 1000 > order.CBM.GetValueOrDefault() ? order.KGS.GetValueOrDefault() : order.CBM.GetValueOrDefault();
break;
case "JF": //计费吨
item.Quantity = order.KGS.GetValueOrDefault() / 1000 > order.CBM.GetValueOrDefault() ? order.KGS.GetValueOrDefault() : order.CBM.GetValueOrDefault();
break;
case "J": //件数
item.Quantity = order.PKGS.GetValueOrDefault();
break;
case "J": //件数
item.Quantity = order.PKGS.GetValueOrDefault();
break;
case "C": //尺码
item.Quantity = order.CBM.GetValueOrDefault();
break;
case "C": //尺码
item.Quantity = order.CBM.GetValueOrDefault();
break;
case "Z": //重量
item.Quantity = order.KGS.GetValueOrDefault();
break;
case "Z": //重量
item.Quantity = order.KGS.GetValueOrDefault();
break;
case "P": //单票
item.Quantity = 1;
break;
case "P": //单票
item.Quantity = 1;
break;
default: //查找箱型标准
var ctn = ctns.Find(x => x.CtnCode == item.Unit);
item.Quantity = ctn == null ? 0 : ctn.CtnNum.GetValueOrDefault();
break;
}
default: //查找箱型标准
var ctn = ctns.Find(x => x.CtnCode == item.Unit);
item.Quantity = ctn == null ? 0 : ctn.CtnNum.GetValueOrDefault();
break;
}
}
//计算税费
item.SetTax();
@ -1038,7 +1041,7 @@ namespace DS.WMS.Core.Fee.Method
/// <returns></returns>
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
{
FeeType = x.FeeType,

@ -113,6 +113,15 @@ public interface IClientFlowInstanceService
Task<DataResult> WithdrawAsync(TaskBaseTypeEnum taskType, long[] bsIds,
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>

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

@ -4,6 +4,7 @@ using DS.Module.Core.Extensions;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Flow.Entity;
using DS.WMS.Core.Flow.Interface;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Sys.Entity;
using Mapster;
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>

@ -113,6 +113,20 @@ public class ClientFlowInstanceController : ApiController
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>
@ -122,7 +136,7 @@ public class ClientFlowInstanceController : ApiController
/// <returns></returns>
[HttpGet, Route("GetFlowContent")]
public DataResult<List<FlowInstanceRes>> GetFlowContent(
[FromQuery] long businessId,
[FromQuery] long businessId,
[FromQuery] BusinessType? businessType,
[FromQuery] params TaskBaseTypeEnum[]? types)
{

Loading…
Cancel
Save