高章伟
2023-03-03 d8dc84a3d56df839895f1c417a4d9cbee763d262
force-app/main/default/classes/UpdateContractAimAmountHandler.cls
@@ -12,16 +12,14 @@
    }
    protected override void beforeUpdate() {
        changeAssume();
        SetAwaitToSendAWS();//new
        //SetAwaitToSendAWS();//new
        CustomizePageJudge();//20221121 lt
    }
    //new
    protected override void beforeInsert() {
        SetAwaitToSendAWS();//new
    }
    protected override void afterInsert() {
        createAgencyTarget();
        //SetAwaitToSendAWS();//old
        SetAwaitToSendAWS();
    }
@@ -30,7 +28,7 @@
        // LHJ KWAG-BQMA89 202006 Start
        updateAgencyAccout();
        // LHJ KWAG-BQMA89 202006 End
        //SetAwaitToSendAWS();//old
        SetAwaitToSendAWS();//old
    }
    
@@ -211,11 +209,7 @@
                    if (!NFM601_IdMap.containsKey(acc.Id)) {
                        // 判断是否是接口用户
                        if(UserInfo.getUserId().equals(System.Label.interfaceUserID)){
                            //此处做修改,NFM624Rest接收数据后触发trigger,trigger再去调用601存在bug,修改为增加标记,使用Batch发送
                            //interfaceUserUpsertAccount.add(acc.Id);
                            //2022-3-28 pk start
                            acc.NFM601Tag__c = true;
                            //2022-3-28 pk end
                            interfaceUserUpsertAccount.add(acc.Id);
                        } else {
                            queueableAccountIdList.add(acc.Id); 
                        }
@@ -234,6 +228,11 @@
                        || acc.Phone  != old.Phone //电话
                        || acc.Postal_Code__c  != old.Postal_Code__c //邮编
                        || acc.Address__c  != old.Address__c //地址
                        //LLIU-CGRCGK LY 20220728 start
                        || (developerId == '01210000000QemGAAS' && //医院
                           (acc.OCM_Category__c  != old.OCM_Category__c //OCSM分类(医院)
                            || acc.Grade__c  != old.Grade__c ) )//政府等级
                        //LLIU-CGRCGK LY 20220728 end
                        || (developerId == '01210000000Qem1AAC' && //经销商
                            (acc.Business_Paper_Expiration_Date__c  != old.Business_Paper_Expiration_Date__c || //营业执照有效期限  
                                acc.Tax_Practice_Expiration_Date__c  != old.Tax_Practice_Expiration_Date__c || //税务登记证有效期限  
@@ -243,16 +242,14 @@
                        ) {
                        if (!NFM601_IdMap.containsKey(acc.Id)) {
                            if(UserInfo.getUserId().equals(System.Label.interfaceUserID)){
                                //interfaceUserUpsertAccount.add(acc.Id);
                                 //2022-3-28 pk start
                                acc.NFM601tag__c = true;
                                 //2022-3-28 pk start
                                interfaceUserUpsertAccount.add(acc.Id);
                            } else {
                                queueableAccountIdList.add(acc.Id);
                            } 
                            NFM601_IdMap.put(acc.Id, acc.Id);  
                        }
                    }
                }
            }
    
@@ -262,15 +259,37 @@
        //After : to avoid mutiple execute
        //if(!(System.Test.isRunningTest()||System.isFuture()||System.isBatch())){
        //Update by Li Jun for PIPL 20220304
        if(!(System.Test.isRunningTest()||System.isFuture()||System.isBatch())){
        if(!(System.Test.isRunningTest())){
            if (queueableAccountIdList.size() > 0) {
                NFM601Controller.callout('', queueableAccountIdList);
            }
            // if (interfaceUserUpsertAccount.size() > 0) {
            //     NFM601Controller.executefuture('', interfaceUserUpsertAccount);
            // }
            if (interfaceUserUpsertAccount.size() > 0) {
                NFM601Controller.executefuture('', interfaceUserUpsertAccount);
            }
        }
    }
    //20221121 lt LLIU-CKB5H9【委托】【医院】医院新建申请和变更系统化 start
    public void CustomizePageJudge(){
        for (Account acc : newList){
            System.debug('lt123-----new审批步骤-----'+acc.ApprovalSteps__c);
            System.debug('lt123-----old审批步骤-----'+oldMap.get(acc.Id).ApprovalSteps__c);
            if(acc.ApprovalSteps__c != oldMap.get(acc.Id).ApprovalSteps__c){
                System.debug('lt123-----审批步骤改变-----');
                if(acc.CustomizePageFlg__c == true){
                    System.debug('lt123-----acc.CustomizePageFlg__c-----'+acc.CustomizePageFlg__c);
                    acc.CustomizePageFlg__c = false;
                }else{
                    System.debug('lt123-----else,acc.CustomizePageFlg__c-----'+acc.CustomizePageFlg__c);
                    acc.addError('请点击链接(相关项)确认具体信息后审批。');
                }
            }
        }
    }
    //20221121 lt LLIU-CKB5H9【委托】【医院】医院新建申请和变更系统化 end
}