高章伟
2023-03-03 d8dc84a3d56df839895f1c417a4d9cbee763d262
force-app/main/default/classes/RentalApplyTriggerHandler.cls
@@ -11,6 +11,7 @@
    private List<Rental_Apply__c> oldList;
    private static Date td = Date.today();
    private static Map<Id, Rental_Apply__c> oldRaMap = new Map<Id, Rental_Apply__c>();
    public static Boolean isFirst = true;
    //update      wangweipeng                             2021/11/25                   start
    private static Map<String, String> approver_of_Service_DepartmentMap = new Map<String, String>();
@@ -32,6 +33,7 @@
    private static Map<String, String> rental_Apply_App_CCEmailMap = FixtureUtil.initRental_Apply_App_CCEmailMap();
    public RentalApplyTriggerHandler() {
        System.debug('进入RentalApplyTriggerHandler');
        Integer i = 0;
        i ++;
        this.newMap = (Map<Id, Rental_Apply__c>) Trigger.newMap;
@@ -43,15 +45,19 @@
    }
    protected override void beforeInsert() {
        System.debug('进入rentalapply beforeInsert');
        setManager();
        beforeSetValue();
        setOffice_Assistant();
    }
    protected override void afterInsert() {
        System.debug('进入rentalapply afterInsert');
        // Check本部是否可以选择
        checkbenbu();
        checkbenbu();// 20220909 ljh 恢复代码
        // 共享设定
        setShare();
        decryptInsert(newList);
    }
    protected override void beforeUpdate() {
        setManager();
@@ -64,7 +70,7 @@
    protected override void afterUpdate() {
        // Check本部是否可以选择
        checkbenbu();
        checkbenbu();// 20220909 ljh 恢复代码
        cancelRa();
        // before では数式項目がnullの場合があります
        formulaToTextCheck();
@@ -75,6 +81,15 @@
        // 取消申请单的审批
        removedProcessRequest();
        System.debug('---------------newList--------------' + newList);
        // add by lc 2022/11/15 DB202211029119 start
        if (isFirst) {
            // 主从申请单,只延主单的情况,走单独的处理逻辑,并且只执行一次
            synchRentalApplyDataMaster();
        }
        // add by lc 2022/11/15 DB202211029119 end
        synchRentalApplyData2();
        // 延期审批后需要更新一览
        setAppExtensionRaes();
@@ -82,10 +97,50 @@
        setShare();
        // 办事处分单的装机确认
        setAgencyHPReceived();
        //批量审批时,需要把主单和从单的延期字段信息同步
        synchRentalApplyData();
    }
    // add by lc 2022/11/15 DB202211029119 start
    // 主从申请单,只延主单的情况,走单独的处理逻辑
    private void synchRentalApplyDataMaster() {
        List<Rental_Apply_Equipment_Set__c> raesList = new List<Rental_Apply_Equipment_Set__c>();
        // 批准只能一条一条的批准
        for (Rental_Apply__c nObj : newList) {
            Rental_Apply__c oObj = oldMap.get(nObj.Id);
            if (oObj.ExtensionApprovalTime_Initial__c != nObj.ExtensionApprovalTime_Initial__c
                && nObj.ExtensionApprovalTime_Initial__c != null && oObj.ExtensionApprovalTime_Initial__c == null
                && String.isNotBlank(nObj.Extension_Type__c) && nObj.Extension_Type__c == '批量延期'
                && (nObj.demo_purpose2__c == '试用(无询价)' || nObj.demo_purpose2__c == '试用(有询价)')
                && String.isBlank(oObj.Extension_Much_ID__c)
                && String.isBlank(oObj.Root_Rental_Apply__c)) {
                isFirst = false;
                List<Rental_Apply__c> checkRentalApply = new List<Rental_Apply__c>();
                checkRentalApply.add(oObj);
                try {
                    System.debug('========================checkRentalApply=========================' + checkRentalApply);
                    for (Rental_Apply_Equipment_Set__c raes : getCan_Extend_RequestList(checkRentalApply)) {
                        System.debug('raes.Id=========================' + raes.Id);
                        //判断是此申请单是否存在 ok并且回寄时间不为空的一览,
                        if ((raes.Received_Confirm__c == 'OK' || raes.Received_Confirm__c == '默认签收-OK') && raes.Asset_return_time__c != null) {
                        }else{
                            raes.RcUnexpectExpiryDelay__c = raes.Rental_Apply__r.RcUnexpectExpiryDelay__c;
                            raesList.add(raes);
                        }
                    }
                }
                catch (Exception e) {
                    nObj.addError(e.getMessage() + ',请操作驳回。');
                }
            }
        }
        if (0 < raesList.size()) {
            update raesList;
        }
    }
    // add by lc 2022/11/15 DB202211029119 end
    private void setAgencyHPReceived() {
        Set<Id> raIdSet = new Set<Id>();
@@ -186,6 +241,7 @@
        List<Rental_Apply__Share> rasList = new List<Rental_Apply__Share>();
        List<Id> deleteOfficeAssistantShare_nObjId_List = new List<Id>();       // 共享删除用
        List<Id> deleteApplyUserShare_nObjId_List = new List<Id>();// 20210727 ljh SFDC-C54C33 共享删除用
        Set<Id> shareSet = new Set<Id>(); // 20230301 ljh DB202302444522 add
        for (Rental_Apply__c nObj : newList) {
            Rental_Apply__c oObj = (null == this.oldMap) ? null : this.oldMap.get(nObj.Id);
            // 服务部审批人
@@ -241,6 +297,7 @@
                ) {
                deleteApplyUserShare_nObjId_List.add(nObj.Id);
                if(nObj.SalesManager__c != null){
                    shareSet.add(nObj.SalesManager__c);// 20230301 ljh DB202302444522 add
                    Rental_Apply__Share rasSalesManager = new Rental_Apply__Share(
                            RowCause = 'ApplyUserShare__c',
                            ParentId = nObj.Id,
@@ -250,6 +307,7 @@
                    rasList.add(rasSalesManager);
                }
                if(nObj.BuchangApprovalManagerSales__c != null){
                    shareSet.add(nObj.BuchangApprovalManagerSales__c);// 20230301 ljh DB202302444522 add
                    Rental_Apply__Share rasBz = new Rental_Apply__Share(
                            RowCause = 'ApplyUserShare__c',
                            ParentId = nObj.Id,
@@ -259,6 +317,7 @@
                    rasList.add(rasBz);
                }
                if(nObj.ZongjianApprovalManager__c != null){
                    shareSet.add(nObj.ZongjianApprovalManager__c);// 20230301 ljh DB202302444522 add
                    Rental_Apply__Share rasZj = new Rental_Apply__Share(
                            RowCause = 'ApplyUserShare__c',
                            ParentId = nObj.Id,
@@ -281,10 +340,18 @@
        if(deleteOfficeAssistantShare_nObjId_List.size() > 0){
            soql += ' AND (RowCause = \'Office_Assistant__c\' AND ParentId =: deleteOfficeAssistantShare_nObjId_List) ';
            if(deleteApplyUserShare_nObjId_List.size() > 0){
                soql += ' OR (RowCause = \'ApplyUserShare__c\'AND ParentId =: deleteApplyUserShare_nObjId_List)';
                // 20230301 ljh DB202302444522 update start
                // soql += ' OR (RowCause = \'ApplyUserShare__c\'AND ParentId =: deleteApplyUserShare_nObjId_List)';
                soql += ' OR (RowCause = \'ApplyUserShare__c\'AND ParentId =: deleteApplyUserShare_nObjId_List';
                soql += ' and UserOrGroupId IN :shareSet)';
                // 20230301 ljh DB202302444522 update end
            }
        }else if(deleteApplyUserShare_nObjId_List.size() > 0){
            soql += ' AND (RowCause = \'ApplyUserShare__c\'AND ParentId =: deleteApplyUserShare_nObjId_List)';
            // 20230301 ljh DB202302444522 update start
            // soql += ' AND (RowCause = \'ApplyUserShare__c\'AND ParentId =: deleteApplyUserShare_nObjId_List)';
            soql += ' AND (RowCause = \'ApplyUserShare__c\'AND ParentId =: deleteApplyUserShare_nObjId_List';
            soql += ' and UserOrGroupId IN :shareSet)';
            // 20230301 ljh DB202302444522 update end
        }
        List<Rental_Apply__Share> deleteShareList = new List<Rental_Apply__Share>();
        if(deleteOfficeAssistantShare_nObjId_List.size() > 0 || deleteApplyUserShare_nObjId_List.size() > 0){
@@ -332,8 +399,11 @@
                    //如果为批量延期,那么这个集合里面会存放 原单+原单下所有的从单
                    //如果为从单,并且目的2为询价,那么会存放 当前从单的原单+从单原单下所有的从单(包括当前从单)
                    List<Rental_Apply__c> checkRentalApply = new List<Rental_Apply__c>();
                    // 只有产品试用会存在批量延期
                    if(String.isNotBlank(nObj.Extension_Type__c) && nObj.Extension_Type__c == '批量延期'){
                        System.debug('========================1=========================');
                        if(String.isNotBlank(nObj.Extension_Much_ID__c)){
                            System.debug('========================2=========================');
                            String parentId = nObj.Id;
                            parentId = parentId.substring(0,15);
                            String likeParentId = parentId+'%';
@@ -363,6 +433,7 @@
                                            order by CreatedDate asc];
                        }
                    }else{
                        System.debug('========================3=========================');
                        //如果延期的是从单,那么需要特殊处理
                        if(String.isNotBlank(nObj.Root_Rental_Apply__c) && (nObj.demo_purpose2__c == '试用(无询价)' || nObj.demo_purpose2__c == '试用(有询价)')){
                            String likeParentId = nObj.Root_Rental_Apply__c+'%';
@@ -395,6 +466,8 @@
                        }
                        checkRentalApply.add(oObj);
                    }
                    System.debug('========================checkRentalApply=========================' + checkRentalApply);
                    for (Rental_Apply_Equipment_Set__c raes : getCan_Extend_RequestList(checkRentalApply)) {
                        //延期批准时间(最初)或延期批准时间(最终) 值都有变动,那么证明此次延期已经批准了,那么需要给申请单的一览赋值
                        if (oObj.ExtensionApprovalTime_Initial__c != nObj.ExtensionApprovalTime_Initial__c
@@ -458,7 +531,7 @@
            update raesList;
        }
    }
    // 20220909 ljh 恢复代码
    private void checkbenbu() {
        for (Rental_Apply__c nObj : newList) {
            if (nObj.DataMigration_Flag__c == false) {
@@ -695,7 +768,16 @@
        }
        //拷贝医院的市字段
        Map<Id, Account> accMap = new Map<Id, Account>();
        // Set<Id> hpIdSetCopy = new Set<Id>();
        // Integer count = 0;
        if (hpIdSet.size() > 0) {
        //    for (Id a : hpIdSet) {
        //        hpIdSetCopy.add(a);
        //        count++;
        //        if (count>=99) {
        //           break;
        //        }
        //    }
            accMap.putAll([SELECT Id, City_Master__r.Name, State_Text__c FROM Account WHERE Id IN: hpIdSet]);
            for (Rental_Apply__c nObj : newList) {
                if (accMap.containsKey(nObj.Hospital__c)) {
@@ -972,6 +1054,169 @@
        if (raIdList.size() > 0) {
            RentalApplyTriggerHandler.doUnlockByFuture(raIdList);
        }
    }
    public static void decryptInsert(List<Rental_Apply__c> newList){
        System.debug('enter RentalApply decryptInsert');
        if(!system.isFuture()){
            List<Rental_Apply__c> fendanList = new List<Rental_Apply__c>();
            for(Rental_Apply__c ra : newList){
                if(ra.Old_Rental_Apply__c != null){
                    fendanList.add(ra);
                }
            }
            if(fendanList.size() == 0){
                system.debug('no need split');
                return;
            }
            //zhj MEBG新方案改造 2022-12-01 start
           //decryptInsertFuture(JSON.serialize(fendanList));
           Map<String,PIHelper.PIIntegration> staticResource = new Map<String,PIHelper.PIIntegration>();
           staticResource.put('Rental_Apply__c',PIHelper.getPIIntegrationInfo('Rental_Apply__c'));
           Map<String, Map<String, PI_Field_Policy_Detail__c>> mmsp = new Map<String, Map<String,PI_Field_Policy_Detail__c>>();
           for (String key : staticResource.keySet()) {
               mmsp.put(key, new Map<String,PI_Field_Policy_Detail__c>());
               for (PI_Field_Policy_Detail__c detail : staticResource.get(key).PIDetails) {
                   mmsp.get(key).put(detail.SF_Field_API_Name__c, detail);
               }
           }
           System.debug('mmsp = ' + mmsp);
           List<AWSServiceTool2V2.EncryptPushRequestBody> EncryptPushList = new List<AWSServiceTool2V2.EncryptPushRequestBody>();
            for(Rental_Apply__c ac : fendanList){
                Rental_Apply__c oldAc = [select id,AWS_Data_Id__c from Rental_Apply__c where id=:ac.Old_Rental_Apply__c];
                System.debug('oldAc = ' + oldAc);
                AWSServiceTool2V2.EncryptPushRequestBody EncryptPush = new AWSServiceTool2V2.EncryptPushRequestBody();
                EncryptPush.dataId = ac.AWS_Data_Id__c != null ?ac.AWS_Data_Id__c:'';
                EncryptPush.sfRecordId = ac.Id;
                EncryptPush.fieldsMapping = new Map<String, List<AWSServiceTool2V2.EncryptPushRes>>();
                List<AWSServiceTool2V2.EncryptPushRes> resList = new List<AWSServiceTool2V2.EncryptPushRes>();
                AWSServiceTool2V2.EncryptPushRes res= new AWSServiceTool2V2.EncryptPushRes();
                res.isQueryDb = true;
                res.value = '';
                res.table = staticResource.get('Rental_Apply__c').awsTableName;
                //res.dataId = ac.Old_Rental_Apply__r.AWS_Data_Id__c;
                res.dataId = oldAc.AWS_Data_Id__c;
                res.field = mmsp.get('Rental_Apply__c').get('direct_shippment_address__c').AWS_Field_API__c;
                resList.add(res);
                List<AWSServiceTool2V2.EncryptPushRes> resList2 = new List<AWSServiceTool2V2.EncryptPushRes>();
                AWSServiceTool2V2.EncryptPushRes res2= new AWSServiceTool2V2.EncryptPushRes();
                res2.isQueryDb = true;
                res2.value = '';
                res2.table = staticResource.get('Rental_Apply__c').awsTableName;
                //res2.dataId = ac.Old_Rental_Apply__r.AWS_Data_Id__c;
                res2.dataId = oldAc.AWS_Data_Id__c;
                res2.field = mmsp.get('Rental_Apply__c').get('Phone_number__c').AWS_Field_API__c;
                resList2.add(res2);
                EncryptPush.fieldsMapping.put(mmsp.get('Rental_Apply__c').get('direct_shippment_address__c').AWS_Field_API__c, resList);
                EncryptPush.fieldsMapping.put(mmsp.get('Rental_Apply__c').get('Phone_number__c').AWS_Field_API__c, resList2);
                EncryptPushList.add(EncryptPush);
            }
            System.debug('EncryptPushListdataId = ' + JSON.serialize(EncryptPushList[0].dataId));
            System.debug('EncryptPushListsfRecordId = ' + JSON.serialize(EncryptPushList[0].sfRecordId));
            System.debug('EncryptPushListfieldsMapping = ' + JSON.serialize(EncryptPushList[0].fieldsMapping));
            System.debug('EncryptPushList = ' + JSON.serialize(EncryptPushList));
            AwsServiceTool2V2.EncryptPushFutureV2(Json.serialize(EncryptPushList),Json.serialize(fendanList), 'Rental_Apply__c');
           //zhj MEBG新方案改造 2022-12-01 end
           //decryptInsertFuture(JSON.serialize(fendanList));
        }
    }
    @future(callout=true)
    public static void decryptInsertFuture(string json_list){
        decryptInsertCore(json_list);
    }
    // List<Rental_Apply__c> temps = [select id,AWS_Data_Id__c,name, direct_shippment_address__c,  Direct_Shippment_Address_Encrypt__c, Phone_number__c,  Phone_Number_Encrypt__c,CreatedDate   from Rental_Apply__c where AWS_Data_Id__c != null order by CreatedDate desc limit 2];
    public static void decryptInsertCore(string json_list){
        system.debug('enter decryptInsertCore');
        //调用滨璜接口更新
        PIHelper.PIIntegration staticResource =  PIHelper.getPIIntegrationInfo('Rental_Apply__c');
        system.debug('staticResource.token='+staticResource.token);
        if(String.isBlank(staticResource.token)){
            System.debug('获取aws token 失败');
            return;
        }
        List<Rental_Apply__c> newList = (List<Rental_Apply__c>)Json.deserialize(json_list, List<Rental_Apply__c>.class);
        Map<Id,Rental_Apply__c> newMap = new Map<Id,Rental_Apply__c>(newList);
        List<Map<string,object>> lmso = new List<Map<string,object>>();
        for(Rental_Apply__c ra : newList){
            Map<string,object> mso = new Map<string,object>();
            /*if(!string.isBlank(ra.AWS_Data_Id__c)){
                continue;
            }*/
            for(PI_Field_Policy_Detail__c detail : staticResource.PIDetails){
                if(ra.isSet(detail.SF_Field_API_Name__c)){
                    mso.put(detail.AWS_Field_API__c,ra.get(detail.SF_Field_API_Name__c));
                    mso.put(detail.AWS_Encrypted_Field_API__c,ra.get(detail.SF_Field_Encrypted_API__c));
                }
            }
            mso.put('sfRecordId',ra.Id);
            lmso.add(mso);
        }
        if(lmso.size()==0){
            system.debug('lmso.size()='+lmso.size());
            return;
        }
        string payload = Json.serialize(lmso);
        system.debug('payload='+payload);
        String awsApi = staticResource.viewUnifiedContactUrl;
        NFMUtil.response response = NFMUtil.sendToPiAWS(payload, awsApi,staticResource.token);
        system.debug(response);
        Map<string,object> res_obj = (Map<string,object>)Json.deserializeUntyped(response.responseBody);
        if(res_obj == null || !res_obj.containsKey('object') ){
            System.debug('res_obj == null || !res_obj.containsKey(\'object\')');
            return;
        }
        List<object> objList = (List<object>)res_obj.get('object');
        if(objList == null){
            System.debug('objList == null');
            return;
        }
        List<Rental_Apply__c> updateList = new List<Rental_Apply__c>();
        for(object obj : objList){
            Map<string,object> obj_map = (Map<string,object>)obj;
            string sfRecordId = null;
            string dataId = null;
            if(obj_map.containsKey('sfRecordId')){
                sfRecordId = string.valueOf(obj_map.get('sfRecordId'));
            }else{
                system.debug('obj_map.containsKey(\'sfRecordId\')='+obj_map.containsKey('sfRecordId'));
                continue;
            }
            if(obj_map.containsKey('dataId')){
                dataId = string.valueOf(obj_map.get('dataId'));
            }else{
                system.debug('obj_map.containsKey(\'dataId\')='+obj_map.containsKey('dataId'));
                continue;
            }
            if(newMap.containsKey(sfRecordId)){
                Rental_Apply__c ra = newMap.get(sfRecordId);
                ra.AWS_Data_Id__c = dataId;
                updateList.add(ra);
            }else{
                system.debug('newMap.containsKey('+sfRecordId+')='+newMap.containsKey(sfRecordId));
                continue;
            }
        }
        system.debug('updateList.size='+updateList.size());
        if(updateList.size()>0){
            update updateList;
        }
    }
    @future
@@ -1250,6 +1495,8 @@
                            }
                        }
                    }
                    System.debug('raes==============' + raes);
                    System.debug('raes1==============' + checkCan_Extend_Request(raes, false));
                    if (checkCan_Extend_Request(raes, false)) {
                        raesList.add(raes);
                    }
@@ -2469,5 +2716,809 @@
        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++;
        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++;
        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++;
        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++;
        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++;
    }
}