对接大简云规则引擎及OCR接口修改

usertest
ZR20090193-陈敬勇 5 months ago
parent 23ab3a1c9a
commit f48469da64

@ -437,6 +437,9 @@ public static class MultiLanguageConst
[Description("请先选择场站!")]
public const string SeaExportYardCheck = "Sea_Export_Yard_Check";
[Description("海运出口规则引擎校验完成!")]
public const string SeaExportRuleEngineFinished = "Sea_Export_RuleEngine_Finished";
[Description("海运出口存在费用信息")]
public const string SeaExportFeeExist = "Sea_Export_Fee_Exist";

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DS.Module.Core\DS.Module.Core.csproj" />
<ProjectReference Include="..\DS.Module.Nuget\DS.Module.Nuget.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.DjyRulesEngine
{
public interface IRuleEngineService
{
/// <summary>
/// 执行海运出口规则引擎校验
/// </summary>
/// <param name="req">修改服务状态详情</param>
/// <returns>返回回执</returns>
public Task<RuleEngineResult> ExcuteRulesOceanBooking(RuleEngineReq req);
}
}

@ -0,0 +1,261 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Security;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.DjyRulesEngine
{
/// <summary>
/// 大简云规则引擎服务封装请求工具类
/// </summary>
public class RuleEngineHttpUtil
{
/// 平台ip
/// </summary>
private static string _ip;
/// <summary>
/// 平台端口
/// </summary>
private static int _port = 443;
/// <summary>
/// 平台APPKey
/// </summary>
private static string _appkey;
/// <summary>
/// 平台APPSecret
/// </summary>
private static string _secret;
/// <summary>
/// 是否使用HTTPS协议
/// </summary>
private static bool _isHttps = true;
/// <summary>
/// 设置信息参数
/// </summary>
/// <param name="appkey">合作方APPKey</param>
/// <param name="secret">合作方APPSecret</param>
/// <param name="ip">平台IP</param>
/// <param name="port">平台端口默认HTTPS的443端口</param>
/// <param name="isHttps">是否启用HTTPS协议默认HTTPS</param>
/// <return></return> string appkey, string secret,
public static void SetPlatformInfo(string ip, int port = 443, bool isHttps = true)
{
//_appkey = appkey;
//_secret = secret;
_ip = ip;
_port = port;
_isHttps = isHttps;
// 设置并发数如不设置默认为2
ServicePointManager.DefaultConnectionLimit = 512;
}
/// <summary>
/// HTTP GET请求
/// </summary>
/// <param name="uri">HTTP接口Url不带协议和端口如/artemis/api/resource/v1/cameras/indexCode?cameraIndexCode=a10cafaa777c49a5af92c165c95970e0</param>
/// <param name="timeout">请求超时时间,单位:秒</param>
/// <returns></returns>
public static string HttpGet(string uri, int timeout)
{
Dictionary<string, string> header = new Dictionary<string, string>();
// 初始化请求:组装请求头,设置远程证书自动验证通过
initRequest(header, uri, "", false);
// build web request object
StringBuilder sb = new StringBuilder();
sb.Append(_isHttps ? "https://" : "http://").Append(_ip).Append(":").Append(_port.ToString()).Append(uri);
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(sb.ToString());
req.KeepAlive = false;
req.ProtocolVersion = HttpVersion.Version11;
req.AllowAutoRedirect = false; // 不允许自动重定向
req.Method = "GET";
req.Timeout = timeout * 1000; // 传入是秒,需要转换成毫秒
req.Accept = header["Accept"];
req.ContentType = header["Content-Type"];
foreach (string headerKey in header.Keys)
{
if (headerKey.Contains("USER_KEY"))
{
req.Headers.Add(headerKey + ":" + header[headerKey]);
}
if (headerKey.Contains("USER_SECRET"))
{
req.Headers.Add(headerKey + ":" + header[headerKey]);
}
//if (headerKey.Contains("sign"))
//{
// req.Headers.Add(headerKey + ":" + header[headerKey]);
//}
}
HttpWebResponse rsp = null;
try
{
rsp = (HttpWebResponse)req.GetResponse();
if (HttpStatusCode.OK == rsp.StatusCode)
{
Stream rspStream = rsp.GetResponseStream(); // 响应内容字节流
StreamReader sr = new StreamReader(rspStream);
string strStream = sr.ReadToEnd();
long streamLength = strStream.Length;
byte[] response = System.Text.Encoding.UTF8.GetBytes(strStream);
rsp.Close();
return System.Text.Encoding.UTF8.GetString(response);
}
else if (HttpStatusCode.Found == rsp.StatusCode || HttpStatusCode.Moved == rsp.StatusCode) // 302/301 redirect
{
string reqUrl = rsp.Headers["Location"].ToString(); // 获取重定向URL
WebRequest wreq = WebRequest.Create(reqUrl); // 重定向请求对象
WebResponse wrsp = wreq.GetResponse(); // 重定向响应
long streamLength = wrsp.ContentLength; // 重定向响应内容长度
Stream rspStream = wrsp.GetResponseStream(); // 响应内容字节流
byte[] response = new byte[streamLength];
rspStream.Read(response, 0, (int)streamLength); // 读取响应内容至byte数组
rspStream.Close();
rsp.Close();
return System.Text.Encoding.UTF8.GetString(response);
}
rsp.Close();
}
catch (WebException e)
{
if (rsp != null)
{
rsp.Close();
}
}
return null;
}
/// <summary>
/// HTTP Post请求
/// </summary>
/// <param name="uri">HTTP接口Url不带协议和端口如/artemis/api/resource/v1/org/advance/orgList</param>
/// <param name="body">请求参数</param>
/// <param name="timeout">请求超时时间,单位:秒</param>
/// <return>请求结果</return>
public static string HttpPost(string uri, string body, int timeout)
{
Dictionary<string, string> header = new Dictionary<string, string>();
// 初始化请求:组装请求头,设置远程证书自动验证通过
initRequest(header, uri, body, true);
// build web request object
StringBuilder sb = new StringBuilder();
sb.Append(_isHttps ? "https://" : "http://").Append(_ip).Append(":").Append(_port.ToString()).Append(uri);
// 创建POST请求
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(sb.ToString());
req.KeepAlive = false;
req.ProtocolVersion = HttpVersion.Version11;
req.AllowAutoRedirect = false; // 不允许自动重定向
req.Method = "POST";
req.Timeout = timeout * 1000; // 传入是秒,需要转换成毫秒
req.Accept = header["Accept"];
req.ContentType = header["Content-Type"];
req.UserAgent = "PostmanRuntime/7.26.8";
foreach (string headerKey in header.Keys)
{
if (headerKey.Contains("USER_KEY"))
{
req.Headers.Add(headerKey + ":" + header[headerKey]);
}
if (headerKey.Contains("USER_SECRET"))
{
req.Headers.Add(headerKey + ":" + header[headerKey]);
}
//if (headerKey.Contains("sign"))
//{
// req.Headers.Add(headerKey + ":" + header[headerKey]);
//}
}
byte[] data = Encoding.UTF8.GetBytes(body);
req.ContentLength = data.Length;
using (Stream reqStream = req.GetRequestStream())
{
reqStream.Write(data, 0, data.Length);
reqStream.Close();
}
HttpWebResponse response = (HttpWebResponse)req.GetResponse();
Stream stream = response.GetResponseStream();
Encoding encode = Encoding.UTF8;
StreamReader reader = new StreamReader(stream, encode);
string content = reader.ReadToEnd();
stream.Close();
reader.Close();
return content;
}
/// <summary>
/// 远程证书验证
/// </summary>
/// <param name="sender"></param>
/// <param name="cert"></param>
/// <param name="chain"></param>
/// <param name="error"></param>
/// <returns>验证是否通过,始终通过</returns>
private static bool remoteCertificateValidate(object sender, X509Certificate cert, X509Chain chain,
SslPolicyErrors error)
{
return true;
}
private static void initRequest(Dictionary<string, string> header, string url, string body, bool isPost)
{
// Accept
// string accept = "application/json"; // "*/*";
string accept = "*/*"; // "*/*";
header.Add("Accept", accept);
// ContentType
string contentType = "application/json";
header.Add("Content-Type", contentType);
//// appId
//header.Add("USER_KEY", _appkey);
//// appId
//header.Add("USER_SECRET", _secret);
//var timestamp = DateTime.Now.DateToTimeStamp();
//// build string to sign
//string signedStr = MD5Helper.Md5EncryptLowerCase(timestamp + _secret);
//// timestamp
//header.Add("timestamp", DateTime.Now.DateToTimeStamp());
//// sign
//header.Add("sign", signedStr);
if (_isHttps)
{
// set remote certificate Validation auto pass
ServicePointManager.ServerCertificateValidationCallback =
new System.Net.Security.RemoteCertificateValidationCallback(remoteCertificateValidate);
// FIX修复不同.Net版对一些SecurityProtocolType枚举支持情况不一致导致编译失败等问题这里统一使用数值
// ServicePointManager.SecurityProtocol = (SecurityProtocolType)48 | (SecurityProtocolType)3072 |
// (SecurityProtocolType)768 | (SecurityProtocolType)192 ;
// ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
}
}
}
}

