| | |
| | | user MyUser_Test; |
| | | Account myAccount1; |
| | | Account contract; |
| | | User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | System.runAs(thisUser) { |
| | | Profile prof1 = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET)' |
| | | ]; |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | List<RecordType> rectCo1 = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND DeveloperName = 'AgencyContract' |
| | | ]; |
| | | Profile prof1 = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | List<RecordType> rectCo1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'AgencyContract']; |
| | | |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 10, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '8888888', |
| | | Product_Limit_Date__c = 'Test07|3|100,Test08|10|50' |
| | | ); |
| | | myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'); |
| | | insert myAccount1; |
| | | contract = new Account( |
| | | RecordTypeId = rectCo1[0].Id, |
| | | Name = 'contractName', |
| | | ParentId = myAccount1.id, |
| | | Agent_Ref__c = myAccount1.id, |
| | | Contract_Department_Class__c = 'ET', |
| | | Contract_Decide_Start_Date__c = Date.today().addDays(-2), |
| | | Contract_Decide_End_Date__c = Date.today().addDays(2), |
| | | Dealer_discount__c = 0.8 |
| | | ); |
| | | contract = new Account(RecordTypeId=rectCo1[0].Id ,Name ='contractName',ParentId = myAccount1.id,Agent_Ref__c =myAccount1.id, Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c=Date.today().addDays(-2), |
| | | Contract_Decide_End_Date__c = Date.today().addDays(2),Dealer_discount__c = 0.8); |
| | | insert contract; |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof1.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com', |
| | | Work_Location__c = '重庆' |
| | | ); |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '重庆'); |
| | | insert MyUser_Test; |
| | | |
| | | } |
| | | |
| | | System.runAs(MyUser_Test) { |
| | | //产品数据 |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | Product2 prod01 = new Product2(Name='Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | Product2 prod02 = new Product2(Name='Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod03 = new Product2( |
| | | Name = 'Test03', |
| | | Product2 prod03 = new Product2(Name='Test03', |
| | | ProductCode = 'Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02, prod03 }; |
| | | Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02,prod03}; |
| | | |
| | | //制作产品 |
| | | Product2__c proG = new Product2__c(Name = 'MH-155:白平衡帽', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | |
| | | insert proH; |
| | | Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:水囊鞘管003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id); |
| | | insert proF; |
| | | |
| | | |
| | | //订单 |
| | | Consumable_order__c order = new Consumable_order__c(); |
| | |
| | | LexConsumableController.ConsumableorderdetailsInfo c2 = new LexConsumableController.ConsumableorderdetailsInfo(v); |
| | | LexConsumableController l = new LexConsumableController(); |
| | | LexConsumableController.Results re = LexConsumableController.init('', order.Id, ''); |
| | | LexConsumableController.searchConsumableorderdetails( |
| | | re.userWorkLocation, |
| | | re.agencyProType, |
| | | re.accountName, |
| | | re.accountid, |
| | | re.hospitalId, |
| | | re.contractId, |
| | | 'testMing', |
| | | '', |
| | | '', |
| | | '', |
| | | re.category_Goods, |
| | | re.specialCampaign, |
| | | JSON.serialize(re.dealerProductId), |
| | | re.methodType, |
| | | JSON.serialize(re.consumableorderdetailsRecordsview), |
| | | re.editAble, |
| | | re.proLimitAndDate |
| | | ); |
| | | LexConsumableController.searchorderdetails( |
| | | re.methodType, |
| | | re.accountid, |
| | | re.hospitalId, |
| | | re.contractId, |
| | | re.userWorkLocation, |
| | | re.accountName, |
| | | re.proLimitAndDate, |
| | | re.editAble |
| | | ); |
| | | LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, re.hospitalId, re.contractId, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate); |
| | | LexConsumableController.searchorderdetails(re.methodType, re.accountid, re.hospitalId, re.contractId, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble); |
| | | LexConsumableController.sorder(order.Id, myAccount1.Id); |
| | | Test.stopTest(); |
| | | } |
| | |
| | | user MyUser_Test; |
| | | Account myAccount1; |
| | | Account contract; |
| | | User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | System.runAs(thisUser) { |
| | | Profile prof1 = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET)' |
| | | ]; |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | List<RecordType> rectCo1 = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND DeveloperName = 'AgencyContract' |
| | | ]; |
| | | Profile prof1 = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | List<RecordType> rectCo1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'AgencyContract']; |
| | | |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 10, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '8888888', |
| | | Product_Limit_Date__c = 'Test07|3|100,Test08|10|50' |
| | | ); |
| | | myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'); |
| | | insert myAccount1; |
| | | contract = new Account( |
| | | RecordTypeId = rectCo1[0].Id, |
| | | Name = 'contractName', |
| | | ParentId = myAccount1.id, |
| | | Agent_Ref__c = myAccount1.id, |
| | | Contract_Department_Class__c = 'ET', |
| | | Contract_Decide_Start_Date__c = Date.today().addDays(-2), |
| | | Contract_Decide_End_Date__c = Date.today().addDays(2), |
| | | Dealer_discount__c = 0.8 |
| | | ); |
| | | contract = new Account(RecordTypeId=rectCo1[0].Id ,Name ='contractName',ParentId = myAccount1.id,Agent_Ref__c =myAccount1.id, Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c=Date.today().addDays(-2), |
| | | Contract_Decide_End_Date__c = Date.today().addDays(2),Dealer_discount__c = 0.8); |
| | | insert contract; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof1.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com', |
| | | Work_Location__c = '重庆' |
| | | ); |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '重庆'); |
| | | insert MyUser_Test; |
| | | |
| | | } |
| | | |
| | | System.runAs(MyUser_Test) { |
| | | //产品数据 |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | Product2 prod01 = new Product2(Name='Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | Product2 prod02 = new Product2(Name='Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod03 = new Product2( |
| | | Name = 'Test03', |
| | | Product2 prod03 = new Product2(Name='Test03', |
| | | ProductCode = 'Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02, prod03 }; |
| | | Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02,prod03}; |
| | | |
| | | //制作产品 |
| | | Product2__c proG = new Product2__c(Name = 'MH-155:白平衡帽', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | |
| | | |
| | | //创建医院 |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND DeveloperName = 'HP' |
| | | ] |
| | | .id; |
| | | hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id; |
| | | hospital.Name = 'test hospital'; |
| | | hospital.Is_Active__c = '有効'; |
| | | hospital.Attribute_Type__c = '卫生部'; |
| | |
| | | |
| | | Test.startTest(); |
| | | LexConsumableController.Results re = LexConsumableController.init('', order1.Id, ''); |
| | | LexConsumableController.searchConsumableorderdetails( |
| | | re.userWorkLocation, |
| | | re.agencyProType, |
| | | re.accountName, |
| | | re.accountid, |
| | | re.hospitalId, |
| | | re.contractId, |
| | | 'testMing', |
| | | '', |
| | | '', |
| | | '', |
| | | re.category_Goods, |
| | | re.specialCampaign, |
| | | JSON.serialize(re.dealerProductId), |
| | | re.methodType, |
| | | JSON.serialize(re.consumableorderdetailsRecordsview), |
| | | re.editAble, |
| | | re.proLimitAndDate |
| | | ); |
| | | LexConsumableController.searchorderdetails( |
| | | re.methodType, |
| | | re.accountid, |
| | | re.hospitalId, |
| | | re.contractId, |
| | | re.userWorkLocation, |
| | | re.accountName, |
| | | re.proLimitAndDate, |
| | | re.editAble |
| | | ); |
| | | LexConsumableController.searchConsumableorderdetails( |
| | | re.userWorkLocation, |
| | | re.agencyProType, |
| | | re.accountName, |
| | | re.accountid, |
| | | hospital.Id, |
| | | contract.Id, |
| | | 'testMing', |
| | | '', |
| | | '', |
| | | '', |
| | | re.category_Goods, |
| | | re.specialCampaign, |
| | | JSON.serialize(re.dealerProductId), |
| | | re.methodType, |
| | | JSON.serialize(re.consumableorderdetailsRecordsview), |
| | | re.editAble, |
| | | re.proLimitAndDate |
| | | ); |
| | | LexConsumableController.searchorderdetails( |
| | | re.methodType, |
| | | re.accountid, |
| | | hospital.Id, |
| | | contract.Id, |
| | | re.userWorkLocation, |
| | | re.accountName, |
| | | re.proLimitAndDate, |
| | | re.editAble |
| | | ); |
| | | LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, re.hospitalId, re.contractId, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate); |
| | | LexConsumableController.searchorderdetails(re.methodType, re.accountid, re.hospitalId, re.contractId, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble); |
| | | LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, hospital.Id, contract.Id, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate); |
| | | LexConsumableController.searchorderdetails(re.methodType, re.accountid, hospital.Id, contract.Id, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | |
| | | Account myAccount1; |
| | | Account contract; |
| | | Consumable_order__c order2; |
| | | User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | System.runAs(thisUser) { |
| | | Profile prof1 = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET)' |
| | | ]; |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | List<RecordType> rectCo1 = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND DeveloperName = 'AgencyContract' |
| | | ]; |
| | | Profile prof1 = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | List<RecordType> rectCo1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'AgencyContract']; |
| | | |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 10, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '8888888', |
| | | Product_Limit_Date__c = 'Test07|3|100,Test08|10|50' |
| | | ); |
| | | myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'); |
| | | insert myAccount1; |
| | | contract = new Account( |
| | | RecordTypeId = rectCo1[0].Id, |
| | | Name = 'contractName', |
| | | ParentId = myAccount1.id, |
| | | Agent_Ref__c = myAccount1.id, |
| | | Contract_Department_Class__c = 'ET', |
| | | Contract_Decide_Start_Date__c = Date.today().addDays(-2), |
| | | Contract_Decide_End_Date__c = Date.today().addDays(2), |
| | | Dealer_discount__c = 0.8 |
| | | ); |
| | | contract = new Account(RecordTypeId=rectCo1[0].Id ,Name ='contractName',ParentId = myAccount1.id,Agent_Ref__c =myAccount1.id, Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c=Date.today().addDays(-2), |
| | | Contract_Decide_End_Date__c = Date.today().addDays(2),Dealer_discount__c = 0.8); |
| | | insert contract; |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof1.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com', |
| | | Work_Location__c = '重庆' |
| | | ); |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '重庆'); |
| | | insert MyUser_Test; |
| | | |
| | | //产品数据 |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | Product2 prod01 = new Product2(Name='Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | Product2 prod02 = new Product2(Name='Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod03 = new Product2( |
| | | Name = 'Test03', |
| | | Product2 prod03 = new Product2(Name='Test03', |
| | | ProductCode = 'Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02, prod03 }; |
| | | Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02,prod03}; |
| | | |
| | | //制作产品 |
| | | Product2__c proG = new Product2__c(Name = 'MH-155:白平衡帽', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | |
| | | } |
| | | |
| | | System.runAs(MyUser_Test) { |
| | | |
| | | Test.startTest(); |
| | | LexConsumableController.Results re = LexConsumableController.init('', order2.Id, ''); |
| | | LexConsumableController.searchConsumableorderdetails( |
| | | re.userWorkLocation, |
| | | re.agencyProType, |
| | | re.accountName, |
| | | re.accountid, |
| | | re.hospitalId, |
| | | re.contractId, |
| | | 'testMing', |
| | | '', |
| | | '', |
| | | '', |
| | | re.category_Goods, |
| | | re.specialCampaign, |
| | | JSON.serialize(re.dealerProductId), |
| | | re.methodType, |
| | | JSON.serialize(re.consumableorderdetailsRecordsview), |
| | | re.editAble, |
| | | re.proLimitAndDate |
| | | ); |
| | | LexConsumableController.searchorderdetails( |
| | | re.methodType, |
| | | re.accountid, |
| | | re.hospitalId, |
| | | re.contractId, |
| | | re.userWorkLocation, |
| | | re.accountName, |
| | | re.proLimitAndDate, |
| | | re.editAble |
| | | ); |
| | | LexConsumableController.searchConsumableorderdetails( |
| | | re.userWorkLocation, |
| | | re.agencyProType, |
| | | re.accountName, |
| | | re.accountid, |
| | | re.hospitalId, |
| | | contract.Id, |
| | | 'testMing', |
| | | '', |
| | | '', |
| | | '', |
| | | re.category_Goods, |
| | | re.specialCampaign, |
| | | JSON.serialize(re.dealerProductId), |
| | | re.methodType, |
| | | JSON.serialize(re.consumableorderdetailsRecordsview), |
| | | re.editAble, |
| | | re.proLimitAndDate |
| | | ); |
| | | LexConsumableController.searchorderdetails( |
| | | re.methodType, |
| | | re.accountid, |
| | | re.hospitalId, |
| | | contract.Id, |
| | | re.userWorkLocation, |
| | | re.accountName, |
| | | re.proLimitAndDate, |
| | | re.editAble |
| | | ); |
| | | LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, re.hospitalId, re.contractId, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate); |
| | | LexConsumableController.searchorderdetails(re.methodType, re.accountid, re.hospitalId, re.contractId, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble); |
| | | LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, re.hospitalId, contract.Id, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate); |
| | | LexConsumableController.searchorderdetails(re.methodType, re.accountid, re.hospitalId, contract.Id, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | |
| | | user MyUser_Test; |
| | | Account myAccount1; |
| | | Account contract; |
| | | User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | System.runAs(thisUser) { |
| | | Profile prof1 = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET)' |
| | | ]; |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | List<RecordType> rectCo1 = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND DeveloperName = 'AgencyContract' |
| | | ]; |
| | | Profile prof1 = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | List<RecordType> rectCo1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'AgencyContract']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | |
| | | RecordType rectCoO = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院' |
| | | ]; |
| | | RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus'); |
| | | insert olympus; |
| | | myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 10, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '8888888', |
| | | Product_Limit_Date__c = 'Test07|3|100,Test08|10|50' |
| | | ); |
| | | myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'); |
| | | insert myAccount1; |
| | | System.debug('account111:' + myAccount1); |
| | | contract = new Account( |
| | | RecordTypeId = rectCo1[0].Id, |
| | | Name = 'contractName', |
| | | ParentId = myAccount1.id, |
| | | Agent_Ref__c = myAccount1.id, |
| | | Contract_Department_Class__c = 'ET', |
| | | Contract_Decide_Start_Date__c = Date.today().addDays(-2), |
| | | Contract_Decide_End_Date__c = Date.today().addDays(2), |
| | | ET_SP_Dealer__c = true |
| | | ); |
| | | contract = new Account(RecordTypeId=rectCo1[0].Id ,Name ='contractName',ParentId = myAccount1.id,Agent_Ref__c =myAccount1.id, Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c=Date.today().addDays(-2), |
| | | Contract_Decide_End_Date__c = Date.today().addDays(2),ET_SP_Dealer__c = true); |
| | | insert contract; |
| | | System.debug('account111:' + contract); |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof1.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com', |
| | | Work_Location__c = '重庆' |
| | | ); |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '重庆'); |
| | | insert MyUser_Test; |
| | | |
| | | } |
| | | |
| | | System.runAs(MyUser_Test) { |
| | | //产品数据 |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | Product2 prod01 = new Product2(Name='Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | Product2 prod02 = new Product2(Name='Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod03 = new Product2( |
| | | Name = 'Test03', |
| | | Product2 prod03 = new Product2(Name='Test03', |
| | | ProductCode = 'Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02, prod03 }; |
| | | Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02,prod03}; |
| | | |
| | | //制作产品 |
| | | Product2__c proG = new Product2__c(Name = 'MH-155:白平衡帽', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | |
| | | insert proH; |
| | | Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:水囊鞘管003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id); |
| | | insert proF; |
| | | |
| | | |
| | | //订单 |
| | | Consumable_order__c order = new Consumable_order__c(); |
| | |
| | | re.consumableorderdetailsRecordsview[0].check = true; |
| | | re.consumableorderdetailsRecordsview[0].esd.Consumable_count__c = 1; |
| | | String conId = contract.Id; |
| | | LexConsumableController.ordrCopy( |
| | | contract.Name, |
| | | JSON.serialize(re.coc), |
| | | re.agencyProType, |
| | | re.accountid, |
| | | JSON.serialize(re.consumableorderdetailsRecordsview), |
| | | JSON.serialize(re.contactDealer), |
| | | re.methodType, |
| | | '', |
| | | conId, |
| | | re.agencyProType1, |
| | | false |
| | | ); |
| | | LexConsumableController.save( |
| | | '', |
| | | JSON.serialize(re.coc), |
| | | re.agencyProType, |
| | | re.accountid, |
| | | JSON.serialize(re.consumableorderdetailsRecordsview), |
| | | JSON.serialize(re.contactDealer), |
| | | re.methodType, |
| | | re.ESetId, |
| | | '', |
| | | conId, |
| | | re.agencyProType1, |
| | | false |
| | | ); |
| | | LexConsumableController.save( |
| | | contract.Name, |
| | | JSON.serialize(re.coc), |
| | | re.agencyProType, |
| | | re.accountid, |
| | | JSON.serialize(re.consumableorderdetailsRecordsview), |
| | | JSON.serialize(re.contactDealer), |
| | | re.methodType, |
| | | re.ESetId, |
| | | '', |
| | | '', |
| | | re.agencyProType1, |
| | | false |
| | | ); |
| | | LexConsumableController.save( |
| | | ':Testaccount001', |
| | | JSON.serialize(re.coc), |
| | | 'ET', |
| | | re.accountid, |
| | | JSON.serialize(re.consumableorderdetailsRecordsview), |
| | | JSON.serialize(re.contactDealer), |
| | | re.methodType, |
| | | re.ESetId, |
| | | '', |
| | | re.contractId, |
| | | 'ET', |
| | | false |
| | | ); |
| | | LexConsumableController.save( |
| | | ':Testaccount001', |
| | | JSON.serialize(re.coc), |
| | | 'ET', |
| | | re.accountid, |
| | | JSON.serialize(re.consumableorderdetailsRecordsview), |
| | | JSON.serialize(re.contactDealer), |
| | | 'agreementorder', |
| | | re.ESetId, |
| | | '', |
| | | re.contractId, |
| | | 'ET', |
| | | false |
| | | ); |
| | | LexConsumableController.save( |
| | | ':Testaccount001', |
| | | JSON.serialize(re.coc), |
| | | 'ET', |
| | | re.accountid, |
| | | JSON.serialize(re.consumableorderdetailsRecordsview), |
| | | JSON.serialize(re.contactDealer), |
| | | 'promotionorder', |
| | | re.ESetId, |
| | | '', |
| | | re.contractId, |
| | | 'ET', |
| | | false |
| | | ); |
| | | LexConsumableController.save( |
| | | ':Testaccount001', |
| | | JSON.serialize(re.coc), |
| | | 'ET', |
| | | re.accountid, |
| | | JSON.serialize(re.consumableorderdetailsRecordsview), |
| | | JSON.serialize(re.contactDealer), |
| | | 'hospitalorder', |
| | | re.ESetId, |
| | | '', |
| | | re.contractId, |
| | | 'ET', |
| | | false |
| | | ); |
| | | LexConsumableController.ordrCopy(contract.Name,JSON.serialize(re.coc),re.agencyProType,re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),re.methodType,'',conId,re.agencyProType1,false); |
| | | LexConsumableController.save('',JSON.serialize(re.coc),re.agencyProType,re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),re.methodType,re.ESetId,'',conId,re.agencyProType1,false); |
| | | LexConsumableController.save(contract.Name,JSON.serialize(re.coc),re.agencyProType,re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),re.methodType,re.ESetId,'','',re.agencyProType1,false); |
| | | LexConsumableController.save(':Testaccount001',JSON.serialize(re.coc),'ET',re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),re.methodType,re.ESetId,'',re.contractId,'ET',false); |
| | | LexConsumableController.save(':Testaccount001',JSON.serialize(re.coc),'ET',re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),'agreementorder',re.ESetId,'',re.contractId,'ET',false); |
| | | LexConsumableController.save(':Testaccount001',JSON.serialize(re.coc),'ET',re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),'promotionorder',re.ESetId,'',re.contractId,'ET',false); |
| | | LexConsumableController.save(':Testaccount001',JSON.serialize(re.coc),'ET',re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),'hospitalorder',re.ESetId,'',re.contractId,'ET',false); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | |
| | | static void ConsumableOrdertest5() { |
| | | user MyUser_Test; |
| | | Account myAccount1; |
| | | User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | ContentVersion cv; |
| | | Consumable_order__c order; |
| | | insert n; |
| | | System.runAs(thisUser) { |
| | | Profile prof1 = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET)' |
| | | ]; |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | Profile prof1 = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | RecordType rectCoO = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院' |
| | | ]; |
| | | RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus'); |
| | | insert olympus; |
| | | myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 10, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '8888888', |
| | | Product_Limit_Date__c = 'Test07|3|100,Test08|10|50' |
| | | ); |
| | | myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'); |
| | | insert myAccount1; |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof1.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com', |
| | | Work_Location__c = '重庆' |
| | | ); |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '重庆'); |
| | | insert MyUser_Test; |
| | | |
| | | order = new Consumable_order__c(); |
| | |
| | | cv.VersionData = EncodingUtil.base64Decode('VGVzdA=='); |
| | | cv.IsMajorVersion = true; |
| | | insert cv; |
| | | |
| | | } |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | Product2 prod01 = new Product2(Name='Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | Product2 prod02 = new Product2(Name='Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | |
| | | Product2 prod03 = new Product2( |
| | | Name = 'Test03', |
| | | Product2 prod03 = new Product2(Name='Test03', |
| | | ProductCode = 'Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod04 = new Product2( |
| | | Name = 'Test04', |
| | | ProductCode = 'Test04', |
| | | Asset_Model_No__c = 'Test04', |
| | | Product2 prod04 = new Product2(Name='Test04', |
| | | ProductCode='Test04',Asset_Model_No__c = 'Test04', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Product_Status__c = '正常销售', |
| | |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod05 = new Product2( |
| | | Name = 'Test05', |
| | | Manual_Entry__c = false); |
| | | Product2 prod05 = new Product2(Name='Test05', |
| | | ProductCode = 'Test05', |
| | | Asset_Model_No__c = 'Test05', |
| | | SFDA_Status__c = '有効', |
| | |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02, prod03, prod04, prod05 }; |
| | | Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02,prod03, prod04, prod05}; |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | Product2__c pro3 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id); |
| | | Product2__c pro4 = new Product2__c(Name = 'Pro004', OT_CODE_Text__c = 'Test004', Product2__c = prod04.Id); |
| | | Product2__c pro5 = new Product2__c(Name = 'Pro005', OT_CODE_Text__c = 'Test005', Product2__c = prod05.Id); |
| | | insert new List<Product2__c>{ pro1, pro2, pro3, pro4, pro5 }; |
| | | insert new Product2__c[] {pro1,pro2,pro3,pro4, pro5}; |
| | | |
| | | |
| | | |
| | | Test.startTest(); |
| | | LexConsumableController.Results re1 = LexConsumableController.categoryAllload('ET', 'CDS'); |