From 57e186f6451a9923f4f97edbdb91b972d6877997 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 7 Nov 2022 11:05:15 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=96=B0=E5=A2=9E=E6=B5=B7=E8=BF=90?= =?UTF-8?q?=E8=AE=A2=E8=88=B1=E8=B0=83=E5=8F=96=E8=A7=84=E5=88=99=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E6=96=B9=E6=B3=95=E5=92=8C=E6=8A=A5=E6=96=87=E3=80=82?= =?UTF-8?q?=202=E3=80=81=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Myshipping.Application.xml | 913 ++++++++++++++++++ .../RulesEngineOrderBookingMainInfo.cs | 645 +++++++++++++ .../RulesEngineOrderBookingMessageInfo.cs | 24 + .../OrderBooking/RulesEngineWebApiResult.cs | 50 + .../Dtos/RulesEngineWebAPIHeadBase.cs | 81 ++ .../Interface/IRulesEngineClientService.cs | 18 + .../RulesEngine/RulesEngineClientService.cs | 87 ++ Myshipping.Core/Myshipping.Core.xml | 32 +- Myshipping.Web.Core/applicationconfig.json | 6 +- 9 files changed, 1854 insertions(+), 2 deletions(-) create mode 100644 Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs create mode 100644 Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMessageInfo.cs create mode 100644 Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineWebApiResult.cs create mode 100644 Myshipping.Application/Service/RulesEngine/Dtos/RulesEngineWebAPIHeadBase.cs create mode 100644 Myshipping.Application/Service/RulesEngine/Interface/IRulesEngineClientService.cs create mode 100644 Myshipping.Application/Service/RulesEngine/RulesEngineClientService.cs diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index a9b0f363..18e5b19e 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -3695,5 +3695,918 @@ 租户ID + + + 项目代码(可以填多个,主要是标识要进行的规则过滤) + + ["OCEAN_BOOKING","OCEAN_BOOKING2"] + + + + 业务对象 + + "object" + + + + 是否返回成功验证的明细(默认只返回失败的明细) + + + + + 主提单号 + + + + + 分提单号 + + + + + 订舱编号 + + + + + 合约号 + + + + + 客户合同号 + + + + + 发货人代码 + + + + + 收货人代码 + + + + + 通知人代码 + + + + + 发货人 + + + + + 收货人 + + + + + 通知人 + + + + + 第二通知人 + + + + + 场站代码 + + + + + 场站名称 + + + + + 船舶呼号 + + + + + 船名 + + + + + 海关航次 + + + + + 内部航次 + + + + + 开船日期 + + + + + 实际开船日期 + + + + + 预计到港日期 + + + + + 截港日期 + + + + + 截单日期 + + + + + 截VGM时间 + + + + + 收货地代码 + + + + + 收货地 + + + + + 起运港代码 + + + + + 起运港 + + + + + 卸货港代码 + + + + + 卸货港 + + + + + 交货地代码 + + + + + 交货地 + + + + + 目的地代码 + + + + + 目的地 + + + + + 提单份数 + + + + + 副本提单份数 + + + + + 签单方式 1-Seaway 2-正本 3-电放 + + + + + 签单日期 + + + + + 签单地点代码 + + + + + 签单地点 + + + + + 付费方式 + + + + + 预付地点 + + + + + 到付地点 + + + + + 运输条款 + + + + + 唛头 + + + + + HS代码 + + + + + 货描 + + + + + 件数 + + + + + 包装 + + + + + 毛重 + + + + + 尺码 + + + + + 件数大写 + + + + + 集装箱 + + + + + 船公司代号 + + + + + 船公司 + + + + + 货物标识 + + + + + 危险品类别 + + + + + 危险品编号 + + + + + 危险品页号 + + + + + 危险品标签 + + + + + 危险品联系人 + + + + + 温度单位 + + + + + 设置温度 + + + + + 通风度 + + + + + 湿度 + + + + + 最低温度 + + + + + 最高温度 + + + + + 是否SOC箱 + + + + + SO备注 + + + + + SI备注 + + + + + 场站备注 + + + + + 公司ID + + + + + 公司名称 + + + + + 发货人名称 + + + + + 发货人地址1 + + + + + 发货人地址2 + + + + + 发货人地址3 + + + + + 发货人城市 + + + + + 发货人省份代码 + + + + + 发货人邮编 + + + + + 发货人国家代码 + + + + + 发货人联系人 + + + + + 发货人电话 + + + + + 发货人名称 + + + + + 发货人地址1 + + + + + 发货人地址2 + + + + + 发货人地址3 + + + + + 发货人城市 + + + + + 发货人省份代码 + + + + + 发货人邮编 + + + + + 发货人国家代码 + + + + + 发货人联系人 + + + + + 发货人电话 + + + + + 通知人名称 + + + + + 通知人地址1 + + + + + 通知人地址2 + + + + + 通知人地址3 + + + + + 通知人城市 + + + + + 通知人省份代码 + + + + + 通知人邮编 + + + + + 通知人国家代码 + + + + + 通知人联系人 + + + + + 通知人电话 + + + + + PO号 + + + + + 操作id + + + + + 单证id + + + + + 操作 + + + + + 单证 + + + + + 销售ID + + + + + 销售 + + + + + 客服ID + + + + + 客服 + + + + + 客户 + + + + + 订舱代理 + + + + + 船代 + + + + + 报关行 + + + + + 车队 + + + + + 国外代理 + + + + + 客户ID + + + + + 订舱代理ID + + + + + 船代ID + + + + + 报关行ID + + + + + 车队ID + + + + + 国外代理名称 + + + + + 委托方 + + + + + 收货人DOOR地址 + + + + + 发货人DOOR地址 + + + + + SCAC代码 + + + + + ITN编号 + + + + + 预付地点ID + + + + + 到付地点ID + + + + + 客户系统编号 + + + + + 中转港代码 + + + + + 中转港 + + + + + 第三付款地 + + + + + 场站联系人电话 + + + + + 场站联系人邮箱 + + + + + 费用自结 + + + + + 航线代码 + + + + + 航线名称 + + + + + 付款方 + + + + + 发货人税号 + + + + + 收货人税号 + + + + + 通知人税号 + + + + + 是否船开后变更签单方式 1-是 0-否 + + + + + 是否条形中英文章 + + + + + 是否双Shipper + + + + + 是否整箱和拼箱混合 + + + + + 是否多品名 + + + + + 是否拼箱 + + + + + 海运订舱规则请求报文 + + + + + 表头 + + + + + 表体 + + + + + 是否成功 true=成功 false=失败 + + + + + 状态 0-成功 + + + + + 返回消息 + + + + + 总记录数 + + + + + 当前页列表数据 + + + + + 合计信息 + + + + + 扩展信息 + + + + + 扩展信息2 + + + + + 规则平台请求报文头(HEAD) + + + + + 报文惟一主键 + + + + + 报文类型 BUSI_RULE-业务规则校验 + + + + + 发送方代码 + + + + + 发送方名称 + + + + + 接收方代码 + + + + + 接收方名称 + + + + + 请求方登录TOKEN(可以是真实的登录人TOKEN或者是服务模拟登录人TOKEN) + + + + + 版本号 默认1.0 + + + + + 请求时间 + + + + + 请求授权KEY + + + + + 请求操作类型 + + + + + 海运订舱请求规则引擎 + + 海运订舱请求业务 + 返回用户信息 + + + + 请求规则平台 + + + + + + + + + + 海运订舱请求规则引擎 + + 海运订舱请求业务 + 返回用户信息 + + + + 请求规则平台 + + + + diff --git a/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs b/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs new file mode 100644 index 00000000..06fc57d6 --- /dev/null +++ b/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs @@ -0,0 +1,645 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + public class RulesEngineOrderBookingMainInfo + { + /// + /// 项目代码(可以填多个,主要是标识要进行的规则过滤) + /// + /// ["OCEAN_BOOKING","OCEAN_BOOKING2"] + [Required(ErrorMessage = "必填")] + public string[] ProjectCode { get; set; } + /// + /// 业务对象 + /// + /// "object" + public RulesEngineOrderBookingMainBusinessInfo BusinessInfo { get; set; } + + /// + /// 是否返回成功验证的明细(默认只返回失败的明细) + /// + public bool IsIncludeSucc { get; set; } = false; + } + + + public class RulesEngineOrderBookingMainBusinessInfo + { + /// + /// 主提单号 + /// + public string MasterBlNo { get; set; } + /// + /// 分提单号 + /// + public string HouseBlNo { get; set; } + /// + /// 订舱编号 + /// + public string BookingNo { get; set; } + /// + /// 合约号 + /// + public string ContrNo { get; set; } + /// + /// 客户合同号 + /// + public string ServContrNo { get; set; } + + /// + /// 发货人代码 + /// + public string ShipperId { get; set; } + /// + /// 收货人代码 + /// + public string ConsigneeId { get; set; } + /// + /// 通知人代码 + /// + public string NotifyPrtId { get; set; } + /// + /// 发货人 + /// + public string Shipper { get; set; } + /// + /// 收货人 + /// + public string Consignee { get; set; } + /// + /// 通知人 + /// + public string NotifyPrt { get; set; } + /// + /// 第二通知人 + /// + public string NotifyPrt2 { get; set; } + /// + /// 场站代码 + /// + public string YardId { get; set; } + /// + /// 场站名称 + /// + public string Yard { get; set; } + /// + /// 船舶呼号 + /// + public string VesselId { get; set; } + /// + /// 船名 + /// + public string Vessel { get; set; } + /// + /// 海关航次 + /// + public string Voyno { get; set; } + /// + /// 内部航次 + /// + public string VoynoIn { get; set; } + /// + /// 开船日期 + /// + public string ETD { get; set; } + /// + /// 实际开船日期 + /// + public string ATD { get; set; } + /// + /// 预计到港日期 + /// + public string ETA { get; set; } + /// + /// 截港日期 + /// + public string ClosingDate { get; set; } + /// + /// 截单日期 + /// + public string CloseDocDate { get; set; } + /// + /// 截VGM时间 + /// + public string CloseVGMDate { get; set; } + /// + /// 收货地代码 + /// + public string PlaceReceiptId { get; set; } + /// + /// 收货地 + /// + public string PlaceReceipt { get; set; } + /// + /// 起运港代码 + /// + public string PortLoadId { get; set; } + /// + /// 起运港 + /// + public string PortLoad { get; set; } + /// + /// 卸货港代码 + /// + public string PortDischargeId { get; set; } + /// + /// 卸货港 + /// + public string PortDischarge { get; set; } + /// + /// 交货地代码 + /// + public string PlaceDeliveryId { get; set; } + /// + /// 交货地 + /// + public string PlaceDelivery { get; set; } + /// + /// 目的地代码 + /// + public string DestinationId { get; set; } + /// + /// 目的地 + /// + public string Destination { get; set; } + /// + /// 提单份数 + /// + public string NoBill { get; set; } + /// + /// 副本提单份数 + /// + public string CopyNoBill { get; set; } + /// + /// 签单方式 1-Seaway 2-正本 3-电放 + /// + public string IssueType { get; set; } + /// + /// 签单日期 + /// + public string IssueDate { get; set; } + /// + /// 签单地点代码 + /// + public string IssuePlaceId { get; set; } + /// + /// 签单地点 + /// + public string IssuePlace { get; set; } + /// + /// 付费方式 + /// + public string Blfrt { get; set; } + /// + /// 预付地点 + /// + public string PrepardAt { get; set; } + /// + /// 到付地点 + /// + public string PayableAt { get; set; } + /// + /// 运输条款 + /// + public string Service { get; set; } + + /// + /// 唛头 + /// + public string Marks { get; set; } + /// + /// HS代码 + /// + public string HsCode { get; set; } + /// + /// 货描 + /// + public string GoodsDescription { get; set; } + /// + /// 件数 + /// + public Nullable PKGs { get; set; } + /// + /// 包装 + /// + public string KindPKGs { get; set; } + /// + /// 毛重 + /// + public Nullable KGs { get; set; } + /// + /// 尺码 + /// + public Nullable CBM { get; set; } + /// + /// 件数大写 + /// + public string TotalNO { get; set; } + /// + /// 集装箱 + /// + public string CntrTotal { get; set; } + /// + /// 船公司代号 + /// + public string CarrierId { get; set; } + /// + /// 船公司 + /// + public string Carrirer { get; set; } + /// + /// 货物标识 + /// + public string CargoId { get; set; } + /// + /// 危险品类别 + /// + public string DClass { get; set; } + /// + /// 危险品编号 + /// + public string DUnno { get; set; } + /// + /// 危险品页号 + /// + public string DPage { get; set; } + /// + /// 危险品标签 + /// + public string DLabel { get; set; } + /// + /// 危险品联系人 + /// + public string DLinkMan { get; set; } + /// + /// 温度单位 + /// + public string TempId { get; set; } + /// + /// 设置温度 + /// + public string TempSet { get; set; } + /// + /// 通风度 + /// + public string Reeferf { get; set; } + /// + /// 湿度 + /// + public string Humidity { get; set; } + /// + /// 最低温度 + /// + public string TempMin { get; set; } + /// + /// 最高温度 + /// + public string TempMax { get; set; } + /// + /// 是否SOC箱 + /// + public Nullable IsContaSOC { get; set; } + /// + /// SO备注 + /// + public string SORemark { get; set; } + /// + /// SI备注 + /// + public string SIRemark { get; set; } + /// + /// 场站备注 + /// + public string YardRemark { get; set; } + /// + /// 公司ID + /// + public string CompId { get; set; } + /// + /// 公司名称 + /// + public string CompName { get; set; } + /// + /// 发货人名称 + /// + public string ShipperName { get; set; } + /// + /// 发货人地址1 + /// + public string ShipperAddr1 { get; set; } + /// + /// 发货人地址2 + /// + public string ShipperAddr2 { get; set; } + /// + /// 发货人地址3 + /// + public string ShipperAddr3 { get; set; } + /// + /// 发货人城市 + /// + public string ShipperCity { get; set; } + /// + /// 发货人省份代码 + /// + public string ShipperProvice { get; set; } + /// + /// 发货人邮编 + /// + public string ShipperPostCode { get; set; } + /// + /// 发货人国家代码 + /// + public string ShipperCountry { get; set; } + /// + /// 发货人联系人 + /// + public string ShipperAttn { get; set; } + /// + /// 发货人电话 + /// + public string ShipperTel { get; set; } + /// + /// 发货人名称 + /// + public string ConsigneeName { get; set; } + /// + /// 发货人地址1 + /// + public string ConsigneeAddr1 { get; set; } + /// + /// 发货人地址2 + /// + public string ConsigneeAddr2 { get; set; } + /// + /// 发货人地址3 + /// + public string ConsigneeAddr3 { get; set; } + /// + /// 发货人城市 + /// + public string ConsigneeCity { get; set; } + /// + /// 发货人省份代码 + /// + public string ConsigneeProvince { get; set; } + /// + /// 发货人邮编 + /// + public string ConsigneePostCode { get; set; } + /// + /// 发货人国家代码 + /// + public string ConsigneeCountry { get; set; } + /// + /// 发货人联系人 + /// + public string ConsigneeAttn { get; set; } + /// + /// 发货人电话 + /// + public string ConsigneeTel { get; set; } + /// + /// 通知人名称 + /// + public string NotifyPartyName { get; set; } + /// + /// 通知人地址1 + /// + public string NotifyPartyAddr1 { get; set; } + /// + /// 通知人地址2 + /// + public string NotifyPartyAddr2 { get; set; } + /// + /// 通知人地址3 + /// + public string NotifyPartyAddr3 { get; set; } + /// + /// 通知人城市 + /// + public string NotifyPartyCity { get; set; } + /// + /// 通知人省份代码 + /// + public string NotifyPartyProvince { get; set; } + /// + /// 通知人邮编 + /// + public string NotifyPartyPostCode { get; set; } + /// + /// 通知人国家代码 + /// + public string NotifyPartyCountry { get; set; } + /// + /// 通知人联系人 + /// + public string NotifyPartyAttn { get; set; } + /// + /// 通知人电话 + /// + public string NotifyPartyTel { get; set; } + /// + /// PO号 + /// + public string PONo { get; set; } + /// + /// 操作id + /// + public string OPID { get; set; } + /// + /// 单证id + /// + public string DOCID { get; set; } + /// + /// 操作 + /// + public string OP { get; set; } + /// + /// 单证 + /// + public string Doc { get; set; } + /// + /// 销售ID + /// + public string SaleId { get; set; } + /// + /// 销售 + /// + public string Sale { get; set; } + /// + /// 客服ID + /// + public string CustserviceId { get; set; } + /// + /// 客服 + /// + public string Custservice{ get; set; } + /// + /// 客户 + /// + public string CustserviceName { get; set; } + /// + /// 订舱代理 + /// + public string Forwarder { get; set; } + /// + /// 船代 + /// + public string ShipAgency { get; set; } + /// + /// 报关行 + /// + public string CustomsER { get; set; } + /// + /// 车队 + /// + public string TruckER { get; set; } + /// + /// 国外代理 + /// + public string AgentId { get; set; } + /// + /// 客户ID + /// + public Nullable CustomerId { get; set; } + /// + /// 订舱代理ID + /// + public string ForwarderId { get; set; } + /// + /// 船代ID + /// + public string ShipAgencyId { get; set; } + /// + /// 报关行ID + /// + public string CustomsERId { get; set; } + /// + /// 车队ID + /// + public string TruckERId { get; set; } + /// + /// 国外代理名称 + /// + public string AgentName { get; set; } + /// + /// 委托方 + /// + public string WeiTo { get; set; } + /// + /// 收货人DOOR地址 + /// + public string ConsigneeDoorAddr { get; set; } + /// + /// 发货人DOOR地址 + /// + public string ShipperDoorAddr { get; set; } + /// + /// SCAC代码 + /// + public string SCACCode { get; set; } + /// + /// ITN编号 + /// + public string ITNCode { get; set; } + /// + /// 预付地点ID + /// + public string PrePardAtId { get; set; } + /// + /// 到付地点ID + /// + public string PayableAtId { get; set; } + /// + /// 客户系统编号 + /// + public string CustNo { get; set; } + /// + /// 中转港代码 + /// + public string TransportId { get; set; } + /// + /// 中转港 + /// + public string Transport { get; set; } + /// + /// 第三付款地 + /// + public string ThirdPayAddr { get; set; } + /// + /// 场站联系人电话 + /// + public string YardContractTel { get; set; } + /// + /// 场站联系人邮箱 + /// + public string YardContractEmail { get; set; } + /// + /// 费用自结 + /// + public Nullable FeeSelf { get; set; } + /// + /// 航线代码 + /// + public string LaneCode { get; set; } + /// + /// 航线名称 + /// + public string LaneName { get; set; } + /// + /// 付款方 + /// + public string FreightPayer { get; set; } + + /// + /// 发货人税号 + /// + public string ShipperTaxNo { get; set; } + + /// + /// 收货人税号 + /// + public string ConsigneeTaxNo { get; set; } + + /// + /// 通知人税号 + /// + public string NotifyPartyTaxNo { get; set; } + + /// + /// 是否船开后变更签单方式 1-是 0-否 + /// + public Nullable IsATDChangeIssueType { get; set; } + + /// + /// 是否条形中英文章 + /// + public Nullable IsEngChinaLineBar { get; set; } + + /// + /// 是否双Shipper + /// + public Nullable IsDoubleShipper { get; set; } + + /// + /// 是否整箱和拼箱混合 + /// + public Nullable IsFCLAndLCLMix { get; set; } + + /// + /// 是否多品名 + /// + public Nullable IsMutipleGoods { get; set; } + + /// + /// 是否拼箱 + /// + public Nullable IsContaLCL { get; set; } + } +} diff --git a/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMessageInfo.cs b/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMessageInfo.cs new file mode 100644 index 00000000..2f3bdb81 --- /dev/null +++ b/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMessageInfo.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + /// + /// 海运订舱规则请求报文 + /// + public class RulesEngineOrderBookingMessageInfo + { + /// + /// 表头 + /// + public RulesEngineWebAPIHeadBase Head { get; set; } + + /// + /// 表体 + /// + public RulesEngineOrderBookingMainInfo Main { get; set; } + } +} diff --git a/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineWebApiResult.cs b/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineWebApiResult.cs new file mode 100644 index 00000000..4b0ed00c --- /dev/null +++ b/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineWebApiResult.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + public class RulesEngineWebApiResult + { + /// + /// 是否成功 true=成功 false=失败 + /// + public bool succ { get; set; } = false; + /// + /// 状态 0-成功 + /// + public int status { get; set; } = 0; + + /// + /// 返回消息 + /// + public string msg { get; set; } + + /// + /// 总记录数 + /// + public int total { get; set; } + + /// + /// 当前页列表数据 + /// + public object rows { get; set; } + + /// + /// 合计信息 + /// + public object summary { get; set; } + + /// + /// 扩展信息 + /// + public object extra { get; set; } + + /// + /// 扩展信息2 + /// + public object extra2 { get; set; } + } +} diff --git a/Myshipping.Application/Service/RulesEngine/Dtos/RulesEngineWebAPIHeadBase.cs b/Myshipping.Application/Service/RulesEngine/Dtos/RulesEngineWebAPIHeadBase.cs new file mode 100644 index 00000000..517d52e0 --- /dev/null +++ b/Myshipping.Application/Service/RulesEngine/Dtos/RulesEngineWebAPIHeadBase.cs @@ -0,0 +1,81 @@ +using Furion.DistributedIDGenerator; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + /// + /// 规则平台请求报文头(HEAD) + /// + public class RulesEngineWebAPIHeadBase + { + /// + /// 报文惟一主键 + /// + public string GID { get; set; } = IDGen.NextID().ToString(); + + /// + /// 报文类型 BUSI_RULE-业务规则校验 + /// + [Required(ErrorMessage = "必填")] + public string MessageType { get; set; } + + /// + /// 发送方代码 + /// + [Required(ErrorMessage = "必填")] + public string SenderId { get; set; } + + /// + /// 发送方名称 + /// + [Required(ErrorMessage = "必填")] + public string SenderName { get; set; } + + /// + /// 接收方代码 + /// + [Required(ErrorMessage = "必填")] + public string ReceiverId { get; set; } + + /// + /// 接收方名称 + /// + [Required(ErrorMessage = "必填")] + public string ReceiverName { get; set; } + + /// + /// 请求方登录TOKEN(可以是真实的登录人TOKEN或者是服务模拟登录人TOKEN) + /// + public string Token { get; set; } + + /// + /// 版本号 默认1.0 + /// + [Required(ErrorMessage = "必填")] + public string Version { get; set; } = "1.0"; + + /// + /// 请求时间 + /// + public string RequestDate { get; set; } + + /// + /// 请求授权KEY + /// + public string SenderKey { get; set; } + + /// + /// 请求操作类型 + /// + [Required(ErrorMessage = "必填")] + public string RequestAction { get; set; } = "Add"; + + + + } +} diff --git a/Myshipping.Application/Service/RulesEngine/Interface/IRulesEngineClientService.cs b/Myshipping.Application/Service/RulesEngine/Interface/IRulesEngineClientService.cs new file mode 100644 index 00000000..70571110 --- /dev/null +++ b/Myshipping.Application/Service/RulesEngine/Interface/IRulesEngineClientService.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + public interface IRulesEngineClientService + { + /// + /// 海运订舱请求规则引擎 + /// + /// 海运订舱请求业务 + /// 返回用户信息 + Task ExcuteRulesEngineOceanBooking(RulesEngineOrderBookingMessageInfo model); + } +} diff --git a/Myshipping.Application/Service/RulesEngine/RulesEngineClientService.cs b/Myshipping.Application/Service/RulesEngine/RulesEngineClientService.cs new file mode 100644 index 00000000..574a5715 --- /dev/null +++ b/Myshipping.Application/Service/RulesEngine/RulesEngineClientService.cs @@ -0,0 +1,87 @@ +using Furion.FriendlyException; +using Furion.JsonSerialization; +using Furion; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using Furion.RemoteRequest.Extensions; +using Furion.DependencyInjection; +using Microsoft.AspNetCore.Mvc; +using System.Xml.Linq; +using Furion.DynamicApiController; +using Microsoft.AspNetCore.Authorization; + +namespace Myshipping.Application +{ + /// + /// 请求规则平台 + /// + public class RulesEngineClientService: IRulesEngineClientService, IDynamicApiController, ITransient + { + /// + /// + /// + public RulesEngineClientService() + { + + } + + /// + /// 海运订舱请求规则引擎 + /// + /// 海运订舱请求业务 + /// 返回用户信息 + [AllowAnonymous] + [ApiDescriptionSettings("Application", Name = "ExcuteRulesEngineOceanBooking", Order = 1)] + [HttpPost] + + public async Task ExcuteRulesEngineOceanBooking(RulesEngineOrderBookingMessageInfo model) + { + return await ExcuteRulesEngine(model); + } + + /// + /// 请求规则平台 + /// + /// + /// + private async Task ExcuteRulesEngine(RulesEngineOrderBookingMessageInfo info) + { + RulesEngineWebApiResult model = null; + /* + 1、读取配置文件中的规则引擎URL + 2、填充请求的类,并生成JSON报文 + 3、POST请求接口,并记录回执。 + 4、返回信息。 + */ + + var url = App.Configuration["RulesEngineUrl"]; + + try + { + var res = await url.SetHttpMethod(HttpMethod.Post) + .SetBody(JSON.Serialize(info), "application/json") + .SetContentEncoding(Encoding.UTF8) + .PostAsync(); + + if (res.StatusCode == System.Net.HttpStatusCode.OK) + { + var userResult = await res.Content.ReadAsStringAsync(); + + model = JSON.Deserialize(userResult); + } + } + catch (Exception ex) + { + //写日志 + if (ex is HttpRequestException) + throw Oops.Oh(10000002); + } + + return model; + } + } +} diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index c913ecec..fb67b97e 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -1589,7 +1589,7 @@ 租户id - + 参数 @@ -7303,6 +7303,36 @@ + + + 删除租户参数类别表 + + + + + + 获取参数 + + + + + + 增加参数 + + + + + + 更新参数 + + + + + + 删除租户参数类别表 + + + 租户参数类别表输出参数 diff --git a/Myshipping.Web.Core/applicationconfig.json b/Myshipping.Web.Core/applicationconfig.json index 02d47d34..bfff3fca 100644 --- a/Myshipping.Web.Core/applicationconfig.json +++ b/Myshipping.Web.Core/applicationconfig.json @@ -104,6 +104,10 @@ "path": "Upload/Default", "maxSize": 41943040, "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", + "RulesEngineAuthKey": "clova3dXNnBldkM4bzVyUkxNcjVIS0lhUTNja2xmRVI4SDZDMkIzRURBMitKamJPb0tIRkMxemF5VlZOQ0wxUDdNeGNuTzF1NnEyOS9FS1VpeDBDZWFya0VucFR4ZE1Ca1JaUXZVb3lhdGs9", + "RulesEngineSender": "NewOceanBooking", + "RulesEngineProjects": "OCEAN_BOOKING" } } \ No newline at end of file