张同海 8 months ago
commit e67c19c5be

@ -303,5 +303,10 @@ public static class MultiLanguageConst
[Description("函电信息不存在")]
public const string LetterNotExist = "Letter_Not_Exist";
[Description("表单设置不存在")]
public const string FormSetNotExist = "FormSet_Not_Exist";
[Description("表单复制模板不存在")]
public const string FormCopyNotExist = "FormCopy_Not_Exist";
#endregion
}

@ -24,7 +24,10 @@ public class UserInfo
/// 公司ID
/// </summary>
public string CompanyId { get; set; }
/// <summary>
/// 机构Id
/// </summary>
public string OrgId { get; set; }
/// <summary>
/// 公司名称
/// </summary>

@ -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.UserModule\DS.Module.UserModule.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,267 @@
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 SKIT.FlurlHttpClient.Wechat.Api.Models.TCBGetPressureTestReportResponse.Types;
using static System.Net.Mime.MediaTypeNames;
namespace DS.Module.PrintModule
{
/// <summary>
/// 打印服务封装请求工具类
/// </summary>
public class HttpUtillib
{
/// <summary>
/// 平台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("appId"))
{
req.Headers.Add(headerKey + ":" + header[headerKey]);
}
if (headerKey.Contains("timestamp"))
{
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("appId"))
{
req.Headers.Add(headerKey + ":" + header[headerKey]);
}
if (headerKey.Contains("timestamp"))
{
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,31 @@
using DS.Module.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.PrintModule
{
public interface IPrintService
{
/// <summary>
/// 获取打印模块列表
/// </summary>
/// <returns></returns>
public DataResult GetOpenPrintModuleList();
/// <summary>
/// 获取打印模板列表
/// </summary>
/// <returns></returns>
public DataResult GetOpenPrintTemplateList(string id);
/// <summary>
/// 获取Json打印信息
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult GetOpenJsonPrintInfo(OpenJsonPrintReq req);
}
}

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.PrintModule
{
/// <summary>
/// Json打印请求数据
/// </summary>
public class OpenJsonPrintReq
{
/// <summary>
/// 模板Id
/// </summary>
public long TemplateId { get; set; }
/// <summary>
/// Json数据
/// </summary>
public string JsonDataStr { get; set; }
}
}

@ -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,133 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.UserModule;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using NLog;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.PrintModule
{
public class PrintService: IPrintService
{
private readonly IServiceProvider _serviceProvider;
private readonly ISqlSugarClient db;
private readonly IUser user;
private readonly string ip;
private readonly int port;
private readonly string accessKey;
private readonly string accessSecret;
private readonly string moduleUrl;
private readonly string templateUrl;
private readonly string jsonPrintInfoUrl;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
/// <summary>
/// 构造函数
/// </summary>
/// <param name="serviceProvider"></param>
public PrintService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
ip = AppSetting.app(new string[] { "PrintService", "IP" }).ObjToString();
port = AppSetting.app(new string[] { "PrintService", "Port" }).ToInt();
accessKey = AppSetting.app(new string[] { "PrintService", "AccessKey" }).ObjToString();
accessSecret = AppSetting.app(new string[] { "PrintService", "AccessSecret" }).ObjToString();
moduleUrl = AppSetting.app(new string[] { "PrintService", "GetModuleListUrl" }).ObjToString();
templateUrl = AppSetting.app(new string[] { "PrintService", "GetTemplateListUrl" }).ObjToString();
jsonPrintInfoUrl = AppSetting.app(new string[] { "PrintService", "GetJsonPrintInfoUrl" }).ObjToString();
}
/// <summary>
/// 获取打印模块列表
/// </summary>
/// <returns></returns>
public DataResult GetOpenPrintModuleList()
{
// 只要平台信息参数一致,多个请求只需设置一次参数
HttpUtillib.SetPlatformInfo(accessKey, accessSecret, ip, port, false);
DataResult res = new DataResult();
// 发起POST请求超时时间15秒返回响应字节数组
string result = HttpUtillib.HttpGet(moduleUrl, 15);
if (null == result)
{
res = DataResult.Failed("请求失败,请联系管理员");
// 请求失败
// Console.WriteLine("/artemis/api/resource/v1/cameras/indexCode: POST fail");
}
else
{
res = JsonConvert.DeserializeObject<DataResult>(result);
// Console.WriteLine(System.Text.Encoding.UTF8.GetString(result));
}
return res;
}
/// <summary>
/// 获取打印模板列表
/// </summary>
/// <param name="id">模块id</param>
/// <returns></returns>
public DataResult GetOpenPrintTemplateList(string id)
{
// 只要平台信息参数一致,多个请求只需设置一次参数
HttpUtillib.SetPlatformInfo(accessKey, accessSecret, ip, port, false);
DataResult res = new DataResult();
// 发起POST请求超时时间15秒返回响应字节数组
string result = HttpUtillib.HttpGet(templateUrl+"?id=" + id, 15);
if (null == result)
{
res = DataResult.Failed("请求失败,请联系管理员");
// 请求失败
// Console.WriteLine("/artemis/api/resource/v1/cameras/indexCode: POST fail");
}
else
{
res = JsonConvert.DeserializeObject<DataResult>(result);
// Console.WriteLine(System.Text.Encoding.UTF8.GetString(result));
}
return res;
}
/// <summary>
/// 获取Json打印信息
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult GetOpenJsonPrintInfo(OpenJsonPrintReq req)
{
// 只要平台信息参数一致,多个请求只需设置一次参数
HttpUtillib.SetPlatformInfo(accessKey, accessSecret, ip, port, false);
DataResult res = new DataResult();
// 发起POST请求超时时间15秒返回响应字节数组
string result = HttpUtillib.HttpPost(jsonPrintInfoUrl, JsonConvert.SerializeObject(req), 30);
if (null == result)
{
res = DataResult.Failed("请求失败,请联系管理员");
// 请求失败
// Console.WriteLine("/artemis/api/resource/v1/cameras/indexCode: POST fail");
}
else
{
res = JsonConvert.DeserializeObject<DataResult>(result);
// Console.WriteLine(System.Text.Encoding.UTF8.GetString(result));
}
return res;
}
}
}

@ -44,6 +44,12 @@ namespace DS.Module.SqlSugar
if (tenantId == null || tenantId == 0)
entityInfo.SetValue(user.GetTenantId());
}
if (entityInfo.PropertyName == "OrgId")
{
var orgId = ((dynamic)entityInfo.EntityValue).OrgId;
if (orgId == null || orgId == 0)
entityInfo.SetValue(user.GetOrgId());
}
if (entityInfo.PropertyName == "CreateBy")
{

@ -228,7 +228,7 @@ public class AspNetUser : IUser
if (_orgId == null)
{
var orgIdClaim = GetClaimValueByType("OrgId").FirstOrDefault();
_orgId = orgIdClaim != null ? orgIdClaim.ObjToString() : "1111111111";
_orgId = orgIdClaim != null ? orgIdClaim.ObjToString() : "0";
}
return _orgId;
}

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Code.Dtos
{
/// <summary>
/// 新建表单获取默认值必填项
/// </summary>
public class FormSetCreateRes
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 权限Id
/// </summary>
public long? PermissionId { get; set; }
/// <summary>
/// 权限模块名称
/// </summary>
public string PermissionName { get; set; }
/// <summary>
/// 模板名称
/// </summary>
public string TemplateName { get; set; }
/// <summary>
/// 字段设置
/// </summary>
public string Content { get; set; }
}
}