@ -0,0 +1,27 @@
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.DjyRulesEngine
{
/// <summary>
/// 注入大简云规则引擎服务
/// </summary>
public static class RuleEngineModuleInstall
{
/// <summary>
///
/// </summary>
/// <param name="services"></param>
/// <exception cref="ArgumentNullException"></exception>
public static void AddRuleEngineModuleInstall(this IServiceCollection services)
{
if (services == null) throw new ArgumentNullException(nameof(services));
services.AddScoped<IRuleEngineService, RuleEngineService>();
}
}
}

@ -0,0 +1,113 @@
using DS.Module.Core.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.DjyRulesEngine
{
/// <summary>
/// 规则引擎封装请求
/// </summary>
public class RuleEngineReq
{
/// <summary>
/// 请求报文表头head
/// </summary>
public HeadInfo Head { get; set; }
/// <summary>
/// 请求报文表体main
/// </summary>
public MainInfo Main { get; set; }
public RuleEngineReq()
{
Head = new HeadInfo();
Main = new MainInfo();
}
}
public class HeadInfo {
public HeadInfo()
{
GID = DateTime.Now.DateToTimeStamp();
MessageType = "SHIP_ORDER_COMPARE";
SenderId = "Dongsheng8";
SenderName = "东胜8平台";
ReceiverId = "RulesEngine";
ReceiverName = "大简云规则引擎";
Version = "1.0";
RequestDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
RequestAction = "Compare";
}
/// <summary>
/// 报文惟一主键
/// </summary>
public string GID { get; set; } = DateTime.Now.DateToTimeStamp();
/// <summary>
/// 报文类型
/// </summary>
public string MessageType { get; set; } = "SHIP_ORDER_COMPARE";
/// <summary>
/// 发送方代码
/// </summary>
public string SenderId { get; set; } = "Dongsheng8";
/// <summary>
/// 发送方名称
/// </summary>
public string SenderName { get; set; } = "东胜8平台";
/// <summary>
/// 接收方代码
/// </summary>
public string ReceiverId { get; set; } = "RulesEngine";
/// <summary>
/// 接收方名称 大简云规则引擎
/// </summary>
public string ReceiverName { get; set; } = "大简云规则引擎";
/// <summary>
/// 请求方登录TOKEN
/// </summary>
public string Token { get; set; } = "";
/// <summary>
/// 版本号
/// </summary>
public string Version { get; set; } = "1.0";
/// <summary>
/// 请求时间
/// </summary>
public string RequestDate { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
/// <summary>
/// 请求操作类型
/// </summary>
public string RequestAction { get; set; } = "Compare";
/// <summary>
/// 请求授权KEY
/// </summary>
public string SenderKey { get; set; }
}
public class MainInfo
{
public MainInfo() {
ProjectCode = [ "OCEAN_BOOKING" ];
BusinessInfo = new RulesEngineOrderBookingMainBusinessInfo();
}
/// <summary>
/// 项目代码 项目代码可以传多个具体按照业务分类来定义默认传OCEAN_BOOKING
/// </summary>
public string[] ProjectCode { get; set; } = { "OCEAN_BOOKING" };
/// <summary>
/// 请求报文表体的海运主业务信息main.businessInfo
/// </summary>
public RulesEngineOrderBookingMainBusinessInfo BusinessInfo { get; set; }
}
}

@ -0,0 +1,114 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.DjyRulesEngine
{
/// <summary>
/// 请求结果
/// </summary>
public class RuleEngineResult
{
/// <summary>
/// 是否成功 true=成功 false=失败
/// </summary>
public string Succ { get; set; }
/// <summary>
/// 状态 0-成功
/// </summary>
public int Status { get; set; }
/// <summary>
/// 返回消息
/// </summary>
public string Msg { get; set; }
/// <summary>
/// 总记录数
/// </summary>
public int Total { get; set; }
/// <summary>
/// 当前页列表数据
/// </summary>
public string Rows { get; set; }
/// <summary>
/// 合计信息
/// </summary>
public string Summary { get; set; }
/// <summary>
/// 回执详情
/// </summary>
public Extra Extra { get; set; }
/// <summary>
///
/// </summary>
public string extra2 { get; set; }
/// <summary>
///
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
public static RuleEngineResult Failed(string message)
{
return new RuleEngineResult()
{
Succ = "false",
Msg = message
};
}
}
/// <summary>
/// 请求结果 extra详情
/// </summary>
public class Extra
{
/// <summary>
/// 是否成功 true=成功 false=失败
/// </summary>
public string IsSuccess { get; set; }
/// <summary>
/// 请求报文HEAD的GID
/// </summary>
public string RequestId { get; set; }
/// <summary>
/// 执行时间
/// </summary>
public string ExcuteDate { get; set; }
/// <summary>
/// 规则详情
/// </summary>
public List<DetailListItem> DetailList { get; set; }
}
/// <summary>
/// 请求结果 detailList详情
/// </summary>
public class DetailListItem
{
/// <summary>
/// 当前规则是否校验成功 true=成功 false=失败
/// </summary>
public string IsSuccess { get; set; }
/// <summary>
/// 返回代码
/// </summary>
public string ResultCode { get; set; }
/// <summary>
/// [返回校验说明
/// </summary>
public string ResultName { get; set; }
/// <summary>
/// 规则提醒类型
/// </summary>
public string ErrorType { get; set; }
/// <summary>
/// 规则名称
/// </summary>
public string RuleName { get; set; }
/// <summary>
/// 规则集名称
/// </summary>
public string WfName { get; set; }
}
}

@ -0,0 +1,63 @@
using DS.Module.Core;
using DS.Module.Core.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using NLog;
namespace DS.Module.DjyRulesEngine
{
/// <summary>
///
/// </summary>
public class RuleEngineService : IRuleEngineService
{
private readonly IServiceProvider _serviceProvider;
private readonly string ip;
private readonly int port;
private readonly string senderKey;
//private readonly string accessSecret;
private readonly string sendUrl;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
/// <summary>
/// 构造函数
/// </summary>
/// <param name="serviceProvider"></param>
public RuleEngineService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
ip = AppSetting.app(new string[] { "ExcuteRuleService", "IP" }).ObjToString();
port = AppSetting.app(new string[] { "ExcuteRuleService", "Port" }).ToInt();
senderKey = AppSetting.app(new string[] { "ExcuteRuleService", "SenderKey" }).ObjToString();
sendUrl = AppSetting.app(new string[] { "ExcuteRuleService", "SendUrl" }).ObjToString();
}
/// <summary>
/// 执行海运出口规则引擎校验
/// </summary>
/// <param name="req">修改服务状态详情</param>
/// <returns>返回回执</returns>
public async Task<RuleEngineResult> ExcuteRulesOceanBooking(RuleEngineReq req)
{
// 只要平台信息参数一致,多个请求只需设置一次参数
RuleEngineHttpUtil.SetPlatformInfo(ip, port, false);
// 发起POST请求超时时间15秒返回响应字节数组
string result = RuleEngineHttpUtil.HttpPost(sendUrl, JsonConvert.SerializeObject(req), 30);
if (null == result)
{
return await Task.FromResult(RuleEngineResult.Failed("请求失败,请联系管理员"));
}
else
{
var res = JsonConvert.DeserializeObject<RuleEngineResult>(result);
// Console.WriteLine(System.Text.Encoding.UTF8.GetString(result));
return await Task.FromResult(res);
}
}
}
}

