sunxia
2022-03-16 8532fb6e9d278f8dbd88e12bbe250c9c0a636556
force-app/main/default/classes/RentalFixtureSetAssignController.cls
@@ -290,13 +290,18 @@
        // updateだけ使用する
        List<Rental_Apply_Equipment_Set__c> mfUpdate = new List<Rental_Apply_Equipment_Set__c>();
        Savepoint sp = Database.setSavepoint();
        List<String> statusList = System.Label.StatusProcessState.split(',');
        try {
            Boolean updRAFlg = false;
            Rental_Apply__c raUpd = [
                    SELECT Id, Shipment_request_Cnt__c,
                           Asset_loaner_start_day__c,
                           Asset_loaner_closed_day__c
                           Asset_loaner_closed_day__c,
                           Campaign__c,
                           Campaign__r.IF_Approved__c,
                           Campaign__r.Meeting_Approved_No__c,
                           Campaign__r.Approved_Status__c   //2022 sx obpm备品决裁状态相关修改
                      FROM Rental_Apply__c
                     WHERE Id = :parentId
                       FOR Update];
@@ -311,6 +316,15 @@
                }
            }
            //20220228 sx obpm修改 是否申请决裁勾着没有决裁编号不能进行操作
            if( raUpd.Campaign__c!= null && raUpd.Campaign__r.IF_Approved__c && raUpd.Campaign__r.Meeting_Approved_No__c == null){
                throw new ControllerUtil.myException('已申请决裁但决裁编码为空');
            }
            //20220315 sx obpm obpm备品决裁状态相关修改 start
            else if( raUpd.Campaign__c!= null && raUpd.Campaign__r.IF_Approved__c && raUpd.Campaign__r.Meeting_Approved_No__c != null && statusList.contains(raUpd.Campaign__r.Approved_Status__c) ){
                throw new ControllerUtil.myException('已申请决裁但决裁编码状态不符合需求');
            }
            //20220315 sx obpm obpm备品决裁状态相关修改 end
            Integer indexNum = 1;
            // 20210708 ljh SFDC-C47CLV add start
            Set<Id> raeIdset = new Set<Id>();
@@ -322,6 +336,7 @@
                    raeIdset.add(robj.Id);    
                }
            }
            List<Rental_Apply_Equipment_Set__c> raeList = [SELECT Id, Name,Rental_Apply__c,Cancel_Select__c,LastModifiedDate FROM Rental_Apply_Equipment_Set__c where Id in :raeIdset];
            // 20210906  ljh SFDC-C6D9C2 add LastModifiedDate
            for(Rental_Apply_Equipment_Set__c rae:raeList){
@@ -344,6 +359,7 @@
                        hasError = true;
                        throw new ControllerUtil.myException('第' + indexNum +'行数据已被分割申请单,请刷新后重试!');
                    }
                    // 20210708 ljh update end
                    // 20210906  ljh SFDC-C6D9C2 add start
                    // 20210929 ljh SFDC-C6D9C2 注释 恢复改其他方案 start
@@ -1536,6 +1552,7 @@
        return result;
    }
    public static List<String> transferStringToList(String str){
        // System.debug(LoggingLevel.INFO, '*** str: ' + str);
        List<String> strList = new List<String>();
@@ -1544,6 +1561,11 @@
        }else{
            strList.add(str);
        }
        for(Integer i = strList.size()-1;i >= 0 ; i --){
            if(String.isEmpty(strList.get(i))){
                strList.remove(i);
            }
        }
        return strList;
    }