大简云对接服务状态缓存

usertest
ZR20090193-陈敬勇 6 months ago
parent f223722add
commit 7e0de230a4

@ -0,0 +1,13 @@
<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" />
</ItemGroup>
</Project>

@ -0,0 +1,262 @@
using DS.Module.Core.Extensions;
using DS.Module.Core.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using static System.Net.Mime.MediaTypeNames;
namespace DS.Module.DjyServiceStatus
{
/// <summary>
/// 大简云服务封装请求工具类
/// </summary>
public class DjyHttpUtillib
{
/// 平台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>
public static void SetPlatformInfo(string appkey, string secret, 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("appId", _appkey);
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,99 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.DjyServiceStatus
{
public class DjyServiceStatusDtos
{
}
/// <summary>
/// 内嵌服务项目请求
/// </summary>
public class EmbedServiceProjectDto
{
/// <summary>
/// 业务主键
/// </summary>
public string BusinessId { get; set; }
/// <summary>
/// 服务项目代码
/// </summary>
public string[] ProjectCodes { get; set; }
/// <summary>
/// 状态操作类型 0-手工 1-自动
/// </summary>
public int OpertType { get; set; }
}
/// <summary>
/// 修改服务项目状态
/// </summary>
public class EmbedServiceProjectStatusDto
{
/// <summary>
/// 业务主键
/// </summary>
public string businessId { get; set; }
/// <summary>
/// 来源类型 0-人工 1-自动
/// </summary>
public int SourceType { get; set; } = 0;
/// <summary>
/// 服务项目状态明细
/// </summary>
public List<EmbedServiceProjectStatusDetailDto> StatusCodes { get; set; }
}
public class EmbedServiceProjectStatusDetailDto
{
/// <summary>
/// 状态代码
/// </summary>
public string StatusCode { get; set; }
/// <summary>
/// 人工设定状态完成时间
/// </summary>
public Nullable<DateTime> SetActDate { get; set; }
/// <summary>
/// 人工设定状态值(可传箱使天数)
/// </summary>
public string SetActVal { get; set; }
/// <summary>
/// 状态备注
/// </summary>
public string ActRemark { get; set; }
}
public class EmbedQueryServiceProjectWithStatus
{
/// <summary>
/// 业务主键(可为空,不为空时需要查询已触发的记录和未触发的记录,为空时只查询已启用的)
/// </summary>
public string BusinessId { get; set; }
/// <summary>
/// 0-查服务项目 1-查服务项目下的状态
/// </summary>
public int QueryType { get; set; }
/// <summary>
/// 服务项目代码组
/// </summary>
public string[] ProjectCodes { get; set; }
/// <summary>
/// 租户ID
/// </summary>
public long TenantId { get; set; }
}
}

@ -0,0 +1,191 @@
using DS.Module.Core;
using DS.Module.Core.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using NLog;
namespace DS.Module.DjyServiceStatus
{
/// <summary>
///
/// </summary>
public class DjyServiceStatusService: IDjyServiceStatusService
{
private readonly IServiceProvider _serviceProvider;
private readonly string ip;
private readonly int port;
private readonly string accessKey;
private readonly string accessSecret;
private readonly string saveServiceProjectUrl;
private readonly string cancelServiceProjectUrl;
private readonly string getServiceProjectListUrl;
private readonly string getServiceStatusListUrl;
private readonly string saveServiceStatusUrl;
private readonly string cancelServiceStatusUrl;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
/// <summary>
/// 构造函数
/// </summary>
/// <param name="serviceProvider"></param>
public DjyServiceStatusService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
ip = AppSetting.app(new string[] { "DjyService", "IP" }).ObjToString();
port = AppSetting.app(new string[] { "DjyService", "Port" }).ToInt();
accessKey = AppSetting.app(new string[] { "DjyService", "AccessKey" }).ObjToString();
accessSecret = AppSetting.app(new string[] { "DjyService", "AccessSecret" }).ObjToString();
saveServiceProjectUrl = AppSetting.app(new string[] { "DjyService", "SaveServiceProjectUrl" }).ObjToString();
cancelServiceProjectUrl = AppSetting.app(new string[] { "DjyService", "CancelServiceProjectUrl" }).ObjToString();
getServiceProjectListUrl = AppSetting.app(new string[] { "DjyService", "GetServiceProjectListUrl" }).ObjToString();
getServiceStatusListUrl = AppSetting.app(new string[] { "DjyService", "GetServiceStatusListUrl" }).ObjToString();
saveServiceStatusUrl = AppSetting.app(new string[] { "DjyService", "SaveServiceStatusUrl" }).ObjToString();
cancelServiceStatusUrl = AppSetting.app(new string[] { "DjyService", "CancelServiceStatusUrl" }).ObjToString();
}
/// <summary>
/// 保存服务状态
/// </summary>
/// <param name="req">修改服务状态详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> SaveServiceProject(EmbedServiceProjectDto req)
{
// 只要平台信息参数一致,多个请求只需设置一次参数
DjyHttpUtillib.SetPlatformInfo(accessKey, accessSecret, ip, port, false);
// 发起POST请求超时时间15秒返回响应字节数组
string result = DjyHttpUtillib.HttpPost(saveServiceProjectUrl, JsonConvert.SerializeObject(req), 30);
if (null == result)
{
return await Task.FromResult(TaskManageOrderResultDto.Failed("请求失败,请联系管理员"));
}
else
{
var res = JsonConvert.DeserializeObject<TaskManageOrderResultDto>(result);
// Console.WriteLine(System.Text.Encoding.UTF8.GetString(result));
return await Task.FromResult(res);
}
}
/// <summary>
/// 取消服务状态
/// </summary>
/// <param name="req">修改服务状态详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> CancelServiceProject(EmbedServiceProjectDto req)
{
// 只要平台信息参数一致,多个请求只需设置一次参数
DjyHttpUtillib.SetPlatformInfo(accessKey, accessSecret, ip, port, false);
// 发起POST请求超时时间15秒返回响应字节数组
string result = DjyHttpUtillib.HttpPost(cancelServiceProjectUrl, JsonConvert.SerializeObject(req), 30);
if (null == result)
{
return await Task.FromResult(TaskManageOrderResultDto.Failed("请求失败,请联系管理员"));
}
else
{
var res = JsonConvert.DeserializeObject<TaskManageOrderResultDto>(result);
// Console.WriteLine(System.Text.Encoding.UTF8.GetString(result));
return await Task.FromResult(res);
}
}
/// <summary>
/// 获取服务项目列表
/// </summary>
/// <param name="req">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> GetServiceProjectList(EmbedQueryServiceProjectWithStatus req)
{
// 只要平台信息参数一致,多个请求只需设置一次参数
DjyHttpUtillib.SetPlatformInfo(accessKey, accessSecret, ip, port, false);
// 发起POST请求超时时间15秒返回响应字节数组
string result = DjyHttpUtillib.HttpPost(getServiceProjectListUrl, JsonConvert.SerializeObject(req), 30);
if (null == result)
{
return await Task.FromResult(TaskManageOrderResultDto.Failed("请求失败,请联系管理员"));
}
else
{
var res = JsonConvert.DeserializeObject<TaskManageOrderResultDto>(result);
// Console.WriteLine(System.Text.Encoding.UTF8.GetString(result));
return await Task.FromResult(res);
}
}
/// <summary>
/// 获取服务项目下的状态列表
/// </summary>
/// <param name="req">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> GetServiceStatusList(EmbedQueryServiceProjectWithStatus req)
{
// 只要平台信息参数一致,多个请求只需设置一次参数
DjyHttpUtillib.SetPlatformInfo(accessKey, accessSecret, ip, port, false);
// 发起POST请求超时时间15秒返回响应字节数组
string result = DjyHttpUtillib.HttpPost(getServiceStatusListUrl, JsonConvert.SerializeObject(req), 30);
if (null == result)
{
return await Task.FromResult(TaskManageOrderResultDto.Failed("请求失败,请联系管理员"));
}
else
{
var res = JsonConvert.DeserializeObject<TaskManageOrderResultDto>(result);
// Console.WriteLine(System.Text.Encoding.UTF8.GetString(result));
return await Task.FromResult(res);
}
}
/// <summary>
/// 保存服务状态
/// </summary>
/// <param name="req">修改服务状态详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> SaveServiceStatus(EmbedServiceProjectStatusDto req)
{
// 只要平台信息参数一致,多个请求只需设置一次参数
DjyHttpUtillib.SetPlatformInfo(accessKey, accessSecret, ip, port, false);
// 发起POST请求超时时间15秒返回响应字节数组
string result = DjyHttpUtillib.HttpPost(saveServiceStatusUrl, JsonConvert.SerializeObject(req), 30);
if (null == result)
{
return await Task.FromResult(TaskManageOrderResultDto.Failed("请求失败,请联系管理员"));
}
else
{
var res = JsonConvert.DeserializeObject<TaskManageOrderResultDto>(result);
// Console.WriteLine(System.Text.Encoding.UTF8.GetString(result));
return await Task.FromResult(res);
}
}
/// <summary>
/// 取消服务状态
/// </summary>
/// <param name="req">修改服务状态详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> CancelServiceStatus(EmbedServiceProjectStatusDto req)
{
// 只要平台信息参数一致,多个请求只需设置一次参数
DjyHttpUtillib.SetPlatformInfo(accessKey, accessSecret, ip, port, false);
// 发起POST请求超时时间15秒返回响应字节数组
string result = DjyHttpUtillib.HttpPost(cancelServiceStatusUrl, JsonConvert.SerializeObject(req), 30);
if (null == result)
{
return await Task.FromResult(TaskManageOrderResultDto.Failed("请求失败,请联系管理员"));
}
else
{
var res = JsonConvert.DeserializeObject<TaskManageOrderResultDto>(result);
// Console.WriteLine(System.Text.Encoding.UTF8.GetString(result));
return await Task.FromResult(res);
}
}
}
}

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.DjyServiceStatus
{
public interface IDjyServiceStatusService
{
/// <summary>
/// 保存服务项目
/// </summary>
/// <param name="req">修改服务项目详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SaveServiceProject(EmbedServiceProjectDto req);
/// <summary>
/// 取消服务项目
/// </summary>
/// <param name="req">修改服务项目详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> CancelServiceProject(EmbedServiceProjectDto req);
/// <summary>
/// 获取服务项目列表
/// </summary>
/// <param name="req">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> GetServiceProjectList(EmbedQueryServiceProjectWithStatus req);
/// <summary>
/// 获取服务项目下的状态列表
/// </summary>
/// <param name="req">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> GetServiceStatusList(EmbedQueryServiceProjectWithStatus req);
/// <summary>
/// 保存服务状态
/// </summary>
/// <param name="req">修改服务状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SaveServiceStatus(EmbedServiceProjectStatusDto req);
/// <summary>
/// 取消服务状态
/// </summary>
/// <param name="req">修改服务状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> CancelServiceStatus(EmbedServiceProjectStatusDto req);
}
}

@ -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.PrintModule
{
/// <summary>
/// 注入打印服务
/// </summary>
public static class PrintModuleInstall
{
/// <summary>
///
/// </summary>
/// <param name="services"></param>
/// <exception cref="ArgumentNullException"></exception>
public static void AddPrintModuleInstall(this IServiceCollection services)
{
if (services == null) throw new ArgumentNullException(nameof(services));
services.AddScoped<IPrintService, PrintService>();
}
}
}

@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.DjyServiceStatus
{
/// <summary>
/// 回执
/// </summary>
public class TaskManageOrderResultDto
{
/// <summary>
/// 是否成功 true=成功 false=失败
/// </summary>
public bool succ { get; set; } = false;
/// <summary>
/// 状态 0-成功
/// </summary>
public int status { get; set; } = 0;
/// <summary>
/// 返回消息
/// </summary>
public string msg { get; set; }
/// <summary>
/// 返回校验明细
/// </summary>
public object rows { get; set; }
/// <summary>
/// 返回单个对象
/// </summary>
public object ext { get; set; }
/// <summary>
/// 返回单个对象
/// </summary>
public object ext2 { get; set; }
/// <summary>
/// 是否超时 true-超时 false-未超时
/// </summary>
public bool isTimeout { get; set; } = false;
/// <summary>
/// 执行日期
/// </summary>
public DateTime executeTime { get; set; } = DateTime.Now;
/// <summary>
/// 批量执行统计详情
/// </summary>
public string batchTotal { get; set; }
/// <summary>
/// 业务单号
/// </summary>
public string bno { get; set; }
/// <summary>
///
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
public static TaskManageOrderResultDto Failed(string message)
{
return new TaskManageOrderResultDto()
{
succ = false,
msg = message
};
}
}
}

@ -40,7 +40,7 @@ public class SeaExport : BaseOrgModel<long>
/// <summary> /// <summary>
/// 单据费用状态时间 /// 单据费用状态时间
/// </summary> /// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "单据费用状态时间", IsNullable = false)] [SqlSugar.SugarColumn(ColumnDescription = "单据费用状态时间", IsNullable = true)]
public DateTime? BillFeeStatusTime { get; set; } public DateTime? BillFeeStatusTime { get; set; }
/// <summary> /// <summary>
@ -63,7 +63,7 @@ public class SeaExport : BaseOrgModel<long>
/// <summary> /// <summary>
/// 录入日期 /// 录入日期
/// </summary> /// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "录入日期", IsNullable = false)] [SqlSugar.SugarColumn(ColumnDescription = "录入日期", IsNullable = true)]
public DateTime? BusinessDate { get; set; } = DateTime.Now; public DateTime? BusinessDate { get; set; } = DateTime.Now;
/// <summary> /// <summary>
@ -875,12 +875,12 @@ public class SeaExport : BaseOrgModel<long>
/// <summary> /// <summary>
/// VGM截止日期 /// VGM截止日期
/// </summary> /// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "截单日期", IsNullable = false)] [SqlSugar.SugarColumn(ColumnDescription = "截单日期", IsNullable = true)]
public DateTime? CloseVgmDate { get; set; } public DateTime? CloseVgmDate { get; set; }
/// <summary> /// <summary>
/// 截单日期 /// 截单日期
/// </summary> /// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "截单日期", IsNullable = false)] [SqlSugar.SugarColumn(ColumnDescription = "截单日期", IsNullable = true)]
public DateTime? CloseDocDate { get; set; } public DateTime? CloseDocDate { get; set; }
/// <summary> /// <summary>
@ -896,7 +896,7 @@ public class SeaExport : BaseOrgModel<long>
/// <summary> /// <summary>
/// 集港日期 /// 集港日期
/// </summary> /// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "集港日期", IsNullable = false)] [SqlSugar.SugarColumn(ColumnDescription = "集港日期", IsNullable = true)]
public DateTime? IntoPortDocDate { get; set; } public DateTime? IntoPortDocDate { get; set; }
/// <summary> /// <summary>
@ -921,7 +921,7 @@ public class SeaExport : BaseOrgModel<long>
/// <summary> /// <summary>
/// Desc:月结算时间 /// Desc:月结算时间
/// </summary> /// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "月结算时间", IsNullable = false)] [SqlSugar.SugarColumn(ColumnDescription = "月结算时间", IsNullable = true)]
public DateTime? StlDate { get; set; } public DateTime? StlDate { get; set; }
/// <summary> /// <summary>

@ -379,7 +379,7 @@ public class SeaExportService : ISeaExportService
return DataResult.Failed("海运出口信息业务已锁定!", MultiLanguageConst.SeaExportBusinessLock); return DataResult.Failed("海运出口信息业务已锁定!", MultiLanguageConst.SeaExportBusinessLock);
} }
if (req.AccountDate.ToString().IsNotNull()) if (req.AccountDate.IsNotNull())
{ {
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.Id) && x.IsFeeLocking == true).Any()) if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.Id) && x.IsFeeLocking == true).Any())
{ {
@ -392,8 +392,7 @@ public class SeaExportService : ISeaExportService
foreach (var item in orderList) foreach (var item in orderList)
{ {
var info = item; var info = req.Adapt(item);
info = req.Adapt(info);
tenantDb.Updateable(info).UpdateColumns(dic).EnableDiffLogEvent().ExecuteCommand(); tenantDb.Updateable(info).UpdateColumns(dic).EnableDiffLogEvent().ExecuteCommand();
} }

@ -0,0 +1,62 @@
using DS.Module.Core;
using DS.Module.ExcelModule;
using DS.Module.ExcelModule.Model;
using DS.Module.PrintModule;
using DS.WMS.Core.Code.Interface;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers
{
/// <summary>
/// 打印服务 模块
/// </summary>
public class PrintController : ApiController
{
private readonly IPrintService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public PrintController(IPrintService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 获取打印模块列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetOpenPrintModuleList")]
public DataResult GetOpenPrintModuleList()
{
return _invokeService.GetOpenPrintModuleList();
}
/// <summary>
/// 获取打印模板列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetOpenPrintTemplateList")]
public DataResult GetOpenPrintTemplateList([FromQuery] string id)
{
return _invokeService.GetOpenPrintTemplateList(id);
}
/// <summary>
/// 获取Json打印信息
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("GetOpenJsonPrintInfo")]
public DataResult GetOpenJsonPrintInfo([FromBody] OpenJsonPrintReq req)
{
return _invokeService.GetOpenJsonPrintInfo(req);
}
}
}

@ -16,16 +16,15 @@
<DocumentationFile>bin\Release\net8.0\Api.xml</DocumentationFile> <DocumentationFile>bin\Release\net8.0\Api.xml</DocumentationFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\DS.Module.AutofacModule\DS.Module.AutofacModule.csproj" /> <ProjectReference Include="..\DS.Module.AutofacModule\DS.Module.AutofacModule.csproj" />
<ProjectReference Include="..\DS.Module.DjyServiceStatus\DS.Module.DjyServiceStatus.csproj" />
<ProjectReference Include="..\DS.Module.ExcelModule\DS.Module.ExcelModule.csproj" /> <ProjectReference Include="..\DS.Module.ExcelModule\DS.Module.ExcelModule.csproj" />
<ProjectReference Include="..\DS.Module.Jwt\DS.Module.Jwt.csproj" /> <ProjectReference Include="..\DS.Module.Jwt\DS.Module.Jwt.csproj" />
<ProjectReference Include="..\DS.Module.Middleware\DS.Module.Middleware.csproj" /> <ProjectReference Include="..\DS.Module.Middleware\DS.Module.Middleware.csproj" />
<ProjectReference Include="..\DS.Module.MultiLanguage\DS.Module.MultiLanguage.csproj" /> <ProjectReference Include="..\DS.Module.MultiLanguage\DS.Module.MultiLanguage.csproj" />
<ProjectReference Include="..\DS.Module.Nuget\DS.Module.Nuget.csproj" /> <ProjectReference Include="..\DS.Module.Nuget\DS.Module.Nuget.csproj" />
<ProjectReference Include="..\DS.Module.PrintModule\DS.Module.PrintModule.csproj" />
<ProjectReference Include="..\DS.Module.SqlSugar\DS.Module.SqlSugar.csproj" /> <ProjectReference Include="..\DS.Module.SqlSugar\DS.Module.SqlSugar.csproj" />
<ProjectReference Include="..\DS.Module.Swagger\DS.Module.Swagger.csproj" /> <ProjectReference Include="..\DS.Module.Swagger\DS.Module.Swagger.csproj" />
<ProjectReference Include="..\DS.WMS.Core\DS.WMS.Core.csproj" /> <ProjectReference Include="..\DS.WMS.Core\DS.WMS.Core.csproj" />

@ -5,6 +5,7 @@ using DS.Module.Core;
using DS.Module.Core.Extensions; using DS.Module.Core.Extensions;
using DS.Module.Core.ServiceExtensions; using DS.Module.Core.ServiceExtensions;
using DS.Module.ExcelModule; using DS.Module.ExcelModule;
using DS.Module.PrintModule;
using DS.Module.Jwt; using DS.Module.Jwt;
using DS.Module.Middleware; using DS.Module.Middleware;
using DS.Module.MultiLanguage; using DS.Module.MultiLanguage;
@ -41,6 +42,7 @@ builder.Services.AddJwtInstall();
builder.Services.AddSaasDbInstall();//分库服务 builder.Services.AddSaasDbInstall();//分库服务
builder.Services.AddMultiLanguageInstall();//多语言服务 builder.Services.AddMultiLanguageInstall();//多语言服务
builder.Services.AddExcelModuleInstall();//Excel服务 builder.Services.AddExcelModuleInstall();//Excel服务
builder.Services.AddPrintModuleInstall();//Print服务
// builder.Services.AddEndpointsApiExplorer(); // builder.Services.AddEndpointsApiExplorer();
// builder.Services.AddSwaggerGen(); // builder.Services.AddSwaggerGen();

@ -57,5 +57,17 @@
"GetModuleListUrl": "/printApi/OpenPrint/GetPrintModuleList", "GetModuleListUrl": "/printApi/OpenPrint/GetPrintModuleList",
"GetTemplateListUrl": "/printApi/OpenPrint/GetPrintTemplateList", "GetTemplateListUrl": "/printApi/OpenPrint/GetPrintTemplateList",
"GetJsonPrintInfoUrl": "/printApi/OpenPrint/GetOpenJsonPrintInfo" "GetJsonPrintInfoUrl": "/printApi/OpenPrint/GetOpenJsonPrintInfo"
},
"DjyService": {
"IP": "60.209.125.238",
"Port": "35100",
"AccessKey": "0aabffa55f3945b7a011b6beeaf23587",
"AccessSecret": "55b3b74b7291da681201b0342b1dec5af570acf015a3e03b66a7a5d2a43d842958647ddec213ea5f",
"SaveServiceProjectUrl": "/EmbedProjectGoodsStatus/SaveServiceProject",
"CancelServiceProjectUrl": "/EmbedProjectGoodsStatus/CancelServiceProject",
"GetServiceProjectListUrl": "/EmbedProjectGoodsStatus/GetServiceProjectList",
"GetServiceStatusListUrl": "/EmbedProjectGoodsStatus/GetServiceStatusList",
"SaveServiceStatusUrl": "/EmbedProjectGoodsStatus/SaveServiceStatus",
"CancelServiceStatusUrl": "/EmbedProjectGoodsStatus/CancelServiceStatus"
} }
} }

