黄千龙
2023-03-29 de8c520114fc0e875b784e1cfa3ebded124c8be2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
public with sharing class otherButtonRepairController {
    public otherButtonRepairController() {
 
    }
 
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res = new initData();
        try{
            Repair__c report =  [SELECT 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.Id = report.Id;
            res.OCSMAdministrativeReportNumberC = report.OCSMAdministrativeReportNumber__c;
            res.OCSMAdministrativeReportDateC = report.OCSMAdministrativeReportDate__c;
            res.AwareDateC = report.Aware_date__c;
            res.PAEDetermineC = report.PAE_Determine__c;
            res.ETQUPLOADSTATUSC = report.ETQ_UPLOAD_STATUS__c;
            res.AEDetermineResultC = report.AE_DetermineResult__c;
            res.PAEDetermineACC = report.PAE_DetermineAC__c;
            res.RepairInspectionDateC = report.Repair_Inspection_Date__c;
            res.ContainUseRSAC = report.Contain_UseRSA__c;
 
            res.InchargeStaffEmailC = report.Incharge_Staff_Email__c;
            res.Name = report.Name;
            res.HPNameC = report.HP_Name__c;
            res.DeliveredProductC = report.Delivered_Product__c;
            res.RepairProductSerialNoC = report.Repair_Product_Serial_No__c;
            res.ServiceRepairNoC = report.Service_Repair_No__c;
            res.RepairFirstestimatedDateC = report.Repair_Firstestimated_Date__c;
            res.RepairEstimatedDateC = report.Repair_Estimated_Date__c;
            res.RCInformationC = report.RC_information__c;
            res.OCSMAdministrativeReportStatusC = report.OCSMAdministrativeReportStatus__c;
 
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }   
 
    @AuraEnabled
    public static List<Repair__c> selectRecords(String recordId){
        List<Repair__c> res = new List<Repair__c>();
        try{
            res = [SELECT Id,AsyncData__c,Complaint_Number__c,ETQ_UPLOAD_STATUS__c FROM Repair__c WHERE id =: recordId ];
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
 
    @AuraEnabled
    public static void updateRepair(String recordId){
        try {
            Repair__c repair = new Repair__c();
            repair.Id = recordid;
            repair.OCSMAdministrativeReportStatus__c = '无需报告';
            update repair;
        } catch (Exception e) {
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
    }
 
    @AuraEnabled
    public static List<PAE_DecisionRecord__c> selectPAEDecisionRecord(String recordId,String recordTypeId){
        List<PAE_DecisionRecord__c> res = new List<PAE_DecisionRecord__c>();
        try{
            res = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_Repair__c =: recordId And RecordType.DeveloperName =: recordTypeId Order by LastModifiedDate desc];
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
 
    public class InitData{
        @AuraEnabled
        public String Id;
        @AuraEnabled
        public String OCSMAdministrativeReportNumberC;
        @AuraEnabled
        public Datetime OCSMAdministrativeReportDateC;
        @AuraEnabled
        public Datetime AwareDateC;
        @AuraEnabled
        public String PAEDetermineC;
        @AuraEnabled
        public String ETQUPLOADSTATUSC;
        @AuraEnabled
        public String AEDetermineResultC;
        @AuraEnabled
        public String PAEDetermineACC;
        @AuraEnabled
        public Datetime RepairInspectionDateC;
        @AuraEnabled
        public boolean ContainUseRSAC;
 
         @AuraEnabled
        public String InchargeStaffEmailC;
         @AuraEnabled
        public String Name;
         @AuraEnabled
        public String HPNameC;
         @AuraEnabled
        public String DeliveredProductC;
         @AuraEnabled
        public String RepairProductSerialNoC;
         @AuraEnabled
        public String ServiceRepairNoC;
         @AuraEnabled
        public Datetime RepairFirstestimatedDateC;
         @AuraEnabled
        public Datetime RepairEstimatedDateC;
         @AuraEnabled
        public String RCInformationC;
        @AuraEnabled
        public String OCSMAdministrativeReportStatusC;
 
     }
}