From e3c02c03dd2de442bbced87236f60a13a1cd154e Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期四, 02 三月 2023 17:51:57 +0800
Subject: [PATCH] gzw 正式环境最新代码更新
---
force-app/main/default/classes/CommonUtils.cls | 46 +++++++++++++++++++++++++---------------------
1 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/force-app/main/default/classes/CommonUtils.cls b/force-app/main/default/classes/CommonUtils.cls
index 8e650a6..cdb584a 100644
--- a/force-app/main/default/classes/CommonUtils.cls
+++ b/force-app/main/default/classes/CommonUtils.cls
@@ -28,27 +28,31 @@
//鏌ヨ 鏅�氱瀹�
- // public static string GetPTKS(String content,String ParentId)
- // {
- // String paramYy = 'HP';
- // String sql = 'select ';
- // String props = GetSqlToPorps(account.SObjectType);
- // sql += props;
- // sql += ' from account';
- // sql += ' where Parent.Parent.RecordType_DeveloperName__c = :paramYy';
- // if(content != null && content != '')
- // {
- // content = '%'+content+'%';
- // sql += ' and Name like :content ';
- // }
- // if(ParentId != null && ParentId != '')
- // {
- // sql += ' and Parentid = :ParentId ';
- // }
- // sql += ' limit 5 ';
- // List<account> arrays = Database.query(sql);
- // return JSON.serialize(arrays);
- // }
+ public static string GetPTKS(String content, List<String> ParentIds, Boolean checkOwner)
+ {
+ String paramYy = 'HP';
+ String sql = 'select ';
+ String props = GetSqlToPorps(account.SObjectType);
+ sql += props;
+ sql += ' from account';
+ sql += ' where Parent.Parent.RecordType_DeveloperName__c = :paramYy';
+ if(content != null && content != '')
+ {
+ content = '%'+content+'%';
+ sql += ' and Name like :content ';
+ }
+ if(ParentIds != null && ParentIds.size() > 0)
+ {
+ sql += ' and Parent.Parentid in :ParentIds ';
+ }
+ if (checkOwner) {
+ String userId = UserInfo.getUserId();
+ sql += ' and OwnerId = :userId';
+ }
+ sql += ' limit 5 ';
+ List<account> arrays = Database.query(sql);
+ return JSON.serialize(arrays);
+ }
//鏌ヨ 鏅�氱瀹�
--
Gitblit v1.9.1