From 44dca913bda584ed9cbb5349bf56d8efbf4c62c5 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Thu, 25 May 2023 09:55:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9TSL=E7=9A=84EDI=20?= =?UTF-8?q?=E5=8F=91=E9=80=81=EF=BC=8C=E8=B0=83=E5=8F=96=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=8E=A8=E9=80=81EDI=E6=8A=A5=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 201 +++++++++++++++--- .../BookingOrder/BookingValueAddedService.cs | 48 ++++- .../Service/BookingOrder/Dto/SingleBCDto.cs | 2 +- .../BookingOrder/IBookingOrderService.cs | 7 + 4 files changed, 223 insertions(+), 35 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index e587ea3b..a9838fa0 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -76,6 +76,7 @@ using Myshipping.Application.Service.DataSync.Dto; using RabbitMQ.Client; using System.Configuration; using System.Collections; +using System.Security.Principal; namespace Myshipping.Application { @@ -118,12 +119,16 @@ namespace Myshipping.Application private readonly SqlSugarRepository _bookingTemplate; private readonly SqlSugarRepository _paraGoodsInfoRepository; private readonly SqlSugarRepository _paraContractNoInfoRepository; + private readonly SqlSugarRepository _djyWebsiteAccountConfigRepository; private readonly IHttpContextAccessor _httpContextAccessor; private readonly IBookingGoodsStatusConfigService _GoodsConfig; const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING"; const string CONST_MAPPING_MODULE_ROUTE = "BOOK_OR_CLOSING_RT"; private const string PrintRecentListTypeKey = "booking_print_recent_list"; + const string CONST_TSL_EDI_URL = "tsl_edi_declare_url"; + const string CONST_TSL_TYPE_CODE = "TslWeb"; + public BookingOrderService(SqlSugarRepository rep, SqlSugarRepository repCtn, SqlSugarRepository ctndetailrep, SqlSugarRepository bookinglog, SqlSugarRepository bookinglogdetail, SqlSugarRepository bookingremark, SqlSugarRepository bookingfile, SqlSugarRepository repUserConfig, SqlSugarRepository repPrint, @@ -133,7 +138,7 @@ namespace Myshipping.Application SqlSugarRepository repOrderUrl, SqlSugarRepository repOrderContact, SqlSugarRepository repSampleBill, SqlSugarRepository djycustomer, SqlSugarRepository excelrep, SqlSugarRepository repUserMail, SqlSugarRepository goodsStatus, SqlSugarRepository goodsStatusConfig, SqlSugarRepository repTenant, SqlSugarRepository repBookingStatus, SqlSugarRepository bookingEDIExt, SqlSugarRepository serviceItem, - SqlSugarRepository paraContractNoInfoRepository, IHttpContextAccessor httpContextAccessor, IBookingGoodsStatusConfigService GoodsConfig) + SqlSugarRepository paraContractNoInfoRepository, IHttpContextAccessor httpContextAccessor, IBookingGoodsStatusConfigService GoodsConfig, SqlSugarRepository djyWebsiteAccountConfigRepository) { this._logger = logger; this._rep = rep; @@ -170,6 +175,8 @@ namespace Myshipping.Application this._paraContractNoInfoRepository = paraContractNoInfoRepository; _httpContextAccessor = httpContextAccessor; _GoodsConfig = GoodsConfig; + + _djyWebsiteAccountConfigRepository = djyWebsiteAccountConfigRepository; } #region 主表和箱信息 @@ -3940,6 +3947,31 @@ namespace Myshipping.Application if (ediSOSICfg == null || string.IsNullOrWhiteSpace(ediSOSICfg.MapCode)) throw Oops.Bah($"CARRIERID={order.CARRIERID} 发送SO(SI)的船公司EDI代码未找到"); + string postSpiderUrl = string.Empty; + DjyWebsiteAccountConfig userWebAccountConfig = null; + + if (ediRouteEnum == EDIRouteEnum.TSL && model.send) + { + if(model.sendType.Equals("E",StringComparison.OrdinalIgnoreCase)) + throw Oops.Oh($"暂未提供TSL的截单发送"); + + postSpiderUrl = _cache.GetAllDictData().GetAwaiter().GetResult() + .FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == CONST_TSL_EDI_URL)?.Value; + + if (string.IsNullOrWhiteSpace(postSpiderUrl)) + throw Oops.Bah($"字典未配置 url_set->{CONST_TSL_EDI_URL} 请联系管理员"); + + //获取个人对应的账户,这里GetAccountConfig逻辑优先取个人,个人没有配置取公司对应配置 + userWebAccountConfig = GetAccountConfig(CONST_TSL_TYPE_CODE, UserManager.UserId, UserManager.TENANT_ID).GetAwaiter() + .GetResult(); + + _logger.LogInformation("批次={no} 获取获取网站的账户完成,result={Num}", batchNo, JSON.Serialize(userWebAccountConfig)); + + if (userWebAccountConfig == null) + throw Oops.Oh($" 未配置个人或公司网站账户,网站{CONST_TSL_TYPE_CODE}"); + } + + var ediModel = new EDIBaseModel(); //2023-03-06 修改读取EDI配置方法,所有提取配置必须是已启用的EnableFlag=true,并且要根据SendType匹配发送类型,SendType=""表示使用订舱和截单,SO-订舱 SI-截单 @@ -4530,6 +4562,10 @@ namespace Myshipping.Application if (model.send) { + /* + 2023-05-24 这里新增TSL的判断,如果是走TSL则默认走吴广的外挂,需要提供个人账户 + */ + string currFilePath = string.Empty; if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) @@ -4557,40 +4593,48 @@ namespace Myshipping.Application DateTime bDate = DateTime.Now; - //上传FTP - CommonWebApiResult sendStatus = null; - //是否发送邮件,EDI这里主要分2种通道发送 默认是FTP,如果配置里指定了接收接收邮箱,就需要推送邮件 bool isSendEmail = false; - //是订舱并且FTP配置了订舱接收邮箱则触发邮箱发送 - if (ftpSet.SendType.Equals("SO", StringComparison.OrdinalIgnoreCase) - && model.sendType.Equals("B", StringComparison.OrdinalIgnoreCase) - && !string.IsNullOrWhiteSpace(ftpSet.RECEIVEEMAIL)) - { - isSendEmail = true; - } - else if (ftpSet.SendType.Equals("SI", StringComparison.OrdinalIgnoreCase) - && model.sendType.Equals("E", StringComparison.OrdinalIgnoreCase) - && !string.IsNullOrWhiteSpace(ftpSet.RECEIVEEMAIL)) - { - isSendEmail = true; - } - else if (string.IsNullOrWhiteSpace(ftpSet.SendType) - && !string.IsNullOrWhiteSpace(ftpSet.RECEIVEEMAIL)) - { - isSendEmail = true; - } + //上传FTP + CommonWebApiResult sendStatus = null; - if (isSendEmail) + //TSL单独走接口 + if (ediRouteEnum == EDIRouteEnum.TSL) { - //推送订舱邮件 - sendStatus = await InnerSendBookingOrClosingEDIToEmail(order, result.extra.ToString(), - model.sendType, result.extra2.ToString(), ftpSet); + sendStatus = await InnerSendBookingOrClosingEDIToPOST(result.extra.ToString(), postSpiderUrl, userWebAccountConfig); } else { - sendStatus = await InnerSendBookingOrClosingEDIToFTP(result.extra.ToString(), ftpSet); + //是订舱并且FTP配置了订舱接收邮箱则触发邮箱发送 + if (ftpSet.SendType.Equals("SO", StringComparison.OrdinalIgnoreCase) + && model.sendType.Equals("B", StringComparison.OrdinalIgnoreCase) + && !string.IsNullOrWhiteSpace(ftpSet.RECEIVEEMAIL)) + { + isSendEmail = true; + } + else if (ftpSet.SendType.Equals("SI", StringComparison.OrdinalIgnoreCase) + && model.sendType.Equals("E", StringComparison.OrdinalIgnoreCase) + && !string.IsNullOrWhiteSpace(ftpSet.RECEIVEEMAIL)) + { + isSendEmail = true; + } + else if (string.IsNullOrWhiteSpace(ftpSet.SendType) + && !string.IsNullOrWhiteSpace(ftpSet.RECEIVEEMAIL)) + { + isSendEmail = true; + } + + if (isSendEmail) + { + //推送订舱邮件 + sendStatus = await InnerSendBookingOrClosingEDIToEmail(order, result.extra.ToString(), + model.sendType, result.extra2.ToString(), ftpSet); + } + else + { + sendStatus = await InnerSendBookingOrClosingEDIToFTP(result.extra.ToString(), ftpSet); + } } DateTime eDate = DateTime.Now; @@ -4609,12 +4653,23 @@ namespace Myshipping.Application CreatedUserName = UserManager.Name }); + string sendTypeName = "FTP"; + + if (isSendEmail) + { + sendTypeName = "邮件"; + } + else if(ediRouteEnum == EDIRouteEnum.TSL) + { + sendTypeName = "POST"; + } + await _bookinglogdetail.InsertReturnSnowflakeIdAsync(new BookingLogDetail { PId = logId, Field = String.Empty, OldValue = String.Empty, - NewValue = $"发送 {order.CARRIERID} EDI 类型={model.sendType} 通过{(isSendEmail ? "邮件" : "FTP")} {(sendStatus.succ ? "成功" : "失败")}", + NewValue = $"发送 {order.CARRIERID} EDI 类型={model.sendType} 通过{sendTypeName} {(sendStatus.succ ? "成功" : "失败")}", }); if (!sendStatus.succ) @@ -4648,6 +4703,28 @@ namespace Myshipping.Application } #endregion + /// + /// 获取个人或公司网站账户配置 + /// + /// 账户类型代码 + /// 用户ID + /// 租户ID + /// 返回账户配置 + private async Task GetAccountConfig(string typeCode, long userId, long tendId) + { + DjyWebsiteAccountConfig accountConfig = new DjyWebsiteAccountConfig(); + accountConfig = await _djyWebsiteAccountConfigRepository.EntityContext.CopyNew().Queryable() + .FirstAsync(x => x.TypeCode == typeCode && x.CreatedUserId == userId); + + if (accountConfig == null) + { + accountConfig = await _djyWebsiteAccountConfigRepository.EntityContext.CopyNew().Queryable() + .FirstAsync(x => x.TypeCode == typeCode && x.TenantId == tendId && x.IsTenant == true); + } + + return accountConfig; + } + #region 下载订舱、截单EDI /// /// 下载订舱、截单EDI @@ -4774,6 +4851,74 @@ namespace Myshipping.Application } #endregion + /// + /// EDI发送POST请求 + /// + /// 文件路径 + /// 请求URL + /// 配置账户 + /// 返回回执 + private async Task InnerSendBookingOrClosingEDIToPOST(string filePath, string url, DjyWebsiteAccountConfig accountConfig) + { + CommonWebApiResult result = new CommonWebApiResult { succ = true }; + + CancellationTokenSource cts = new CancellationTokenSource(); + + NameValueCollection par = new NameValueCollection(); + par.Add("user_key", App.Configuration["BCOrDraftUserKey"]); + par.Add("user_secret", App.Configuration["BCOrDraftUserSecret"]); + par.Add("web_user", accountConfig.Account?.Trim()); + par.Add("web_psw", accountConfig.Password?.Trim()); + + _logger.LogInformation($"准备请求发送POST:{url} ,参数:{JSON.Serialize(par)},文件:{filePath}"); + + System.IO.FileStream file = new System.IO.FileStream(filePath, FileMode.Open, FileAccess.Read); + int SplitSize = 5242880;//5M分片长度 + int index = 1; //序号 第几片 + long StartPosition = 5242880 * (index - 1); + long lastLens = file.Length - StartPosition;//真不知道怎么起命了,就这样吧 + if (lastLens < 5242880) + { + SplitSize = (int)lastLens; + } + byte[] heByte = new byte[SplitSize]; + file.Seek(StartPosition, SeekOrigin.Begin); + //第一个参数是 起始位置 + file.Read(heByte, 0, SplitSize); + //第三个参数是 读取长度(剩余长度) + file.Close(); + + string strJoin = System.IO.File.ReadAllText(filePath); + + DateTime bDate = DateTime.Now; + + _logger.LogInformation("POST 开始上传"); + + var res = FTPHelper.TransmitFtpFile(url, par, new + { + file = "file", + fileName = Path.GetFileName(filePath), + fileBytes = heByte + }); + + DateTime eDate = DateTime.Now; + TimeSpan ts = eDate.Subtract(bDate); + var timeDiff = ts.TotalMilliseconds; + + _logger.LogInformation($"请求POST 上传完成 上传文件大小:{heByte.Length} 用时:{timeDiff}ms.,{strJoin}"); + + _logger.LogInformation($"发送POST返回:{res}"); + + var jobjRetn = JObject.Parse(res); + + if (jobjRetn.GetStringValue("code") != "200") + { + result.succ = false; + result.msg = jobjRetn.GetStringValue("msg"); + } + return result; + } + #region 上传邮件 /// /// 上传邮件 diff --git a/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs b/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs index 28dd6339..80caa569 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs @@ -6,6 +6,7 @@ using Furion.Extensions; using Furion.FriendlyException; using Furion.JsonSerialization; using Furion.RemoteRequest.Extensions; +using Mapster; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -47,7 +48,7 @@ namespace Myshipping.Application public class BookingValueAddedService : IBookingValueAddedService, IDynamicApiController, ITransient { private readonly ISysCacheService _cache; - //private readonly IDjyWebsiteAccountConfigService _webAccountConfig; + private readonly IBookingOrderService _bookingOrderService; private readonly ILogger _logger; private readonly SqlSugarRepository _bookingOrderRepository; private readonly SqlSugarRepository _bookingfile; @@ -71,7 +72,7 @@ namespace Myshipping.Application public BookingValueAddedService(ISysCacheService cache, ILogger logger, SqlSugarRepository bookingOrderRepository, SqlSugarRepository bookingfile, SqlSugarRepository djyWebsiteAccountConfigRepository, SqlSugarRepository sysUserRepository, - SqlSugarRepository bookingLetteryardRepository) + SqlSugarRepository bookingLetteryardRepository, IBookingOrderService bookingOrderService) { _cache = cache; _logger = logger; @@ -82,6 +83,7 @@ namespace Myshipping.Application _djyWebsiteAccountConfigRepository = djyWebsiteAccountConfigRepository; _sysUserRepository = sysUserRepository; _bookingLetteryardRepository = bookingLetteryardRepository; + _bookingOrderService = bookingOrderService; } @@ -1205,7 +1207,7 @@ namespace Myshipping.Application /// 订舱主键 /// 返回回执 [HttpPost("/BookingValueAdded/SingleBCFileRead")] - public async Task SingleBCFileRead(IFormFile file, long bookingOrderId) + public async Task SingleBCFileRead(IFormFile file, [FromForm] long bookingOrderId) { TaskManageOrderResultDto result = new TaskManageOrderResultDto(); @@ -1336,8 +1338,6 @@ namespace Myshipping.Application jsonOptions.Converters.Add(new IntegerJsonConverter()); jsonOptions.Converters.Add(new DecimalJsonConverter()); - - model = JSON.Deserialize(result, jsonOptions); } } @@ -1356,9 +1356,45 @@ namespace Myshipping.Application /// /// 单票BC详情 /// 返回回执 + [HttpPost("/BookingValueAdded/SingleBCUpdateBookingOrder")] public async Task SingleBCUpdateBookingOrder(SingleBCDto model) { - return new TaskManageOrderResultDto(); + TaskManageOrderResultDto result = new TaskManageOrderResultDto(); + + string batchNo = IDGen.NextID().ToString(); + + try + { + /* + 1、根据BC的数据更新订舱相关信息(提单号、截港时间、截单时间、船名航次、开船日期) + 2、如果选择了转为入货通知,则先保存入货通知。 + 3、调取入货通知的发送。 + */ + if (model.IsLetterYard) + { + _logger.LogInformation("批次={no} 单票BC更新订舱后,用户选择了,转为入货通知,开始发送入货通知", batchNo); + + var letterYardDto = new UpdateBookingLetteryardInput(); + + letterYardDto = model.LetteryardDto.Adapt(); + + if(model.LetterYardId.HasValue) + { + letterYardDto.Id = model.LetterYardId.Value; + } + + //放舱保存 + var letterYardId = await _bookingOrderService.LetteryardSave(letterYardDto); + + // + } + } + catch (Exception ex) + { + + } + + return result; } } diff --git a/Myshipping.Application/Service/BookingOrder/Dto/SingleBCDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/SingleBCDto.cs index ccfa05ac..cef77cf8 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/SingleBCDto.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/SingleBCDto.cs @@ -20,7 +20,7 @@ namespace Myshipping.Application /// /// 放舱主键(入货通知保存后的主键) /// - public string LetterYardId { get; set; } + public Nullable LetterYardId { get; set; } /// /// 截关时间 diff --git a/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs index b297fd38..fb50fb3b 100644 --- a/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs @@ -47,5 +47,12 @@ namespace Myshipping.Application Task InnerBookingOrClosingEDI(BookingOrClosingEDIOrderDto model); Task SendBookingOrder(long[] ids); + + /// + /// 保存(新增或修改)放舱 + /// + /// 放舱详情 + /// 返回放舱主键 + Task LetteryardSave(UpdateBookingLetteryardInput input); } } \ No newline at end of file From 214ab143ded609598e14dc37819bd66dcd2ab649 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 26 May 2023 08:55:05 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9EDI=E7=9A=84=E7=AD=BE?= =?UTF-8?q?=E5=8D=95=E6=96=B9=E5=BC=8F=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index be34e181..7795a2dd 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -4312,23 +4312,23 @@ namespace Myshipping.Application } } - //运输条款EDI - var baseServiceList = _cache.GetAllCodeService().GetAwaiter().GetResult(); + if (!string.IsNullOrWhiteSpace(order.SERVICE)) + { + //运输条款EDI + var baseServiceList = _cache.GetAllCodeService().GetAwaiter().GetResult(); - var baseServiceInfo = baseServiceList.FirstOrDefault(t => - t.Name.Equals(order.SERVICE, StringComparison.OrdinalIgnoreCase)); + var baseServiceInfo = baseServiceList.FirstOrDefault(t => + t.Name.Equals(order.SERVICE, StringComparison.OrdinalIgnoreCase)); - if (baseServiceInfo == null) - throw Oops.Bah($"运输条款{order.SERVICE}的基础代码未找到"); + if (baseServiceInfo == null) + throw Oops.Bah($"运输条款{order.SERVICE}的基础代码未找到"); - //运输条款映射 - var ediServiceList = _cache.GetAllMappingService().GetAwaiter().GetResult() - .Where(t => t.Module.Equals(CONST_MAPPING_MODULE, StringComparison.OrdinalIgnoreCase) - && !string.IsNullOrWhiteSpace(t.CarrierCode) && t.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase) - ).ToList(); + //运输条款映射 + var ediServiceList = _cache.GetAllMappingService().GetAwaiter().GetResult() + .Where(t => t.Module.Equals(CONST_MAPPING_MODULE, StringComparison.OrdinalIgnoreCase) + && !string.IsNullOrWhiteSpace(t.CarrierCode) && t.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase) + ).ToList(); - if (!string.IsNullOrWhiteSpace(order.SERVICE)) - { var currServiceInfo = ediServiceList.FirstOrDefault(t => t.Code.Equals(baseServiceInfo.Code, StringComparison.OrdinalIgnoreCase)); if (currServiceInfo == null) @@ -4337,22 +4337,23 @@ namespace Myshipping.Application primaryModel.SERVICEEDICODE = currServiceInfo.MapCode?.Trim(); } - //签单方式EDI - var baseIssueTypeList = _cache.GetAllCodeIssueType().GetAwaiter().GetResult(); - var baseIssueTypeInfo = baseIssueTypeList.FirstOrDefault(t => - t.EnName.Equals(order.ISSUETYPE, StringComparison.OrdinalIgnoreCase)); + if (!string.IsNullOrWhiteSpace(order.ISSUETYPE)) + { + //签单方式EDI + var baseIssueTypeList = _cache.GetAllCodeIssueType().GetAwaiter().GetResult(); - if (baseIssueTypeInfo == null) - throw Oops.Bah($"签单方式{order.ISSUETYPE}的基础代码未找到"); + var baseIssueTypeInfo = baseIssueTypeList.FirstOrDefault(t => + t.EnName.Equals(order.ISSUETYPE, StringComparison.OrdinalIgnoreCase)); - //签单方式映射 - var ediIssueTypeList = _cache.GetAllMappingIssueType().GetAwaiter().GetResult() - .Where(t => t.Module.Equals(CONST_MAPPING_MODULE, StringComparison.OrdinalIgnoreCase) - ).ToList(); + if (baseIssueTypeInfo == null) + throw Oops.Bah($"签单方式{order.ISSUETYPE}的基础代码未找到"); + + //签单方式映射 + var ediIssueTypeList = _cache.GetAllMappingIssueType().GetAwaiter().GetResult() + .Where(t => t.Module.Equals(CONST_MAPPING_MODULE, StringComparison.OrdinalIgnoreCase) + ).ToList(); - if (!string.IsNullOrWhiteSpace(order.ISSUETYPE)) - { var currIssueTypeInfo = ediIssueTypeList.FirstOrDefault(t => !string.IsNullOrWhiteSpace(t.CarrierCode) && t.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase) && t.Code.Equals(baseIssueTypeInfo.Code, StringComparison.OrdinalIgnoreCase)); From 8f8fdd3e9b304b86259c3fe16d390b386a29c369 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 26 May 2023 09:07:40 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9EDI=20PIL=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20=E7=AD=BE=E5=8D=95=E6=96=B9=E5=BC=8F=E4=B8=BAnull?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Application/EDI/PILEdiHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Myshipping.Application/EDI/PILEdiHelper.cs b/Myshipping.Application/EDI/PILEdiHelper.cs index 178c0ff9..429bab83 100644 --- a/Myshipping.Application/EDI/PILEdiHelper.cs +++ b/Myshipping.Application/EDI/PILEdiHelper.cs @@ -1807,7 +1807,7 @@ namespace Myshipping.Application.EDI.PIL } tempstr += GetSpaceStr("", 4);//5//Department Code//M//X(4)//19//22//webCSM Department Code (eg SG00) (out from webCSM only)//部门代码//webcsm部门代码(如sg00)(从webcsm只) tempstr += GetSpaceStr("", 3);//6//Booking Agent Code//M//X(3)//23//25//webCSM Booking Agent Code (eg SIN)//订舱代理代码//webcsm订舱代理代码(如犯罪) - if (bill.ISSUETYPE.ToString().Trim().ToUpper() == "WAYBILL" || bill.ISSUETYPE.ToString().Trim().ToUpper() == "SEAWAY BILL") + if (bill.ISSUETYPE?.Trim().ToUpper() == "WAYBILL" || bill.ISSUETYPE?.Trim().ToUpper() == "SEAWAY BILL") { tempstr += GetSpaceStr("W", 1);//7//BOL Type//M//X(1)//26//26//N-Nominal, G-Negotiable, S-Switch, W-Waybill, M-Memo//公司类型//n-nominal,g-negotiable,S-开关,w-waybill,m-memo } From 1921c4cba0321d77dddcfa0c14f084a43fcf3530 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 26 May 2023 09:45:01 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BE=E8=BD=A6?= =?UTF-8?q?=E5=9B=9E=E5=86=99=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TaskManagePlat/TaskManageTruckService.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageTruckService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageTruckService.cs index 5ce00d79..afa05534 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageTruckService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageTruckService.cs @@ -943,6 +943,11 @@ namespace Myshipping.Application var service = _namedServiceProvider.GetService(nameof(BookingTruckService)); var rlt = await service.TruckDispatchCompleteCallBack(model); + if(!rlt.succ) + { + throw Oops.Oh(rlt.msg); + } + result.succ = true; result.msg = "派车成功"; result.ext = rlt;