sunxia
2022-03-16 8532fb6e9d278f8dbd88e12bbe250c9c0a636556
force-app/main/default/classes/RentalApplyWebService.cls
@@ -431,15 +431,15 @@
        }
        //1388 yc 20211021 跨区域分配不能出库 end
        // 20220211 ljh add 备品FY23课题01 start
        AggregateResult[] resultsRas = [SELECT Rental_Start_Date__c,count(Id) cnt
                                     FROM Rental_Apply_Equipment_Set__c
                                     WHERE Rental_Apply__c = :rentalApplyId
                                     AND Cancel_Select__c = false
                                     group by Rental_Start_Date__c];
        If(resultsRas.size() > 1){
           returnStr = '所有一览备品预计出货日应一致,不一致不能做出库指示';
            return returnStr;
        }
        // AggregateResult[] resultsRas = [SELECT Rental_Start_Date__c,count(Id) cnt
        //                              FROM Rental_Apply_Equipment_Set__c
        //                              WHERE Rental_Apply__c = :rentalApplyId
        //                              AND Cancel_Select__c = false
        //                              group by Rental_Start_Date__c];
        // If(resultsRas.size() > 1){
        //    returnStr = '所有一览备品预计出货日应一致,不一致不能做出库指示';
        //     return returnStr;
        // }
        // 20220211 ljh add 备品FY23课题01 end
//bp2        // 备品借出历史取得
@@ -1159,7 +1159,10 @@
//    }
    // 分配验证
    Webservice static String AssignBtn(String Rid){
        List<Rental_Apply__c> raList = [select demo_purpose2__c,next_action__c,QIS_number__r.ReplaceDeliveryDate__c,Follow_UP_Opp__r.Shipping_Finished_Day_Func__c,repair__r.Repair_Final_Inspection_Date__c,repair__r.Return_Without_Repair_Date__c,Campaign__c,Campaign__r.Status,Repair__r.Repair_Shipped_Date__c,Campaign__r.IF_Approved__c,Campaign__r.Meeting_Approved_No__c   from Rental_Apply__c where id = :Rid];
        List<String> statusList = System.Label.StatusProcessState.split(',');
        List<Rental_Apply__c> raList = [select demo_purpose2__c,next_action__c,QIS_number__r.ReplaceDeliveryDate__c,Follow_UP_Opp__r.Shipping_Finished_Day_Func__c,repair__r.Repair_Final_Inspection_Date__c,repair__r.Return_Without_Repair_Date__c,Campaign__c,Campaign__r.Status,Repair__r.Repair_Shipped_Date__c,Campaign__r.IF_Approved__c,Campaign__r.Meeting_Approved_No__c,Campaign__r.Approved_Status__c   from Rental_Apply__c where id = :Rid];
        // 20210803 ljh  SFDC-C5HDC7 add 查询添加 Campaign__c,Campaign__r.Status,Repair__r.Repair_Shipped_Date__c 
        if(raList.size()>0){
            Rental_Apply__c Ra = raList[0];
@@ -1184,6 +1187,9 @@
           else if(Ra.Campaign__r.IF_Approved__c && Ra.Campaign__r.Meeting_Approved_No__c == null){
                return '已申请决裁但决裁编码为空';
           }//20220301 sx obpm修改
           else if(Ra.Campaign__r.IF_Approved__c && Ra.Campaign__r.Meeting_Approved_No__c != null && statusList.contains(Ra.Campaign__r.Approved_Status__c)){
                return '已申请决裁但决裁编码状态不符合需求';
           }//20220315 sx obpm备品决裁状态相关修改
           else{
                return 'Fin';
            }