From d79fcb2a960e8b0e18fe039d892f98187b08866d Mon Sep 17 00:00:00 2001
From: 李彤 <litong@prec-tech.com>
Date: 星期五, 23 九月 2022 18:24:58 +0800
Subject: [PATCH] 招标项目失单报告

---
 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