@ -7,7 +7,7 @@ namespace DS.WMS.Core.Code.Entity;
/// <summary>
/// 租户表单字段复制模板
/// </summary>
[SqlSugar.SugarTable("op_code_form_copy")]
[SqlSugar.SugarTable("op_code_form_copy", "租户表单字段复制模板")]
public class CodeFormCopy : BaseOrgModel<long>
{
/// <summary>

@ -7,7 +7,7 @@ namespace DS.WMS.Core.Code.Entity;
/// <summary>
/// 租户表单设置
/// </summary>
[SqlSugar.SugarTable("op_code_form_set")]
[SqlSugar.SugarTable("op_code_form_set", "租户表单设置")]
public class CodeFormSet : BaseOrgModel<long>
{
/// <summary>

@ -4,6 +4,9 @@ using DS.WMS.Core.System.Dtos;
namespace DS.WMS.Core.Code.Interface;
/// <summary>
///
/// </summary>
public interface IFormSetService
{
/// <summary>
@ -27,4 +30,7 @@ public interface IFormSetService
/// <param name="id"></param>
/// <returns></returns>
DataResult<CodeFormSetRes> GetFormSetInfo(string id);
}

@ -63,7 +63,7 @@ public class CodeFormCopyService : IFormCopyService
if (req.Id == 0)
{
if (tenantDb.Queryable<CodeFormCopy>()
.Where(x => x.OrgId == long.Parse(user.OrgId) && x.PermissionId == req.PermissionId && x.CreateBy == long.Parse(user.UserId)).Any())
.Where(x => x.OrgId == user.GetOrgId() && x.PermissionId == req.PermissionId && x.CreateBy == long.Parse(user.UserId)).Any())
{
return DataResult.Failed("表单复制字段设置已存在!", MultiLanguageConst.FormCopyExist);
}

@ -56,10 +56,11 @@ public class CodeFormSetService : IFormSetService
public DataResult EditFormSet(CodeFormSetReq req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//var orgId = user.GetOrgId();
if (req.Id == 0)
{
if (tenantDb.Queryable<CodeFormSet>()
.Where(x => x.OrgId == long.Parse(user.OrgId) && x.PermissionId == req.PermissionId).Any())
.Where(x => x.OrgId == user.GetOrgId() && x.PermissionId == req.PermissionId).Any())
{
return DataResult.Failed("表单设置已存在!", MultiLanguageConst.FormSetExist);
}
@ -95,4 +96,5 @@ public class CodeFormSetService : IFormSetService
.First();
return DataResult<CodeFormSetRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
}
}

@ -7,7 +7,7 @@ namespace DS.WMS.Core.Info.Entity;
/// <summary>
/// 往来单位基本信息
/// </summary>
[SqlSugar.SugarTable("info_client")]
[SqlSugar.SugarTable("info_client", "往来单位基本信息")]
public class InfoClient : BaseOrgModel<long>
{
/// <summary>

@ -7,7 +7,7 @@ namespace DS.WMS.Core.Info.Entity;
/// <summary>
/// 往来单位-账期信息
/// </summary>
[SqlSugar.SugarTable("info_client_account_date")]
[SqlSugar.SugarTable("info_client_account_date", "往来单位-账期信息")]
public class InfoClientAccountDate : BaseOrgModel<long>
{
/// <summary>

@ -7,7 +7,7 @@ namespace DS.WMS.Core.Info.Entity;
/// <summary>
/// 往来单位-银行信息
/// </summary>
[SqlSugar.SugarTable("info_client_bank")]
[SqlSugar.SugarTable("info_client_bank", "往来单位-银行信息")]
public class InfoClientBank : BaseOrgModel<long>
{
/// <summary>

@ -7,7 +7,7 @@ namespace DS.WMS.Core.Info.Entity;
/// <summary>
/// 往来单位-联系人信息
/// </summary>
[SqlSugar.SugarTable("info_client_contact")]
[SqlSugar.SugarTable("info_client_contact", "往来单位-联系人信息")]
public class InfoClientContact : BaseOrgModel<long>
{
/// <summary>

@ -7,7 +7,7 @@ namespace DS.WMS.Core.Info.Entity;
/// <summary>
/// 往来单位-合同信息
/// </summary>
[SqlSugar.SugarTable("info_client_contract")]
[SqlSugar.SugarTable("info_client_contract", "往来单位-合同信息")]
public class InfoClientContract : BaseOrgModel<long>
{
/// <summary>

@ -7,7 +7,7 @@ namespace DS.WMS.Core.Info.Entity;
/// <summary>
/// 往来单位-收发货人信息
/// </summary>
[SqlSugar.SugarTable("info_client_shipper")]
[SqlSugar.SugarTable("info_client_shipper", "往来单位-收发货人信息")]
public class InfoClientShipper : BaseOrgModel<long>
{
/// <summary>

@ -6,7 +6,7 @@ namespace DS.WMS.Core.Info.Entity;
/// <summary>
/// 往来单位标识
/// </summary>
[SqlSugar.SugarTable("info_client_tag")]
[SqlSugar.SugarTable("info_client_tag", "往来单位标识")]
public class InfoClientTag : BaseOrgModel<long>
{
/// <summary>

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.System.Dtos
{
/// <summary>
/// 用户高级查询条件设置请求
/// </summary>
public class UserQuerySetUpdateReq
{
/// <summary>
/// 权限Id
/// </summary>
public long? PermissionId { get; set; }
/// <summary>
/// 高级查询条件设置
/// </summary>
public string Content { get; set; }
}
}

@ -0,0 +1,32 @@
using SqlSugar;
namespace DS.WMS.Core.System.Entity;
/// <summary>
/// 用户高级查询条件设置
/// </summary>
[SqlSugar.SugarTable("sys_query_set")]
public class SysQuerySet
{
/// <summary>
/// ID
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
/// <summary>
/// 用户id
/// </summary>
public long? UserId { get; set; }
/// <summary>
/// 权限Id
/// </summary>
public long? PermissionId { get; set; }
/// <summary>
/// 查询条件设置
/// </summary>
[SugarColumn(ColumnDescription = "查询条件设置", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string Content { get; set; }
}

@ -225,4 +225,26 @@ public interface IClientCommonService
/// </summary>
/// <returns></returns>
public DataResult<List<CodeServiceSelectRes>> GetServiceSelectList();
/// <summary>
/// 获取用户高级查询设置
/// </summary>
/// <param name="permissionId"></param>
/// <returns></returns>
public DataResult<SysQuerySet> GetUserQuerySet(string permissionId);
/// <summary>
/// 更新用户高级查询设置
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult UpdateUserQuerySet(UserQuerySetUpdateReq req);
/// <summary>
/// 获取模块新增信息
/// </summary>
/// <param name="id">权限模块id</param>
/// <returns></returns>
Task<DataResult<FormSetCreateRes>> GetFormSetCreateInfoAsync(string id);
}

@ -149,6 +149,18 @@ public interface ICommonService
/// <returns></returns>
public DataResult<List<DbColumnInfo>> GetColumns(string tableViewName);
/// <summary>
/// 获取表及视图-按客户
/// </summary>
/// <returns></returns>
public DataResult<List<DbTableInfo>> GetTablesByClient();
/// <summary>
/// 获取列字段-按客户
/// </summary>
/// <param name="tableViewName">表名</param>
/// <returns></returns>
public DataResult<List<DbColumnInfo>> GetColumnsByClient(string tableViewName);
/// <summary>
/// 获取用户字段设置
/// </summary>

@ -681,4 +681,87 @@ public class ClientCommonService : IClientCommonService
).ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
#region 用户高级查询条件设置
/// <summary>
/// 获取用户高级查询条件设置
/// </summary>
/// <param name="permissionId"></param>
/// <returns></returns>
public DataResult<SysQuerySet> GetUserQuerySet(string permissionId)
{
var info = db.Queryable<SysQuerySet>()
.Where(x => x.UserId == long.Parse(user.UserId) && x.PermissionId == long.Parse(permissionId)).First();
return DataResult<SysQuerySet>.Success(info);
}
/// <summary>
/// 更新用户高级查询条件设置
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult UpdateUserQuerySet(UserQuerySetUpdateReq req)
{
var info = db.Queryable<SysQuerySet>()
.Where(x => x.UserId == long.Parse(user.UserId) && x.PermissionId == req.PermissionId).First();
if (info.IsNull())
{
var entity = new SysQuerySet
{
UserId = long.Parse(user.UserId),
PermissionId = req.PermissionId,
Content = req.Content
};
db.Insertable(entity).ExecuteCommand();
}
else
{
info.Content = req.Content;
db.Updateable(info).ExecuteCommand();
}
return DataResult.Successed("更新成功");
}
#endregion
/// <summary>
/// 获取模块新增信息
/// </summary>
/// <param name="id">权限模块id</param>
/// <returns></returns>
public async Task<DataResult<FormSetCreateRes>> GetFormSetCreateInfoAsync(string id)
{
var res = new FormSetCreateRes();
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//判断有没有自己设置的模板
var ownSet = await tenantDb.Queryable<CodeFormSet>()
.Where(x => x.PermissionId == long.Parse(id) && x.CreateBy == long.Parse(user.UserId))
.Select<FormSetCreateRes>()
.FirstAsync();
if (ownSet != null)
{
return await Task.FromResult(DataResult<FormSetCreateRes>.Success(ownSet));
}
else
{
var publicSet = await tenantDb.Queryable<CodeFormSet>()
.Where(x => x.PermissionId == long.Parse(id))
.Select<FormSetCreateRes>()
.FirstAsync();
if (publicSet != null)
{
return await Task.FromResult(DataResult<FormSetCreateRes>.Success(publicSet));
}
else
{
return await Task.FromResult(DataResult<FormSetCreateRes>.Failed(MultiLanguageConst.FormSetNotExist));
}
}
}
}

@ -376,7 +376,7 @@ public class CommonService : ICommonService
OrgId = orgRelation.OrgId.ToString(),
TenantId = userInfo.TenantId.ToString(),
};
var token = JwtHelper.Encrypt(tokenModel, false, false);
var token = JwtHelper.Encrypt(tokenModel, false, true);
var visLog = new SysLogVisit()
{
@ -416,7 +416,7 @@ public class CommonService : ICommonService
OrgId = user.GetOrgId().ToString(),
TenantId = tenantId.ToString(),
};
var refreshToken = JwtHelper.Encrypt(tokenModel, true, false);
var refreshToken = JwtHelper.Encrypt(tokenModel, true, true);
var data = db.Queryable<SysUser>().Filter(null, true).Where(x => x.Id == userId)
.Select(a => new CurrentUserViewModel
@ -1131,7 +1131,7 @@ public class CommonService : ICommonService
#region 获取数据库表及字段属性
/// <summary>
///
/// 获取数据库表
/// </summary>
/// <returns></returns>
public DataResult<List<DbTableInfo>> GetTables()
@ -1141,7 +1141,7 @@ public class CommonService : ICommonService
}
/// <summary>
///
/// 获取数据库表字段
/// </summary>
/// <param name="tableViewName"></param>
/// <returns></returns>
@ -1151,6 +1151,30 @@ public class CommonService : ICommonService
return DataResult<List<DbColumnInfo>>.Success("获取数据成功", data);
}
/// <summary>
/// 获取数据库表-按客户
/// </summary>
/// <returns></returns>
public DataResult<List<DbTableInfo>> GetTablesByClient()
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.DbMaintenance.GetTableInfoList();
return DataResult<List<DbTableInfo>>.Success("获取数据成功", data);
}
/// <summary>
/// 获取数据库表字段-按客户
/// </summary>
/// <param name="tableViewName"></param>
/// <returns></returns>
public DataResult<List<DbColumnInfo>> GetColumnsByClient(string tableViewName)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.DbMaintenance.GetColumnInfosByTableName(tableViewName);
return DataResult<List<DbColumnInfo>>.Success("获取数据成功", data);
}
#endregion
#region 用户字段设置

@ -417,4 +417,44 @@ public class ClientCommonController : ApiController
var res = _invokeService.GetServiceSelectList();
return res;
}
/// <summary>
/// 获取用户高级查询条件设置
/// </summary>
/// <param name="permissionId">权限模块id</param>
/// <returns></returns>
[HttpGet]
[Route("GetUserQuerySet")]
public DataResult<SysQuerySet> GetUserQuerySet([FromQuery] string permissionId)
{
var res = _invokeService.GetUserQuerySet(permissionId);
return res;
}
/// <summary>
/// 更新用户高级查询条件设置
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("UpdateUserQuerySet")]
public DataResult UpdateUserQuerySet([FromBody] UserQuerySetUpdateReq req)
{
var res = _invokeService.UpdateUserQuerySet(req);
return res;
}
/// <summary>
/// 获取模块新增信息
/// </summary>
/// <param name="id">权限模块Id</param>
/// <returns></returns>
[HttpGet]
[Route("GetFormSetCreateInfoAsync")]
public async Task<DataResult<FormSetCreateRes>> GetFormSetCreateInfoAsync([FromQuery] string id)
{
var res = await _invokeService.GetFormSetCreateInfoAsync(id);
return res;
}
}