@ -0,0 +1,797 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.DjyRulesEngine
{
/// <summary>
///
/// </summary>
public class RulesEngineOrderBookingMainBusinessInfo
{
/// <summary>
/// 主提单号
/// </summary>
public string MasterBlNo { get; set; }
/// <summary>
/// 分提单号
/// </summary>
public string HouseBlNo { get; set; }
/// <summary>
/// 订舱编号
/// </summary>
public string BookingNo { get; set; }
/// <summary>
/// 合约号
/// </summary>
public string ContrNo { get; set; }
/// <summary>
/// 客户合同号
/// </summary>
public string ServContrNo { get; set; }
/// <summary>
/// 发货人代码
/// </summary>
public string ShipperId { get; set; }
/// <summary>
/// 收货人代码
/// </summary>
public string ConsigneeId { get; set; }
/// <summary>
/// 通知人代码
/// </summary>
public string NotifyPartyId { get; set; }
/// <summary>
/// 发货人
/// </summary>
public string Shipper { get; set; }
/// <summary>
/// 收货人
/// </summary>
public string Consignee { get; set; }
/// <summary>
/// 通知人
/// </summary>
public string NotifyParty { get; set; }
/// <summary>
/// 第二通知人
/// </summary>
public string NotifyPrt2 { get; set; }
/// <summary>
/// 场站代码
/// </summary>
public string YardId { get; set; }
/// <summary>
/// 场站名称
/// </summary>
public string Yard { get; set; }
/// <summary>
/// 船舶呼号
/// </summary>
public string VesselId { get; set; }
/// <summary>
/// 船名
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 海关航次
/// </summary>
public string Voyno { get; set; }
/// <summary>
/// 内部航次
/// </summary>
public string VoynoIn { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public string ETD { get; set; }
/// <summary>
/// 实际开船日期
/// </summary>
public string ATD { get; set; }
/// <summary>
/// 预计到港日期
/// </summary>
public string ETA { get; set; }
/// <summary>
/// 截港日期
/// </summary>
public string ClosingDate { get; set; }
/// <summary>
/// 截单日期
/// </summary>
public string CloseDocDate { get; set; }
/// <summary>
/// 截VGM时间
/// </summary>
public string CloseVGMDate { get; set; }
/// <summary>
/// 收货地代码
/// </summary>
public string PlaceReceiptId { get; set; }
/// <summary>
/// 收货地
/// </summary>
public string PlaceReceipt { get; set; }
/// <summary>
/// 起运港代码
/// </summary>
public string PortLoadId { get; set; }
/// <summary>
/// 起运港
/// </summary>
public string PortLoad { get; set; }
/// <summary>
/// 卸货港代码
/// </summary>
public string PortDischargeId { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string PortDischarge { get; set; }
/// <summary>
/// 交货地代码
/// </summary>
public string PlaceDeliveryId { get; set; }
/// <summary>
/// 交货地
/// </summary>
public string PlaceDelivery { get; set; }
/// <summary>
/// 目的地代码
/// </summary>
public string DestinationId { get; set; }
/// <summary>
/// 目的地
/// </summary>
public string Destination { get; set; }
/// <summary>
/// 提单份数
/// </summary>
public string NoBill { get; set; }
/// <summary>
/// 副本提单份数
/// </summary>
public string CopyNoBill { get; set; }
/// <summary>
/// 签单方式 1-Seaway 2-正本 3-电放
/// </summary>
public string IssueType { get; set; }
/// <summary>
/// 签单日期
/// </summary>
public string IssueDate { get; set; }
/// <summary>
/// 签单地点代码
/// </summary>
public string IssuePlaceId { get; set; }
/// <summary>
/// 签单地点
/// </summary>
public string IssuePlace { get; set; }
/// <summary>
/// 付费方式
/// </summary>
public string Blfrt { get; set; }
/// <summary>
/// 预付地点
/// </summary>
public string PrepardAt { get; set; }
/// <summary>
/// 到付地点
/// </summary>
public string PayableAt { get; set; }
/// <summary>
/// 运输条款
/// </summary>
public string Service { get; set; }
/// <summary>
/// 唛头
/// </summary>
public string Marks { get; set; }
/// <summary>
/// HS代码
/// </summary>
public string HsCode { get; set; }
/// <summary>
/// 货描
/// </summary>
public string GoodsDescription { get; set; }
/// <summary>
/// 件数
/// </summary>
public Nullable<int> PKGs { get; set; }
/// <summary>
/// 包装
/// </summary>
public string KindPKGs { get; set; }
/// <summary>
/// 毛重
/// </summary>
public Nullable<decimal> KGs { get; set; }
/// <summary>
/// 尺码
/// </summary>
public Nullable<decimal> CBM { get; set; }
/// <summary>
/// 件数大写
/// </summary>
public string TotalNO { get; set; }
/// <summary>
/// 集装箱
/// </summary>
public string CntrTotal { get; set; }
/// <summary>
/// 船公司代号
/// </summary>
public string CarrierId { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 货物标识
/// </summary>
public string CargoId { get; set; }
/// <summary>
/// 危险品类别
/// </summary>
public string DClass { get; set; }
/// <summary>
/// 危险品编号
/// </summary>
public string DUnno { get; set; }
/// <summary>
/// 危险品页号
/// </summary>
public string DPage { get; set; }
/// <summary>
/// 危险品标签
/// </summary>
public string DLabel { get; set; }
/// <summary>
/// 危险品联系人
/// </summary>
public string DLinkMan { get; set; }
/// <summary>
/// 温度单位
/// </summary>
public string TempId { get; set; }
/// <summary>
/// 温度单位
/// </summary>
public string TempSet { get; set; }
/// <summary>
/// 通风度
/// </summary>
public string Reeferf { get; set; }
/// <summary>
/// 湿度
/// </summary>
public string Humidity { get; set; }
/// <summary>
/// 最低温度
/// </summary>
public string TempMin { get; set; }
/// <summary>
/// 最高温度
/// </summary>
public string TempMax { get; set; }
/// <summary>
/// 是否SOC箱
/// </summary>
public Nullable<bool> IsContaSOC { get; set; }
/// <summary>
/// SO备注
/// </summary>
public string SORemark { get; set; }
/// <summary>
/// SI备注
/// </summary>
public string SIRemark { get; set; }
/// <summary>
/// 场站备注
/// </summary>
public string YardRemark { get; set; }
/// <summary>
/// 公司ID
/// </summary>
public string CompId { get; set; }
/// <summary>
/// 公司名称
/// </summary>
public string CompName { get; set; }
/// <summary>
/// 发货人名称
/// </summary>
public string ShipperName { get; set; }
/// <summary>
/// 发货人地址1
/// </summary>
public string ShipperAddr1 { get; set; }
/// <summary>
/// 发货人地址2
/// </summary>
public string ShipperAddr2 { get; set; }
/// <summary>
/// 发货人地址3
/// </summary>
public string ShipperAddr3 { get; set; }
/// <summary>
/// 发货人城市
/// </summary>
public string ShipperCity { get; set; }
/// <summary>
/// 发货人省份代码
/// </summary>
public string ShipperProvice { get; set; }
/// <summary>
/// 发货人邮编
/// </summary>
public string ShipperPostCode { get; set; }
/// <summary>
/// 发货人国家代码
/// </summary>
public string ShipperCountry { get; set; }
/// <summary>
/// 发货人联系人
/// </summary>
public string ShipperAttn { get; set; }
/// <summary>
/// 发货人电话
/// </summary>
public string ShipperTel { get; set; }
/// <summary>
/// 收货人名称
/// </summary>
public string ConsigneeName { get; set; }
/// <summary>
/// 收货人地址1
/// </summary>
public string ConsigneeAddr1 { get; set; }
/// <summary>
/// 收货人地址2
/// </summary>
public string ConsigneeAddr2 { get; set; }
/// <summary>
/// 收货人地址3
/// </summary>
public string ConsigneeAddr3 { get; set; }
/// <summary>
/// 收货人城市
/// </summary>
public string ConsigneeCity { get; set; }
/// <summary>
/// 收货人省份代码
/// </summary>
public string ConsigneeProvince { get; set; }
/// <summary>
/// 收货人邮编
/// </summary>
public string ConsigneePostCode { get; set; }
/// <summary>
/// 收货人国家代码
/// </summary>
public string ConsigneeCountry { get; set; }
/// <summary>
/// 收货人联系人
/// </summary>
public string ConsigneeAttn { get; set; }
/// <summary>
/// 收货人电话
/// </summary>
public string ConsigneeTel { get; set; }
/// <summary>
/// 通知人名称
/// </summary>
public string NotifyPartyName { get; set; }
/// <summary>
/// 通知人地址1
/// </summary>
public string NotifyPartyAddr1 { get; set; }
/// <summary>
/// 通知人地址2
/// </summary>
public string NotifyPartyAddr2 { get; set; }
/// <summary>
/// 通知人地址3
/// </summary>
public string NotifyPartyAddr3 { get; set; }
/// <summary>
/// 通知人城市
/// </summary>
public string NotifyPartyCity { get; set; }
/// <summary>
/// 通知人省份代码
/// </summary>
public string NotifyPartyProvince { get; set; }
/// <summary>
/// 通知人邮编
/// </summary>
public string NotifyPartyPostCode { get; set; }
/// <summary>
/// 通知人国家代码
/// </summary>
public string NotifyPartyCountry { get; set; }
/// <summary>
/// 通知人联系人
/// </summary>
public string NotifyPartyAttn { get; set; }
/// <summary>
/// 通知人电话
/// </summary>
public string NotifyPartyTel { get; set; }
/// <summary>
/// PO号
/// </summary>
public string PONo { get; set; }
/// <summary>
/// 操作id
/// </summary>
public string OPID { get; set; }
/// <summary>
/// 单证id
/// </summary>
public string DOCID { get; set; }
/// <summary>
/// 操作
/// </summary>
public string OP { get; set; }
/// <summary>
/// 单证
/// </summary>
public string Doc { get; set; }
/// <summary>
/// 销售ID
/// </summary>
public string SaleId { get; set; }
/// <summary>
/// 销售
/// </summary>
public string Sale { get; set; }
/// <summary>
/// 客服ID
/// </summary>
public string CustserviceId { get; set; }
/// <summary>
/// 客服
/// </summary>
public string Custservice { get; set; }
/// <summary>
/// 客户
/// </summary>
public string CustserviceName { get; set; }
/// <summary>
/// 订舱代理
/// </summary>
public string Forwarder { get; set; }
/// <summary>
/// 船代
/// </summary>
public string ShipAgency { get; set; }
/// <summary>
/// 报关行
/// </summary>
public string CustomsER { get; set; }
/// <summary>
/// 车队
/// </summary>
public string TruckER { get; set; }
/// <summary>
/// 国外代理
/// </summary>
public string AgentId { get; set; }
/// <summary>
/// 客户ID
/// </summary>
public Nullable<long> CustomerId { get; set; }
/// <summary>
/// 订舱代理ID
/// </summary>
public string ForwarderId { get; set; }
/// <summary>
/// 船代ID
/// </summary>
public string ShipAgencyId { get; set; }
/// <summary>
/// 报关行ID
/// </summary>
public string CustomsERId { get; set; }
/// <summary>
/// 车队ID
/// </summary>
public string TruckERId { get; set; }
/// <summary>
/// 国外代理名称
/// </summary>
public string AgentName { get; set; }
/// <summary>
/// 委托方
/// </summary>
public string WeiTo { get; set; }
/// <summary>
/// 收货人DOOR地址
/// </summary>
public string ConsigneeDoorAddr { get; set; }
/// <summary>
/// 发货人DOOR地址
/// </summary>
public string ShipperDoorAddr { get; set; }
/// <summary>
/// SCAC代码
/// </summary>
public string SCACCode { get; set; }
/// <summary>
/// ITN编号
/// </summary>
public string ITNCode { get; set; }
/// <summary>
/// 预付地点ID
/// </summary>
public string PrePardAtId { get; set; }
/// <summary>
/// 到付地点ID
/// </summary>
public string PayableAtId { get; set; }
/// <summary>
/// 客户系统编号
/// </summary>
public string CustNo { get; set; }
/// <summary>
/// 中转港代码
/// </summary>
public string TransportId { get; set; }
/// <summary>
/// 中转港
/// </summary>
public string Transport { get; set; }
/// <summary>
/// 第三付款地
/// </summary>
public string ThirdPayAddr { get; set; }
/// <summary>
/// 场站联系人电话
/// </summary>
public string YardContractTel { get; set; }
/// <summary>
/// 场站联系人邮箱
/// </summary>
public string YardContractEmail { get; set; }
/// <summary>
/// 费用自结
/// </summary>
public Nullable<bool> FeeSelf { get; set; }
/// <summary>
/// 航线代码
/// </summary>
public string LaneCode { get; set; }
/// <summary>
/// 航线名称
/// </summary>
public string LaneName { get; set; }
/// <summary>
/// 付款方
/// </summary>
public string FreightPayer { get; set; }
/// <summary>
/// 发货人税号
/// </summary>
public string ShipperTaxNo { get; set; }
/// <summary>
/// 收货人税号
/// </summary>
public string ConsigneeTaxNo { get; set; }
/// <summary>
/// 通知人税号
/// </summary>
public string NotifyPartyTaxNo { get; set; }
/// <summary>
/// 是否船开后变更签单方式 1-是 0-否
/// </summary>
public Nullable<bool> IsATDChangeIssueType { get; set; }
/// <summary>
/// 是否条形中英文章
/// </summary>
public Nullable<bool> IsEngChinaLineBar { get; set; }
/// <summary>
/// 是否双Shipper
/// </summary>
public Nullable<bool> IsDoubleShipper { get; set; }
/// <summary>
/// 是否整箱和拼箱混合
/// </summary>
public Nullable<bool> IsFCLAndLCLMix { get; set; }
/// <summary>
/// 是否多品名
/// </summary>
public Nullable<bool> IsMutipleGoods { get; set; }
/// <summary>
/// 是否拼箱
/// </summary>
public Nullable<bool> IsContaLCL { get; set; }
/// <summary>
/// 卸货港国家代码
/// </summary>
public string PortDischargeCountryNo { get; set; }
/// <summary>
/// 卸货港国家英文
/// </summary>
public string PortDischargeEN { get; set; }
/// <summary>
/// 卸货港国家中文
/// </summary>
public string PortDischargeCN { get; set; }
/// <summary>
/// 中转港国家代码
/// </summary>
public string TransportCountryNo { get; set; }
/// <summary>
/// 中转港国家英文
/// </summary>
public string TransportEN { get; set; }
/// <summary>
/// 中转港国家中文
/// </summary>
public string TransportCN { get; set; }
/// <summary>
/// 箱信息
/// </summary>
public List<RulesEngineOrderBookingContaInfo> ContaList { get; set; }
}
/// <summary>
/// 集装箱信息
/// </summary>
public class RulesEngineOrderBookingContaInfo
{
/// <summary>
/// 箱型代码
/// </summary>
public string ContaType { get; set; }
/// <summary>
/// 箱型
/// </summary>
public string ContaTypeName { get; set; }
/// <summary>
/// TEU
/// </summary>
public Nullable<int> TEU { get; set; }
/// <summary>
/// 箱号
/// </summary>
public string ContaNo { get; set; }
/// <summary>
/// 封号
/// </summary>
public string SealNo { get; set; }
/// <summary>
/// 件数
/// </summary>
public Nullable<int> PKGs { get; set; }
/// <summary>
/// 包装
/// </summary>
public string KindPKGs { get; set; }
/// <summary>
/// 毛重
/// </summary>
public Nullable<decimal> KGs { get; set; }
/// <summary>
/// 尺码
/// </summary>
public Nullable<decimal> CBM { get; set; }
/// <summary>
/// 皮重
/// </summary>
public Nullable<decimal> TareWeight { get; set; }
/// <summary>
/// 箱状态
/// </summary>
public string ContaStatus { get; set; }
/// <summary>
/// 称重方式
/// </summary>
public string WeighType { get; set; }
/// <summary>
/// 称重重量
/// </summary>
public Nullable<decimal> WeighKGs { get; set; }
/// <summary>
/// 称重联系人
/// </summary>
public string WeighAttn { get; set; }
/// <summary>
/// VGM联系公司
/// </summary>
public string VGMConnCom { get; set; }
/// <summary>
/// VGM联系电话
/// </summary>
public string WeighTel { get; set; }
/// <summary>
/// 称重日期
/// </summary>
public string WeighDate { get; set; }
/// <summary>
/// VGM地址
/// </summary>
public string VGMAddr { get; set; }
/// <summary>
/// VGM邮箱
/// </summary>
public string VGMEmail { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 大小箱分类small-小箱 big-大箱)
/// </summary>
public string ContaCategory { get; set; }
/// <summary>
/// 货物明细
/// </summary>
public List<RulesEngineOrderBookingContaCargoInfo> CargoList { get; set; }
}
/// <summary>
/// 集装箱内货物信息
/// </summary>
public class RulesEngineOrderBookingContaCargoInfo
{
/// <summary>
/// 件数
/// </summary>
public Nullable<int> PKGs { get; set; }
/// <summary>
/// 包装
/// </summary>
public string KindPKGs { get; set; }
/// <summary>
/// 毛重
/// </summary>
public Nullable<decimal> KGs { get; set; }
/// <summary>
/// 尺码
/// </summary>
public Nullable<decimal> CBM { get; set; }
/// <summary>
/// HS编码
/// </summary>
public string HSCode { get; set; }
/// <summary>
/// 唛头
/// </summary>
public string Marks { get; set; }
/// <summary>
/// 货描
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -25,6 +25,7 @@
<ItemGroup>
<ProjectReference Include="..\DS.Module.Core\DS.Module.Core.csproj" />
<ProjectReference Include="..\DS.Module.DjyRulesEngine\DS.Module.DjyRulesEngine.csproj" />
<ProjectReference Include="..\DS.Module.DjyServiceStatus\DS.Module.DjyServiceStatus.csproj" />
<ProjectReference Include="..\DS.Module.Nuget\DS.Module.Nuget.csproj" />
<ProjectReference Include="..\DS.Module.PrintModule\DS.Module.PrintModule.csproj" />

@ -1,5 +1,6 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.DjyRulesEngine;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.EDI;
using Microsoft.AspNetCore.Http;
@ -160,4 +161,12 @@ public interface ISeaExportService
/// <param name="req"></param>
/// <returns></returns>
public Task<DataResult<string>> UploadOcrFile(IFormFile file, [FromForm] OpFileReq req);
/// <summary>
/// 海运出口规则引擎校验
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public Task<DataResult<RuleEngineResult>> ExcuteRuleEngine(string id);
}

@ -1817,7 +1817,7 @@ namespace DS.WMS.Core.Op.Method
/// <returns></returns>
public async Task<DataResult<string>> GetConfigData(string code)
{
var config = await db.Queryable<SysConfig>().Where(x => x.Code == code && x.Status == StatusEnum.Enable).FirstAsync();
var config = await db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == code && x.Status == StatusEnum.Enable).FirstAsync();
if (config.IsNull())
{
return await Task.FromResult(DataResult<string>.Failed("OCR接口地址未配置!"));

@ -37,18 +37,54 @@ namespace DS.WMS.Core.Op.Method
{
return await Task.FromResult(DataResult<string>.Failed("附件不存在!"));
}
// 先存库获取Id
var limitFiles = AppSetting.app<string>(new string[] { "FileSettings", "FileType" });
var originalFilename = file.FileName; // 文件原始名称
var fileSuffix = Path.GetExtension(file.FileName).ToLower(); // 文件后缀
if (!limitFiles.Contains(fileSuffix))
{
return await Task.FromResult(DataResult<string>.Failed("不允许的文件类型!"));
}
var basePath = AppSetting.app(new string[] { "FileSettings", "BasePath" });
var relativePath = AppSetting.app(new string[] { "FileSettings", "RelativePath" });
var dirAbs = string.Empty;
var fileRelaPath = string.Empty;
var fileAbsPath = string.Empty;
if (string.IsNullOrEmpty(basePath))
{
dirAbs = Path.Combine(_environment.WebRootPath, relativePath);
}
else
{
dirAbs = Path.Combine(basePath, relativePath);
}
if (!Directory.Exists(dirAbs))
Directory.CreateDirectory(dirAbs);
// 先存库获取Id
var id = SnowFlakeSingle.Instance.NextId();
var fileSaveName = $"{id}{fileSuffix}".ToLower();
fileRelaPath = Path.Combine(relativePath, fileSaveName).ToLower();
fileAbsPath = Path.Combine(dirAbs, fileSaveName).ToLower();
var newFile = new OpFile
{
Id = id,
//FileName = originalFilename,
FilePath = fileSaveName,
TypeCode = req.TypeCode,
TypeName = req.TypeName,
LinkId = req.LinkId,
LinkId = req.LinkId,
};
//await tenantDb.Insertable(newFile).ExecuteCommandAsync();
var originalFilename = file.FileName; // 文件原始名称
var fileSuffix = Path.GetExtension(file.FileName).ToLower(); // 文件后缀
using (var stream = File.Create(fileAbsPath))
{
await file.CopyToAsync(stream);
}
var config = await db.Queryable<SysConfig>().Where(x => x.Code == "ocr_api_url" && x.Status == StatusEnum.Enable).FirstAsync();
var config = await db.Queryable<SysConfig>().Filter(null,true).Where(x => x.Code == "ocr_api_url" && x.Status == StatusEnum.Enable).FirstAsync();
if (config.IsNull())
{
return await Task.FromResult(DataResult<string>.Failed("OCR接口地址未配置!"));

@ -0,0 +1,58 @@
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.DjyRulesEngine;
using DS.WMS.Core.Op.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Mapster;
namespace DS.WMS.Core.Op.Method
{
/// <summary>
/// 海运出口规则引擎接口
/// </summary>
public partial class SeaExportService
{
/// <summary>
/// 海运出口规则引擎校验
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task<DataResult<RuleEngineResult>> ExcuteRuleEngine(string id)
{
var SenderKey = AppSetting.app(new string[] { "ExcuteRuleService", "SenderKey" }).ObjToString();
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var info = tenantDb.Queryable<SeaExport>().Where(x => x.Id == long.Parse(id)).First();
if (info.IsNull())
return await Task.FromResult(DataResult<RuleEngineResult>.Failed("海运出口信息不存在!", MultiLanguageConst.SeaExportNotExist));
var mainInfo = info.Adapt<RulesEngineOrderBookingMainBusinessInfo>();
var ctnlist = new List<RulesEngineOrderBookingContaInfo>();
var ctns= tenantDb.Queryable<OpCtn>().Where(x => x.BSNO == id).ToList();
if (ctns.Count > 0)
{
ctns.Adapt(ctnlist);
mainInfo.ContaList = ctnlist;
}
var req = new RuleEngineReq();
//req.Head = new HeadInfo();
req.Head.SenderKey = SenderKey;
req.Main.BusinessInfo = mainInfo;
var res = await _ruleEngineService.ExcuteRulesOceanBooking(req);
return await Task.FromResult(DataResult<RuleEngineResult>.Success("海运出口规则引擎校验完成!", res, MultiLanguageConst.SeaExportRuleEngineFinished));
}
}
}

@ -2,6 +2,7 @@ using AngleSharp.Dom;
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.DjyRulesEngine;
using DS.Module.DjyServiceStatus;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
@ -35,7 +36,7 @@ public partial class SeaExportService : ISeaExportService
private readonly ISeaExportCommonService seaComService;
private readonly IWebHostEnvironment _environment;
private readonly IDjyServiceStatusService _djyServiceStatusService;
private readonly IRuleEngineService _ruleEngineService;
const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING";
const string CONST_MAPPING_MODULE_ROUTE = "BOOK_OR_CLOSING_RT";
const string CONST_MAPPING_MODULE_VOLTA = "BOOK_CLOSING_VOLTA";
@ -63,6 +64,7 @@ public partial class SeaExportService : ISeaExportService
//_printService = _serviceProvider.GetRequiredService<IPrintService>();
_djyServiceStatusService = _serviceProvider.GetRequiredService<IDjyServiceStatusService>();
_ruleEngineService = _serviceProvider.GetRequiredService<IRuleEngineService>();
#region 设置对象映射
TypeAdapterConfig<SeaExportEdi, SeaExportEDIBaseModel>
@ -199,6 +201,121 @@ public partial class SeaExportService : ISeaExportService
.Map(dto => dto.KGS, poco => poco.KGS)
.Map(dto => dto.CBM, poco => poco.CBM);
//.IgnoreNonMapped(true);//只映射Map指定的属性其他属性都排除;
//映射规则引擎
TypeAdapterConfig<SeaExport, RulesEngineOrderBookingMainBusinessInfo>
.NewConfig()
.Map(dto => dto.MasterBlNo, poco => poco.MBLNO)
.Map(dto => dto.HouseBlNo, poco => poco.HBLNO)
.Map(dto => dto.BookingNo, poco => poco.BookingNo)
.Map(dto => dto.ServContrNo, poco => poco.ServiceContractNo)
.Map(dto => dto.Shipper, poco => poco.Shipper)
.Map(dto => dto.ShipperId, poco => poco.ShipperId)
.Map(dto => dto.Consignee, poco => poco.Consignee)
.Map(dto => dto.ConsigneeId, poco => poco.ConsigneeId)
.Map(dto => dto.NotifyParty, poco => poco.NotifyParty)
.Map(dto => dto.NotifyPartyId, poco => poco.NotifyPartyId)
.Map(dto => dto.NotifyPrt2, poco => poco.SecondNotifyParty)
.Map(dto => dto.Yard, poco => poco.Yard)
.Map(dto => dto.YardId, poco => poco.YardId)
.Map(dto => dto.Vessel, poco => poco.Vessel)
.Map(dto => dto.VesselId, poco => poco.VesselId)
.Map(dto => dto.Voyno, poco => poco.Voyno)
.Map(dto => dto.VoynoIn, poco => poco.InnerVoyno)
.Map(dto => dto.ETD, poco => poco.ETD)
.Map(dto => dto.ATD, poco => poco.ATD)
.Map(dto => dto.ETA, poco => poco.ETA)
.Map(dto => dto.ClosingDate, poco => poco.ClosingDate)
.Map(dto => dto.CloseDocDate, poco => poco.CloseDocDate)
.Map(dto => dto.CloseVGMDate, poco => poco.CloseVgmDate)
.Map(dto => dto.PortLoad, poco => poco.LoadPort)
.Map(dto => dto.PortLoadId, poco => poco.LoadPortId)
.Map(dto => dto.PlaceReceipt, poco => poco.ReceiptPlace)
.Map(dto => dto.PlaceReceiptId, poco => poco.ReceiptPlaceId)
.Map(dto => dto.PortDischarge, poco => poco.DischargePort)
.Map(dto => dto.PortDischargeId, poco => poco.DischargePortId)
.Map(dto => dto.PlaceDelivery, poco => poco.DeliveryPlace)
.Map(dto => dto.PlaceDeliveryId, poco => poco.DeliveryPlaceId)
.Map(dto => dto.Destination, poco => poco.Destination)
.Map(dto => dto.DestinationId, poco => poco.DestinationId)
.Map(dto => dto.NoBill, poco => poco.NoBill)
.Map(dto => dto.CopyNoBill, poco => poco.CopyNoBill)
.Map(dto => dto.IssueType, poco => poco.IssueType)
.Map(dto => dto.IssueDate, poco => poco.IssueDate)
.Map(dto => dto.IssuePlace, poco => poco.IssuePlace)
.Map(dto => dto.Blfrt, poco => poco.MBLFrt)
.Map(dto => dto.PrepardAt, poco => poco.PrepareAt)
.Map(dto => dto.PayableAt, poco => poco.PayableAt)
.Map(dto => dto.Service, poco => poco.Service)
.Map(dto => dto.Marks, poco => poco.Marks)
.Map(dto => dto.HsCode, poco => poco.HSCode)
.Map(dto => dto.GoodsDescription, poco => poco.Description)
.Map(dto => dto.PKGs, poco => poco.PKGS)
.Map(dto => dto.KindPKGs, poco => poco.KindPkgs)
.Map(dto => dto.KGs, poco => poco.KGS)
.Map(dto => dto.CBM, poco => poco.CBM)
.Map(dto => dto.TotalNO, poco => poco.TotalNo)
.Map(dto => dto.CntrTotal, poco => poco.CntrTotal)
.Map(dto => dto.Carrier, poco => poco.Carrier)
//.Map(dto => dto.CarrierId, poco => poco.Carrier)
.Map(dto => dto.CargoId, poco => poco.CargoId)
.Map(dto => dto.DClass, poco => poco.DangerClass)
.Map(dto => dto.DUnno, poco => poco.DangerNo)
.Map(dto => dto.DPage, poco => poco.DangerPage)
.Map(dto => dto.DLabel, poco => poco.DangerLabel)
//.Map(dto => dto.DLinkMan, poco => poco.dan)
.Map(dto => dto.TempId, poco => poco.TemperatureUnit)
.Map(dto => dto.TempSet, poco => poco.TemperatureSet)
.Map(dto => dto.Reeferf, poco => poco.ReeferQuantity)
.Map(dto => dto.Humidity, poco => poco.Humidity)
.Map(dto => dto.TempMin, poco => poco.TemperatureMin)
.Map(dto => dto.TempMax, poco => poco.TemperatureMax)
.Map(dto => dto.IsContaSOC, poco => poco.IsContainerSoc)
.Map(dto => dto.YardRemark, poco => poco.YardRemark)
//.Map(dto => dto.CompId, poco => poco.OrgId.ToString())
//.Map(dto => dto.CompName, poco => poco.OrgId.ToString())
//.Map(dto => dto.CustserviceName, poco => poco.CustserviceName)
.Map(dto => dto.Forwarder, poco => poco.Forwarder)
.Map(dto => dto.ShipAgency, poco => poco.ShipAgency)
.Map(dto => dto.CustomsER, poco => poco.Customser)
.Map(dto => dto.TruckER, poco => poco.Trucker)
.Map(dto => dto.AgentId, poco => poco.AgentId)
.Map(dto => dto.CustomerId, poco => poco.CustomerId)
.Map(dto => dto.ForwarderId, poco => poco.ForwarderId)
.Map(dto => dto.ShipAgencyId, poco => poco.ShipAgencyId)
.Map(dto => dto.CustomsERId, poco => poco.CustomserId)
.Map(dto => dto.TruckERId, poco => poco.TruckerId)
//.Map(dto => dto.AgentName, poco => poco.Agent)
.Map(dto => dto.WeiTo, poco => poco.CustomerName)
//.Map(dto => dto.SCACCode, poco => poco.sca)
//.Map(dto => dto.ITNCode, poco => poco.it)
.Map(dto => dto.PrePardAtId, poco => poco.PrepareAtId)
//.Map(dto => dto.PayableAtId, poco => poco.pa)
.Map(dto => dto.CustNo, poco => poco.CustomNo)
.Map(dto => dto.TransportId, poco => poco.TransportCode)
.Map(dto => dto.Transport, poco => poco.Transport)
.Map(dto => dto.IsMutipleGoods, poco => poco.IsMoreGood);
TypeAdapterConfig<OpCtn, RulesEngineOrderBookingContaInfo>
.NewConfig()
.Map(dto => dto.ContaType, poco => poco.CtnCode)
.Map(dto => dto.ContaTypeName, poco => poco.CtnAll)
.Map(dto => dto.ContaNo, poco => poco.CntrNo)
.Map(dto => dto.TEU, poco => poco.TEU)
.Map(dto => dto.SealNo, poco => poco.SealNo)
.Map(dto => dto.PKGs, poco => poco.PKGS)
.Map(dto => dto.KindPKGs, poco => poco.KindPkgs)
.Map(dto => dto.KGs, poco => poco.KGS)
.Map(dto => dto.CBM, poco => poco.CBM)
.Map(dto => dto.TareWeight, poco => poco.TareWeight)
.Map(dto => dto.WeighKGs, poco => poco.WeightKGS)
.Map(dto => dto.WeighType, poco => poco.WeightType)
.Map(dto => dto.ContaStatus, poco => poco.CtnStatus)
;
#endregion 设置对象映射
}

@ -2,6 +2,7 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Helpers;
using DS.Module.DjyRulesEngine;
using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Info.Interface;
using DS.WMS.Core.Op.Dtos;
@ -13,6 +14,7 @@ using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using NPOI.XWPF.UserModel;
using Org.BouncyCastle.Ocsp;
using System.Net;
namespace DS.WMS.OpApi.Controllers;
@ -323,7 +325,7 @@ public class SeaExportController : ApiController
//var str = await $"{url}pdf/getRegionText?fileName={fileName}&scale={scale}&x={x}&y={y}&w={w}&h={h}"
//.PostAsStringAsync();
var str = RequestHelper.Post("",url);
var str = RequestHelper.Post("", postUrl);
return await Task.FromResult(DataResult<string>.Success(str)); ;
}
@ -351,7 +353,9 @@ public class SeaExportController : ApiController
}
var postUrl = $"{url}pdf/getCanvasImage?fileName={fileName}&scale={scale}";
byte[] byteArr = System.IO.File.ReadAllBytes(postUrl);
WebClient mywebclient = new WebClient();
byte[] byteArr = mywebclient.DownloadData(postUrl);
//byte[] byteArr = System.IO.File.ReadAllBytes(postUrl);
string mimeType = "application/octet-stream";
return new FileContentResult(byteArr, mimeType)
{
@ -359,4 +363,16 @@ public class SeaExportController : ApiController
};
}
/// <summary>
/// 海运出口规则引擎校验
/// </summary>
/// <param name="id">业务id</param>
/// <returns></returns>
[HttpGet]
[Route("ExcuteRuleEngine")]
public async Task<DataResult<RuleEngineResult>> ExcuteRuleEngine([FromQuery] string id)
{
return await _invokeService.ExcuteRuleEngine(id);
}
}

@ -12,6 +12,7 @@
<ItemGroup>
<ProjectReference Include="..\DS.Module.AutofacModule\DS.Module.AutofacModule.csproj" />
<ProjectReference Include="..\DS.Module.Core\DS.Module.Core.csproj" />
<ProjectReference Include="..\DS.Module.DjyRulesEngine\DS.Module.DjyRulesEngine.csproj" />
<ProjectReference Include="..\DS.Module.DjyServiceStatus\DS.Module.DjyServiceStatus.csproj" />
<ProjectReference Include="..\DS.Module.ExcelModule\DS.Module.ExcelModule.csproj" />
<ProjectReference Include="..\DS.Module.Jwt\DS.Module.Jwt.csproj" />

@ -14,6 +14,7 @@ using DS.Module.UserModule;
using NLog.Web;
using Swashbuckle.AspNetCore.SwaggerUI;
using DS.Module.PrintModule;
using DS.Module.DjyRulesEngine;
var builder = WebApplication.CreateBuilder(args);
var environment = builder.Environment.EnvironmentName;
@ -41,6 +42,7 @@ builder.Services.AddJwtInstall();
builder.Services.AddSaasDbInstall();//分库服务
builder.Services.AddMultiLanguageInstall();//多语言服务
builder.Services.AddDjyModuleInstall();//Djy服务
builder.Services.AddRuleEngineModuleInstall();//Djy¹æÔòÒýÇæУÑé·þÎñ
// builder.Services.AddEndpointsApiExplorer();
// builder.Services.AddSwaggerGen();

@ -79,5 +79,11 @@
"GetServiceStatusListUrl": "/EmbedProjectGoodsStatus/GetServiceStatusList",
"SaveServiceStatusUrl": "/EmbedProjectGoodsStatus/SaveServiceStatus",
"CancelServiceStatusUrl": "/EmbedProjectGoodsStatus/CancelServiceStatus"
},
"ExcuteRuleService": {
"IP": "47.104.73.97",
"Port": "7115",
"SenderKey": "SEFBZkh5V3R1TGxtdlBIcTF4QmNMWURCS08vb2EvTzVxS0F0eDFKdlgyS3lKVUx6K3JRRE94Q2kvcWZMRytZeWxyVkhLdk9hRGpzVStPamhIUXd5NU9FMjhFTktwUlZ2eThJZGlQd3p5dUk9",
"SendUrl": "/api/RulesEngineManage/ExcuteWorkFlow"
}
}

