黄千龙
2023-03-08 962519811b7c4be07f30d09e791798b0ea79d3ae
force-app/main/default/classes/AssetHandler.cls
@@ -5,6 +5,7 @@
    private Map<Id, Asset> oldMap;
    private List<Asset> newList;
    private List<Asset> oldList;
    private static final Map<String,Schema.RecordTypeInfo>  DEVELOPERNAMEMAP  = Schema.SObjectType.Asset.getRecordTypeInfosByDeveloperName();// 20230306 ljh add
    @TestVisible private static Set<String> testTargetDepts;
    @TestVisible private static Id Account_Asset_Id;
     public static Boolean disabled = false;
@@ -109,7 +110,11 @@
        StaticParameter.EscapeMaintenanceContractAfterUpdateTrigger = true;
        Set<id> AssetIDSet = new Set<id>();
        for(Asset tempAsset : newList){
            if(String.isNotBlank(tempAsset.warrantyType__c)){
            // 20230306 ljh update start
            Id Shipment = DEVELOPERNAMEMAP.get('Shipment').getRecordTypeId();
            // if(String.isNotBlank(tempAsset.warrantyType__c)){
            if(String.isNotBlank(tempAsset.warrantyType__c) && Shipment != tempAsset.RecordTypeId){
            // 20230306 ljh update end
                AssetIDSet.add(tempAsset.id);
            }
        }
@@ -183,6 +188,11 @@
            if (nObj.Status == FixtureUtil.assetStatusMap.get(FixtureUtil.AssetStatus.Dai_Fei_Qi.ordinal())) {
                nObj.Freeze_sign__c = false;
            }
            // gzw CHAN-CCR6MW  【委托】【保有设备】保有设备发货日逻辑 start
            if(Trigger.isInsert && nObj.Posting_Date__c == null){
                nObj.Posting_Date__c = Date.newInstance(1900, 1, 1);
            }
            // gzw CHAN-CCR6MW  【委托】【保有设备】保有设备发货日逻辑 end
        }
    }
@@ -253,6 +263,7 @@
    // 更新項目Fixture_OneToOne_Link__c.In_wh_Fu_Shu_Pin_You_Xiao_Ku_Cun__c = Fixture_OneToOne_Link__c.In_wh_Fu_Shu_Pin_You_Xiao_Ku_Cun_F__c
    private void mainAssetUpdateed_OneToOneRecord() {
        Set<Id> aSetIdSet = new Set<Id>();
        System.debug(LoggingLevel.INFO, '*** mainAssetUpdateed_OneToOneRecord: ');
        for (Integer i = 0; i < newList.size(); i++) {
            Asset nObj = newList[i];
            Asset oObj = oldList[i];
@@ -392,6 +403,7 @@
                                                        WHERE Series_No__c > 0 AND Invalid_Flag__c =false
                                                        AND Apply_Set_Detail__c NOT IN:raesdIdSet
                                                        AND ExternalKey__c IN:keyList
                                                        AND Apply_Set_Detail__r.Cancel_Select__c = false
                                                        ORDER BY Series_No__c ];
        System.debug(LoggingLevel.INFO, '*** targetSequence: ' + targetSequence);
        Map<String,List<Rental_Apply_Sequence__c>> sequenceMap = new Map<String,List<Rental_Apply_Sequence__c>>();