From 2768cebeb80753586dcc25b352913c3b5b5b6cd1 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期五, 21 四月 2023 17:58:11 +0800
Subject: [PATCH] 修改按钮4.21

---
 force-app/main/default/classes/QISReportController.cls |  667 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 641 insertions(+), 26 deletions(-)

diff --git a/force-app/main/default/classes/QISReportController.cls b/force-app/main/default/classes/QISReportController.cls
index e2eb1d3..296a17c 100644
--- a/force-app/main/default/classes/QISReportController.cls
+++ b/force-app/main/default/classes/QISReportController.cls
@@ -1,4 +1,5 @@
 public with sharing class QISReportController {
+    // Final universal code缂栬緫
    @AuraEnabled
     public static InitData initForQisUniversalFailureCodeButton (String recordId){
         InitData res = new initData();
@@ -15,10 +16,11 @@
     @AuraEnabled
     public  static InitData sqlForPAE (String qisReportId){
         InitData res = new initData();
-        String RecordTypeId = 'ASACDecision';
+        
+        String recordTypeId = LightingButtonConstant.DEVELOPER_NAME_ASAC_DECISION;
         try{
-            PAE_DecisionRecord__c RCPAED_IdList = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_QIS__c = :qisReportId  And RecordType.DeveloperName =  :RecordTypeId limit 1]; 
-            res.PAEid = RCPAED_IdList.id;
+            PAE_DecisionRecord__c RCPAEDIdList = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_QIS__c = :qisReportId  And RecordType.DeveloperName =  :recordTypeId limit 1]; 
+            res.pAEid = RCPAEDIdList.id;
             System.debug(LoggingLevel.INFO, '*** res: ' + res);
         }catch(Exception e){
             System.debug(LoggingLevel.INFO, '*** e: ' + e);
@@ -26,6 +28,35 @@
         return res;
     }
 
+    //Intake universal code缂栬緫
+    @AuraEnabled
+    public static InitData initForlexQISIntakeuniversalcodeButton (String recordId){
+        InitData res = new initData();
+        try{
+            QIS_Report__c report = [SELECT  id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];  
+            res.Id = report.Id;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public  static InitData sqlForPAE1 (String qisReportId){
+        InitData res = new initData();
+        
+        String recordTypeId = LightingButtonConstant.DEVELOPER_NAME_ASRC_DECISION;
+        try{
+            PAE_DecisionRecord__c ASRCDIdList = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_QIS__c = :qisReportId  And RecordType.DeveloperName =  :recordTypeId Limit 1]; 
+            res.pAEid = ASRCDIdList.id;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+    //OSH鐜板搧鏀跺埌
     @AuraEnabled
     public static InitData initForOSHRecievedButton (String recordId){
         InitData res = new initData();
@@ -45,13 +76,12 @@
         String re = '鎴愬姛';
         try{
             ID myUserID = UserInfo.getUserId();
+            
             User tempUser = [select id,Alias,Email from user where id = : myUserID ];
             QIS_Report__c rac  = new QIS_Report__c();   
             rac.id = recordId;
-            rac.QIS_Status__c = 'OSH妫�娴嬩腑';
-            // 寰呰ˉ鍏�
+            rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_OSH_TESTING;
             rac.OSHRecievedDate__c  = Date.today();
-            System.debug( 'OSHRecievedDate__c=' + rac.OSHRecievedDate__c);
             rac.OSH_Receive_staff__c = tempUser.Alias;
             rac.OSH_staff__c = tempUser.Alias;
             rac.OSH_staff_email__c = tempUser.email;
@@ -75,7 +105,7 @@
          return re;
     }
 
-
+    //鎻愪氦寰呭鎵�1
     @AuraEnabled
     public static InitData initForOSHSubmitButton (String recordId){
         InitData res = new initData();
@@ -95,9 +125,10 @@
     public static String updateQis1 (String recordId){
         String re = '鎴愬姛';
         try{
+            
             QIS_Report__c rac  = new QIS_Report__c();   
             rac.id = recordId;
-            rac.QIS_Status__c = 'OSH濉啓瀹屾瘯';
+            rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_OSH_COMPLATED;
             update rac;
         }catch(Exception e){
             System.debug(LoggingLevel.INFO, '*** e: ' + e);
@@ -105,7 +136,7 @@
         }
          return re;
     }
-
+    //鎻愪氦寰呭鎵�
      @AuraEnabled
     public static InitData initForRCSubmitButton (String recordId){
         InitData res = new initData();
@@ -130,13 +161,14 @@
     @AuraEnabled
     public static String updateQisWithRC (String recordId,String type,String oldQIStatus){
         String re = '鎴愬姛';
+        
         ID myUserID = UserInfo.getUserId();
         User userinfo = [SELECT Id, JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c, BuchangApprovalManagerSales__c, SalesManager__c FROM User WHERE Id = :myUserID LIMIT 1];  
         QIS_Report__c rac  = new QIS_Report__c();  
         rac.id = recordId;
         if (type == '1') {
             QIS_Report__c report1 = [SELECT  id,RC_problem_not_found__c,RC_FixedJudgement__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];  
-            rac.QIS_Status__c = 'RC濉啓瀹屾瘯';
+            rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_RC_COMPLATED;
             if (report1.RC_problem_not_found__c == true && report1.RC_FixedJudgement__c == false) {
                 QIS_Report__c qisreport = [SELECT Id, Reason_bloken__c, Special_follow__c, next_action__c, QIS_Reply_Comment__c, OCM_judgement__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
                 if (qisreport != null) {
@@ -149,7 +181,7 @@
             }
         }
         if (type == '2') {
-            rac.QIS_Status__c = '鍙栨秷鐢宠';
+            rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_CANCEL;
             rac.QIS_Cancel_Submit_day__c  = Date.today();
         }
         try{
@@ -159,7 +191,7 @@
                 rac.RC_Manager__c = myUserID;
             }
             if (userinfo!=null) {
-                if (oldQIStatus == 'RC妫�娴嬩腑') {
+                if (oldQIStatus == LightingButtonConstant.STATUS_QIS_RC_CHECKING) {
                     rac.RC__c = myUserID;
                 }
                 if (userinfo.SalesManager__c != null ) {
@@ -185,7 +217,7 @@
         }
          return re;
     }
-
+    // 鎻愪氦
      @AuraEnabled
     public static InitData initForOCMSubmitButton (String recordId){
         InitData res = new initData();
@@ -213,7 +245,7 @@
         try{
             QIS_Report__c rac  = new QIS_Report__c();   
             rac.id = recordId;
-            rac.QIS_Status__c = 'FSE濉啓瀹屾瘯';
+            rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_FSE_COMPLATED;
             rac.OCM_Manager_Mail__c = report.OCM_Manager_Mail_F__c;
             rac.OCM_Member_Mail__c = report.OCM_Member_Mail_F__c;
             rac.OCM_Repair_Mail__c = report.OCM_Repair_Mail_F__c;
@@ -225,8 +257,8 @@
             if (report.is_aohui_product__c == true) {
                     rac.OCM_judgement__c = '璐ㄩ噺闂';
                     rac.next_action__c = '鏃犲伩缁翠慨';
-                    rac.RecordTypeId = '01210000000RLWm';
-                    rac.QIS_Status__c = 'OSH妫�娴嬬敵璇�';
+                    rac.RecordTypeId = Schema.SObjectType.QIS_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_OSH).getRecordTypeId();
+                    rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_OSH_TESTING_APP;
             }
             if (report.QuolityApproveResult__c == null || report.QuolityApproveResult__c == '') {
                 rac.QuolityApproveResult__c = '3.宸插鏍革紝涓�鑸川閲忛棶棰�';
@@ -238,32 +270,615 @@
         }
          return re;
     }
+
+    // QIS缁撴灉璺熻繘瀹屾瘯
+     @AuraEnabled
+    public static InitData initForQisAgreeButton (String recordId){
+        InitData res = new initData();
+        try{
+            QIS_Report__c report = [SELECT  id ,OwnerId FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];  
+            res.Id = report.Id;
+            res.ownerId = report.OwnerId;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForQisAgree (String recordId){
+        String re = '鎴愬姛';
+        ID myUserID = UserInfo.getUserId();
+        
+        String answerComp = Schema.SObjectType.QIS_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_OSH_FINASH).getRecordTypeId();
+        String fina = Schema.SObjectType.QIS_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_FINAL).getRecordTypeId();
+        String comp = Schema.SObjectType.QIS_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_COMP).getRecordTypeId();
+        // RecordType rectyp = [SELECT id ,name FROM RecordType where  id = '01210000000gFTH'];
+        QIS_Report__c report = [SELECT  id,OwnerId,RecordTypeId FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+        try{
+            if (report.ownerid == myUserID) {
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_COMPLATED;
+                if (report.RecordTypeId == answerComp) {
+                    rac.RecordTypeId = fina;
+                }else{
+                    rac.RecordTypeId = comp;
+                }
+                rac.QIS_Complete_Day__c  = Date.today();
+                update rac;
+            }
+            
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+    //OCSM鏈嶅姟鏈儴CDS瀹屾瘯
+    @AuraEnabled
+    public static InitData initForRCCDScompleteButton (String recordId){
+        InitData res = new initData();
+        try{
+            QIS_Report__c report = [SELECT  id ,CDS_date__c,QIS_Status__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];  
+            res.Id = report.Id;
+            res.cdsdate = report.CDS_date__c;
+            res.QIStatus = report.QIS_Status__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForRCCDScomplete (String recordId){
+        String re = '鎴愬姛';
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Alias__c FROM User WHERE Id = :myUserID LIMIT 1];  
+        QIS_Report__c report = [SELECT  id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+        try{
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.CDS_date__c  = Date.today();
+                rac.RC_CDS_staff__c  = userinfo.Alias__c;
+                update rac;        
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+    //OCSM涓嶈鎶ュ憡
+    @AuraEnabled
+    public static InitData initForlexOCSMNoToReportLightingButton (String recordId){
+        InitData res = new initData();
+        try{
+            QIS_Report__c report = [SELECT  id ,OCSMAdministrativeReportNumber__c,OCSMAdministrativeReportDate__c,Aware_date__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];  
+            res.Id = report.Id;
+            res.oCSMAdministrativeReportNumber = report.OCSMAdministrativeReportNumber__c;
+            res.oCSMAdministrativeReportDate = report.OCSMAdministrativeReportDate__c;
+            res.Awaredate = report.Aware_date__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+    @AuraEnabled
+    public static String updateQisForlexOCSMNoToReportLighting (String recordId){
+        String re = '鎴愬姛'; 
+        QIS_Report__c report = [SELECT  id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+        try{
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.OCSMAdministrativeReportStatus__c = '鏃犻渶鎶ュ憡';
+                update rac;        
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+    //OCSM瑕佹姤鍛�
+    @AuraEnabled
+    public static InitData initForlexOCSMToReportLightingButton (String recordId){
+        InitData res = new initData();
+        try{
+            QIS_Report__c report = [SELECT  id ,OCSMAdministrativeReportStatus__c,Aware_date__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];  
+            res.Id = report.Id;
+            res.oCSMAdministrativeReportStatus = report.OCSMAdministrativeReportStatus__c;
+            res.Awaredate = report.Aware_date__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForlexOCSMToReportLighting (String recordId){
+        String re = '鎴愬姛'; 
+        QIS_Report__c report = [SELECT  id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+        try{
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.OCSMAdministrativeReportStatus__c  = '寰呮姤鍛�';
+                update rac;        
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+
+    //鍙戦�丵IS鍒癝PO
+    @AuraEnabled
+    public static InitData initForlexSendQISButton (String recordId){
+        InitData res = new initData();
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Profile.name FROM User WHERE Id = :myUserID LIMIT 1];
+        try{
+            QIS_Report__c report = [SELECT  id ,RecordTypeId,IsSendQIS__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+            RecordType rec = [SELECT id,name FROM RecordType where  Id = :report.RecordTypeId];
+            res.Id = report.Id;
+            res.qisRecordTypeId = report.RecordTypeId;
+            res.qisRecordName = rec.name;
+            res.profileName = userinfo.Profile.name;
+            res.IsSendQIS = report.IsSendQIS__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForSendQIS (String recordId){
+        String re = '鎴愬姛'; 
+        QIS_Report__c report = [SELECT Id,Name,IsSendQIS__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+        if(report == null ){
+            return '娌℃湁QIS锛�' + recordId + '鐨勬暟鎹��';
+        }
+        Savepoint sp = Database.setSavepoint(); 
+        try{    
+                
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.IsSendQIS__c = true;
+                update rac;
+        }catch(Exception e){
+            Database.rollback(sp);
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+    // OCSM鏈嶅姟鏈儴鏀跺埌瀹炵墿
+    @AuraEnabled
+    public static InitData initForlexRCRecievedButton (String recordId){
+        InitData res = new initData();
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Profile.name FROM User WHERE Id = :myUserID LIMIT 1];
+        try{
+            QIS_Report__c report = [SELECT  id ,isAE_Profile__c,QIS_Status__c,isPAE_Profile__c,is_CNBuy__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+            res.Id = report.Id;
+            res.isAEProfile = report.isAE_Profile__c;
+            res.isPAEProfile = report.isPAE_Profile__c;
+            res.QIStatus = report.QIS_Status__c;
+            res.isCNBuy = report.is_CNBuy__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForRCRecieved (String recordId){
+        String re = '鎴愬姛'; 
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Alias,BuchangApprovalManagerSales__c,JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c FROM User WHERE Id = :myUserID LIMIT 1];
+
+        try{    
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+
+                rac.QIS_Status__c = 'RC妫�娴嬩腑';
+                rac.OCM_RC_RecievedDate__c = Date.today();
+                rac.RC__c = myUserID;
+                rac.RC_Receive_staff__c = userinfo.Alias;
+
+                if (userinfo != null  && userinfo.BuchangApprovalManagerSales__c!= null) {
+                    rac.RC_Manager__c = userinfo.BuchangApprovalManagerSales__c;
+                } else {
+                    rac.RC_Manager__c = myUserID;
+                }
+                update rac;
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+    // QIS甯傚満閮ㄦ剰瑙�
+    @AuraEnabled
+    public static InitData initForlexQISSCButton (String recordId){
+        InitData res = new initData();
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Profile.name FROM User WHERE Id = :myUserID LIMIT 1];
+        try{
+            QIS_Report__c report = [SELECT  id,name,QIS_SC_Report__c,QIS_SC_Id__c,next_action__c,QIS_Market_Category__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+            res.Id = report.Id;
+            res.name = report.name;
+            res.profileName = userinfo.Profile.name;
+            res.qISSCId = report.QIS_SC_Id__c;
+            res.qISSCReport = report.QIS_SC_Report__c;
+            res.nextaction = report.next_action__c;
+            res.qISMarketCategory = report.QIS_Market_Category__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+     // 鏂板缓淇悊
+    @AuraEnabled
+    public static InitData initForlexCreateRepairButton (String recordId){
+        InitData res = new initData();
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,RepairSalesPoint_Province_China__c FROM User WHERE Id = :myUserID LIMIT 1];
+        QIS_Report__c report = [SELECT  id,Owner.name,FailureQInHospital__c,InformationFrom__c,Delay15Min__c,
+                                AfterFailureInformation__c,Set_usage_product__c,BreakORFallOff__c,Opera_Name__c,
+                                Which_Project__c,Report_For_Goz__c,Relation_With_The_Problem__c,Damage_For_Doc_Or_Pat__c,
+                                Trable_occur_daY_collect__c,source_for_repair__c,Faliour_date__c,OwnerId,nonyushohin__c,nonyushohin__r.name,
+                                Hospital_Department__c,Hospital_Department__r.name,Department_Class__c,Department_Class__r.name,Hospital__c,Hospital__r.name,name,Source_OnCall__c,Source_OnCall__r.name,
+                                failuer_situation__c,Comment__c,Is_Used_For_The_Opera__c,RecordType_ID__c,
+                                OCM_judgement__c,next_action__c,Special_follow__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+        Account acc = [SELECT id,ParentId,Parent.RecordTypeId, 
+                        Parent.Parent.FSE_GI_Main_Leader__c,Parent.Parent.FSE_SP_Main_Leader__c,
+                        Parent.Parent.FSE_GI_Main_Leader__r.Work_Location__c,
+                        Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c FROM Account WHERE id = :report.Hospital_Department__c limit 1];
+        try{
+            
+            res.Id = report.Id;
+            res.qisRecordTypeId = report.RecordType_ID__c;
+            res.oCMjudgement = report.OCM_judgement__c;
+            res.nextaction = report.next_action__c;
+            res.comment = report.Comment__c;
+            res.sourceOnCall = report.Source_OnCall__c;
+            res.sourceOnCallname = report.Source_OnCall__r.name;
+            res.name = report.name;
+            res.hospitalId = report.Hospital__c;
+            res.hospitalname = report.Hospital__r.name;
+            res.departmentClassId = report.Department_Class__c;
+            res.departmentClassname = report.Department_Class__r.name;
+            res.hospitalDepartment = report.Hospital_Department__c;
+            res.hospitalDepartmentname = report.Hospital_Department__r.name;
+            res.nonyushohinId = report.nonyushohin__c;
+            res.nonyushohinIdname = report.nonyushohin__r.name;
+            res.ownerId = report.OwnerId;
+            res.faliourdate = report.Faliour_date__c;
+            res.sourceforrepair = report.source_for_repair__c;
+            res.repairSalesPointProvinceChina = userinfo.RepairSalesPoint_Province_China__c;
+            res.trableoccurdaYcollect = report.Trable_occur_daY_collect__c;
+            res.damageForDocOrPat = report.Damage_For_Doc_Or_Pat__c;
+            res.relationWithTheProblem = report.Relation_With_The_Problem__c;
+            res.reportForGoz = report.Report_For_Goz__c;
+            res.whichProject = report.Which_Project__c;
+            res.operaName = report.Opera_Name__c;
+            res.breakORFallOff = report.BreakORFallOff__c;
+            res.setusageproduct = report.Set_usage_product__c;
+            res.afterFailureInformation = report.AfterFailureInformation__c;
+            res.delay15Min = report.Delay15Min__c;
+            res.informationFrom = report.InformationFrom__c;
+            res.failureQInHospital = report.FailureQInHospital__c;
+            res.ownername = report.Owner.name;
+            res.failuerSituation = report.failuer_situation__c;
+            res.isUsedForTheOpera = report.Is_Used_For_The_Opera__c;
+            res.specialfollow = report.Special_follow__c;
+            res.accParentId = acc.ParentId;
+            res.accParentRecordTypeId = acc.Parent.RecordTypeId;
+            res.accParentParentFSEGIMainLeader = acc.Parent.Parent.FSE_GI_Main_Leader__c;
+            res.accParentParentFSEGIMainLeaderWorkLocation = acc.Parent.Parent.FSE_GI_Main_Leader__r.Work_Location__c;
+            res.accParentParentFSESPMainLeader = acc.Parent.Parent.FSE_SP_Main_Leader__c;
+            res.accParentParentFSESPMainLeaderWorkLocation = acc.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+     // PDF(QIS鐢宠涔�)
+    @AuraEnabled
+    public static InitData initForlexPDFQISrequestButton (String recordId){
+        InitData res = new initData();
+        try{
+            QIS_Report__c report = [SELECT  id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+            res.Id = report.Id;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    // OCSM鏈嶅姟鏈儴妫�娴嬪畬姣�
+    @AuraEnabled
+    public static InitData initForlexRCinspectioncompletedateButton (String recordId){
+        InitData res = new initData();
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Profile.name FROM User WHERE Id = :myUserID LIMIT 1];
+        try{
+            QIS_Report__c report = [SELECT  id ,RC_inspection_date__c,QIS_Status__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+            res.Id = report.Id;
+            res.rCinspectionDate = report.RC_inspection_date__c;
+            res.QIStatus = report.QIS_Status__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForRCinspectioncompletedate (String recordId){
+        String re = '鎴愬姛'; 
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Alias FROM User WHERE Id = :myUserID LIMIT 1];
+
+        try{    
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.RC_inspection_date__c  = Date.today();
+                rac.RC__c = myUserID;
+                rac.RC_Inspection_staff__c  = userinfo.Alias;
+                update rac;
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+    // OSH妫�鏌ュ彈鐞�
+    @AuraEnabled
+    public static InitData initForlexOSHInspectButton (String recordId){
+        InitData res = new initData();
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Profile.name FROM User WHERE Id = :myUserID LIMIT 1];
+        try{
+            QIS_Report__c report = [SELECT  id ,OSHInspectionDate__c,QIS_Status__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+            res.Id = report.Id;
+            res.oSHInspectionDate = report.OSHInspectionDate__c;
+            res.QIStatus = report.QIS_Status__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForlexOSHInspect (String recordId){
+        String re = '鎴愬姛'; 
+        try{    
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.OSHInspectionDate__c   = Date.today();
+                update rac;
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+
+     //     澶嶅埗1
+   @AuraEnabled
+    public static InitData initForlexcopyQISButton (String recordId){
+        InitData res = new initData();
+        try{
+            QIS_Report__c report = [SELECT  id,Name,QIS_Status__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];  
+            res.Id = report.Id;
+            res.name = report.Name;
+            res.qIStatus = report.QIS_Status__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+     // OCSM鏃犲疄鐗╅�佽揪
+    @AuraEnabled
+    public static InitData initForlexOCSMNogoodsButton (String recordId){
+        InitData res = new initData();
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Profile.name FROM User WHERE Id = :myUserID LIMIT 1];
+        try{
+            QIS_Report__c report = [SELECT  id ,QIS_Status__c,isAE_Profile__c,is_CNBuy__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+            res.Id = report.Id;
+            res.isAEProfile = report.isAE_Profile__c;
+            res.QIStatus = report.QIS_Status__c;
+            res.isCNBuy = report.is_CNBuy__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updatelexOCSMNogoods (String recordId){
+        String re = '鎴愬姛'; 
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT Id,Alias__c,Alias, BuchangApprovalManagerSales__c,JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c FROM User WHERE Id = :myUserID LIMIT 1];
+
+        try{    
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.QIS_Status__c   = 'RC妫�娴嬩腑';
+                rac.OCM_RC_RecievedDate__c    = Date.today();
+                rac.RC__c = myUserID;
+                if (userinfo != null) {
+                    rac.RC_Receive_staff__c   = userinfo.Alias;
+                }
+                if (userinfo != null && userinfo.BuchangApprovalManagerSales__c !=null) {
+                    rac.RC_Manager__c  = userinfo.BuchangApprovalManagerSales__c;
+                }else{
+                    rac.RC_Manager__c = myUserID;
+                }
+                rac.CDS_date__c    = Date.today();
+                rac.RC_CDS_staff__c   = userinfo.Alias__c;
+                rac.OCSM_Nogoods__c   = true;
+                update rac;
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
     public class InitData{
         @AuraEnabled
         public String Id;
         @AuraEnabled
-        public String PAEid;
+        public String qISSCReport;
         @AuraEnabled
-        public String QIStatus;
+        public String name;
         @AuraEnabled
-        public String OSHstaff;
+        public String qISSCId;
         @AuraEnabled
-        public String OSHstaffEmail;
+        public String accParentId;
         @AuraEnabled
-        public String CancelQISReason;
+        public String accParentRecordTypeId;
         @AuraEnabled
-        public String RCid;
+        public String accParentParentFSEGIMainLeader;
+        @AuraEnabled
+        public String accParentParentFSEGIMainLeaderWorkLocation;
+        @AuraEnabled
+        public String accParentParentFSESPMainLeader;
+        @AuraEnabled
+        public String accParentParentFSESPMainLeaderWorkLocation;
+        @AuraEnabled
+        public String oCMjudgement;
+        @AuraEnabled
+        public String comment;
+        @AuraEnabled
+        public String isUsedForTheOpera;
+        @AuraEnabled
+        public String failuerSituation;
+        @AuraEnabled
+        public String sourceOnCall;
+        @AuraEnabled
+        public String sourceOnCallname;
+        @AuraEnabled
+        public String hospitalId;
+        @AuraEnabled
+        public String hospitalname;
+        @AuraEnabled
+        public String departmentClassId;
+        @AuraEnabled
+        public String departmentClassname;
+        @AuraEnabled
+        public String hospitalDepartment;
+        @AuraEnabled
+        public String hospitalDepartmentname;
+        @AuraEnabled
+        public String nonyushohinId;
+        @AuraEnabled
+        public String nonyushohinIdname;
+        @AuraEnabled
+        public String sourceforrepair;
+        @AuraEnabled
+        public String repairSalesPointProvinceChina;
+        @AuraEnabled
+        public String damageForDocOrPat;
+        @AuraEnabled
+        public String relationWithTheProblem;
+        @AuraEnabled
+        public String reportForGoz;
+        @AuraEnabled
+        public String whichProject;
+        @AuraEnabled
+        public String operaName;
+        @AuraEnabled
+        public String breakORFallOff;
+        @AuraEnabled
+        public String setusageproduct;
+        @AuraEnabled
+        public String afterFailureInformation;
+        @AuraEnabled
+        public String delay15Min;
+        @AuraEnabled
+        public String informationFrom;
+        @AuraEnabled
+        public String failureQInHospital;
+        @AuraEnabled
+        public String ownerId;
+        @AuraEnabled
+        public String ownername;
+        @AuraEnabled
+        public String qisRecordTypeId;
+        @AuraEnabled
+        public String qisRecordName;
+        @AuraEnabled
+        public String nextaction;
+        @AuraEnabled
+        public String qISMarketCategory;
+        @AuraEnabled
+        public String profileName;
+        @AuraEnabled
+        public String isAEProfile;
+        @AuraEnabled
+        public String isPAEProfile;
+        @AuraEnabled
+        public String isCNBuy;
+        @AuraEnabled
+        public String pAEid;
+        @AuraEnabled
+        public String oCSMAdministrativeReportNumber;
+        @AuraEnabled
+        public String oCSMAdministrativeReportStatus;
+        @AuraEnabled
+        public String qIStatus;
+        @AuraEnabled
+        public String oSHstaff;
+        @AuraEnabled
+        public String oSHstaffEmail;
+        @AuraEnabled
+        public String cancelQISReason;
+        @AuraEnabled
+        public String rCid;
         @AuraEnabled
         public String contractnumber;
         @AuraEnabled
-        public Date RCinspectionDate;
+        public Date rCinspectionDate;
         @AuraEnabled
-        public Date QISReplyDay;
+        public Date qISReplyDay;
         @AuraEnabled
-        public Date QISInstallDate;
+        public Date qISInstallDate;
         @AuraEnabled
-        public Boolean RCproblemnotfound;
+        public Date oSHInspectionDate;
+        @AuraEnabled
+        public Date faliourdate;
+        @AuraEnabled
+        public Date trableoccurdaYcollect;
+        @AuraEnabled
+        public Date cdsdate;
+        @AuraEnabled
+        public Date awaredate;
+        @AuraEnabled
+        public Date oCSMAdministrativeReportDate;
+        @AuraEnabled
+        public Boolean rCproblemnotfound;
         @AuraEnabled
         public Boolean isaohuiproduct;
+        @AuraEnabled
+        public Boolean isSendQIS;
+        @AuraEnabled
+        public Boolean specialfollow;
+        
     }
+
 }
\ No newline at end of file

--
Gitblit v1.9.1