From 8badb57ea2c82557850ad5b39281c3e8714eb119 Mon Sep 17 00:00:00 2001
From: liuyan <liuyan@prec-tech.com>
Date: 星期四, 24 十一月 2022 10:08:31 +0800
Subject: [PATCH] 科室信息漏传SPO问题
---
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