|  |  |  | 
|---|
|  |  |  | ast = [select Id, Name, Product_Serial_No__c, AccountId, Department_Class__c, Department_Class__r.Management_Code_Auto__c, Hospital__c, Product2Id, Product2.ProductCode, Product2.Repair_Product_Code__c, SerialNumber | 
|---|
|  |  |  | from Asset | 
|---|
|  |  |  | where Id = :ast.Id]; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | RepairSubOrder__c subOrder = new RepairSubOrder__c(); | 
|---|
|  |  |  | subOrder.AttachmentDownload__c = true; | 
|---|
|  |  |  | subOrder.AttachmentLink__c = 'https://albsylfw.s3.cn-northwest-1.amazonaws.com.cn/20211220/14/11/30/lessthan12/5e8cb69e-f935-48f5-825e-b8344d60f6d4.zip'; | 
|---|
|  |  |  | subOrder.AttachmentName__c = '测试附件下载'; | 
|---|
|  |  |  | insert subOrder; | 
|---|
|  |  |  | Repair__c rpr = new Repair__c(); | 
|---|
|  |  |  | rpr.PAE_Determine__c = 'PAE' ;   //-- | 
|---|
|  |  |  | rpr.ifDeadHurt__c = '有';        //-- R1 | 
|---|
|  |  |  | 
|---|
|  |  |  | rpr.Account__c             = depart.Id; | 
|---|
|  |  |  | rpr.Department_Class__c    = section.Id; | 
|---|
|  |  |  | rpr.Hospital__c            = company.Id; | 
|---|
|  |  |  | rpr.RepairSubOrder__c = subOrder.Id; | 
|---|
|  |  |  | rpr.Delivered_Product__c   = ast.Id; | 
|---|
|  |  |  | rpr.Status__c              = '1.受理完毕'; | 
|---|
|  |  |  | rpr.Incharge_Staff__c = Userinfo.getUserId(); | 
|---|
|  |  |  | rpr.Repair_Detail__c = 'test'; | 
|---|
|  |  |  | rpr.GeneratedPDFField__c = null; | 
|---|
|  |  |  | rpr.AsyncData__c    = true; | 
|---|
|  |  |  | rpr.AwaitToSendAWS__c = false; | 
|---|
|  |  |  | rpr.Complaint_Number__c = null; | 
|---|
|  |  |  | rpr.ReportAdverseEvents__c = '有'; | 
|---|
|  |  |  | rpr.ProblemOccurred__c = '到货验收'; | 
|---|
|  |  |  | 
|---|
|  |  |  | rpr.Failure_Occurrence_Date__c = Date.today(); | 
|---|
|  |  |  | rpr.Repair_Ordered_Date__c = Date.today(); | 
|---|
|  |  |  | rpr.Repair_Shipped_Date__c = Date.today(); | 
|---|
|  |  |  | rpr.Repair_Ordered_DateTime__c = Datetime.newInstance(2022,04,13,18,18,18); | 
|---|
|  |  |  | rpr.ReturnType__c = 'A20'; | 
|---|
|  |  |  | rpr.AwaitToSendAWS__c = true; | 
|---|
|  |  |  | //rpr.Returns_Product_waySAP__c = '返送医院'; | 
|---|
|  |  |  | 
|---|
|  |  |  | Test.stopTest(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @isTest | 
|---|
|  |  |  | static void testCallOut1_1(){ | 
|---|
|  |  |  | List<Repair__c> repairList = [select id,Repair_Ordered_DateTime__c from Repair__c]; | 
|---|
|  |  |  | Test.startTest(); | 
|---|
|  |  |  | List<Id> idList = new List<Id>(); | 
|---|
|  |  |  | for(Repair__c repair : repairList){ | 
|---|
|  |  |  | idList.add(repair.Id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | BatchIF_Log__c iflog = new BatchIF_Log__c(); | 
|---|
|  |  |  | iflog.Log__c = 'test start \n'; | 
|---|
|  |  |  | insert iflog; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | NFM603Controller.callout(iflog.Id,idList); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Test.stopTest(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @isTest | 
|---|
|  |  |  | static void testCallOut1_2(){ | 
|---|
|  |  |  | List<Repair__c> repairList = [select id,Repair_Ordered_DateTime__c,OTSRepairOrder__c from Repair__c]; | 
|---|
|  |  |  | Test.startTest(); | 
|---|
|  |  |  | List<Id> idList = new List<Id>(); | 
|---|
|  |  |  | for(Repair__c repair : repairList){ | 
|---|
|  |  |  | repair.Repair_Ordered_DateTime__c = Datetime.newInstance(2022,04,13,05,18,18); | 
|---|
|  |  |  | repair.OTSRepairOrder__c = '123123123'; | 
|---|
|  |  |  | idList.add(repair.Id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | upsert repairList; | 
|---|
|  |  |  | for(Repair__c repair : repairList){ | 
|---|
|  |  |  | idList.add(repair.Id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | BatchIF_Log__c iflog = new BatchIF_Log__c(); | 
|---|
|  |  |  | iflog.Log__c = 'test start \n'; | 
|---|
|  |  |  | insert iflog; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | NFM603Controller.callout(iflog.Id,idList); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Test.stopTest(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // @isTest | 
|---|
|  |  |  | // static void testcallout2(){ | 
|---|
|  |  |  | //   List<Repair__c> repairList = [select id from Repair__c]; | 
|---|