修改工艺卡生成word时化学元素AS显示不对问题

master
孙亮 11 months ago
parent 46de7a7f8a
commit 02aa2a7b68

@ -819,6 +819,11 @@ namespace BP.En
{
if (this.Row.GetValByKey(key) != null)
return this.Row.GetValByKey(key).ToString();
#region @BKGY 2023-12-26
if (this.Row.GetValByKey(key).ToString() == "@RDT") {
return this.Row.GetValByKey(key).ToString().Replace("@RDT", DataType.CurrentDateTime);
}
#endregion
return "";
}
public string GetValStrByKey(string key, string isNullAs)

@ -18,6 +18,7 @@ using System.Collections.Generic;
using Spire.Doc.Documents;
using NPOI.SS.Formula.Functions;
using System.Diagnostics;
using NPOI.SS.Formula.Eval;
namespace BP.Pub
@ -1465,14 +1466,7 @@ trgaph108\trleft5\trbrdrl\brdrs\brdrw10 \trbrdrt\brdrs\brdrw10 \trbrdrr\brdrs\br
string name = D3.Split(',')[i].ToString();
if (name.Length > 1)
{
if (name == "ASYS")
{
name = "As";
}
else
{
name = name.Substring(0, 1).ToUpper() + name.Substring(1).ToLower();//将元素改成首位大写次位小写
}
name=name.Substring(0, 1).ToUpper() + name.Substring(1).ToLower();
}
//如果都没有值择把这个元素移除
@ -1688,11 +1682,6 @@ trgaph108\trleft5\trbrdrl\brdrs\brdrw10 \trbrdrt\brdrs\brdrw10 \trbrdrr\brdrs\br
sql += "and " + D1 + "='" + D1date.Split(',')[j] + "'";
}
string named3 = D3date.Split(',')[d3Knum].ToString();
//取数据时再将As转回未ASYS否则取不到数据
if (named3=="As")
{
named3 = "ASYS";
}
int ss = data.Select(sql).Count();
string ds = data.Select(sql)[0][named3].ToString();
//if (string.IsNullOrEmpty(ds))
@ -1720,13 +1709,7 @@ trgaph108\trleft5\trbrdrl\brdrs\brdrw10 \trbrdrt\brdrs\brdrw10 \trbrdrr\brdrs\br
{
sql += "and " + D1 + "='" + D1date.Split(',')[j] + "'";
}
string named3 = D3date.Split(',')[d3Knum].ToString();
//取数据时再将As转回未ASYS否则取不到数据
if (named3 == "As")
{
named3 = "ASYS";
}
string ds = data.Select(sql)[0][named3].ToString();
string ds = data.Select(sql)[0][D3date.Split(',')[d3Knum].ToString()].ToString();
//if (string.IsNullOrEmpty(ds))
//{
// ds = "W";
@ -1930,6 +1913,16 @@ trgaph108\trleft5\trbrdrl\brdrs\brdrw10 \trbrdrt\brdrs\brdrw10 \trbrdrr\brdrs\br
str = GetRtfStr(str, "<" + para + ">");
continue;
}
//@BKGY 工艺卡的被隐藏的编制字段,打印赋值
val = val.Replace("@WebUser.No", WebUser.No);
val = val.Replace("@WebUser.Name", WebUser.Name);
val = val.Replace("@WebUser.FK_DeptName", WebUser.DeptName);
val = val.Replace("@WebUser.FK_Dept", WebUser.DeptNo);
val = val.Replace("@WebUser.OrgNo", WebUser.OrgNo);
val = val.Replace("@RDT", DataType.CurrentDateTime);
val = val.Replace("\\", "\\\\");
val = this.GetCode(val);
str = str.Replace("<" + para + ">", val);

Loading…
Cancel
Save