SVN r1124

SVN-Revision: r1124
This commit is contained in:
cyf
2026-02-25 06:51:07 +00:00
parent fcf7cf8d16
commit c7b4bbb05f
2 changed files with 55 additions and 23 deletions
+48
View File
@@ -89,6 +89,54 @@ namespace Lskj.Util
return path;
}
}
/// <summary>
/// 图片扩展框图片下载路径(LabelImageEdit,每次进入程序会清空)
/// </summary>
public static string ImageDownloadPath
{
get
{
string path = AbsolutelyPath + "TempFiles\\ImageFile/";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
return path;
}
}
public static void ClearFilesInDirectory(string targetDir)
{
// 校验目录是否存在
if (!Directory.Exists(targetDir))
{
return;
}
try
{
// 删除所有文件
foreach (string filePath in Directory.GetFiles(targetDir))
{
File.SetAttributes(filePath, FileAttributes.Normal);
File.Delete(filePath);
}
// 删除所有子文件夹(及其内容)
foreach (string subDir in Directory.GetDirectories(targetDir))
{
Directory.Delete(subDir, recursive: true); // 递归删除子文件夹
}
}
catch (Exception ex)
{
}
}
/// <summary>
/// 获取打印文件路径
/// </summary>
+7 -23
View File
@@ -113,6 +113,10 @@ namespace Lskj.Util
/// </summary>
private static readonly string _userCode_key = "{lserpUserCode}";
/// <summary>
/// P_EmployeeTab表LoginAccount 固定字段(UserCode)
/// </summary>
private static readonly string _loginaccount_key = "{loginaccount}";
/// <summary>
/// 账套 固定字段
/// </summary>
private static readonly string _accountBook = "{lserpAccountBook}";
@@ -234,10 +238,11 @@ namespace Lskj.Util
.Replace(_className_key, ERPInfo.Instance.ClassName + "", true)
.Replace(_logintype, "0", true)
.Replace(_userCode_key, ERPInfo.Instance.LoginAccount + "", true)
.Replace(_loginaccount_key, ERPInfo.Instance.LoginAccount + "", true)
.Replace(_accountBook, ERPInfo.Instance.AccountBook + "", true)
.Replace(_loginUserLinkPhone_key, ERPInfo.Instance.UserLinkPhone + "", true)
.Replace(_mrpTag_key, ERPInfo.Instance.MrpTag + "", true)
.Replace(_macAddressy, ERPInfo.Instance.MacAddress + "", true); ;
.Replace(_macAddressy, ERPInfo.Instance.MacAddress + "", true);
}
/// <summary>
@@ -797,25 +802,4 @@ namespace Lskj.Util
/// <param name="iPersonnelCustomerId">客户标识</param>
/// <param name="iPersonnelPrivateKey">私钥</param>
/// <returns>System.String.</returns>
public static string ReplaceIPersonnel(string defaultValue, string iPersonnelAllowInformation, string iPersonnelCustomerId, string iPersonnelPrivateKey)
{
if (defaultValue.Contains(_iPersonnelAllowInformation) || defaultValue.Contains(_iPersonnelEncryptedMessage))
{
//替换许可
defaultValue = defaultValue.Replace(_iPersonnelAllowInformation, iPersonnelAllowInformation);
//替换加密的签名信息
TimeSpan ts = DateTime.Now.ToUniversalTime() - new DateTime(1970, 1, 1);
long time = (long)ts.TotalMilliseconds;//当前时间的时间戳
string EncryptedMessage = string.Format("company_id={0}&mobile_no={1}&timestamp={2}", iPersonnelCustomerId, ERPInfo.Instance.UserLinkPhone, time);
string value = Lskj.Util.EncryptByPrivateKey.encryptByPrivateKey(EncryptedMessage, iPersonnelPrivateKey);
defaultValue = defaultValue.Replace(_iPersonnelEncryptedMessage, value);
}
return defaultValue;
}
}
}
public static string ReplaceIPersonnel(string defaultValue, string iPersonnelAllowInformation, stri