19626
2023-10-07 988f9735377909b6310301e582c15804e004783f
force-app/main/default/classes/InquiryFormHandler.cls
@@ -204,10 +204,12 @@
                }
                //20220511 you SWAG-CBUB2W end 
                //不需要日期,跟进日期,服务跟进日期,创建意向日期,比较最早日期
                //20230710 you DB202306544691  增加 转服务跟进日期
                String date1;
                String date2;
                String date3;
                String date4;
                String date6;
                if(null != nObj.No_Need_Date__c){
                  date1=String.valueOf(nObj.No_Need_Date__c);
                }
@@ -220,11 +222,14 @@
                if(null != nObj.Service_Follow_Date__c){
                  date4=String.valueOf(nObj.Service_Follow_Date__c);
                }
                if(null != nObj.Transfer_Service_Follow_Date__c){
                  date6=String.valueOf(nObj.Transfer_Service_Follow_Date__c);
                }
                //方法调用 
                 Date date_MD;
                 if((String.isNotBlank(date1) && nObj.No_Need_Date__c !=oldMap.get(nObj.Id).No_Need_Date__c) || (String.isNotBlank(date2) && nObj.Follow_Date__c !=oldMap.get(nObj.Id).Follow_Date__c) || (String.isNotBlank(date3) && nObj.Confirmation_Date__c !=oldMap.get(nObj.Id).Confirmation_Date__c) || (String.isNotBlank(date4) && nObj.Service_Follow_Date__c !=oldMap.get(nObj.Id).Service_Follow_Date__c)){
                    date_MD =getBigTime(date1,date2,date3,date4);
                 if((String.isNotBlank(date1) && nObj.No_Need_Date__c !=oldMap.get(nObj.Id).No_Need_Date__c) || (String.isNotBlank(date2) && nObj.Follow_Date__c !=oldMap.get(nObj.Id).Follow_Date__c) || (String.isNotBlank(date3) && nObj.Confirmation_Date__c !=oldMap.get(nObj.Id).Confirmation_Date__c) || (String.isNotBlank(date4) && nObj.Service_Follow_Date__c !=oldMap.get(nObj.Id).Service_Follow_Date__c) || (String.isNotBlank(date6) && nObj.Transfer_Service_Follow_Date__c !=oldMap.get(nObj.Id).Transfer_Service_Follow_Date__c)){
                    date_MD =getBigTime(date1,date2,date3,date4,date6);
                    nObj.MinimumDate__c = date_MD;//最小日期
                    String date5 = nObj.CreateDate__c==null?'':String.valueOf(nObj.CreateDate__c);
                    if(null != nObj.CreateDate__c){
@@ -238,6 +243,7 @@
                    }
                   
                 } 
                 /**
                 //处理老数据
                 if( System.Label.Inquiry_form_flag == 'True' && null != nObj.CreateDate__c){
                    if(String.isNotBlank(date1) || String.isNotBlank(date2) || String.isNotBlank(date3) || String.isNotBlank(date4)){
@@ -250,6 +256,7 @@
                    }
                 }
                 system.debug('==='+date_MD);
                 **/
                }
            
            
@@ -402,12 +409,13 @@
     }
     //20220419 you SWAG-CBUB2W end
 //多个日期比较最小日期
    public static Date getBigTime(String date1, String date2, String date3, String date4) {
    public static Date getBigTime(String date1, String date2, String date3, String date4, String date6) {
        system.debug(date1+'======'+date2+'====='+date3);
         long millis1 =0;
         Long millis2 =0;
         Long millis3 =0;
         Long millis4 =0;
         Long millis6 =0;
         List<Long> list_dateDecimal = new List<Long>();
         if(String.isNotBlank(date1)){
           millis1 = Datetime.valueOf(date1+' 08:00:05').getTime();
@@ -424,6 +432,10 @@
         if(String.isNotBlank(date4)){
           millis4 = Datetime.valueOf(date4+' 08:00:05').getTime();
           list_dateDecimal.add(millis4);
         }
         if(String.isNotBlank(date6)){
           millis6 = Datetime.valueOf(date6+' 08:00:05').getTime();
           list_dateDecimal.add(millis6);
         }
         
         list_dateDecimal.sort();
@@ -583,199 +595,6 @@
   
     @TestVisible private static void test() {
        Integer i = 0;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        //可以多写点
    }
}