SVN r1145
SVN-Revision: r1145
This commit is contained in:
@@ -802,4 +802,53 @@ namespace Lskj.Util
|
|||||||
/// <param name="iPersonnelCustomerId">客户标识</param>
|
/// <param name="iPersonnelCustomerId">客户标识</param>
|
||||||
/// <param name="iPersonnelPrivateKey">私钥</param>
|
/// <param name="iPersonnelPrivateKey">私钥</param>
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
public static string ReplaceIPersonnel(string defaultValue, string iPersonnelAllowInformation, stri
|
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}×tamp={2}", iPersonnelCustomerId, ERPInfo.Instance.UserLinkPhone, time);
|
||||||
|
string value = Lskj.Util.EncryptByPrivateKey.encryptByPrivateKey(EncryptedMessage, iPersonnelPrivateKey);
|
||||||
|
defaultValue = defaultValue.Replace(_iPersonnelEncryptedMessage, value);
|
||||||
|
|
||||||
|
}
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 替换多行参数
|
||||||
|
/// [!xxx] 替换为 'xxx','xxx'
|
||||||
|
/// [@xxx] 替换为 'xxx,xxx'
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rows">行</param>
|
||||||
|
/// <param name="param">替换值</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string ReplaceMultipleLinesParam(DataRow[] rows, string param)
|
||||||
|
{
|
||||||
|
if (rows == null || rows.Length == 0) return param;
|
||||||
|
|
||||||
|
param = ReplaceUserInfo(param);
|
||||||
|
string fieldValues = string.Empty;
|
||||||
|
|
||||||
|
//获取所有[xxx]值,只处理[!xxx]和[@xxx]的值
|
||||||
|
List<string> fields = new List<string>();
|
||||||
|
Regex regex = new Regex(@"\[([^\]]+)\]");
|
||||||
|
MatchCollection mcs = regex.Matches(param);
|
||||||
|
foreach (Match item in mcs)
|
||||||
|
{
|
||||||
|
if (fields.IndexOf(item.Value) == -1)
|
||||||
|
fields.Add(item.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
string start = string.Empty;
|
||||||
|
string end = string.Empty;
|
||||||
|
|
||||||
|
foreach (string field in fields)
|
||||||
|
{
|
||||||
|
|
||||||
Reference in New Issue
Block a user