From e6068da47c1bef5517c9e5fdc8c726766867ad4e Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期五, 14 七月 2023 15:10:02 +0800
Subject: [PATCH] Merge branch 'master' into LEXUpgrade2023-Deloitte
---
force-app/main/default/classes/LexRemoveBoxControllerTest.cls | 396 +-------------------------------------------------------
1 files changed, 8 insertions(+), 388 deletions(-)
diff --git a/force-app/main/default/classes/LexRemoveBoxControllerTest.cls b/force-app/main/default/classes/LexRemoveBoxControllerTest.cls
index 9ff8eee..0cf8123 100644
--- a/force-app/main/default/classes/LexRemoveBoxControllerTest.cls
+++ b/force-app/main/default/classes/LexRemoveBoxControllerTest.cls
@@ -1,24 +1,15 @@
@isTest
-<<<<<<< HEAD
private class LexRemoveBoxControllerTest {
static testMethod void myUnitTest() {
user myUser_test;
Account myAccount2;
User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
myAccount2 = new Account(
name = 'Testaccount002',
Dealer_discount__c = 20,
@@ -50,37 +41,12 @@
}
System.runAs(myUser_Test) {
-=======
-private class LexRemoveBoxControllerTest
-{
-
- static testMethod void myUnitTest() {
- user myUser_test;
- Account myAccount2;
- User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
- System.runAs(thisUser){
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
- insert myAccount2;
- Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.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 = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
- insert MyUser_Test;
- }
-
- System.runAs(myUser_Test){
->>>>>>> LEXCommunityLiJun
StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
StaticParameter.EscapeNFM007Trigger = true;
StaticParameter.EscapeOpportunityBefUpdTrigger = true;
StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true;
StaticParameter.EscapeSyncOpportunityTrigger = true;
StaticParameter.EscapeSyncProduct2Trigger = true;
-<<<<<<< HEAD
Product2 prod01 = new Product2(
Name = 'Test01',
ProductCode = 'Test01',
@@ -116,16 +82,6 @@
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);
insert new List<Product2__c>{ pro1, pro2, pro3 };
-=======
- Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Packing_list_manual__c=12,Dealer_special_Object__c = true,Manual_Entry__c = false);
- Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Packing_list_manual__c=10,Dealer_special_Object__c = true,Manual_Entry__c = false);
- Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200313',Packing_list_manual__c=1,Dealer_special_Object__c = true,Manual_Entry__c = false);
- insert new Product2[]{prod01,prod02,prod03};
- 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);
- insert new Product2__c[] {pro1, pro2,pro3};
->>>>>>> LEXCommunityLiJun
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
@@ -147,13 +103,8 @@
Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
Orderdet2.Used_date__c = null;
Orderdet2.Lose_Flag__c = false;
-<<<<<<< HEAD
Orderdet2.Return_date__c = null;
Orderdet2.Send_Date__c = null;
-=======
- Orderdet2.Return_date__c= null;
- Orderdet2.Send_Date__c= null;
->>>>>>> LEXCommunityLiJun
Orderdet2.Box_Piece__c = '鐩�';
conList1.add(Orderdet2);
@@ -166,7 +117,6 @@
Orderdet3.Arrive_date__c = Date.today();
Orderdet3.Send_Date__c = Date.today();
Orderdet3.Box_Piece__c = '涓�';
-<<<<<<< HEAD
Orderdet3.RemoveBox_date__c = Date.today();
Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
Orderdet3.Used_date__c = null;
@@ -174,16 +124,6 @@
Orderdet3.Return_date__c = null;
conList1.add(Orderdet3);
-=======
- Orderdet3.RemoveBox_date__c= Date.today();
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet3.Used_date__c = null;
- Orderdet3.Lose_Flag__c = false;
- Orderdet3.Return_date__c= null;
- conList1.add(Orderdet3);
-
-
->>>>>>> LEXCommunityLiJun
//sale
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001004';
@@ -192,19 +132,11 @@
Orderdet4.Asset_Model_No__c = 'Test02';
Orderdet4.Arrive_date__c = Date.today();
Orderdet4.Box_Piece__c = '涓�';
-<<<<<<< HEAD
Orderdet4.RemoveBox_date__c = Date.today();
Orderdet4.Bar_Code__c = '011495317020843711170400172003311074K250CXSDS';
Orderdet4.Lose_Flag__c = false;
Orderdet4.Return_date__c = null;
Orderdet4.Used_date__c = Date.today();
-=======
- Orderdet4.RemoveBox_date__c= Date.today();
- Orderdet4.Bar_Code__c = '011495317020843711170400172003311074K250CXSDS';
- Orderdet4.Lose_Flag__c = false;
- Orderdet4.Return_date__c= null;
- Orderdet4.Used_date__c= Date.today();
->>>>>>> LEXCommunityLiJun
conList1.add(Orderdet4);
List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
@@ -217,19 +149,11 @@
Orderdet5.Arrive_date__c = Date.today();
//Orderdet5.Used_date__c = Date.today();
Orderdet5.Box_Piece__c = '鐩�';
-<<<<<<< HEAD
Orderdet5.RemoveBox_date__c = Date.today();
Orderdet5.Used_date__c = null;
Orderdet5.Lose_Flag__c = false;
Orderdet5.Return_date__c = null;
Orderdet5.Send_Date__c = null;
-=======
- Orderdet5.RemoveBox_date__c= Date.today();
- Orderdet5.Used_date__c = null;
- Orderdet5.Lose_Flag__c = false;
- Orderdet5.Return_date__c= null;
- Orderdet5.Send_Date__c=null;
->>>>>>> LEXCommunityLiJun
Orderdet5.Bar_Code__c = '010495317014059411170400172203311074K250DCWQW';
conList.add(Orderdet5);
//pandian
@@ -241,19 +165,11 @@
Orderdet7.Box_Piece__c = '鐩�';
Orderdet7.Lose_Flag__c = false;
Orderdet7.Bar_Code__c = '010495317014059411170400172203311074K250DBVUD';
-<<<<<<< HEAD
Orderdet7.RemoveBox_date__c = Date.today();
Orderdet7.Inventory_date__c = Date.today();
conList.add(Orderdet7);
Consumable_order_details2__c Orderdet8 = new Consumable_order_details2__c();
-=======
- Orderdet7.RemoveBox_date__c= Date.today();
- Orderdet7.Inventory_date__c= Date.today();
- conList.add(Orderdet7);
-
- Consumable_order_details2__c Orderdet8= new Consumable_order_details2__c();
->>>>>>> LEXCommunityLiJun
Orderdet8.Name = 'OCM_01_001004';
Orderdet8.Consumable_order_minor__c = Order1.Id;
Orderdet8.Consumable_Product__c = pro2.Id;
@@ -264,22 +180,14 @@
Orderdet8.Bar_Code__c = '010495317014059411170400172203311074K250DBVUC';
Orderdet8.Used_date__c = null;
Orderdet8.Lose_Flag__c = false;
-<<<<<<< HEAD
Orderdet8.Return_date__c = null;
Orderdet8.RemoveBox_date__c = Date.today();
Orderdet8.Send_Date__c = null;
Orderdet8.RemoveBox_No__c = 3;
-=======
- Orderdet8.Return_date__c= null;
- Orderdet8.RemoveBox_date__c=Date.today();
- Orderdet8.Send_Date__c=null;
- Orderdet8.RemoveBox_No__c =3;
->>>>>>> LEXCommunityLiJun
conList.add(Orderdet8);
insert conList1;
insert conList;
-<<<<<<< HEAD
System.Test.startTest();
LexRemoveBoxController Controller = new LexRemoveBoxController();
LexRemoveBoxController.init();
@@ -296,43 +204,18 @@
List<Consumable_order_details2__c> orderDetaList = new List<Consumable_order_details2__c>();
LexRemoveBoxController.removeBoxConfirm(JSON.serialize(orderDetaList), 'Testaccount002', '閲嶅簡', 'ENG');
System.Test.stopTest();
-=======
-
- System.Test.startTest();
- LexRemoveBoxController Controller = new LexRemoveBoxController();
- LexRemoveBoxController.init();
- LexRemoveBoxController.searchConsumableorderdetails('01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRA\n011495317020843711170400172003311074K250CXSDS\n010495317014059411170400172203311074K250DCWQW\n010495317014059411170400172203311074K250DBVUD\n010495317014059411170400172203311074K250DBVUC'
- ,myAccount2.Id,'娣卞湷','ET');
- LexRemoveBoxController.searchConsumableorderdetails('',myAccount2.Id,'閲嶅簡','ET');
- LexRemoveBoxController.barcode = '1004\n1003\n1002\n1001';
- LexRemoveBoxController.getinventorysize();
- LexRemoveBoxController.removeBoxConfirm(JSON.serialize(conList),'Testaccount002','閲嶅簡','ENG');
- List<Consumable_order_details2__c> orderDetaList = new List<Consumable_order_details2__c>();
- LexRemoveBoxController.removeBoxConfirm(JSON.serialize(orderDetaList),'Testaccount002','閲嶅簡','ENG');
- System.Test.stopTest();
-
->>>>>>> LEXCommunityLiJun
}
}
static testMethod void testMethod1() {
user myUser_test;
Account myAccount2;
-<<<<<<< HEAD
User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
myAccount2 = new Account(
name = 'Testaccount002',
Dealer_discount__c = 20,
@@ -399,32 +282,6 @@
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);
insert new List<Product2__c>{ pro1, pro2, pro3 };
-=======
- User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
- System.runAs(thisUser){
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
- insert myAccount2;
- Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.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 = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
- insert MyUser_Test;
- }
-
- System.runAs(myUser_Test){
- Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Packing_list_manual__c=12,Dealer_special_Object__c = true,Manual_Entry__c = false);
- Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Packing_list_manual__c=10,Dealer_special_Object__c = true,Manual_Entry__c = false);
- Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200313',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
- insert new Product2[]{prod01,prod02,prod03};
- 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);
- insert new Product2__c[] {pro1, pro2,pro3};
->>>>>>> LEXCommunityLiJun
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01';
@@ -433,11 +290,7 @@
Order1.Dealer_Info__c = myAccount2.Id;
Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
Order1.Order_ProType__c = 'ET';
-<<<<<<< HEAD
insert Order1;
-=======
- insert Order1;
->>>>>>> LEXCommunityLiJun
//鍙戣揣
Consumable_order__c Order2 = new Consumable_order__c();
Order2.Name = 'OCM_01';
@@ -448,13 +301,8 @@
Order2.Order_ProType__c = 'ENG';
insert Order2;
-<<<<<<< HEAD
List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
//浜у搧绫诲瀷涓嶅悓
-=======
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> ();
- //浜у搧绫诲瀷涓嶅悓
->>>>>>> LEXCommunityLiJun
Consumable_order_details2__c con = new Consumable_order_details2__c();
con.Name = 'OCM_01_001001';
con.Consumable_order_minor__c = Order1.Id;
@@ -464,7 +312,6 @@
con.Bar_Code__c = '10011';
con.Used_date__c = null;
con.Lose_Flag__c = false;
-<<<<<<< HEAD
con.Return_date__c = null;
con.Send_Date__c = null;
con.Box_Piece__c = '鐩�';
@@ -502,45 +349,6 @@
System.Test.startTest();
LexRemoveBoxController.searchConsumableorderdetails('10011', 'Testaccount002', '閲嶅簡', 'ET');
LexRemoveBoxController.searchConsumableorderdetails('10031\n10032', 'Testaccount002', '閲嶅簡', 'ENG');
-=======
- con.Return_date__c= null;
- con.Send_Date__c= null;
- con.Box_Piece__c = '鐩�';
- conList1.add(con);
-
- // 鏈埌璐�
- Consumable_order_details2__c con2 = new Consumable_order_details2__c();
- con2.Arrive_date__c = null;
- con2.Send_Date__c =null;
- con2.Used_date__c = null;
- con2.Return_date__c = null;
- con2.Lose_Flag__c = false;
- con2.Box_Piece__c = '鐩�';
- con2.Consumable_Arrived_order__c = Order2.Id;
- con2.Consumable_Product__c = pro2.Id;
- con2.Consumable_order_minor__c = Order2.Id;
- con2.Bar_Code__c = '10031';
- conList1.add(con2);
- //瑙勬牸=1
- Consumable_order_details2__c con3 = new Consumable_order_details2__c();
- con3.Arrive_date__c = Date.today();
- con3.Send_Date__c =null;
- con3.Used_date__c = null;
- con3.Return_date__c = null;
- con3.Lose_Flag__c = false;
- con3.Box_Piece__c = '鐩�';
- con3.Consumable_Arrived_order__c = Order2.Id;
- con3.Consumable_Product__c = pro3.Id;
- con3.Consumable_order_minor__c = Order2.Id;
- con3.RemoveBox_date__c= Date.today();
- con3.Bar_Code__c = '10032';
- conList1.add(con3);
-
- insert conList1;
- System.Test.startTest();
- LexRemoveBoxController.searchConsumableorderdetails('10011','Testaccount002','閲嶅簡','ET');
- LexRemoveBoxController.searchConsumableorderdetails('10031\n10032','Testaccount002','閲嶅簡','ENG');
->>>>>>> LEXCommunityLiJun
System.Test.stopTest();
}
}
@@ -548,25 +356,16 @@
// TO DO: implement unit test
user myUser_test;
Account myAccount2;
-<<<<<<< HEAD
Product2__c pro2;
Product2__c pro3;
Product2__c pro1;
User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
myAccount2 = new Account(
name = 'Testaccount002',
Dealer_discount__c = 20,
@@ -633,35 +432,6 @@
pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
pro3 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
insert new List<Product2__c>{ pro1, pro2, pro3 };
-=======
- Product2__c pro2 ;
- Product2__c pro3;
- Product2__c pro1;
- User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
- System.runAs(thisUser){
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
- insert myAccount2;
- Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.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 = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
- insert MyUser_Test;
- }
-
- System.runAs(myUser_Test){
- Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Packing_list_manual__c=12,Dealer_special_Object__c = true,Manual_Entry__c = false);
- Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Packing_list_manual__c=10,Dealer_special_Object__c = true,Manual_Entry__c = false);
- Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200313',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
- insert new Product2[]{prod01,prod02,prod03};
- pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
- pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
- pro3 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
- insert new Product2__c[] {pro1, pro2, pro3};
->>>>>>> LEXCommunityLiJun
List<Consumable_order__c> orderList = new List<Consumable_order__c>();
List<Consumable_order__c> orderList1 = new List<Consumable_order__c>();
//鍒拌揣
@@ -684,7 +454,6 @@
orderList.add(Order2);
insert orderList;
-<<<<<<< HEAD
//鍑鸿揣
Consumable_order__c Order3 = new Consumable_order__c();
Order3.Name = 'OCM_03';
@@ -708,31 +477,6 @@
List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
//浜у搧绫诲瀷涓嶅悓
-=======
- //鍑鸿揣
- Consumable_order__c Order3 = new Consumable_order__c();
- Order3.Name = 'OCM_03';
- Order3.Order_status__c = '鎵瑰噯';
- Order3.Order_type__c = '鍑鸿揣';
- Order3.Dealer_Info__c = myAccount2.Id;
- Order3.RecordTypeid = '012100000006Jx9AAE';
- Order3.Order_ProType__c = 'ENG';
- orderList1.add(Order3);
-
- //鍙戣揣
- Consumable_order__c Order4 = new Consumable_order__c();
- Order4.Name = 'OCM_03';
- Order4.Order_status__c = '鎵瑰噯';
- Order4.Order_type__c = '鍙戣揣';
- Order4.Dealer_Info__c = myAccount2.Id;
- Order4.RecordTypeid = '01210000000c9drAAA';
- Order4.Order_ProType__c = 'ENG';
- orderList1.add(Order4);
- insert orderList1;
-
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> ();
- //浜у搧绫诲瀷涓嶅悓
->>>>>>> LEXCommunityLiJun
Consumable_order_details2__c con = new Consumable_order_details2__c();
con.Name = 'OCM_01_001001';
con.Consumable_order_minor__c = Order1.Id;
@@ -742,7 +486,6 @@
con.Bar_Code__c = '10011';
con.Used_date__c = null;
con.Lose_Flag__c = false;
-<<<<<<< HEAD
con.Return_date__c = null;
con.Send_Date__c = null;
con.Box_Piece__c = '鐩�';
@@ -752,17 +495,6 @@
Consumable_order_details2__c con2 = new Consumable_order_details2__c();
con2.Arrive_date__c = null;
con2.Send_Date__c = null;
-=======
- con.Return_date__c= null;
- con.Send_Date__c= null;
- con.Box_Piece__c = '鐩�';
- conList1.add(con);
-
- // // 鏈埌璐�
- Consumable_order_details2__c con2 = new Consumable_order_details2__c();
- con2.Arrive_date__c = null;
- con2.Send_Date__c =null;
->>>>>>> LEXCommunityLiJun
con2.Used_date__c = null;
con2.Return_date__c = null;
con2.Lose_Flag__c = false;
@@ -775,11 +507,7 @@
//瑙勬牸=1
Consumable_order_details2__c con3 = new Consumable_order_details2__c();
con3.Arrive_date__c = Date.today();
-<<<<<<< HEAD
con3.Send_Date__c = null;
-=======
- con3.Send_Date__c =null;
->>>>>>> LEXCommunityLiJun
con3.Used_date__c = null;
con3.Return_date__c = null;
con3.Lose_Flag__c = false;
@@ -787,21 +515,13 @@
con3.Consumable_Arrived_order__c = Order2.Id;
con3.Consumable_Product__c = pro3.Id;
con3.Consumable_order_minor__c = Order2.Id;
-<<<<<<< HEAD
con3.RemoveBox_date__c = Date.today();
-=======
- con3.RemoveBox_date__c= Date.today();
->>>>>>> LEXCommunityLiJun
con3.Bar_Code__c = '10032';
conList1.add(con3);
insert conList1;
System.Test.startTest();
-<<<<<<< HEAD
LexRemoveBoxController.searchConsumableorderdetails('10031\n10032\n', 'Testaccount002', '閲嶅簡', 'ENG');
-=======
- LexRemoveBoxController.searchConsumableorderdetails('10031\n10032\n','Testaccount002','閲嶅簡','ENG');
->>>>>>> LEXCommunityLiJun
System.Test.stopTest();
}
}
@@ -809,25 +529,16 @@
// TO DO: implement unit test
user myUser_test;
Account myAccount2;
-<<<<<<< HEAD
Product2__c pro2;
Product2__c pro3;
Product2__c pro1;
User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
myAccount2 = new Account(
name = 'Testaccount002',
Dealer_discount__c = 20,
@@ -904,45 +615,6 @@
Order1.RecordTypeid = '01210000000c9dqAAA';
Order1.Order_ProType__c = 'ENG';
orderList.add(Order1);
-=======
- Product2__c pro2 ;
- Product2__c pro3;
- Product2__c pro1;
- User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
- System.runAs(thisUser){
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
- insert myAccount2;
- Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.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 = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
- insert MyUser_Test;
- }
-
- System.runAs(myUser_Test){
- Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Packing_list_manual__c=12,Dealer_special_Object__c = true,Manual_Entry__c = false);
- Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Packing_list_manual__c=10,Dealer_special_Object__c = true,Manual_Entry__c = false);
- Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200313',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
- insert new Product2[]{prod01,prod02,prod03};
- pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
- pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
- pro3 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
- insert new Product2__c[] {pro1, pro2,pro3};
- List<Consumable_order__c> orderList = new List<Consumable_order__c>();
- //鍒拌揣
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '鍒拌揣';
- Order1.Dealer_Info__c = myAccount2.Id;
- Order1.RecordTypeid = '01210000000c9dqAAA';
- Order1.Order_ProType__c = 'ENG';
- orderList.add(Order1);
->>>>>>> LEXCommunityLiJun
//鍙戣揣
Consumable_order__c Order2 = new Consumable_order__c();
Order2.Name = 'OCM_01';
@@ -954,13 +626,8 @@
orderList.add(Order2);
insert orderList;
-<<<<<<< HEAD
List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
//浜у搧绫诲瀷涓嶅悓
-=======
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> ();
- //浜у搧绫诲瀷涓嶅悓
->>>>>>> LEXCommunityLiJun
Consumable_order_details2__c con = new Consumable_order_details2__c();
con.Name = 'OCM_01_001001';
con.Consumable_order_minor__c = Order1.Id;
@@ -970,7 +637,6 @@
con.Bar_Code__c = '10011';
con.Used_date__c = null;
con.Lose_Flag__c = false;
-<<<<<<< HEAD
con.Return_date__c = null;
con.Send_Date__c = null;
con.Box_Piece__c = '鐩�';
@@ -1013,49 +679,3 @@
}
}
}
-=======
- con.Return_date__c= null;
- con.Send_Date__c= null;
- con.Box_Piece__c = '鐩�';
- conList1.add(con);
-
- // 鏈埌璐�
- Consumable_order_details2__c con2 = new Consumable_order_details2__c();
- con2.Arrive_date__c = null;
- con2.Send_Date__c =null;
- con2.Used_date__c = null;
- con2.Return_date__c = null;
- con2.Lose_Flag__c = false;
- con2.Box_Piece__c = '鐩�';
- con2.Consumable_Arrived_order__c = Order2.Id;
- con2.Consumable_Product__c = pro2.Id;
- con2.Consumable_order_minor__c = Order2.Id;
- con2.Bar_Code__c = '10031';
- conList1.add(con2);
- //瑙勬牸=1
- Consumable_order_details2__c con3 = new Consumable_order_details2__c();
- con3.Arrive_date__c = Date.today();
- con3.Send_Date__c =null;
- con3.Used_date__c = null;
- con3.Return_date__c = null;
- con3.Lose_Flag__c = false;
- con3.Box_Piece__c = '鐩�';
- con3.Consumable_Arrived_order__c = Order2.Id;
- con3.Consumable_Product__c = pro3.Id;
- con3.Consumable_order_minor__c = Order2.Id;
- con3.RemoveBox_date__c= Date.today();
- con3.Bar_Code__c = '10032';
- conList1.add(con3);
-
- insert conList1;
- System.Test.startTest();
- LexRemoveBoxController.searchConsumableorderdetails('10011\n10031','Testaccount002','閲嶅簡','ENG');
- LexRemoveBoxController.searchConsumableorderdetails('10032','Testaccount002','涓婃捣','ENG');
- LexRemoveBoxController.removeBoxConfirm(JSON.serialize(conList1),'Testaccount002','閲嶅簡','ENG');
- System.Test.stopTest();
-
-
- }
- }
-}
->>>>>>> LEXCommunityLiJun
--
Gitblit v1.9.1