@ -354,7 +354,30 @@ public class CommonController : ApiController
var res = _invokeService.GetColumns(tableViewName);
return res;
}
/// <summary>
/// 获取数据库表及视图名-客户端
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetTablesByClient")]
public DataResult<List<DbTableInfo>> GetTablesByClient()
{
var res = _invokeService.GetTablesByClient();
return res;
}
/// <summary>
/// 获取数据库表及视图名-客户端
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetColumnsByClient")]
public DataResult<List<DbColumnInfo>> GetColumnsByClient([FromQuery] string tableViewName)
{
var res = _invokeService.GetColumnsByClient(tableViewName);
return res;
}
/// <summary>
/// 获取用户字段设置
/// </summary>

@ -61,4 +61,6 @@ public class FormSetController : ApiController
var res = _invokeService.GetFormSetInfo(id);
return res;
}
}

@ -1006,3 +1006,129 @@
2024-03-22 15:20:15.8155 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-03-22 15:20:15.8391 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-22 15:20:15.9040 Info Configuration initialized.
2024-04-08 10:09:10.2207 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 10:09:10.2510 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 10:09:10.2510 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 10:09:10.2778 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-04-08 10:09:10.2901 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 10:09:10.2901 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 10:09:10.3066 Info Configuration initialized.
2024-04-08 13:48:40.3741 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 13:48:40.4078 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 13:48:40.4078 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 13:48:40.4457 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-04-08 13:48:40.4724 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 13:48:40.4846 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 13:48:40.5011 Info Configuration initialized.
2024-04-08 13:59:14.5993 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 13:59:14.6266 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 13:59:14.6266 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 13:59:14.6579 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-04-08 13:59:14.6716 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 13:59:14.6716 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 13:59:14.6971 Info Configuration initialized.
2024-04-08 14:09:10.4100 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 14:09:10.4380 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 14:09:10.4380 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 14:09:10.4667 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-04-08 14:09:10.4667 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 14:09:10.4872 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 14:09:10.4984 Info Configuration initialized.
2024-04-08 16:31:07.8305 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 16:31:07.8948 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 16:31:07.9053 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 16:31:07.9344 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-04-08 16:31:07.9491 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Release\net8.0\nlog.config
2024-04-08 16:31:07.9569 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 16:31:07.9718 Info Configuration initialized.
2024-04-08 16:32:10.0449 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 16:32:10.0760 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 16:32:10.0851 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 16:32:10.1065 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-04-08 16:32:10.1221 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 16:32:10.1296 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 16:32:10.1557 Info Configuration initialized.
2024-04-08 16:49:18.7836 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 16:49:18.8033 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 16:49:18.8033 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 16:49:18.8239 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-04-08 16:49:18.8339 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 16:49:18.8339 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 16:49:18.8479 Info Configuration initialized.
2024-04-08 16:59:46.1775 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 16:59:46.2039 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 16:59:46.2039 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 16:59:46.2319 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-04-08 16:59:46.2496 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 16:59:46.2496 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 16:59:46.2763 Info Configuration initialized.
2024-04-08 17:00:46.4418 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 17:00:46.4811 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 17:00:46.4965 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 17:00:46.5235 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-04-08 17:00:46.5410 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 17:00:46.5514 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 17:00:46.5731 Info Configuration initialized.
2024-04-08 17:05:46.5592 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 17:05:46.6040 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 17:05:46.6178 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 17:05:46.6540 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-04-08 17:05:46.6829 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 17:05:46.6950 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 17:05:46.7298 Info Configuration initialized.
2024-04-08 17:07:52.1587 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 17:07:52.1890 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 17:07:52.1890 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 17:07:52.2210 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-04-08 17:07:52.2403 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 17:07:52.2483 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 17:07:52.2483 Info Configuration initialized.
2024-04-08 17:11:15.7620 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 17:11:15.8124 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 17:11:15.8330 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 17:11:15.8637 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-04-08 17:11:15.8786 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 17:11:15.8786 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 17:11:15.9038 Info Configuration initialized.
2024-04-08 17:14:25.1661 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 17:14:25.2291 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 17:14:25.2460 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 17:14:25.2810 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-04-08 17:14:25.3114 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 17:14:25.3307 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 17:14:25.3619 Info Configuration initialized.
2024-04-08 17:15:30.5101 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 17:15:30.6174 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 17:15:30.6373 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 17:15:30.7669 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-04-08 17:15:30.8144 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 17:15:30.8382 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 17:15:30.8714 Info Configuration initialized.
2024-04-08 17:21:34.7371 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 17:21:35.0378 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 17:21:35.0595 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 17:21:35.1049 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-04-08 17:21:35.1372 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 17:21:35.1616 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 17:21:35.2097 Info Configuration initialized.
2024-04-08 17:37:32.8181 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 17:37:32.8443 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 17:37:32.8443 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 17:37:32.8728 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-04-08 17:37:32.8728 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 17:37:32.8939 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 17:37:32.9082 Info Configuration initialized.
2024-04-08 17:40:12.3325 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 17:40:12.3641 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 17:40:12.3732 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 17:40:12.4012 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-04-08 17:40:12.4320 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 17:40:12.4464 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 17:40:12.4719 Info Configuration initialized.
2024-04-08 17:44:13.5165 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-08 17:44:13.5602 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-08 17:44:13.5602 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-08 17:44:13.5999 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-04-08 17:44:13.6177 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-08 17:44:13.6281 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-08 17:44:13.6504 Info Configuration initialized.

