diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs index 871bdcb4..8ba1596a 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs @@ -273,4 +273,11 @@ public interface ISeaExportService /// /// public Task> RefreshYard(long[] Ids); + + /// + /// 提交订单 + /// + /// + /// + public Task CreateOrderAuditTaskAsync(IdModel req); } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs index f7518fb8..95052b6c 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs @@ -1608,43 +1608,48 @@ public partial class SeaExportService : ISeaExportService - ///// - ///// - ///// - ///// - ///// - //public async Task CreateOrderAuditTaskAsync(IdModel req) - //{ - - // var tenantDb = saasService.GetBizDbScopeById(user.TenantId); - // var id = long.Parse(req.Id); - // var info = await tenantDb.Queryable().Where(x => x.Id == id).FirstAsync(); - // if (info.IsNull()) - // return await Task.FromResult(DataResult.Failed("不存在的海运出口信息!", MultiLanguageConst.SeaExportExist)); + /// + /// 提交订单 + /// + /// + /// + public async Task CreateOrderAuditTaskAsync(IdModel req) + { - // if (string.IsNullOrEmpty(info.ServiceItem)) - // return await Task.FromResult(DataResult.Failed("海运出口服务项目不能为空!", MultiLanguageConst.SeaExportServiceItemNotExist)); + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var id = long.Parse(req.Id); + var info = await tenantDb.Queryable().Where(x => x.Id == id).FirstAsync(); + if (info.IsNull()) + return await Task.FromResult(DataResult.Failed("不存在的海运出口信息!", MultiLanguageConst.SeaExportExist)); + if (string.IsNullOrEmpty(info.ServiceItem)) + return await Task.FromResult(DataResult.Failed("海运出口服务项目不能为空!", MultiLanguageConst.SeaExportServiceItemNotExist)); - // var items = info.ServiceItem.Split(','); + var items = info.ServiceItem.Split(','); + //订舱 走审单流程 + if (items.Contains("dingcang")) + { + var taskReq = new TaskCreationRequest() + { + BusinessId = id, + BusinessType = BusinessType.OceanShippingExport, + TaskTypeName = TaskBaseTypeEnum.WAIT_ORDER_AUDIT.ToString(), + }; + var result = await _seaTaskService.CreateTaskAsync(taskReq, false); + if (!result.Succeeded) + return await Task.FromResult(DataResult.Failed(result.Message)); + return result; + } + else //没有订舱服务不调用审单流程生成订舱相关任务,直接根据服务项目生成任务。 + { + var taskReq = new BusinessTask() + { + BusinessId = id, + BusinessType = BusinessType.OceanShippingExport, + }; + await _seaTaskService.CreateSubTaskAsync(taskReq); - // if (items.Contains("dingcang")) - // { - // var taskReq = new TaskCreationRequest() - // { - // BusinessId = id, - // BusinessType = BusinessType.OceanShippingExport, - // TaskTypeName = TaskBaseTypeEnum.WAIT_ORDER_AUDIT.ToString(), - // }; - // var result = await _seaTaskService.CreateTaskAsync(taskReq, false); - // if (!result.Succeeded) - // return await Task.FromResult(DataResult.Failed(result.Message)); - - // return - // } - // else - // { - // return await Task.FromResult(DataResult.Failed("不存在的海运出口信息!")); - // } - //} + return DataResult.Success; + } + } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Sys/Dtos/BankReq.cs b/ds-wms-service/DS.WMS.Core/Sys/Dtos/BankReq.cs index 16b0a05c..54a2bf53 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Dtos/BankReq.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Dtos/BankReq.cs @@ -88,6 +88,11 @@ public class BankReq /// 英文银行地址 /// public string BankEnAddress { get; set; } + + /// + /// 银行国际代码 + /// + public string? SwiftCode { get; set; } } diff --git a/ds-wms-service/DS.WMS.Core/Sys/Dtos/BankRes.cs b/ds-wms-service/DS.WMS.Core/Sys/Dtos/BankRes.cs index 7a15498c..3b25e9bd 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Dtos/BankRes.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Dtos/BankRes.cs @@ -89,4 +89,8 @@ public class BankRes /// 英文银行地址 /// public string BankEnAddress { get; set; } + /// + /// 银行国际代码 + /// + public string? SwiftCode { get; set; } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Sys/Entity/SysBank.cs b/ds-wms-service/DS.WMS.Core/Sys/Entity/SysBank.cs index 46130038..dda2b42e 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Entity/SysBank.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Entity/SysBank.cs @@ -101,5 +101,11 @@ namespace DS.WMS.Core.Sys.Entity /// [SugarColumn(ColumnDescription = "英文银行地址", IsNullable = true, Length = 200)] public string BankEnAddress { get; set; } + + /// + /// 银行国际代码 + /// + [SugarColumn(ColumnDescription = "银行国际代码", Length = 150, IsNullable = true)] + public string? SwiftCode { get; set; } } } diff --git a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs index b417dcd3..41cdcb8c 100644 --- a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs @@ -582,5 +582,16 @@ public class SeaExportController : ApiController { return await _chargeFeeService.ChargeFee(model); } + /// + /// 提交订单 + /// + /// 订舱主键id + [HttpPost] + [Route("SubmitOrderAudit")] + public async Task CreateOrderAuditTaskAsync([FromBody] IdModel req) + { + var res = await _invokeService.CreateOrderAuditTaskAsync(req); + return res; + } } \ No newline at end of file