模板缓冲
This commit is contained in:
@@ -110,26 +110,92 @@ namespace NX.ERP.U8.Store
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static object lockHeadobj = new object();
|
||||||
|
private static string strTemlateHead = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
private string GetHeadTemplate()
|
private string GetHeadTemplate()
|
||||||
{
|
{
|
||||||
var strTemlate = FileHelp.ReadFile(HeadFile);
|
|
||||||
if (strTemlate == string.Empty)
|
if (!string.IsNullOrEmpty(strTemlateHead))
|
||||||
{
|
{
|
||||||
this.LoadTemplate();
|
return strTemlateHead;
|
||||||
strTemlate = GetHeadTemplate();
|
|
||||||
}
|
}
|
||||||
return strTemlate;
|
else
|
||||||
|
{
|
||||||
|
lock (lockHeadobj)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(strTemlateHead))
|
||||||
|
{
|
||||||
|
return strTemlateHead;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strTemlateHead = FileHelp.ReadFile(HeadFile);
|
||||||
|
if (string.IsNullOrEmpty(strTemlateHead))
|
||||||
|
{
|
||||||
|
this.LoadTemplate();
|
||||||
|
strTemlateHead = GetHeadTemplate();
|
||||||
|
}
|
||||||
|
return strTemlateHead;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static object lockBodyobj = new object();
|
||||||
|
private static string strTemlateBody = "";
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
private string GetBodyTemplate()
|
private string GetBodyTemplate()
|
||||||
{
|
{
|
||||||
var strTemlate = FileHelp.ReadFile(BodyFile);
|
|
||||||
if (strTemlate == string.Empty)
|
if (!string.IsNullOrEmpty(strTemlateBody))
|
||||||
{
|
{
|
||||||
this.LoadTemplate();
|
return strTemlateBody;
|
||||||
strTemlate = GetBodyTemplate();
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lock (lockBodyobj)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(strTemlateBody))
|
||||||
|
{
|
||||||
|
return strTemlateHead;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strTemlateBody = FileHelp.ReadFile(BodyFile);
|
||||||
|
if (string.IsNullOrEmpty(strTemlateBody))
|
||||||
|
{
|
||||||
|
this.LoadTemplate();
|
||||||
|
strTemlateBody = GetHeadTemplate();
|
||||||
|
}
|
||||||
|
return strTemlateBody;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return strTemlate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -306,14 +372,15 @@ namespace NX.ERP.U8.Store
|
|||||||
{
|
{
|
||||||
u8ApiBroker.AssignNormalValue("domPosition", para.DomPosition);
|
u8ApiBroker.AssignNormalValue("domPosition", para.DomPosition);
|
||||||
}
|
}
|
||||||
if (para.cnnFrom!=null)
|
if (para.cnnFrom != null)
|
||||||
{
|
{
|
||||||
u8ApiBroker.AssignNormalValue("cnnFrom", para.cnnFrom);
|
u8ApiBroker.AssignNormalValue("cnnFrom", para.cnnFrom);
|
||||||
} else
|
|
||||||
{
|
|
||||||
u8ApiBroker.AssignNormalValue("cnnFrom",null);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
u8ApiBroker.AssignNormalValue("cnnFrom", null);
|
||||||
|
}
|
||||||
|
|
||||||
if (para.DOMMsg != null)
|
if (para.DOMMsg != null)
|
||||||
{
|
{
|
||||||
u8ApiBroker.AssignNormalValue("domMsg", para.DOMMsg);
|
u8ApiBroker.AssignNormalValue("domMsg", para.DOMMsg);
|
||||||
|
|||||||
Reference in New Issue
Block a user