@ -48,5 +48,14 @@
"BasePath": "", //使
"RelativePath": "LinkAttach",
"FileType": [ ".xls", ".xlsx", ".pdf", ".txt", ".pms" ]
},
"PrintService": {
"IP": "60.209.125.238",
"Port": "3009",
"AccessKey": "1777229107311022080",
"AccessSecret": "d816e6fe938f24e2f205db129d31286a",
"GetModuleListUrl": "/printApi/OpenPrint/GetPrintModuleList",
"GetTemplateListUrl": "/printApi/OpenPrint/GetPrintTemplateList",
"GetJsonPrintInfoUrl": "/printApi/OpenPrint/GetOpenJsonPrintInfo"
}
}

@ -11,8 +11,8 @@
<ItemGroup>
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
<PackageReference Include="xunit" Version="2.4.2"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="Xunit.DependencyInjection" Version="8.9.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@ -27,6 +27,7 @@
<ItemGroup>
<ProjectReference Include="..\DS.Module.AutofacModule\DS.Module.AutofacModule.csproj" />
<ProjectReference Include="..\DS.Module.Core\DS.Module.Core.csproj" />
<ProjectReference Include="..\DS.Module.PrintModule\DS.Module.PrintModule.csproj" />
<ProjectReference Include="..\DS.WMS.Core\DS.WMS.Core.csproj" />
</ItemGroup>

