diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportRefundService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportRefundService.cs
index 77066561..f0131b78 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportRefundService.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportRefundService.cs
@@ -1,4 +1,5 @@
using DS.Module.Core;
+using DS.Module.Core.Data;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Op.Dtos;
using System;
@@ -53,5 +54,14 @@ namespace DS.WMS.Core.Op.Interface
///
///
public Task CreateChangeTaskAsync(ChangeTaskReq req);
+
+
+ ///
+ /// 退舱入池
+ ///
+ ///
+ ///
+
+ public Task RefundPoolAsync(IdModel req);
}
}
diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportRefundService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportRefundService.cs
index 84e1bdce..b5a46698 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportRefundService.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportRefundService.cs
@@ -49,6 +49,8 @@ namespace DS.WMS.Core.Op.Method
private readonly ICommonService commonService;
readonly ITaskService taskService;
private readonly ISeaExportCommonService seaComService;
+ private readonly IBookingSlotService bookSlotService;
+
///
///
///
@@ -62,6 +64,7 @@ namespace DS.WMS.Core.Op.Method
saasService = _serviceProvider.GetRequiredService();
seaComService = _serviceProvider.GetRequiredService();
taskService = serviceProvider.GetRequiredService();
+ bookSlotService = serviceProvider.GetRequiredService();
}
@@ -556,5 +559,55 @@ namespace DS.WMS.Core.Op.Method
//return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
+
+
+ ///
+ /// 退舱入池
+ ///
+ ///
+ ///
+
+ public async Task RefundPoolAsync(IdModel req)
+ {
+ var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
+ var info = await tenantDb.Queryable().Where(x => x.Id == long.Parse(req.Id)).FirstAsync();
+ if (info.IsNull())
+ return await Task.FromResult(DataResult.Failed("不存在的海运出口信息!", MultiLanguageConst.SeaExportExist));
+ if (info.IsRefund == false)
+ {
+ return await Task.FromResult(DataResult.Failed("订单状态必须为退舱标识!"));
+ }
+ var task = await tenantDb.Queryable().Where(x => x.BusinessId == long.Parse(req.Id) && x.TaskType == TaskBaseTypeEnum.RETURN_CABIN_POOL).FirstAsync();
+
+ if (task.IsNotNull() && task.TaskStatus == TaskStatusEnum.Complete)
+ {
+ return await Task.FromResult(DataResult.Failed("退舱入池任务已完成!"));
+ }
+
+ var ctnList = await tenantDb.Queryable().Where(x => x.BSNO == req.Id).ToListAsync();
+ if (ctnList.Count == 0)
+ return await Task.FromResult(DataResult.Failed("集装箱列表不能为空!"));
+
+
+ var ctns = ctnList.Adapt>();
+
+
+ //调用退舱入池接口
+ var postData = new BookingSlotBaseApiDto()
+ {
+ OpType = "del",
+ DataObj = new BookingSlotBaseApiSaveDto()
+ {
+ CtnList = ctns,
+ }
+ };
+ var res = await bookSlotService.InnerApiReceive(postData);
+
+ if (!res.Succeeded)
+ return await Task.FromResult(DataResult.Failed(res.Message));
+
+ return DataResult.Success;
+
+ }
}
}
diff --git a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportRefundController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportRefundController.cs
index dbbf73a1..0b382965 100644
--- a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportRefundController.cs
+++ b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportRefundController.cs
@@ -1,4 +1,5 @@
using DS.Module.Core;
+using DS.Module.Core.Data;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Interface;
@@ -97,6 +98,16 @@ namespace DS.WMS.OpApi.Controllers
{
return await _invokeService.CreateChangeTaskAsync(req);
}
-
+ ///
+ /// 退舱入池
+ ///
+ ///
+ ///
+ [HttpPost]
+ [Route("RefundPool")]
+ public async Task RefundPool([FromBody] IdModel req)
+ {
+ return await _invokeService.RefundPoolAsync(req);
+ }
}
}
\ No newline at end of file