涂煌豪
2022-05-16 d075f9ef422d029599749fcf65c44740dbe4d8f9
force-app/main/default/classes/LogAutoSendBatch.cls
@@ -29,8 +29,21 @@
    global Database.QueryLocator start(Database.BatchableContext BC) {
        String profileId = UserInfo.getProfileId();
        // 20220318 ljh SWAG-CC54R2 add start
        if(String.isNotBlank(typeNFM) && typeNFM == 'NFM010' && String.isBlank(messageGroupNumber)){
            return Database.getQueryLocator(
                [SELECT Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c,
                 Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, Type__c,
                 retry_cnt__c, NFM501Future_Count__c, NFM501_Web_Annex_Count__c
                 FROM BatchIF_Log__c
                 WHERE RowDataFlg__c = true
                 AND (retry_cnt__c = null OR (retry_cnt__c != null AND retry_cnt__c > 0 AND retry_cnt__c < : max_cnt))
                 AND Type__c = : typeNFM ]
                );
        } else if (String.isNotBlank(typeNFM) && String.isNotBlank(messageGroupNumber) && times != null) {
        // 20220318 ljh SWAG-CC54R2 add end
        //20191224 HWAG-BK65E8 add start
        if (String.isNotBlank(typeNFM) && String.isNotBlank(messageGroupNumber) && times != null) {
        // if (String.isNotBlank(typeNFM) && String.isNotBlank(messageGroupNumber) && times != null) {
            return Database.getQueryLocator(
                [SELECT Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c,
                 Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, Type__c,
@@ -54,18 +67,6 @@
                                            OR(NFM501_Web_Annex_Count__c != null
                                               AND NFM501_Web_Annex_Count__c > 0 AND NFM501_Web_Annex_Count__c < : max_cnt))]
                );
        // 20220318 ljh SWAG-CC54R2 add start
        } else if(String.isNotBlank(typeNFM) && typeNFM == 'NFM010'){
            return Database.getQueryLocator(
                [SELECT Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c,
                 Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, Type__c,
                 retry_cnt__c, NFM501Future_Count__c, NFM501_Web_Annex_Count__c
                 FROM BatchIF_Log__c
                 WHERE RowDataFlg__c = true
                 AND (retry_cnt__c = null OR (retry_cnt__c != null AND retry_cnt__c > 0 AND retry_cnt__c < : max_cnt))
                 AND Type__c = : typeNFM ]
                );
        // 20220318 ljh SWAG-CC54R2 add end
        } else {
            return Database.getQueryLocator(
                [SELECT Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c,
@@ -171,6 +172,11 @@
                NFM114Rest.main(rowData.Id);
            }
            // 2021/12/1 fxk add End
            // // 电子签收单发送SAP接口 thh 20220427 start
            if (strType_c == 'NFM116') {
                NFM116Controller.execute(rowData,null);
            }
            // // 电子签收单发送SAP接口 thh 20220427 end
            // 三方接口
            if (strType_c == 'NFM201') {
                NFM201Controller.execute(rowData, null);
@@ -256,15 +262,18 @@
            if (strType_c == 'NFM621') {
                NFM621Controller.execute(rowData, null);
            }
            // if (strType_c == 'NFM624') {//智慧医疗pk
            //     NFM624Rest.main(rowData.Id);
            // }
            if (strType_c == 'NFM624') {//智慧医疗pk
                NFM624Rest.main(rowData.Id);
            }
            if (strType_c == 'NFM622') {
                NFM622Controller.execute(rowData, null);
            }
            // if (strType_c == 'NFM112') {//先款后修pk
            //     NFM112Controller.execute(rowData, null);
            // }
            if (strType_c == 'NFM112') {//先款后修pk
                NFM112Controller.ManualExecute(rowData.id);
            }
            if (strType_c == 'NFM113') {//先款后修pk
                NFM113Rest.main(rowData.id);
            }
            if (strType_c == 'NFM701') {
                NFM701Controller.execute(rowData, null);
            }
@@ -274,20 +283,18 @@
            if (strType_c == 'NFM703') {
                NFM703Controller.execute(rowData, null);
            }
            // if (strType_c == 'NFM704') {
            //     NFM704Rest.executefuture(rowData.Id);
            // }
            if (strType_c == 'NFM704') {
                NFM704Rest.executefuture(rowData.Id);
            }
            if (strType_c == 'NFM705') {
                NFM705Rest.executefuture(rowData.Id);
                NFM705Rest.main(rowData.Id);
            }
            if (strType_c == 'NFM706') {
                NFM706Rest.executefuture(rowData.Id);
                NFM706Rest.main(rowData.Id);
            }
            if (strType_c == 'NFM707') {
                NFM707Rest.executefuture(rowData.Id);
                NFM707Rest.main(rowData.Id);
            }
        }
        if (System.Test.isRunningTest()) {
            Integer i = 0;