diff --git a/APT.BaseData.Services/Services/PF/PFFormService.cs b/APT.BaseData.Services/Services/PF/PFFormService.cs index dc85f31..a0d3c6b 100644 --- a/APT.BaseData.Services/Services/PF/PFFormService.cs +++ b/APT.BaseData.Services/Services/PF/PFFormService.cs @@ -1245,7 +1245,7 @@ namespace APT.BaseData.Services.DomainServices { if (mi.DeclaringType.Name == "T_PF_MENU" && mi.Name == "MineType") { - if (dstOrgId=="A3DCE14A-13D9-D879-D9AB-821D4A3F1F93") + if (dstOrgId == "A3DCE14A-13D9-D879-D9AB-821D4A3F1F93") { continue;//wyw 菜单导出 功能优化 SMS 没有 MineType } @@ -1359,7 +1359,12 @@ namespace APT.BaseData.Services.DomainServices string field = item.Key; string value = item.Value; if (string.Compare(value, "NULL") != 0 && value.IndexOf("to_date", StringComparison.OrdinalIgnoreCase) == -1) - value = "'" + value + "'"; + { + if (field == "ORG_ID") + value = "@ORG_ID"; + else + value = "'" + value + "'"; + } if (dataBaseType == DataBaseType.Postgresql) field = "\"" + field + "\""; 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) id = value; + else if (field == "ORG_ID") + { + upBuilder.Append(field + "=@ORG_ID,"); + upFieldBuilder.Append(field + "=@ORG_ID,"); + } else { upBuilder.Append(field + "=" + value + ","); diff --git a/APT.MicroApi/APT.PF.WebApi/Controllers/Api/Table/FormController.cs b/APT.MicroApi/APT.PF.WebApi/Controllers/Api/Table/FormController.cs index 9f011fc..4f96a63 100644 --- a/APT.MicroApi/APT.PF.WebApi/Controllers/Api/Table/FormController.cs +++ b/APT.MicroApi/APT.PF.WebApi/Controllers/Api/Table/FormController.cs @@ -485,6 +485,10 @@ namespace APT.PF.WebApiControllers.Api.PF } 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.下载语法文件) { var tmpDatabaseType = databaseType == 0 ? DataBaseType.SQL : (DataBaseType)databaseType; @@ -508,6 +512,7 @@ namespace APT.PF.WebApiControllers.Api.PF this.AddEntity(file); return "PF/File/GetFile?id=" + file.ID; } + sb.AppendLine("go "); return sb.ToString(); } else if (formConfigSqlType == PFFormConfigSqlTypeEnum.连接数据库执行)