From 1ce13a35baf4d4a8cd047aacfb27afaae3278073 Mon Sep 17 00:00:00 2001
From: zhangzhengmei <zhangzhengmei@prec-tech.com>
Date: 星期四, 18 五月 2023 14:06:28 +0800
Subject: [PATCH] Merge branch 'LEX_dev' into LEX_zhangzhengmei_dev

---
 force-app/main/default/classes/otherButtonRepairController.cls |   48 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/force-app/main/default/classes/otherButtonRepairController.cls b/force-app/main/default/classes/otherButtonRepairController.cls
index 986cab3..1907e8d 100644
--- a/force-app/main/default/classes/otherButtonRepairController.cls
+++ b/force-app/main/default/classes/otherButtonRepairController.cls
@@ -309,7 +309,7 @@
 
     //閫氳繃Is_Validity__c鍜孖d瀛楁鏌ヨAccount鐨勮褰曞苟杩斿洖
     @AuraEnabled
-    public static List<Account> queryForFindInvalidLicense(Boolean isValidity,String dealerId){
+    public static List<Account> queryForFindInvalidLicense(String dealerId){
         try {
             List<Account> accounts = [select Id,Is_Validity__c from Account where Is_Validity__c = false And Id = :dealerId];
             return accounts;
@@ -342,10 +342,9 @@
 
     //閫氳繃Id鏌ヨRepair__c涓殑Dealer__c锛屽啀鏍规嵁Dealer__c鏌ヨAccount涓殑璁板綍骞惰繑鍥�
     @AuraEnabled
-    public static List<Account> queryForrecords3(String recordId){
+    public static List<Account> queryForrecords3(String dealer){
         try {
-            Repair__c repair = [select Repair__c.Dealer__c from Repair__c where Id =:recordId];
-           List<Account> accounts = [select id, FirstParagraph__c from Account where name =:repair.Dealer__c]; 
+           List<Account> accounts = [SELECT id, FirstParagraph__c from Account where name =:dealer]; 
            return accounts;
         } catch (Exception e) {
             throw new AuraHandledException(e.getMessage());
@@ -355,24 +354,24 @@
     //鏇存柊Repair__c涓殑璁板綍锛屽皢Maintenance_Contract__c鍜孧aintenanceContractType__c瀛楁鏇存柊涓虹┖锛岃嫢鎹曡幏鍒板紓甯稿垯杩斿洖閿欒淇℃伅
     @AuraEnabled
     public static String updateForRepair1(String recordId){
+        String res='';
         try {
             Repair__c repair = new Repair__c();
-            repair.ID = recordId;
+            repair.Id = recordId;
             repair.Maintenance_Contract__c = null;
             repair.MaintenanceContractType__c = null;
             update repair;
             return null;
         } catch (Exception e) {
-            String eMessage = e.getMessage();
-            Integer left = eMessage.indexOf(',') + 1;
-            Integer right = eMessage.length();
-            return eMessage.substring(left,right);
+            res = e.getMessage();
         }
+        return res;
     }
 
     //鏇存柊Repair__c涓殑璁板綍锛岃嫢鎹曡幏鍒板紓甯稿垯杩斿洖閿欒淇℃伅
     @AuraEnabled
     public static String updateRepair2(String recordId,User staff,Boolean DWSign,String statusc,String DOJStatus,String SAPcondition){
+        String res='';
         try {
             Repair__c repair = new Repair__c();
             repair.Id = recordId;
@@ -399,15 +398,36 @@
             repair.SAP_Transfer_time__c = Datetime.now();
           }
           update repair;
-          return null;
         } catch (Exception e) {
-            String eMessage = e.getMessage();
-            Integer left = eMessage.indexOf(',') + 1;
-            Integer right = eMessage.length();
-            return eMessage.substring(left,right);
+             res = e.getMessage();
         }
+        return res;
     }
 
+     // 鏌ユ壘绠�妗�
+     @AuraEnabled
+     public static List<Profile> initSelectProfile(String profileId){
+         List<Profile> res = new List<Profile>();
+         try{
+             res = [SELECT Id,name FROM Profile WHERE Id=: profileId ];
+         }catch(Exception e){
+             System.debug(LoggingLevel.INFO, '*** e: ' + e);
+         }
+         return res;
+     }
+
+      // 鏌ユ壘UserName
+      @AuraEnabled
+      public static List<User> initUserName(String userId){
+          List<User> res = new List<User>();
+          try{
+              res = [SELECT Id,name FROM User WHERE Id=: userId ];
+          }catch(Exception e){
+              System.debug(LoggingLevel.INFO, '*** e: ' + e);
+          }
+          return res;
+      }
+
     public class InitData{
         @AuraEnabled
         public String detailedAddress;

--
Gitblit v1.9.1