| | |
| | | private class updateESignBatchTest { |
| | | //测试经销商收货 |
| | | static testMethod void testMethod1() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | eSignForm.Statu_Achievements__c = Sac.Id; |
| | | eSignForm.Name = '::测试电子签收单'; |
| | | |
| | | |
| | | insert eSignForm; |
| | | |
| | | eSignFormEntry__c eSignFormEntry1 = new eSignFormEntry__c(); |
| | |
| | | eSignFormEntry2.HPConfirmDateBack__c = Date.today().addDays(-2); |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | |
| | | Test.startTest(); |
| | | |
| | | |
| | | Database.executeBatch(new updateESignBatch(), 20); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | //测试经销商确认 |
| | | static testMethod void testMethod2() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | | eSignFormLineItem.Name = '::电子签收单明细'; |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | |
| | | //测试医院收货 |
| | | static testMethod void testMethod3() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | | eSignFormLineItem.Name = '::电子签收单明细'; |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | |
| | | //测试医院确认 |
| | | static testMethod void testMethod4() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | | eSignFormLineItem.Name = '::电子签收单明细'; |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | |
| | | static testMethod void testMethod5() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | } |
| | | |
| | | static testMethod void testMethod6() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | } |
| | | |
| | | static testMethod void testMethod7() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | } |
| | | |
| | | static testMethod void testMethod8() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | } |
| | | |
| | | static testMethod void testMethod9() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | } |
| | | |
| | | static testMethod void testMethod10() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | |
| | | //测试经销商收货 |
| | | static testMethod void testMethod11() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry4; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | | eSignFormLineItem.Name = '::电子签收单明细'; |
| | |
| | | |
| | | insert eSignFormLineItemEntry4; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | } |
| | | //测试医院确认 |
| | | static testMethod void testMethod12() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | | eSignFormLineItem.Name = '::电子签收单明细'; |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | |
| | | //测试经销商收货 |
| | | static testMethod void testMethod13() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | eSignForm.agencyRejectDate__c = Date.today().addDays(2); |
| | | eSignForm.HPRejectDate__c = Date.today().addDays(2); |
| | | |
| | | |
| | | |
| | | insert eSignForm; |
| | | |
| | | /* eSignFormEntry__c eSignFormEntry1 = new eSignFormEntry__c(); |
| | |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2;*/ |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | | eSignFormLineItem.Name = '::电子签收单明细'; |
| | | eSignFormLineItem.eSignForm__c = eSignForm.Id; |
| | | |
| | | |
| | | insert eSignFormLineItem; |
| | | |
| | |
| | | |
| | | insert eSignFormLineItemEntry2;*/ |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | |
| | | Test.startTest(); |
| | | |
| | | |
| | | Database.executeBatch(new updateESignBatch(), 20); |
| | | Test.stopTest(); |
| | | |
| | | } |
| | | //跑单独方法 |
| | | @isTest |
| | | private static void test_upsertESignLineItems() { |
| | | |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | ); |
| | | insert Sac; |
| | | |
| | | |
| | | //新建电子签收单 |
| | | eSignForm__c eSignForm = new eSignForm__c(); |
| | | eSignForm.Statu_Achievements__c = Sac.Id; |
| | | eSignForm.Name = '::测试电子签收单'; |
| | | |
| | | |
| | | insert eSignForm; |
| | | |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | |
| | | eSignFormLineItem.eSignForm__c = eSignForm.Id; |
| | | |
| | | insert eSignFormLineItem; |
| | | |
| | | |
| | | |
| | | /*list<Attachment> attachmentList = new list<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | |
| | | |
| | | // } |
| | | |
| | | |
| | | OCM_Management_Province__c mp1 = new OCM_Management_Province__c(); |
| | | mp1.Name = '江西'; |
| | | mp1.GI_assistant__c = UserInfo.getUserId(); |
| | |
| | | eSignFormList.add(eSignForm); |
| | | |
| | | updateESignBatch.updateOwner(provinceList,provinceMap,eSignFormList,true); |
| | | |
| | | } |
| | | |
| | | //测试经销商收货 |
| | | static testMethod void testMethod14() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | eSignForm.agencyRejectDate__c = Date.today().addDays(2); |
| | | eSignForm.HPRejectDate__c = Date.today().addDays(2); |
| | | |
| | | |
| | | insert eSignForm; |
| | | |
| | | eSignFormEntry__c eSignFormEntry1 = new eSignFormEntry__c(); |
| | | eSignFormEntry1.Name = '::电子签收单录入表1'; |
| | | eSignFormEntry1.eSignForm__c = eSignForm.Id; |
| | | eSignFormEntry1.entryType__c = '经销商收货'; |
| | | |
| | | |
| | | insert eSignFormEntry1; |
| | | |
| | |
| | | eSignFormEntry2.HPConfirmDateBack__c = Date.today().addDays(-2); |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | attach1.parentId=eSignForm.id; |
| | | attach1.ContentType = 'application/pdf'; |
| | | |
| | | |
| | | attachmentList.add(attach1); |
| | | |
| | | Attachment attach2=new Attachment(); |
| | |
| | | attach2.parentId=eSignForm.id; |
| | | attach2.ContentType = 'application/pdf'; |
| | | |
| | | |
| | | attachmentList.add(attach2); |
| | | |
| | | insert attachmentList; |
| | | |
| | | Test.startTest(); |
| | | |
| | | |
| | | Database.executeBatch(new updateESignBatch(), 20); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | static testMethod void testMethod15(){ |
| | | Test.startTest(); |
| | | updateESignBatch.improveTestRate(); |
| | | Test.stopTest(); |
| | | } |
| | | } |