@ -0,0 +1,42 @@
using DS.Module.Core;
using DS.Module.ExcelModule;
using DS.Module.ExcelModule.Model;
using DS.Module.PrintModule;
using DS.WMS.Core.Code.Interface;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.OpApi.Controllers
{
/// <summary>
/// 大简云服务项目服务 模块
/// </summary>
public class DjyServiceStatusController : ApiController
{
private readonly IPrintService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public DjyServiceStatusController(IPrintService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 获取Json打印信息
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("GetOpenJsonPrintInfo")]
public DataResult GetOpenJsonPrintInfo([FromBody] OpenJsonPrintReq req)
{
return _invokeService.GetOpenJsonPrintInfo(req);
}
}
}

@ -96,3 +96,31 @@
2024-05-20 16:20:35.1879 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config 2024-05-20 16:20:35.1879 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-05-20 16:20:35.2035 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile 2024-05-20 16:20:35.2035 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-20 16:20:35.2289 Info Configuration initialized. 2024-05-20 16:20:35.2289 Info Configuration initialized.
2024-05-21 14:43:55.6958 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-05-21 14:43:55.7321 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-05-21 14:43:55.7445 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-05-21 14:43:55.7767 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-05-21 14:43:55.8036 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-05-21 14:43:55.8036 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-21 14:43:55.8362 Info Configuration initialized.
2024-05-21 14:48:42.3616 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-05-21 14:48:42.4285 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-05-21 14:48:42.4478 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-05-21 14:48:42.5838 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-05-21 14:48:42.6506 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-05-21 14:48:42.6862 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-21 14:48:42.7409 Info Configuration initialized.
2024-05-21 14:55:50.3527 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-05-21 14:55:50.4079 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-05-21 14:55:50.4942 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-05-21 14:55:50.6263 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-05-21 14:55:50.6654 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-05-21 14:55:50.7335 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-21 14:55:50.7741 Info Configuration initialized.
2024-05-21 15:04:07.4140 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-05-21 15:04:07.4573 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-05-21 15:04:07.4780 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-05-21 15:04:07.5206 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-05-21 15:04:07.5543 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-05-21 15:04:07.5713 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-21 15:04:07.5944 Info Configuration initialized.

