From cc04ae515750a52edc2e51448b83a62e3a3f9ba2 Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Fri, 3 Jul 2026 11:45:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E9=85=8D=E7=BD=AE=20=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APT.BaseData.Services/Services/PF/PFFormService.cs | 14 ++++++++++++-- .../Controllers/Api/Table/FormController.cs | 5 +++++ 2 files changed, 17 insertions(+), 2 deletions(-) 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.连接数据库执行)