去除引用common.props
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using JNPF.Common.Configuration;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Models.NPOI;
|
||||
using JNPF.DataEncryption;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Data;
|
||||
using JNPF.DependencyInjection;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using NPOI.SS.UserModel;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using System.Data;
|
||||
|
||||
namespace JNPF.Common.Helper
|
||||
{
|
||||
@@ -10,7 +10,7 @@ namespace JNPF.Common.Helper
|
||||
/// Excel导入操作类
|
||||
/// 版 本:V3.2.0
|
||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
||||
/// 日 期:2017.03.12.
|
||||
/// 日 期:2017.03.12.
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class ExcelImportHelper
|
||||
@@ -108,7 +108,7 @@ namespace JNPF.Common.Helper
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
dataRow[j] = cell.ToString()?.Trim();
|
||||
dataRow[j] = cell.ToString()?.Trim();
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -134,7 +134,7 @@ namespace JNPF.Common.Helper
|
||||
sheet = null;
|
||||
}
|
||||
#region 清除最后的空行
|
||||
for (int i = table.Rows.Count-1; i >= 0; i--)
|
||||
for (int i = table.Rows.Count - 1; i >= 0; i--)
|
||||
{
|
||||
bool isnull = true;
|
||||
for (int j = 0; j < table.Columns.Count; j++)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using JNPF.Common.Configuration;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Models;
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Drawing;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using JNPF.Common.Configuration;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Models;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Security;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.JsonSerialization;
|
||||
using JNPF.RemoteRequest.Extensions;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
|
||||
@@ -108,16 +108,16 @@ public class PinyinHelper
|
||||
|
||||
#region 汉字转换成全拼的拼音
|
||||
|
||||
/// <summary>
|
||||
/// 汉字转换成全拼的拼音.
|
||||
/// </summary>
|
||||
/// <param name="Chstr"></param>
|
||||
/// <returns></returns>
|
||||
public static string Pinyin(string Chstr)
|
||||
{
|
||||
// 定义拼音区编码数组
|
||||
int[] getValue = new int[]
|
||||
/// <summary>
|
||||
/// 汉字转换成全拼的拼音.
|
||||
/// </summary>
|
||||
/// <param name="Chstr"></param>
|
||||
/// <returns></returns>
|
||||
public static string Pinyin(string Chstr)
|
||||
{
|
||||
// 定义拼音区编码数组
|
||||
int[] getValue = new int[]
|
||||
{
|
||||
-20319, -20317, -20304, -20295, -20292, -20283, -20265, -20257, -20242, -20230, -20051, -20036,
|
||||
-20032, -20026, -20002, -19990, -19986, -19982, -19976, -19805, -19784, -19775, -19774, -19763,
|
||||
-19756, -19751, -19746, -19741, -19739, -19728, -19725, -19715, -19540, -19531, -19525, -19515,
|
||||
@@ -151,11 +151,11 @@ public class PinyinHelper
|
||||
-11055, -11052, -11045, -11041, -11038, -11024, -11020, -11019, -11018, -11014, -10838, -10832,
|
||||
-10815, -10800, -10790, -10780, -10764, -10587, -10544, -10533, -10519, -10331, -10329, -10328,
|
||||
-10322, -10315, -10309, -10307, -10296, -10281, -10274, -10270, -10262, -10260, -10256, -10254
|
||||
};
|
||||
};
|
||||
|
||||
// 定义拼音数组
|
||||
string[] getName = new string[]
|
||||
{
|
||||
// 定义拼音数组
|
||||
string[] getName = new string[]
|
||||
{
|
||||
"A", "Ai", "An", "Ang", "Ao", "Ba", "Bai", "Ban", "Bang", "Bao", "Bei", "Ben",
|
||||
"Beng", "Bi", "Bian", "Biao", "Bie", "Bin", "Bing", "Bo", "Bu", "Ba", "Cai", "Can",
|
||||
"Cang", "Cao", "Ce", "Ceng", "Cha", "Chai", "Chan", "Chang", "Chao", "Che", "Chen", "Cheng",
|
||||
@@ -189,7 +189,7 @@ public class PinyinHelper
|
||||
"Za", "Zai", "Zan", "Zang", "Zao", "Ze", "Zei", "Zen", "Zeng", "Zha", "Zhai", "Zhan",
|
||||
"Zhang", "Zhao", "Zhe", "Zhen", "Zheng", "Zhi", "Zhong", "Zhou", "Zhu", "Zhua", "Zhuai", "Zhuan",
|
||||
"Zhuang", "Zhui", "Zhun", "Zhuo", "Zi", "Zong", "Zou", "Zu", "Zuan", "Zui", "Zun", "Zuo"
|
||||
};
|
||||
};
|
||||
|
||||
// 验证是否输入汉字
|
||||
Regex reg = new Regex("^[\u4e00-\u9fa5]$");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Data;
|
||||
using System.Data;
|
||||
using System.Reflection;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Security;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using JNPF.Common.Cache;
|
||||
using JNPF.Common.Const;
|
||||
using JNPF.FriendlyException;
|
||||
using Yitter.IdGenerator;
|
||||
|
||||
namespace JNPF.Common.Security;
|
||||
@@ -11,56 +9,56 @@ namespace JNPF.Common.Security;
|
||||
/// </summary>
|
||||
public class SnowflakeIdHelper
|
||||
{
|
||||
// 定义dll路径
|
||||
public const string RegWorkerId_DLL_NAME = "lib\\regworkerid_lib_v1.3.1\\yitidgengo.dll";
|
||||
// 定义dll路径
|
||||
public const string RegWorkerId_DLL_NAME = "lib\\regworkerid_lib_v1.3.1\\yitidgengo.dll";
|
||||
|
||||
// 根据文档定义三个接口
|
||||
// 根据文档定义三个接口
|
||||
|
||||
// 注册一个 WorkerId,会先注销所有本机已注册的记录
|
||||
// ip: redis 服务器地址
|
||||
// port: redis 端口
|
||||
// password: redis 访问密码,可为空字符串“”
|
||||
// maxWorkerId: 最大 WorkerId
|
||||
[DllImport(RegWorkerId_DLL_NAME, EntryPoint = "RegisterOne", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
private static extern ushort RegisterOne(string ip, int port, string password, int maxWorkerId);
|
||||
// 注册一个 WorkerId,会先注销所有本机已注册的记录
|
||||
// ip: redis 服务器地址
|
||||
// port: redis 端口
|
||||
// password: redis 访问密码,可为空字符串“”
|
||||
// maxWorkerId: 最大 WorkerId
|
||||
[DllImport(RegWorkerId_DLL_NAME, EntryPoint = "RegisterOne", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
private static extern ushort RegisterOne(string ip, int port, string password, int maxWorkerId);
|
||||
|
||||
// 注销本机已注册的 WorkerId
|
||||
[DllImport(RegWorkerId_DLL_NAME, EntryPoint = "UnRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
private static extern void UnRegister();
|
||||
// 注销本机已注册的 WorkerId
|
||||
[DllImport(RegWorkerId_DLL_NAME, EntryPoint = "UnRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
private static extern void UnRegister();
|
||||
|
||||
// 检查本地WorkerId是否有效(0-有效,其它-无效)
|
||||
[DllImport(RegWorkerId_DLL_NAME, EntryPoint = "Validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
private static extern int Validate(int workerId);
|
||||
// 检查本地WorkerId是否有效(0-有效,其它-无效)
|
||||
[DllImport(RegWorkerId_DLL_NAME, EntryPoint = "Validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
private static extern int Validate(int workerId);
|
||||
|
||||
/// <summary>
|
||||
/// 初始化YitId配置
|
||||
/// </summary>
|
||||
public static void InitYitIdWorker()
|
||||
{
|
||||
//var option = new IdGeneratorOptions
|
||||
//{
|
||||
// WorkerId = 1, //必须 全局唯一,必须 程序设定,理论最大值 2^WorkerIdBitLength-1
|
||||
// //BaseTime = new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), //用生成ID时的系统时间与基础时间的差值(毫秒数)作为生成ID的时间戳
|
||||
// WorkerIdBitLength = 16, //机器码位长,决定 WorkerId 的最大值,默认值6,取值范围 [1, 16]
|
||||
// //SeqBitLength = 4, //序列数位长,默认值6,取值范围 [3, 21](建议不小于4),决定每毫秒基础生成的ID个数
|
||||
// //MinSeqNumber = 5, //最小序列数,默认值5,取值范围 [5, MaxSeqNumber]
|
||||
// //MaxSeqNumber 最大序列数,设置范围 [MinSeqNumber, 2^SeqBitLength-1],默认值0
|
||||
//};
|
||||
var option = App.GetConfig<IdGeneratorOptions>("YitId");
|
||||
if (option.WorkerId == 0)
|
||||
/// <summary>
|
||||
/// 初始化YitId配置
|
||||
/// </summary>
|
||||
public static void InitYitIdWorker()
|
||||
{
|
||||
CacheOptions _cacheOptions = App.GetConfig<CacheOptions>("Cache", true);
|
||||
option.WorkerId = RegisterOne(_cacheOptions.ip, _cacheOptions.port, _cacheOptions.password, 63);
|
||||
//var option = new IdGeneratorOptions
|
||||
//{
|
||||
// WorkerId = 1, //必须 全局唯一,必须 程序设定,理论最大值 2^WorkerIdBitLength-1
|
||||
// //BaseTime = new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), //用生成ID时的系统时间与基础时间的差值(毫秒数)作为生成ID的时间戳
|
||||
// WorkerIdBitLength = 16, //机器码位长,决定 WorkerId 的最大值,默认值6,取值范围 [1, 16]
|
||||
// //SeqBitLength = 4, //序列数位长,默认值6,取值范围 [3, 21](建议不小于4),决定每毫秒基础生成的ID个数
|
||||
// //MinSeqNumber = 5, //最小序列数,默认值5,取值范围 [5, MaxSeqNumber]
|
||||
// //MaxSeqNumber 最大序列数,设置范围 [MinSeqNumber, 2^SeqBitLength-1],默认值0
|
||||
//};
|
||||
var option = App.GetConfig<IdGeneratorOptions>("YitId");
|
||||
if (option.WorkerId == 0)
|
||||
{
|
||||
CacheOptions _cacheOptions = App.GetConfig<CacheOptions>("Cache", true);
|
||||
option.WorkerId = RegisterOne(_cacheOptions.ip, _cacheOptions.port, _cacheOptions.password, 63);
|
||||
}
|
||||
YitIdHelper.SetIdGenerator(option);
|
||||
}
|
||||
YitIdHelper.SetIdGenerator(option);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成ID.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string NextId()
|
||||
{
|
||||
return YitIdHelper.NextId().ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// 生成ID.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string NextId()
|
||||
{
|
||||
return YitIdHelper.NextId().ToString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user