@ -0,0 +1,42 @@
using System.Reflection;
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.System.Entity;
using DS.WMS.Core.System.Interface;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
using SqlSugar.IOC;
using Xunit;
namespace Ds.WMS.Test;
public class OpTest
{
private readonly IServiceProvider _serviceProvider;
private readonly SqlSugarScope db;
private readonly ISaasDbService saasService;
private readonly IClientCommonService _formSetService;
public OpTest(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = (SqlSugarScope)_serviceProvider.GetRequiredService<ISqlSugarClient>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
_formSetService = _serviceProvider.GetRequiredService<IClientCommonService>();
}
[Fact]
public async void OpTest1()
{
//var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
var data = await _formSetService.GetFormSetCreateInfoAsync("1750335377144680448");
Assert.True(true);
}
}

@ -0,0 +1,65 @@
using System.Reflection;
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.PrintModule;
using DS.Module.SqlSugar;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.System.Entity;
using DS.WMS.Core.System.Interface;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
using SqlSugar.IOC;
using Xunit;
namespace Ds.WMS.Test;
public class PrintTest
{
private readonly IServiceProvider _serviceProvider;
private readonly SqlSugarScope db;
private readonly ISaasDbService saasService;
private readonly IPrintService _printService;
public PrintTest(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = (SqlSugarScope)_serviceProvider.GetRequiredService<ISqlSugarClient>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
_printService = _serviceProvider.GetRequiredService<IPrintService>();
}
/// <summary>
/// 获取打印模块列表
/// </summary>
[Fact]
public void GetOpenPrintModuleList()
{
var data = _printService.GetOpenPrintModuleList();
Assert.True(data.Succeeded);
}
/// <summary>
/// 获取打印模板列表
/// </summary>
[Fact]
public void GetOpenPrintTemplateList()
{
var data = _printService.GetOpenPrintTemplateList("1777229219986804736");
Assert.True(data.Succeeded);
}
/// <summary>
/// 获取Json打印信息
/// </summary>
[Fact]
public void GetOpenJsonPrintInfo()
{
var req = new OpenJsonPrintReq()
{
TemplateId = 1777232318486941696,
JsonDataStr = "{\"GID\":\"52fc4ecf-5c88-49a8-aa1f-08da84ccc2d3\",\"BILLTYPE\":false,\"TRUCKNO\":\"鲁A789\",\"BoxWeigth\":10540,\"BoxCode\":\"A124\",\"BoxCode2\":null,\"ISTwoBox\":false,\"CORPID\":null,\"CreateDate\":\"2023-12-22T09:55:43.0332931+08:00\",\"CreateID\":null,\"Creator\":null,\"TURNOVERDATE\":\"2023-12-22T09:55:43.0333166+08:00\",\"Modifier\":null,\"ModifyDate\":null,\"ModifyID\":null,\"REMARK\":null}"
};
var data = _printService.GetOpenJsonPrintInfo(req);
Assert.True(data.Succeeded);
}
}

