| | |
| | | logstr += ex.getMessage(); |
| | | iflog.ErrorLog__c += ex.getMessage() + '\n'; |
| | | iflog.ErrorLog__c += ex.getStackTraceString() + '\n'; |
| | | rowDataSFDC = NFMUtil.LogAutoSend(rowDataSFDC, ex, null); |
| | | if(!Test.isRunningTest()){ |
| | | rowDataSFDC = NFMUtil.LogAutoSend(rowDataSFDC, ex, null); |
| | | } |
| | | } |
| | | iflog.Log__c = logstr; |
| | | upsert iflog; |
| | |
| | | // } |
| | | // 2022/4/18 zhangyuheng update end |
| | | // 测试环境测试用,上线前请注掉 |
| | | if (rpr.Repair_Firstestimated_Date__c != oldrpr.Repair_Firstestimated_Date__c) { |
| | | if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // rprIds.add(rpr.Id); |
| | | rprIdMap.put(rpr.Id, rpr.Id); |
| | | } |
| | | } |
| | | if (rpr.Repair_Shipped_Date__c != oldrpr.Repair_Shipped_Date__c) { |
| | | if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | rprIdMap.put(rpr.Id, rpr.Id); |
| | | } |
| | | } |
| | | // if (rpr.Repair_Firstestimated_Date__c != oldrpr.Repair_Firstestimated_Date__c) { |
| | | // if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | // NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // // rprIds.add(rpr.Id); |
| | | // rprIdMap.put(rpr.Id, rpr.Id); |
| | | // } |
| | | // } |
| | | // if (rpr.Repair_Shipped_Date__c != oldrpr.Repair_Shipped_Date__c) { |
| | | // if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | // NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // rprIdMap.put(rpr.Id, rpr.Id); |
| | | // } |
| | | // } |
| | | // 测试环境测试用,上线前请注掉 |
| | | } |
| | | |
| | |
| | | iflog.Type__c = LOG_TYPE; |
| | | iflog.Log__c = 'callout start\n'; |
| | | insert iflog; |
| | | NFM603Controller.callout(iflog.Id, rprIds); |
| | | NFM603Controller.executefuture(iflog, rprIds); |
| | | } |
| | | } else { |
| | | if (Trigger.isUpdate) { |
| | |
| | | iflog.Log__c = 'test start \n'; |
| | | insert iflog; |
| | | |
| | | NFM603Controller.callout(iflog.Id,idList); |
| | | NFM603Controller.executefuture(iflog,idList); |
| | | |
| | | Test.stopTest(); |
| | | } |
| | |
| | | // Test.stopTest(); |
| | | // } |
| | | |
| | | @isTest |
| | | static void testcallout3(){ |
| | | BatchIF_Log__c iflog = [select id from BatchIF_Log__c where Type__c = '603test']; |
| | | NFM603Controller.ManualExecute(iflog.Id); |
| | | } |
| | | // @isTest |
| | | // static void testcallout3(){ |
| | | // BatchIF_Log__c iflog = [select id from BatchIF_Log__c where Type__c = '603test' limit 1]; |
| | | // NFM603Controller.ManualExecute(iflog.Id); |
| | | // } |
| | | |
| | | @isTest |
| | | static void NFM603BatchTest01(){ |
| | |
| | | // 包含报修子单的修理 修理单状态编号变更发送AWS Start |
| | | if (Trigger.isUpdate) { |
| | | Repair__c oldrpr = oldMap.get(nObj.Id); |
| | | if (String.isNotBlank(nObj.RepairSubOrder__c) && nObj.RepairOrderStatusCode__c != oldrpr.RepairOrderStatusCode__c) { |
| | | nObj.AwaitToSendAWS__c = true; |
| | | } |
| | | // 2022/04/20 zhangyuheng update start |
| | | if ((nObj.OTSRepairOrder__c == oldrpr.OTSRepairOrder__c) && // OTS订单号发生改变,即时发送AWS |
| | | (nObj.DeliveryLogisticsNo__c == oldrpr.DeliveryLogisticsNo__c) && // 送修物流单号发生改变,即时发送AWS |
| | | (nObj.Returns_Product_waySAP__c == oldrpr.Returns_Product_waySAP__c) && // 送修方式发生改变且寄送日有值,即时发送AWS |
| | | (nObj.FSE_ApplyForRepair_time__c == oldrpr.FSE_ApplyForRepair_time__c) && // FSE申请修理日发生改变,即时发送AWS |
| | | (nObj.Repair_Ordered_DateTime__c == oldrpr.Repair_Ordered_DateTime__c) && // 4.修理品RC受理日(小程序)发生改变,即时发送AWS |
| | | (nObj.Repair_Firstestimated_Date__c == oldrpr.Repair_Firstestimated_Date__c) && // 初次报价日(不用)发生改变,即时发送AWS |
| | | (nObj.Repair_Shipped_DateTime__c == oldrpr.Repair_Shipped_DateTime__c) && // 11.RC修理品返送日(小程序)发生改变,即时发送AWS |
| | | (nObj.Repair_Final_Inspection_DateTime__c == oldrpr.Repair_Final_Inspection_DateTime__c) && // 10.最终检测日(小程序)发生改变,即时发送AWS |
| | | (nObj.Agreed_DateTime__c == oldrpr.Agreed_DateTime__c) && //7.用户同意日(小程序)发生改变,即时发送AWS |
| | | (nObj.Agreed_Date__c == oldrpr.Agreed_Date__c) && // 7.用户同意日发生改变,即时发送AWS |
| | | (nObj.engineerSendDate__c == oldrpr.engineerSendDate__c) |
| | | ) { |
| | | // 2022/04/20 zhangyuheng update end |
| | | if (String.isNotBlank(nObj.RepairSubOrder__c) && nObj.RepairOrderStatusCode__c != oldrpr.RepairOrderStatusCode__c) { |
| | | nObj.AwaitToSendAWS__c = true; |
| | | } |
| | | // 2022/04/20 zhangyuheng update start |
| | | } |
| | | // 2022/04/20 zhangyuheng update end |
| | | |
| | | } |
| | | // 包含报修子单的修理 修理单状态编号变更发送AWS End |
| | | |
| | |
| | | Username = 'Test' + timenow + '@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', |
| | | TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', |
| | | ProfileId = System.Label.ProfileId_SystemAdmin, |
| | | Dept__c = '医疗华北营业本部', Province__c = '北京'); |
| | | Dept__c = '医疗华北营业本部', Province__c = '北京',Employee_No__c = '12345'); // 2022-04-25 zhangyuheng update 'Employee_No__c = '12345'' |
| | | |
| | | List<Profile> p = [Select Id From Profile Where Name = '2S1_销售医院担当']; |
| | | System.assertEquals(p.size(), 1); |
| | |
| | | Username = 'Test1' + timenow + '@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', |
| | | TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', |
| | | ProfileId = p[0].Id, |
| | | Dept__c = '医疗华北营业本部', Province__c = '北京'); |
| | | Dept__c = '医疗华北营业本部', Province__c = '北京',Employee_No__c = '23456'); // 2022-04-25 zhangyuheng update 'Employee_No__c = '23456'' |
| | | List<User> us = new List<User>(); |
| | | us.add(user1); |
| | | us.add(user2); |