From a8628cfe2640797ba9265e9be46c42430d9e7eba Mon Sep 17 00:00:00 2001
From: twysparks <twysparks@163.com>
Date: 星期一, 26 六月 2023 10:01:44 +0800
Subject: [PATCH] 服务按钮样式调整

---
 force-app/main/default/classes/otherButtonRepairController.cls |   60 +++++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/force-app/main/default/classes/otherButtonRepairController.cls b/force-app/main/default/classes/otherButtonRepairController.cls
index 7e007a7..9e58449 100644
--- a/force-app/main/default/classes/otherButtonRepairController.cls
+++ b/force-app/main/default/classes/otherButtonRepairController.cls
@@ -7,12 +7,13 @@
     public static InitData init(String recordId){
         InitData res = new initData();
         try{
-            Repair__c report =  [SELECT AWS_Data_Id__c,SAP_condition__c,DOJ_Status__c,DW_Sign__c,Incharge_Staff__r.Id,URF_Reapir__c,Recall_Correspondence__c,Day_later_30__c,Dealer__r.Id,Status__c,URFLimitSerial__c,Maintenance_Contract__r.Id,FSE_ApplyForRepair_time__c,Delivered_Product__r.Id,Asset_Owner__c,State_Hospital__c,is_aohui_product__c,Sales_Dept_HP__c,RCCD__c,Quick_Repair_Sign__c,RepairSource__c,FSE_State__c,VM_Maintenance_Contract__c,Maintenance_Contract__c,NewProductGuarante_Txt__c,Number_of_EffectiveContract__c,Detailed_Address__c,Status1__c,Rental_Apply_Equipment_Set_Detail__c,Rental_Apply_Equipment_Set_Detail_Id__c,Latest_Collect_Date_Priority__c,if_Rental_Apply__c,Offer_Rental_New__c,ProduceCompany_hand__c,CFDA_No_Hand__c,MBC_AwareDate__c,InsReport__c,QIS_ID__c,On_Call_ID__c,RepairSubOrder__c,ProductFailureRelated__c,Delay15Min__c,ProblemOccurredSelect__c,Repair_Source__c ,Failure_Occurrence_Date__c ,MaintenanceContractType__c ,OperationOrExaminationName__c ,WhatProject__c ,FailureQInHospital__c ,ReportAdverseEvents__c ,InformationFrom__c ,AfterFailureInformation__c ,ProblemOccurred__c ,SupportingProducts__c ,ifDeadHurt__c ,UseFailProductFinish__c ,DelayReportReason__c ,BreakORFallOff__c ,DateReceiptQuestions__c ,DeliveryLogisticsAnnotation__c ,DeliveryLogisticsNo__c ,engineerSendDate__c ,DeliveryLogisticsMode__c ,RepairApplicantDepartment__c ,RepairApplicantHospital__c ,RepairApplicant__c ,Repair_Detail__c ,Returns_Product_way__c ,work_location_select__c ,On_site_repair__c ,SalesOfficeCode_selection__c ,Incharge_Staff_Contact__c ,Incharge_Staff__c ,Dealer__c ,RepairCostType__c ,Account__c,Department_Class__c ,Hospital__c ,PaperRepairRequestNo__c ,part_arrangement_complete__c,Repair_Shipped_Date__c,OCSMAdministrativeReportStatus__c,Incharge_Staff_Email__c,Name,HP_Name__c,Delivered_Product__c,
+            Repair__c report =  [SELECT HP_active__c,AWS_Data_Id__c,SAP_condition__c,DOJ_Status__c,DW_Sign__c,Incharge_Staff__r.Id,URF_Reapir__c,Recall_Correspondence__c,Day_later_30__c,Dealer__r.Id,Status__c,URFLimitSerial__c,Maintenance_Contract__r.Id,FSE_ApplyForRepair_time__c,Delivered_Product__r.Id,Asset_Owner__c,State_Hospital__c,is_aohui_product__c,Sales_Dept_HP__c,RCCD__c,Quick_Repair_Sign__c,RepairSource__c,FSE_State__c,VM_Maintenance_Contract__c,Maintenance_Contract__c,NewProductGuarante_Txt__c,Number_of_EffectiveContract__c,Detailed_Address__c,Status1__c,Rental_Apply_Equipment_Set_Detail__c,Rental_Apply_Equipment_Set_Detail_Id__c,Latest_Collect_Date_Priority__c,if_Rental_Apply__c,Offer_Rental_New__c,ProduceCompany_hand__c,CFDA_No_Hand__c,MBC_AwareDate__c,InsReport__c,QIS_ID__c,On_Call_ID__c,RepairSubOrder__c,ProductFailureRelated__c,Delay15Min__c,ProblemOccurredSelect__c,Repair_Source__c ,Failure_Occurrence_Date__c ,MaintenanceContractType__c ,OperationOrExaminationName__c ,WhatProject__c ,FailureQInHospital__c ,ReportAdverseEvents__c ,InformationFrom__c ,AfterFailureInformation__c ,ProblemOccurred__c ,SupportingProducts__c ,ifDeadHurt__c ,UseFailProductFinish__c ,DelayReportReason__c ,BreakORFallOff__c ,DateReceiptQuestions__c ,DeliveryLogisticsAnnotation__c ,DeliveryLogisticsNo__c ,engineerSendDate__c ,DeliveryLogisticsMode__c ,RepairApplicantDepartment__c ,RepairApplicantHospital__c ,RepairApplicant__c ,Repair_Detail__c ,Returns_Product_way__c ,work_location_select__c ,On_site_repair__c ,SalesOfficeCode_selection__c ,Incharge_Staff_Contact__c ,Incharge_Staff__c ,Dealer__c ,RepairCostType__c ,Account__c,Department_Class__c ,Hospital__c ,PaperRepairRequestNo__c ,part_arrangement_complete__c,Repair_Shipped_Date__c,OCSMAdministrativeReportStatus__c,Incharge_Staff_Email__c,Name,HP_Name__c,Delivered_Product__c,
             Repair_Product_Serial_No__c,Service_Repair_No__c,Repair_Firstestimated_Date__c,
             Repair_Estimated_Date__c,RC_information__c,Id,OCSMAdministrativeReportNumber__c,
             OCSMAdministrativeReportDate__c,Aware_date__c,PAE_Determine__c,ETQ_UPLOAD_STATUS__c,
             AE_DetermineResult__c,PAE_DetermineAC__c,Repair_Inspection_Date__c,Contain_UseRSA__c FROM Repair__c WHERE Id =: recordId LIMIT 1];
             System.debug(LoggingLevel.INFO, '*** opp: ' + report);
+            res.HPActiveC = report.HP_active__c;
             res.detailedAddress = report.Detailed_Address__c;
             res.numberofEffectiveContract = report.Number_of_EffectiveContract__c;
             res.newProductGuaranteTxt = report.NewProductGuarante_Txt__c;
@@ -141,7 +142,8 @@
 
     // 鏍规嵁ID淇敼淇悊
     @AuraEnabled
-    public static void updateRepair(String recordId){
+    public static String updateRepair(String recordId){
+        String res;
         try {
             Repair__c repair = new Repair__c();
             repair.Id = recordid;
@@ -149,8 +151,10 @@
             update repair;
         } catch (Exception e) {
             System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            res=e.getMessage();
         }
-    }
+        return res;
+    } 
 
     // 淇敼楠屾敹鍗�
     @AuraEnabled
@@ -306,7 +310,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;
@@ -339,10 +343,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());
@@ -352,24 +355,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;
@@ -396,17 +399,40 @@
             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 HPActiveC;
+        @AuraEnabled
         public String detailedAddress;
         @AuraEnabled
         public String numberofEffectiveContract;

--
Gitblit v1.9.1