导出配置 功能优化

This commit is contained in:
wyw 2026-07-03 11:45:19 +08:00
parent f4146f674e
commit cc04ae5157
2 changed files with 17 additions and 2 deletions

View File

@ -1359,7 +1359,12 @@ namespace APT.BaseData.Services.DomainServices
string field = item.Key; string field = item.Key;
string value = item.Value; string value = item.Value;
if (string.Compare(value, "NULL") != 0 && value.IndexOf("to_date", StringComparison.OrdinalIgnoreCase) == -1) if (string.Compare(value, "NULL") != 0 && value.IndexOf("to_date", StringComparison.OrdinalIgnoreCase) == -1)
{
if (field == "ORG_ID")
value = "@ORG_ID";
else
value = "'" + value + "'"; value = "'" + value + "'";
}
if (dataBaseType == DataBaseType.Postgresql) if (dataBaseType == DataBaseType.Postgresql)
field = "\"" + field + "\""; field = "\"" + field + "\"";
else if (DB_KEYWORDS.Any(t => (string.Compare(t, field, true) == 0)))//关键字加引号 else if (DB_KEYWORDS.Any(t => (string.Compare(t, field, true) == 0)))//关键字加引号
@ -1367,6 +1372,11 @@ namespace APT.BaseData.Services.DomainServices
if (string.Compare(field, (dataBaseType == DataBaseType.Postgresql ? "\"ID\"" : "ID"), true) == 0) if (string.Compare(field, (dataBaseType == DataBaseType.Postgresql ? "\"ID\"" : "ID"), true) == 0)
id = value; id = value;
else if (field == "ORG_ID")
{
upBuilder.Append(field + "=@ORG_ID,");
upFieldBuilder.Append(field + "=@ORG_ID,");
}
else else
{ {
upBuilder.Append(field + "=" + value + ","); upBuilder.Append(field + "=" + value + ",");

View File

@ -485,6 +485,10 @@ namespace APT.PF.WebApiControllers.Api.PF
} }
if (list != null && list.Any()) if (list != null && list.Any())
{ {
sb.AppendLine("--USE [mh_jy_bt]");
sb.AppendLine("--GO ");
sb.AppendLine("declare @ORG_ID varchar(50) ");
sb.AppendLine("set @ORG_ID= ( select top 1 ID from T_FM_ORGANIZATION ) -- 可能需要动态调整 ");
if (formConfigSqlType == PFFormConfigSqlTypeEnum. || formConfigSqlType == PFFormConfigSqlTypeEnum.) if (formConfigSqlType == PFFormConfigSqlTypeEnum. || formConfigSqlType == PFFormConfigSqlTypeEnum.)
{ {
var tmpDatabaseType = databaseType == 0 ? DataBaseType.SQL : (DataBaseType)databaseType; var tmpDatabaseType = databaseType == 0 ? DataBaseType.SQL : (DataBaseType)databaseType;
@ -508,6 +512,7 @@ namespace APT.PF.WebApiControllers.Api.PF
this.AddEntity(file); this.AddEntity(file);
return "PF/File/GetFile?id=" + file.ID; return "PF/File/GetFile?id=" + file.ID;
} }
sb.AppendLine("go ");
return sb.ToString(); return sb.ToString();
} }
else if (formConfigSqlType == PFFormConfigSqlTypeEnum.) else if (formConfigSqlType == PFFormConfigSqlTypeEnum.)