KKbes
2023-07-19 ccd7b0b9f89d2b2538eb5bcdb21eec413061942b
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
public with sharing class LexOPDSupplementaryController {
    @AuraEnabled
    public static OPDPlan__c init(String recordId){
        try{
            OPDPlan__c res = [SELECT id,OPDPlan_ImplementDate__c,Status__c,
            OriginalOpdPlanRental__c,Rental_Apply2__c,Account_Laboratory__c,Related_Opportunity1_ID__c,
            PlanProdDetail__c,Cnt_OPD_LastYear__c,Cnt_OPD_ThisYear__c,Cnt_Rentals__c,
            lastMonth_Plan__c,SalesManager__c,OPDType__c,OriginalOpdPlanApplication__c,
            BuchangApprovalManagerSales__c,SalesManager_Txt__c,
            Name,supplementaryApplication__c 
                FROM OPDPlan__c
                    Where Id = : recordId];
            return res;
        }
        catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return null;
    }
 
    @AuraEnabled
    public static OPDPlan__c getTheOPDPlan(String Id){
        try{
            OPDPlan__c res = [Select Id, Name,supplementaryApplication__c 
                FROM OPDPlan__c 
                    WHERE supplementaryApplication__c = true 
                    AND OriginalOpdPlanApplication__c = :Id];
            return res;
        }
        catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return null;
    }
 
 
    @AuraEnabled
    public static OPDPlan__c init2(String recordId){
        try{
            OPDPlan__c res = [SELECT id,Status__c,RentalReson__c,AttachmentCertificate__c,
            NeedReport__c,PlanProdDetail__c,Related_Opportunity1_ID__c,Related_Opportunity2_ID__c
                FROM OPDPlan__c
                    Where Id = : recordId];
            return res;
        }
        catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return null;       
 
    }
 
    @AuraEnabled
    public static void NewAndUpdateOPDStatus(String Id){
    try{
        OPDPlan__c res =new OPDPlan__c();
        res.Id = Id;
        res.Status__c='提交';
        update res;
    }
    catch (Exception e) {
        System.debug(LoggingLevel.INFO, '*** e: ' + e);
    }
    }
 
    @AuraEnabled
    public static OPDPlan__c init3(String recordId){
        OPDPlan__c res = new OPDPlan__c();
        try{ 
            res = [SELECT Id,Name,Status__c,DelayCancel_Reason__c
            ,Account_Laboratory__c,OPDType__c,RentalReson__c,
            Related_Opportunity1_ID__c,
            CorrespondingRepairNo__c,AdditionalSupport__c,Campaign__c,
            NoOpp_Reason__c,ModelLending__c,ModelLendingProduct__c,
            PlanProdDetail__c 
                FROM  OPDPlan__c  WHERE Id = :recordId];
 
        }
        catch(Exception e){
        System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
 
    }
 
    @AuraEnabled
    public static OPDPlan__c reapplyFindOPD(String Id){
        OPDPlan__c res =new OPDPlan__c();
        try{
            res =[SELECT Id, Name,Reapply__c 
                    FROM OPDPlan__c 
                        WHERE Reapply__c = true AND OriginalOpdPlan__c = :Id];
        }
        catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
}