@ -1,6 +1,7 @@
using Autofac;
using Autofac.Extensions.DependencyInjection;
using DS.Module.AutofacModule;
using DS.Module.PrintModule;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using Microsoft.Extensions.DependencyInjection;
@ -52,6 +53,7 @@ public class Startup
services.AddUserModuleInstall(); //用户服务
services.AddSqlSugarInstall();
services.AddSaasDbInstall();
services.AddPrintModuleInstall();
}
/// <summary>

@ -1,42 +1,51 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"JwtSettings": {
"Issuer": "vol.core.owner",
"Audience": "vol.core",
"User": "C5ABA9E202D94C43A3CA66002BF77FAF",
"SecretKey": "sdfsdfsrty45634kkhllghtdgdfss345t678fs"
},
"Cors": {
"PolicyName": "WMSCore.API",
"Url": "http://localhost:8000,http://localhost:5999,http://localhost:8088,http://localhost:5173,http://0.0.0.0:5999,http://0.0.0.0:9995,http://localhost:9995,http://60.209.125.238:9995,http://localhost:3000,https://localhost:3100,http://47.104.255.182:3100,http://47.104.255.182:3110,https://localhost:3110,http://localhost:8080,http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084"
},
"DBInfo": {
"DefaultDbConnId": "1288018625843826688",
"DefaultDbType": 0,
"DefaultDbString": "server=60.209.125.238;port=32006;uid=root;pwd=Djy@Mysql.test;database=shippingweb8_dev",
"DBS": [
{
"ConnId": "1595354960864874496",
"DBType": 1,
"Enabled": false,
"HitRate": 40,
"Connection": "Data Source=47.105.193.36,11435;Initial Catalog=SHIPPINGWEB_JNHJ;Integrated Security=False;Connect Timeout=500;User ID=sa;Password=Ds20040201",
"ProviderName": "System.Data.SqlClient"
}
]
},
"SwaggerDoc": {
"ContactName": "WmsAdminAPI",
"ContactEmail": "Wms API.Core@xxx.com",
"ContactUrl": "https://www.xxx.com",
"Version": "1.0",
"Title": "Wms Admin API",
"Description": "Wms Admin API"
},
"PrintService": {
"IP": "60.209.125.238",
"Port": "3009",
"AccessKey": "1777229107311022080",
"AccessSecret": "d816e6fe938f24e2f205db129d31286a",
"GetModuleListUrl": "/printApi/OpenPrint/GetPrintModuleList",
"GetTemplateListUrl": "/printApi/OpenPrint/GetPrintTemplateList",
"GetJsonPrintInfoUrl": "/printApi/OpenPrint/GetOpenJsonPrintInfo"
}
},
"AllowedHosts": "*",
"JwtSettings": {
"Issuer": "vol.core.owner",
"Audience": "vol.core",
"User": "C5ABA9E202D94C43A3CA66002BF77FAF",
"SecretKey": "sdfsdfsrty45634kkhllghtdgdfss345t678fs"
},
"Cors": {
"PolicyName": "WMSCore.API",
"Url": "http://localhost:8000,http://localhost:5999,http://localhost:8088,http://localhost:5173,http://0.0.0.0:5999,http://0.0.0.0:9995,http://localhost:9995,http://60.209.125.238:9995,http://localhost:3000,https://localhost:3100,http://47.104.255.182:3100,http://47.104.255.182:3110,https://localhost:3110,http://localhost:8080,http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084"
},
"DBInfo": {
"DefaultDbConnId": "1288018625843826688",
"DefaultDbType": 0,
"DefaultDbString": "server=60.209.125.238;port=32006;uid=root;pwd=Djy@Mysql.test;database=shippingweb8_dev",
"DBS": [
{
"ConnId": "1595354960864874496",
"DBType": 1,
"Enabled": false,
"HitRate": 40,
"Connection": "Data Source=47.105.193.36,11435;Initial Catalog=SHIPPINGWEB_JNHJ;Integrated Security=False;Connect Timeout=500;User ID=sa;Password=Ds20040201",
"ProviderName": "System.Data.SqlClient"
}
]
},
"SwaggerDoc": {
"ContactName": "WmsAdminAPI",
"ContactEmail": "Wms API.Core@xxx.com",
"ContactUrl": "https://www.xxx.com",
"Version": "1.0",
"Title": "Wms Admin API",
"Description": "Wms Admin API"
}
}

