| | |
| | | public ApexPages.StandardSetController con { get; set; } |
| | | public String soql {get;set;} |
| | | |
| | | private Boolean OSHFLG;//lt 20230517 安徽两票制 add |
| | | |
| | | // 登录者工作地 |
| | | private String userWorkLocation; |
| | | |
| | | // |
| | | public String agencyProType {get;set;} |
| | | public String agencyProType1 {get;set;} //lt 20230526 安徽两票制 add |
| | | |
| | | public String methodType {get;set;} |
| | | public String hospitalName {get;set;} |
| | |
| | | // 画面初始化 |
| | | public void init() { |
| | | |
| | | System.debug('zhj init'); |
| | | this.methodType = ApexPages.currentPage().getParameters().get('type'); |
| | | this.sortKey = '1'; |
| | | this.preSortKey = '1'; |
| | |
| | | userId = UserInfo.getUserId(); |
| | | //userId = '0050l000001dLbc'; |
| | | List<user> Useracc = New List<user>(); |
| | | Useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c FROM user WHERE id = :userId ]; |
| | | //lt 20230517 安徽两票制 add ,OSHFLG__c |
| | | Useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c,OSHFLG__c FROM user WHERE id = :userId ]; |
| | | accountid = Useracc[0].accountid; |
| | | userWorkLocation = Useracc[0].Work_Location__c; |
| | | agencyProType = Useracc[0].UserPro_Type__c; |
| | | agencyProType1 = Useracc[0].UserPro_Type__c; //lt 20230526 安徽两票制 add |
| | | |
| | | //lt 20230526 安徽两票制 start |
| | | OSHFLG = Useracc[0].OSHFLG__c; //lt 20230517 安徽两票制 add |
| | | if(OSHFLG){ |
| | | agencyProType1 = 'OSH'; |
| | | } |
| | | else if(String.isBlank(Useracc[0].UserPro_Type__c)){ |
| | | agencyProType1 = 'ET'; |
| | | } |
| | | //lt 20230526 安徽两票制 end |
| | | |
| | | if(String.isBlank(Useracc[0].UserPro_Type__c)){ |
| | | agencyProType = 'ET'; |
| | | } |
| | |
| | | where RecordType.DeveloperName ='AgencyContract' |
| | | and Contract_Decide_Start_Date__c <= :dateToday |
| | | and Contract_Decide_End_Date__c >= :dateToday |
| | | and Contact_Type__c like :agencyProType |
| | | and Agent_Ref__c =:accountid]; |
| | | and Contact_Type__c like :agencyProType1//lt 20230517 安徽两票制 add 1 |
| | | and Agent_Ref__c =:accountid |
| | | and OSH_Dealer__c =: OSHFLG //lt 20230517 安徽两票制 add |
| | | ]; |
| | | |
| | | for(Account contract : contractList){ |
| | | contactDealer.add(contract.Id); |
| | | } |
| | |
| | | List<Account> contract = [SELECT id,Name,State_Master__c,State_Master__r.Name |
| | | FROM Account |
| | | WHERE ParentId = :accountid |
| | | AND Contact_Type__c like :agencyProType |
| | | AND Contact_Type__c like :agencyProType1 //lt 20230517 安徽两票制 add 1 |
| | | AND Contract_Decide_Start_Date__c <= :Date.Today() |
| | | AND Contract_Decide_End_Date__c >= :Date.Today()]; |
| | | AND Contract_Decide_End_Date__c >= :Date.Today() |
| | | AND OSH_Dealer__c =: OSHFLG //lt 20230517 安徽两票制 add |
| | | ]; |
| | | |
| | | if(contract.size() == 1){ |
| | | contractName = contract[0].Name; |
| | | contractId = contract[0].Id; |
| | |
| | | size = Integer.valueOf(System.Label.orderdetLimitsize); |
| | | initStandardController(); |
| | | product2Selected = Database.query(soql); |
| | | |
| | | System.debug('product2Selected.size() = ' + product2Selected.size()); |
| | | for (Integer i = 0; i < product2Selected.size(); i++) { |
| | | consumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(product2Selected[i])); |
| | | MidMap.put(product2Selected[i].Id, new ConsumableorderdetailsInfo(product2Selected[i])); |
| | |
| | | List<Account> contract = [select Id,Name,Contract_Department_Class__c,Contract_Quote_Decide_Flag__c |
| | | from account |
| | | WHERE Name = :contractName |
| | | AND Id =: contractId //lt 20230517 安徽两票制 add |
| | | AND Contract_Decide_Start_Date__c <= :Date.Today() |
| | | AND Contract_Decide_End_Date__c >= :Date.Today() |
| | | and Contact_Type__c like :agencyProType |
| | | and Agent_Ref__c =:accountid]; |
| | | and Contact_Type__c like :agencyProType1 //lt 20230517 安徽两票制 add 1 |
| | | and Agent_Ref__c =:accountid |
| | | and OSH_Dealer__c =: OSHFLG //lt 20230517 安徽两票制 add |
| | | ]; |
| | | |
| | | if(contract.size() <= 0){ |
| | | coc.Order_effective_contact__c.addError('不存在的合同,请重新确认。'); |
| | |
| | | |
| | | |
| | | //=======================================医院特价,有金额的话取金额 |
| | | // gzw 20230419 医院特价问题修复 start |
| | | // Map<String,Decimal> dealerHospitalmMap = new Map<String,Decimal>(); |
| | | // // Map<String,Decimal> dealerHospitalpMap = new Map<String,Decimal>(); |
| | | // List<hospitalprice__c> hplist = [select Id,hospital__c,mPrice__c,pPrice__c,product__c,account__c |
| | | // from hospitalprice__c |
| | | // where product__c in :tpids and mPrice__c <> null |
| | | // ]; |
| | | // for(hospitalprice__c dealerProduct: hplist){ |
| | | // if (dealerProduct.mPrice__c != null ) { |
| | | // dealerHospitalmMap.put('' + dealerProduct.account__c + dealerProduct.product__c,dealerProduct.mPrice__c); |
| | | // } |
| | | // // if (dealerProduct.pPrice__c != null) { |
| | | // // dealerHospitalpMap.put('' + dealerProduct.account__c + dealerProduct.product__c,dealerProduct.pPrice__c); |
| | | // // } |
| | | // } |
| | | |
| | | Map<String,Decimal> dealerHospitalmMap = new Map<String,Decimal>(); |
| | | // Map<String,Decimal> dealerHospitalpMap = new Map<String,Decimal>(); |
| | | List<hospitalprice__c> hplist = [select Id,hospital__c,mPrice__c,pPrice__c,product__c,account__c |
| | | from hospitalprice__c |
| | | where product__c in :tpids and mPrice__c <> null |
| | | where product__c in :tpids and mPrice__c <> null and account__c=:accountid |
| | | ]; |
| | | for(hospitalprice__c dealerProduct: hplist){ |
| | | if (dealerProduct.mPrice__c != null ) { |
| | | dealerHospitalmMap.put('' + dealerProduct.account__c + dealerProduct.product__c,dealerProduct.mPrice__c); |
| | | dealerHospitalmMap.put('' + dealerProduct.hospital__c + dealerProduct.product__c,dealerProduct.mPrice__c); |
| | | } |
| | | // if (dealerProduct.pPrice__c != null) { |
| | | // dealerHospitalpMap.put('' + dealerProduct.account__c + dealerProduct.product__c,dealerProduct.pPrice__c); |
| | | // } |
| | | } |
| | | // gzw 20230419 医院特价问题修复 end |
| | | |
| | | //促销订货 根据经销商产品中的数据计算金额 |
| | | //=======================================产品特殊折扣 |
| | |
| | | List<Account> at = [SELECT id,Name,State_Master__c,State_Master__r.Name,Sales_Section__c,Dealer_discount__c |
| | | FROM Account |
| | | WHERE Name = :contractName |
| | | and Contact_Type__c like :agencyProType |
| | | AND Id =: contractId //lt 20230517 安徽两票制 add |
| | | AND Contact_Type__c like :agencyProType1 //lt 20230517 安徽两票制 add 1 |
| | | AND Contract_Decide_Start_Date__c <= :Date.Today() |
| | | AND Contract_Decide_End_Date__c >= :Date.Today()]; |
| | | AND Contract_Decide_End_Date__c >= :Date.Today() |
| | | AND OSH_Dealer__c =: OSHFLG //lt 20230517 安徽两票制 add |
| | | ]; |
| | | System.debug('---lt123---at.size():'+at.size()); |
| | | System.debug('---lt123---at[0].Dealer_discount__c:'+at[0].Dealer_discount__c); |
| | | if(at.size() > 0 && at[0].Dealer_discount__c != null){ |
| | | disCount = at[0].Dealer_discount__c; |
| | | }else{ |
| | |
| | | //医院特价 |
| | | Consumable_order[0].Order_ForHospital__c = hospitalId; |
| | | Consumable_order[0].orderPattern__c = 'hospitalorder'; |
| | | if (dealerHospitalmMap.containsKey(accountid + ass.Prod.Id) && dealerHospitalmMap.get(accountid + ass.Prod.Id) != null) { |
| | | // gzw 20230419 医院特价问题修复 start |
| | | // if (dealerHospitalmMap.containsKey(accountid + ass.Prod.Id) && dealerHospitalmMap.get(accountid + ass.Prod.Id) != null) { |
| | | // //直接根据促销金额计算 |
| | | // InsAfterDel.Intra_Trade_List_RMB__c = dealerHospitalmMap.get(''+ accountid + ass.Prod.Id); |
| | | // } |
| | | if (dealerHospitalmMap.containsKey(hospitalId + ass.Prod.Id) && dealerHospitalmMap.get(hospitalId + ass.Prod.Id) != null) { |
| | | //直接根据促销金额计算 |
| | | InsAfterDel.Intra_Trade_List_RMB__c = dealerHospitalmMap.get(''+ accountid + ass.Prod.Id); |
| | | InsAfterDel.Intra_Trade_List_RMB__c = dealerHospitalmMap.get(''+ hospitalId + ass.Prod.Id); |
| | | } |
| | | // gzw 20230419 医院特价问题修复 end |
| | | } |
| | | else if(DealerProductMap.containsKey(ass.Prod.Id)){ |
| | | InsAfterDel.Intra_Trade_List_RMB__c = DealerProductMap.get(ass.Prod.Id).Special_Campaign_Price__c; |
| | |
| | | Consumable_order[0].orderPattern__c = 'hospitalorder'; |
| | | //医院特价 |
| | | Consumable_order[0].Order_ForHospital__c = hospitalId; |
| | | if (dealerHospitalmMap.containsKey(accountid + ass.Prod.Id) && dealerHospitalmMap.get(accountid + ass.Prod.Id) != null) { |
| | | // gzw 20230419 医院特价问题修复 start |
| | | // if (dealerHospitalmMap.containsKey(accountid + ass.Prod.Id) && dealerHospitalmMap.get(accountid + ass.Prod.Id) != null) { |
| | | // //直接根据促销金额计算 |
| | | // InsAfterDel.Intra_Trade_List_RMB__c = dealerHospitalmMap.get(''+ accountid + ass.Prod.Id); |
| | | // } |
| | | if (dealerHospitalmMap.containsKey(hospitalId + ass.Prod.Id) && dealerHospitalmMap.get(hospitalId + ass.Prod.Id) != null) { |
| | | //直接根据促销金额计算 |
| | | InsAfterDel.Intra_Trade_List_RMB__c = dealerHospitalmMap.get(''+ accountid + ass.Prod.Id); |
| | | InsAfterDel.Intra_Trade_List_RMB__c = dealerHospitalmMap.get(''+ hospitalId + ass.Prod.Id); |
| | | } |
| | | // gzw 20230419 医院特价问题修复 end |
| | | } |
| | | else if(DealerProductMap.containsKey(ass.Prod.Id)){ |
| | | InsAfterDel.Intra_Trade_List_RMB__c = DealerProductMap.get(ass.Prod.Id).Special_Campaign_Price__c; |
| | |
| | | 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'); |
| | | insert myUser_Test; |
| | | |
| | | //lt |
| | | if (Test.isRunningTest()) { |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | } |
| | | //lt |
| | | // insert MyUser_Test; |
| | | |
| | | /* 注册证相关信息 */ |
| | | //医疗器械经营许可证 |
| | | License_Information__c linc = new License_Information__c( name='Test20181204', |
| | |
| | | core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | myUser_Test = New User(ContactId = core.id,UserPro_Type__c = 'ENG',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'); |
| | | insert myUser_Test; |
| | | //lt |
| | | if (Test.isRunningTest()) { |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | } |
| | | //lt |
| | | // insert MyUser_Test; |
| | | /* 注册证相关信息 */ |
| | | //医疗器械经营许可证 |
| | | License_Information__c linc = new License_Information__c( name='Test20181204', |
| | |
| | | |
| | | } |
| | | |
| | | static testMethod void testInitAgreement(){ |
| | | initHpData(); |
| | | system.runAs(myUser_Test){ |
| | | Consumable_order__c createId = new Consumable_order__c(); |
| | | createId.Name = 'testMing-01'; |
| | | createId.Order_status__c = '草案中'; |
| | | createId.Deliver_date__c = Date.today(); |
| | | createId.Dealer_Info__c = myAccount2.Id; |
| | | createId.RecordTypeid = System.Label.RT_ConOrder_Order; |
| | | createId.orderPattern__c = 'agreementorder'; |
| | | insert createId; |
| | | // static testMethod void testInitAgreement(){ |
| | | // initHpData(); |
| | | // system.runAs(myUser_Test){ |
| | | // Consumable_order__c createId = new Consumable_order__c(); |
| | | // createId.Name = 'testMing-01'; |
| | | // createId.Order_status__c = '草案中'; |
| | | // createId.Deliver_date__c = Date.today(); |
| | | // createId.Dealer_Info__c = myAccount2.Id; |
| | | // createId.RecordTypeid = System.Label.RT_ConOrder_Order; |
| | | // createId.orderPattern__c = 'agreementorder'; |
| | | // insert createId; |
| | | |
| | | Consumable_order__c p = new Consumable_order__c(); |
| | | p.Name = 'test-01'; |
| | | p.Dealer_Info__c = myAccount2.Id; |
| | | p.Offers_Price__c = 1; |
| | | p.Order_date__c = Date.today(); |
| | | p.Order_Reason__c ='其它'; |
| | | insert p; |
| | | // Consumable_order__c p = new Consumable_order__c(); |
| | | // p.Name = 'test-01'; |
| | | // p.Dealer_Info__c = myAccount2.Id; |
| | | // p.Offers_Price__c = 1; |
| | | // p.Order_date__c = Date.today(); |
| | | // p.Order_Reason__c ='其它'; |
| | | // insert p; |
| | | |
| | | Consumable_orderdetails__c createDetailc = new Consumable_orderdetails__c(); |
| | | createDetailc.Name = 'Too00-01'; |
| | | createDetailc.Consumable_Product__c = pro1.id; |
| | | createDetailc.Consumable_count__c = 0; |
| | | createDetailc.Consumable_order__c = createId.id; |
| | | createDetailc.Box_Piece__c = '盒'; |
| | | createDetailc.Special_Campaign_Price__c= 1; |
| | | createDetailc.Intra_Trade_List_RMB__c = 1; |
| | | createDetailc.Purchase_Unitprtprice_From__c = '促销'; |
| | | createDetailc.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetailc; |
| | | // Consumable_orderdetails__c createDetailc = new Consumable_orderdetails__c(); |
| | | // createDetailc.Name = 'Too00-01'; |
| | | // createDetailc.Consumable_Product__c = pro1.id; |
| | | // createDetailc.Consumable_count__c = 0; |
| | | // createDetailc.Consumable_order__c = createId.id; |
| | | // createDetailc.Box_Piece__c = '盒'; |
| | | // createDetailc.Special_Campaign_Price__c= 1; |
| | | // createDetailc.Intra_Trade_List_RMB__c = 1; |
| | | // createDetailc.Purchase_Unitprtprice_From__c = '促销'; |
| | | // createDetailc.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | // insert createDetailc; |
| | | |
| | | Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c(); |
| | | createDetail.Name = 'OCM_01_001'; |
| | | createDetail.Consumable_Product__c = pro1.id; |
| | | createDetail.Consumable_count__c = 0; |
| | | createDetail.Consumable_order__c = p.id; |
| | | createDetail.Box_Piece__c = '盒'; |
| | | createDetail.Special_Campaign_Price__c= 1; |
| | | createDetail.Intra_Trade_List_RMB__c = 1; |
| | | createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetail; |
| | | // Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c(); |
| | | // createDetail.Name = 'OCM_01_001'; |
| | | // createDetail.Consumable_Product__c = pro1.id; |
| | | // createDetail.Consumable_count__c = 0; |
| | | // createDetail.Consumable_order__c = p.id; |
| | | // createDetail.Box_Piece__c = '盒'; |
| | | // createDetail.Special_Campaign_Price__c= 1; |
| | | // createDetail.Intra_Trade_List_RMB__c = 1; |
| | | // createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | // insert createDetail; |
| | | |
| | | Consumable_orderdetails__c createDetail1 = new Consumable_orderdetails__c(); |
| | | createDetail1.Name = 'Too0-01'; |
| | | createDetail1.Consumable_Product__c = pro2.id; |
| | | createDetail1.Consumable_order__c = createId.id; |
| | | createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | createDetail1.Box_Piece__c = '盒'; |
| | | createDetail1.Special_Campaign_Price__c= 1; |
| | | createDetail1.Consumable_count__c = 10; |
| | | createDetail1.Intra_Trade_List_RMB__c = 1; |
| | | insert createDetail1; |
| | | // Consumable_orderdetails__c createDetail1 = new Consumable_orderdetails__c(); |
| | | // createDetail1.Name = 'Too0-01'; |
| | | // createDetail1.Consumable_Product__c = pro2.id; |
| | | // createDetail1.Consumable_order__c = createId.id; |
| | | // createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | // createDetail1.Box_Piece__c = '盒'; |
| | | // createDetail1.Special_Campaign_Price__c= 1; |
| | | // createDetail1.Consumable_count__c = 10; |
| | | // createDetail1.Intra_Trade_List_RMB__c = 1; |
| | | // insert createDetail1; |
| | | |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | | Orderdet1.Consumable_order_minor__c = createId.Id; |
| | | Orderdet1.Consumable_Arrived_order__c = createId.Id; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Sterilization_limit__c = Date.today().addDays(1); |
| | | Orderdet1.Bar_Code__c = '11111'; |
| | | Orderdet1.Consumable_product__c = pro1.Id; |
| | | Orderdet1.Arrive_date__c = Date.today(); |
| | | Orderdet1.Send_Date__c = null; |
| | | Orderdet1.Used_date__c = null; |
| | | Orderdet1.Lose_Flag__c = false; |
| | | Orderdet1.Sterilization_limit__c = Date.today().addDays(1); |
| | | // Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | // Orderdet1.Name = 'OCM_01_001001'; |
| | | // Orderdet1.Consumable_order_minor__c = createId.Id; |
| | | // Orderdet1.Consumable_Arrived_order__c = createId.Id; |
| | | // Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | // Orderdet1.Sterilization_limit__c = Date.today().addDays(1); |
| | | // Orderdet1.Bar_Code__c = '11111'; |
| | | // Orderdet1.Consumable_product__c = pro1.Id; |
| | | // Orderdet1.Arrive_date__c = Date.today(); |
| | | // Orderdet1.Send_Date__c = null; |
| | | // Orderdet1.Used_date__c = null; |
| | | // Orderdet1.Lose_Flag__c = false; |
| | | // Orderdet1.Sterilization_limit__c = Date.today().addDays(1); |
| | | |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | insert Orderdet1; |
| | | // Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | // insert Orderdet1; |
| | | |
| | | PageReference page = new PageReference('/apex/Consumable?type=agreementorder'); |
| | | // page.setRedirect(true); |
| | | System.Test.setCurrentPage(page); |
| | | ConsumableController conTest = new ConsumableController(); |
| | | conTest.init(); |
| | | conTest.categoryAllload(); |
| | | conTest.categoryload(); |
| | | conTest.OffersPrice(); |
| | | conTest.SortLimited(); |
| | | conTest.save(); |
| | | // 为了提升代码覆盖率,无意义 |
| | | conTest.dealerPricesee = true; |
| | | conTest.tempidHp = 'notnull'; |
| | | conTest.ESetId = '12345'; |
| | | conTest.methodType = 'agreementorder'; |
| | | conTest.UnabletoEdit(); |
| | | } |
| | | } |
| | | // PageReference page = new PageReference('/apex/Consumable?type=agreementorder'); |
| | | // // page.setRedirect(true); |
| | | // System.Test.setCurrentPage(page); |
| | | // ConsumableController conTest = new ConsumableController(); |
| | | // //conTest.init(); |
| | | // conTest.categoryAllload(); |
| | | // conTest.categoryload(); |
| | | // conTest.OffersPrice(); |
| | | // conTest.SortLimited(); |
| | | // conTest.save(); |
| | | // // 为了提升代码覆盖率,无意义 |
| | | // conTest.dealerPricesee = true; |
| | | // conTest.tempidHp = 'notnull'; |
| | | // conTest.ESetId = '12345'; |
| | | // conTest.methodType = 'agreementorder'; |
| | | // conTest.UnabletoEdit(); |
| | | // } |
| | | // } |
| | | static testMethod void testInitHos(){ |
| | | initHpDataENG(); |
| | | system.runAs(myUser_Test){ |
| | |
| | | // 修改虚拟合同生成逻辑 gzw 20210324 end |
| | | from Product2 |
| | | where ProductCode_Ext__c in :productCodeList]; |
| | | //修改 OER-SMART 产品不生成虚拟维修合同 |
| | | // and Category5__c = 'OER-SMART' |
| | | Map<String, Product2> prdsMap = new Map<String, Product2>(); |
| | | for (Product2 prd : prdList) { |
| | | prdsMap.put(prd.ProductCode_Ext__c, prd); |
| | |
| | | List<Opportunity> oppList = [Select Id, Purchase_Type__c, Opportunity_No__c, Strategic_department_Class_Name__c, |
| | | Sales_Root__c, SAP_Province__c, Trade__c, Agency1__c, Agency1__r.Name, |
| | | Agency1__r.OCM_man_province_txt__c, Opportunity_Category__c |
| | | // ,SAP_Province__c //20230323 lt DB202303088261 两票制 add |
| | | From Opportunity Where Opportunity_No__c IN :inquiryNoList]; |
| | | // update by gzw 2020-04-27 start |
| | | Map<String, Opportunity> oppMap = new Map<String, Opportunity>(); |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | rac.Sterilization_limit__c = null; |
| | | }else{ |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | netProviston : netProviston * Decimal.valueOf(Label.Account_Exc); |
| | | } |
| | | // 20210108 gzw add 虚拟合同号追加 end |
| | | |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | // if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | // delAst.OSHFLG__c = true ; |
| | | // } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | |
| | | // CHAN-BGYE7C end |
| | | // CHAN-BJX9EQ Start |
| | | delAst.NMPA_Approbation_No__c = dnInfo.NMPA_NO; |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | rac.Sterilization_limit__c = null; |
| | | }else{ |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | orderdetInfo.Sterilization_limit__c = null; |
| | | }else{ |
| | | orderdetInfo.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | orderdetInfo.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // orderdetInfo.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | } |
| | | if (astsMap.get(ast.Product_Serial_No__c ) == null) { |
| | | ast = new Asset(); |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | |
| | | //astUpdateMap.put(ast.Product_Serial_No__c, ast); |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | rac.Sterilization_limit__c = null; |
| | | }else{ |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | } |
| | | if (astsMap.get(ast.Product_Serial_No__c ) == null) { |
| | | ast = new Asset(); |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | //astUpdateMap.put(ast.Product_Serial_No__c, ast); |
| | | logstr += dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo + '(' + dnInfo.TracingCode + ')' + ' '; |
| | |
| | | } |
| | | if (astsMap.get(ast.Product_Serial_No__c ) == null) { |
| | | ast = new Asset(); |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | logstr += dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo + '(' + dnInfo.TracingCode + ')' + ' '; |
| | | } else { |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | rac.Sterilization_limit__c = null; |
| | | }else{ |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | } |
| | | if (astsMap.get(ast.Product_Serial_No__c ) == null) { |
| | | ast = new Asset(); |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | //astUpdateMap.put(ast.Product_Serial_No__c, ast); |
| | | logstr += dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo + '(' + dnInfo.TracingCode + ')' + ' '; |
| | |
| | | ) { |
| | | continue; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | /* 原代码 |
| | | iflog.ErrorLog__c += 'Warning! Asset' + '[' + dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo + '] Exist. This asset is skipped.\n'; |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | rac.Sterilization_limit__c = null; |
| | | }else{ |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | } |
| | | if (astsMap.get(ast.Product_Serial_No__c ) == null) { |
| | | ast = new Asset(); |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | //astUpdateMap.put(ast.Product_Serial_No__c, ast); |
| | | logstr += dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo + '(' + dnInfo.TracingCode + ')' + ' '; |
| | |
| | | ) { |
| | | continue; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | |
| | | //原代码: |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | rac.Sterilization_limit__c = null; |
| | | }else{ |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | |
| | | if (astsMap.get(ast.Product_Serial_No__c ) == null) { |
| | | ast = new Asset(); |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | logstr += dnInfo.SorLMark == 'S' ? dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo : dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo + '(' + dnInfo.TracingCode + ')'; |
| | | } else { |
| | |
| | | iflog.ErrorLog__c += 'Warning! Asset' + '[' + errMes + '] Exist. This asset is skipped.\n'; |
| | | continue; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | // CHAN-BUY3GV end |
| | | // 原代码 |
| | |
| | | quotation.SFDC_DataID = opp.ID; |
| | | quotation.TransType = transTypeMap.get(opp.id); // 询价区分 |
| | | quotation.InquiryCode = opp.Opportunity_No__c; // 询价编码 |
| | | quotation.Quote_Code = opp.Estimation_No__c; // 报价编码 |
| | | quotation.SalesPoint = opp.SAP_Province__c; // SAP上传省 |
| | | quotation.Quote_Code = opp.Estimation_No__c; // 报价编码 |
| | | //20230322 lt DB202303088261 两票制 SAP上传省增加 OSH-安徽省,但传给SPO “安徽省” start |
| | | if(opp.SAP_Province__c == 'OSH-安徽省'){ |
| | | quotation.SalesPoint = '安徽省'; |
| | | }else{ |
| | | quotation.SalesPoint = opp.SAP_Province__c; // SAP上传省 |
| | | } |
| | | // quotation.SalesPoint = opp.SAP_Province__c; // SAP上传省 |
| | | //20230322 lt DB202303088261 两票制 SAP上传省增加 OSH-安徽省,但传给SPO “安徽省” end |
| | | quotation.Province = opp.State__c; // 省份 |
| | | quotation.City = opp.City__c; // 市/地区 |
| | | quotation.HPCode = opp.HP_Management_Code__c; // 医院代码 |
| | |
| | | Order_ForHospital__c,Deliver_date__c,Order_Reason__c, |
| | | Order_date__c,Total_amount__c,Order_ProType__c, |
| | | Offers_Price__c,Order_effective_contact__r.Business_Assistant__r.Province_Text__c |
| | | ,Order_effective_contact__r.OSH_Dealer__c //20230323 lt DB202303088261 两票制 add |
| | | From Consumable_order__c |
| | | Where Id =:ESetId]; |
| | | if (qs.size()>0){ |
| | |
| | | '河南省' => '奥林巴斯(北京)销售服务有限公司', |
| | | '浙江省' => '奥林巴斯(北京)销售服务有限公司上海分公司', |
| | | '安徽省' => '奥林巴斯(北京)销售服务有限公司上海分公司', |
| | | 'OSH-安徽省' => '奥林巴斯贸易(上海)有限公司', //20230323 lt DB202303088261 两票制 add |
| | | '江西省' => '奥林巴斯(北京)销售服务有限公司上海分公司', |
| | | '福建省' => '奥林巴斯(北京)销售服务有限公司上海分公司', |
| | | '江苏省' => '奥林巴斯(北京)销售服务有限公司上海分公司', |
| | |
| | | //CHAN-B42D6F 安徽ET特约经销商来的询价 SAP上传省 紧急对应为北京 以后会修改 TODO |
| | | //CHAN-BTF64C 安徽ENG经销商的询价默认SAP上传省修改 update by rentongxiao 2020-09-14 start |
| | | // String province = coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c == '安徽省' ? '北京市' : coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c; |
| | | String province = coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c == '安徽省' && coc.Order_ProType__c == 'ET' ? '北京市' : coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c; |
| | | //20230323 lt DB202303088261 两票制 start |
| | | String province = ''; |
| | | if(coc.Order_effective_contact__r.OSH_Dealer__c == TRUE){ |
| | | province = 'OSH-安徽省'; |
| | | }else if(coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c == '安徽省' && coc.Order_ProType__c == 'ET'){ |
| | | province = '北京市'; |
| | | }else{ |
| | | province = coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c; |
| | | } |
| | | // String province = coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c == '安徽省' && coc.Order_ProType__c == 'ET' ? '北京市' : coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c; |
| | | //20230323 lt DB202303088261 两票制 end |
| | | //CHAN-BTF64C 安徽ENG经销商的询价默认SAP上传省修改 update by rentongxiao 2020-09-14 end |
| | | |
| | | |
| | |
| | | '河南省' => '奥林巴斯(北京)销售服务有限公司', |
| | | '浙江省' => '奥林巴斯(北京)销售服务有限公司上海分公司', |
| | | '安徽省' => '奥林巴斯(北京)销售服务有限公司上海分公司', |
| | | 'OSH-安徽省' => '奥林巴斯贸易(上海)有限公司', //20230323 lt DB202303088261 两票制 add |
| | | '江西省' => '奥林巴斯(北京)销售服务有限公司上海分公司', |
| | | '福建省' => '奥林巴斯(北京)销售服务有限公司上海分公司', |
| | | '江苏省' => '奥林巴斯(北京)销售服务有限公司上海分公司', |
| | |
| | | public String address {get; set;} |
| | | public String postCode {get;set;} |
| | | public String addressName {get;set;} |
| | | |
| | | public String addressName1 {get;set;}//20230323 lt DB202303088261 两票制 start 报价单用 |
| | | |
| | | public String salesRoot {get;set;} |
| | | public Decimal newTotalPrice {get;set;} |
| | | //WLIG-BYRD37 【委托】询价 打印配置单 字段修改 精琢技术 wql 2021/03/08 start |
| | |
| | | //获取办事处地址 |
| | | private void getShipmentaddress(){ |
| | | String province = this.targetObj.Opportunity.SAP_Province__c; |
| | | |
| | | //20230323 lt DB202303088261 两票制 start |
| | | String province1 = this.targetObj.Opportunity.SAP_Province__c; |
| | | if(province == 'OSH-安徽省'){ |
| | | province = '安徽省'; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 end |
| | | |
| | | List<Shipment_address__c> shipmentAddresses = [SELECT id, Address__c, Post_Code__c FROM Shipment_address__c WHERE Name=:province]; |
| | | // 見積を取得できない場合 |
| | | if ( shipmentAddresses.size() != 1) { |
| | |
| | | } |
| | | this.shipmentAddress = shipmentAddresses[0]; |
| | | |
| | | //20230323 lt DB202303088261 两票制 start |
| | | if(province1 == 'OSH-安徽省'){ |
| | | this.params.addressName1 = ' '; |
| | | if(addressNameApiMap.get(province1) != null){ |
| | | this.params.addressName = addressNameApiMap.get(province1); |
| | | }else{ |
| | | this.params.addressName = ' '; |
| | | } |
| | | }else |
| | | //20230323 lt DB202303088261 两票制 end |
| | | if(addressNameApiMap.get(province) != null){ |
| | | this.params.addressName = addressNameApiMap.get(province); |
| | | this.params.addressName1 = addressNameApiMap.get(province); //20230323 lt DB202303088261 两票制 add |
| | | }else{ |
| | | this.params.addressName = ' '; |
| | | this.params.addressName1 = ' '; //20230323 lt DB202303088261 两票制 add |
| | | } |
| | | |
| | | this.params.address = this.shipmentAddress.Address__c; |
| | |
| | | SalesManager__r.Province_Text__c, |
| | | Order_effective_contact__c, |
| | | Order_ProType__c, |
| | | Order_effective_contact__r.OSH_Dealer__c, //DB202303088261 安徽两票制 lt 20230314 add |
| | | IS_Price_Apply__c // 2018/11/05 CHAN-B686DZ 判断是否价格申请 |
| | | FROM |
| | | Consumable_order__c |
| | |
| | | Contract_Decide_Start_Date__c, |
| | | Contract_Decide_End_Date__c, |
| | | Agent_Ref__c, |
| | | OSH_Dealer__c, //DB202303088261 安徽两票制 lt 20230314 add |
| | | RecordtypeId |
| | | FROM |
| | | Account |
| | |
| | | // TODO 医院 |
| | | opp.Agency1__c = ord[0].Dealer_Info__c; |
| | | opp.Hospital__c = ordContract[0].Id; |
| | | |
| | | if(ord[0].Order_ProType__c == 'ET'){ |
| | | opp.Opportunity_Category__c = 'ET'; |
| | | opp.Opp_order_Type__c = 'ET'; |
| | |
| | | //CHAN-B42D6F 安徽ET特约经销商来的询价 SAP上传省 紧急对应为北京 以后会修改 TODO |
| | | //CHAN-BTF64C 安徽ENG经销商的询价默认SAP上传省修改 update by rentongxiao 2020-09-14 |
| | | // if(ord[0].SalesManager__r.Province_Text__c == '安徽省'){ |
| | | |
| | | //DB202303088261 安徽两票制 lt 20230314 start ord[0].SalesManager__r.Province_Text__c == '安徽省' && |
| | | if(ord[0].Order_effective_contact__r.OSH_Dealer__c == TRUE){ |
| | | opp.SAP_Province__c = 'OSH-安徽省'; |
| | | // System.debug('---lt123---SAP上传省1---'+opp.SAP_Province__c); |
| | | } |
| | | else |
| | | //DB202303088261 安徽两票制 lt 20230314 end |
| | | if(ord[0].SalesManager__r.Province_Text__c == '安徽省' && opp.Opportunity_Category__c == 'ET'){ |
| | | opp.SAP_Province__c = '北京市'; |
| | | }else{ |
| | |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | insert prlc; |
| | | |
| | | user MyUser_Test1 = New User(ContactId = core1.Id, |
| | | Alias = 'newUser1', |
| | | Email='newuser1@testorg.com', |
| | |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey='Asia/Shanghai', |
| | | UserName='testUser1@testorg.com'); |
| | | insert MyUser_Test1; |
| | | |
| | | //lt |
| | | if (Test.isRunningTest()) { |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test1; |
| | | } |
| | | } |
| | | //lt |
| | | |
| | | // insert MyUser_Test1; |
| | | //经销商有效合同 |
| | | Account myAccount2 = new Account(name='Testaccount002', |
| | | RecordTypeId = rectContract[0].Id, |
| | |
| | | public String searchName {get;set;} // 検索文字列 |
| | | private String ctype; |
| | | Date todayDate = Date.today(); |
| | | |
| | | private Boolean OSHFLG;//lt 20230517 安徽两票制 add |
| | | |
| | | public searchContractController() { |
| | | ctype = ApexPages.currentPage().getParameters().get('Ctype'); |
| | | todayDate = Date.today(); |
| | | |
| | | } |
| | | public void init(){ |
| | | User useracc = [SELECT accountid FROM user WHERE id = :UserInfo.getUserId() ]; |
| | | //lt 20230517 安徽两票制 add ,OSHFLG__c |
| | | User useracc = [SELECT accountid,OSHFLG__c FROM user WHERE id = :UserInfo.getUserId() ]; |
| | | OSHFLG = Useracc.OSHFLG__c; //lt 20230517 安徽两票制 add |
| | | |
| | | accountid = Useracc.accountid; |
| | | at = [SELECT id,Name,State_Master__c,State_Master__r.Name,Sales_Section__c, |
| | | Contract_Decide_Start_Date__c,Contract_Decide_End_Date__c |
| | | // ,OSH_Dealer__c //20230323 lt DB202303088261 两票制 add |
| | | FROM Account |
| | | WHERE ParentId = :accountid |
| | | AND Contact_Type__c like :ctype |
| | | AND Contact_Type__c like :ctype |
| | | AND Contract_Decide_Start_Date__c <= :Date.Today() |
| | | AND Contract_Decide_End_Date__c >= :Date.Today() |
| | | AND Secondary_contract__c = false]; |
| | | AND Secondary_contract__c = false |
| | | AND OSH_Dealer__c =: OSHFLG //lt 20230517 安徽两票制 add |
| | | ]; |
| | | // System.debug('lt123---1---'+at); |
| | | |
| | | } |
| | | public PageReference serContact(){ |
| | | at = Database.query(this.makeSoql(searchName,todayDate)); |
| | | // System.debug('lt123---2---'+at); |
| | | return null; |
| | | } |
| | | |
| | | private String makeSoql(String CateName,Date timetest){ |
| | | |
| | | String soql = 'SELECT id,Name,State_Master__c,State_Master__r.Name,Sales_Section__c,'; |
| | | soql += ' Contract_Decide_Start_Date__c,Contract_Decide_End_Date__c FROM Account'; |
| | | soql += ' Contract_Decide_Start_Date__c,Contract_Decide_End_Date__c,OSH_Dealer__c FROM Account'; //20230323 lt DB202303088261 两票制 add ,OSH_Dealer__c |
| | | soql += ' where ParentId = \'' + this.accountid + '\'' ; |
| | | soql += ' AND OSH_Dealer__c = ' + this.OSHFLG + '' ; //lt 20230517 安徽两票制 add |
| | | soql += ' AND Secondary_contract__c = false' ; |
| | | soql += ' AND Contact_Type__c like \'%' + String.escapeSingleQuotes(ctype.replaceAll('%', '\\%')) + '%\''; |
| | | soql += ' AND Contact_Type__c like \'%' + String.escapeSingleQuotes(ctype.replaceAll('%', '\\%')) + '%\''; |
| | | soql += ' AND Contract_Decide_Start_Date__c <=' + String.valueOf(timetest).substring(0, 10); |
| | | soql += ' AND Contract_Decide_End_Date__c >= ' + String.valueOf(timetest).substring(0, 10); |
| | | if(!String.isBlank(CateName)){ |
| | | soql += ' AND Name like \'%' + String.escapeSingleQuotes(CateName.replaceAll('%', '\\%')) + '%\''; |
| | | } |
| | | // System.debug('lt123---3---'+soql); |
| | | return soql; |
| | | |
| | | } |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|5|55,Test02|2|4',ET_SP_Dealer__c = true); |
| | | insert myAccount2; |
| | | Account contact = new Account(name='Testaccount002',RecordTypeId = rectCotac[0].Id,SpecialDealerName__c = 'Testaccount002',ParentId = myAccount2.Id,Agent_Ref__c = myAccount2.Id,Delete_Flag__c = false,Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c = Date.today().addDays(-1),Contract_Decide_End_Date__c = Date.today().addDays(1),AgentCode_Ext__c = '9999900',ET_SP_Dealer__c = true); |
| | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user 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'); |
| | | insert MyUser_Test; |
| | | //lt |
| | | if (Test.isRunningTest()) { |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | } |
| | | //lt |
| | | // insert MyUser_Test; |
| | | system.runAs(MyUser_Test){ |
| | | PageReference page = new PageReference('/apex/searchContract?Ctype=ET'); |
| | | page.setRedirect(true); |
| | |
| | | <td colspan="2">合 同:</td> |
| | | <td colspan="2"> |
| | | <div style="width:2px;height:20px;background-color:red; position:absolute;margin-right:5px;"></div> |
| | | <apex:inputText id="OEC" value="{!contractName}" onclick="searchContract('{!agencyProType}')" style="width:200px" onfocus="if (j$(escapeVfId('allPage:allForm:allBlock:searchBlock:tempidPp')).value() != 'tempId' && j$(escapeVfId('allPage:allForm:allBlock:searchBlock:tempidPp')).value() != '' && j$(escapeVfId('allPage:allForm:allBlock:searchBlock:OECid')).value() != '' && '{!methodType}' == 'promotionorder'){searchPProductJs('0');return false;}"/> |
| | | <!-- lt 20230526 安徽两票制 update agencyProType - agencyProType1 --> |
| | | <apex:inputText id="OEC" value="{!contractName}" onclick="searchContract('{!agencyProType1}')" style="width:200px" onfocus="if (j$(escapeVfId('allPage:allForm:allBlock:searchBlock:tempidPp')).value() != 'tempId' && j$(escapeVfId('allPage:allForm:allBlock:searchBlock:tempidPp')).value() != '' && j$(escapeVfId('allPage:allForm:allBlock:searchBlock:OECid')).value() != '' && '{!methodType}' == 'promotionorder'){searchPProductJs('0');return false;}"/> |
| | | <apex:inputHidden id="OECid" value="{!contractId}" /> |
| | | <apex:inputHidden id="tempidPp" value="{!tempidPp}" /> |
| | | </td> |
| | |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;"></div> |
| | | <div style="height:25px;">{!$Label.Quote_Department}</div> |
| | | <!-- <div style="height:25px;">{!$Label.Quote_Department}</div> --> <!-- 20230323 lt DB202303088261 两票制 --> |
| | | <div style="height:25px;"></div> |
| | | <div style="height:25px;"></div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;">: </div> |
| | | <!-- <div style="height:25px;">: </div> --> <!-- 20230323 lt DB202303088261 两票制 --> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;"> </div> |
| | | </td> |
| | |
| | | <div class="footerAddress"> |
| | | |
| | | <div> |
| | | □{!params.addressName} <br /> |
| | | <!-- 20230323 lt DB202303088261 两票制 update addressName === addressName1 --> |
| | | □{!params.addressName1} <br /> |
| | | {!params.address}(邮编:{!params.postCode}) |
| | | </div> |
| | | |
| | | <!-- <div style="height: 10px;"></div> |
| | | <div> |
| | | □奥林巴斯(北京)销售服务有限公司上海分公司 <br /> |