diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index 4e2cb428..52a4653c 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -8226,6 +8226,26 @@ 返回校验明细 + + + 是否成功 true-成功 false-失败 + + + + + 请求报文HEAD的GID + + + + + 执行时间 格式(yyyy-MM-dd HH:mm:ss) + + + + + 规则详情 + + 规则平台请求报文头(HEAD) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 6ae77c2e..f422368a 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -1835,6 +1835,7 @@ namespace Myshipping.Application } #endregion + #region 上传FTP /// /// 上传FTP /// @@ -1889,8 +1890,9 @@ namespace Myshipping.Application return true; } + #endregion - + #region 触发订舱 /// /// 触发订舱 /// @@ -2017,7 +2019,9 @@ namespace Myshipping.Application return result; } + #endregion + #region 检查订舱、截单EDI订单信息 /// /// 检查订舱、截单EDI订单信息 /// @@ -2034,7 +2038,9 @@ namespace Myshipping.Application if (string.IsNullOrWhiteSpace(order.KINDPKGS)) throw Oops.Bah("包装种类未填写"); } + #endregion + #region 根据船公司ID获取EDI的路由枚举 /// /// 根据船公司ID获取EDI的路由枚举 /// @@ -2073,6 +2079,7 @@ namespace Myshipping.Application return routeEnum; } + #endregion #region 其他 /// diff --git a/Myshipping.Application/Service/RulesEngine/Dtos/RulesEngineExcuteResultDto.cs b/Myshipping.Application/Service/RulesEngine/Dtos/RulesEngineExcuteResultDto.cs index 6b51d602..229da619 100644 --- a/Myshipping.Application/Service/RulesEngine/Dtos/RulesEngineExcuteResultDto.cs +++ b/Myshipping.Application/Service/RulesEngine/Dtos/RulesEngineExcuteResultDto.cs @@ -31,4 +31,28 @@ namespace Myshipping.Application /// public List rows { get; set; } } + + public class RemoteRulesEngineExcuteResultDto + { + /// + /// 是否成功 true-成功 false-失败 + /// + + public bool IsSuccess { get; set; } + + /// + /// 请求报文HEAD的GID + /// + public string RequestId { get; set; } + + /// + /// 执行时间 格式(yyyy-MM-dd HH:mm:ss) + /// + public string ExcuteDate { get; set; } + + /// + /// 规则详情 + /// + public List DetailList { get; set; } + } } diff --git a/Myshipping.Application/Service/RulesEngine/RulesEngineClientService.cs b/Myshipping.Application/Service/RulesEngine/RulesEngineClientService.cs index 718f248f..07d311dc 100644 --- a/Myshipping.Application/Service/RulesEngine/RulesEngineClientService.cs +++ b/Myshipping.Application/Service/RulesEngine/RulesEngineClientService.cs @@ -17,6 +17,8 @@ using Myshipping.Application.Entity; using Myshipping.Core; using Furion.DistributedIDGenerator; using Mapster; +using Furion.DataValidation; +using Newtonsoft.Json.Linq; namespace Myshipping.Application { @@ -42,7 +44,7 @@ namespace Myshipping.Application _bookingOrderContaCargoRepository = bookingOrderContaCargoRepository; } - + #region 海运订舱请求规则引擎校验 /// /// 海运订舱请求规则引擎校验 /// @@ -58,7 +60,9 @@ namespace Myshipping.Application if (ruleResult == null) throw Oops.Oh($"订舱请求规则失败,返回为空"); - var ruleDetailList = ruleResult.rows as List; + var innerRlt = JSON.Deserialize(ruleResult.extra.ToString()); + + var ruleDetailList = innerRlt.DetailList; result.succ = ruleResult.succ; result.msg = ruleResult.msg; @@ -70,8 +74,9 @@ namespace Myshipping.Application return result; } + #endregion - + #region 海运订舱请求规则引擎校验 /// /// 海运订舱请求规则引擎校验 /// @@ -128,8 +133,10 @@ namespace Myshipping.Application { msgModel.Main.BusinessInfo.ContaList = contaList.Adapt>(); + var ctnArg = contaList.Select(t => t.Id).ToArray(); + var cargoList = await _bookingOrderContaCargoRepository.AsQueryable() - .Where(x=> contaList.Any(a=>a.Id == x.CTNID)).ToListAsync(); + .Where(x=> ctnArg.Contains(x.CTNID.Value)).ToListAsync(); if(cargoList.Count > 0) { @@ -160,12 +167,14 @@ namespace Myshipping.Application if(ruleResult == null) throw Oops.Oh($"订舱主键{bookingId}请求规则失败,返回为空"); - var ruleDetailList = ruleResult.rows as List; + var innerRlt = JSON.Deserialize(ruleResult.extra.ToString()); + + var ruleDetailList = innerRlt.DetailList; result.succ = ruleResult.succ; result.msg = ruleResult.msg; - if (ruleDetailList.Count > 0) + if (ruleDetailList != null && ruleDetailList.Count > 0) { result.rows = ruleDetailList; } @@ -178,8 +187,9 @@ namespace Myshipping.Application return result; } + #endregion - + #region 海运订舱请求规则引擎校验 /// /// 海运订舱请求规则引擎校验 /// @@ -272,7 +282,9 @@ namespace Myshipping.Application if (ruleResult == null) throw Oops.Oh($"订舱主键{model.BOOKINGNO}请求规则失败,返回为空"); - var ruleDetailList = ruleResult.rows as List; + var innerRlt = JSON.Deserialize(ruleResult.extra.ToString()); + + var ruleDetailList = innerRlt.DetailList; result.succ = ruleResult.succ; result.msg = ruleResult.msg; @@ -290,7 +302,9 @@ namespace Myshipping.Application return result; } + #endregion + #region 请求规则平台 /// /// 请求规则平台 /// @@ -331,5 +345,6 @@ namespace Myshipping.Application return model; } + #endregion } } diff --git a/Myshipping.Web.Core/applicationconfig.json b/Myshipping.Web.Core/applicationconfig.json index 18c70a07..6eedf260 100644 --- a/Myshipping.Web.Core/applicationconfig.json +++ b/Myshipping.Web.Core/applicationconfig.json @@ -106,7 +106,7 @@ "contentType": [ "image/jpg", "image/png", "image/jpeg", "image/gif", "image/bmp", "text/plain", "application/pdf", "application/msword", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.presentationml.presentation" ] } }, - "RulesEngineUrl": "http://192.168.0.181:8088/api/RulesEngineManage/ExcuteWorkFlow", + "RulesEngineUrl": "http://60.209.125.238:35210/api/RulesEngineManage/ExcuteWorkFlow", "RulesEngineAuthKey": "clova3dXNnBldkM4bzVyUkxNcjVIS0lhUTNja2xmRVI4SDZDMkIzRURBMitKamJPb0tIRkMxemF5VlZOQ0wxUDdNeGNuTzF1NnEyOS9FS1VpeDBDZWFya0VucFR4ZE1Ca1JaUXZVb3lhdGs9", "RulesEngineSender": "NewOceanBooking", "RulesEngineSenderName": "新海运订舱平台",