海运出口撤销审单 更新状态等操作

dev
cjy 4 weeks ago
parent 585fa38136
commit f846a04583

@ -3,12 +3,16 @@ using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Helpers;
using DS.Module.DjyRulesEngine;
using DS.Module.DjyServiceStatus;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Flow.Entity;
using DS.WMS.Core.Flow.Interface;
using DS.WMS.Core.Flow.Method;
using DS.WMS.Core.Info.Interface;
using DS.WMS.Core.Invoice.Dtos;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.TaskInteraction.Dtos;
using DS.WMS.Core.TaskInteraction.Entity;
@ -114,7 +118,15 @@ namespace DS.WMS.Core.TaskInteraction.Method
/// 规则库服务
/// </summary>
protected Lazy<IRuleEngineService> RuleEngineService { get; private set; }
/// <summary>
/// 海运出口公共服务
/// </summary>
protected Lazy<ISeaExportCommonService> seaComService { get; private set; }
/// <summary>
/// 大简云服务状态服务
/// </summary>
protected Lazy<IDjyServiceStatusService> djyStatusService { get; private set; }
/// <summary>
/// 初始化
/// </summary>
@ -129,7 +141,8 @@ namespace DS.WMS.Core.TaskInteraction.Method
ClientParamService = new Lazy<IClientParamService>(provider.GetRequiredService<IClientParamService>());
FlowService = new Lazy<IClientFlowInstanceService>(provider.GetRequiredService<IClientFlowInstanceService>());
RuleEngineService = new Lazy<IRuleEngineService>(provider.GetRequiredService<IRuleEngineService>());
seaComService = new Lazy<ISeaExportCommonService>(provider.GetRequiredService<ISeaExportCommonService>());
djyStatusService = new Lazy<IDjyServiceStatusService>(provider.GetRequiredService<IDjyServiceStatusService>());
TenantDb.QueryFilter.Clear<IOrgId>();
}
@ -823,11 +836,50 @@ namespace DS.WMS.Core.TaskInteraction.Method
TaskStatus = TaskStatusEnum.Cancel,
TaskType = request.TaskType
});
//海运出口撤销审单 更新状态等操作
if (request.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT)
{
await TenantDb.Updateable<SeaExport>().SetColumns(x => x.BusinessStatusName == null)
.Where(x => x.Id == request.BusinessId).ExecuteCommandAsync();
//await TenantDb.Updateable<SeaExport>().SetColumns(x => x.BusinessStatusName == null)
//.Where(x => x.Id == request.BusinessId).ExecuteCommandAsync();
//删除提交货物状态
var goodsStatus = TenantDb.Queryable<BookingGoodsStatus>().First(x => x.StatusCode == "TIJIAO" && x.BusinessId == request.BusinessId);
if (goodsStatus != null)
await TenantDb.Updateable(goodsStatus).ExecuteCommandAsync();
var order = TenantDb.Queryable<SeaExport>().Filter(null, true).First(x => x.Id == request.BusinessId);
var oldOrder = order.Adapt<SeaExport>();
order.BusinessStatusName = string.Empty;
order.BusinessStatus = string.Empty;
await TenantDb.Updateable(order).UpdateColumns(x => new
{
x.BusinessStatusName,
x.BusinessStatus
}).EnableDiffLogEvent().ExecuteCommandAsync();
// 记录日志
await seaComService.Value.SaveSeaExportLogAsync(new SeaExportSaveLog()
{
OperateType = "Update",
OldOrder = oldOrder,
NewOrder = order,
SourceCode = "WithdrawAsync",
SourceName = "撤销审单更新",
}, TenantDb);
//更新大简云货物状态
var pushModel = new EmbedServiceProjectStatusDto
{
businessId = request.BusinessId.ToString(),
SourceType = 1,
StatusCodes = new List<EmbedServiceProjectStatusDetailDto> {
new EmbedServiceProjectStatusDetailDto{
StatusCode = "TIJIAO"
}
}
};
await djyStatusService.Value.CancelServiceStatus(pushModel);
}
if (useTransaction)

Loading…
Cancel
Save