From 25d59e3f1e59c984ccb8c5bd61735962e450720c Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 15 Apr 2024 09:21:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A9=AC=E5=A3=AB=E5=9F=BAAP?= =?UTF-8?q?I=E7=9A=84=E6=89=B9=E9=87=8F=E5=A4=8D=E5=88=B6=E5=92=8C?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=8F=91=E9=80=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingMSKAPIService.cs | 23 +++---------- .../Dto/MSKAPI/MSKAPIBookingCopyDto.cs | 34 +++++++++++++++++++ Myshipping.Core/Myshipping.Core.xml | 20 +++++++++++ ServiceProjectSyncWin/Program.cs | 1 + 4 files changed, 60 insertions(+), 18 deletions(-) create mode 100644 Myshipping.Application/Service/BookingOrder/Dto/MSKAPI/MSKAPIBookingCopyDto.cs diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs index ea54b650..836f98f7 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs @@ -478,22 +478,8 @@ namespace Myshipping.Application.Service.BookingOrder var jsonBody = Newtonsoft.Json.JsonConvert.SerializeObject(bookingDto); -#if DEBUG - //测试用造假数据 - var rlt = JSON.Serialize(new MSKAPIBookingResultDto - { - code = 200, - data = new MSKAPIBookingResultDataDto - { - bookingReference = DateTime.Now.ToString("yyyyMMddHHmmssfffff"), - requestAcknowledgementId = Guid.NewGuid().ToString(), - } - }); -#else -var rlt = await sendUrl.SetBody(jsonBody) + var rlt = await sendUrl.SetBody(jsonBody) .PostAsStringAsync(); -#endif - _logger.LogInformation($"开始请求MSK API订舱,返回结果 JSON={JSON.Serialize(rlt)}"); @@ -1396,13 +1382,14 @@ var rlt = await sendUrl.SetBody(jsonBody) var model = GetInfo(entity.Id).GetAwaiter().GetResult(); result = InnerSendMSKBooking(model, entity.Id, false).GetAwaiter().GetResult(); + + if (result.succ) + return string.Empty; } catch (Exception ex) { msgList.Add(ex.Message); } - - return string.Empty; } return string.Join("#", msgList.ToArray()); @@ -1477,7 +1464,7 @@ var rlt = await sendUrl.SetBody(jsonBody) }); } - entity = model.Adapt(); + entity = model.bookingDto.Adapt(); entity.CreatedTime = nowDate; entity.UpdatedTime = nowDate; diff --git a/Myshipping.Application/Service/BookingOrder/Dto/MSKAPI/MSKAPIBookingCopyDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/MSKAPI/MSKAPIBookingCopyDto.cs new file mode 100644 index 00000000..9206d2b8 --- /dev/null +++ b/Myshipping.Application/Service/BookingOrder/Dto/MSKAPI/MSKAPIBookingCopyDto.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + /// + /// 马士基API批量复制 + /// + public class MSKAPIBookingCopyDto + { + /// + /// 被复制马士基API订舱主键 + /// + public long originalId { get; set; } + + /// + /// 操作类型 only_copy-只单票复制;copy_edit-复制使用提交的编辑信息 + /// + public string opType { get; set; } + + /// + /// 编辑详情(弹出编辑框后修改的详情内容) + /// + public MSKBookingDto bookingDto { get; set; } + + /// + /// 复制数量 + /// + public int copyNum { get; set; } = 1; + } +} diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 820e1fbb..f0beaa77 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -2039,6 +2039,16 @@ 等级 + + + 客户端系统ID + + + + + 大简云GID + + 客户地址 @@ -2124,6 +2134,16 @@ 备注 + + + 客户端系统ID + + + + + 大简云GID + + 钉钉客服通知群配置 diff --git a/ServiceProjectSyncWin/Program.cs b/ServiceProjectSyncWin/Program.cs index e9fbe3c6..24190456 100644 --- a/ServiceProjectSyncWin/Program.cs +++ b/ServiceProjectSyncWin/Program.cs @@ -423,6 +423,7 @@ public class SyncHisRecord: ISyncHisRecord,ITransient } + }