游畅
2022-04-22 64b3629116e6f3f5eb3debf9b451d100f4010fa5
force-app/main/default/classes/StatusPageController.cls
@@ -2,14 +2,11 @@
    public StatusPageController() {
        Inquiryform = new Inquiry_form__c();
    }
    public String status{get;set;}
    public String search{get;set;}
    public String reason{get;set;}
    public Inquiry_form__c Inquiryform{get; set;}
    public void init(){
        String infId = ApexPages.currentPage().getParameters().get('id');
       List<Inquiry_form__c> infList = [SELECT id,Reasons_options__c,Opp_Name_Search__c,Follow_Content__c,Follow_Content_Other__c,Status__c FROM Inquiry_form__c WHERE id =  :infId];
       List<Inquiry_form__c> infList = [SELECT id,Reasons_options__c,Opp_Name_Search__c,Follow_Content__c,Follow_Content_Other__c,Status__c,Service_Follow_Content__c,Service_Follow_Content_Other__c,Service_Status__c FROM Inquiry_form__c WHERE id =  :infId];
       if (infList.size() == 0) {
          
       }else{
@@ -37,7 +34,23 @@
            if (String.isBlank(Inquiryform.Follow_Content__c) && String.isBlank(Inquiryform.Follow_Content_Other__c)) {
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '跟进内容不能为空'));
            }
            if (String.isBlank(Inquiryform.Follow_Content__c)) {
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '跟进内容不能为空'));
            }
            if ('其他'.equals(Inquiryform.Follow_Content__c) && String.isBlank(Inquiryform.Follow_Content_Other__c)) {
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '跟进内容(其他)不能为空'));
            }
            // Date nowDT = Date.now();
            //20220418 you SWAG-CBUB2W start
            if(String.isNotBlank(Inquiryform.Follow_Content__c) && Inquiryform.Follow_Content__c.indexOf('服务对应')!=-1){
               Inquiryform.ServiceCorrespond__c = true;
               Inquiryform.Service_Status__c = '01.未跟进';
            }else{
                Inquiryform.ServiceCorrespond__c = false;
                Inquiryform.Service_Status__c = '';
            }
            //20220418 you SWAG-CBUB2W end
            Inquiryform.Follow_Date__c = Date.toDay();
            Inquiryform.Status__c = '03.已跟进';
            update Inquiryform;
        }
@@ -46,4 +59,27 @@
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, ex.getMessage()));
        }
    }
    //20220418 you SWAG-CBUB2W start
    public void servicesavefo(){
        try {
            if (String.isBlank(Inquiryform.Service_Follow_Content__c) && String.isBlank(Inquiryform.Service_Follow_Content_Other__c)) {
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '服务跟进内容不能为空'));
            }
            if (String.isBlank(Inquiryform.Service_Follow_Content__c)) {
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '服务跟进内容不能为空'));
            }
            if ('其他'.equals(Inquiryform.Service_Follow_Content__c) && String.isBlank(Inquiryform.Service_Follow_Content_Other__c)) {
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '服务跟进内容(其他)不能为空'));
            }
            // Date nowDT = Date.now();
            Inquiryform.Service_Follow_Date__c = Date.toDay();
            Inquiryform.Service_Status__c = '03.已跟进';
            update Inquiryform;
        }
        catch (Exception ex) {
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, ex.getMessage()));
        }
    }
    //20220418 you SWAG-CBUB2W end
}