diff --git a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs index c8ce03e2..3b13c688 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs @@ -1136,11 +1136,11 @@ namespace Myshipping.Application } } - BookingOrderSyncTypeEnum syncTypeEnum = syncType switch + BookingOrderSyncTypeEnum? syncTypeEnum = syncType switch { - "ALL" => BookingOrderSyncTypeEnum.ALL, "BC" => BookingOrderSyncTypeEnum.BC, - _ => BookingOrderSyncTypeEnum.ALL, + //"FILE" => BookingOrderSyncTypeEnum.FILE, + _ => null, }; await bookingOrderService.SendBookingOrder(new long[] { dbOrder.Id }, syncTypeEnum); @@ -1988,7 +1988,7 @@ namespace Myshipping.Application custOrder.ExtendData = jobjBookAcc.ToJsonString(); var ctns = input.CtnList.Adapt>(); - foreach(var ctn in ctns) + foreach (var ctn in ctns) { ctn.CTNALL = ctnList.First(x => x.Code == ctn.CTNCODE).Name; } diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 39bab17c..efe1ae31 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -83,6 +83,7 @@ using Myshipping.Application.EDI.VOLTA; using TinyPinyin; using Furion.EventBus; using Myshipping.Application.Service.BookingSlot.Dto; +using Myshipping.Application.Service.BookingOrder.Dto.MSKAPI; namespace Myshipping.Application { @@ -2182,7 +2183,7 @@ namespace Myshipping.Application // 客户订舱:运营端发送订舱数据给客户端 if (App.Configuration["RunType"] == CommonConst.RUN_TYPE_DJY) { - CustomerBookingSyncHelper.SendCustomerBookingSync(Id, "ALL"); + CustomerBookingSyncHelper.SendCustomerBookingSync(Id, BookingOrderSyncTypeEnum.BC.ToString()); } return ordOut; @@ -5084,8 +5085,10 @@ namespace Myshipping.Application /// /// [HttpPost("/BookingOrder/VgmSend")] - public async Task VgmSend(long bookingId) + public async Task VgmSend(long bookingId) { + object result = null; + var order = _rep.FirstOrDefault(x => x.Id == bookingId); var ctns = _repCtn.Where(x => x.BILLID == bookingId).ToList(); @@ -5101,268 +5104,408 @@ namespace Myshipping.Application throw Oops.Bah(BookingErrorCode.BOOK127); } - var config = _cache.GetAllTenantParam().Result.FirstOrDefault(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == "VgmDirectSendCarrierId"); - if (config == null) - { - throw Oops.Bah("请配置租户的VGM直发船司参数"); - } + /* 1. 先通过 租户参数里的 支持API发送的船司列表 判断是否走API发送 + * 2. 如果不走API,再通过 租户参数里的 直发船司列表 判断走爬虫直发或大简云发送 + */ + + var tenantParamList = _cache.GetAllTenantParam().Result; - var arrCarr = config.ItemCode.Split(",", StringSplitOptions.RemoveEmptyEntries); - if (!arrCarr.Contains(order.CARRIERID)) //使用大简云发送vgm + var vgmApiSendCarrierIdStr = tenantParamList.FirstOrDefault(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == "VgmApiSendCarrierId"); + + string[] vgmApiSendCarrierIdArr = vgmApiSendCarrierIdStr == null + ? new string[0] + : vgmApiSendCarrierIdStr.ItemCode.Split(","); + + // VGM发送方式1:通过API发送 + if (vgmApiSendCarrierIdArr.Contains(order.CARRIERID)) { - //ETD不能为空 - if (!order.ETD.HasValue) + try { - throw Oops.Bah("ETD不能为空"); - } + if (!order.CARRIERID.Equals("MSK", StringComparison.OrdinalIgnoreCase)) + { + throw Oops.Bah($"[{order.CARRIERID}]船公司暂不支持通过API发送VGM"); + } + + //config1 + string userKey = App.Configuration["MSKAPIDjyUserKey"]; + string userSecret = App.Configuration["MSKAPIDjyUserSecret"]; + string env = App.Configuration["MSKAPIOPEnvironment"]; + + if (string.IsNullOrWhiteSpace(userKey) || string.IsNullOrWhiteSpace(userSecret) || string.IsNullOrWhiteSpace(env)) + { + throw Oops.Bah("通过MSKAPI发送VGM所需的Key或Secret或Environment未配置,请联系管理员"); + } + + // config2 + var webAccount = await _webAccountConfig.GetAccountConfig("MSKApi", UserManager.UserId) ?? throw Oops.Bah("未配置网站账户,类型:MSKApi"); + + // config3 + var allSysConfig = await _cache.GetAllSysConfig(); + var url = allSysConfig.FirstOrDefault(x => x.Code == "VgmSendMskApiUrl")?.Value; + + if (string.IsNullOrWhiteSpace(url)) + { + throw Oops.Bah("通过MSKAPI发送VGM所需的Url未配置,请联系管理员,配置名称:[VgmSendMskApiUrl]"); + } - //重量不能为空 - if (!order.KGS.HasValue) + // config4 + var vgmSendMskCustomerCode = tenantParamList.FirstOrDefault(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == "VgmSendMskCustomerCode")?.ItemCode; + if (string.IsNullOrWhiteSpace(vgmSendMskCustomerCode)) + { + throw Oops.Bah("通过MSKAPI发送VGM所需的[客户编号],请联系管理员,配置名称:[VgmSendMskCustomerCode]"); + } + + var param = new + { + userKey, + userSecret, + operatingEnvironment = env, + mskAppKey = webAccount.Account, + mskAppSecret = webAccount.Password, + shipmentNumber = order.MBLNO, + brandCode = "MAEU", + customerCode = vgmSendMskCustomerCode, + terminalCode = "", + containerList = new List() + }; + foreach (var ctn in ctns) + { + if (string.IsNullOrEmpty(ctn.CNTRNO) + || !ctn.WEIGHKGS.HasValue + || ctn.WEIGHKGS == 0 + || string.IsNullOrWhiteSpace(ctn.WEIGHTYPE)) + { + throw Oops.Bah("所有箱子的箱号、称重重量、称重方式都不能为空"); + } + var vgmMethod = ctn.WEIGHTYPE switch + { + "累加" => "CALCULATED", + "总重" => "SCALED", + _ => throw Oops.Bah($"箱号为[{ctn.CNTRNO}]的箱子称重方式非[累加]或[总重],请检查") + }; + param.containerList.Add(new + { + containerNumber = ctn.CNTRNO, + vgmSource = "Shipper", + vgm = ctn.WEIGHKGS, + vgmUnit = "KGS", + vgmMethod, + authorizedPersonName = UserManager.Name, + authorizedPersonEmail = UserManager.Email + }); + } + + _logger.LogInformation("通过MSKAPI发送VGM,单号:{mblno},入参:{param}", order.MBLNO, param.ToJson()); + var resp = await url.SetBody(param).PostAsAsync(); + _logger.LogInformation("通过MSKAPI发送VGM,单号:{mblno},响应:{resp}", order.MBLNO, resp.ToJson()); + + if (resp.code == 200) + { + if (resp.data.Any(x => !x.status)) + { + result = resp.data.Select(x => new + { + CNTRNO = x.containerNumber, + IsSuccess = x.status, + FailReason = x.error_msg + }).ToList(); + _logger.LogInformation("通过MSKAPI发送VGM,部分成功,单号:{mblno},详细结果:{data}", order.MBLNO, result.ToJson()); + } + else + { + _logger.LogInformation("通过MSKAPI发送VGM,全部成功,单号:{mblno},详细结果:{data}", order.MBLNO, result.ToJson()); + + //货运动态 + var bsl = new BookingStatusLog(); + bsl.BookingId = order.Id; + bsl.Status = $"直发VGM(API)"; + bsl.OpTime = DateTime.Now; + bsl.Category = "ship"; + bsl.MBLNO = order.MBLNO; + await _repStatuslog.InsertAsync(bsl); + } + } + else + { + _logger.LogInformation("通过MSKAPI发送VGM,VGM服务接口返回失败结果,单号:{mblno}", order.MBLNO); + throw Oops.Bah($"VGM服务接口返回失败结果:{resp.msg}"); + } + } + catch (Exception ex) { - throw Oops.Bah("重量不能为空"); + _logger.LogError(ex, "通过MSKAPI发送VGM时发生未知异常,单号:{mblno}", order.MBLNO); + throw Oops.Bah($"发送失败:{ex.Message}"); } - - var sysconfig = await _cache.GetAllSysConfig(); - var urlConfig = sysconfig.FirstOrDefault(x => x.GroupCode == "DJY_CONST" && x.Code == "DjyVgmApiMyshpping"); - var accConfig = await _webAccountConfig.GetAccountConfig("DjyVgm", UserManager.UserId); - if (accConfig == null) + } + else + { + var config = tenantParamList.FirstOrDefault(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == "VgmDirectSendCarrierId"); + if (config == null) { - throw Oops.Bah("请在网站账号中维护VGM接口的用户id和秘钥"); + throw Oops.Bah("请配置租户的VGM直发船司参数"); } - var objMdata = new + var arrCarr = config.ItemCode.Split(",", StringSplitOptions.RemoveEmptyEntries); + // VGM发送方式2:使用大简云发送vgm + if (!arrCarr.Contains(order.CARRIERID)) { - MBLNO = order.MBLNO, - CARRIER = order.CARRIERID, - ChuanMing = order.VESSEL, - HangCi = order.VOYNOINNER, - ETD = order.ETD.Value.ToString("yyyy-MM-dd HH:mm:ss"), - ZongZhongLiang = order.KGS.ToString(), - BeiZhu = "", - ORDERNO = order.CUSTNO, - VGMCLOSETIME = order.CLOSEVGMDATE.HasValue ? order.CLOSEVGMDATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "" - }; + //ETD不能为空 + if (!order.ETD.HasValue) + { + throw Oops.Bah("ETD不能为空"); + } - var listCtn = new List(); - foreach (var ctn in ctns) - { - if (string.IsNullOrEmpty(ctn.CTNALL) - || string.IsNullOrEmpty(ctn.CNTRNO) - || string.IsNullOrEmpty(ctn.SEALNO) - || !ctn.WEIGHKGS.HasValue - || string.IsNullOrEmpty(ctn.WEIGHDATE)) + //重量不能为空 + if (!order.KGS.HasValue) { - throw Oops.Bah("所有箱子的箱型、箱号、封号、称重重量和称重时间都不能为空"); + throw Oops.Bah("重量不能为空"); } - listCtn.Add(new + var sysconfig = await _cache.GetAllSysConfig(); + var urlConfig = sysconfig.FirstOrDefault(x => x.GroupCode == "DJY_CONST" && x.Code == "DjyVgmApiMyshpping"); + var accConfig = await _webAccountConfig.GetAccountConfig("DjyVgm", UserManager.UserId); + if (accConfig == null) { - ChengZhongZhongLiang = ctn.WEIGHKGS.Value.ToString(), - ChengZhongShiJian = ctn.WEIGHDATE, - CTNALL = ctn.CTNALL.Replace("'", ""), - CNTRNO = ctn.CNTRNO, - SEALNO = ctn.SEALNO - }); - } + throw Oops.Bah("请在网站账号中维护VGM接口的用户id和秘钥"); + } + + var objMdata = new + { + MBLNO = order.MBLNO, + CARRIER = order.CARRIERID, + ChuanMing = order.VESSEL, + HangCi = order.VOYNOINNER, + ETD = order.ETD.Value.ToString("yyyy-MM-dd HH:mm:ss"), + ZongZhongLiang = order.KGS.ToString(), + BeiZhu = "", + ORDERNO = order.CUSTNO, + VGMCLOSETIME = order.CLOSEVGMDATE.HasValue ? order.CLOSEVGMDATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "" + }; - var dictParam = new Dictionary { + var listCtn = new List(); + foreach (var ctn in ctns) + { + if (string.IsNullOrEmpty(ctn.CTNALL) + || string.IsNullOrEmpty(ctn.CNTRNO) + || string.IsNullOrEmpty(ctn.SEALNO) + || !ctn.WEIGHKGS.HasValue + || string.IsNullOrEmpty(ctn.WEIGHDATE)) + { + throw Oops.Bah("所有箱子的箱型、箱号、封号、称重重量和称重时间都不能为空"); + } + + listCtn.Add(new + { + ChengZhongZhongLiang = ctn.WEIGHKGS.Value.ToString(), + ChengZhongShiJian = ctn.WEIGHDATE, + CTNALL = ctn.CTNALL.Replace("'", ""), + CNTRNO = ctn.CNTRNO, + SEALNO = ctn.SEALNO + }); + } + + var dictParam = new Dictionary { { "ac", "vgm" }, { "uid", accConfig.Account}, { "skey", accConfig.Password}, { "optype", "9"}, { "mdata", JsonConvert.SerializeObject(objMdata)}, { "ctndata", JsonConvert.SerializeObject(listCtn)} - }; + }; - _logger.LogInformation($"调用vgm发送接口:{urlConfig.Value},参数:{JsonConvert.SerializeObject(dictParam)}"); + _logger.LogInformation($"调用vgm发送接口:{urlConfig.Value},参数:{JsonConvert.SerializeObject(dictParam)}"); - var rtn = await urlConfig.Value - .SetBody(dictParam, "application/x-www-form-urlencoded") - .PostAsStringAsync(); + var rtn = await urlConfig.Value + .SetBody(dictParam, "application/x-www-form-urlencoded") + .PostAsStringAsync(); - _logger.LogInformation($"调用vgm发送接口:{urlConfig.Value},返回:{rtn}"); + _logger.LogInformation($"调用vgm发送接口:{urlConfig.Value},返回:{rtn}"); - var jobjRtn = JObject.Parse(rtn); - if (jobjRtn.GetBooleanValue("Success")) - { - //货运动态 - var bsl = new BookingStatusLog(); - bsl.BookingId = bookingId; - bsl.Status = $"发送VGM"; - bsl.OpTime = DateTime.Now; - bsl.Category = "ship"; - bsl.MBLNO = order.MBLNO; - await _repStatuslog.InsertAsync(bsl); + var jobjRtn = JObject.Parse(rtn); + if (jobjRtn.GetBooleanValue("Success")) + { + //货运动态 + var bsl = new BookingStatusLog(); + bsl.BookingId = bookingId; + bsl.Status = $"发送VGM"; + bsl.OpTime = DateTime.Now; + bsl.Category = "ship"; + bsl.MBLNO = order.MBLNO; + await _repStatuslog.InsertAsync(bsl); + } + else + { + throw Oops.Bah(jobjRtn.GetStringValue("Message")); + } } + // VGM发送方式3:直接调用vgm接口直发 else { - throw Oops.Bah(jobjRtn.GetStringValue("Message")); - } - } - else //直接调用vgm接口直发 - { - //判断船公司是否支持 - var allowCarrier = _cache.GetAllDictData().Result.Where(x => x.TypeCode == "vgm_carrier_list").Select(x => x.Code).ToList(); - if (!allowCarrier.Contains(order.CARRIERID)) - { - throw Oops.Bah(BookingErrorCode.BOOK117); - } + //判断船公司是否支持 + var allowCarrier = _cache.GetAllDictData().Result.Where(x => x.TypeCode == "vgm_carrier_list").Select(x => x.Code).ToList(); + if (!allowCarrier.Contains(order.CARRIERID)) + { + throw Oops.Bah(BookingErrorCode.BOOK117); + } - //船公司网站账号 - var carrWebAccMap = _cache.GetAllDictData().Result.FirstOrDefault(x => x.TypeCode == "carrier_web_account_mapping" && x.Code == order.CARRIERID); - if (carrWebAccMap == null) - { - throw Oops.Bah("不支持的船公司或账号映射未配置"); - } + //船公司网站账号 + var carrWebAccMap = _cache.GetAllDictData().Result.FirstOrDefault(x => x.TypeCode == "carrier_web_account_mapping" && x.Code == order.CARRIERID); + if (carrWebAccMap == null) + { + throw Oops.Bah("不支持的船公司或账号映射未配置"); + } - var webacc = _webAccountConfig.GetAccountConfig(carrWebAccMap.Value, UserManager.UserId).Result; - if (webacc == null) - { - throw Oops.Bah(BookingErrorCode.BOOK125); - } + var webacc = _webAccountConfig.GetAccountConfig(carrWebAccMap.Value, UserManager.UserId).Result; + if (webacc == null) + { + throw Oops.Bah(BookingErrorCode.BOOK125); + } - ////箱型映射 - //var ctnMapping = await _cache.GetAllMappingCtn(); - //ctnMapping = ctnMapping.Where(x => x.Module == "BookingVgm").ToList(); - //if (ctnMapping.Count == 0) - //{ - // throw Oops.Bah(BookingErrorCode.BOOK122); - //} + ////箱型映射 + //var ctnMapping = await _cache.GetAllMappingCtn(); + //ctnMapping = ctnMapping.Where(x => x.Module == "BookingVgm").ToList(); + //if (ctnMapping.Count == 0) + //{ + // throw Oops.Bah(BookingErrorCode.BOOK122); + //} - //var expCode = ctns.Select(x => x.CTNCODE).Distinct().Except(ctnMapping.Select(y => y.Code)).ToList(); - //if (expCode.Count > 0) - //{ - // throw Oops.Bah(BookingErrorCode.BOOK123, string.Join(',', expCode)); - //} + //var expCode = ctns.Select(x => x.CTNCODE).Distinct().Except(ctnMapping.Select(y => y.Code)).ToList(); + //if (expCode.Count > 0) + //{ + // throw Oops.Bah(BookingErrorCode.BOOK123, string.Join(',', expCode)); + //} - #region 箱信息校验,2022-7-1修改:【累加】的必须有重量、皮重和称重重量;【总重】的只需要称重重量不为空 - if (ctns.Where(c => c.WEIGHTYPE == "累加" && - ( - string.IsNullOrEmpty(c.CNTRNO) - || !c.WEIGHKGS.HasValue - || c.WEIGHKGS == 0 - || !c.TAREWEIGHT.HasValue - || c.TAREWEIGHT == 0 - || !c.KGS.HasValue - || c.KGS == 0) - ).Count() > 0) - { - throw Oops.Bah("称重方式为累加时,箱号、重量、箱皮重以及称重重量都不能为空"); - } + #region 箱信息校验,2022-7-1修改:【累加】的必须有重量、皮重和称重重量;【总重】的只需要称重重量不为空 + if (ctns.Where(c => c.WEIGHTYPE == "累加" && + ( + string.IsNullOrEmpty(c.CNTRNO) + || !c.WEIGHKGS.HasValue + || c.WEIGHKGS == 0 + || !c.TAREWEIGHT.HasValue + || c.TAREWEIGHT == 0 + || !c.KGS.HasValue + || c.KGS == 0) + ).Count() > 0) + { + throw Oops.Bah("称重方式为累加时,箱号、重量、箱皮重以及称重重量都不能为空"); + } - if (ctns.Where(c => c.WEIGHTYPE == "总重" && - ( - string.IsNullOrEmpty(c.CNTRNO) - || !c.WEIGHKGS.HasValue - || c.WEIGHKGS == 0) - ).Count() > 0) - { - throw Oops.Bah("称重方式为总重时,箱号和称重重量都不能为空"); - } - #endregion + if (ctns.Where(c => c.WEIGHTYPE == "总重" && + ( + string.IsNullOrEmpty(c.CNTRNO) + || !c.WEIGHKGS.HasValue + || c.WEIGHKGS == 0) + ).Count() > 0) + { + throw Oops.Bah("称重方式为总重时,箱号和称重重量都不能为空"); + } + #endregion - ////场站转换 - //var yardset = _cache.GetAllMappingYard().Result.FirstOrDefault(y => y.Code == order.YARDID && y.Module == "BookingVgm"); - //if (yardset == null) - //{ - // throw Oops.Bah(BookingErrorCode.BOOK120, order.YARDID); - //} - if (string.IsNullOrEmpty(order.YARD) || string.IsNullOrEmpty(order.YARDID)) - { - throw Oops.Bah("场站未正确选择"); - } - // 场站映射 - string mappingYard, mappingYardId; - var yardMapList = _cache.GetAllMappingYard().Result?.Where(y => y.Code == order.YARDID && y.Module == "BookingVgm" && (y.CarrierCode == null || y.CarrierCode == "" || y.CarrierCode == order.CARRIERID))?.ToList(); - if (yardMapList?.Any() == true) - { - var yardset = yardMapList.FirstOrDefault(x => x.CarrierCode == order.CARRIERID) - ?? yardMapList.FirstOrDefault(x => x.CarrierCode == null || x.CarrierCode == ""); + ////场站转换 + //var yardset = _cache.GetAllMappingYard().Result.FirstOrDefault(y => y.Code == order.YARDID && y.Module == "BookingVgm"); + //if (yardset == null) + //{ + // throw Oops.Bah(BookingErrorCode.BOOK120, order.YARDID); + //} + if (string.IsNullOrEmpty(order.YARD) || string.IsNullOrEmpty(order.YARDID)) + { + throw Oops.Bah("场站未正确选择"); + } + // 场站映射 + string mappingYard, mappingYardId; + var yardMapList = _cache.GetAllMappingYard().Result?.Where(y => y.Code == order.YARDID && y.Module == "BookingVgm" && (y.CarrierCode == null || y.CarrierCode == "" || y.CarrierCode == order.CARRIERID))?.ToList(); + if (yardMapList?.Any() == true) + { + var yardset = yardMapList.FirstOrDefault(x => x.CarrierCode == order.CARRIERID) + ?? yardMapList.FirstOrDefault(x => x.CarrierCode == null || x.CarrierCode == ""); - mappingYard = yardset.MapName; - mappingYardId = yardset.MapCode; - } - else - { - mappingYard = order.YARD; - mappingYardId = order.YARDID; - } - - // 船司映射 - var carrMap = _cache.GetAllMappingCarrier().Result?.Where(y => y.Code == order.CARRIERID && y.Module == "BookingVgm")?.FirstOrDefault(); - string mappingCarrierId = carrMap != null ? carrMap.MapCode : order.CARRIERID; - - var user = await _repUser.FirstOrDefaultAsync(x => x.Id == UserManager.UserId); - - int idx = 1; - //调用接口 - var dicUrl = _cache.GetAllDictData().Result.First(x => x.TypeCode == "url_set" && x.Code == "vgm_service_single"); - var sendObj = new - { - SystemCode = "djy_hechuan", - billOrderId = order.Id.ToString(), - sendOrderCode = order.MBLNO, - customerName = $"{UserManager.TENANT_NAME}+{UserManager.Name}", //公司名称+用户姓名 - customerId = order.CUSTOMERID.ToString(), - agentName = string.IsNullOrEmpty(order.FORWARDER) ? UserManager.TENANT_NAME : order.FORWARDER, - carrierCode = mappingCarrierId, - userName = webacc.Account, - userPassword = webacc.Password, - depotCode = mappingYardId, - depotName = mappingYard, - linkName = UserManager.Name, - linkMobile = user.Phone, - linkEmail = user.Email, - userId = user.DjyUserId, - signatory = user.NickName, //2023年8月28日,董怡含:把用户昵称当做vgm上传人 - returnUrl = "", - shipName = order.VESSEL, - voyNo = order.VOYNO, - etdstr = order.ETD.HasValue ? order.ETD.Value.ToString("yyyy-MM-dd") : string.Empty, - potrSend = order.PORTLOAD, - potrGoal = order.PORTDISCHARGE, - boxinfoStr = order.CNTRTOTAL.Replace("'", ""), - vgmEndTimeStr = order.CLOSEVGMDATE.HasValue ? order.CLOSEVGMDATE.Value.ToString("yyyy-MM-dd") : string.Empty, - BoxInfo = ctns.Select(c => new - { - index = idx++, - boxType = c.CTNALL.Replace("'", ""), - boxcount = c.CTNNUM.HasValue ? c.CTNNUM.Value : 0, - code = c.CNTRNO, - sealCode = c.SEALNO, - weigth = c.KGS, - weigthTare = c.TAREWEIGHT, - weigthTotal = c.WEIGHKGS, - weigthType = c.WEIGHTYPE == "累加" ? "SM2" : "SM1" - }).ToList(), - returnOkUrl = "" - }; + mappingYard = yardset.MapName; + mappingYardId = yardset.MapCode; + } + else + { + mappingYard = order.YARD; + mappingYardId = order.YARDID; + } + + // 船司映射 + var carrMap = _cache.GetAllMappingCarrier().Result?.Where(y => y.Code == order.CARRIERID && y.Module == "BookingVgm")?.FirstOrDefault(); + string mappingCarrierId = carrMap != null ? carrMap.MapCode : order.CARRIERID; + + var user = await _repUser.FirstOrDefaultAsync(x => x.Id == UserManager.UserId); + + int idx = 1; + //调用接口 + var dicUrl = _cache.GetAllDictData().Result.First(x => x.TypeCode == "url_set" && x.Code == "vgm_service_single"); + var sendObj = new + { + SystemCode = "djy_hechuan", + billOrderId = order.Id.ToString(), + sendOrderCode = order.MBLNO, + customerName = $"{UserManager.TENANT_NAME}+{UserManager.Name}", //公司名称+用户姓名 + customerId = order.CUSTOMERID.ToString(), + agentName = string.IsNullOrEmpty(order.FORWARDER) ? UserManager.TENANT_NAME : order.FORWARDER, + carrierCode = mappingCarrierId, + userName = webacc.Account, + userPassword = webacc.Password, + depotCode = mappingYardId, + depotName = mappingYard, + linkName = UserManager.Name, + linkMobile = user.Phone, + linkEmail = user.Email, + userId = user.DjyUserId, + signatory = user.NickName, //2023年8月28日,董怡含:把用户昵称当做vgm上传人 + returnUrl = "", + shipName = order.VESSEL, + voyNo = order.VOYNO, + etdstr = order.ETD.HasValue ? order.ETD.Value.ToString("yyyy-MM-dd") : string.Empty, + potrSend = order.PORTLOAD, + potrGoal = order.PORTDISCHARGE, + boxinfoStr = order.CNTRTOTAL.Replace("'", ""), + vgmEndTimeStr = order.CLOSEVGMDATE.HasValue ? order.CLOSEVGMDATE.Value.ToString("yyyy-MM-dd") : string.Empty, + BoxInfo = ctns.Select(c => new + { + index = idx++, + boxType = c.CTNALL.Replace("'", ""), + boxcount = c.CTNNUM.HasValue ? c.CTNNUM.Value : 0, + code = c.CNTRNO, + sealCode = c.SEALNO, + weigth = c.KGS, + weigthTare = c.TAREWEIGHT, + weigthTotal = c.WEIGHKGS, + weigthType = c.WEIGHTYPE == "累加" ? "SM2" : "SM1" + }).ToList(), + returnOkUrl = "" + }; - string strPostObj = sendObj.ToJsonString(); - _logger.LogInformation($"调用VGM直发接口 {dicUrl.Value} 传递数据:{strPostObj}"); - var strResp = await dicUrl.Value.SetBody(sendObj).PostAsStringAsync(); - _logger.LogInformation($"调用VGM直发接口返回:{strResp}"); + string strPostObj = sendObj.ToJsonString(); + _logger.LogInformation($"调用VGM直发接口 {dicUrl.Value} 传递数据:{strPostObj}"); + var strResp = await dicUrl.Value.SetBody(sendObj).PostAsStringAsync(); + _logger.LogInformation($"调用VGM直发接口返回:{strResp}"); - var jobjResp = JObject.Parse(strResp); - int respCode = jobjResp.GetIntValue("code"); - if (respCode != 200) - { - throw Oops.Bah(BookingErrorCode.BOOK128, jobjResp.GetStringValue("message")); + var jobjResp = JObject.Parse(strResp); + int respCode = jobjResp.GetIntValue("code"); + if (respCode != 200) + { + throw Oops.Bah(BookingErrorCode.BOOK128, jobjResp.GetStringValue("message")); + } + //货运动态 + var bsl = new BookingStatusLog(); + bsl.BookingId = bookingId; + bsl.Status = $"直发VGM"; + bsl.OpTime = DateTime.Now; + bsl.Category = "ship"; + bsl.MBLNO = order.MBLNO; + await _repStatuslog.InsertAsync(bsl); } - //货运动态 - var bsl = new BookingStatusLog(); - bsl.BookingId = bookingId; - bsl.Status = $"直发VGM"; - bsl.OpTime = DateTime.Now; - bsl.Category = "ship"; - bsl.MBLNO = order.MBLNO; - await _repStatuslog.InsertAsync(bsl); } //设置货物状态:已发VGM,并回传东胜 await SetGoodsStatus("YFVGM", bookingId); await SendBookingOrder(new long[] { bookingId }); + + return result; } @@ -9845,6 +9988,7 @@ namespace Myshipping.Application var files = await _bookingfile.AsQueryable().Filter(null, true).Where(x => x.BookingId == item.Id).ToListAsync(); dto.Files = files.Select(x => new ReceiveBcInfoDto.DownloadFile() { + Id = x.Id, FileName = x.FileName, FileType = x.TypeCode, FilePath = x.FilePath @@ -11774,7 +11918,7 @@ namespace Myshipping.Application if (App.Configuration["RunType"] == CommonConst.RUN_TYPE_DJY) { //推送订舱数据到客户订舱系统 - CustomerBookingSyncHelper.SendCustomerBookingSync(bookingId, "ALL"); + CustomerBookingSyncHelper.SendCustomerBookingSync(bookingId); } } /// @@ -11992,6 +12136,8 @@ namespace Myshipping.Application x.VOYNO = input.VOYNO; x.ETD = input.ETD; x.UpdatedTime = DateTime.Now; + x.UpdatedUserId = UserManager.UserId; + x.UpdatedUserName = UserManager.Name; }); var changeNum = await _rep.Context.Updateable(list).UpdateColumns(x => new @@ -12004,13 +12150,35 @@ namespace Myshipping.Application x.VOYNO, x.ETD, x.UpdatedTime, + x.UpdatedUserId, + x.UpdatedUserName }).ExecuteCommandAsync(); foreach (var item in list) { + // 保存日志 var oldOrder = oldOrderList.FirstOrDefault(x => x.Id == item.Id); await SaveLog(item, oldOrder, "接收BC后更新订舱"); + if (input.Files != null) + { + // 保存文件 + foreach (var fileItem in input.Files) + { + var insFile = new BookingFile() + { + BookingId = item.Id, + FileName = fileItem.FileName, + FilePath = fileItem.FilePath, + TypeCode = fileItem.FileType, + TypeName = fileItem.FileType switch { "BC" => "BC", _ => "未定义" }, + TenantId = item.TenantId, + TenantName = item.TenantName + }; + await _bookingfile.InsertAsync(insFile); + } + } + // 客户订舱:运营端发送订舱数据给客户端 if (App.Configuration["RunType"] == CommonConst.RUN_TYPE_DJY) diff --git a/Myshipping.Application/Service/BookingOrder/Dto/MSKAPI/MSKAPISendVgmResultDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/MSKAPI/MSKAPISendVgmResultDto.cs new file mode 100644 index 00000000..53bcbbd6 --- /dev/null +++ b/Myshipping.Application/Service/BookingOrder/Dto/MSKAPI/MSKAPISendVgmResultDto.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; + +namespace Myshipping.Application.Service.BookingOrder.Dto.MSKAPI +{ + public class MSKAPISendVgmResultDto + { + public int code { get; set; } + public string msg { get; set; } + public List data { get; set; } + + public class VGMInfoByCtn + { + /// + /// 单号 + /// + public string shipmentNumber { get; set; } + /// + /// 箱号 + /// + public string containerNumber { get; set; } + /// + /// 提交状态 + /// + public bool status { get; set; } + public SuccessResult success_result { get; set; } + /// + /// 提交失败的提示文本 + /// + public string error_msg { get; set; } + } + public class SuccessResult + { + /// + /// 操作的结果 + /// + public string vgmAcknowledgmentMessage { get; set; } + + /// + /// 操作完成的时间戳 + /// + public string vgmTimestamp { get; set; } + } + } + + +} diff --git a/Myshipping.Application/Service/BookingOrder/Dto/ReceiveBcInfoDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/ReceiveBcInfoDto.cs index 9ebeeaff..2940bc1f 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/ReceiveBcInfoDto.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/ReceiveBcInfoDto.cs @@ -17,6 +17,7 @@ namespace Myshipping.Application.Service.BookingOrder.Dto public class DownloadFile { + public long Id { get; set; } public string FileName { get; set; } public string FileType { get; set; } public string FilePath { get; set; } diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index f4c4b4a5..da9b1c4c 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -41,6 +41,7 @@ using Myshipping.Core.Service.Dict.Dto; using Furion.JsonSerialization; using Microsoft.AspNetCore.SignalR; using Furion.EventBus; +using Myshipping.Core.Const; namespace Myshipping.Application { @@ -2512,109 +2513,198 @@ namespace Myshipping.Application #endregion #endregion - #region ATD MDGETA MDGATA - if (item.Status == "ATD") - { - //2023-8-31,排查单号为177GZHZHQ5711V的数据,原来录入的船已开船,运踪港前不再查询,而因订阅港后数据会继续回推数据,所以导致ATD被改 - //因此,暂时取消运踪回推时写入ATD,还是以船期表查询为准 - ////变更ATD - //var o = _rep.AsQueryable().Filter(null, true).Where(x => x.Id == all[0].BookingId && x.IsDeleted == false).First(); - //var oldorder = o; - //var oldatd = o == null ? null : o.ATD; - //if (oldatd != item.OpTime && item.OpTime != null) - //{ - // o.ATD = item.OpTime; - // await _rep.UpdateAsync(o); - // flag = true; - // await _bookingorderservice.SaveLog(o, oldorder); - //} - - /* - * 2023年8月24日改,取消运踪回推ATD的批量更新功能 - * 和川操作经常修改提单号和船名航次,但修改时间会差好几天,导致运踪根据提单号查询的数据,回写回来之后,再根据船名航次去批量更新数据时,错误的把其他数据修改了 - * 因此,不能根据船名航次去批量修改数据,因为操作写的船名航次可能是错误的,导致把他人的数据修改错误 - */ - ////批量变更相同船期 - //if (!string.IsNullOrEmpty(o.VESSEL) && !string.IsNullOrEmpty(o.VOYNO) && !string.IsNullOrEmpty(o.CARRIERID)) - //{ - // var order = await _rep.AsQueryable().Filter(null, true).Where(x => x.VOYNO == o.VOYNO && x.VESSEL == o.VESSEL && x.CARRIERID == o.CARRIERID && x.TenantId == o.TenantId && x.IsDeleted == false && x.Id != item.BookingId).ToListAsync(); - - // foreach (var it in order) - // { - // var _oldorder = it; - // var _oldatd = it.ATD; - // if (_oldatd != item.OpTime) - // { - // it.ATD = item.OpTime; - // await _rep.UpdateAsync(it); - // await _bookingorderservice.SaveLog(it, _oldorder); - // await _bookingorderservice.SendBookingOrder(new long[] { it.Id }); - // } - // } - //} - } - if (item.Status == "MDGETA") + #region 船舶动态:ATD ETD ATA ETA MDGETA MDGATA + if (item.Status == "ATD" || item.Status == "ETD" || item.Status == "ATA" || item.Status == "ETA" || item.Status == "MDGETA" || item.Status == "MDGATA") { - var o = _rep.AsQueryable().Filter(null, true).Where(x => x.Id == all[0].BookingId && x.IsDeleted == false).First(); - var oldorder = o.Adapt(); - var oldeta = o == null ? null : o.ETA; - if (oldeta != item.OpTime && item.OpTime != null) + var enableStatusToSailingDate = _cache.GetAllTenantParam().Result + .FirstOrDefault(x => x.TenantId == UserManager.TENANT_ID + && x.ParaCode == TenantParamCode.ENABLE_STATUS_TO_SAILING_DATE)?.ItemCode; + if (enableStatusToSailingDate == "YES") { - o.ETA = item.OpTime; - await _rep.UpdateAsync(o); - flag = true; - await _bookingorderservice.SaveLog(o, oldorder, "运踪回推"); - + if (item.Status == "ATD") + { + //2023-8-31,排查单号为177GZHZHQ5711V的数据,原来录入的船已开船,运踪港前不再查询,而因订阅港后数据会继续回推数据,所以导致ATD被改 + //因此,暂时取消运踪回推时写入ATD,还是以船期表查询为准 - } - //if (!string.IsNullOrEmpty(o.VESSEL) && !string.IsNullOrEmpty(o.VOYNO) && !string.IsNullOrEmpty(o.CARRIERID)) - //{ - // var order = await _rep.AsQueryable().Filter(null, true).Where(x => x.VOYNO == o.VOYNO && x.VESSEL == o.VESSEL && x.CARRIERID == o.CARRIERID && x.TenantId == o.TenantId && x.IsDeleted == false && x.Id != item.BookingId).ToListAsync(); - // foreach (var it in order) - // { - // var _oldorder = it; - // var _oldatd = it.ETA; - // if (_oldatd != item.OpTime) - // { - // it.ETA = item.OpTime; - // await _rep.UpdateAsync(it); - // await _bookingorderservice.SendBookingOrder(new long[] { it.Id }); - // await _bookingorderservice.SaveLog(it, _oldorder); - // } - // } - //} - } - if (item.Status == "MDGATA") - { - var o = _rep.AsQueryable().Filter(null, true).Where(x => x.Id == all[0].BookingId && x.IsDeleted == false).First(); - var oldorder = o.Adapt(); - var oldata = o == null ? null : o.ATA; - if (oldata != item.OpTime && item.OpTime != null) - { - o.ATA = item.OpTime; - await _rep.UpdateAsync(o); + // 2024-4-8 因为港捷需要,重新开启,并通过租户参数判断 + //变更ATD + var oldOrder = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == item.BookingId && x.IsDeleted == false).FirstAsync(); + if (oldOrder != null && item.OpTime != null && oldOrder.ATD != item.OpTime) + { + var newOrder = oldOrder.Adapt(); + newOrder.ATD = item.OpTime; + newOrder.UpdatedUserId = UserManager.UserId; + newOrder.UpdatedUserName = UserManager.Name; + await _rep.AsUpdateable(newOrder).UpdateColumns(x => new + { + x.ATD, + x.UpdatedTime, + x.UpdatedUserId, + x.UpdatedUserName + }).ExecuteCommandAsync(); + flag = true; + await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); + } - flag = true; - await _bookingorderservice.SaveLog(o, oldorder, "运踪回推"); + /* + * 2023年8月24日改,取消运踪回推ATD的批量更新功能 + * 和川操作经常修改提单号和船名航次,但修改时间会差好几天,导致运踪根据提单号查询的数据,回写回来之后,再根据船名航次去批量更新数据时,错误的把其他数据修改了 + * 因此,不能根据船名航次去批量修改数据,因为操作写的船名航次可能是错误的,导致把他人的数据修改错误 + */ + ////批量变更相同船期 + //if (!string.IsNullOrEmpty(o.VESSEL) && !string.IsNullOrEmpty(o.VOYNO) && !string.IsNullOrEmpty(o.CARRIERID)) + //{ + // var order = await _rep.AsQueryable().Filter(null, true).Where(x => x.VOYNO == o.VOYNO && x.VESSEL == o.VESSEL && x.CARRIERID == o.CARRIERID && x.TenantId == o.TenantId && x.IsDeleted == false && x.Id != item.BookingId).ToListAsync(); + + // foreach (var it in order) + // { + // var _oldorder = it; + // var _oldatd = it.ATD; + // if (_oldatd != item.OpTime) + // { + // it.ATD = item.OpTime; + // await _rep.UpdateAsync(it); + // await _bookingorderservice.SaveLog(it, _oldorder); + // await _bookingorderservice.SendBookingOrder(new long[] { it.Id }); + // } + // } + //} + } + else if (item.Status == "ETD") + { + var oldOrder = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == item.BookingId && x.IsDeleted == false).FirstAsync(); + if (oldOrder != null && item.OpTime != null && oldOrder.YgtETD != item.OpTime) + { + var newOrder = oldOrder.Adapt(); + newOrder.YgtETD = item.OpTime; + newOrder.UpdatedUserId = UserManager.UserId; + newOrder.UpdatedUserName = UserManager.Name; + await _rep.AsUpdateable(newOrder).UpdateColumns(x => new + { + x.YgtETD, + x.UpdatedTime, + x.UpdatedUserId, + x.UpdatedUserName + }).ExecuteCommandAsync(); + flag = true; + await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); + } + } + else if (item.Status == "ATA") + { + var oldOrder = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == item.BookingId && x.IsDeleted == false).FirstAsync(); + if (oldOrder != null && item.OpTime != null && oldOrder.StartATA != item.OpTime) + { + var newOrder = oldOrder.Adapt(); + newOrder.StartATA = item.OpTime; + newOrder.UpdatedUserId = UserManager.UserId; + newOrder.UpdatedUserName = UserManager.Name; + await _rep.AsUpdateable(newOrder).UpdateColumns(x => new + { + x.StartATA, + x.UpdatedTime, + x.UpdatedUserId, + x.UpdatedUserName + }).ExecuteCommandAsync(); + flag = true; + await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); + } + } + else if (item.Status == "ETA") + { + var oldOrder = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == item.BookingId && x.IsDeleted == false).FirstAsync(); + if (oldOrder != null && item.OpTime != null && oldOrder.StartETA != item.OpTime) + { + var newOrder = oldOrder.Adapt(); + newOrder.StartETA = item.OpTime; + newOrder.UpdatedUserId = UserManager.UserId; + newOrder.UpdatedUserName = UserManager.Name; + await _rep.AsUpdateable(newOrder).UpdateColumns(x => new + { + x.StartETA, + x.UpdatedTime, + x.UpdatedUserId, + x.UpdatedUserName + }).ExecuteCommandAsync(); + flag = true; + await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); + } + } + else if (item.Status == "MDGETA") + { + var oldOrder = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == item.BookingId && x.IsDeleted == false).FirstAsync(); + if (oldOrder != null && item.OpTime != null && oldOrder.ETA != item.OpTime) + { + var newOrder = oldOrder.Adapt(); + newOrder.ETA = item.OpTime; + newOrder.UpdatedUserId = UserManager.UserId; + newOrder.UpdatedUserName = UserManager.Name; + await _rep.AsUpdateable(newOrder).UpdateColumns(x => new + { + x.ETA, + x.UpdatedTime, + x.UpdatedUserId, + x.UpdatedUserName + }).ExecuteCommandAsync(); + flag = true; + await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); + } + //if (!string.IsNullOrEmpty(o.VESSEL) && !string.IsNullOrEmpty(o.VOYNO) && !string.IsNullOrEmpty(o.CARRIERID)) + //{ + // var order = await _rep.AsQueryable().Filter(null, true).Where(x => x.VOYNO == o.VOYNO && x.VESSEL == o.VESSEL && x.CARRIERID == o.CARRIERID && x.TenantId == o.TenantId && x.IsDeleted == false && x.Id != item.BookingId).ToListAsync(); + // foreach (var it in order) + // { + // var _oldorder = it; + // var _oldatd = it.ETA; + // if (_oldatd != item.OpTime) + // { + // it.ETA = item.OpTime; + // await _rep.UpdateAsync(it); + // await _bookingorderservice.SendBookingOrder(new long[] { it.Id }); + // await _bookingorderservice.SaveLog(it, _oldorder); + // } + // } + //} + } + else if (item.Status == "MDGATA") + { + var oldOrder = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == item.BookingId && x.IsDeleted == false).FirstAsync(); + if (oldOrder != null && item.OpTime != null && oldOrder.ATA != item.OpTime) + { + var newOrder = oldOrder.Adapt(); + newOrder.ATA = item.OpTime; + newOrder.UpdatedUserId = UserManager.UserId; + newOrder.UpdatedUserName = UserManager.Name; + await _rep.AsUpdateable(newOrder).UpdateColumns(x => new + { + x.ATA, + x.UpdatedTime, + x.UpdatedUserId, + x.UpdatedUserName + }).ExecuteCommandAsync(); + flag = true; + await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); + } + //if (!string.IsNullOrEmpty(o.VESSEL) && !string.IsNullOrEmpty(o.VOYNO) && !string.IsNullOrEmpty(o.CARRIERID)) + //{ + // var order = await _rep.AsQueryable().Filter(null, true).Where(x => x.VOYNO == o.VOYNO && x.VESSEL == o.VESSEL && x.CARRIERID == o.CARRIERID && x.TenantId == o.TenantId && x.IsDeleted == false && x.Id != item.BookingId).ToListAsync(); + // foreach (var it in order) + // { + // var _oldorder = it; + // var _oldatd = it.ATA; + // if (_oldatd != item.OpTime) + // { + // it.ATA = item.OpTime; + // await _rep.UpdateAsync(it); + // await _bookingorderservice.SendBookingOrder(new long[] { it.Id }); + // await _bookingorderservice.SaveLog(it, _oldorder); + // } + // } + //} + } } - //if (!string.IsNullOrEmpty(o.VESSEL) && !string.IsNullOrEmpty(o.VOYNO) && !string.IsNullOrEmpty(o.CARRIERID)) - //{ - // var order = await _rep.AsQueryable().Filter(null, true).Where(x => x.VOYNO == o.VOYNO && x.VESSEL == o.VESSEL && x.CARRIERID == o.CARRIERID && x.TenantId == o.TenantId && x.IsDeleted == false && x.Id != item.BookingId).ToListAsync(); - // foreach (var it in order) - // { - // var _oldorder = it; - // var _oldatd = it.ATA; - // if (_oldatd != item.OpTime) - // { - // it.ATA = item.OpTime; - // await _rep.UpdateAsync(it); - // await _bookingorderservice.SendBookingOrder(new long[] { it.Id }); - // await _bookingorderservice.SaveLog(it, _oldorder); - // } - // } - //} } #endregion diff --git a/Myshipping.Application/Service/DataSync/Dto/BookingOrderDto.cs b/Myshipping.Application/Service/DataSync/Dto/BookingOrderDto.cs index 36fe77c1..2d11ef93 100644 --- a/Myshipping.Application/Service/DataSync/Dto/BookingOrderDto.cs +++ b/Myshipping.Application/Service/DataSync/Dto/BookingOrderDto.cs @@ -12,7 +12,7 @@ namespace Myshipping.Application.Service.DataSync.Dto public class SyncBookingOrderDto { /// - /// 字段同步类型 空:更新全部字段 BC:只更新BC相关字段 + /// 字段同步类型(用于客户订舱,彩虹+东胜7独立版本)空:所有字段都不同步 BC:只同步BC+文件相关字段 FILE:只同步文件相关字段) /// public string SyncType { get; set; } diff --git a/Myshipping.Core/Const/TenantParamCode.cs b/Myshipping.Core/Const/TenantParamCode.cs index 9338d797..a0549bca 100644 --- a/Myshipping.Core/Const/TenantParamCode.cs +++ b/Myshipping.Core/Const/TenantParamCode.cs @@ -19,5 +19,10 @@ /// 是否必须使用船期表录入船期参数 /// public const string VESSEL_FROM_CONFIG_ONLY = "VESSEL_FROM_CONFIG_ONLY"; + + /// + /// 通过运踪更新船舶动态开关 + /// + public const string ENABLE_STATUS_TO_SAILING_DATE = "EnableStatusToSailingDate"; } } diff --git a/Myshipping.Core/Enum/BookingOrderSyncTypeEnum.cs b/Myshipping.Core/Enum/BookingOrderSyncTypeEnum.cs index c7236bda..e48f4a00 100644 --- a/Myshipping.Core/Enum/BookingOrderSyncTypeEnum.cs +++ b/Myshipping.Core/Enum/BookingOrderSyncTypeEnum.cs @@ -1,16 +1,16 @@ namespace Myshipping.Core; /// -/// 订舱记录同步类型 +/// 字段同步类型(用于客户订舱,彩虹+东胜7独立版本) /// public enum BookingOrderSyncTypeEnum { /// - /// 同步全部字段(未指定时,默认为同步全部) - /// - ALL = 0, - /// - /// 只同步BC相关字段 + /// 只同步BC+文件相关字段 /// BC = 1, + ///// + ///// 只同步文件相关字段 + ///// + //FILE = 2, } diff --git a/Myshipping.Core/EventSubscriber/CompanyUserSyncSubscriber.cs b/Myshipping.Core/EventSubscriber/CompanyUserSyncSubscriber.cs index 1e94b40c..eb32e7f6 100644 --- a/Myshipping.Core/EventSubscriber/CompanyUserSyncSubscriber.cs +++ b/Myshipping.Core/EventSubscriber/CompanyUserSyncSubscriber.cs @@ -174,6 +174,7 @@ namespace Myshipping.Core 374126362341445, 142307070910563, 142307000914633, + 533697384435781 //复制项配置 }; foreach (var menuId in initMenu) diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index a4775205..b072c839 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -867,6 +867,11 @@ 是否必须使用船期表录入船期参数 + + + 通过运踪更新船舶动态开关 + + 代码 @@ -4462,17 +4467,12 @@ - 订舱记录同步类型 - - - - - 同步全部字段(未指定时,默认为同步全部) + 字段同步类型(用于客户订舱,彩虹+东胜7独立版本) - 只同步BC相关字段 + 只同步BC+文件相关字段