黄千龙
2023-03-08 962519811b7c4be07f30d09e791798b0ea79d3ae
force-app/main/default/classes/LogAutoSendBatch.cls
@@ -5,6 +5,11 @@
    private Datetime times;
    private Boolean isForecast;// 20220318 ljh SWAG-CC54R2 add
    private String loginId;
     //20230203 lt 计划的作业优化  一小时两次 start
     private BatchEmailUtil.ScBean scB1;
     //20230203 lt 计划的作业优化  一小时两次 end
    /**
     * コンスタント
     */
@@ -38,6 +43,16 @@
     */
    public Integer max_cnt = Integer.valueOf(System.Label.batch_retry_max_cnt);
    global Database.QueryLocator start(Database.BatchableContext BC) {
        //20230203 lt 计划的作业优化  一小时两次 start
        scB1 = BatchEmailUtil.setSc1('LogAutoSendSchedule', 0, 23, 0, '0 30 *', null);
        if (System.Test.isRunningTest() == false) {
            for(CronTrigger ct : [SELECT Id FROM CronTrigger WHERE CronJobDetail.Name =: scB1.scName]) {
                System.abortJob(ct.Id);
            }
            system.schedule(scB1.scName, scB1.scTime, new LogAutoSendSchedule());
        }
        //20230203 lt 计划的作业优化  一小时两次 end
        String profileId = UserInfo.getProfileId();
        // 20220318 ljh SWAG-CC54R2 add start
@@ -121,7 +136,9 @@
                                                AND NFM501Future_Count__c > 0 AND NFM501Future_Count__c < : max_cnt)
                                            OR(NFM501_Web_Annex_Count__c != null
                                               AND NFM501_Web_Annex_Count__c > 0 AND NFM501_Web_Annex_Count__c < : max_cnt))
                                       AND ownerId = : UserInfo.getUserId()]
                                       AND ownerId = : UserInfo.getUserId()
                                       ORDER BY CreatedDate // 2023-02-04   ZYH   ADD
                                       ]
                );
        }
    }
@@ -300,6 +317,11 @@
            if (strType_c == 'NFM612') {
                NFM612Rest.main(rowData.Id);
            }
            // 2023-3-6   zyh   add   报修子单发送接口测试用
            if (strType_c == 'NFM612S') {
                NFM612Controller.ManualExecute(rowData.Id);
            }
            // 2023-3-6   zyh   add   报修子单发送接口测试用
            if (strType_c == 'NFM620') {
                NFM620Rest.main(rowData.Id);
            }
@@ -310,12 +332,12 @@
                NFM621Controller.execute(rowData, null);
            }
            //zhj 新方案改造 2023-01-06 start
            if (strType_c == 'NFM624') {//智慧医疗pk
                NFM624Rest.main(rowData.Id);
            }
            // if (strType_c == 'NFM624Rest2') {//智慧医疗pk
            //     NFMUtil.againSendToAWS624(rowData.Id);
            // if (strType_c == 'NFM624') {//智慧医疗pk
            //     NFM624Rest.main(rowData.Id);
            // }
            if (strType_c == 'NFM624Rest2') {//智慧医疗pk
                NFMUtil.againSendToAWS624(rowData.Id);
            }
            //zhj 新方案改造 2023-01-06 end
            if (strType_c == 'NFM622') {
                NFM622Controller.execute(rowData, null);
@@ -517,6 +539,8 @@
    }
    global void finish(Database.BatchableContext BC) {
        BatchEmailUtil.removeOtherSc('LogAutoSendSchedule', scB1.scName);  //20230203 lt 计划的作业优化
        // 今回はやることないです
        // 20220318 ljh SWAG-CC54R2 add start
        if(String.isNotBlank(typeNFM) && typeNFM == 'NFM010' && isForecast){