@ -61,13 +61,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ds.WMS.WebCore", "Ds.WMS.We
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ds.WMS.MogonDb", "Ds.WMS.MogonDb\Ds.WMS.MogonDb.csproj", "{47702656-3E62-4477-B72C-ADA39034B5A7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.WMS.Test", "DS.WMS.Test\DS.WMS.Test.csproj", "{A8749917-1B4C-4976-98F7-C0A1B043DE38}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.WMS.Test", "DS.WMS.Test\DS.WMS.Test.csproj", "{A8749917-1B4C-4976-98F7-C0A1B043DE38}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.MultiLanguage", "DS.Module.MultiLanguage\DS.Module.MultiLanguage.csproj", "{FE82ABD4-CE11-49F6-823C-6E0B64135FFC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.Module.MultiLanguage", "DS.Module.MultiLanguage\DS.Module.MultiLanguage.csproj", "{FE82ABD4-CE11-49F6-823C-6E0B64135FFC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.Log", "DS.Module.Log\DS.Module.Log.csproj", "{739899DE-D41F-4083-94E1-EDA349344ECC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.Module.Log", "DS.Module.Log\DS.Module.Log.csproj", "{739899DE-D41F-4083-94E1-EDA349344ECC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.Middleware", "DS.Module.Middleware\DS.Module.Middleware.csproj", "{B0351554-748F-4DF8-8C22-152646937EFE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.Module.Middleware", "DS.Module.Middleware\DS.Module.Middleware.csproj", "{B0351554-748F-4DF8-8C22-152646937EFE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.PrintModule", "DS.Module.PrintModule\DS.Module.PrintModule.csproj", "{F7ACC016-4181-4B26-9550-FB18A2053503}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -191,6 +193,10 @@ Global
{B0351554-748F-4DF8-8C22-152646937EFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0351554-748F-4DF8-8C22-152646937EFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0351554-748F-4DF8-8C22-152646937EFE}.Release|Any CPU.Build.0 = Release|Any CPU
{F7ACC016-4181-4B26-9550-FB18A2053503}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F7ACC016-4181-4B26-9550-FB18A2053503}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7ACC016-4181-4B26-9550-FB18A2053503}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7ACC016-4181-4B26-9550-FB18A2053503}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -225,6 +231,7 @@ Global
{FE82ABD4-CE11-49F6-823C-6E0B64135FFC} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
{739899DE-D41F-4083-94E1-EDA349344ECC} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
{B0351554-748F-4DF8-8C22-152646937EFE} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
{F7ACC016-4181-4B26-9550-FB18A2053503} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {66115F23-94B4-43C0-838E-33B5CF77F788}

Loading…
Cancel
Save