@ -51,7 +51,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.Module.CrawlerData", "DS
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.Module.DjyServiceStatus", "DS.Module.DjyServiceStatus\DS.Module.DjyServiceStatus.csproj", "{86AF9895-D98D-4BFD-BEB9-CE291A382426}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.WMS.CheckApi", "DS.WMS.CheckApi\DS.WMS.CheckApi.csproj", "{4EE319A5-22DC-43F8-BA3C-A34494B4BB8D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.WMS.CheckApi", "DS.WMS.CheckApi\DS.WMS.CheckApi.csproj", "{4EE319A5-22DC-43F8-BA3C-A34494B4BB8D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.DjyRulesEngine", "DS.Module.DjyRulesEngine\DS.Module.DjyRulesEngine.csproj", "{C3296BF4-9A02-4C7D-90C9-7BBFDAA4F1A1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -147,6 +149,10 @@ Global
{4EE319A5-22DC-43F8-BA3C-A34494B4BB8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4EE319A5-22DC-43F8-BA3C-A34494B4BB8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4EE319A5-22DC-43F8-BA3C-A34494B4BB8D}.Release|Any CPU.Build.0 = Release|Any CPU
{C3296BF4-9A02-4C7D-90C9-7BBFDAA4F1A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3296BF4-9A02-4C7D-90C9-7BBFDAA4F1A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3296BF4-9A02-4C7D-90C9-7BBFDAA4F1A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3296BF4-9A02-4C7D-90C9-7BBFDAA4F1A1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -174,6 +180,7 @@ Global
{AB3034D8-91F4-42A6-BFE9-497B238D65AD} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
{86AF9895-D98D-4BFD-BEB9-CE291A382426} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
{4EE319A5-22DC-43F8-BA3C-A34494B4BB8D} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4}
{C3296BF4-9A02-4C7D-90C9-7BBFDAA4F1A1} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {66115F23-94B4-43C0-838E-33B5CF77F788}

Loading…
Cancel
Save