@ -75,7 +75,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.WMS.OpApi", "DS.WMS.OpAp
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.WMS.FeeApi", "DS.WMS.FeeApi\DS.WMS.FeeApi.csproj", "{4A810D08-AB29-4758-BA37-9BEDBEA97B3A}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.WMS.FeeApi", "DS.WMS.FeeApi\DS.WMS.FeeApi.csproj", "{4A810D08-AB29-4758-BA37-9BEDBEA97B3A}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.CrawlerData", "DS.Module.CrawlerData\DS.Module.CrawlerData.csproj", "{AB3034D8-91F4-42A6-BFE9-497B238D65AD}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.Module.CrawlerData", "DS.Module.CrawlerData\DS.Module.CrawlerData.csproj", "{AB3034D8-91F4-42A6-BFE9-497B238D65AD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.DjyServiceStatus", "DS.Module.DjyServiceStatus\DS.Module.DjyServiceStatus.csproj", "{86AF9895-D98D-4BFD-BEB9-CE291A382426}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -215,6 +217,10 @@ Global
{AB3034D8-91F4-42A6-BFE9-497B238D65AD}.Debug|Any CPU.Build.0 = Debug|Any CPU {AB3034D8-91F4-42A6-BFE9-497B238D65AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB3034D8-91F4-42A6-BFE9-497B238D65AD}.Release|Any CPU.ActiveCfg = Release|Any CPU {AB3034D8-91F4-42A6-BFE9-497B238D65AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB3034D8-91F4-42A6-BFE9-497B238D65AD}.Release|Any CPU.Build.0 = Release|Any CPU {AB3034D8-91F4-42A6-BFE9-497B238D65AD}.Release|Any CPU.Build.0 = Release|Any CPU
{86AF9895-D98D-4BFD-BEB9-CE291A382426}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{86AF9895-D98D-4BFD-BEB9-CE291A382426}.Debug|Any CPU.Build.0 = Debug|Any CPU
{86AF9895-D98D-4BFD-BEB9-CE291A382426}.Release|Any CPU.ActiveCfg = Release|Any CPU
{86AF9895-D98D-4BFD-BEB9-CE291A382426}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -253,6 +259,7 @@ Global
{28C691B0-6891-4407-9A8F-03E6035FB963} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4} {28C691B0-6891-4407-9A8F-03E6035FB963} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4}
{4A810D08-AB29-4758-BA37-9BEDBEA97B3A} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4} {4A810D08-AB29-4758-BA37-9BEDBEA97B3A} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4}
{AB3034D8-91F4-42A6-BFE9-497B238D65AD} = {518DB9B5-80A8-4B2C-8570-52BD406458DE} {AB3034D8-91F4-42A6-BFE9-497B238D65AD} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
{86AF9895-D98D-4BFD-BEB9-CE291A382426} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {66115F23-94B4-43C0-838E-33B5CF77F788} SolutionGuid = {66115F23-94B4-43C0-838E-33B5CF77F788}

Loading…
Cancel
Save