From 525c238103c81ed5fceeff81ffc2f4c08ff882a9 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Thu, 18 Jul 2024 16:53:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=88=B1=E4=BD=8D=E7=AE=A1=E7=90=86controller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingSlotServiceController.cs | 370 ++++++++++++++++++ .../PublishProfiles/FolderProfile.pubxml.user | 2 +- 2 files changed, 371 insertions(+), 1 deletion(-) create mode 100644 ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs diff --git a/ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs new file mode 100644 index 00000000..c9ec4d6a --- /dev/null +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs @@ -0,0 +1,370 @@ +using Azure.Storage.Blobs.Models; +using DS.Module.Core; +using DS.Module.Core.Data; +using DS.Module.DjyServiceStatus; +using DS.WMS.Core.Op.Dtos; +using DS.WMS.Core.Op.Interface; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Owin.Security.Provider; +using Org.BouncyCastle.Crypto; +using SqlSugar; + +namespace DS.WMS.OpApi.Controllers +{ + /// + /// 舱位管理 + /// + public class BookingSlotServiceController : ApiController + { + private readonly IBookingSlotService _bookingSlotService; + + public BookingSlotServiceController(IBookingSlotService bookingSlotService) + { + _bookingSlotService = bookingSlotService; + } + + #region 舱位接收保存、取消接口 + /// + /// 舱位接收保存、取消接口 + /// + /// 请求详情(JSON) + /// BC附件 + /// BC修改附件 + /// + [HttpPost] + [Route("ApiReceive")] + public async Task> ApiReceive(string jsonData, IFormFile file = null, IFormFile modifyFile = null) + { + return await _bookingSlotService.ApiReceive(jsonData, file, modifyFile); + } + #endregion + + #region 获取舱位详情 + /// + /// 获取舱位详情 + /// + /// 舱位ID + /// 返回详情 + [HttpGet] + [Route("Detail")] + public async Task> Detail(long id) + { + return await _bookingSlotService.Detail(id); + } + #endregion + + #region 查询可用的舱位及箱子列表 + /// + /// 查询可用的舱位及箱子列表 + /// + /// 筛选条件1:舱位信息、箱型 + /// 筛选条件2:舱位主键列表 + /// 筛选条件3:分页 + /// 可用的舱位列表(含可用的箱子列表) + [HttpPost] + [Route("GetAvailableSlots")] + public async Task>> GetAvailableSlots(BookingSlotBaseDto slotInput = null, + List slotIdListInput = null, + PageWithTotal pageInfo = null) + { + return await _bookingSlotService.GetAvailableSlots(slotInput, slotIdListInput, pageInfo); + } + #endregion + + #region 检查指定订舱记录,是否可以引入舱位列表 + /// + /// 检查指定订舱记录,是否可以引入舱位列表 + /// + /// 待引入的舱位列表 + /// 待关联的订舱记录 + /// (指定订舱记录是否已经引入过舱位数据,现有舱位及箱子是否满足需求,提示信息) + [HttpPost] + [Route("CheckImportSlots")] + public async Task<(bool isExists, bool isEnough, string message)> CheckImportSlots(List slots, long bookingOrderId) + { + return await _bookingSlotService.CheckImportSlots(slots, bookingOrderId); + } + #endregion + + #region 为指定订舱记录引入舱位信息 + /// + /// 为指定订舱记录引入舱位信息 + /// + /// 待引入的舱位列表 + /// 待关联的订舱记录 + /// 是否进行剩余量检查 + /// 额外的用于生成管理记录的信息 + /// (是否成功,提示消息) + [HttpPost] + [Route("ImportSlots")] + public async Task<(bool isSuccess, string message)> ImportSlots(List slots, long bookingOrderId, bool isCheck, BookingGenerateDto generateModel = null) + { + return await _bookingSlotService.ImportSlots(slots, bookingOrderId, isCheck, generateModel); + } + #endregion + + #region 舱位库存台账 + /// + /// 舱位库存台账 + /// + /// 请求参数 + /// 返回列表 + [HttpPost] + [Route("PageStock")] + public async Task PageStock([FromBody] BookingSlotStockPageInput input) + { + return await _bookingSlotService.PageStock(input); + } + #endregion + + #region 舱位库存刷新 + /// + /// 舱位库存刷新 + /// + /// 请求参数 + /// 返回列表 + [HttpPost] + [Route("RefreshStock")] + public async Task RefreshStock([FromBody] BookingSlotStockUpdateModel input) + { + await _bookingSlotService.RefreshStock(input); + } + #endregion + + #region 保存舱位 + /// + /// 保存舱位 + /// + /// 舱位详情 + /// 返回输出 + [HttpPost] + [Route("Save")] + public async Task> Save([FromBody] BookingSlotBaseSaveInput input) + { + return await _bookingSlotService.Save(input); + } + #endregion + + #region 获取附件 + /// + /// 获取附件 + /// + /// 舱位主键 + /// 返回附件列表 + [HttpGet] + [Route("GetFile")] + public async Task>> GetFile(long id) + { + return await _bookingSlotService.GetFile(id); + } + #endregion + + #region 分页查询订舱舱位 + /// + /// 分页查询订舱舱位 + /// + /// + /// + [HttpPost] + [Route("Page")] + public async Task Page([FromBody] BookingSlotBasePageInput input) + { + return await _bookingSlotService.Page(input); + } + #endregion + + #region 舱位接收保存、取消接口 + /// + /// 舱位接收保存、取消接口 + /// + /// + /// + /// + /// + [HttpPost] + [Route("InnerApiReceive")] + public async Task InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null) + { + return await _bookingSlotService.InnerApiReceive(dto, file, modifyFile); + + } + #endregion + + #region 获取舱位变更比对结果 + /// + /// 获取舱位变更比对结果 + /// + /// 舱位主键 + /// 批次号 + /// 返回舱位变更比对结果 + [HttpGet] + [Route("GetSlotCompareResult")] + public async Task> GetSlotCompareResult(long id, string batchNo) + { + return await _bookingSlotService.GetSlotCompareResult(id, batchNo); + } + #endregion + + #region 导入舱位 + /// + /// 导入舱位 + /// + /// 导入舱位文件 + /// 返回回执 + [HttpPost] + [Route("ImportSlotFromFile")] + public async Task ImportSlotFromFile(IFormFile file) + { + return await _bookingSlotService.ImportSlotFromFile(file); + } + #endregion + + #region 生成订舱订单 + /// + /// 生成订舱订单 + /// + /// 生成订舱订单请求 + /// 返回回执 + [HttpPost] + [Route("ImportSlotFromFile")] + public async Task CreateBookingOrder([FromBody] BookingGenerateDto model) + { + return await _bookingSlotService.CreateBookingOrder(model); + } + #endregion + + #region 检索舱位对应的订舱订单(BY 舱位主键) + /// + /// 检索舱位对应的订舱订单(BY 舱位主键) + /// + /// + /// 返回回执 + [HttpGet] + [Route("SearchBookingSlotWithOrderById")] + public async Task SearchBookingSlotWithOrderById(long id) + { + return await _bookingSlotService.SearchBookingSlotWithOrderById(id); + } + #endregion + + #region 检索舱位对应的订舱订单(BY 订舱编号) + /// + /// 检索舱位对应的订舱订单(BY 订舱编号) + /// + /// 订舱编号 + /// 租户ID + /// 返回回执 + [HttpGet] + [Route("SearchBookingSlotWithOrderByNo")] + public async Task SearchBookingSlotWithOrderByNo(string slotBookingNo, long tenantId) + { + return await _bookingSlotService.SearchBookingSlotWithOrderByNo(slotBookingNo, tenantId); + } + #endregion + + #region 请求BC比对 + /// + /// 请求BC比对 + /// + /// BC详情 + /// BC变更后详情 + /// 返回回执 + [HttpPost] + [Route("ExcuteCompare")] + public async Task ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto) + { + return await _bookingSlotService.ExcuteCompare(bcSrcDto, bcTargetDto); + } + #endregion + + #region 推送BC变更比对 + /// + /// 推送BC变更比对 + /// + /// 原舱位详情 + /// 变更后舱位详情 + /// 舱位主键 + /// 请求批次号用来区分对应的哪个批次任务 + /// + [HttpPost] + [Route("PushCompareBCInfo")] + public async Task PushCompareBCInfo(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto, long slotId, string reqBatchNo) + { + await _bookingSlotService.PushCompareBCInfo(bcSrcDto, bcTargetDto, slotId, reqBatchNo); + } + #endregion + + #region 估算差异重要提醒 + /// + /// 估算差异重要提醒 + /// + /// 原舱位详情 + /// 新舱位详情 + /// 舱位ID + /// + [HttpPost] + [Route("MeasureDiffCautionTask")] + public async Task MeasureDiffCautionTask(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto, long slotId) + { + await _bookingSlotService.MeasureDiffCautionTask(bcSrcDto, bcTargetDto, slotId); + } + #endregion + + #region 订舱编号检索舱位信息 + /// + /// 订舱编号检索舱位信息 + /// + /// 订舱编号 + /// 船公司ID + /// + [HttpGet] + [Route("QueryBookingSlot")] + public async Task QueryBookingSlot(string slotBookingNo, string CarrierId) + { + return await _bookingSlotService.QueryBookingSlot(slotBookingNo, CarrierId); + } + #endregion + + #region 获取舱位详情列表 + /// + /// 获取舱位详情列表 + /// + /// 舱位ID组 + /// 返回舱位详情 + [HttpPost] + [Route("GetSlotList")] + public async Task> GetSlotList(long[] ids) + { + return await _bookingSlotService.GetSlotList(ids); + } + #endregion + + #region 获取合票详情(生成合票需要先调此方法) + /// + /// 获取合票详情(生成合票需要先调此方法) + /// + /// + /// + [HttpPost] + [Route("GetMergeList")] + public async Task GetMergeList(QueryMergeSlotDto model) + { + return await _bookingSlotService.GetMergeList(model); + } + #endregion + + #region 生成合票订舱订单 + /// + /// 生成合票订舱订单 + /// + /// 生成订舱订单请求 + /// 返回回执 + [HttpPost] + [Route("MergeCreateBookingOrder")] + public async Task MergeCreateBookingOrder(BookingGenerateDto model) + { + return await _bookingSlotService.MergeCreateBookingOrder(model); + } + #endregion + } +} diff --git a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user index 5930d587..7bb8bf55 100644 --- a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -6,7 +6,7 @@ <_PublishTargetUrl>D:\Code\PublishCopy\ds8-opapi - True|2024-07-17T09:44:18.4741963Z||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; + True|2024-07-18T08:18:45.8049777Z||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; \ No newline at end of file