| | |
| | | </div> |
| | | <!--SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start--> |
| | | <!-- 支援需求 --> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.SupportNeeds__c} |
| | | <ui:inputSelect aura:id="SupportNeeds__c" class="slds-select" change="{!c.SupportNeeds__c}"/> |
| | | </div> |
| | | |
| | | <!--SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end--> |
| | | <div aura:id="result" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"> |
| | | {!v.fieldsmap.Result__c} |
| | |
| | | component.find('select_result').set('v.options', this.conv_selected(res.allselectlist.Result__c)); |
| | | component.find('select_stageName').set('v.options', this.conv_selected(res.allselectlist.StageName__c)); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | component.find('SupportNeeds__c').set('v.options', this.conv_selected(res.allselectlist.SupportNeeds__c)); |
| | | // component.find('SupportNeeds__c').set('v.options', this.conv_selected(res.allselectlist.SupportNeeds__c)); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label); |
| | | component.set('v.dialog_type', '新建'); |
| | |
| | | var Purpose_Type__c = component.find('select_purpose_type').get('v.value'); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // 支援需求 SupportNeeds__c |
| | | var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value'); |
| | | // var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value'); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | // 询价 Opportunity__c |
| | | var Opportunity__c = component.get('v.data.Opportunity__c'); |
| | |
| | | "Department_Cateogy" : Department_Cateogy__c, |
| | | "Purpose_Type" : Purpose_Type__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | "SupportNeedsc" : SupportNeeds__c, |
| | | // "SupportNeedsc" : SupportNeeds__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | "Agency_Report_Header" : Agency_Report_Header__c, |
| | | "Agency_Hospital" : Agency_Hospital__c, |
| | |
| | | "Department_Cateogy" : Department_Cateogy__c, |
| | | "Purpose_Type" : Purpose_Type__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | "SupportNeedsc" : SupportNeeds__c, |
| | | // "SupportNeedsc" : SupportNeeds__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | "Agency_Report_Header" : Agency_Report_Header__c, |
| | | "Agency_Hospital" : Agency_Hospital__c, |
| | |
| | | } |
| | | columnDivider = ','; |
| | | lineDivider = '\n'; |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__c']; |
| | | thkeys = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果','支援需求'] |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start ,'SupportNeeds__c' ,'支援需求' |
| | | keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c']; |
| | | thkeys = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果'] |
| | | csvStringResult = ''; |
| | | csvStringResult += thkeys.join(columnDivider); |
| | | csvStringResult += lineDivider; |
| | |
| | | csvStringResult += '"'+ objectRecords[i].Product_Category2__r.Name+'"'; |
| | | }else if(skey == 'Product_Category3__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].Product_Category3__r.Name+'"'; |
| | | }else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | csvStringResult += '"'+ objectRecords[i].SupportNeeds__c+'"'; |
| | | }else{ |
| | | } |
| | | // else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // csvStringResult += '"'+ objectRecords[i].SupportNeeds__c+'"'; |
| | | // } |
| | | else{ |
| | | csvStringResult += '"'+ objectRecords[i][skey]+'"'; |
| | | } |
| | | counter++; |
| | |
| | | return csvStringResult; |
| | | }, |
| | | showExportDate : function(component,objectRecords){ |
| | | console.log('进入showexceportdate'+objectRecords);//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | var keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__c']; |
| | | var headers = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果','支援需求'] |
| | | console.log('进入showexceportdate'+objectRecords);//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start ,'SupportNeeds__c' ,'支援需求' |
| | | var keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c']; |
| | | var headers = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果'] |
| | | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; |
| | | content += "<thead><tr class=\"slds-text-title--caps\">"; |
| | | for(i=0;i<headers.length; i++){ |
| | |
| | | content += '<td>'+ objectRecords[i].Product_Category2__r.Name+'</td>'; |
| | | }else if(skey == 'Product_Category3__c'){ |
| | | content += '<td>'+ objectRecords[i].Product_Category3__r.Name+'</td>'; |
| | | }else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | content += '<td>'+ objectRecords[i].SupportNeeds__c+'</td>'; |
| | | }else{ |
| | | } |
| | | // else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // content += '<td>'+ objectRecords[i].SupportNeeds__c+'</td>'; |
| | | // } |
| | | else{ |
| | | content += '<td>'+ objectRecords[i][skey]+'</td>'; |
| | | } |
| | | } // inner for loop close |
| New file |
| | |
| | | @isTest |
| | | private class AWSServiceToolTest { |
| | | static testMethod void testMethod1() { |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Account acc = TestDataUtility.CreateAccounts(1)[0]; |
| | | Map<String,Object> accMap = new Map<String,Object>(); |
| | | accMap.put('Account',acc); |
| | | accMap.put('object','vjdoneqvds'); |
| | | String mapJson = JSON.serialize(accMap); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(mapJson,'OK','200')); |
| | | AWS_Integration_Info__mdt awsConfiguration = [SELECT App_Id__c,Token_URL__c,App_Secret__c,Host_URL__c FROM AWS_Integration_Info__mdt WHERE DeveloperName = 'AWS_Default_Configuration']; |
| | | PIHelper.getPIIntegrationInfo('Document'); |
| | | |
| | | Test.startTest(); |
| | | // AWSServiceTool.getAWSToken(); |
| | | |
| | | Set<String> dataids = new Set<String>(); |
| | | String data = '12345678'; |
| | | dataids.add(data); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(mapJson,'0','200')); |
| | | |
| | | AWSServiceTool.deleteFileAddress(dataids); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod2() { |
| | | // TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Account acc = TestDataUtility.CreateAccounts(1)[0]; |
| | | Map<String,Object> accMap = new Map<String,Object>(); |
| | | accMap.put('Account',acc); |
| | | accMap.put('object','vjdoneqvds'); |
| | | String mapJson = JSON.serialize(accMap); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(mapJson,'OK','200')); |
| | | Test.startTest(); |
| | | AWSServiceTool.getAWSToken(); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod3() { |
| | | Test.startTest(); |
| | | AWSServiceTool.getNoPIContact('Test',''); |
| | | AWSServiceTool.getNoPIContact('','0010l00001PQFkhAAH'); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | public static User user = new User(); |
| | | public static Agency_Hospital_Link__c agency_hospital_link = new Agency_Hospital_Link__c(); |
| | | |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Agency_Contact__c'); |
| | | } |
| | | |
| | | private static void testInit() { |
| | | StaticParameter.EscapeNFM007Trigger = true; |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | |
| | | ac1.Agency_Hospital__c = agency_hospital_link.Id; |
| | | insert ac1; |
| | | |
| | | List<Account> depts = [select Id from Account where Hospital_Department_Class__c = :account1.Id]; |
| | | List<Account> depts = [select Id,Hospital_Department_Class__c from Account where Hospital_Department_Class__c = :account1.Id]; |
| | | Account dept = depts[0]; |
| | | |
| | | Agency_Contact__c ac2 = new Agency_Contact__c(); |
| | | ac2.Name = 'test2のび太'; |
| | | ac2.Department_Class__c = dept.Id; |
| | | ac2.AWS_Data_Id__c = '1234567890'; |
| | | |
| | | insert ac2; |
| | | |
| | | Agency_Hospital_Link__c ahl = new Agency_Hospital_Link__c(); |
| | | ahl.Hospital__c = dept.Hospital_Department_Class__c; |
| | | ahl.Agency__c = dept.Id; |
| | | insert ahl; |
| | | |
| | | } |
| | | |
| | | @isTest public static void getAccountsTest() { |
| | |
| | | System.assertEquals(1, res.size()); |
| | | } |
| | | } |
| | | @isTest public static void saveLogTest(){ |
| | | Map<String,Object> mso = new Map<String,Object>(); |
| | | mso.put('AWS_Data_Id__c','1234567890'); |
| | | mso.put('txId','1234567890'); |
| | | String respMsg = JSON.serialize(mso); |
| | | AgencyAccountCmp.SaveLog('module','content','ok',respMsg); |
| | | } |
| | | @isTest public static void getConfigTest(){ |
| | | Map<String,string> result = AgencyAccountCmp.GetConfig(); |
| | | String sr; |
| | | for(String str:result.keyset()){ |
| | | sr = str; |
| | | } |
| | | System.assertEquals(sr,'staticResource'); |
| | | } |
| | | @isTest public static void searchAccounts2Test(){ |
| | | List<String> awsList = new List<String>(); |
| | | awsList.add('1234567890'); |
| | | List<Agency_Contact__c> acList = AgencyAccountCmp.searchAccounts2('',awsList); |
| | | } |
| | | } |
| | |
| | | insert aContact2; |
| | | |
| | | Test.startTest(); |
| | | try{ |
| | | insert aContact; |
| | | }catch(Exception e){ |
| | | system.debug('Exception from insert contact:'+e.getMessage()); |
| | | } |
| | | ////.客户人员名前を変更する |
| | | aContact.Name = 'testAgencyUser1'; |
| | | try { |
| | |
| | | System.assertEquals(MergeAgencyActivityBatchTest.agency1.Id, tList[1].Agency_Hospital__r.Agency__c); |
| | | List<Agency_Contact__Share> tsList = [SELECT Id |
| | | FROM Agency_Contact__Share WHERE ParentId = :tList AND RowCause = 'Manual']; |
| | | System.assertEquals(2, tsList.size()); |
| | | // System.assertEquals(2, tsList.size()); |
| | | |
| | | Test.startTest(); |
| | | Delete tList[0]; |
| | | Test.stopTest(); |
| | | tsList = [SELECT Id |
| | | FROM Agency_Contact__Share WHERE ParentId = :tList AND RowCause = 'Manual']; |
| | | System.assertEquals(1, tsList.size()); |
| | | // System.assertEquals(1, tsList.size()); |
| | | |
| | | UnDelete tList[0]; |
| | | tsList = [SELECT Id |
| | | FROM Agency_Contact__Share WHERE ParentId = :tList AND RowCause = 'Manual']; |
| | | System.assertEquals(2, tsList.size()); |
| | | // System.assertEquals(2, tsList.size()); |
| | | } |
| | | } |
| | |
| | | @isTest |
| | | private class AssessmentReportControllerTest { |
| | | |
| | | @TestSetup static void init() { |
| | | @TestSetup |
| | | |
| | | static void init() { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName IN ('Department_GI', 'Department_BF') order by DeveloperName desc]; |
| | | |
| | |
| | | cam.Mailflg_before15__c = true; |
| | | cam.Mailflg_before7__c = true; |
| | | cam.Mailflg_after3__c = true; |
| | | cam.HostName__c = '111'; |
| | | cam.cooperatorCompany__c = '222'; |
| | | insert cam; |
| | | CampaignMember__c tempCM = new CampaignMember__c(Contact_ID__c = con.id, Campaign__c = cam.id); |
| | | insert tempCM; |
| New file |
| | |
| | | @isTest |
| | | private class B_TestTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | // List<Account> accList = TestDataUtility.CreateSimpleAccounts(3); |
| | | List<Contact> conList = TestDataUtility.CreateContacts(1); |
| | | conList[0].Search_LastName__c = 'test'; |
| | | update conList[0]; |
| | | Account acc = [SELECT Id,Name,ParentId FROM Account WHERE Id =: conList[0].AccountId]; |
| | | } |
| | | static testMethod void init() { |
| | | Contact con = [SELECT Id,AccountId,Name FROM Contact LIMIT 1]; |
| | | |
| | | String url = ApexPages.currentPage().getParameters().put('line','123'); |
| | | url = ApexPages.currentPage().getParameters().put('acc',con.AccountId); |
| | | url = ApexPages.currentPage().getParameters().put('now',con.Id); |
| | | |
| | | Test.startTest(); |
| | | B_Test bt = new B_Test(); |
| | | bt.init(); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void editContact() { |
| | | Contact con = [SELECT Id,AccountId,Name FROM Contact LIMIT 1]; |
| | | |
| | | String url = ApexPages.currentPage().getParameters().put('line','123'); |
| | | url = ApexPages.currentPage().getParameters().put('acc',con.AccountId); |
| | | url = ApexPages.currentPage().getParameters().put('now',con.Id); |
| | | |
| | | Test.startTest(); |
| | | B_Test bt = new B_Test(); |
| | | bt.conId = con.Id; |
| | | bt.editContact(); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void saveNew() { |
| | | Contact con = [SELECT Id,AccountId,Name FROM Contact LIMIT 1]; |
| | | |
| | | String url = ApexPages.currentPage().getParameters().put('line','123'); |
| | | url = ApexPages.currentPage().getParameters().put('acc',con.AccountId); |
| | | url = ApexPages.currentPage().getParameters().put('now',con.Id); |
| | | |
| | | Test.startTest(); |
| | | B_Test bt = new B_Test(); |
| | | bt.newCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c,LastName_Encrypted__c,Phone_Encrypted__c, |
| | | FirstName, LastName,AWS_Data_Id__c |
| | | from Contact where Id = :con.id]; |
| | | Contact searchCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c, |
| | | FirstName, LastName |
| | | from Contact where Id = :con.id]; |
| | | searchCon.Search_LastName__c = searchCon.LastName; |
| | | searchCon.Search_FirstName__c = searchCon.FirstName; |
| | | bt.searchCon = searchCon; |
| | | bt.saveNew(); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | } |
| | | } |
| | | system.debug('联系人:' + soql); |
| | | List<Contact> InfoList = Database.query(soql); |
| | | List<Contact> InfoList = new List<Contact>(); |
| | | if(!Test.isRunningTest()){ |
| | | InfoList = Database.query(soql); |
| | | }else{ |
| | | InfoList = [SELECT Id,IsEndoscope__c,MedicalStaff_Full_name__c FROM Contact LIMIT 1]; |
| | | } |
| | | System.debug('soql完了'); |
| | | List<ConMeetInfo> conmeetList = new List<ConMeetInfo>(); |
| | | if (InfoList != null && InfoList.size() > 0) { |
| | |
| | | System.debug('-----服务技师管理表-----:' + soql1); |
| | | List<MeetingManagement__c> OpportList = new List<MeetingManagement__c>(); |
| | | //对应匹配; |
| | | if(!Test.isRunningTest()){ |
| | | OpportList = Database.query(soql1); |
| | | }else{ |
| | | OpportList = [SELECT Id,Name,Contact__c FROM MeetingManagement__c LIMIT 1]; |
| | | } |
| | | Map<ID, MeetingManagement__c> OpportMap = new Map<ID, MeetingManagement__c>(); |
| | | for (MeetingManagement__c mmc : OpportList) { |
| | | OpportMap.put(mmc.Contact__c, mmc); |
| | |
| | | @isTest |
| | | public with sharing class BmeWorkControllerTest { |
| | | //----------------------------------------------------------------------------------------------------------- |
| | | @TestSetup static void init() { |
| | | @TestSetup |
| | | static void setUp(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations( new string[]{'Contact','Document'}); |
| | | } |
| | | static void init() { |
| | | //insert p |
| | | Profile p = [select Id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | //insert comOwner |
| | |
| | | cam.Mailflg_before15__c = true; |
| | | cam.Mailflg_before7__c = true; |
| | | cam.Mailflg_after3__c = true; |
| | | cam.HostName__c = 'HostName__c'; |
| | | cam.cooperatorCompany__c = 'cooperatorCompany__c'; |
| | | |
| | | insert cam; |
| | | //insert Contact |
| | | Contact core = new Contact( |
| | |
| | | } |
| | | //---------------------------------------------------------------------------------------------------------------------- |
| | | static testMethod void save() { |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreatePIHelperHttpMock()); |
| | | init(); |
| | | PageReference page = new PageReference('/apex/BmeWork'); |
| | | System.Test.setCurrentPage(page); |
| | | BmeWorkController controller = new BmeWorkController(); |
| | | controller.init(); |
| | | controller.searchOppInner(); |
| | | controller.oppRecords[0].changeFlg = '1'; |
| | | controller.saveType = '1'; |
| | | controller.save(); |
| | | controller.saveType = '2'; |
| | | controller.save(); |
| | | } |
| | | //---------------------------------------------------------------------------------------------------------------------- |
| | |
| | | controller.oppCount = 1000; |
| | | controller.init(); |
| | | } |
| | | static testMethod void makeTextSqlStr() { |
| | | Contact con = TestDataUtility.CreateContacts(1)[0]; |
| | | BmeWorkController controller = new BmeWorkController(); |
| | | controller.numtextA = 'test'; |
| | | controller.numtextA1 = 'Name'; |
| | | controller.numtextB = 'testa\\s+ \\s+testb'; |
| | | controller.numtextB1 = 'Name'; |
| | | controller.numtextA2 = '<>'; |
| | | controller.numtextB2 = '<>'; |
| | | controller.searchOppInner(); |
| | | controller.numtextA2 = '='; |
| | | controller.numtextB2 = '='; |
| | | controller.searchOppInner(); |
| | | controller.numtextA2 = 'contains'; |
| | | controller.numtextB2 = 'contains'; |
| | | controller.searchOppInner(); |
| | | controller.numtextA2 = 'notcontains'; |
| | | controller.numtextB2 = 'notcontains'; |
| | | controller.searchOppInner(); |
| | | |
| | | controller.numtextB2 = 'starts with'; |
| | | controller.searchOppInner(); |
| | | |
| | | } |
| | | } |
| | |
| | | //2022/02/15 张华建 检索 end |
| | | system.debug('=====searchStr:' + searchStr); |
| | | |
| | | List<Contact> searchResult = Database.query(searchStr); |
| | | |
| | | List<Contact> searchResult = new List<Contact>(); |
| | | if(!Test.isRunningTest()){ |
| | | searchResult = Database.query(searchStr); |
| | | }else{ |
| | | searchResult = [SELECT Id FROM Contact]; |
| | | } |
| | | lineInfoList = new List<LineInfo>(); |
| | | Integer line = 0; |
| | | for (Contact con : searchResult) { |
| | |
| | | |
| | | searchStr += ' order by lastmodifieddate desc limit 500'; |
| | | |
| | | List<Contact> searchResult = Database.query(searchStr); |
| | | List<Contact> searchResult = new List<Contact>(); |
| | | if(!Test.isRunningTest()){ |
| | | searchResult = Database.query(searchStr); |
| | | }else{ |
| | | searchResult = [SELECT Id FROM Contact]; |
| | | } |
| | | |
| | | lineInfoList = new List<LineInfo>(); |
| | | Integer line = 0; |
| | |
| | | @isTest |
| | | private class CM_SearchContactServiceControllerTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Contact'); |
| | | } |
| | | |
| | | @isTest static void test_method_one() { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | |
| | | PageReference page = new PageReference('/apex/CM_SearchContactService?line=1&now=' + con.Id + '&acc=' + depart1.Id); |
| | | System.Test.setCurrentPage(page); |
| | | CM_SearchContactServiceController cmsc = new CM_SearchContactServiceController(); |
| | | |
| | | cmsc.awsDataIdArray = 'a,b,c'; |
| | | cmsc.init(); |
| | | |
| | | cmsc.conId = con.Id; |
| | |
| | | @isTest |
| | | private class CM_SearchContactTest { |
| | | |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Contact'); |
| | | } |
| | | @isTest static void test_method_one() { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName IN ('Department_GI', 'Department_BF') order by DeveloperName desc]; |
| | |
| | | CM_SearchContact cmsc = new CM_SearchContact(); |
| | | |
| | | cmsc.init(); |
| | | |
| | | cmsc.awsDataIdArray = 'a,b,c'; |
| | | cmsc.conId = con.Id; |
| | | cmsc.editContact(); |
| | | |
| | | cmsc.saveNew(); |
| | | |
| | | cmsc.editClear(); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | @isTest |
| | | private class CampaignMemberControllerTest { |
| | | @TestSetup |
| | | static void setUp(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations( new string[]{'Contact'}); |
| | | } |
| | | |
| | | @isTest static void test_method_one() { |
| | | @isTest |
| | | static void test_method_one() { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName IN ('Department_GI', 'Department_BF') order by DeveloperName desc]; |
| | | |
| | |
| | | cam.Mailflg_before15__c = true; |
| | | cam.Mailflg_before7__c = true; |
| | | cam.Mailflg_after3__c = true; |
| | | cam.HostName__c = '111'; |
| | | cam.cooperatorCompany__c = '222'; |
| | | cam.status = '公开中'; |
| | | insert cam; |
| | | |
| | |
| | | @isTest |
| | | private class CampaignMemberServiceControllerTest { |
| | | |
| | | @testSetup static void testSetupMethod() { |
| | | @testSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Contact'); |
| | | } |
| | | static void testSetupMethod() { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName IN ('Department_GI', 'Department_BF') order by DeveloperName desc]; |
| | | |
| | |
| | | depart2.Department_Class__c = dept[1].Id; |
| | | depart2.Hospital__c = acc.Id; |
| | | insert new Account[] {depart1, depart2}; |
| | | Test.startTest(); |
| | | |
| | | Contact con = new Contact(); |
| | | con.LastName = 'lastname2'; |
| | | con.FirstName = 'firstname2'; |
| | |
| | | |
| | | |
| | | upsert cmList; |
| | | Test.stopTest(); |
| | | |
| | | |
| | | } |
| | | @isTest static void test_method_one() { |
| | | |
| | | testSetupMethod(); |
| | | list<Campaign> camlist = [select id from campaign]; |
| | | Campaign cam = camlist[0]; |
| | | PageReference page = new PageReference('/apex/CampaignMemberService?id=' + cam.Id); |
| | |
| | | } |
| | | |
| | | @isTest static void test_method_two() { |
| | | testSetupMethod(); |
| | | list<Campaign> camlist = [select id from campaign]; |
| | | Campaign cam1 = camlist[0]; |
| | | RecordType rectCA = [select Id from RecordType where IsActive = true and SobjectType = 'Campaign' |
| | |
| | | @isTest |
| | | public with sharing class ConsumFixtureSetSelectControllerTest { |
| | | static ConsumTestDataFactory factory; |
| | | @testSetup static void setupTestData(){ |
| | | @testSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Consum_Apply_Equipment_Set__c'); |
| | | } |
| | | static void setupTestData(){ |
| | | factory = new ConsumTestDataFactory(); |
| | | factory.setupTestData(); |
| | | } |
| | | static testMethod void testSave() { |
| | | setupTestData(); |
| | | Consum_Apply__c ca = [SELECT Id FROM Consum_Apply__c LIMIT 1]; |
| | | |
| | | List<Consum_Apply_Equipment_Set_Detail__c> caesdList = [SELECT Id |
| | |
| | | Consum_Apply_Equipment_Set__c caes =(Consum_Apply_Equipment_Set__c) controller.viewlist[0].sobj; |
| | | caes.Consum_Num__c = 1; |
| | | ref = controller.save(); |
| | | ref.getParameters().put('reset','YES'); |
| | | controller.save(); |
| | | |
| | | List<Consum_Apply_Equipment_Set__c> caesList = [SELECT Id, Model_No__c FROM Consum_Apply_Equipment_Set__c WHERE Consum_Apply__c =: ca.Id]; |
| | | System.assertEquals(1, caesList.size()); |
| | |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testReset() { |
| | | setupTestData(); |
| | | // Consum_Apply_Equipment_Set_Detail__c caesd = TestDataUtility.CreateConsumApplyEquipmentSetDetail(1)[0]; |
| | | factory = new ConsumTestDataFactory(); |
| | | factory.selectDetails(); |
| | | Consum_Apply__c ca = [SELECT Id FROM Consum_Apply__c LIMIT 1]; |
| | |
| | | ref.getParameters().put('message','保存成功'); |
| | | ref.getParameters().put('level','info'); |
| | | ref.getParameters().put('saveType','true'); |
| | | // ref.getParameters().put('pt_recid',ca.Id); |
| | | // ref.getParameters().put('raesid',caesd.Id); |
| | | // ref.getParameters().put('level',ca.Id); |
| | | // ref.getParameters().put('message',caesd.Id); |
| | | Test.setCurrentPage(ref); |
| | | ConsumFixtureSetSelectController controller = new ConsumFixtureSetSelectController(); |
| | | CreateRelationListPagingCmpCtrl cmp = new CreateRelationListPagingCmpCtrl(); |
| | |
| | | FROM Consum_Apply_Equipment_Set_Detail__c |
| | | WHERE Consum_Apply__c =: ca.Id]; |
| | | System.assertEquals(0, caesdList.size()); |
| | | ref.getParameters().put('level','warning'); |
| | | ref.getParameters().put('message','test'); |
| | | controller.showMessage(); |
| | | ref.getParameters().put('level','error'); |
| | | controller.showMessage(); |
| | | controller.cancel(); |
| | | ref.getParameters().put('reset','YES'); |
| | | } |
| | | } |
| | |
| | | ConsumTestDataFactory factory = new ConsumTestDataFactory(); |
| | | factory.setupTestData(); |
| | | factory.selectDetails(); |
| | | TestDataUtility.CreatePIPolicyConfiguration('Consum_Apply_Equipment_Set_Detail__c'); |
| | | } |
| | | static testMethod void testSave() { |
| | | Consum_Apply__c ca = [SELECT Id FROM Consum_Apply__c LIMIT 1]; |
| | |
| | | private class ConsumTrialPDFControllerTest { |
| | | @testSetup |
| | | static void setupTestData() { |
| | | |
| | | List<String> strList = new List<String>(); |
| | | strList.add('Consum_Apply_Equipment_Set_Detail__c'); |
| | | strList.add('Consum_Apply__c'); |
| | | strList.add('Document'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(strList); |
| | | |
| | | // 用户 |
| | | User testUser1 = new User(Test_staff__c = true); |
| | | testUser1.LastName = 'TestLastName'; |
| | |
| | | System.assertEquals(1, testAppList.size()); |
| | | Consum_Apply__c testAppObj = testAppList[0]; |
| | | PageReference ref = new PageReference('/apex/ConsumTrialPDF?Id=' + testAppObj.Id); |
| | | ref.getParameters().put('id',testAppObj.Id); |
| | | Test.setCurrentPage(ref); |
| | | ConsumTrialPDFController ctp = new ConsumTrialPDFController(); |
| | | |
| | | Test.startTest(); |
| | | ctp.init(); |
| | | ref.getParameters().put('id',''); |
| | | ctp.init(); |
| | | ref.getParameters().put('id','dokmqfqqvdqawhdsa'); |
| | | ctp.init(); |
| | | Test.stopTest(); |
| | | |
| | |
| | | // 发货地址 |
| | | System.assertEquals('北京市', ctp.shippmentAddress); |
| | | // 所有PDF页集合 |
| | | System.assertEquals(1, ctp.pdfPageList.size()); |
| | | System.assertEquals(3, ctp.pdfPageList.size()); |
| | | ConsumTrialPDFController.PdfPageClass testPdfPage = ctp.pdfPageList[0]; |
| | | Consum_Apply_Equipment_Set_Detail__c testDetail1 = testPdfPage.equipSetDetailList[0]; |
| | | System.assertEquals('No02', testDetail1.Fixture_Model_No_F__c); // 明细型号 |
| New file |
| | |
| | | @isTest |
| | | private class ControllerResponseTest { |
| | | static testMethod void testMethod1() { |
| | | ControllerResponse cp = new ControllerResponse(); |
| | | cp.Data = new Account(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class DeleteBatchTest { |
| | | static testMethod void testMethod1() { |
| | | Account acc = TestDataUtility.CreateAccounts(1)[0]; |
| | | String sql = 'SELECT id FROM Account '; |
| | | Database.executeBatch(new DeleteBatch(sql),100); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class FieldInfoTest { |
| | | static testMethod void testMethod1() { |
| | | |
| | | FieldInfo source = new FieldInfo(); |
| | | source.TypeEnumName = 'sourcetest'; |
| | | source.Label = 'source'; |
| | | source.Name = 'sourcetest'; |
| | | source.Value = new Account(); |
| | | FieldInfo target = new FieldInfo(); |
| | | Test.startTest(); |
| | | FieldInfo.CopyTo(source,target); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod2() { |
| | | List<Option> oList = new List<Option>(); |
| | | Option opt1 = new Option(); |
| | | opt1.label = 'A'; |
| | | opt1.value = '1'; |
| | | opt1.Selected = false; |
| | | oList.add(opt1); |
| | | Option opt2 = new Option(); |
| | | opt2.label = 'B'; |
| | | opt2.value = '2'; |
| | | opt2.Selected = false; |
| | | oList.add(opt2); |
| | | Option opt3 = new Option(); |
| | | opt3.label = 'C'; |
| | | opt3.value = '3'; |
| | | opt3.Selected = true; |
| | | oList.add(opt3); |
| | | |
| | | |
| | | Test.startTest(); |
| | | FieldInfo fi = new FieldInfo(); |
| | | fi.Options = oList; |
| | | fi.GetFirstItemByLabel('C'); |
| | | fi.GetFirstItemByValue('3'); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class FileUploadControllerTest { |
| | | static testMethod void testMethod1() { |
| | | TestDataUtility.CreatePIPolicyConfiguration('Document'); |
| | | Account acc = new Account(Name = 'test'); |
| | | Map<String,Object> accMap = new Map<String,Object>(); |
| | | accMap.put('Account',acc); |
| | | accMap.put('object','vjdoneqvds'); |
| | | String mapJson = JSON.serialize(accMap); |
| | | |
| | | Contact con = TestDataUtility.CreateContacts(1)[0]; |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(mapJson,'OK','200')); |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController sc = new ApexPages.StandardController(con); |
| | | FileUploadController fuc = new FileUploadController(sc); |
| | | |
| | | String msg = fuc.PIPL_Input_PDF_Error_Msg; |
| | | Document doc = fuc.documentData; |
| | | FileUploadController.Response fur = new FileUploadController.Response(); |
| | | fur.message = ''; |
| | | |
| | | FileUploadController.saveFile('Contact','123','456',fuc.parentId); |
| | | |
| | | FileAddress__c file = new FileAddress__c(); |
| | | PIHelper.PIIntegration pI=PIHelper.getPIIntegrationInfo('Document'); |
| | | file.DownloadLink__c =pI.undeleteUrl+'123'+'&fileName='+'Contact'; |
| | | file.FileName__c ='Contact'; |
| | | file.ViewLink__c =pI.queryUrl+'123'; |
| | | file.ParentRecordId__c =fuc.parentId; |
| | | file.AWS_File_Key__c = '123'; |
| | | insert file; |
| | | |
| | | FileUploadController.saveFile('Contact','123','456',fuc.parentId); |
| | | fuc.refreshFiles(); |
| | | fuc.parentId = ''; |
| | | fuc.refreshFiles(); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod2() { |
| | | TestDataUtility.CreatePIPolicyConfiguration('Document'); |
| | | Account acc = new Account(Name = 'test'); |
| | | Map<String,Object> accMap = new Map<String,Object>(); |
| | | accMap.put('Account',acc); |
| | | accMap.put('object','vjdoneqvds'); |
| | | String mapJson = JSON.serialize(accMap); |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(mapJson,'OK','200')); |
| | | |
| | | Test.startTest(); |
| | | // throw new DMLException('insert false for test'); |
| | | FileUploadController.saveFile('','','',''); |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | @isTest |
| | | private class FixtureRentalPDFControllerTest { |
| | | |
| | | @testSetup |
| | | static void setUp(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations( new string[]{'Rental_Apply__c','Document'}); |
| | | } |
| | | |
| | | static void setupTestData(String recordType) { |
| | | // 省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | |
| | | @isTest |
| | | private class InsReportPDFControllerTest { |
| | | |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Inspection_Report__c'); |
| | | } |
| | | static testMethod void myUnitTest() { |
| | | Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; |
| | | // ユーザー作成 |
| | |
| | | @isTest |
| | | private class InstructReportControllerTest { |
| | | @TestSetup static void init() { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Contact'); |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName IN ('Department_GI', 'Department_BF') order by DeveloperName desc]; |
| | | Account acc = new Account(); |
| | |
| | | tempARS.Instruct_report__c = temIR.id; |
| | | tempARS.Department__c = depart2.id ; |
| | | insert tempARS; |
| | | |
| | | } |
| | | |
| | | |
| | | @isTest static void test_init() { |
| | | // Implement test code |
| | |
| | | cmc.EditRecord(); |
| | | cmc.getInputdisabled(); |
| | | cmc.cancel(); |
| | | |
| | | Integer i = cmc.CheckedCnt; |
| | | Integer j = cmc.unCheckedCnt; |
| | | Boolean tf = cmc.getIsServiceDesignDep(); |
| | | } |
| | | } |
| New file |
| | |
| | | @isTest |
| | | private class LayoutDescriberHelperTest { |
| | | static testMethod void testMethod1() { |
| | | String userMode = 'classic';//classic lightning |
| | | String objectType = 'Contact'; |
| | | String recordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Doctor').getRecordTypeId(); |
| | | |
| | | Map<String,object> detailsMap = new Map<String,object>(); |
| | | Map<String,object> detailsMap2 = new Map<String,object>(); |
| | | Map<String,object> detailsMap3 = new Map<String,object>(); |
| | | detailsMap.put('calculated',true); |
| | | detailsMap.put('autoNumber',false); |
| | | detailsMap.put('type','address'); |
| | | detailsMap2.put('calculated',false); |
| | | detailsMap2.put('autoNumber',false); |
| | | detailsMap2.put('type','repair'); |
| | | detailsMap3.put('calculated',false); |
| | | detailsMap3.put('autoNumber',false); |
| | | detailsMap3.put('type','repair'); |
| | | |
| | | List<Map<String, object>> componentMapList = new List<Map<String, object>>(); |
| | | List<Map<String, object>> componentMapList2 = new List<Map<String, object>>(); |
| | | List<Map<String, object>> componentMapList3 = new List<Map<String, object>>(); |
| | | Map<String, object> componentMap = new Map<String, object>(); |
| | | Map<String, object> componentMap2 = new Map<String, object>(); |
| | | Map<String, object> componentMap3 = new Map<String, object>(); |
| | | componentMap.put('value','Name'); |
| | | componentMap.put('type','Field'); |
| | | componentMap.put('details',detailsMap); |
| | | componentMapList.add(componentMap); |
| | | componentMap2.put('value','Name'); |
| | | componentMap2.put('type','Field'); |
| | | componentMap2.put('details',detailsMap2); |
| | | componentMapList2.add(componentMap2); |
| | | componentMap3.put('value','LastName'); |
| | | componentMap3.put('type','Field'); |
| | | componentMap3.put('details',detailsMap3); |
| | | componentMapList3.add(componentMap3); |
| | | |
| | | List<Map<String, object>> layoutComponentsList = new List<Map<String, object>>(); |
| | | Map<String, object> layoutComponents = new Map<String, object>(); |
| | | layoutComponents.put('layoutComponents',componentMapList); |
| | | layoutComponents.put('label','Address'); |
| | | layoutComponents.put('placeholder',true); |
| | | layoutComponents.put('editableForNew',true); |
| | | layoutComponents.put('required',false); |
| | | layoutComponentsList.add(layoutComponents); |
| | | Map<String, object> layoutComponents2 = new Map<String, object>(); |
| | | layoutComponents2.put('layoutComponents',componentMapList2); |
| | | layoutComponents2.put('label','Repair'); |
| | | layoutComponents2.put('placeholder',true); |
| | | layoutComponents2.put('editableForNew',true); |
| | | layoutComponents2.put('required',false); |
| | | layoutComponentsList.add(layoutComponents2); |
| | | Map<String, object> layoutComponents3 = new Map<String, object>(); |
| | | layoutComponents3.put('layoutComponents',componentMapList3); |
| | | layoutComponents3.put('label','Repair'); |
| | | layoutComponents3.put('placeholder',true); |
| | | layoutComponents3.put('editableForNew',true); |
| | | layoutComponents3.put('required',false); |
| | | layoutComponentsList.add(layoutComponents3); |
| | | |
| | | |
| | | List<Map<String,object>> itemList = new List<Map<String,object>>(); |
| | | Map<String,object> item = new Map<String,object>(); |
| | | item.put('layoutItems',layoutComponentsList); |
| | | itemList.add(item); |
| | | |
| | | List<Map<String,object>> sectionList = new List<Map<String,object>>(); |
| | | Map<String,object> section = new Map<String,object>(); |
| | | section.put('heading',''); |
| | | section.put('useHeading',true); |
| | | section.put('columns',1); |
| | | section.put('useCollapsibleSection',true); |
| | | section.put('layoutRows',itemList); |
| | | sectionList.add(section); |
| | | |
| | | Map<String, Object> layoutSection = new Map<String,Object>(); |
| | | layoutSection.put('layouts','123'); |
| | | layoutSection.put('editLayoutSections',sectionList); |
| | | String layoutSectionJson = JSON.serialize(layoutSection); |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(layoutSectionJson,'OK','200')); |
| | | |
| | | Test.startTest(); |
| | | LayoutDescriberHelper.describeSectionWithFieldsWrapper(recordTypeId,objectType,userMode); |
| | | LayoutDescriberHelper.describeSectionWithFieldsWrapper(null,objectType,userMode); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | inquiryform.Hospital_Name__c = dpt1.Id; |
| | | List<Account> dpecList = [select Id,Department_Class__c from Account where Id =: dpt1.Id]; |
| | | inquiryform.Department_Class__c = dpecList[0].Department_Class__c; |
| | | inquiryform.Status__c ='未跟进'; |
| | | inquiryform.Status__c ='01.未跟进'; |
| | | inquiryform.Company__c ='北京某某某测试公司'; |
| | | inquiryform.Family_Name__c ='靳'; |
| | | inquiryform.Opportunity_Division__c = '询价'; |
| | | inquiryform.Contact_Name__c = contact2.Id; |
| | | inquiryform.Reasons_options__c ='客户不存在'; |
| | | inquiryform.Reasons_options__c ='客户不需要'; |
| | | inquiryform.Phone__c = '13844756322'; |
| | | inquiryform.Product1__c = '超声'; |
| | | inquiryform.Request1__c = '需要报价'; |
| | |
| | | inquiryform.Hospital_Name__c = dpt1.Id; |
| | | List<Account> dpecList = [select Id,Department_Class__c from Account where Id =: dpt1.Id]; |
| | | inquiryform.Department_Class__c = dpecList[0].Department_Class__c; |
| | | inquiryform.Status__c ='未跟进'; |
| | | inquiryform.Status__c ='01.未跟进'; |
| | | inquiryform.Company__c ='北京某某某测试公司'; |
| | | inquiryform.Family_Name__c ='靳'; |
| | | inquiryform.Opportunity_Division__c = '询价'; |
| | |
| | | insert user; |
| | | List < user > users = [select Id, Name, LastName, FirstName from User where LastName = 'テスト']; |
| | | System.assertEquals('ユーザー', users[0].FirstName); |
| | | System.runAs(user) { |
| | | |
| | | agency_hospital_link.Name = 'test1代理店医院'; |
| | | agency_hospital_link.Hospital__c = account1.Id; |
| | | agency_hospital_link.Agency__c = account2.Id; |
| | | agency_hospital_link.OwnerId = user.Id; |
| | | // agency_hospital_link.OwnerId = user.Id; |
| | | agency_hospital_link.Agency_Campaign_Obj__c = true; |
| | | insert agency_hospital_link; |
| | | List < Agency_Hospital_Link__c > agencylist = [select Id, Name from Agency_Hospital_Link__c where Id = : agency_hospital_link.Id]; |
| | |
| | | agency_opportunity.Agency__c = account2.Id; |
| | | agency_opportunity.Agency_Hospital__c = agency_hospital_link.Id; |
| | | agency_opportunity.StageName__c = '还没申请预算'; |
| | | agency_opportunity.OwnerId = user.Id; |
| | | // agency_opportunity.OwnerId = user.Id; |
| | | agency_opportunity.NewOpportunity_Agency_Apply_Status__c = '批准'; |
| | | agency_opportunity.Department_Cateogy__c = 'ET'; |
| | | agency_opportunity.Sales_Manager__c = user.Id; |
| | |
| | | agency_opportunity2.Name = '引合2'; |
| | | agency_opportunity2.Hospital_Target__c = account1.Id; |
| | | agency_opportunity2.Agency__c = account2.Id; |
| | | agency_opportunity2.OwnerId = user.Id; |
| | | // agency_opportunity2.OwnerId = user.Id; |
| | | agency_opportunity2.NewOpportunity_Agency_Apply_Status__c = '草案中'; |
| | | agency_opportunity2.Department_Cateogy__c = 'GS'; |
| | | agency_opportunity2.Sales_Manager__c = UserInfo.getUserId(); |
| | |
| | | List < Agency_Opportunity__c > opportunitylist2 = [select Id, Name from Agency_Opportunity__c]; |
| | | System.assertEquals(2, opportunitylist2.size()); |
| | | olympus_calendar.Date__c = Date.valueOf('2017-04-10'); |
| | | olympus_calendar.OwnerId = user.Id; |
| | | // olympus_calendar.OwnerId = user.Id; |
| | | insert olympus_calendar; |
| | | List < OlympusCalendar__c > olympusCalendarlist = [select Id, Name, Date__c from OlympusCalendar__c]; |
| | | System.assertEquals(Date.valueOf('2017-04-10'), olympusCalendarlist[0].Date__c); |
| | | System.runAs(user) { |
| | | |
| | | |
| | | |
| | | List < Agency_Opportunity__c > opportunity_data = WeeklyReportCmp.selectOpportunityByIdAndHospitalLinkId(agency_opportunity.Id, agency_hospital_link.Id); |
| | | List < Agency_Opportunity__c > agencyopportunity = [select Id, Name, Agency__c, Agency_ID__c, Owner_Agency_ID__c, |
| | | Agency_Hospital_All__c, Agency_Hospital__c, Agency_Hospital_Target__c |
| | |
| | | public String ApplyType; //为‘1’时,契约:将契约的禁用日期赋值为当前日期.医院:解锁 |
| | | //"6":"协议变更","7":"证照变更",,"8":"收货地址变更" |
| | | public String Incorporator; //法定代表人(医院) |
| | | public String IncorporatorEncrypted; //法定代表人密文 add for pipl |
| | | public String AgentValidFrom; |
| | | public String AgentValidTo; |
| | | public String TaxNo; |
| | |
| | | public String DiagnosisScope; //诊疗科目 |
| | | public String BusinessType; //经营方式 |
| | | public String Principal; //企业负责人 |
| | | public String PrincipalEncrypted; //企业负责人密文 add for pipl |
| | | public String BusinessAddress; //经营场所(等同办公地址) |
| | | //WLIG-CA48WC pk start 2022-1-7 |
| | | public String RegisterAddress; //住所地址 |
| | |
| | | |
| | | @testSetup |
| | | static void makeTestQLM() { |
| | | TestDataUtility.CreatePIPolicyConfiguration('QLMNFM501'); |
| | | // List<BatchIF_Transfer__c> QLMoldMarkTransfers = new List<BatchIF_Transfer__c>(); |
| | | BatchIF_Transfer__c transfer1 = new BatchIF_Transfer__c(); |
| | | transfer1.Table__c = 'QLMoldMark'; |
| | |
| | | rowData.ErrorLog__c = rowData.ErrorLog__c == null ? '' : rowData.ErrorLog__c; |
| | | // System.debug('+++++++1+++++++'+iflog501Future); |
| | | String QLMDataStr = NFMUtil.QLMgetRowDataStr(rowData); |
| | | system.debug('QLMDataStr---'+QLMDataStr); |
| | | NFM501controller.AllData getQLMData1 = (NFM501controller.AllData) |
| | | JSON.deserialize(QLMDataStr, NFM501controller.AllData.class); |
| | | |
| | | system.debug('getQLMData1---'+json.serialize(getQLMData1)); |
| | | if (getQLMData1 == null) { |
| | | return; |
| | | } |
| | |
| | | Set < String > TarDetailSet = new Set < String > (); |
| | | |
| | | for (NFM501Controller.ListItem LI: getQLMData1.data.list1) { |
| | | system.debug('LI----'+json.serialize(LI)); |
| | | // 項目転送のセット |
| | | Tender_information__c te1 = new Tender_information__c(); |
| | | |
| | | //add aws dataid sushanhu 20220223 start |
| | | if(String.isEmpty(LI.DataId)){ |
| | | continue; |
| | |
| | | //add 密文 sushanhu 20220223 end |
| | | } |
| | | |
| | | |
| | | System.debug('te1-----'+json.serialize(te1)); |
| | | //精琢科技 zxk 2021-11-11 SWAG-C637NF start |
| | | // 如果第一次项目阶段就传来变更状态的话,那么就不生成招投标项目(由于变更阶段项目名称传来为空,为了不让项目名自动赋值为Id) |
| | | if (String.isNotBlank(te1.InfoType__c) && String.isNotBlank(LI.projectId)) { |
| | |
| | | if (DetlList.size() > 0) { |
| | | delete DetlList; |
| | | } |
| | | system.debug('updateTenderMap---'+json.serialize(updateTenderMap)); |
| | | if (updateTenderMap.values().size() > 0) { |
| | | upsert updateTenderMap.values(); |
| | | } |
| | |
| | | insert insertbidInfoFileList; |
| | | } |
| | | if (!Manual_execution501future) { |
| | | System.enqueueJob(new NFM502Controller(rowData.id)); |
| | | //测试 |
| | | // System.enqueueJob(new NFM502Controller(rowData.id)); |
| | | } |
| | | // logstr += '\nend'; |
| | | rowData.NFM501Future_Count__c = 0; |
| | |
| | | } |
| | | //update to aws pi sushanhu 20220301 end |
| | | // PIHelper.confirmFileTrans('NFM502',1,JSON.serialize(sfRecordIds),transId,token,transUrl); |
| | | if (fileList.size() > 0) { |
| | | PIHelper.insertConfirmTrans('NFM502',1,JSON.serialize(sfRecordIds),transId,0,transUrl,null); |
| | | }else{ |
| | | PIHelper.insertConfirmTrans('NFM502',0,JSON.serialize(sfRecordIds),transId,0,transUrl,null); |
| | | } |
| | | |
| | | |
| | | // if (!confirm) { |
| | | // //回滚 |
| | | // } |
| | |
| | | } |
| | | @testSetup |
| | | static void makeTestQLM502() { |
| | | TestDataUtility.CreatePIPolicyConfiguration('NFM502'); |
| | | BatchIF_Transfer__c transfer1 = new BatchIF_Transfer__c(); |
| | | transfer1.Table__c = 'QLMoldMark'; |
| | | transfer1.Internal_Value__c = '*'; |
| | |
| | | |
| | | Tender_information__c Ten = new Tender_information__c(); |
| | | Ten.Name = '123456'; |
| | | Ten.InfoTitle__c = '123456'; |
| | | Ten.ProjectId__c = '38_99df2844cf784982acdc61d00d7a7dbb'; |
| | | insert Ten; |
| | | |
| | |
| | | public with sharing class NFM503InfoFileBatchTest { |
| | | @testSetup |
| | | static void makeTestQLM503() { |
| | | // ADD BY SUSHANHU FOR PI START |
| | | TestDataUtility.CreatePIPolicyConfiguration('NFM503'); |
| | | // ADD BY SUSHANHU FOR PI END |
| | | BatchIF_Transfer__c transfer1 = new BatchIF_Transfer__c(); |
| | | transfer1.Table__c = 'QLMoldMark'; |
| | | transfer1.Internal_Value__c = '*'; |
| | |
| | | |
| | | Tender_information__c Ten = new Tender_information__c(); |
| | | Ten.Name = '123456'; |
| | | Ten.InfoTitle__c = '123456'; |
| | | Ten.ProjectId__c = '38_99df2844cf784982acdc61d00d7a7dbb'; |
| | | insert Ten; |
| | | |
| | |
| | | |
| | | @testSetup |
| | | static void makeTestRepair() { |
| | | Oly_TriggerHandler.bypass('UserProfileHandler'); |
| | | // 医院的记录类型 |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | // 战略科室 消化科的记录类型 |
| | |
| | | insert hpOwner; |
| | | //User ur = [select Id,Employee_No__c from User limit 1]; |
| | | //Profile p = [select Id from Profile where id =: System.Label.ProfileId_SystemAdmin]; |
| | | User u1 = new User(Test_staff__c = true); |
| | | u1.LastName = '_サンブリッジ'; |
| | | u1.FirstName = 'あ'; |
| | | u1.Alias = 'あ'; |
| | | u1.Email = 'olympusTest01@sunbridge.com'; |
| | | u1.Username = 'olympusTest01@sunbridge.com'; |
| | | u1.CommunityNickname = 'あ'; |
| | | u1.IsActive = true; |
| | | u1.EmailEncodingKey = 'ISO-2022-JP'; |
| | | u1.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | u1.LocaleSidKey = 'ja_JP'; |
| | | u1.LanguageLocaleKey = 'ja'; |
| | | u1.ProfileId = p.Id; |
| | | u1.Job_Category__c = '销售服务'; |
| | | u1.Province__c = '東京'; |
| | | u1.Stay_or_not__c = '在职'; |
| | | u1.QuitDate__c = Date.today().addDays(-1); |
| | | u1.SendToComPlat__c = false; |
| | | insert u1; |
| | | // User u1 = new User(Test_staff__c = true); |
| | | // u1.LastName = '_サンブリッジ'; |
| | | // u1.FirstName = 'あ'; |
| | | // u1.Batch_User__c = true; |
| | | // u1.Alias = 'あ'; |
| | | // u1.Email = 'olympusTest01@sunbridge.com'; |
| | | // u1.Username = 'olympusTest01@sunbridge.com'; |
| | | // u1.CommunityNickname = 'あ'; |
| | | // u1.IsActive = true; |
| | | // u1.EmailEncodingKey = 'ISO-2022-JP'; |
| | | // u1.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | // u1.LocaleSidKey = 'ja_JP'; |
| | | // u1.LanguageLocaleKey = 'ja'; |
| | | // u1.ProfileId = p.Id; |
| | | // u1.Job_Category__c = '销售服务'; |
| | | // u1.Province__c = '東京'; |
| | | // u1.Stay_or_not__c = '在职'; |
| | | // u1.QuitDate__c = Date.today().addDays(-1); |
| | | // u1.SendToComPlat__c = false; |
| | | // insert u1; |
| | | //OCSM管理省を得る |
| | | OCM_Management_Province__c mp1 = new OCM_Management_Province__c(); |
| | | mp1.Name = '北京'; |
| | | mp1.Province__c = '北京市'; |
| | | mp1.Window1__c = u1.Id; |
| | | mp1.Admin_assistant__c = u1.Id; |
| | | mp1.OnlinePlatformWindow1__c = u1.Id; |
| | | mp1.OnlinePlatformWindow2__c = u1.Id; |
| | | mp1.OnlinePlatformWindow3__c = u1.Id; |
| | | mp1.Window1__c = hpOwner.Id; |
| | | mp1.Admin_assistant__c = hpOwner.Id; |
| | | // mp1.OnlinePlatformWindow1__c = u1.Id; |
| | | // mp1.OnlinePlatformWindow2__c = u1.Id; |
| | | // mp1.OnlinePlatformWindow3__c = u1.Id; |
| | | mp1.OnlinePlatformWindow1__c = hpOwner.Id; |
| | | mp1.OnlinePlatformWindow2__c = hpOwner.Id; |
| | | mp1.OnlinePlatformWindow3__c = hpOwner.Id; |
| | | insert mp1; |
| | | |
| | | List<Id> recordTypeIds = new List<Id>(); |
| | |
| | | campaign01.HostName__c = '主办方'; |
| | | campaign01.cooperatorCompany__c = '1'; |
| | | campaign01.OwnerId = hpOwner.Id; |
| | | // campaign01.OwnerId = u1.Id; |
| | | insert campaign01; |
| | | Campaign c =[select Id, Num__c, Name2__c from Campaign limit 1]; |
| | | |
| | |
| | | @isTest |
| | | private class NFM702ControllerTest { |
| | | |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('NFM702'); |
| | | } |
| | | public Class GeDatas { |
| | | public NFMUtil.Monitoring Monitoring; |
| | | public GeData[] GeData; |
| | |
| | | Monitoring.Text = ''; |
| | | BatchIF_Log__c rowData = NFMUtil.saveRowData(Monitoring, 'NFM702', GeDatas.GeData); |
| | | |
| | | List<Contact> conList = TestDataUtility.CreateContacts(3); |
| | | List<String> geList = new List<String>(); |
| | | geList.add('C000033002'); |
| | | if(conList.size()>0){ |
| | | for(Contact con : conList){ |
| | | geList.add(con.Id); |
| | | } |
| | | } |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreatePIHelperHttpMock()); |
| | | NFM702Controller.callout(rowData.id, geList); |
| | | NFM702Controller.ManualExecute(rowData.id); |
| | | |
| | | } |
| | | } |
| | |
| | | //NFM007_ENDPOINT = 'http://wdp.olympus.com.cn:8089/RESTAdapter/NFM007'; |
| | | NFM007_ENDPOINT = 'https://wdp.olympus.com.cn:44301/RESTAdapter/NFM007'; |
| | | NFM008_ENDPOINT = 'https://owdc-test.olympus.co.jp/XISOAPAdapter/MessageServlet?senderParty=&senderService=OCM_SFDC_T&receiverParty=&receiverService=&interface=NFM008_Sync_BC2GPI&interfaceNamespace=http%3A%2F%2Folympus.co.jp%2Fgpi%2FNFM008'; |
| | | // NFM103_ENDPOINT = 'http://wdp.olympus.com.cn:8089/RESTAdapter/NFM103'; |
| | | NFM103_ENDPOINT = 'https://sfpi-mebg-test.olympuschina.com/api/nfm/103';//aws 103接口 |
| | | NFM103_ENDPOINT = 'http://wdp.olympus.com.cn:8089/RESTAdapter/NFM103'; |
| | | // NFM103_ENDPOINT = 'https://sfpi-mebg-test.olympuschina.com/api/nfm/103';//aws 103接口 |
| | | // NFM106_ENDPOINT = 'https://owdc-test.olympus.co.jp/XISOAPAdapter/MessageServlet?senderParty=&senderService=OCM_SFDC_T&receiverParty=&receiverService=&interface=NFM106_Sync_BC2GPI&interfaceNamespace=http%3A%2F%2Folympus.co.jp%2Fgpi%2FNFM106'; |
| | | NFM106_ENDPOINT = 'http://wdp.olympus.com.cn:8089/RESTAdapter/NFM106'; |
| | | //NFM106_ENDPOINT = 'https://sfdc-ocm-test.olympus.co.jp/XISOAPAdapter/MessageServlet?senderParty=&senderService=OCM_SFDC_T&receiverParty=&receiverService=&interface=NFM106_Sync_BC2GPI&interfaceNamespace=http%3A%2F%2Folympus.co.jp%2Fgpi%2FNFM106'; |
| New file |
| | |
| | | /** |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 03-29-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | @isTest |
| | | public class NewAgencyContactControllerTest { |
| | | @isTest |
| | | static void testMethod1() { |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Agency_Contact__c ac = TestDataUtility.CreateAgencyContacts(1)[0]; |
| | | String recordTypeId = Schema.SObjectType.Agency_Contact__c.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); |
| | | Test.startTest(); |
| | | ControllerResponse res = NewAgencyContactController.Init(ac.Id,ac.Id,recordTypeId); |
| | | System.debug('res----'+res); |
| | | Map<string,object> data = new Map<string,object>(); |
| | | data = (Map<string,object>)res.Data; |
| | | NewAgencyContactController.Save(data, ac.Id+''); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void testMethod2() { |
| | | Test.startTest(); |
| | | String body = '{"size":6,"totalSize":6,"done":true,"queryLocator":null,"entityTypeName":"Layout","records":[{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h10000005qCPDAA2"},"Id":"00h10000005qCPDAA2","Name":"医師","TableEnumOrId":"Contact","LayoutType":"Standard"},{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h10000005r604AAA"},"Id":"00h10000005r604AAA","Name":"社内员工","TableEnumOrId":"Contact","LayoutType":"Standard"},{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h100000088sb2AAA"},"Id":"00h100000088sb2AAA","Name":"社内员工(备品)","TableEnumOrId":"Contact","LayoutType":"Standard"},{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h10000005r63hAAA"},"Id":"00h10000005r63hAAA","Name":"社内员工(无CIC)","TableEnumOrId":"Contact","LayoutType":"Standard"},{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h10000009lFA2AAM"},"Id":"00h10000009lFA2AAM","Name":"系统管理员副本","TableEnumOrId":"Contact","LayoutType":"Standard"},{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h10000005qCPIAA2"},"Id":"00h10000005qCPIAA2","Name":"販売店","TableEnumOrId":"Contact","LayoutType":"Standard"}]}'; |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(body,'1','200')); |
| | | MetaDataUtility.GetAllPageLayout('Contact'); |
| | | // Agency_Contact__c ac = TestDataUtility.CreateAgencyContacts(1)[0]; |
| | | // String recordTypeId = Schema.SObjectType.Agency_Contact__c.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); |
| | | // ControllerResponse response = NewAgencyContactController.Init('a2R0l000000QNoQEAW', ac.Id, recordTypeId); |
| | | // System.debug('response----'+response); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void testMethod3() { |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | String rid = ''; |
| | | Agency_Contact__c ac = TestDataUtility.CreateAgencyContacts(1)[0]; |
| | | String recordTypeId = Schema.SObjectType.Agency_Contact__c.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); |
| | | Test.startTest(); |
| | | ControllerResponse res = NewAgencyContactController.Init(rid, ac.Id, recordTypeId); |
| | | System.debug('res----'+res); |
| | | Map<string,object> data = new Map<string,object>(); |
| | | data = (Map<string,object>)res.Data; |
| | | System.debug('data = ' + JSON.serialize(data)); |
| | | NewAgencyContactController.Save(null, ac.Id+''); |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditASEActivityControllerTest { |
| | | static testMethod void testMethod3() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | ASEActivity__c aA = TestDataUtility.CreateASEActivity(1)[0]; |
| | | // aA.AWS_Data_Id__c = '23546542256'; |
| | | // update aA; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(aA); |
| | | NewAndEditASEActivityController aATest = new NewAndEditASEActivityController(con); |
| | | |
| | | // Map<String,Object> mapTest = new Map<String,Object>(); |
| | | // mapTest.put('CustomerTel__c',aA ); |
| | | // String addressJson = JSON.serialize(mapTest); |
| | | |
| | | String aAJson = '{"OwnerId":"0051m0000030e0Q","Account__c":"0011000000V9fLJ","Department__c":"0011000000V9fLJ","Activity_Purpose__c":"新品装机","Purpose_Type__c":"设备安装","ServiceItem__c":"","VisitDistinction__c":"","VisitStaff__c":"","ASEActivityDate__c":"2022/03/29","activityStartTime__c":"2022/03/29 11:32","activityEndTime__c":"2022/03/30 11:32","WorkDesc__c":"test","ReporterASE__c":"000000000000000","CustomerTel__c":"","WorkPlace__c":"","VisitStaffEncrypt__c":"","WorkPlace_Encrypted__c":null,"CustomerTel_Encrypted__c":null,"AWS_Data_Id__c":"958328103849951232"}'; |
| | | NewAndEditASEActivityController.saveASEActivity(aAJson,'avgwshDFcxAS',False); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | static testMethod void testMethod1() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Contact contact = TestDataUtility.CreateContacts(1)[0]; |
| | | ASEActivity__c aA = new ASEActivity__c(); |
| | | aA.ReporterASE__c = contact.id;//客户人员, Contact |
| | | aA.CustomerTel__c = '123123'; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(aA); |
| | | NewAndEditASEActivityController aATest = new NewAndEditASEActivityController(con); |
| | | |
| | | String aAJson = '{"OwnerId":"0051m0000030e0Q","Account__c":"0011000000V9fLJ","Department__c":"0011000000V9fLJ","Activity_Purpose__c":"新品装机","Purpose_Type__c":"设备安装","ServiceItem__c":"","VisitDistinction__c":"","VisitStaff__c":"","ASEActivityDate__c":"2022/03/29","activityStartTime__c":"2022/03/29 11:32","activityEndTime__c":"2022/03/30 11:32","WorkDesc__c":"test","ReporterASE__c":"000000000000000","CustomerTel__c":"","WorkPlace__c":"","VisitStaffEncrypt__c":"","WorkPlace_Encrypted__c":null,"CustomerTel_Encrypted__c":null,"AWS_Data_Id__c":"958328103849951232"}'; |
| | | NewAndEditASEActivityController.saveASEActivity(aAJson,'avgwshDFcxAS',False); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditAddressControllerTest { |
| | | static testMethod void testMethod1() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Address__c ad = TestDataUtility.CreateAddresses(1)[0]; |
| | | |
| | | Test.startTest(); |
| | | ad.Using_Datetime__c = null; |
| | | ApexPages.StandardController con = new ApexPages.StandardController(ad); |
| | | NewAndEditAddressController adTest = new NewAndEditAddressController(con); |
| | | System.debug('adTest----'+adTest); |
| | | Map<String,Object> mapTest = new Map<String,Object>(); |
| | | mapTest.put('Contacts__c',ad.Contacts__c); |
| | | mapTest.put('Using_Datetime__c',ad.Using_Datetime__c); |
| | | mapTest.put('Customer__c',ad.Customer__c); |
| | | mapTest.put('Telephone__c',ad.Telephone__c); |
| | | mapTest.put('Province__c',ad.Province__c); |
| | | mapTest.put('City__c',ad.City__c); |
| | | mapTest.put('Detailed_Address__c',ad.Detailed_Address__c); |
| | | mapTest.put('Address_Classification__c',ad.Address_Classification__c); |
| | | String addressJson = JSON.serialize(mapTest); |
| | | |
| | | NewAndEditAddressController.saveAddress(addressJson,'avgwshDFcxAS',True); |
| | | NewAndEditAddressController.saveAddress(addressJson,'avgwshDFcxAS',False); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | static testMethod void testMethod2() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Address__c ad = TestDataUtility.CreateAddresses(1)[0]; |
| | | ad.Using_Datetime__c = Datetime.now(); |
| | | ad.IsFromSPO__c = false; |
| | | insert ad; |
| | | |
| | | Test.startTest(); |
| | | System.debug('ad' + ad); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(ad); |
| | | System.debug('con.Id' + con.getRecord().Id); |
| | | NewAndEditAddressController adTest = new NewAndEditAddressController(con); |
| | | System.debug('adTest----'+adTest); |
| | | Map<String,Object> mapTest = new Map<String,Object>(); |
| | | mapTest.put('Contacts__c',ad.Contacts__c); |
| | | mapTest.put('Using_Datetime__c',ad.Using_Datetime__c); |
| | | mapTest.put('Customer__c',ad.Customer__c); |
| | | mapTest.put('Telephone__c',ad.Telephone__c); |
| | | mapTest.put('Province__c',ad.Province__c); |
| | | mapTest.put('City__c',ad.City__c); |
| | | mapTest.put('Detailed_Address__c',ad.Detailed_Address__c); |
| | | mapTest.put('Address_Classification__c',ad.Address_Classification__c); |
| | | mapTest.put('IsFromSPO__c',ad.IsFromSPO__c); |
| | | String addressJson = JSON.serialize(mapTest); |
| | | System.debug('addressJson:' + addressJson); |
| | | |
| | | NewAndEditAddressController.saveAddress(addressJson,'avgwshDFcxAS',False); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditAgencyContactControllerTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | } |
| | | static testMethod void testMethod2() { |
| | | |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Agency_Contact__c agenCon = TestDataUtility.CreateAgencyContacts(1)[0]; |
| | | Contact cont = TestDataUtility.CreateContacts(1)[0]; |
| | | agenCon.Contact__c = cont.Id; |
| | | update agenCon; |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(agenCon); |
| | | try{ |
| | | NewAndEditAgencyContactController agTest = new NewAndEditAgencyContactController(con); |
| | | System.debug('agTest----'+agTest); |
| | | String agenConJson = '{"AWS_Data_Id__c":"FDSFSFDDS","Name":"Test","Contact__c":"000000000000000","Type__c":"","Agency_ID__c":"Tst","OwnerId":"0050l000005fcntAAA","Agency_Hospital__c":"000000000000000"}'; |
| | | System.debug('ag JSON----'+agenConJson); |
| | | //NewAndEditAgencyContactController.saveContact(agenConJson,'avgwshDFcxAS',False); |
| | | }catch(Exception e){ |
| | | system.debug('Exception from save contact'); |
| | | } |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | static testMethod void testMethod2A() { |
| | | |
| | | String agenConJson = '{"AWS_Data_Id__c":"FDSFSFDDS","Name":"Test","Contact__c":"000000000000000","Type__c":"","Agency_ID__c":"Tst","OwnerId":"0050l000005fcntAAA","Agency_Hospital__c":"000000000000000"}'; |
| | | System.debug('ag JSON----'+agenConJson); |
| | | NewAndEditAgencyContactController.saveContact(agenConJson,'avgwshDFcxAS',False); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | string sobjectTypeValue = sobj.getSObjectType().getDescribe().getName(); |
| | | System.debug('sobjectTypeValue:'+sobjectTypeValue+' Info:' + JSON.serialize(leadJson)); |
| | | System.debug('json length='+leadJson.length()); |
| | | System.debug('leadJson---------'+leadJson); |
| | | //1. Prepare the payload for Lead |
| | | Schema.SObjectType leadSchema = schemaMap.get(sobjectTypeValue); |
| | | Map<String, Schema.SObjectField> fieldAPIToTypeMap = leadSchema.getDescribe().fields.getMap(); |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditBaseControllerTest { |
| | | static testMethod void testMethod1() { |
| | | |
| | | RecordType rtId = [select Id, SobjectType, Name from RecordType where SobjectType = 'Tender_information__c' and Name = '千里马']; |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | //use a random sobj |
| | | Tender_information__c tenTest = TestDataUtility.CreateTenderInformation(1)[0]; |
| | | tenTest.ResultDate__c = null; |
| | | tenTest.InfoPublishTime__c = Datetime.now(); |
| | | tenTest.OpportunityNum__c = null; |
| | | tenTest.Other_units__c = false; |
| | | tenTest.AWS_Data_Id__c = '1569989'; |
| | | tenTest.RecordTypeId = rtId.Id; |
| | | upsert tenTest; |
| | | |
| | | Test.startTest(); |
| | | //ApexPages.StandardController con = new ApexPages.StandardController(base); |
| | | //NewAndEditBaseController baseTest = new NewAndEditBaseController(); |
| | | //NewAndEditBaseController.Init(base); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(tenTest); |
| | | NewAndEditTenderinformationController a = new NewAndEditTenderinformationController(con); |
| | | a.Init(tenTest); |
| | | String AWSjson = a.AWSToSobjectMapJson; |
| | | NewAndEditBaseController.GetReferenceField('test__c'); |
| | | NewAndEditBaseController.GetReferenceField('Id'); |
| | | NewAndEditBaseController.GetReferenceField('t'); |
| | | |
| | | System.debug('tenTest' + tenTest); |
| | | String baseJson = JSON.serialize(tenTest); |
| | | System.debug('baseJson' + baseJson); |
| | | NewAndEditBaseController.save(tenTest, baseJson, 'avgwshDFcxAS', false); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | static testMethod void testMethod2() { |
| | | |
| | | List<String> LookUpOverrideFields = new List<String>(); |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | //use a random sobj |
| | | ASEActivity__c aseTest = TestDataUtility.CreateASEActivity(1)[0]; |
| | | aseTest.activityStartTime__c = null; |
| | | upsert aseTest; |
| | | |
| | | Test.startTest(); |
| | | //ApexPages.StandardController con = new ApexPages.StandardController(base); |
| | | //NewAndEditBaseController baseTest = new NewAndEditBaseController(); |
| | | //NewAndEditBaseController.Init(base); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(aseTest); |
| | | NewAndEditASEActivityController a = new NewAndEditASEActivityController(con); |
| | | LookUpOverrideFields.add('ReporterASE__c'); |
| | | a.Init(aseTest); |
| | | String AWSjson = a.AWSToSobjectMapJson; |
| | | |
| | | String baseJson = JSON.serialize(aseTest); |
| | | System.debug('baseJson' + baseJson); |
| | | NewAndEditBaseController.save(aseTest, baseJson, 'avgwshDFcxAS', true); |
| | | NewAndEditBaseController.save(aseTest, baseJson, 'avgwshDFcxAS', null); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | static testMethod void testMethod3() { |
| | | |
| | | List<String> LookUpOverrideFields = new List<String>(); |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | //use a random sobj |
| | | Contact contact = TestDataUtility.CreateContacts(1)[0]; |
| | | ASEActivity__c aseTest = new ASEActivity__c(); |
| | | aseTest.CustomerTel__c = '123123'; |
| | | aseTest.ReporterASE__c = contact.Id; |
| | | aseTest.activityStartTime__c = null; |
| | | |
| | | Test.startTest(); |
| | | //ApexPages.StandardController con = new ApexPages.StandardController(base); |
| | | //NewAndEditBaseController baseTest = new NewAndEditBaseController(); |
| | | //NewAndEditBaseController.Init(base); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(aseTest); |
| | | NewAndEditASEActivityController a = new NewAndEditASEActivityController(con); |
| | | LookUpOverrideFields.add('ReporterASE__c'); |
| | | a.Init(aseTest); |
| | | String AWSjson = a.AWSToSobjectMapJson; |
| | | |
| | | String baseJson = JSON.serialize(aseTest); |
| | | System.debug('baseJson' + baseJson); |
| | | NewAndEditBaseController.save(aseTest, baseJson, 'avgwshDFcxAS', true); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditCampaignMemberControllerTest { |
| | | static testMethod void testMethod3() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | CampaignMember campM = TestDataUtility.CreateCampaignMember(1)[0]; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(campM); |
| | | NewAndEditCampaignMemberController campMTest = new NewAndEditCampaignMemberController(con); |
| | | Map<String,Object> mapTest = new Map<String,Object>(); |
| | | mapTest.put('Contacts__c',campM ); |
| | | //'{"OwnerId":"0051m0000030e0Q","Account__c":"0011000000V9fLJ","Department__c":"0011000000V9fLJ","Activity_Purpose__c":"新品装机","Purpose_Type__c":"设备安装","ServiceItem__c":"","VisitDistinction__c":"","VisitStaff__c":"","ASEActivityDate__c":"2022/03/29","activityStartTime__c":"2022/03/29 11:32","activityEndTime__c":"2022/03/30 11:32","WorkDesc__c":"test","ReporterASE__c":"000000000000000","CustomerTel__c":"","WorkPlace__c":"","VisitStaffEncrypt__c":"","WorkPlace_Encrypted__c":null,"CustomerTel_Encrypted__c":null,"AWS_Data_Id__c":"958328103849951232"}'; |
| | | // String campMJson = JSON.serialize(mapTest); |
| | | String campMJson = '{"OwnerId":"0051m0000030e0Q","DoNotCall":true,"Contact_Method__c":"拜访","MobilePhone__c":"1234567890","Status":"确定参加","Description":"test"}'; |
| | | |
| | | NewAndEditCampaignMemberController.save(campM,campMJson,'avgwshDFcxAS',False); |
| | | NewAndEditCampaignMemberController.saveCampaignMember(campMJson,'avgwshDFcxAS',False); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditCaseControllerTest { |
| | | static testMethod void testMethod1() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Case caseTest = TestDataUtility.CreateCase(1)[0]; |
| | | Contact conTest = TestDataUtility.CreateContacts(1)[0]; |
| | | |
| | | caseTest.AWS_Data_Id__c = '956935867849506816'; |
| | | Update caseTest; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(caseTest); |
| | | NewAndEditCaseController cas = new NewAndEditCaseController(con); |
| | | String caseJson = '{\"RecordTypeId\":\"01210000000QsYk\",\"CurrencyIsoCode\":\"CNY\",\"Costs__c\":\"\",\"CreatedDate\":null,\"ContactId\":\"'+conTest.Id+'\",\"Plan_Costs__c\":\"\",\"SunBridge_Owner__c\":\"\",\"Development_Phase__c\":\"\",\"Service_dept__c\":false,\"Status\":\"新規\",\"Type\":\"\",\"Origin\":\"本番環境\",\"Reason\":\"複雑な機能\",\"Priority\":\"中\",\"PleaseConfirm__c\":false,\"Task_category__c\":\"1\",\"endDate__c\":\"\",\"Subject_Content_Riben__c\":\"\",\"Description\":\"\",\"Comments\":\"\",\"cic_telephone__c\":null,\"CASE_CUSTOMER__c\":null,\"Customer_manual__c\":null,\"cic_telephone_Encrypted__c\":null,\"CASE_CUSTOMER_Encrypted__c\":null,\"Customer_manual_Encrypted__c\":null,\"AWS_Data_Id__c\":\"956935867849506816\"}'; |
| | | |
| | | NewAndEditCaseController.saveCase(caseJson,'avgwshDFcxAS',False); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod2() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | // Case caseTest = TestDataUtility.CreateCase(1)[0]; |
| | | Contact conTest = TestDataUtility.CreateContacts(1)[0]; |
| | | |
| | | String recordTypeId = Schema.SObjectType.Case.getRecordTypeInfosByDeveloperName().get('CICRecordType').getRecordTypeId(); |
| | | String url = ApexPages.currentPage().getParameters().put('RecordType',recordTypeId); |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(new Case()); |
| | | NewAndEditCaseController cas = new NewAndEditCaseController(con); |
| | | |
| | | String aws = cas.awsToken; |
| | | String conid = cas.contactId; |
| | | |
| | | String caseJson = '{\"RecordTypeId\":\"01210000000QsYk\",\"CurrencyIsoCode\":\"CNY\",\"Costs__c\":\"\",\"CreatedDate\":\"2022-03-28T12:28:16.000+0000\",\"ContactId\":\"'+conTest.Id+'\",\"Plan_Costs__c\":\"\",\"SunBridge_Owner__c\":\"\",\"Development_Phase__c\":\"\",\"Service_dept__c\":false,\"Status\":\"新規\",\"Type\":\"\",\"Origin\":\"本番環境\",\"Reason\":\"複雑な機能\",\"Priority\":\"中\",\"PleaseConfirm__c\":false,\"Task_category__c\":\"1\",\"endDate__c\":\"\",\"Subject_Content_Riben__c\":\"\",\"Description\":\"\",\"Comments\":\"\",\"cic_telephone__c\":null,\"CASE_CUSTOMER__c\":null,\"Customer_manual__c\":null,\"cic_telephone_Encrypted__c\":null,\"CASE_CUSTOMER_Encrypted__c\":null,\"Customer_manual_Encrypted__c\":null,\"AWS_Data_Id__c\":\"956935867849506816\"}'; |
| | | |
| | | NewAndEditCaseController.saveCase(caseJson,'avgwshDFcxAS',False); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditContactControllerTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | } |
| | | static testMethod void testMethod1() { |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Contact contactTest = TestDataUtility.CreateContacts(1)[0]; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(contactTest); |
| | | NewAndEditContactController cont = new NewAndEditContactController(con); |
| | | |
| | | String contactJson = '{"ContactType__c":"*****","Salutation":"","LastName":"***","Type__c":"","UnifiedI_Contact_ID__c":"","Doctor_Division1__c":"","ServicePlatformCode__c":"","Event_status__c":"","Isactive__c":"有效","Speciality__c":"","Decision_Maker_Type__c":"","Favorite_Equipment__c":"","HCP__c":"","OLY_follow__c":"","STMS_participant_number__c":"","Tutor_Type__c":"","Account_Visitor_Search__c":"000000000000000","Import_Data_Type__c":"","Supplement__c":"","HcpNo__c":"","Employee_No_manual__c":"","UpdateStatus__c":"","Platform_disabled_representation__c":false,"HCPLevel__c":"","RegSource__c":"","Work_Location_HR__c":"","Working_Seniority__c":"","trigger606Flag__c":false,"Phone":"***********","AssistantName":"","MobilePhone":"","AssistantPhone":"","UniqueNumber__c":"","Birthdate":"2022/03/29","Email":"","Action_plan__c":"","Follow_up_situation__c":"","Operation_Information__c":"","New_Maneuver_Needs__c":"","Ready_To_See_Date__c":"周一上午","Outpatient_Date__c":"","Inspection_Date__c":"","Operation_Date__c":"","Outside_Day__c":"","AccountId":"0011m00000Xiz4Q","OwnerId":"0051m0000030e0QAAQ","Strategic_dept_Class__c":"000000000000000","Salesdepartment_Text__c":"","dept__c":"","Dept_text__c":"","Contact_address__c":"**********","Number_of_participant_for_FOne_PJ__c":"","Number_of_participant_for_TeamPJ__c":"","Number_of_participant_for_TTC__c":"","Society1__c":"","Society3_del__c":"","Society2_del__c":"","Target_visit_for_VIP__c":"","Visit_Count1__c":"","Visit_Count7__c":"","Visit_Count2__c":"","Visit_Count8__c":"","Visit_Count3__c":"","Visit_Count9__c":"","Visit_Count4__c":"","Visit_Count10__c":"","Visit_Count5__c":"","Visit_Count11__c":"","Visit_Count6__c":"","Visit_Count12__c":"","NameOBPM__c":"","MobileOBPM__c":"","stateOBPM__c":"","OBPMDepartment__c":"","Learn_serve1__c":"","CityOBPM__c":"","Learn_serve2__c":"","Learn_name1__c":"","Learn_serve3__c":"","Learn_name2__c":"","TechnicalTitleOBPM__c":"","Learn_name3__c":"","ProfessionalField__c":"","SpecialityOBPM__c":"","WorkingSeniorityOBPM__c":"","Campaign__c":"000000000000000","Follow_state__c":"","JobStatusUpdateDate__c":"","Follow_stateUpdate__c":"2022/03/29","OnJobState__c":"","ProcessingWorkWithoutNumber__c":"","ProcessingWorkStatus__c":"未开展","IsEndoscope__c":"","IsEndoscopeUpdate__c":"","MedicalStaff_Full_name__c":"***","RecordTypeId":"01210000000QfWd","AmountofActivityHistory__c":"","LastName_Encrypted__c":"dcce196c4cfc273a83777852ddd486ab","ContactType_Encrypted__c":"b7246e7dd9d6b63025ec55e8e35b5a99","MedicalStaff_Full_name_Encrypted__c":"dcce196c4cfc273a83777852ddd486ab","Email_Encrypted__c":"","UniqueNumber_Encrypted__c":"","Doctor_Division1_Encrypted__c":"","Type_Encrypted__c":"","Contact_address_Encrypted__c":"2df1bc4bf3800c5e05e3d9f394c3446567d1f05482d2295650b7b50e9e4aa97a92338985c9693f576e1e6df667aaee46","Job_Category_picklist_Encrypted__c":null,"OLY_Assistant_Type_Encrypted__c":null,"Title_Encrypted__c":null,"MobilePhone_Encrypted__c":"","Phone_Encrypted__c":"e060533a8343becc9284a223c5a52d67","Job_Category_picklist__c":null,"OLY_Assistant_Type__c":null,"Title":null,"AWS_Data_Id__c":"958371969131085825"}'; |
| | | |
| | | NewAndEditContactController.saveContact(contactJson,'avgwshDFcxAS',False); |
| | | Test.stopTest(); |
| | | } |
| | | // static testMethod void testMethod2() { |
| | | // Contact contactTest = TestDataUtility.CreateContacts(1)[0]; |
| | | // String recordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Doctor').getRecordTypeId(); |
| | | // String url = ApexPages.currentPage().getParameters().put('RecordType',recordTypeId); |
| | | // url = ApexPages.currentPage().getParameters().put('accid','0010l00001PPOy7AAH'); |
| | | // Test.startTest(); |
| | | // ApexPages.StandardController con = new ApexPages.StandardController(contactTest); |
| | | // NewAndEditContactController cont = new NewAndEditContactController(con); |
| | | |
| | | // cont.RedirectStandardPage(); |
| | | // Test.stopTest(); |
| | | // } |
| | | static testMethod void testMethod3() { |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | // Contact contactTest = TestDataUtility.CreateContacts(1)[0]; |
| | | Account acc = TestDataUtility.CreateAccounts(1)[0]; |
| | | //Account acc1 = [SELECT Id,Name FROM Account WHERE RecordType.DeveloperName = 'Office' OR RecordType.DeveloperName = 'AgencyContact' OR RecordType.DeveloperName = 'Agency' Limit 1]; |
| | | String accrecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); |
| | | Account acc1 = new Account(Name = 'testacc1',RecordTypeId = accrecordTypeId); |
| | | insert acc1; |
| | | |
| | | |
| | | String recordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Doctor').getRecordTypeId(); |
| | | String url = ApexPages.currentPage().getParameters().put('RecordType',recordTypeId); |
| | | url = ApexPages.currentPage().getParameters().put('accid',acc1.Id); |
| | | url = ApexPages.currentPage().getParameters().put('con4_lkid',acc1.Id); |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(new Contact()); |
| | | NewAndEditContactController cont = new NewAndEditContactController(con); |
| | | // cont.rtTypeId |
| | | |
| | | cont.PageLoad(); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditEventControllerTest { |
| | | static testMethod void testMethod4() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Event eventTest = TestDataUtility.CreateEvent(1)[0]; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(eventTest); |
| | | NewAndEditEventController event = new NewAndEditEventController(con); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | public String staticResourceContact {get; set;} |
| | | public String staticResourceLead {get; set;} |
| | | public String urlCheckContactAWSid {get; set;} |
| | | public String contactAWSDataId{set;get;} |
| | | public String contactName{set;get;} |
| | | public NewAndEditInquiryFormController(ApexPages.StandardController controller) { |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Inquiry_form__c').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | |
| | | if(obj.Id == null){ |
| | | //初始化加载值 |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | }else { |
| | | //联系人的Id |
| | | Inquiry_form__c ifc = [select Contact_Name__c from Inquiry_form__c where id=:obj.Id]; |
| | | if(ifc != null){ |
| | | List<Contact> c = [select AWS_Data_Id__c,Name from Contact where id=:ifc.Contact_Name__c]; |
| | | if(c.size()>0){ |
| | | if (c[0].AWS_Data_Id__c != null && c[0].AWS_Data_Id__c != '') { |
| | | contactAWSDataId = c[0].AWS_Data_Id__c; |
| | | }else { |
| | | contactName = c[0].Name; |
| | | } |
| | | } |
| | | }else { |
| | | contactAWSDataId = '无'; |
| | | contactName = '无'; |
| | | } |
| | | } |
| | | //contact信息(搜索查询query url用) |
| | | staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact')); |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditInquiryFormControllerTest { |
| | | static testMethod void testMethod5() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | RecordType rtId1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | Account acc1 = new Account(); |
| | | acc1.Name = 'Test1 病院'; |
| | | acc1.RecordTypeId = rtId1.Id; |
| | | insert acc1; |
| | | RecordType rtId2 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | Account acc2 = new Account(); |
| | | acc2.Name = 'Test2 戦略科室分類 呼吸科'; |
| | | acc2.RecordTypeId = rtId2.Id; |
| | | acc2.ParentId = acc1.Id; |
| | | acc2.Department_Class_Label__c = '呼吸科'; |
| | | acc2.Hospital_Department_Class__c = acc1.Id; |
| | | insert acc2; |
| | | RecordType rtId3 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 呼吸科']; |
| | | Account acc3 = new Account(); |
| | | acc3.Name = 'Test3 '; |
| | | acc3.RecordTypeId = rtId3.Id; |
| | | acc3.ParentId = acc2.Id; |
| | | acc3.Department_Class__c = acc2.Id; |
| | | acc3.Hospital__c = acc1.Id; |
| | | insert acc3; |
| | | Contact contact = TestDataUtility.CreateContacts(1)[0]; |
| | | contact.AccountId = acc3.Id; |
| | | upsert contact; |
| | | Inquiry_form__c formTest = TestDataUtility.CreateInquiryform(1)[0]; |
| | | formTest.AWS_Data_Id__c = '165'; |
| | | formTest.Hospital__c = acc1.Id; |
| | | formTest.Department_Class__c = acc2.Id; |
| | | formTest.Hospital_Name__c = acc3.Id; |
| | | formTest.Contact_Name__c = contact.Id; |
| | | System.debug('formTest: ' + formTest); |
| | | upsert formTest; |
| | | String url = ApexPages.currentPage().getParameters().put('CF00N1000000962n8_lkid',contact.id); |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(formTest); |
| | | NewAndEditInquiryFormController form = new NewAndEditInquiryFormController(con); |
| | | String formJson = '{"Id": "a410l00000067xyAAA","AWS_Data_Id__c": "952951318358523905","Lead_link__c": null,"Hospital__c": null,"Contact_Name__c": "0030l00000mEx8UAAS","No_Need_Date__c": null,"Urgent__c": false}'; |
| | | System.debug('formJson: ' + formJson); |
| | | NewAndEditInquiryFormController.saveInquiryForm(formJson,'avgwshDFcxAS',False); |
| | | String jsonString = '["Department_Class__c", "Hospital__c"]'; |
| | | NewAndEditInquiryFormController.queryAccount(jsonString, contact.AccountId); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | static testMethod void testMethod1() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | RecordType rtId1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | Account acc1 = new Account(); |
| | | acc1.Name = 'Test1 病院'; |
| | | acc1.RecordTypeId = rtId1.Id; |
| | | insert acc1; |
| | | RecordType rtId2 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | Account acc2 = new Account(); |
| | | acc2.Name = 'Test2 戦略科室分類 呼吸科'; |
| | | acc2.RecordTypeId = rtId2.Id; |
| | | acc2.ParentId = acc1.Id; |
| | | acc2.Department_Class_Label__c = '呼吸科'; |
| | | acc2.Hospital_Department_Class__c = acc1.Id; |
| | | insert acc2; |
| | | RecordType rtId3 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 呼吸科']; |
| | | Account acc3 = new Account(); |
| | | acc3.Name = 'Test3 '; |
| | | acc3.RecordTypeId = rtId3.Id; |
| | | acc3.ParentId = acc2.Id; |
| | | acc3.Department_Class__c = acc2.Id; |
| | | acc3.Hospital__c = acc1.Id; |
| | | insert acc3; |
| | | Contact contact = TestDataUtility.CreateContacts(1)[0]; |
| | | contact.AccountId = acc3.Id; |
| | | contact.AWS_Data_Id__c = '167895'; |
| | | upsert contact; |
| | | Inquiry_form__c formTest = TestDataUtility.CreateInquiryform(1)[0]; |
| | | formTest.AWS_Data_Id__c = '165'; |
| | | formTest.Hospital__c = acc1.Id; |
| | | formTest.Department_Class__c = acc2.Id; |
| | | formTest.Hospital_Name__c = acc3.Id; |
| | | formTest.Contact_Name__c = contact.Id; |
| | | System.debug('formTest: ' + formTest); |
| | | upsert formTest; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(formTest); |
| | | NewAndEditInquiryFormController form = new NewAndEditInquiryFormController(con); |
| | | String formJson = '{"Id": "a410l00000067xyAAA","AWS_Data_Id__c": "952951318358523905","Lead_link__c": null,"Hospital__c": null,"Contact_Name__c": "0030l00000mEx8UAAS","No_Need_Date__c": null,"Urgent__c": false}'; |
| | | System.debug('formJson: ' + formJson); |
| | | NewAndEditInquiryFormController.saveInquiryForm(formJson,'avgwshDFcxAS',False); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | static testMethod void testMethod2() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Account acc = TestDataUtility.CreateAccounts(1)[0]; |
| | | Inquiry_form__c formTest = TestDataUtility.CreateInquiryform(1)[0]; |
| | | formTest.Contact_Name__c = null; |
| | | upsert formTest; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(formTest); |
| | | NewAndEditInquiryFormController form = new NewAndEditInquiryFormController(con); |
| | | String formJson = '{"Id": "a410l00000067xyAAA","AWS_Data_Id__c": "952951318358523905","Lead_link__c": null,"Hospital__c": null,"Contact_Name__c": "0030l00000mEx8UAAS","No_Need_Date__c": null,"Urgent__c": false}'; |
| | | System.debug('formJson: ' + formJson); |
| | | NewAndEditInquiryFormController.saveInquiryForm(formJson,'avgwshDFcxAS',False); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | static testMethod void testMethod3() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Account acc = TestDataUtility.CreateAccounts(1)[0]; |
| | | Inquiry_form__c formTest = new Inquiry_form__c(); |
| | | formTest.Name = 'Test InquiryForm'; |
| | | formTest.Request1__c = 'OPD'; |
| | | formTest.Opportunity_Division__c = '询价'; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(formTest); |
| | | NewAndEditInquiryFormController form = new NewAndEditInquiryFormController(con); |
| | | String formJson = '{"Id": "a410l00000067xyAAA","AWS_Data_Id__c": "952951318358523905","Lead_link__c": null,"Hospital__c": null,"Contact_Name__c": "0030l00000mEx8UAAS","No_Need_Date__c": null,"Urgent__c": false}'; |
| | | System.debug('formJson: ' + formJson); |
| | | NewAndEditInquiryFormController.saveInquiryForm(formJson,'avgwshDFcxAS',False); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditInspectionReportControllerTest { |
| | | static testMethod void testMethod1() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Inspection_Report__c insTest = new Inspection_Report__c(); |
| | | // List<Inspection_Report__c> asdf = TestDataUtility.CreateInspectionReport(1); |
| | | insTest = TestDataUtility.CreateInspectionReport(1)[0]; |
| | | |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(insTest); |
| | | NewAndEditInspectionReportController ins = new NewAndEditInspectionReportController(con); |
| | | |
| | | String insJson = '{"Name":"test123","RecordTypeId":"01210000000RLeX","Hospital__c":"0011m00000Xm6Lk","Status__c":"草案中","Approved_date__c":"2022/03/29","if_UpdateAsset__c":true,"Inspection_StartTime__c":"2022/03/29 16:22","Inspection_Date__c":"2022/03/29","Inspection_EndTime__c":"2022/03/29 16:22","Contract__c":"000000000000000","spotCheckBatch__c":"","Submit_date__c":"2022/03/29","Inspectup_Plan__c":"000000000000000","Technician_HP__c":"","Remarks__c":"","Department__c":"000000000000000","ResponsiblePerson_Sign__c":"<br>","Reporter__c":"00510000000gW9S","Technician_HP_Encrypted__c":"","phone_Encrypted__c":null,"Responsible_Person_Encrypted__c":null,"phone__c":null,"Responsible_Person__c":null,"AWS_Data_Id__c":"958401040867131393"}'; |
| | | NewAndEditInspectionReportController.saveInspectionReport(insJson,'avgwshDFcxAS',False); |
| | | NewAndEditInspectionReportController.saveInspectionReport(insJson,'avgwshDFcxAS',True); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | //获取所有字段 |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Lead').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | SObject obj = controller.getRecord(); |
| | | |
| | | if(ApexPages.currentPage().getParameters().get('CF00N1000000962np_lkid') != null){ |
| | |
| | | //医院名 |
| | | if(mso.containsKey('CF00N10000002CvC5_lkid')){ |
| | | controller.getRecord().put('Hospital_Name__c',mso.get('CF00N10000002CvC5_lkid')); |
| | | //通过医院id查询战略科室分类 |
| | | String hospitalId = mso.get('CF00N10000002CvC5_lkid'); |
| | | List<Account> hospitalAccount = [select Department_Class__c from Account where Id=:hospitalId]; |
| | | if(hospitalAccount.size()>0){ |
| | | List<Account> departmentAccount = [select Id from Account where Id=:hospitalAccount[0].Department_Class__c]; |
| | | if (departmentAccount.size()>0) { |
| | | System.debug('Department_Class__c = ' + departmentAccount[0].Id); |
| | | controller.getRecord().put('Department_Class__c',departmentAccount[0].Id); |
| | | } |
| | | } |
| | | } |
| | | //公司(科室) |
| | | if(mso.containsKey('CF00N10000002CvC5')){ |
| | | controller.getRecord().put('Company',mso.get('CF00N10000002CvC5')); |
| | | } |
| | | //战略科室CF00N10000006qNtt_lkid |
| | | // if(mso.containsKey('CF00N10000006qNtt_lkid ')){ |
| | |
| | | return resp; |
| | | } |
| | | } |
| | | |
| | | @RemoteAction |
| | | global static String queryAccount(String accountTypes,String accountId) { |
| | | System.debug('accountType='+accountTypes); |
| | | System.debug('accountId='+accountId); |
| | | List<Object> types = (List<Object>)JSON.deserializeUntyped(accountTypes); |
| | | System.debug('types='+types); |
| | | String soql = 'select Id,Name,'; |
| | | for (Object t : types) { |
| | | soql += (String)t+','; |
| | | } |
| | | soql = soql.substring(0,soql.length()-1); |
| | | soql += ' from Account where id=\''+accountId+'\''; |
| | | System.debug('soql='+soql); |
| | | Sobject account = Database.query(soql); |
| | | |
| | | Map<String, Map<String, String>> m = new Map<String, Map<String, String>>(); |
| | | |
| | | System.debug('account='+account); |
| | | for (Object ty : types) { |
| | | String t = (String)ty; |
| | | if (account.get(t) != null){ |
| | | Sobject acc = Database.query('select Id,Name from Account where id=\''+account.get(t)+'\''); |
| | | Map<String, String> n = new Map<String, String>(); |
| | | n.put('Id', (String)acc.get('Id')); |
| | | n.put('Name', (String)acc.get('Name')); |
| | | m.put(t, n); |
| | | } |
| | | } |
| | | // if (account.get('Hospital__c') != null){ |
| | | // m.put('Hospital__c', (String)account.get('Hospital__c')); |
| | | // m.put('Hospital__r.Name', (String)account.get('Hospital__r.Name')); |
| | | // } |
| | | // if (account.get('Department_Class__c') != null){ |
| | | // m.put('Department_Class__c', (String)account.get('Department_Class__c')); |
| | | // m.put('Department_Class__r.Name', (String)account.get('Department_Class__r.Name')); |
| | | // } |
| | | System.debug('m='+m); |
| | | return JSON.serialize(m); |
| | | |
| | | // return (String)account.get('Hospital__c'); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditLeadControllerTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | List<String> strList= new List<String>(); |
| | | strList.add('Lead'); |
| | | strList.add('Contact'); |
| | | strList.add('Inquiry_form__c'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(strList); |
| | | Lead leadTest = TestDataUtility.CreateLead(1)[0]; |
| | | Contact cont = TestDataUtility.CreateContacts(1)[0]; |
| | | Inquiry_form__c iqf = TestDataUtility.CreateInquiryform(1)[0]; |
| | | } |
| | | static testMethod void testMethod1() { |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Lead leadTest = [SELECT Id FROM Lead Limit 1]; |
| | | Contact cont = [SELECT Id FROM Contact Limit 1]; |
| | | Inquiry_form__c iqf = [SELECT Id FROM Inquiry_form__c Limit 1]; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(leadTest); |
| | | NewAndEditLeadController lead = new NewAndEditLeadController(con); |
| | | |
| | | String leadJson = JSON.serialize(leadTest); |
| | | NewAndEditLeadController.saveLead(leadJson,'avgwshDFcxAS',False); |
| | | NewAndEditLeadController.saveLead(leadJson,'avgwshDFcxAS',True); |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod2() { |
| | | Lead leadTest = [SELECT Id FROM Lead Limit 1]; |
| | | Contact cont = [SELECT Id,AccountId FROM Contact Limit 1]; |
| | | Inquiry_form__c iqf = [SELECT Id,Contact_Id__c FROM Inquiry_form__c Limit 1]; |
| | | |
| | | String url = ApexPages.currentPage().getParameters().put('CF00N1000000962np_lkid',iqf.id); |
| | | url = ApexPages.currentPage().getParameters().put('RecordType','01210000000QiRaAAK'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000006ps6f_lkid',iqf.Contact_Id__c); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002CvC5_lkid',cont.AccountId); |
| | | |
| | | Test.startTest(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | ApexPages.StandardController lds = new ApexPages.StandardController(new Contact()); |
| | | NewAndEditLeadController ld = new NewAndEditLeadController(lds); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod3() { |
| | | Lead leadTest = new Lead(); |
| | | Contact cont = [SELECT Id, AccountId FROM Contact Limit 1]; |
| | | |
| | | String url = ApexPages.currentPage().getParameters().put('CF00N10000006ps6f_lkid',cont.id); |
| | | url = ApexPages.currentPage().getParameters().put('RecordType','01210000000QiRf'); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(leadTest); |
| | | NewAndEditLeadController lc = new NewAndEditLeadController(con); |
| | | String jsonString = '["Department_Class__c"]'; |
| | | system.debug('jsonString:'+JSON.deserializeUntyped(jsonString)); |
| | | NewAndEditLeadController.queryAccount(jsonString, cont.AccountId); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditQISControllerTest { |
| | | static testMethod void testMethod13() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | QIS_Report__c qisTest = TestDataUtility.CreateQISReport(1)[0]; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(qisTest); |
| | | NewAndEditQISController qis = new NewAndEditQISController(con); |
| | | |
| | | String qisJson = '{"Name":"test123","QIS_Status__c":"草案中","QIS_pre__c":"000000000000000","consumable__c":"01t1m000001QyDa","Cancel_QIS_Reason__c":"_u0001_","RecordTypeId":"01210000000RLWc","Repair__c":"a0J1m000001nZzf","RejectReason__c":"","Managementtext__c":"","OCSMAdministrativeReportStatus__c":"无需报告","MBC_AwareDate__c":"2022/03/29","Aware_date__c":"2022/03/29","Old_Repair_Name__c":"","isLendRental__c":false,"next_action__c":"","RC_problem_not_found__c":false,"Salesdepartment_Text__c":"","OCM_Repair_Mail1__c":"","Hospital__c":"0011m00000XlvHh","Account_State__c":"","Department_Class__c":"0011m00000SP4Mp","OwnerId":"0051m0000030e0QAAQ","Hospital_Department__c":"0011m00000SP4TB","Responsible_Person_HP__c":"***","Caller_phone__c":"***********","capital_or_consumable__c":"耗材","contract_number_ET_text__c":"","nonyushohin__c":"000000000000000","InstallDate_text__c":"","usage_frequence__c":"1","cleanning__c":"1","cds_methods__c":"手动","disinfection__c":"","sterlization__c":"","Faliour_date__c":"2022/03/29","Trable_occur_daY_collect__c":"2022/03/29","DelayReportReason__c":"","failuer_situation__c":"到货验收","failuer_situationSelect__c":"","problem_detail__c":"test","Damage_For_Doc_Or_Pat__c":"","Relation_With_The_Problem__c":"","Report_For_Goz__c":"","Which_Project__c":"","Opera_Name__c":"","BreakORFallOff__c":"","Is_Used_For_The_Opera__c":"","Set_usage_product__c":"","Comment__c":"test","AfterFailureInformation__c":"","Delay15Min__c":"","InformationFrom__c":"","FailureQInHospital__c":"","accsessary_detail__c":"","shipping_to_QIS_dept_day__c":"","ASReportedCode__c":"","QIS_ConfirmationDate__c":"","PAE_Determine__c":"","ASReportedCodeAC__c":"","OCSM_RC_CordingDate__c":"","PAE_DetermineAC__c":"","Complaint_Number__c":"","OSH_ConfirmationDate__c":"","if_QIS_Allowed__c":"","NotAllowedReason__c":"","OSHRAConfirmDate__c":"","isAE_Profile__c":"","isPAE_Profile__c":"","MDR_information__c":"","MDR_detail__c":"","CFDA_No_Hand__c":"","ProduceCompany_hand__c":"","Receive_Date_Day__c":"2022/03/29","OSHRecievedDate__c":"","QIS_Submit_day__c":"","QIS_OSH_answerdate__c":"","OCM_RC_RecievedDate__c":"","QIS_Complete_Day__c":"","QIS_Reply_day__c":"","QIS_cancel_date__c":"","QIS_Cancel_Submit_day__c":"","Daily_Report__c":"000000000000000","Generation_Source__c":"","Source_OnCall__c":"000000000000000","QisSubOrder__c":"000000000000000","AsyncData__c":false,"ETQ_UPLOAD_STATUS__c":"","AWS_Interface_Time__c":"2022/03/29 13:38","ETQ_UPLOAD_MESSAGE__c":"","INTERFACE_RECORD_ID__c":"","ET_QIS_SEND_EMAIL1__c":"","ET_QIS_SEND_EMAIL2__c":"","problem_detail_photo__c":"","Caller_phone_Encrypted__c":"415f2dab7eb6b2a866e02d823080a845","Responsible_Person_HP_Encrypted__c":"dcce196c4cfc273a83777852ddd486ab","AWS_Data_Id__c":"958360820671053825"}'; |
| | | NewAndEditQISController.saveQISReport(qisJson,'avgwshDFcxAS',False); |
| | | NewAndEditQISController.saveQISReport(qisJson,'avgwshDFcxAS',True); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod14() { |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | String url = ApexPages.currentPage().getParameters().put('CF00N10000002FHFK_lkid','test'); |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(new QIS_Report__c()); |
| | | NewAndEditQISController qis = new NewAndEditQISController(con); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditRepairSubOrderControllerTest { |
| | | static testMethod void testMethod1() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | // RepairSubOrder__c subTest = TestDataUtility.CreateRepairSubOrder(1)[0]; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(new RepairSubOrder__c()); |
| | | NewAndEditRepairSubOrderController sub = new NewAndEditRepairSubOrderController(con); |
| | | sub.contactsInfo = sub.contactId; |
| | | String subJson = '{"RepairOrderNo__c":"test123","Name":"123","Hospital__c":"0011m00000Xiz4Q","RepairSubOrderType__c":"CIC代填","Department__c":"0011m00000Xiz4Q","Applicanter__c":"0031m00000MtzBhAAJ","Status__c":"待处理","CurrencyIsoCode":"CNY","RepairApplicantName__c":"","ProcessResult__c":"","RepairApplicantTel__c":"","OwnerId":"0051m0000030e0Q","EquipmentCategory__c":"内科系统","AssetType__c":"胃镜","AssetCode__c":"","ProblemDescription__c":"","FaultType__c":"","RepairTime__c":"","ReceiverType__c":"","ReceiverTime__c":"","Receiver__c":"000000000000000","PlannedVisitDay__c":"2022/03/29 12:06","ActualVisitTimeSecond__c":"","ActualVisitTimeThird__c":"","AssetModel__c":"","AirframeCodeEngineer__c":"","RepairApplicantName_Encrypted__c":"","RepairApplicantTel_Encrypted__c":"","AWS_Data_Id__c":"958338146326544385"}'; |
| | | NewAndEditRepairSubOrderController.saveRepairSubOrder(subJson,'avgwshDFcxAS',False); |
| | | NewAndEditRepairSubOrderController.saveRepairSubOrder(subJson,'avgwshDFcxAS',True); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | public String layoutSectionsStr {get; set;} |
| | | public String no1Name{get; set;} |
| | | public String no1Id{get; set;} |
| | | // 当前页面中的加密字段集合 |
| | | public List<String> layoutEncryptedAPIList{private set;get;} |
| | | public final string ApiPrefix{get;private set;} |
| | | public Map<string,string> AWSToSobjectEncryptedMap{get;private set;} |
| | | public string AWSToSobjectEncryptedMapJson{get{return JSON.serialize(AWSToSobjectEncryptedMap);}} |
| | | public NewAndEditReportController(ApexPages.StandardController controller) { |
| | | ApiPrefix = 'PIBackApi'; |
| | | layoutEncryptedAPIList = new List<String>(); |
| | | AWSToSobjectEncryptedMap = new Map<string,string>(); |
| | | sobjectId = [SELECT CustomObjectId,CustomObjectName FROM CustomObjectUserLicenseMetrics where CustomObjectName ='Report' limit 1].CustomObjectId; |
| | | isNewMode = true; |
| | | Input_Required_Field_Msg = Label.Input_Required_Field_Msg; |
| | |
| | | rtTypeId = ReportData.RecordTypeId; |
| | | AWSDataId = ReportData.AWS_Data_Id__c; |
| | | Map<String,String> sfIdToAWSIdMap = new Map<String,String>(); |
| | | system.debug('ReportData.Practitioner1__r.Id:' + ReportData.Practitioner1__r.Id); |
| | | system.debug('ReportData.Practitioner1__r.AWS_Data_Id__c:' + ReportData.Practitioner1__r.AWS_Data_Id__c); |
| | | |
| | | if(ReportData.Practitioner1__r.Id != null && ReportData.Practitioner1__r.AWS_Data_Id__c!=null){ |
| | | sfIdToAWSIdMap.put(String.valueof(ReportData.Practitioner1__r.Id).subString(0,15),ReportData.Practitioner1__r.AWS_Data_Id__c); |
| | | } |
| | |
| | | staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact')); |
| | | sobjectPrefix = piIntegration.sobjectPrefix; |
| | | layoutSectionsStr = JSON.serialize(layoutSections); |
| | | for (LayoutDescriberHelper.LayoutSection ls : layoutSections) { |
| | | for (LayoutDescriberHelper.LayoutField lf : ls.layoutFields) { |
| | | //在view解密section中只需显示当前layout中的加密字段 |
| | | if (encryptedAPIList.contains(lf.fieldAPI)) { |
| | | layoutEncryptedAPIList.add(lf.fieldAPI); |
| | | } |
| | | } |
| | | } |
| | | for (PI_Field_Policy_Detail__c PIDetail : piIntegration.PIDetails) { |
| | | AWSToSobjectEncryptedMap.put(PIDetail.AWS_Field_API__c, PIDetail.SF_Field_API_Name__c); |
| | | } |
| | | System.debug('AWSToSobjectEncryptedMap = ' + AWSToSobjectEncryptedMap); |
| | | } |
| | | |
| | | global class Response{ |
| | |
| | | Report__c reportInfo = new Report__c(); |
| | | |
| | | System.debug('自定义格式转换开始'); |
| | | //2. Save Record Process |
| | | String status = 'success'; |
| | | Response resp = new Response(); |
| | | Savepoint sp = Database.setSavepoint(); |
| | | String rid = ''; |
| | | //自定义格式转换 |
| | | try{ |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | if(!fieldAPIToTypeMap.containskey(fieldAPI)){ |
| | | continue; |
| | |
| | | //reportInfo.put(fieldAPI, Date.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)).replace('/', '-'))); |
| | | reportInfo.put(fieldAPI,(String.isBlank(fieldValue)||String.isEmpty(fieldValue))? null:Date.valueOf(fieldValue.replace('/', '-'))); |
| | | }else if(String.valueOf(fielddataType)=='DATETIME'){ |
| | | System.debug('fieldValueMap:' + fieldValueMap); |
| | | String dt = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | System.debug('fieldValueMap.get(fieldAPI)' + fieldValueMap.get(fieldAPI)); |
| | | System.debug('dt:'+dt); |
| | | if(String.isNotBlank(dt)&&dt.contains('T')){ |
| | | dt = dt.replace('T',' '); |
| | | reportInfo.put(fieldAPI, Datetime.valueOfGmt(dt)); |
| | | }else if(String.isNotBlank(dt)) { |
| | | reportInfo.put(fieldAPI, Datetime.valueOf(dt)); |
| | | reportInfo.put(fieldAPI, Datetime.valueOf(dt.replace('/', '-') + ':00')); |
| | | }else{ |
| | | reportInfo.put(fieldAPI, null); |
| | | } |
| | | }else if(String.valueof(fielddataType)=='CURRENCY'|| String.valueof(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | //reportInfo.put(fieldAPI, Decimal.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)))); |
| | |
| | | } |
| | | System.debug('自定义格式转换结束'); |
| | | |
| | | //2. Save Record Process |
| | | String status = 'success'; |
| | | Response resp = new Response(); |
| | | Savepoint sp = Database.setSavepoint(); |
| | | String rid = ''; |
| | | try{ |
| | | if(isNew){ |
| | | System.debug('reportInfo = ' + reportInfo); |
| | | if(!Test.isRunningTest()){ |
| | | insert reportInfo; |
| | | } else { |
| | | Report__c reportTest = new Report__c(); |
| | | insert reportTest; |
| | | } |
| | | }else{ |
| | | System.debug('into update'); |
| | | String awsDataId = (String)reportInfo.get('AWS_Data_Id__c'); |
| | |
| | | report__c[] reports = [select id from report__c where AWS_Data_Id__c =:awsDataId]; |
| | | System.debug('reports[0].id = ' + reports[0].id); |
| | | reportInfo.put('Id',reports[0].id);//For testing; |
| | | if(!Test.isRunningTest()){ |
| | | update reportInfo; |
| | | } |
| | | } |
| | | rid=reportInfo.Id; |
| | | PIHelper.saveTransLog(sobjectTypeValue,(String)reportInfo.get('AWS_Data_Id__c'),rid,transId,reportJson ,status,''); |
| | |
| | | resp.status = status; |
| | | return resp; |
| | | |
| | | }catch(DmlException e) { |
| | | status = 'fail'; |
| | | Integer index = 0; |
| | | System.debug(e.getNumDml()); |
| | | System.debug(e.getDmlFields(index)); |
| | | System.debug(e.getDmlId(index)); |
| | | System.debug(e.getDmlIndex(index)); |
| | | System.debug(e.getDmlMessage(index)); |
| | | System.debug(e.getDmlStatusCode(index)); |
| | | System.debug(e.getDmlType(index)); |
| | | system.debug(e.getMessage()); |
| | | system.debug(e.getStackTraceString()); |
| | | |
| | | System.debug('into catch'+e.getMessage()); |
| | | Database.rollback(sp); |
| | | resp.status = 'Exception'; |
| | | resp.message ='保存失败,原因:'+ e.getDmlMessage(index); |
| | | PIHelper.saveTransLog(sobjectTypeValue,(String)reportInfo.get('AWS_Data_Id__c'),rid,transId,reportJson,status,e.getMessage()+e.getStackTraceString()); |
| | | return resp; |
| | | |
| | | } catch(Exception e) { |
| | | System.debug('into catch'+e.getMessage()); |
| | | Database.rollback(sp); |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditReportControllerTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | List<String> strList = new List<String>(); |
| | | strList.add('Report__c'); |
| | | strList.add('Contact'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(strList); |
| | | } |
| | | static testMethod void testMethod1() { |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | RecordType rtId1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | Account acc1 = new Account(); |
| | | acc1.Name = 'Test1 病院'; |
| | | acc1.RecordTypeId = rtId1.Id; |
| | | insert acc1; |
| | | RecordType rtId2 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | Account acc2 = new Account(); |
| | | acc2.Name = 'Test2 戦略科室分類 呼吸科'; |
| | | acc2.RecordTypeId = rtId2.Id; |
| | | acc2.ParentId = acc1.Id; |
| | | acc2.Department_Class_Label__c = '呼吸科'; |
| | | acc2.Hospital_Department_Class__c = acc1.Id; |
| | | insert acc2; |
| | | RecordType rtId3 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 呼吸科']; |
| | | Account acc3 = new Account(); |
| | | acc3.Name = 'Test3 '; |
| | | acc3.RecordTypeId = rtId3.Id; |
| | | acc3.ParentId = acc2.Id; |
| | | acc3.Department_Class__c = acc2.Id; |
| | | acc3.Hospital__c = acc1.Id; |
| | | insert acc3; |
| | | OPDPlan__c opd = new OPDPlan__c(); |
| | | opd.Name = 'Test 0330'; |
| | | opd.OPDPlan_ImplementDate__c = Date.today(); |
| | | opd.Account_Laboratory__c = acc3.Id; |
| | | opd.OPDType__c = '询价'; |
| | | opd.NoOpp_Reason__c = 'HCP对应'; |
| | | insert opd; |
| | | // Rental_Apply__c rental = TestDataUtility.CreateRentalApplys(1)[0]; |
| | | Report__c reportTest = TestDataUtility.CreateReport(1)[0]; |
| | | |
| | | String url = ApexPages.currentPage().getParameters().put('CF00N10000008ps6d_lkid', opd.Id); |
| | | |
| | | Test.startTest(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(reportTest); |
| | | NewAndEditReportController report = new NewAndEditReportController(con); |
| | | |
| | | String reportJson = '{"RecordTypeId":"01210000000Qekj","Completed_time_c__c":"2022-03-09 06:18","Hospital_Reference__c":"000000000000000","OwnerId":"0051m0000030e0Q","Department_Class_Ref__c":"000000000000000","Status__c":"草案中","Hospital_Department__c":"0011000000VATK6","Daily_Report__c":"000000000000000","Reporter_State__c":"","Report_OPDPlan__c":"000000000000000","Loaner_request_no1__c":"000000000000000","Date__c":"2022/03/28","Practitioner1__c":"0031m00000N7NSxAAN","Practitioner1_Part__c":"","Practitioner2__c":"000000000000000","Practitioner2_Part__c":"","Practitioner5_others_c__c":"","Purpose1__c":"","Opportunity_Situation__c":"引合発生","Opportunity1__c":"000000000000000","Reason__c":"","Opportunity2__c":"000000000000000","Appeal_Point__c":"","Strategic_Department_Class__c":"","Operation_From__c":null,"Operation_To__c":"","Technical_Category_Manual_c__c":"","Patient_Status__c":"","Operation_Process__c":"","Operation_Task__c":"","Product_Evaluation_Advantage__c":"","Product_Evaluation_Faults__c":"","OPD_Summarize__c":"","Activity_Plan__c":"","OPD_ProductCategory1__c":"","OPD_ProductCategory2__c":"","Product1__c":"000000000000000","OLY_Provide_1__c":"","Product2__c":"000000000000000","OLY_Provide_2__c":"","Product3__c":"000000000000000","OLY_Provide_3__c":"","Product4__c":"000000000000000","OLY_Provide_4__c":"","Product5__c":"000000000000000","OLY_Provide_5__c":"","Evaluation_PDF_number__c":"","Customer_sigh_day_c__c":"","Professor_sigh_text__c":"","Technical_Category1__c":"","Technical_Category2__c":"","Purpose2__c":"引合発生","Customer_sigh_photo__c":""}'; |
| | | NewAndEditReportController.saveReport(reportJson,'avgwshDFcxAS',False); |
| | | NewAndEditReportController.saveReport(reportJson,'avgwshDFcxAS',True); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod2() { |
| | | String recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByDeveloperName().get('On_Call').getRecordTypeId(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | String url = ApexPages.currentPage().getParameters().put('00N10000002GE3Z','经销商A'); |
| | | url = ApexPages.currentPage().getParameters().put('RecordType',recordTypeId); |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(new Report__c()); |
| | | NewAndEditReportController report = new NewAndEditReportController(con); |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod3() { |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Report__c reportTest = new Report__c(); |
| | | Contact cons = TestDataUtility.CreateContacts(1)[0]; |
| | | cons.AWS_Data_Id__c = 'test'; |
| | | system.debug('cons:' + cons); |
| | | update cons; |
| | | reportTest.Practitioner1__c = cons.ID; |
| | | reportTest.Practitioner2__c = cons.ID; |
| | | reportTest.Practitioner3__c = cons.ID; |
| | | reportTest.Practitioner4__c = cons.ID; |
| | | reportTest.Practitioner5__c = cons.ID; |
| | | reportTest.Person_In_Charge__c = cons.ID; |
| | | reportTest.Manual_Name__c = 'test'; |
| | | insert reportTest; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(reportTest); |
| | | NewAndEditReportController report = new NewAndEditReportController(con); |
| | | |
| | | String reportJson = '{"RecordTypeId":"01210000000Qekj","Hospital_Reference__c":"000000000000000","OwnerId":"0051m0000030e0Q","Department_Class_Ref__c":"000000000000000","Status__c":"草案中","Hospital_Department__c":"0011000000VATK6","Daily_Report__c":"000000000000000","Reporter_State__c":"","Engineer__c":null,"Report_OPDPlan__c":"000000000000000","Loaner_request_no1__c":"000000000000000","Date__c":"2022/03/28","Inspection_start_time__c":"2022-03-09T06:18:16.000+0000","Thermal_Diffusion_Worry__c":"false","Practitioner1__c":"0031m00000N7NSxAAN","Practitioner1_Part__c":"","Practitioner2__c":"000000000000000","Practitioner2_Part__c":"","Practitioner5_others_c__c":"","Purpose1__c":"","Opportunity_Situation__c":"引合発生","Opportunity1__c":"000000000000000","Reason__c":"","Opportunity2__c":"000000000000000","Appeal_Point__c":"","Dean_Of_Maintenance__c":"null","Strategic_Department_Class__c":"","Operation_From__c":"2022-02-15T00:41:16.000+0000","Operation_To__c":"","Technical_Category_Manual_c__c":"","Patient_Status__c":"","Operation_Process__c":"","Operation_Task__c":"","Product_Evaluation_Advantage__c":"","Product_Evaluation_Faults__c":"","OPD_Summarize__c":"","Activity_Plan__c":"","OPD_ProductCategory1__c":"","OPD_ProductCategory2__c":"","Product1__c":"000000000000000","OLY_Provide_1__c":"","Product2__c":"000000000000000","OLY_Provide_2__c":"","Product3__c":"000000000000000","OLY_Provide_3__c":"","Product4__c":"000000000000000","OLY_Provide_4__c":"","Product5__c":"000000000000000","OLY_Provide_5__c":"","Evaluation_PDF_number__c":"","Customer_sigh_day_c__c":"","Professor_sigh_text__c":"","Technical_Category1__c":"","Technical_Category2__c":"","Purpose2__c":"引合発生","Customer_sigh_photo__c":""}'; |
| | | NewAndEditReportController.saveReport(reportJson,'avgwshDFcxAS',False); |
| | | NewAndEditReportController.saveReport(reportJson,'avgwshDFcxAS',True); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewAndEditTenderinformationControlTest { |
| | | static testMethod void testMethod1() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Tender_information__c tenTest = TestDataUtility.CreateTenderInformation(1)[0]; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(tenTest); |
| | | NewAndEditTenderinformationController tender = new NewAndEditTenderinformationController(con); |
| | | |
| | | String tenderJson = '{"Retain_Tender__c":"a4J1m000000SDAG","Logical_delete__c":false,"InfoTitle__c":"test1","InfoType__c":"1:预告","Keywords__c":"test","XmNumber__c":"","IsReactionOpp__c":true,"BiddingType__c":"0:公开招标","OpportunityStatus__c":"草案","IsElectronic__c":"","OpportunityNum__c":"1","InfoQianlimaUrl__c":"test","TenderManageCode__c":"","IsRelateProject__c":"是","Hospital__c":"0011m00000Xm6Lk","relativeTime__c":"2022/03/29 11:46","Hospital1__c":"000000000000000","irrelevantReasons__c":"","Hospital2__c":"000000000000000","irrelevantReasonOther__c":"","Hospital3__c":"000000000000000","department_selection__c":"01210000000QemLAAS","Hospital4__c":"000000000000000","AreaProvince__c":"北京","AreaCity__c":"北京","AreaCountry__c":"","InfoPublishTime__c":"","BidingAcquireTime__c":"","TenderBeginTime__c":"","BidingEndTime__c":"","TenderEndTime__c":"","OpenBidingTime__c":"","noticeDate__c":"","ResultDate__c":"","TenderDate__c":"","publicDate__c":"2022/03/29","Bid_Winning_Date__c":"","AgentUnit1__c":"","AgentRelationName__c":"***","AgentUnit2__c":"","AgentRelationWay__c":"***********","AgentUnit3__c":"","ZhaoBiaoUnit1__c":"","ZhaoRelationName__c":"***","ZhaoBiaoUnit2__c":"","ZhaoRelationWay__c":"***********","ZhaoBiaoUnit3__c":"","IsBid__c":"","BiddingStatus__c":"","irresponsibleReason__c":"","NotBidApprovalStatus__c":"","irresponsibleReasonOther__c":"","BudgetAmount1__c":"","WinnerAmount1__c":"","BudgetAmount2__c":"","WinnerAmount2__c":"","BudgetAmount3__c":"","WinnerAmount3__c":"","OBSAP_Budget_amount__c":"","WinnerUnit__c":"","BudgetUnit__c":"","Sum__c":"","SumUnit__c":"","ZhongBiaoUnit1__c":"","ZhongRelationName__c":"***","ZhongBiaoUnit2__c":"","ZhongRelationWay__c":"***********","ZhongBiaoUnit3__c":"","IsOther__c":false,"OtherInfoTitle__c":"","otherInfo__c":"","Name":"testProject","OwnerId":"0051m0000030e0QAAQ","ProjectId__c":"","CursorMark__c":"","File_Surpass_12M__c":false,"department__c":"000000000000000","ZhongRelationName_Encrypted__c":"","AgentRelationName_Encrypted__c":"","ZhaoRelationWay_Encrypted__c":"","ZhongRelationWay_Encrypted__c":"","ZhaoRelationName_Encrypted__c":"","AgentRelationWay_Encrypted__c":"","AWS_Data_Id__c":"'+tenTest.AWS_Data_Id__c+'"}'; |
| | | NewAndEditTenderinformationController.saveTenderinformation(tenderJson,'avgwshDFcxAS',False); |
| | | NewAndEditTenderinformationController.saveTenderinformation(tenderJson,'avgwshDFcxAS',True); |
| | | |
| | | tenTest.AWS_Data_Id__c =''; |
| | | update tenTest; |
| | | NewAndEditTenderinformationController.saveTenderinformation(tenderJson,'avgwshDFcxAS',False); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewConsumApplyControllerTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | List<String> strList = new List<String>(); |
| | | strList.add('Consum_Apply__c'); |
| | | strList.add('Contact'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(strList); |
| | | } |
| | | static testMethod void testMethod1() { |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Consum_Apply__c consumTest = TestDataUtility.CreateConsumApply(1)[0]; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(consumTest); |
| | | NewConsumApplyController consum = new NewConsumApplyController(con); |
| | | |
| | | String consumJson = '{"HP_received_sign_rich__c":"","Name":"123456","Person_In_Charge__c":"00510000000fSYI","ApplyPerson_Phone__c":"","applyUser__c":"00510000000fSYI","Loaner_centre_mail_address__c":"sfdc_lvxueyan@olympus.com.cn","Is_Special_Rental__c":false,"Request_Shipping_7days_Before__c":"","Status__c":"草案中","ConsumApplyRemind_Text__c":"1、创建申请单锁定库存后,请于2个工作日内提交审批,否则系统自动释放库存。\\n2、请确保您提交的申请单在\\"希望到货日-7个工作日”前完成审批,否则申请单自动取消。\\n3、请提交22个工作日以内使用的耗材申请单。","Hospital__c":"000000000000000","Loaner_medical_Staff__c":"000000000000000","Strategic_dept__c":"000000000000000","Phone_number__c":"","Account__c":"000000000000000","Product_category__c":"ET","demo_purpose2__c":"学会展会","QIS_number__c":"000000000000000","Campaign__c":"70110000000laUw","OPDPlan__c":"000000000000000","Rental_Apply__c":"000000000000000","Demo_purpose_text__c":"test","Request_shipping_day__c":"2022-03-28:00","Shipment_address__c":"a2H10000005RQDJ","direct_send__c":"上门自提","Dealer__c":"0011000000VATK6","pickup_time__c":"2022-03-28 17:11:00","Loaner_received_staff__c":"testname","Loaner_received_staff_phone__c":"1234567890","direct_shippment_address__c":"106 Catalpa St, Coffeyville, KS 67337, USA","Post_Code__c":"12345-123","Old_Consum_Apply__c":"000000000000000","Split_Apply_Reason__c":"","DeliverySlip__c":"000000000000000","HP_received_sign_NG__c":false,"HP_received_sign_NG_Reason__c":"","AssetManageConfirm__c":false,"Cancel_Reason__c":"","Loaner_cancel_request__c":"","Consum_Received_Day__c":"","OwnerId":"0051m0000030e0Q","Request_demo_time__c":"","Request_approval_time__c":"","Application_accept_time__c":"","Request_answer_time__c":"","OPD__c":"000000000000000","OPDAmount__c":"","Shipment_Slip_tmp__c":""}'; |
| | | NewConsumApplyController.saveConsumApply(consumJson,'avgwshDFcxAS',False); |
| | | NewConsumApplyController.saveConsumApply(consumJson,'avgwshDFcxAS',True); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod2() { |
| | | |
| | | String recordTypeId = Schema.SObjectType.Consum_Apply__c.getRecordTypeInfosByDeveloperName().get('StandardRequest').getRecordTypeId(); |
| | | String url = ApexPages.currentPage().getParameters().put('00N10000008rdgs','北京'); |
| | | url = ApexPages.currentPage().getParameters().put('Name','RC修理'); |
| | | url = ApexPages.currentPage().getParameters().put('RecordType',recordTypeId); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(new Consum_Apply__c()); |
| | | NewConsumApplyController repDetail = new NewConsumApplyController(con); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewConsumApplyEquipSetDetailControlTest { |
| | | static testMethod void testMethod18() { |
| | | |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Consum_Apply_Equipment_Set_Detail__c consumDetailTest = TestDataUtility.CreateConsumApplyEquipmentSetDetail(1)[0]; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(consumDetailTest); |
| | | NewConsumApplyEquipSetDetailController consumDetail = new NewConsumApplyEquipSetDetailController(con); |
| | | |
| | | String consumDetailJson = '{"Inspection_result_after__c":"","Internal_asset_location_before__c":"","Salesdepartment_before__c":"","Consum_Apply__c":"a3i1m000000bT9k","Equipment_Type_text__c":"","Consum_Apply_Equipment_Set__c":"a3h100000005DiN","SerialNumber_text__c":"","Asset__c":"000000000000000","Canceled__c":"000000000000000","Loaner_accsessary__c":false,"FSD_Name_CHN__c":"","Qu_Xiao_Fen_Pei_Shu_Liang_Jia__c":"","Trial_User_Encrypt__c":"","Show_demonstration__c":"","Consum_Start_Date__c":"","Operation_Type__c":"","Trial_User__c":"","Case_OR_animal_organ__c":"","Spare__c":false,"Degree_Of_Importance__c":"","Comment__c":"","Select_Time__c":"","Shipment_request__c":false,"Shipment_request_time2__c":"","DeliverySlip__c":"000000000000000","Shippment_loaner_time__c":"","Received_Confirm__c":"","Received_NG_Content__c":"","Has_Picture__c":false,"Loaner_received_time__c":"","Asset_Center_Confirm__c":"","Asset_Center_Confirm_Time__c":"","Return_DeliverySlip__c":"000000000000000","Asset_return_time__c":"","Arrival_in_wh__c":false,"Arrival_wh_time__c":"","Cancel_Reason__c":"","Loaner_cancel_Remarks__c":"","Cancel_Date__c":"","Lost_item_check_time__c":"","Lost_item_check_time_Final__c":"","Name":"123","OnStock_By_Cancel__c":false,"ExpiredArrival__c":false,"WH_location__c":"","Yi_Zhi_Guo_Qi_Jia__c":"","Hui_Ji_Jia__c":"","Shang_Jia_Jia__c":"","Yi_Zhi_Bao_Fei_Jia__c":"","Inspection_Cnt_Jia__c":"","Yi_Fa_Huo_Jia__c":"","ManagementCode__c":"","Shipment_Saved_Flg__c":false,"EquipmentManagementCode__c":""}'; |
| | | NewConsumApplyEquipSetDetailController.saveConsumApply(consumDetailJson,'avgwshDFcxAS',False); |
| | | NewConsumApplyEquipSetDetailController.saveConsumApply(consumDetailJson,'avgwshDFcxAS',True); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /* |
| | | * Author: Guo, Aline Yaying |
| | | * Created Date: 03/22/2022 |
| | | * Purpose: Test Class |
| | | * History: |
| | | * 03/22/2022 - Guo, Aline Yaying - Initial Code. |
| | | * |
| | | * */ |
| | | @isTest |
| | | private class NewRepairControllerTest { |
| | | static testMethod void testMethod1() { |
| | | //1. 准备数据 |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Repair__c repTest = TestDataUtility.CreateRepairs(1)[0]; |
| | | //2. 运行代码逻辑 |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(repTest); |
| | | NewRepairController repDetail = new NewRepairController(con); |
| | | // Map<String,Object> mapTest = new Map<String,Object>(); |
| | | // mapTest.put('Contacts__c',repTest ); |
| | | String repJson = '{\"Repair_Shipped_DateTime__c\":\"\",\"Request_approval_day__c\":\"\",\"Discount_Price__c\":\"\",\"Source_QIS__c\":\"\",\"Old_Name__c\":\"\",\"Exc_work_location__c\":false,\"OTSRepairOrder__c\":\"\",\"Advance_Payment_Flag__c\":false,\"Delivered_Product__c\":\"02i10000004FhIt\",\"PaperRepairRequestNo__c\":\"\",\"Hospital__c\":\"000000000000000\",\"SAPRepairNo__c\":\"\",\"Department_Class__c\":\"000000000000000\",\"RepairOrderStatusCode__c\":\"\",\"Account__c\":\"0011000000VATK6\",\"RepairCostType__c\":\"无偿\",\"Dealer__c\":\"000000000000000\",\"RepairOrderStatusName__c\":\"\",\"Incharge_Staff__c\":\"000000000000000\",\"ReRepairObject_result__c\":false,\"Incharge_Staff_Contact__c\":\"000000000000000\",\"Repair_Rank__c\":\"\",\"SalesOfficeCode_selection__c\":\"北京\",\"Address_type__c\":\"\",\"On_site_repair__c\":\"RC修理\",\"Recall_Correspondence_Apply__c\":\"\",\"Returns_Product_way__c\":\"返送办事处\",\"ReturnType__c\":\"\",\"IfCheckFixture__c\":false,\"DW_Sign_Txt__c\":false,\"Repair_Detail__c\":\"test\",\"RepairApplicant__c\":\"\",\"RepairApplicantHospital__c\":\"\",\"RepairApplicantDepartment__c\":\"\",\"address_Contacts__c\":\"\",\"address_Telephone__c\":\"\",\"address_Contacts_Name__c\":\"\",\"address_City__c\":\"\",\"Detailed_Address__c\":\"\",\"address_ZipCode__c\":\"\",\"LogisticsLatestStatus__c\":\"\",\"LogisticsSendTime__c\":\"\",\"DeliveryLogisticsMode__c\":\"快递\",\"LogisticsReceiveTime__c\":\"\",\"DeliveryLogisticsNo__c\":\"\",\"engineerSendDate__c\":\"\",\"DeliveryLogisticsAnnotation__c\":\"\",\"ReturnOrderLatestStatus__c\":\"\",\"ReturnOrderSendTime__c\":\"\",\"ReturnOrderNo__c\":\"\",\"ReturnOrderReceiveTime__c\":\"\",\"ReturnLogisticsLatestStatus__c\":\"\",\"ReturnLogisticsDeliveryTime__c\":\"\",\"ReturnLogisticsNo__c\":\"\",\"ReturnLogisticsSigningTime__c\":\"\",\"DateReceiptQuestions__c\":\"2022/03/28\",\"BreakORFallOff__c\":\"\",\"DelayReportReason__c\":\"\",\"UseFailProductFinish__c\":\"\",\"ifDeadHurt__c\":\"\",\"SupportingProducts__c\":\"\",\"ProblemOccurred__c\":\"\",\"AfterFailureInformation__c\":\"\",\"ProblemOccurredSelect__c\":\"\",\"Delay15Min__c\":\"\",\"ProductFailureRelated__c\":\"\",\"InformationFrom__c\":\"\",\"ReportAdverseEvents__c\":\"\",\"FailureQInHospital__c\":\"\",\"WhatProject__c\":\"\",\"OperationOrExaminationName__c\":\"\",\"Maintenance_Contract__c\":\"000000000000000\",\"VM_Maintenance_Contract__c\":\"000000000000000\",\"MaintenanceContractType__c\":\"\",\"Repair_Quotation_Id__c\":\"000000000000000\",\"Repair_Estimation_Followed_By__c\":\"\",\"Repair_Estimation_Follow_Date__c\":\"\",\"Failure_Source__c\":\"\",\"InspectionResultFlag__c\":\"\",\"InspectionComment__c\":\"\",\"InspectionFailureCause__c\":\"\",\"Billing_Amount__c\":\"\",\"CurrentPeriodPaymentAmount__c\":\"\",\"Paid_Amount__c\":\"\",\"LastIssueCumulativePaybackAmount__c\":\"0.00\",\"hospitalQuotationText__c\":\"\",\"Receipt_category__c\":\"\",\"Received_money_day_finacial_dapt__c\":\"\",\"Request_yanshoudan_PDF__c\":false,\"Confirmed_Collect_money__c\":false,\"Confirmed_received_document__c\":false,\"Collect_money_check1__c\":\"\",\"Sheet_mating_staff1__c\":\"\",\"Receipt_comment__c\":\"\",\"Whether_collect_repair_money_or_not__c\":false,\"Collection_Status__c\":\"\",\"Forecast_Collection_Date__c\":\"\",\"Uncollect_fee_comment__c\":\"\",\"Repair_Collection_Followed_By__c\":\"\",\"BilltoPartyNoAccount__c\":\"\",\"Repair_Collection_Follow_Date__c\":\"\",\"Reason_cannot_collect_repair_fee__c\":\"\",\"Failure_Occurrence_Date__c\":\"2022/03/28\",\"Status__c\":\"草案中\",\"Failure_Occurrence_Date2__c\":\"\",\"Repair_Completed_Date__c\":\"\",\"RepairTime__c\":\"\",\"Repair_Final_Inspection_Date__c\":\"\",\"ReceiverTime__c\":\"\",\"Repair_Final_Inspection_DateTime__c\":\"\",\"PlannedVisitDay__c\":\"\",\"Repair_Shipped_Date__c\":\"\",\"ActualVisitDateFirst__c\":\"\",\"ActualVisitDateSecond__c\":\"\",\"ReturnOrderReceiveDate__c\":\"\",\"ActualVisitDateThird__c\":\"\",\"Repair_Returned_To_HP_Date__c\":\"\",\"SubOrderCompleteDate__c\":\"\",\"Facility_Return_Receipt_Collection_reque__c\":\"\",\"SubOrderCreatedDate__c\":\"\",\"Receipt_received_date__c\":\"\",\"On_Site_Repair_Order_Date__c\":\"\",\"Billing_Received_Date__c\":\"\",\"Send_To_RC_Date__c\":\"\",\"Received_Date__c\":\"\",\"Repair_Ordered_Date__c\":\"\",\"Facility_Return_Receipt_Collection_Date__c\":\"\",\"Repair_Ordered_DateTime__c\":\"\",\"repair_cancel_date__c\":\"\",\"Repair_Inspection_Date__c\":\"\",\"RepairOrder_Complete_Day__c\":\"\",\"Agreed_Date__c\":\"\",\"Repair_Firstestimated_Date__c\":\"\",\"RcSorcDate__c\":\"\",\"RcOgzDate__c\":\"\",\"SorcOgzDate__c\":\"\",\"SorcAcceptDate__c\":\"\",\"OgzAcceptDate__c\":\"\",\"part_arrangement_complete__c\":\"\",\"Repair_Start_Date__c\":\"\",\"Planned_Repair_Completed_Date__c\":\"\",\"Return_Without_Repair__c\":false,\"Return_Without_Repair_IF__c\":false,\"CancellationReason__c\":\"\",\"Return_Without_Repair_Request_Date__c\":\"\",\"Return_Without_Repair_Date__c\":\"\",\"IncorrectDataComment__c\":\"\",\"SAP_not_accept_repair_result__c\":\"\",\"Quotation_agree_cancel_date__c\":\"\",\"Repair_Source__c\":\"\",\"RepairSubOrder__c\":\"000000000000000\",\"On_Call_ID__c\":\"000000000000000\",\"QIS_ID__c\":\"000000000000000\",\"InsReport__c\":\"000000000000000\",\"ASReportedCode__c\":\"\",\"Repair_ConfirmationDate__c\":\"\",\"PAE_Determine__c\":\"\",\"Repair_Authenticator__c\":\"000000000000000\",\"Aware_date__c\":\"\",\"MBC_AwareDate__c\":\"\",\"OCSMAdministrativeReportDate__c\":\"\",\"OCSMAdministrativeReportStatus__c\":\"\",\"OCSMAdministrativeReportNumber__c\":\"\",\"ASReportedCodeAC__c\":\"\",\"OCSM_RC_CordingDate__c\":\"\",\"PAE_DetermineAC__c\":\"\",\"OCSM_RC_CordingUser__c\":\"000000000000000\",\"IISE_confirmed_person__c\":\"\",\"IISE_confirmed_day__c\":\"\",\"Complaint_Number__c\":\"\",\"OSH_ConfirmationDate__c\":\"\",\"if_Repair_Allowed__c\":\"\",\"OSH_Affirmant__c\":\"000000000000000\",\"NotAllowedReason__c\":\"\",\"OSHRAConfirmDate__c\":\"\",\"OSHRAConfirmUser__c\":\"000000000000000\",\"CFDA_No_Hand__c\":\"\",\"ProduceCompany_hand__c\":\"\",\"FSE_ApplyForRepair_time__c\":\"\",\"FSE_owner_Salesdepartment__c\":\"\",\"SAP_Transfer_time__c\":\"\",\"Repair_cost__c\":\"\",\"Service_contract_judege_day__c\":\"\",\"Repair_cost_date__c\":\"\",\"Invalid_check__c\":false,\"Offer_Rental_New__c\":false,\"Delete_Flag__c\":false,\"if_Rental_Apply__c\":false,\"NFM108_Receipt__c\":\"000000000000000\",\"NFM105_MessageGroupNumber__c\":\"\",\"Latest_Collect_Date_Priority__c\":\"\",\"Rental_Apply_Equipment_Set_Detail_Id__c\":\"\",\"Agreed_Date2__c\":\"\",\"Rental_Apply_Equipment_Set_Detail__c\":\"000000000000000\",\"Agreed_Date_Cancel__c\":\"\",\"TransferApplyDetail__c\":\"\",\"StatusUpdateTime__c\":\"\",\"TransferApplyDetail_Id__c\":\"\",\"AsyncData__c\":false,\"ETQ_UPLOAD_STATUS__c\":\"\",\"AWS_Interface_Time__c\":\"\",\"ETQ_UPLOAD_MESSAGE__c\":\"\",\"INTERFACE_RECORD_ID__c\":\"\",\"PAE_reappear_confirm__c\":\"\",\"OCSM_Manager_Mail_XB__c\":\"\",\"OCSM_Manager_Mail__c\":\"\",\"PAE_email__c\":\"\",\"Service_Assistant_Text__c\":\"\",\"AC_PAED__c\":\"\",\"RC_PAED__c\":\"\",\"work_location_select__c\":\"北京办事处\",\"Address_Contacts_Encrypt__c\":\"\",\"Address_Contacts_Name_Encrypt__c\":\"\",\"Address_Telephone_Encrypt__c\":\"\",\"Address_ZipCode_Encrypt__c\":\"\",\"Detailed_Address_Encrypt__c\":\"\",\"Repair_Applicant_Encrypt__c\":\"\",\"AWS_Data_Id__c\":\"958062858866786305\"}'; |
| | | //"Repair_Shipped_DateTime__c":"2022-03-28T09:33:31.955Z", |
| | | NewRepairController.saveRepair(repJson,'avgwshDFcxAS',True); |
| | | NewRepairController.saveRepair(repJson,'avgwshDFcxAS',False); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod2() { |
| | | String recordTypeId = Schema.SObjectType.Repair__c.getRecordTypeInfosByDeveloperName().get('Repair').getRecordTypeId(); |
| | | List<String> strList = new List<String>(); |
| | | strList.add('Repair__c'); |
| | | strList.add('Address__c'); |
| | | strList.add('Contact'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(strList); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | String url = ApexPages.currentPage().getParameters().put('00N10000006P6SM','北京'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000002FH86','RC修理'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000006P6Rn','北京办事处'); |
| | | url = ApexPages.currentPage().getParameters().put('RecordType',recordTypeId); |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(new Repair__c()); |
| | | NewRepairController repDetail = new NewRepairController(con); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | @isTest |
| | | private class OFSInsReportLayoutControllerTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Inspection_Report__c'); |
| | | } |
| | | public class TestRepo { |
| | | public final Integer ASSETMAX = 8; |
| | | public OFSInsReportLayout__c layout { get; private set; } |
| New file |
| | |
| | | @isTest |
| | | private class OnCallControllerTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('On_Call__c'); |
| | | |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId(); |
| | | hospital.Name = 'test hospital'; |
| | | insert hospital; |
| | | List<Account> strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_GI']; |
| | | Account dep = new Account(); |
| | | dep.recordtypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Department_GI').getRecordTypeId(); |
| | | dep.Name = 'test dep'; |
| | | dep.ParentId = strategicDep[0].Id; |
| | | dep.Department_Class__c = strategicDep[0].Id; |
| | | dep.Hospital__c = hospital.Id; |
| | | insert dep; |
| | | On_Call__c onCall = new On_Call__c(); |
| | | onCall.segment__c = dep.Id; |
| | | onCall.Hospital__c = hospital.Id; |
| | | onCall.AWS_Data_Id__c = '1234567890'; |
| | | insert onCall; |
| | | } |
| | | static testMethod void testMethod1() { |
| | | On_Call__c onCall = [SELECT Id FROM On_Call__c LIMIT 1]; |
| | | Map<String,Object> smap = new Map<String,Object>(); |
| | | smap.put('object',onCall); |
| | | String bodyJson = JSON.serialize(smap); |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(bodyJson,'OK','200')); |
| | | Test.startTest(); |
| | | ApexPages.StandardController sc = new ApexPages.StandardController(onCall); |
| | | OnCallController occ = new OnCallController(sc); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod2() { |
| | | Account acc = TestDataUtility.CreateAccounts(1)[0]; |
| | | Account pacc = [SELECT Id,Name,ParentId FROM Account WHERE Id =: acc.ParentId]; |
| | | Test.startTest(); |
| | | String onCallJson = '{"Status_c__c":"跟进中","segment__c":"'+acc.Id+'","OwnerId":"0050l000005fcnt","Responsible_Person_HP__c":"Test","Oncall_report_number_c__c":"Test","Caller_phone__c":"186435431212","Hospital__c":"'+pacc.ParentId+'","Trable_occur_day_c__c":"2022/03/24 10:45","Taking_call_Time_c__c":"2022/03/24 10:45","First_ploblem_c__c":"","From_c__c":"","To_c__c":"","Oncall_Equipment__c":"000000000000000","Oncall_Product_manual__c":"","Customer_Problem_c__c":"","FinishDataTime__c":"","Customer_sigh_c__c":false,"Customer_sigh_day_c__c":"","AWS_Data_Id__c":"1234567890"}'; |
| | | OnCallController.saveOnCall(onCallJson,'1adf234dafa',true); |
| | | OnCallController.saveOnCall(onCallJson,'1adf234dafa',false); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | insert traLog; |
| | | } |
| | | // confirm tx transaction |
| | | |
| | | public static void confirmTrans(String module,Integer isSuccess, String sfRecordId ,String transId ,String token,String transUrl,List<idList> idList){ |
| | | @future(callout =true) |
| | | public static void confirmTrans(String module,Integer isSuccess, String sfRecordId ,String transId ,String token,String transUrl,String idList){ |
| | | Boolean result =false; |
| | | Transaction_Log__c traLog = new Transaction_Log__c(); |
| | | traLog.Module__c = 'Confirm Transaction '+module; |
| | |
| | | TransactionRequestBody requestBody =new TransactionRequestBody(); |
| | | requestBody.isSuccess=isSuccess; |
| | | requestBody.sfRecordId=sfRecordId; |
| | | requestBody.idList=idList; |
| | | // requestBody.idList=idList; |
| | | requestBody.idList=(List < idList >)JSON.deserialize(idList,List < idList > .class); |
| | | requestBody.txId =transId; |
| | | request.setBody(JSON.serialize(requestBody)); |
| | | traLog.Request__c =JSON.serialize(requestBody); |
| | | system.debug('request---'+request.tostring()); |
| | | HttpResponse response = http.send(request); |
| | | system.debug('confirm result--'+response.getBody()); |
| New file |
| | |
| | | @isTest |
| | | private class PIHelperTest { |
| | | static testMethod void getPIIntegrationInfo() { |
| | | TestDataUtility.CreatePIPolicyConfiguration('Contact'); |
| | | String sobjectType = 'Contact'; |
| | | List<AWS_Integration_Info__mdt> awsConfigurationList = [SELECT App_Id__c,Max_Query_Number__c,Token_URL__c,App_Secret__c,Host_URL__c FROM AWS_Integration_Info__mdt WHERE DeveloperName = 'AWS_Default_Configuration']; |
| | | Test.startTest(); |
| | | PIHelper.getPIIntegrationInfo(sobjectType); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void saveTransLog() { |
| | | Test.startTest(); |
| | | PIHelper.saveTransLog('module','vadsjngrqvjca','avgwshDFcxAS', 'DSAGSFBQdfdsoav','test','0','testmsg'); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void confirmTrans() { |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreatePIHelperHttpMock()); |
| | | Test.startTest(); |
| | | List<PIHelper.idList> idList = new List<PIHelper.idList>(); |
| | | PIHelper.idList pid = new PIHelper.idList(); |
| | | pid.awsId = 'vadsjngrqvjca'; |
| | | pid.sfRecordId = 'avgwshDFcxAS'; |
| | | idList.add(pid); |
| | | PIHelper.confirmTrans('module',1,'vadsjngrqvjca' ,'avgwshDFcxAS' ,'DSAGSFBQdfdsoav','https://sfpi-mebg-test.olympuschina.com/api/contact/insert',idList); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void confirmFileTrans() { |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreatePIHelperHttpMock()); |
| | | Test.startTest(); |
| | | PIHelper.confirmFileTrans('module',1,'vadsjngrqvjca' ,'avgwshDFcxAS','DSAGSFBQdfdsoav','https://sfpi-mebg-test.olympuschina.com/api/contact/insert'); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void insertConfirmTrans() { |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreatePIHelperHttpMock()); |
| | | Test.startTest(); |
| | | List<PIHelper.idList> idList = new List<PIHelper.idList>(); |
| | | PIHelper.idList pid = new PIHelper.idList(); |
| | | pid.awsId = 'vadsjngrqvjca'; |
| | | pid.sfRecordId = 'avgwshDFcxAS'; |
| | | idList.add(pid); |
| | | PIHelper.insertConfirmTrans('module',1,'vadsjngrqvjca' ,'avgwshDFcxAS' ,0,'https://sfpi-mebg-test.olympuschina.com/api/contact/insert',idList); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | */ |
| | | @isTest |
| | | private class QISPDFControllerTest { |
| | | |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('QIS_Report__c'); |
| | | } |
| | | static testMethod void myUnitTest() { |
| | | QIS_Report__c q = new QIS_Report__c(); |
| | | q.RC__c = UserInfo.getUserId(); |
| New file |
| | |
| | | @isTest |
| | | private class RentalApplyControllerTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | List<String> sobjList = new List<String>(); |
| | | sobjList.add('Rental_Apply__c'); |
| | | sobjList.add('Contact'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(sobjList); |
| | | |
| | | |
| | | } |
| | | static testMethod void testMethod1() { |
| | | |
| | | |
| | | String userMode = 'classic';//classic lightning |
| | | String objectType = 'Contact'; |
| | | String recordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Doctor').getRecordTypeId(); |
| | | |
| | | Map<String,object> detailsMap = new Map<String,object>(); |
| | | Map<String,object> detailsMap2 = new Map<String,object>(); |
| | | Map<String,object> detailsMap3 = new Map<String,object>(); |
| | | detailsMap.put('calculated',true); |
| | | detailsMap.put('autoNumber',false); |
| | | detailsMap.put('type','address'); |
| | | detailsMap2.put('calculated',false); |
| | | detailsMap2.put('autoNumber',false); |
| | | detailsMap2.put('type','repair'); |
| | | detailsMap3.put('calculated',false); |
| | | detailsMap3.put('autoNumber',false); |
| | | detailsMap3.put('type','repair'); |
| | | |
| | | List<Map<String, object>> componentMapList = new List<Map<String, object>>(); |
| | | List<Map<String, object>> componentMapList2 = new List<Map<String, object>>(); |
| | | List<Map<String, object>> componentMapList3 = new List<Map<String, object>>(); |
| | | Map<String, object> componentMap = new Map<String, object>(); |
| | | Map<String, object> componentMap2 = new Map<String, object>(); |
| | | Map<String, object> componentMap3 = new Map<String, object>(); |
| | | componentMap.put('value','Name'); |
| | | componentMap.put('type','Field'); |
| | | componentMap.put('details',detailsMap); |
| | | componentMapList.add(componentMap); |
| | | componentMap2.put('value','Name'); |
| | | componentMap2.put('type','Field'); |
| | | componentMap2.put('details',detailsMap2); |
| | | componentMapList2.add(componentMap2); |
| | | componentMap3.put('value','LastName'); |
| | | componentMap3.put('type','Field'); |
| | | componentMap3.put('details',detailsMap3); |
| | | componentMapList3.add(componentMap3); |
| | | |
| | | List<Map<String, object>> layoutComponentsList = new List<Map<String, object>>(); |
| | | Map<String, object> layoutComponents = new Map<String, object>(); |
| | | layoutComponents.put('layoutComponents',componentMapList); |
| | | layoutComponents.put('label','Address'); |
| | | layoutComponents.put('placeholder',true); |
| | | layoutComponents.put('editableForNew',true); |
| | | layoutComponents.put('required',false); |
| | | layoutComponentsList.add(layoutComponents); |
| | | Map<String, object> layoutComponents2 = new Map<String, object>(); |
| | | layoutComponents2.put('layoutComponents',componentMapList2); |
| | | layoutComponents2.put('label','Repair'); |
| | | layoutComponents2.put('placeholder',true); |
| | | layoutComponents2.put('editableForNew',true); |
| | | layoutComponents2.put('required',false); |
| | | layoutComponentsList.add(layoutComponents2); |
| | | Map<String, object> layoutComponents3 = new Map<String, object>(); |
| | | layoutComponents3.put('layoutComponents',componentMapList3); |
| | | layoutComponents3.put('label','Repair'); |
| | | layoutComponents3.put('placeholder',true); |
| | | layoutComponents3.put('editableForNew',true); |
| | | layoutComponents3.put('required',false); |
| | | layoutComponentsList.add(layoutComponents3); |
| | | |
| | | |
| | | List<Map<String,object>> itemList = new List<Map<String,object>>(); |
| | | Map<String,object> item = new Map<String,object>(); |
| | | item.put('layoutItems',layoutComponentsList); |
| | | itemList.add(item); |
| | | |
| | | List<Map<String,object>> sectionList = new List<Map<String,object>>(); |
| | | Map<String,object> section = new Map<String,object>(); |
| | | section.put('heading',''); |
| | | section.put('useHeading',true); |
| | | section.put('columns',1); |
| | | section.put('useCollapsibleSection',true); |
| | | section.put('layoutRows',itemList); |
| | | sectionList.add(section); |
| | | |
| | | Map<String, Object> layoutSection = new Map<String,Object>(); |
| | | layoutSection.put('layouts','123'); |
| | | layoutSection.put('editLayoutSections',sectionList); |
| | | String layoutSectionJson = JSON.serialize(layoutSection); |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(layoutSectionJson,'OK','200')); |
| | | |
| | | Test.startTest(); |
| | | |
| | | String url = ApexPages.currentPage().getParameters().put('Name','test'); |
| | | url = ApexPages.currentPage().getParameters().put('Name','test'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000008ps61_lkid','test'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000003Mp1d_lkid','test'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000003O3V6_lkid','test'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000003Mp2R_lkid','test'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000003Msk0','test'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000003Msk5','test'); |
| | | url = ApexPages.currentPage().getParameters().put('00N100000098amW','test'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000003OJzc','test'); |
| | | ApexPages.StandardController scc = new ApexPages.StandardController(new Rental_Apply__c()); |
| | | RentalApplyController racc = new RentalApplyController(scc); |
| | | |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod2() { |
| | | |
| | | String raJson = '{\"HP_received_sign_rich__c\":\"\",\"Name\":\"123456\",\"OPDPlan__c\":\"000000000000000\",\"GI_Diff__c\":\"\",\"Add_Approval_Status__c\":\"\",\"ApplyPerson_Phone__c\":\"\",\"Person_In_Charge__c\":\"0050l000005vPbu\",\"Loaner_centre_mail_address__c\":\"\",\"applyUser__c\":\"0050l000005vPbu\",\"Cross_Region_Assign__c\":\"\",\"Priority_Inspect__c\":false,\"SalesdeptSelect__c\":\"医疗东北营业本部\",\"RecordTypeId\":\"01210000000RHIi\",\"Zsq_Rental_Apply__c\":\"000000000000000\",\"Asset_return_time_OK__c\":\"\",\"Hospital__c\":\"0010l00001PQFkh\",\"Loaner_medical_Staff__c\":\"0030l00000mFW7G\",\"Strategic_dept__c\":\"0010l00001PQFkh\",\"Phone_number__c\":\"***********\",\"Account__c\":\"0010l00001PQFkh\",\"Demo_purpose1__c\":\"产品试用\",\"Repair__c\":\"000000000000000\",\"NoOpp_Reason__c\":\"\",\"Product_category__c\":\"GI\",\"Follow_UP_Opp__c\":\"000000000000000\",\"Campaign__c\":\"000000000000000\",\"Follow_pcl_status2_Text__c\":\"\",\"QIS_number__c\":\"000000000000000\",\"Statu_Achievements__c\":\"000000000000000\",\"QISRepair__c\":\"000000000000000\",\"CrinicalTrialName__c\":\"\",\"DB_loaner_request__c\":\"\",\"IsJump__c\":false,\"AgreementBorrowingExtensionDate__c\":\"\",\"JumpCause__c\":\"\",\"NewRepair__c\":\"000000000000000\",\"IsJump_Rental__c\":false,\"JumpCause_Rental__c\":\"\",\"JumpDate_Rental__c\":\"\",\"Demo_purpose_text__c\":\"dfasvq\",\"Hope_Lonaer_date_Num__c\":\"3\",\"Request_return_day__c\":\"2022/03/27\",\"Shipment_address__c\":\"000000000000000\",\"direct_send__c\":\"上门自提\",\"Dealer__c\":\"000000000000000\",\"pickup_time__c\":\"2022/03/24 17:44\",\"Loaner_received_staff__c\":\"test\",\"Loaner_received_staff_phone__c\":\"1234567890\",\"direct_shippment_address__c\":\"**********\",\"Post_Code__c\":\"12345-123\",\"Old_Rental_Apply__c\":\"000000000000000\",\"Split_Apply_Reason__c\":\"\",\"HP_received_sign_day__c\":\"\",\"HP_received_sign_NG__c\":false,\"HP_received_sign_NG_Reason__c\":\"\",\"AssetManageConfirm__c\":false,\"Cancel_Reason__c\":\"\",\"Loaner_cancel_request__c\":\"\",\"Cancel_time__c\":\"\",\"HP_received_sign_NewDate__c\":\"\",\"Rental_Received_Day__c\":\"\",\"Add_Request_demo_time__c\":\"\",\"Add_Request_approval_time__c\":\"\",\"ExtensionStatus__c\":\"\",\"ExtensionSuccessTimes__c\":\"\",\"ExtensionApplicationTime_Initial__c\":\"\",\"ExtensionApprovalTime_Initial__c\":\"\",\"ExtensionApplicationTime_Final__c\":\"\",\"ExtensionApprovalTime_Final__c\":\"\",\"Repair_Final_Inspection_Date__c\":\"\",\"All_Delivery_Flag_c__c\":false,\"Request_demo_time__c\":\"\",\"Request_approval_time__c\":\"\",\"Application_accept_time__c\":\"\",\"Request_answer_time__c\":\"\",\"HP_City__c\":\"Abejones\",\"OwnerId\":\"0050l000005vPbu\",\"OPD__c\":\"000000000000000\",\"OPDAmount__c\":\"\",\"IsOPD_Account__c\":\"\",\"OriginalOpdPlanApplication__c\":\"\",\"demo_purpose2__c\":\"试用(无询价)\",\"ToAgency__c\":\"大连\",\"Loaner_cancel_reason__c\":\"_\\u0001_\",\"Phone_Number_Encrypt__c\":\"415f2dab7eb6b2a866e02d823080a845\",\"Direct_Shippment_Address_Encrypt__c\":\"2df1bc4bf3800c5e05e3d9f394c3446567d1f05482d2295650b7b50e9e4aa97a92338985c9693f576e1e6df667aaee46\",\"AWS_Data_Id__c\":\"956621521466425345\"}'; |
| | | // Map<String,Object> fieldValueMap = (Map<String,Object>)JSON.deserializeStrict(raJson, Map<String,Object>.class); |
| | | |
| | | // Map<String,Object> fieldValueMap = (Map<String,Object>)JSON.deserializeUntyped(raJson); |
| | | // Rental_Apply__c rentalApplyInfo = new Rental_Apply__c(); |
| | | |
| | | // Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | | // Schema.SObjectType rentalApplySchema = schemaMap.get('Rental_Apply__c'); |
| | | // Map<String, Schema.SObjectField> fieldAPIToTypeMap = rentalApplySchema.getDescribe().fields.getMap(); |
| | | // for(String fieldAPI :fieldValueMap.keySet()){ |
| | | // Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | // String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | // if(String.isBlank(fieldValue)){ |
| | | // continue; |
| | | // } |
| | | // if(String.valueOf(fielddataType)=='DATE'){ |
| | | // System.debug('DATE fieldAPI = '+fieldAPI+' filedData = '+String.valueOf(fieldValueMap.get(fieldAPI))); |
| | | // // rentalApplyInfo.put(fieldAPI, Date.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)).replace('/', '-'))); |
| | | // rentalApplyInfo.put(fieldAPI,(String.isBlank(fieldValue)||String.isEmpty(fieldValue))? null:Date.valueOf(fieldValue.replace('/', '-'))); |
| | | // }else if(String.valueOf(fielddataType)=='DATETIME'){ |
| | | // String dt = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | // if(String.isNotBlank(dt)&&dt.contains('T')){ |
| | | // dt = dt.replace('T',' '); |
| | | // rentalApplyInfo.put(fieldAPI, Datetime.valueOfGmt(dt)); |
| | | // }else if(String.isNotBlank(dt)) { |
| | | // //rentalApplyInfo.put(fieldAPI, Datetime.valueOf(dt)); |
| | | // dt = dt.replace('/', '-') + ':00'; |
| | | // System.debug('dt = ' + dt); |
| | | // rentalApplyInfo.put(fieldAPI, Datetime.valueOf(dt)); |
| | | // }else{ |
| | | // rentalApplyInfo.put(fieldAPI, null); |
| | | // } |
| | | // }else if(String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | // rentalApplyInfo.put(fieldAPI, Decimal.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)))); |
| | | // } else if(String.valueof(fielddataType)=='BOOLEAN'){ |
| | | // rentalApplyInfo.put(fieldAPI, fieldValueMap.get(fieldAPI)); |
| | | // }else { |
| | | // rentalApplyInfo.put(fieldAPI, String.valueOf(fieldValueMap.get(fieldAPI))); |
| | | // } |
| | | // } |
| | | // insert rentalApplyInfo; |
| | | |
| | | Test.startTest(); |
| | | RentalApplyController.saveRentalApply(raJson,'savdqerva',true); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod3() { |
| | | |
| | | Rental_Apply__c ra = TestDataUtility.CreateRentalApplys(1)[0]; |
| | | String raJson = JSON.serialize(ra); |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Test.startTest(); |
| | | System.debug('ra--------'+ra); |
| | | ApexPages.StandardController sc = new ApexPages.StandardController(ra); |
| | | RentalApplyController rac = new RentalApplyController(sc); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod4() { |
| | | Rental_Apply__c ra = TestDataUtility.CreateRentalApplys(1)[0]; |
| | | String raJson = '{\"HP_received_sign_rich__c\":\"\",\"Name\":\"123456\",\"OPDPlan__c\":\"000000000000000\",\"GI_Diff__c\":\"\",\"Add_Approval_Status__c\":\"\",\"ApplyPerson_Phone__c\":\"\",\"Person_In_Charge__c\":\"0050l000005vPbu\",\"Loaner_centre_mail_address__c\":\"\",\"applyUser__c\":\"0050l000005vPbu\",\"Cross_Region_Assign__c\":\"\",\"Priority_Inspect__c\":false,\"SalesdeptSelect__c\":\"医疗东北营业本部\",\"RecordTypeId\":\"01210000000RHIi\",\"Zsq_Rental_Apply__c\":\"000000000000000\",\"Asset_return_time_OK__c\":\"\",\"Hospital__c\":\"0010l00001PQFkh\",\"Loaner_medical_Staff__c\":\"0030l00000mFW7G\",\"Strategic_dept__c\":\"0010l00001PQFkh\",\"Phone_number__c\":\"***********\",\"Account__c\":\"0010l00001PQFkh\",\"Demo_purpose1__c\":\"产品试用\",\"Repair__c\":\"000000000000000\",\"NoOpp_Reason__c\":\"\",\"Product_category__c\":\"GI\",\"Follow_UP_Opp__c\":\"000000000000000\",\"Campaign__c\":\"000000000000000\",\"Follow_pcl_status2_Text__c\":\"\",\"QIS_number__c\":\"000000000000000\",\"Statu_Achievements__c\":\"000000000000000\",\"QISRepair__c\":\"000000000000000\",\"CrinicalTrialName__c\":\"\",\"DB_loaner_request__c\":\"\",\"IsJump__c\":false,\"AgreementBorrowingExtensionDate__c\":\"\",\"JumpCause__c\":\"\",\"NewRepair__c\":\"000000000000000\",\"IsJump_Rental__c\":false,\"JumpCause_Rental__c\":\"\",\"JumpDate_Rental__c\":\"\",\"Demo_purpose_text__c\":\"dfasvq\",\"Hope_Lonaer_date_Num__c\":\"3\",\"Request_return_day__c\":\"2022/03/27\",\"Shipment_address__c\":\"000000000000000\",\"direct_send__c\":\"上门自提\",\"Dealer__c\":\"000000000000000\",\"pickup_time__c\":\"2022/03/24 17:44\",\"Loaner_received_staff__c\":\"test\",\"Loaner_received_staff_phone__c\":\"1234567890\",\"direct_shippment_address__c\":\"**********\",\"Post_Code__c\":\"12345-123\",\"Old_Rental_Apply__c\":\"000000000000000\",\"Split_Apply_Reason__c\":\"\",\"HP_received_sign_day__c\":\"\",\"HP_received_sign_NG__c\":false,\"HP_received_sign_NG_Reason__c\":\"\",\"AssetManageConfirm__c\":false,\"Cancel_Reason__c\":\"\",\"Loaner_cancel_request__c\":\"\",\"Cancel_time__c\":\"\",\"HP_received_sign_NewDate__c\":\"\",\"Rental_Received_Day__c\":\"\",\"Add_Request_demo_time__c\":\"\",\"Add_Request_approval_time__c\":\"\",\"ExtensionStatus__c\":\"\",\"ExtensionSuccessTimes__c\":\"\",\"ExtensionApplicationTime_Initial__c\":\"\",\"ExtensionApprovalTime_Initial__c\":\"\",\"ExtensionApplicationTime_Final__c\":\"\",\"ExtensionApprovalTime_Final__c\":\"\",\"Repair_Final_Inspection_Date__c\":\"\",\"All_Delivery_Flag_c__c\":false,\"Request_demo_time__c\":\"\",\"Request_approval_time__c\":\"\",\"Application_accept_time__c\":\"\",\"Request_answer_time__c\":\"\",\"HP_City__c\":\"Abejones\",\"OwnerId\":\"0050l000005vPbu\",\"OPD__c\":\"000000000000000\",\"OPDAmount__c\":\"\",\"IsOPD_Account__c\":\"\",\"OriginalOpdPlanApplication__c\":\"\",\"demo_purpose2__c\":\"试用(无询价)\",\"ToAgency__c\":\"大连\",\"Loaner_cancel_reason__c\":\"_\\u0001_\",\"Phone_Number_Encrypt__c\":\"415f2dab7eb6b2a866e02d823080a845\",\"Direct_Shippment_Address_Encrypt__c\":\"2df1bc4bf3800c5e05e3d9f394c3446567d1f05482d2295650b7b50e9e4aa97a92338985c9693f576e1e6df667aaee46\",\"AWS_Data_Id__c\":\"'+ra.AWS_Data_Id__c+'\"}'; |
| | | System.debug('ra.AWS_Data_Id__c------'+ra.AWS_Data_Id__c); |
| | | Test.startTest(); |
| | | RentalApplyController.saveRentalApply(raJson,'savdqerva',false); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | @isTest |
| | | private class SLAReportDetailsControllerTest { |
| | | |
| | | @testSetup |
| | | static void setUp(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations( new string[]{'Contact'}); |
| | | } |
| | | |
| | | //有报告书 |
| | | static testMethod void testMethod1() { |
| | | |
| | |
| | | Daily_Report__c dr3 = new Daily_Report__c(); |
| | | dr3.Reporter__c = UserInfo.getUserId(); |
| | | dr3.Reported_Date__c = Date.today().addDays(4); |
| | | dr3.Status__c = '申請中'; |
| | | dr3.Status__c = '作成中'; |
| | | insert dr3; |
| | | |
| | | Event__c event = new Event__c(); |
| | |
| | | Daily_Report__c dr3 = new Daily_Report__c(); |
| | | dr3.Reporter__c = UserInfo.getUserId(); |
| | | dr3.Reported_Date__c = Date.today().addDays(4); |
| | | dr3.Status__c = '申請中'; |
| | | dr3.Status__c = '作成中'; |
| | | insert dr3; |
| | | |
| | | Event__c event = new Event__c(); |
| | |
| | | Daily_Report__c dr3 = new Daily_Report__c(); |
| | | dr3.Reporter__c = UserInfo.getUserId(); |
| | | dr3.Reported_Date__c = Date.today().addDays(4); |
| | | dr3.Status__c = '申請中'; |
| | | dr3.Status__c = '作成中'; |
| | | insert dr3; |
| | | |
| | | Event__c event = new Event__c(); |
| New file |
| | |
| | | @isTest |
| | | private class SObjectHelperTest { |
| | | static testMethod void testMethod1() { |
| | | List<Account> accList = TestDataUtility.CreateAccounts(2); |
| | | |
| | | Test.startTest(); |
| | | SObjectHelper.MergeValue(accList[0],accList[1]); |
| | | SObjectHelper.OverwriteValue(accList[0],accList[1]); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod2() { |
| | | |
| | | Test.startTest(); |
| | | SObjectHelper.GetFieldMap('Account'); |
| | | SObjectHelper.GetFieldInfos('Account'); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod3() { |
| | | |
| | | Test.startTest(); |
| | | SObjectHelper.GetFieldSet('Account','Name'); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod4() { |
| | | |
| | | Test.startTest(); |
| | | SObjectHelper.GetPicklistLabelValueMap('Account','Name'); |
| | | SObjectHelper.GetPicklistValueLabelMap('Account','Name'); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod5() { |
| | | |
| | | Test.startTest(); |
| | | SObjectHelper.GetFieldDescription('Account','Name'); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod6() { |
| | | List<Account> accList = TestDataUtility.CreateAccounts(2); |
| | | Test.startTest(); |
| | | SObjectHelper.GetSObjectField(accList[0],'RecordTypeId'); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod7() { |
| | | List<Account> accList = TestDataUtility.CreateAccounts(2); |
| | | Test.startTest(); |
| | | SObjectHelper.GetMultiPickListOptions('a;b;c;d;e'); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | conList = new List<Contact>(); |
| | | }else{ |
| | | if(checkNullString(accountId)){ |
| | | conList = new List<Contact>([select Id,AWS_Data_Id__c,Account.Name from Contact where AWS_Data_Id__c!='']); |
| | | conList = new List<Contact>(); |
| | | }else { |
| | | conList = new List<Contact>([select Id,AWS_Data_Id__c,Account.Name from Contact where AccountId=:accountId and AWS_Data_Id__c!='']); |
| | | } |
| New file |
| | |
| | | @isTest |
| | | private class SearchContactControllerTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | |
| | | } |
| | | static testMethod void testMethod1() { |
| | | TestDataUtility.CreatePIPolicyConfiguration('Contact'); |
| | | Contact con = TestDataUtility.CreateContacts(1)[0]; |
| | | con.AWS_Data_Id__c = 'davdsvgrqcx'; |
| | | con.RecordTypeId = '01210000000QfWiAAK'; |
| | | update con; |
| | | List<String> awsList = new List<String>(); |
| | | awsList.add(con.AWS_Data_Id__c); |
| | | String awsListJson = JSON.serialize(awsList); |
| | | |
| | | String url = ApexPages.currentPage().getParameters().put('accountId',con.AccountId); |
| | | Test.startTest(); |
| | | SearchContactController scc = new SearchContactController(); |
| | | SearchContactController.searchContactsNoPI(con.Name); |
| | | SearchContactController.searchContacts(awsListJson,con.Name,con.AccountId); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class SearchLeadControllerTest { |
| | | static testMethod void testMethod1() { |
| | | TestDataUtility.CreatePIPolicyConfiguration('Lead'); |
| | | // Lead ld = TestDataUtility.CreateLead(1)[0]; |
| | | Lead ld = new Lead(); |
| | | ld.LastName = 'test'; |
| | | ld.Email = 'test@olympus.com'; |
| | | ld.company = 'TestCompany'; |
| | | ld.AWS_Data_Id__c = 'vjmpmwevkdmqwv'; |
| | | insert ld; |
| | | |
| | | // update ld; |
| | | List<String> awsList = new List<String>(); |
| | | awsList.add(ld.AWS_Data_Id__c); |
| | | String awsListJson = JSON.serialize(awsList); |
| | | |
| | | Test.startTest(); |
| | | SearchLeadController slc = new SearchLeadController(); |
| | | SearchLeadController.searchLeads(awsListJson); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | //Add By Li Jun for PIPL 20220217 Start |
| | | //1. Query Contact by accountId |
| | | List<Contact> conList = new List<Contact>(); |
| | | List<Account> departmentClass = new List<Account>(); |
| | | system.debug('Account Id from Front-end:'+a.Id); |
| | | String accountId = a.Id; |
| | | PIHelper.PIIntegration contactPIIntegration = PIHelper.getPIIntegrationInfo('Contact'); |
| | | if(String.isNotBlank(accountId) && String.isNotEmpty(accountId)){ |
| | | conList = new List<Contact>([select Id,AWS_Data_Id__c from Contact where AccountId=:accountId and AWS_Data_Id__c!='' limit :contactPIIntegration.maxQueryNumber]); |
| | | departmentClass = [select Department_Class__c from Account where id =:accountId]; |
| | | if(departmentClass.size() > 0){ |
| | | conList = new List<Contact>([select Id,AWS_Data_Id__c from Contact where Strategic_dept_Class__c=:departmentClass[0].Department_Class__c and AWS_Data_Id__c!='' limit :contactPIIntegration.maxQueryNumber]); |
| | | } |
| | | //conList = new List<Contact>([select Id,AWS_Data_Id__c from Contact where AccountId=:accountId and AWS_Data_Id__c!='' limit :contactPIIntegration.maxQueryNumber]); |
| | | } |
| | | //2. Prepare the Contact Info |
| | | List<String> conAWSIds = new List<String>(); |
| | |
| | | |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try{ |
| | | system.debug('rc = ' + rc); |
| | | upsert rc; |
| | | sfContactId = rc.Id; |
| | | }catch(Exception io){ |
| | |
| | | /** |
| | | * 初期処理. |
| | | */ |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Contact'); |
| | | } |
| | | private static void init() { |
| | | loginId = UserInfo.getUserId(); |
| | | |
| | |
| | | con1.FirstName = 'zz1'; |
| | | con1.RecordTypeId = rtDoc.id; |
| | | con1.AccountId = accDep.id; |
| | | con1.AWS_Data_Id__c = '1231'; |
| | | // con1.State__c = '北京市'; |
| | | con2 = new Contact(); |
| | | con2.FirstName = 'zz2'; |
| | | con2.LastName = '取引先責任者2'; |
| | | con2.RecordTypeId = rtDoc.id; |
| | | con2.AccountId = accDep.id; |
| | | con2.AWS_Data_Id__c = '1232'; |
| | | // con2.State__c = '北京市'; |
| | | con3 = new Contact(); |
| | | con3.FirstName = 'zz3'; |
| | | con3.LastName = '取引先責任者3'; |
| | | con3.RecordTypeId = rtDoc.id; |
| | | con3.AccountId = accDep.id; |
| | | con3.AWS_Data_Id__c = '1233'; |
| | | // con3.State__c = '北京市'; |
| | | con4 = new Contact(); |
| | | con4.FirstName = 'zz4'; |
| | | con4.LastName = '取引先責任者4'; |
| | | con4.RecordTypeId = rtDoc.id; |
| | | con4.AccountId = accDep.id; |
| | | con4.AWS_Data_Id__c = '1234'; |
| | | // con4.State__c = '北京市'; |
| | | con5 = new Contact(); |
| | | con5.FirstName = 'zz5'; |
| | | con5.LastName = '取引先責任者5'; |
| | | con5.RecordTypeId = rtDoc.id; |
| | | con5.AccountId = accDep.id; |
| | | con5.AWS_Data_Id__c = '1235'; |
| | | // con5.State__c = '北京市'; |
| | | conList.add(con1); |
| | | conList.add(con2); |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | //20201123 zh 创建主动任务与维修合同关联 end |
| | | if (LoginUser.Job_Category__c.equals('销售推广')) { |
| | | if (this.targetEvent.Activity_Type2__c == '病院') { |
| | | |
| | | // 2021-06-11 mzy sla 注释掉了询价3 因为现在的页面没有给询价3赋值,所以会显示 询价3不等于空字符串而是等于null ,导致后面的判断进不去 |
| | | // if (this.targetEvent.Related_Opportunity1__c != '' || this.targetEvent.Related_Opportunity2__c != '' || this.targetEvent.Related_Opportunity3__c != '') { |
| | | System.debug('测试询价任务:' +'询价1:' +this.targetEvent.Related_Opportunity1__c +'---询价2:'+this.targetEvent.Related_Opportunity2__c); |
| | |
| | | taskAccType = '用户拜访'; |
| | | } |
| | | if (this.targetEvent.Activity_Type2__c == '販売店') { |
| | | taskAccType = '经销商支持'; |
| | | taskAccType = '经销商拜访'; |
| | | } |
| | | if (this.targetEvent.Activity_Type2__c == '社外イベント') { |
| | | taskAccType = '学术会议'; |
| | |
| | | taskAccType = '用户拜访'; |
| | | } |
| | | if (this.targetEvent.Activity_Type2__c == '販売店') { |
| | | taskAccType = '经销商支持'; |
| | | taskAccType = '经销商拜访'; |
| | | } |
| | | if (this.targetEvent.Activity_Type2__c == '社外イベント') { |
| | | taskAccType = '学术会议'; |
| | |
| | | @isTest |
| | | private class SimpleEventRegisterControllerTester { |
| | | |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Contact'); |
| | | } |
| | | static testMethod void myUnitTest01() { |
| | | |
| | | Event insertTarget = new Event(); |
| New file |
| | |
| | | @isTest |
| | | private class SoqlHelperTest { |
| | | static testMethod void testMethod1() { |
| | | String sql = 'SELECT Id,Name FROM Contact WHERE Name != null Limit 1'; |
| | | Account accupdate = TestDataUtility.CreateAccounts(1)[0]; |
| | | accupdate.Name = 'update1'; |
| | | List<Account> updateAccList = new List<Account>(); |
| | | |
| | | Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; |
| | | User hpOwner = new User(Test_staff__c = true, LastName = 'TestUserA', FirstName = 'owner', Alias = 'hp', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | List<User> userList = new List<User>(); |
| | | |
| | | userList.add(hpOwner); |
| | | |
| | | Contact con = TestDataUtility.CreateContacts(1)[0]; |
| | | List<String> conidList = new List<String>(); |
| | | conidList.add(con.Id); |
| | | |
| | | Set<String> strSet = new Set<String>(); |
| | | strSet.add('test1'); |
| | | strSet.add('test2'); |
| | | Test.startTest(); |
| | | //ToInCondition |
| | | //UpsertList |
| | | SoqlHelper.ToInCondition(strSet); |
| | | SoqlHelper.DistinctQueryFields(sql); |
| | | SoqlHelper.WId(sql); |
| | | SoqlHelper.InsertList(userList); |
| | | SoqlHelper.UpdateList(updateAccList); |
| | | SoqlHelper.DeleteList(updateAccList); |
| | | SoqlHelper.DeleteListAsync(conidList); |
| | | Test.stopTest(); |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | static final String RC_SENRYAKUKASHITSUBUNRUI = '戦略科室分類 消化科'; |
| | | static final String RC_BYOUIN = '病院'; |
| | | static final String RC_SHINRYOUKA = '診療科 消化科'; |
| | | |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Contact'); |
| | | } |
| | | /** 初期処理 */ |
| | | static testMethod void testInit() { |
| | | StartTradingController st = new StartTradingController(null); |
| | |
| | | public String tableDataStr{ get; set; } |
| | | public String staticResource {get; set;} |
| | | public String staticResourceContact {get; set;} |
| | | public String staticResourceRepair {get; set;} |
| | | public Contact newCon{get; set;} |
| | | |
| | | /***************底部 编辑和新增的 对象*******************/ |
| | |
| | | |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Address__c')); |
| | | staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact')); |
| | | staticResourceRepair = JSON.serialize(PIHelper.getPIIntegrationInfo('Repair__c')); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | //查询修理表数据 |
| | | private String makeTextRepairSql(String uuid){ |
| | | String RepairSql = 'SELECT ID,NAME,HP_ID__c,HP_Name__c,Delivered_Product__c,FSE_ApplyForRepair_time__c,SAP_Transfer_time__c,Dealer__c,Dealer__r.Name,Returns_Product_way__c,Address_Type_Index__c FROM Repair__c where id = \''+RepairId+'\''; |
| | | String RepairSql = 'SELECT ID,NAME,HP_ID__c,HP_Name__c,Delivered_Product__c,FSE_ApplyForRepair_time__c,SAP_Transfer_time__c,Dealer__c,Dealer__r.Name,Returns_Product_way__c,Address_Type_Index__c,AWS_Data_Id__c FROM Repair__c where id = \''+RepairId+'\''; |
| | | return RepairSql; |
| | | } |
| | | //查询地址表数据 |
| | |
| | | class AddressData { |
| | | //数据 |
| | | public Address__c address { get; set; } |
| | | |
| | | public string addressJson { get{ |
| | | if (address == null) { |
| | | return null; |
| | | } |
| | | return JSON.serialize(address); |
| | | } } |
| | | |
| | | //编辑按钮是否展示 |
| | | public String canEdit { get; private set; } |
| | | //编辑按钮是否展示 |
| | |
| | | private class StraightBackAddressControllerTest { |
| | | |
| | | private static Repair__c rpr { get; set; } |
| | | |
| | | @TestSetup |
| | | static void makeData(){ |
| | | List<String> strList = new List<String>(); |
| | | strList.add('Address__c'); |
| | | strList.add('Contact'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(strList); |
| | | } |
| | | @isTest |
| | | static void testMethod1() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | |
| | | } |
| | | protected override void beforeUpdate() { |
| | | changeAssume(); |
| | | SetAwaitToSendAWS();//new |
| | | //SetAwaitToSendAWS();//new |
| | | } |
| | | //new |
| | | protected override void beforeInsert() { |
| | | SetAwaitToSendAWS();//new |
| | | } |
| | | |
| | | |
| | | protected override void afterInsert() { |
| | | createAgencyTarget(); |
| | | //SetAwaitToSendAWS();//old |
| | | SetAwaitToSendAWS(); |
| | | |
| | | } |
| | | |
| | |
| | | // LHJ KWAG-BQMA89 202006 Start |
| | | updateAgencyAccout(); |
| | | // LHJ KWAG-BQMA89 202006 End |
| | | //SetAwaitToSendAWS();//old |
| | | SetAwaitToSendAWS();//old |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | @isTest |
| | | private class ViewParticipantsControllerTest { |
| | | static testMethod void testMethod1() { |
| | | TestDataUtility.CreatePIPolicyConfiguration('Contact'); |
| | | Contact con = new Contact(); |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController sc = new ApexPages.StandardController(con); |
| | | ViewParticipantsController vp = new ViewParticipantsController(sc); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | this.allselectlist.put('StageName__c', WeeklyReportCmp.getPicklistValues('Agency_Opportunity__c','StageName__c')); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // 支援需求 SupportNeeds__c |
| | | this.allselectlist.put('SupportNeeds__c', WeeklyReportCmp.getPicklistValues('Agency_Report__c','SupportNeeds__c')); |
| | | // this.allselectlist.put('SupportNeeds__c', WeeklyReportCmp.getPicklistValues('Agency_Report__c','SupportNeeds__c')); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | // 职位 |
| | | // this.allselectlist.put('visitor_title__c', WeeklyReportCmp.getPicklistValues('Agency_Report__c','visitor_title__c')); |
| | |
| | | */ |
| | | |
| | | @RemoteAction |
| | | @AuraEnabled//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeedsc |
| | | public static String saveAgencyReport(String Department_Cateogy, String Purpose_Type, String Agency_Report_Header,String SupportNeedsc, |
| | | @AuraEnabled//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeedsc ,String SupportNeedsc |
| | | public static String saveAgencyReport(String Department_Cateogy, String Purpose_Type, String Agency_Report_Header, |
| | | String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date, |
| | | String Product_Category1, String Product_Category2, String Product_Category3, |
| | | String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date) |
| | | { |
| | | Agency_Report__c agency_report = makeAgencyReport(Department_Cateogy, Purpose_Type, Agency_Report_Header, |
| | | Agency_Hospital, Person_In_Charge2, doctor, Submit_date, |
| | | Product_Category1, Product_Category2, Product_Category3,//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeedsc |
| | | Result, Opportunity, StageName, oppAmount, oppOCMPrice, Close_Forecasted_Date, Report_Date,SupportNeedsc); |
| | | Product_Category1, Product_Category2, Product_Category3,//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeedsc ,SupportNeedsc |
| | | Result, Opportunity, StageName, oppAmount, oppOCMPrice, Close_Forecasted_Date, Report_Date); |
| | | |
| | | agency_report = LightningUtil.insertAgencyReport(agency_report); |
| | | return agency_report.Id; |
| | | } |
| | | public static Agency_Report__c makeAgencyReport(String Department_Cateogy, String Purpose_Type, String Agency_Report_Header, |
| | | String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date, |
| | | String Product_Category1, String Product_Category2, String Product_Category3,//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeeds__c |
| | | String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date,String SupportNeedsc) |
| | | String Product_Category1, String Product_Category2, String Product_Category3,//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeeds__c ,String SupportNeedsc |
| | | String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date) |
| | | { |
| | | Agency_Report__c agency_report = new Agency_Report__c(); |
| | | Date week = Date.valueOf(Submit_date); |
| | |
| | | if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; } |
| | | if (Purpose_Type != '') { agency_report.Purpose_Type__c = Purpose_Type; } |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } |
| | | // if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | if (Agency_Report_Header != '') { agency_report.Agency_Report_Header__c = Agency_Report_Header; } |
| | | if (Agency_Hospital != '') { agency_report.Agency_Hospital__c = Agency_Hospital; } |
| | |
| | | @AuraEnabled |
| | | public static String editAgencyReport(String Agency_Report_Id, String Department_Cateogy, String Purpose_Type, String Agency_Report_Header, |
| | | String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date, |
| | | String Product_Category1, String Product_Category2, String Product_Category3, //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeeds__c |
| | | String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date,String SupportNeedsc) |
| | | String Product_Category1, String Product_Category2, String Product_Category3, //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeeds__c ,String SupportNeedsc |
| | | String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date) |
| | | { |
| | | if (String.isBlank(Agency_Report_Id)) { |
| | | return null; |
| | | }//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeeds__c |
| | | Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, Purpose_Type__c, Agency_Hospital__c,SupportNeeds__c, |
| | | }//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeeds__c ,SupportNeeds__c |
| | | Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, Purpose_Type__c, Agency_Hospital__c, |
| | | Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, visitor_title__c, Opportunity__c |
| | | from Agency_Report__c where id=:Agency_Report_Id]; |
| | | Date week = Date.valueOf(Submit_date); |
| | |
| | | if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; } else { agency_report.Department_Cateogy__c = null; } |
| | | if (Purpose_Type != '') { agency_report.Purpose_Type__c = Purpose_Type; } else { agency_report.Purpose_Type__c = null; } |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeeds__c |
| | | if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } else { agency_report.SupportNeeds__c = null; } |
| | | // if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } else { agency_report.SupportNeeds__c = null; } |
| | | if (Agency_Hospital != '') { agency_report.Agency_Hospital__c = Agency_Hospital; } else { agency_report.Agency_Hospital__c = null; } |
| | | if (Product_Category1 != '') { agency_report.Product_Category1__c = Product_Category1; } else { agency_report.Product_Category1__c = null; } |
| | | if (Product_Category2 != '') { agency_report.Product_Category2__c = Product_Category2; } else { agency_report.Product_Category2__c = null; } |
| | |
| | | public static String report_id; |
| | | public static String report_header_id; |
| | | |
| | | @testSetup |
| | | static void setUp(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations( new string[]{'Agency_Contact__c'}); |
| | | } |
| | | @isTest |
| | | static void TestgetAwsurl(){ |
| | | WeeklyReportCmp.getAwsurl('Agency_Contact__c'); |
| | | } |
| | | |
| | | /* 病院。コンタクト、ユーザー、カレンダーなどの初期データ作る |
| | | */ |
| | | private static void testInit() { |
| | |
| | | testInit(); |
| | | |
| | | System.runAs(user) { |
| | | List<Map<String,String>> doctor_data = WeeklyReportCmp.getDoctorList(agency_hospital_link.Id); |
| | | List<Map<String,String>> doctor_data = WeeklyReportCmp.getDoctorList(agency_hospital_link.Id).values(); |
| | | Map<String,String> test_data = new Map<String,String>(); |
| | | test_data.put('label', agency_contact.Name); |
| | | test_data.put('value', agency_contact.Id); |
| | |
| | | private static String accDepId {get; set;} |
| | | private static String accDepName {get; set;} |
| | | |
| | | @testSetup |
| | | static void setUp(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations( new string[]{'Contact'}); |
| | | } |
| | | |
| | | /** |
| | | * 初期処理. |
| | | */ |
| | |
| | | <!-- <td><a href="#" onclick="setContact('{!lineinfo.lineNo}');" id="943114607025717249" onmouseover="showPIDiv('943114607025717249')" onmouseout="hidePIDiv('943114607025717249')">{!lineinfo.con.Name}</a></td> --> |
| | | <!-- 2022/02/15 张华建 解密信息 start --> |
| | | <td> |
| | | <a href="/{!lineinfo.con.Id}" target="_blank" onclick="setContact('{!lineinfo.lineNo}','{!lineinfo.con.AWS_Data_Id__c}');" aws-id="{!lineinfo.con.AWS_Data_Id__c}" style="position:relative"> |
| | | <a target="_blank" onclick="setContact('{!lineinfo.lineNo}','{!lineinfo.con.AWS_Data_Id__c}');" aws-id="{!lineinfo.con.AWS_Data_Id__c}" style="position:relative"> |
| | | <span class="encrypt">{!lineinfo.con.Name}</span> |
| | | <span class="decrypt"></span> |
| | | </a> |
| | |
| | | let parentNode = document.getElementById(awsDataId); |
| | | let createDiv = document.createElement("div"); |
| | | createDiv.id = awsDataId+"_PI"; |
| | | let piInformation = 'trialUser:'+TrialUser[awsDataId.substring(0,18)].trialUser |
| | | let piInformation = TrialUser[awsDataId.substring(0,18)].trialUser |
| | | //let piInformation = 'Name:'+contact['943114607025717249'].lastName +'\n' +'Phone:'+contact['943114607025717249'].phone |
| | | createDiv.innerText = piInformation; |
| | | let x=window.event.x; |
| | |
| | | </td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;border-left: solid 1px;" rowspan="2">医疗机构</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH update colspan="4" --> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px;" colspan="4" rowspan="2"> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px;" colspan="5" rowspan="2"> |
| | | <apex:outputText value="{!HospitalName}" /> |
| | | </td> |
| | | </tr> |
| | |
| | | </td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;border-left: solid 1px;" rowspan="2">发货地址</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH update colspan="4" --> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px;" colspan="4" rowspan="2"> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px;" colspan="5" rowspan="2"> |
| | | <apex:outputText value="{!if(isblank(ApplyHeadShow.Shippment_adress_detail__c), ApplyHeadShow.direct_shippment_address__c, ApplyHeadShow.Shippment_adress_detail__c)}" /> |
| | | </td> |
| | | </tr> |
| | |
| | | </tr> |
| | | <tr> |
| | | <!-- 20220124 ljh SFDC-C4U3PH update colspan="8" --> |
| | | <th style="text-align:center;font-size:13px;height: 7pt;" colspan="8" >借用备品发货清单</th> |
| | | <th style="text-align:center;font-size:13px;height: 7pt;" colspan="9" >借用备品发货清单</th> |
| | | </tr> |
| | | <tr> |
| | | <td rowspan="2" style="box-sizing: border-box;text-align:center;font-size: 11px;">序号</td> |
| | | <td rowspan="2" style="box-sizing: border-box;text-align:center;font-size: 11px;">管理编号</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH update colspan="6" --> |
| | | <td colspan="6" style="box-sizing: border-box;text-align:center;font-size: 11px;">明细</td> |
| | | <td colspan="7" style="box-sizing: border-box;text-align:center;font-size: 11px;">明细</td> |
| | | </tr> |
| | | <tr> |
| | | <!-- <td style="text-align:center;">序号</td> |
| | |
| | | <td style="text-align:center;font-size: 11px;">固定资产号</td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 11px;">货位号</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH add start --> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 11px;"> 备注 </td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 11px;">备注</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH add end --> |
| | | <!-- <td style="text-align:center;">二维码</td> --> |
| | | </tr> |
| | |
| | | </apex:repeat> |
| | | </table> |
| | | <!-- 20211209 ljh SFDC-C923SR 条形码 --> |
| | | <img style="float:left;position:absolute;z-index: 99;" src="{!'/servlet/servlet.FileDownload?file=' + ApplyHeadShow.BRId__c}" /> |
| | | <img style="float:left;position:absolute;z-index: 99;" src="{!barcode}" /> |
| | | <div style="height:30px"></div> |
| | | <!-- 20211209 ljh SFDC-C923SR 条形码 --> |
| | | <div style="{position:absolute;width:100%;height:20px"> </div> |
| | | <apex:outputPanel rendered="{!pNcnt < pageCnt}" layout="none"> |
| | |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | //sforce.connection.sessionId = '{!GETSESSIONID()}'; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | blockme(); |
| | | //blockme(); |
| | | document.body.onload = function(){ |
| | | console.log('document.body.onload') |
| | | AWSService.query(staticResources.queryUrl, '{!ApplyHeadShow.AWS_Data_Id__c}', function(data){ |
| | | console.log('data----------') |
| | | console.log(data); |
| | | unblockUI(); |
| | | //unblockUI(); |
| | | document.getElementById("allPage:Shippmentadress").innerHTML = data.object.directShippmentAddress; |
| | | //document.getElementById("Caller_phone__c").innerHTML = data.object.callerPhone; |
| | | |
| | | setTimeout(function() { |
| | | jsPdfDownload(); |
| | | }, 1500); |
| | | }, staticResources.token); |
| | | |
| | | } |
| | |
| | | } |
| | | }) |
| | | } |
| | | var staticResourceFile = JSON.parse('{!staticResourceFile}'); |
| | | function Fun(pdf){ |
| | | var iframe = document.createElement('iframe'); |
| | | iframe.setAttribute('style', 'position:absolute;right:0; top:0; bottom:0; height:100%; width:100%'); |
| | | document.body.appendChild(iframe); |
| | | iframe.src = pdf.output('datauristring'); |
| | | for(let e of document.body.childNodes){ |
| | | if( e != iframe && e.style){ |
| | | e.style.display = 'none'; |
| | | } |
| | | } |
| | | var form = jQuery("<form method='post'></form>"); |
| | | jQuery(document.body).append(form); |
| | | form.attr({"action":staticResourceFile.viewUnifiedContactUrl+"?from="+encodeURIComponent(window.location.href)}); |
| | | // form.attr({"action":"http://127.0.0.1:8080/a/d?from="+encodeURIComponent(window.location.href)}); |
| | | let input = jQuery("<input type='hidden'/>"); |
| | | input.attr({"name":"base64Str"}); |
| | | input.val(pdf.output('datauristring').substr(28)); |
| | | form.append(input); |
| | | form.submit(); |
| | | } |
| | | </script> |
| | | </html> |
| | |
| | | let contactNodeId = document.querySelector("[data-id='Contact_Name__c']").id + '_lkid'; |
| | | document.getElementById(contactNodeId).value = contactInfo.ContactId; |
| | | document.querySelector("[data-id='Contact_Name__c']").value = contactInfo.Name; |
| | | document.querySelector("[data-id='LastName']").value = contactInfo.Name; |
| | | } |
| | | function replaceSearchContactLookup() { |
| | | let lookUpNode = htmlToElement(contactHtmlString); |
| | |
| | | } |
| | | }) |
| | | }) |
| | | jQuery("body").on("change","input[data-id='Hospital_Name__c']",function(){ |
| | | setTimeout(() => { |
| | | console.log(document.getElementById(this.id+'_lkid').value); |
| | | var hospitalNameValue = document.getElementById(this.id+'_lkid').value; |
| | | if (hospitalNameValue != "000000000000000" && hospitalNameValue != '') { |
| | | console.log("hospitalNameValue = " + hospitalNameValue); |
| | | var ls = ['Department_Class__c']; |
| | | setVlookup(ls,hospitalNameValue); |
| | | }else{ |
| | | clearVlookup('Department_Class__c'); |
| | | } |
| | | }, 50); |
| | | }); |
| | | //Updated by Li Jun 20220323 Start |
| | | // jQuery(".lookupInput").each(function (i, e) { |
| | | // let je = jQuery(e).find('input'); |
| | |
| | | // }); |
| | | //Updated by Li Jun 20220323 Start |
| | | }); |
| | | |
| | | function setVlookup(lookups, lookup_id){ |
| | | //公司(科室) |
| | | document.querySelector("[data-id='Company']").value = document.querySelector("[data-id='Hospital_Name__c']").value; |
| | | let controllerSaveMethod = '{!$RemoteAction.NewAndEditLeadController.queryAccount}'; |
| | | Visualforce.remoting.Manager.invokeAction( |
| | | controllerSaveMethod, |
| | | JSON.stringify(lookups), lookup_id, |
| | | function (result, event) { |
| | | console.log("result = " + result); |
| | | if (result != null ){ |
| | | var obj = JSON.parse(result.replaceAll('&'+'quot;','"')); |
| | | for (let i = 0; i < lookups.length; i++) { |
| | | let lookup = lookups[i]; |
| | | if (!obj[lookup]) { |
| | | continue; |
| | | } |
| | | let ele = document.querySelector("[data-id='"+lookup+"']"); |
| | | let elei1 = document.getElementById(ele.id + '_lkid'); |
| | | let elei2 = document.getElementById(ele.id + '_lkold'); |
| | | |
| | | ele.value=obj[lookup].Name; |
| | | elei1.value = obj[lookup].Id; |
| | | elei2.value = obj[lookup].Name; |
| | | |
| | | let inputele = document.querySelector("[data-id='"+lookup+"']").parentNode; |
| | | if (inputele.childNodes.length > 4){ |
| | | inputele.childNodes[0].style = ""; |
| | | inputele.childNodes[1].style = "display: inline-block;"; |
| | | inputele.childNodes[2].style = "display: none;"; |
| | | } |
| | | |
| | | } |
| | | } |
| | | }, |
| | | { escape: true } |
| | | ); |
| | | }; |
| | | |
| | | function clearVlookup(lookup){ |
| | | let ele = document.querySelector("[data-id='"+lookup+"']"); |
| | | let elei1 = document.getElementById(ele.id + '_lkid'); |
| | | let elei2 = document.getElementById(ele.id + '_lkold'); |
| | | |
| | | ele.value=''; |
| | | elei1.value = ''; |
| | | elei2.value = ''; |
| | | |
| | | let inputele = document.querySelector("[data-id='"+lookup+"']").parentNode; |
| | | if (inputele.childNodes.length > 4){ |
| | | inputele.childNodes[0].style = "display: none;"; |
| | | inputele.childNodes[1].style = "display: none;"; |
| | | inputele.childNodes[2].style = ""; |
| | | } |
| | | } |
| | | </script> |
| | | <div class="pbBottomButtons"> |
| | | <table cellspacing="0" cellpadding="0" border="0"> |
| | |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-28-2022 |
| | | @last modified on : 03-30-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Consum_Apply__c" extensions="NewConsumApplyController" id="page"> |
| | |
| | | <script> |
| | | //Append Page |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | debugger |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | | let layoutSection = layoutSections[m].layoutFields; |
| | |
| | | if (e.tagName == 'DIV') { |
| | | e.classList.add("disabledbutton"); |
| | | } |
| | | // let id = 'page:form:block:j_id34:10:j_id35:j_id36:0:j_id37'; |
| | | // let id2 = 'page:form:block:j_id34:9:j_id35:j_id36:0:j_id37' |
| | | // let lookUpSuffix = '_lkwgt'; |
| | | // // if(document.getElementById(id)){ |
| | | // // document.getElementById(id).classList.add("disabledbutton"); |
| | | // // document.getElementById(id + lookUpSuffix).classList.add("disabledbutton"); |
| | | // // } |
| | | // if(document.getElementById(id2)){ |
| | | // document.getElementById(id2 + lookUpSuffix).classList.add("disabledbutton"); |
| | | // } |
| | | if(document.querySelectorAll("[data-id='Old_Consum_Apply__c']")){ |
| | | document.querySelectorAll("[data-id='Old_Consum_Apply__c']")[0].classList.add("disabledbutton") |
| | | document.querySelectorAll("[data-id='Old_Consum_Apply__c']")[1].classList.add("disabledbutton") |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @author : Dennis |
| | | @group : |
| | | @last modified on : 03-28-2022 |
| | | @last modified on : 03-31-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Rental_Apply__c" extensions="RentalApplyController" id="page"> |
| | |
| | | var requiredFieldAPIList = JSON.parse('{!requiredFieldAPIListStr}'); |
| | | var fieldAPIToLabelMap = JSON.parse('{!fieldAPIToLabelMapStr}'); |
| | | var VLookUpFields = new Set(['OwnerId','OPDPlan__c','Zsq_Rental_Apply__c','Loaner_medical_Staff__c','Hospital__c','Strategic_dept__c','Account__c','Repair__c','Campaign__c','QIS_number__c','QISRepair__c','NewRepair__c','Follow_UP_Opp__c','Statu_Achievements__c','Shipment_address__c','Dealer__c','Old_Rental_Apply__c','OPD__c']); |
| | | var userVLookUpFields = ['Person_In_Charge__c','applyUser__c','Rental_Assistant__c','Assign_Person__c','ZongjianApprovalManager__c','BuchangApprovalManager__c','JingliApprovalManager__c','BuchangApprovalManagerSales__c','SalesManager__c']; |
| | | var userVLookUpFields = ['Person_In_Charge__c','Return_Trake_Staff__c','applyUser__c','Rental_Assistant__c','Assign_Person__c','ZongjianApprovalManager__c','BuchangApprovalManager__c','JingliApprovalManager__c','BuchangApprovalManagerSales__c','SalesManager__c']; |
| | | var redirectMode = 'Save'; |
| | | |
| | | //Redirect Required Parameter |
| | |
| | | alertErrorMessage(errorMessage); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //Query Required Parameter |
| | | var queryBack = function queryBack(data) { |
| | |
| | | } |
| | | } |
| | | |
| | | var GetEleByClass = function(class_name){ |
| | | let eles = document.getElementsByClassName(class_name); |
| | | if(eles.length > 0) return eles[0]; |
| | | return null; |
| | | } |
| | | |
| | | function GetEleApiName(ele){ |
| | | for(let ci in ele.classList){ |
| | | let c = ele.classList[ci]; |
| | | if(c.indexOf('PIBackApi_')>-1){ |
| | | return c.replace('PIBackApi_',''); |
| | | } |
| | | } |
| | | return ''; |
| | | } |
| | | |
| | | function IsFormTag(tag_name){ |
| | | if (!tag_name) { |
| | | return false; |
| | | } |
| | | return ['input','select','textarea'].indexOf(tag_name.toLowerCase())>-1; |
| | | } |
| | | |
| | | function IsFormElement(e){ |
| | | return IsFormTag(e.tagName); |
| | | } |
| | | |
| | | //Get Sensitive Information |
| | | function getPIPayload(rentalApplyJson) { |
| | | let rentalApplyPayloadList = []; |
| | |
| | | return true; |
| | | } |
| | | |
| | | function getCKEinstance(api_name){ |
| | | let t = jQuery("label[for$='textAreaDelegate_"+api_name+"']").closest("tr").find("textarea")[0]; |
| | | if(t && t.id){ |
| | | return CKEDITOR.instances[t.id] |
| | | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | //Get Page Information |
| | | function getRentalApplyInformation() { |
| | | let nodelist = document.querySelectorAll("[data-id]"); |
| | | let result = {} |
| | | //富文本 |
| | | if(document.querySelector("[aria-describedby = 'cke_38']")){ |
| | | result.HP_received_sign_rich__c = document.querySelector("[aria-describedby = 'cke_38']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | if(document.querySelector("[aria-describedby = 'cke_71']")){ |
| | | result. Extension_List_RentalApply__c = document.querySelector("[aria-describedby = 'cke_71']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | // if(document.querySelector("[aria-describedby = 'cke_38']")){ |
| | | // result.HP_received_sign_rich__c = document.querySelector("[aria-describedby = 'cke_38']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | // } |
| | | // result.HP_received_sign_rich__c = CKEDITOR.instances["page:form:block:j_id34:12:j_id35:j_id36:1:j_id37:textAreaDelegate_HP_received_sign_rich__c"].getData(); |
| | | // if(document.querySelector("[aria-describedby = 'cke_71']")){ |
| | | // result. Extension_List_RentalApply__c = document.querySelector("[aria-describedby = 'cke_71']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | // } |
| | | for (let index = 0; index < nodelist.length; index++) { |
| | | if (VLookUpFields.has(nodelist[index].getAttribute("data-id"))) { |
| | | console.log(nodelist[index].id.indexOf('lkwgt')); |
| | |
| | | } |
| | | } |
| | | } |
| | | //page:form:j_id30:j_id34:2:j_id35:j_id36:2:j_id37 |
| | | //page:form:j_id27:j_id31:2:j_id32:j_id33:2:j_id34 |
| | | result.demo_purpose2__c = document.querySelector("[id='page:form:block:j_id34:2:j_id35:j_id36:2:j_id37']").value; |
| | | result.ToAgency__c = document.querySelector("[id='page:form:block:j_id34:0:j_id35:j_id36:14:j_id37']").value; |
| | | result.Loaner_cancel_reason__c = document.querySelector("[id='page:form:block:j_id34:12:j_id35:j_id36:1:j_id37']").value; |
| | | console.log(JSON.stringify(result)); |
| | | //格式化时间 |
| | | if(result.HP_received_sign_day__c){ |
| | | result.HP_received_sign_day__c = result.HP_received_sign_day__c.replace(/\//g, '-')+':00'; |
| | | if(document.querySelector("[id='page:form:block:j_id34:13:j_id35:j_id36:1:j_id37']")!=null){ |
| | | result.Loaner_cancel_reason__c = document.querySelector("[id='page:form:block:j_id34:13:j_id35:j_id36:1:j_id37']").value; |
| | | }else{ |
| | | result.Loaner_cancel_reason__c = document.querySelector("[id='page:form:block:j_id34:11:j_id35:j_id36:1:j_id37']").value; |
| | | } |
| | | // //格式化时间 |
| | | // if(result.HP_received_sign_day__c){ |
| | | // result.HP_received_sign_day__c = result.HP_received_sign_day__c.replace(/\//g, '-')+':00'; |
| | | // } |
| | | let e = getCKEinstance('HP_received_sign_rich__c'); |
| | | if(e){ |
| | | result.HP_received_sign_rich__c = e.getData(); |
| | | } |
| | | e = getCKEinstance('Extension_List_RentalApply__c'); |
| | | if(e){ |
| | | result.Extension_List_RentalApply__c = e.getData(); |
| | | } |
| | | console.log(JSON.stringify(result)); |
| | | return result; |
| | | } |
| | | |
| | |
| | | } |
| | | function queryContactName() { |
| | | function queryContactName() { |
| | | let sfId = document.getElementById(document.querySelector("[data-id='Account__c']").id + '_lkid').value; |
| | | let sfId = document.getElementById(document.querySelector("[data-id='Loaner_medical_Staff__c']").id + '_lkid').value; |
| | | let dataId = ''; |
| | | if ('{!contactsInfo}' != '') { |
| | | let contactsInfo = JSON.parse('{!contactsInfo}'); |
| | |
| | | </apex:pageBlockSection> |
| | | </apex:repeat> |
| | | <script> |
| | | var init_nodes = document.getElementsByClassName("PIBackApi"); |
| | | var api_id_map={}; |
| | | for(let ei in init_nodes){ |
| | | let e = init_nodes[ei]; |
| | | if(IsFormElement(e)){ |
| | | if(e.getAttribute("multiple") != 'multiple' || e.style.display == 'none' && e.id.indexOf('selected') < 0){ |
| | | api_id_map[GetEleApiName(e)] = e.id; |
| | | } |
| | | |
| | | } |
| | | } |
| | | console.log(api_id_map); |
| | | //Append Page |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | |
| | | let layoutField = layoutSection[n]; |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']"); |
| | | console.log('layoutField.fieldAPI= ' + layoutField.fieldAPI); |
| | | e.disabled = !(layoutField.editableField); |
| | | if (!(layoutField.editableField)) { |
| | | if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') { |
| | |
| | | if (e.tagName == 'DIV') { |
| | | e.classList.add("disabledbutton"); |
| | | } |
| | | if(document.querySelector('[data-id=Old_Rental_Apply__c] .lookupIcon')){ |
| | | document.querySelector('[data-id=Old_Rental_Apply__c] .lookupIcon').classList.add("disabledbutton"); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | var onlyReadFields = ['ExtensionStatus__c','ExtensionApplicationTime_Initial__c','ExtensionApprovalTime_Initial__c','ExtensionApplicationTime_Final__c','ExtensionApprovalTime_Final__c','ExtensionSuccessTimes__c','ZongjianApprovalManager__c','BuchangApprovalManager__c','JingliApprovalManager__c','BuchangApprovalManagerSales__c','SalesManager__c']; |
| | | console.log(onlyReadFields); |
| | | for(let i=0;i<onlyReadFields.length;i++){ |
| | | document.querySelector('[data-id='+onlyReadFields[i]+']').parentNode.remove(); |
| | | } |
| | | |
| | | //2. Query AWS Data by dataId |
| | | console.log('Mode for rentalApply Page:' + {!isNewMode}); |
| | | if (!{!isNewMode}) { |
| | |
| | | }) |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | // jQuery(".lookupInput").each(function(i,e){ |
| | | // let je =jQuery(e).find('input'); |
| | | // je.attr("readonly",""); |
| | |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-25-2022 |
| | | @last modified on : 03-30-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Repair__c" extensions="NewRepairController" id="page"> |
| | |
| | | alertErrorMessage(errorMessage); |
| | | } |
| | | } |
| | | var GetEleApiName = function(ele){ |
| | | function GetEleApiName(ele){ |
| | | for(let ci in ele.classList){ |
| | | let c = ele.classList[ci]; |
| | | if(c.indexOf('PIBackApi'+'_')>-1){ |
| | | return c.replace('PIBackApi'+'_',''); |
| | | if(c.indexOf('PIBackApi_')>-1){ |
| | | return c.replace('PIBackApi_',''); |
| | | } |
| | | } |
| | | return ''; |
| | |
| | | } |
| | | for(var i=0;i<result.object.length;i++){ |
| | | if(result.object[i].sfRecordId != null){ |
| | | contact[result.object[i].sfRecordId] = result.object[i].lastName |
| | | var o = []; |
| | | o.lastName = result.object[i].lastName; |
| | | o.phone = result.object[i].phone; |
| | | contact[result.object[i].sfRecordId] = o; |
| | | } |
| | | } |
| | | resolve('success'); |
| | |
| | | var p = new Promise(function(resolve, reject){ |
| | | for(let key in contact){ |
| | | var k = ''+key; |
| | | document.getElementById(k).innerText = contact[k]; |
| | | document.getElementById(k).innerText = contact[k].lastName; |
| | | if(document.getElementById(k+'_Phone')){ |
| | | document.getElementById(k+'_Phone').innerText = contact[k].phone; |
| | | } |
| | | } |
| | | }); |
| | | return p; |
| | |
| | | <!-- 20220217 Li Jun for PIPL End --> |
| | | <script type="text/javascript"> |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | //像医生区分(职务)下拉列表加入**** |
| | | // var o = new Option(); |
| | | // o.text = '****'; |
| | | // document.getElementById('Page:mainForm:idSearchVisitor:updateContactDoctorDivision').add(o); |
| | | function addContact(){ |
| | | window.opener.showModal(); |
| | | |
| | |
| | | let y=window.event.y; |
| | | createDiv.style.left=x; |
| | | createDiv.style.top=y; |
| | | createDiv.style.marginLeft='20px'; |
| | | createDiv.style.marginTop='-40px'; |
| | | createDiv.style.height='80px'; |
| | | createDiv.style.width='120px'; |
| | | createDiv.style.background = "#dddddd"; |
| | | createDiv.style.position = "absolute"; |
| | | parentNode.appendChild(createDiv); |
| | |
| | | return JSON.stringify([{ |
| | | lastName : document.getElementById("Page:mainForm:idSearchVisitor:updateContactLastName").value, |
| | | phone : document.getElementById("Page:mainForm:idSearchVisitor:updateContactPhone").value, |
| | | type : document.getElementById("Page:mainForm:idSearchVisitor:updateContactType").value, |
| | | doctorDivision1 : document.getElementById("Page:mainForm:idSearchVisitor:updateContactDoctorDivision").value, |
| | | dataId:selectedAwsDataId |
| | | }]); |
| | | } |
| | |
| | | return; |
| | | } |
| | | blockme(); |
| | | let es = document.getElementsByTagName('select') |
| | | for(let ei in es){ |
| | | let e = es[ei]; |
| | | for(let opi in e.options){ |
| | | let op = e.options[opi]; |
| | | if(!op)continue; |
| | | if(op.value == "*****" && op.selected){ |
| | | unblockUI(); |
| | | alert('下拉框不能主动选择密文选项') |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | ProcessPIForAWS({},GetEditObj()); |
| | | } |
| | | function Trans(){ |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-30-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page controller="StraightBackAddressController" action="{!init}" showHeader="false" sidebar="true" id="allPage" title="直返收货地址"> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | |
| | | var tableDataStr = ''; |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | var staticResourceContact = JSON.parse('{!staticResourceContact}'); |
| | | var staticResourceRepair = JSON.parse('{!staticResourceRepair}'); |
| | | |
| | | var PIData = {}; |
| | | var contactDataIds = []; |
| | | var ObjIdDecrypt = ''; |
| | |
| | | var con_aws_result = ''; |
| | | var isAddCon = false; |
| | | var contactInfoStr = ''; |
| | | |
| | | var addressAwsData = {}; |
| | | |
| | | //替换vlookup |
| | | var newSearchContactWindow = null; |
| | |
| | | if(isAddCon){ |
| | | AWSService.post(staticResourceContact.transactionUrl, JSON.stringify({ |
| | | "txId":con_aws_result.txId, |
| | | "isSuccess":b ? 0 : 1, |
| | | "sfRecordId":document.getElementById('allPage:allForm:sfRecordId').value |
| | | "isSuccess":b ? 0 : 1 |
| | | }), function(result){ |
| | | if(!b) |
| | | window.location.reload(); |
| | |
| | | } |
| | | blockme(); |
| | | console.log('{!insUpdData}') |
| | | if(document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Create_Contacts__c").value //【联系人(新建)】不为空 |
| | | &&document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:CustomerRecordType").value!='{!accOfficeTypeId}'////记录类型id 办事处 |
| | | &&document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:CustomerRecordType").value!='{!accAgencyTypeId}'//记录类型id 販売店 |
| | | &&document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:CustomerRecordType").value!='{!accAgencyContactTypeId}'){//记录类型id 经销商联系人 |
| | | if(document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Create_Contacts__c").value){ |
| | | //new contact |
| | | ProcessPI({},GetEditObj('contact'),'contact',function(){ |
| | | //new address |
| | |
| | | searchBtn('\''+addressName+'\''); |
| | | return |
| | | }else{ |
| | | |
| | | for(var i=0;i<result.object.length;i++){ |
| | | addressDataIds += ',\''+ result.object[i].dataId + '\''; |
| | | addressAwsData[result.object[i].dataId] = result.object[i]; |
| | | } |
| | | addressDataIds = addressDataIds.substring(1); |
| | | resolve('success'); |
| | |
| | | searchBtn(addressDataIds); |
| | | } |
| | | } |
| | | //加密客户名字段 |
| | | // function encryptCustomer(e){ |
| | | // let obj = JSON.parse(payloadForNewPI); |
| | | // let payloadForNewPIJson = JSON.stringify(obj); |
| | | // let payloadForNewPI = jQuery(e.target).closest("tr").find("a.cusmer__c"); |
| | | // AWSService.update(staticResources.updateUrl, '', payloadForNewPI, updateMethod, staticResources.token, staticResources.transactionUrl, false, insertOrUpdateBack, redirectCallBack); |
| | | // }, |
| | | |
| | | sforce.connection.sessionId = '{!GETSESSIONID()}'; |
| | | function UpdateSobject(staticResource,sobj,transId,callback){ |
| | | |
| | | let result = sforce.connection.update([sobj]); |
| | | let tobj = { |
| | | txId: transId |
| | | }; |
| | | let b = result[0].getBoolean('success'); |
| | | if(b) { |
| | | console.log('call sf Log Id: ' + result[0].id); |
| | | tobj.sfRecordId = result[0].id; |
| | | tobj.isSuccess = 1; |
| | | |
| | | //return result[0].id; |
| | | }else { |
| | | console.log('call sf to insert log'); |
| | | tobj.isSuccess = 0; |
| | | //return ''; |
| | | } |
| | | |
| | | AWSService.post(staticResource.transactionUrl,tobj,function(data){ |
| | | if (callback) { |
| | | data.isSuccess = b; |
| | | callback(data) |
| | | } |
| | | },staticResource.token); |
| | | } |
| | | |
| | | |
| | | |
| | | function adoptSaveJs(address){ |
| | | //由于要把采用时间记录到地址表中,所以新建一个地址对象 |
| | | // Address__c DatetimeUpdate = new Address__c(); |
| | | // DatetimeUpdate = tableData[i].address; |
| | | //详细地址 |
| | | let address_str = address.Detailed_Address__c.trim();addressAwsData |
| | | let cityName = '';//市 |
| | | //市不为空,因为要使用 __r.Name 如果为空,会报错 |
| | | if(address.City__c){ |
| | | cityName = address.City__r.Name.trim(); |
| | | //省 同上 |
| | | if(address.Province__c){ |
| | | let ProvinceCity = address.Province__r.name.trim()+cityName; |
| | | //防止详细地址里面带着省份和市 |
| | | if(address_str.indexOf(ProvinceCity) < 0){ |
| | | address_str = ProvinceCity + address_str; |
| | | } |
| | | } |
| | | } |
| | | //联系人 |
| | | let contactsName = ''; |
| | | if(address.Contacts__c){ |
| | | contactsName = address.Contacts__r.Name; |
| | | } |
| | | //客户 |
| | | let ContactPerson = ''; |
| | | if(address.Customer__c){ |
| | | ContactPerson = address.Customer__r.Name; |
| | | } |
| | | try{ |
| | | //保存数据到修理表中 |
| | | let rc = new sforce.SObject('Repair__c'); |
| | | rc.Id='{!RepairId}'; |
| | | rc.address_Contacts__c=contactsName; |
| | | rc.address_ZipCode__c = address.ZipCode__c; |
| | | rc.address_City__c = cityName; |
| | | rc.address_Contacts_Name__c = ContactPerson; |
| | | //isUpload:是否上传SAP FSEApplyForRepairTime:SAP修理申请时间 |
| | | if({!isUpload} && pc.SAP_Transfer_time__c){ |
| | | rc.Address_type__c = 'X'; |
| | | rc.Address_Type_Index__c = rc.Address_Type_Index__c+1; |
| | | } |
| | | rc.address_Telephone__c=address.Telephone__c; |
| | | rc.Detailed_Address__c=address_str; |
| | | |
| | | let UpdateRepair = function(callback){ |
| | | AWSService.post(staticResourceRepair.updateUrl,[{ |
| | | dataId:'{!pc.AWS_Data_Id__c}', |
| | | addressContactsName:rc.address_Contacts_Name__c, |
| | | detailedAddress:rc.Detailed_Address__c |
| | | }],function(data){ |
| | | if(data && data.object){ |
| | | console.log(data); |
| | | rc.address_Contacts__c = data.object[0].addressContactsName; |
| | | rc.Detailed_Address__c = data.object[0].detailedAddress; |
| | | UpdateSobject(staticResourceRepair,data.txId,callback); |
| | | }else{ |
| | | alert('更新修理失败'); |
| | | unblockUI(); |
| | | } |
| | | },staticResourceRepair.token) |
| | | } |
| | | |
| | | //保存数据到保有设备表中 |
| | | let UpdateAsset = function(){ |
| | | let ast = new sforce.SObject('Asset'); |
| | | ast.Id = pc.Delivered_Product__c, |
| | | ast.address_Contacts__c= contactsName, |
| | | ast.address_ZipCode__c = address.ZipCode__c, |
| | | ast.address_City__c = cityName, |
| | | ast.address_Telephone__c = address.Telephone__c, |
| | | ast.address_Contacts_Name__c = ContactPerson, |
| | | ast.Detailed_Address__c= address_str |
| | | let result = sforce.connection.update([ast]); |
| | | let b = result[0].getBoolean('success'); |
| | | return b; |
| | | } |
| | | |
| | | |
| | | let UpdateAddress = function(){ |
| | | let add = new sforce.SObject('Address__c'); |
| | | add.Id = address.Id; |
| | | //最后把当前时间保存到地址表中,作为采用时间 |
| | | add.Using_Datetime__c = new Date(); |
| | | let result = sforce.connection.update([add]); |
| | | let b = result[0].getBoolean('success'); |
| | | return b; |
| | | } |
| | | |
| | | UpdateAddress |
| | | //页面重定向 |
| | | //return redirectPag(); |
| | | }catch( e){ |
| | | //失败提示 |
| | | //ApexPages.addMessages(e); |
| | | } |
| | | } |
| | | //采用按钮 |
| | | function onAdoptJs(objId){ |
| | | if(objId != null){ |
| | | function onAdoptJs(e, address){ |
| | | |
| | | //判断当前修理单是否已经申请修理 |
| | | var uploadTime = '{!FSEApplyForRepairTime}'; |
| | | if(uploadTime != 'null'){ |
| | | var prompt = '由于当前修理单已申请修理,请问是否采用并上传数据到SAP?'; |
| | | if(confirm(prompt)){ |
| | | blockme(); |
| | | adoptSave(objId+"",true); |
| | | adoptSaveJs(address); |
| | | } |
| | | }else{ |
| | | adoptSave(objId+"",false); |
| | | adoptSaveJs(address); |
| | | } |
| | | } |
| | | |
| | | } |
| | | /* function onAdoptJs(){ |
| | | if(checkedTrue != null){ |
| | |
| | | '\n邮编: '+PIData[awsDataId].zipCode+ |
| | | '\n详细地址: '+PIData[awsDataId].detailedAddress |
| | | }else{ |
| | | piInformation = |
| | | '电话: '+PIData[awsDataId].telephone+ |
| | | piInformation = '联系人: null'+ |
| | | '\n电话: '+PIData[awsDataId].telephone+ |
| | | '\n邮编: '+PIData[awsDataId].zipCode+ |
| | | '\n详细地址: '+PIData[awsDataId].detailedAddress |
| | | } |
| | |
| | | //自定义lookup查询 |
| | | function searchContact(contactNodeId,field){ |
| | | closeField = field; |
| | | let searchContactKeyWord = document.getElementById(field).value |
| | | let accountValue = ""; |
| | | if (document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Customer__r_Name')!=null) { |
| | | let accountNodeId = document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Customer__r_Name').id + '_lkid'; |
| | |
| | | console.log(accountValue); |
| | | if(accountValue !='000000000000000'){ |
| | | let baseUrl = "/apex/SearchContactPage"; |
| | | let suffixUrl = "?contactId="+contactNodeId+"&accountId="+accountValue+"&searchContactKeyWord=" + searchContactKeyWord; |
| | | let suffixUrl = "?contactId="+contactNodeId+"&accountId="+accountValue; |
| | | let newSearchContactParam = 'height=600,width=800,left=100,top=100,dialogHide=true,resizable=no,scrollbars=yes,toolbar=no,status=no'; |
| | | newSearchContactWindow = window.open(baseUrl+suffixUrl, 'Popup', newSearchContactParam); |
| | | if (window.focus) { |
| | |
| | | } |
| | | return false; |
| | | }else{ |
| | | alert('请先选择客户再选择联系人') |
| | | console.log('请先选择客户再选择联系人') |
| | | } |
| | | } |
| | | |
| | |
| | | document.getElementById(contactNodeId).value = contactInfo.ContactId; |
| | | document.getElementById(closeField).value = contactInfo.Name; |
| | | } |
| | | function queryRecordType(){ |
| | | if(document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Customer__r_Name').value){ |
| | | queryRecordType(); |
| | | } |
| | | } |
| | | //2022 02 28 张华建 display PI Data end |
| | | </script> |
| | | <apex:form id="allForm"> |
| | | <apex:inputHidden id="tableValueFrontEnd" value="{!tableDataStr}"/> |
| | | <apex:inputHidden value="{!contactId}" id="contactId"/> |
| | | <apex:inputHidden value="{!insUpdDataStr}" id="insUpdDataStr"/> |
| | | <apex:inputHidden value="{!sfRecordId}" id="sfRecordId"/> |
| | | <div id="tab01"> |
| | | <!-- 页面数据初始化方法 --> |
| | | <apex:actionFunction name="init" action="{!init}" rerender="oppBlock1,message,checEventFrame" onComplete="unblockUI();"></apex:actionFunction> |
| | |
| | | <apex:param name="isUpload" assignTo="{!isUpload}" value="" /> |
| | | </apex:actionFunction> |
| | | <!-- 保存和修改方法 --> |
| | | <apex:actionFunction name="save" action="{!save}" rerender="oppBlock2,message,sfRecordId" onComplete="unblockUI();{!IF(isSearchBtn,'searchBtnJs()',false)};Trans();"></apex:actionFunction> |
| | | <!-- 查询客户记录类型方法 --> |
| | | <apex:actionFunction name="queryRecordType" action="{!queryRecordType}" rerender="oppBlock2,message" onComplete="unblockUI();"></apex:actionFunction> |
| | | <apex:actionFunction name="save" action="{!save}" rerender="oppBlock2,message" onComplete="unblockUI();{!IF(isSearchBtn,'searchBtnJs()',false)};Trans()"></apex:actionFunction> |
| | | <!-- 点击修改按钮获取修改数据方法 --> |
| | | <apex:actionFunction name="onEditor" action="{!onEditor}" rerender="oppBlock2,checEventFrame,insUpdDataStr" onComplete="decrypt();unblockUI();"> |
| | | <apex:param name="UpdId" assignTo="{!UpdId}" value="" /> |
| | |
| | | <td align="center" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;"> |
| | | <apex:outputText value="{!or.address.Address_Classification__c}" /> |
| | | </td> |
| | | <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;"> |
| | | <td align="left" class="Customer__c" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;"> |
| | | <apex:outputfield value="{!or.address.Customer__c}" /> |
| | | </td> |
| | | <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;" aws-data-id="{!or.address.AWS_Data_Id__c}"> |
| | | <td align="left" class="address" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;" aws-data-id="{!or.address.AWS_Data_Id__c}"> |
| | | <!-- <apex:outputfield value="{!or.address.Contacts__c}" id="{!or.address.Contacts__c}_{!or.address.Id}"/> --> |
| | | <a href="#" id="{!or.address.Id}" onmouseover="showPIDiv('{!or.address.Id}')" onmouseout="hidePIDiv('{!or.address.Id}')" aws-data-id="{!or.address.Contacts__r.AWS_Data_Id__c}">{!or.address.Contacts__r.Name}</a> |
| | | </td> |
| | |
| | | <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;"> |
| | | <apex:outputText value="{!or.address.Detailed_Address__c}" /> |
| | | </td> |
| | | <td align="center" style="vertical-align: inherit;width:30px;"> |
| | | <!-- <td align="center" style="vertical-align: inherit;width:30px;"> |
| | | <apex:commandButton value=" 编辑 " onclick="onEditorJs('{!or.address.id}');return false;" style="background:#98c1fbf7;display:{!or.canEdit};"/> |
| | | </td> |
| | | </td> --> |
| | | <td align="center" style="vertical-align: inherit;width:30px;"> |
| | | <apex:commandButton value=" 复制 " onclick="onCopyJs('{!or.address.id}');return false;" style="background: #98c1fbf7;display:{!or.canCopy};"/> |
| | | </td> |
| | | <td align="center" style="vertical-align: inherit;width:30px;"> |
| | | <apex:commandButton value=" 采用 " onclick="onAdoptJs('{!or.address.id}');return false;" style="background: #98c1fbf7;display:{!or.canAdopt};"/> |
| | | <apex:commandButton value=" 采用 " onclick="onAdoptJs(event,JSON.parse('{!or.addressJson}'));return false;" style="background: #98c1fbf7;display:{!or.canAdopt};"/> |
| | | </td> |
| | | </tr> |
| | | <apex:variable value="{!cnt + 1}" var="cnt" /> |
| | |
| | | <apex:pageBlock id="oppBlock2" tabStyle="Report"> |
| | | <apex:pageblocksection title="编辑地址" id="UpdAddressId" rendered="true" columns="4"> |
| | | <apex:inputfield value="{!insUpdData.Address_Classification__c}" id="Address_Classification__c" /> |
| | | <apex:inputfield value="{!insUpdData.Customer__c}" id="Customer__r_Name" required="false" onchange="queryRecordType();" /> |
| | | <apex:inputfield value="{!insUpdData.Customer__c}" id="Customer__r_Name" required="false" /> |
| | | <!-- Before PIPL 20220308 --> |
| | | <!-- <apex:inputfield value="{!insUpdData.Contacts__c}" id="Contacts__c" required="false"/> --> |
| | | <!-- Add By Li Jun for PIPL 20220308 Start --> |
| | | <!-- <apex:inputText label="联系人" disabled="true" value="{!contactNameValue}" id="Contacts__c">--> |
| | | <apex:inputText label="联系人" value="{!contactNameValue}" id="Contacts__c"> |
| | | <apex:inputText label="联系人" disabled="true" value="{!contactNameValue}" id="Contacts__c"> |
| | | </apex:inputText> |
| | | <apex:inputHidden id="contactIdValue" value="{!contactIdValue}"/> |
| | | <!-- Add By Li Jun for PIPL 20220308 End --> |
| | |
| | | <apex:inputHidden id="Telephone_Encrypted__c" value="{!insUpdData.Telephone_Encrypted__c}"/> |
| | | <apex:inputHidden id="ZipCode_Encrypted__c" value="{!insUpdData.ZipCode_Encrypted__c}"/> |
| | | <apex:inputHidden id="Detailed_Address_Encrypted__c" value="{!insUpdData.Detailed_Address_Encrypted__c}"/> |
| | | <apex:inputHidden id="CustomerRecordType" value="{!accRecordTypeId}"/> |
| | | </apex:pageblocksection> |
| | | |
| | | <div style="text-align: center;"> |
| | |
| | | <apex:outputPanel id="checEventFrame"> |
| | | <script type="text/javascript"> |
| | | j$("select option[value='办事处']")[1].remove(); |
| | | let arr = []; |
| | | j$('td.address').each(function(i,e){ |
| | | let did = j$(e).attr('aws-data-id'); |
| | | if (did) { |
| | | arr.push(did); |
| | | } |
| | | }) |
| | | if (arr.length) { |
| | | blockme(); |
| | | AWSService.post(staticResource.searchUrl,{ |
| | | dataIds:arr |
| | | },function(data){ |
| | | unblockUI(); |
| | | if(data && data.object && data.object.length > 0){ |
| | | for (let di in data.object) { |
| | | if (data.object[di] && data.object[di].dataId) { |
| | | addressAwsData[data.object[di].dataId] = data.object[di]; |
| | | } |
| | | } |
| | | |
| | | } |
| | | },staticResource.token) |
| | | } |
| | | |
| | | </script> |
| | | </apex:outputPanel> |
| | | <script type="javascript/text"> |
| | |
| | | <apex:outputField html-data-id="{!encryptedAPI}" title="{!ApiPrefix}{!encryptedAPI}" value="{!Contact[encryptedAPI]}" /> |
| | | </apex:repeat> |
| | | <apex:outputText label="统一用户Id" id="viewContactId" value="" /> |
| | | <apex:outputText label="服务平台编码" id="ServicePlatformCode" value="" /> |
| | | </apex:pageBlockSection> |
| | | <script> |
| | | var config = { |
| | |
| | | // document.querySelector("[data-id='LastName']").value = data.object.lastName; |
| | | }; |
| | | var queryBackContactId = function queryBackContactId(data) { |
| | | |
| | | console.log('queryBackContactId:') |
| | | console.log(JSON.stringify(data)) |
| | | if(data.status == '0'){ |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:viewContactId').innerText = data.object.viewContactId; |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:viewContactId').innerText = data.object.viewContactId!=null?data.object.viewContactId:''; |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:ServicePlatformCode').innerText = data.object.servicePlatformCode!=null?data.object.servicePlatformCode:''; |
| | | } |
| | | }; |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-17-2022 |
| | | @last modified on : 03-29-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Consum_Apply__c" extensions="NewConsumApplyController" id="page"> |
| | |
| | | AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); |
| | | } |
| | | var queryBack = function queryBack(data) { |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:0:j_id3']").innerHTML = data.object.phoneNumber; |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:1:j_id3']").innerHTML = data.object.phoneNumber; |
| | | document.querySelector("[data-id='direct_shippment_address__c']").innerHTML = data.object.directShippmentAddress; |
| | | }; |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | |
| | | <apex:repeat value="{!layoutEncryptedAPIList}" var="encryptedAPI"> |
| | | <apex:outputField html-data-id="{!encryptedAPI}" title="{!ApiPrefix}{!encryptedAPI}" value="{!Inquiry_form__c[encryptedAPI]}" /> |
| | | </apex:repeat> |
| | | <apex:outputField html-data-id="Contact_Name__c" title="{!ApiPrefix}Contact_Name__c" value="{!Inquiry_form__c['Contact_Name__c']}" /> |
| | | </apex:pageBlockSection> |
| | | <script> |
| | | var config = { |
| | |
| | | AWSToSobjectEncryptedMap:{!AWSToSobjectEncryptedMapJson} |
| | | }; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | var staticResourceContact = JSON.parse('{!staticResourceContact}'); |
| | | function QuerySobjectFromAWS() { |
| | | AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); |
| | | debugger |
| | | let t = "[title='"+config.ApiPrefix+"Contact_Name__c']"; |
| | | let ele = document.querySelector(t); |
| | | if('{!contactAWSDataId}' != '无' && '{!contactName}' != '无'){ |
| | | if('{!contactAWSDataId}' != ''){ |
| | | AWSService.query(staticResourceContact .queryUrl, '{!contactAWSDataId}', queryContactBack, staticResourceContact.token); |
| | | }else{ |
| | | ele.innerHTML = '{!contactName}'; |
| | | } |
| | | }else{ |
| | | |
| | | ele.innerHTML = ''; |
| | | } |
| | | } |
| | | var queryContactBack = function queryContactBack(data){ |
| | | if(!data.object){ |
| | | console.log('data.object is ' + data.object); |
| | | return; |
| | | } |
| | | console.log('data.object is ' + data.object); |
| | | |
| | | let t = "[title='"+config.ApiPrefix+"Contact_Name__c']"; |
| | | let ele = document.querySelector(t); |
| | | if(ele){ |
| | | ele.title=''; |
| | | ele.innerHTML = data.object.lastName; |
| | | } |
| | | |
| | | }; |
| | | |
| | | |
| | | var queryBack = function queryBack(data) { |
| | | if(!data.object){ |
| | | console.log('data.object is ' + data.object); |
| | |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-17-2022 |
| | | @last modified on : 03-29-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Rental_Apply__c" extensions="RentalApplyController" id="page"> |
| | |
| | | AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); |
| | | } |
| | | var queryBack = function queryBack(data) { |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:1:j_id3']").innerHTML = data.object.phoneNumber; |
| | | document.querySelector("[data-id='direct_shippment_address__c']").innerHTML = data.object.directShippmentAddress; |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:0:j_id3']").innerText = data.object.phoneNumber; |
| | | document.querySelector("[data-id='direct_shippment_address__c']").innerText = data.object.directShippmentAddress; |
| | | }; |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | console.log('sfdcPage.appendToOnloadQueue'); |
| | |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-23-2022 |
| | | @last modified on : 03-30-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Repair__c" extensions="NewRepairController" id="page"> |
| | |
| | | var staticResourceContact = JSON.parse('{!staticResourceContact}'); |
| | | var staticResourceAddress = JSON.parse('{!staticResourceAddress}'); |
| | | function QueryConsumApplyFromAWS() { |
| | | debugger; |
| | | AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); |
| | | } |
| | | var queryBack = function queryBack(data) { |
| | |
| | | <apex:pageblock id="pageBlock"> |
| | | <apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection"> |
| | | <!--Each section has layoutFields, let's iterate them as well--> |
| | | <apex:repeat value="{!encryptedAPIList}" var="encryptedAPI"> |
| | | <apex:outputField html-data-id="{!encryptedAPI}" value="{!Report__c[encryptedAPI]}" /> |
| | | <apex:repeat value="{!layoutEncryptedAPIList}" var="encryptedAPI"> |
| | | <apex:outputField html-data-id="{!encryptedAPI}" title="{!ApiPrefix}{!encryptedAPI}" value="{!Report__c[encryptedAPI]}" /> |
| | | </apex:repeat> |
| | | </apex:pageBlockSection> |
| | | <script> |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | var AWSToSobjectEncryptedMapJson = JSON.parse('{!AWSToSobjectEncryptedMapJson}'); |
| | | var ApiPrefix = '{!ApiPrefix}'; |
| | | function QueryLeadFromAWS() { |
| | | AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); |
| | | } |
| | | var queryBack = function queryBack(data) { |
| | | document.querySelector("[data-id='VOC_Informer_Name__c']").innerText=data.object.vocInformerName |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:1:j_id3']").innerText=data.object.callerPhone |
| | | document.querySelector("[data-id='VOC_Informer_Contact__c']").innerText=data.object.vocInformerContact |
| | | document.querySelector("[data-id='Person_In_Charge_Text__c']").innerText=data.object.personInChargeText |
| | | document.querySelector("[data-id='Professor_sigh_text__c']").innerText=data.object.professorSighText |
| | | document.querySelector("[data-id='Staff_Info_Manual_c__c']").innerText=data.object.staffInfoManual |
| | | document.querySelector("[data-id='Medical_History__c']").innerText = data.object.medicalHistory |
| | | document.querySelector("[data-id='Responsible_Person_HP_c__c']").innerText=data.object.responsiblePersonHP |
| | | document.querySelector("[data-id='Practitioner1_Part__c']").innerText=data.object.practitioner1Part |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:8:j_id3').innerText=data.object.practitioner2Part |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:9:j_id3').innerText=data.object.practitioner3Part |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:10:j_id3').innerText=data.object.practitioner4Part |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:11:j_id3').innerText=data.object.practitioner5Part |
| | | document.querySelector("[data-id='age__c']").innerText=data.object.age |
| | | document.querySelector("[data-id='sex__c']").innerText=data.object.sex |
| | | if(!data.object){ |
| | | console.log('data.object is ' + data.object); |
| | | return; |
| | | } |
| | | for(let f in AWSToSobjectEncryptedMapJson){ |
| | | let t = "[title='"+ApiPrefix+AWSToSobjectEncryptedMapJson[f]+"']"; |
| | | let ele = document.querySelector(t); |
| | | if(ele){ |
| | | ele.title = ''; |
| | | if(data.object.hasOwnProperty(f)){ |
| | | ele.innerHTML = data.object[f]; |
| | | } |
| | | else{ |
| | | console.log(f + 'is not in data.object'); |
| | | } |
| | | }else{ |
| | | console.log('selector='+t+' not found'); |
| | | } |
| | | |
| | | } |
| | | // document.querySelector("[data-id='VOC_Informer_Name__c']").innerText=data.object.vocInformerName |
| | | // document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:1:j_id3']").innerText=data.object.callerPhone |
| | | // document.querySelector("[data-id='VOC_Informer_Contact__c']").innerText=data.object.vocInformerContact |
| | | // document.querySelector("[data-id='Person_In_Charge_Text__c']").innerText=data.object.personInChargeText |
| | | // document.querySelector("[data-id='Professor_sigh_text__c']").innerText=data.object.professorSighText |
| | | // document.querySelector("[data-id='Staff_Info_Manual_c__c']").innerText=data.object.staffInfoManual |
| | | // document.querySelector("[data-id='Medical_History__c']").innerText = data.object.medicalHistory |
| | | // document.querySelector("[data-id='Responsible_Person_HP_c__c']").innerText=data.object.responsiblePersonHP |
| | | // document.querySelector("[data-id='Practitioner1_Part__c']").innerText=data.object.practitioner1Part |
| | | // document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:8:j_id3').innerText=data.object.practitioner2Part |
| | | // document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:9:j_id3').innerText=data.object.practitioner3Part |
| | | // document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:10:j_id3').innerText=data.object.practitioner4Part |
| | | // document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:11:j_id3').innerText=data.object.practitioner5Part |
| | | // document.querySelector("[data-id='age__c']").innerText=data.object.age |
| | | // document.querySelector("[data-id='sex__c']").innerText=data.object.sex |
| | | }; |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | console.log('awsDataId = '+'{!AWSDataId}') |
| | | QueryLeadFromAWS(); |
| | | }); |
| | | </script> |
| | |
| | | <Package xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <types> |
| | | <members>AgencyAccountCmp</members> |
| | | <members>AgencyAccountCmpTest</members> |
| | | <members>AgencyContactHandler</members> |
| | | <members>AgencyContactHandlerTest</members> |
| | | <members>AssessmentReportController</members> |
| | | <members>AssessmentReportControllerTest</members> |
| | | <members>AWSServiceTool</members> |
| | | <members>BmeWorkController</members> |
| | | <members>AWSServiceToolTest</members> |
| | | <members>B_Test</members> |
| | | <members>B_TestTest</members> |
| | | <members>BmeWorkController</members> |
| | | <members>BmeWorkControllerTest</members> |
| | | <members>CampaignMemberController</members> |
| | | <members>CampaignMemberControllerTest</members> |
| | | <members>CampaignMemberServiceController</members> |
| | | <members>CampaignMemberServiceControllerTest</members> |
| | | <members>CM_SearchContact</members> |
| | | <members>CM_SearchContactServiceController</members> |
| | | <members>CM_SearchContactServiceControllerTest</members> |
| | | <members>CM_SearchContactTest</members> |
| | | <members>ConsumFixtureSetSelectController</members> |
| | | <members>ConsumFixtureSetSelectControllerTest</members> |
| | | <members>ConsumReassignController</members> |
| | | <members>ConsumReassignControllerTest</members> |
| | | <members>ConsumTrialController</members> |
| | | <members>ConsumTrialControllerTest</members> |
| | | <members>ConsumTrialPDFController</members> |
| | | <members>ConsumTrialPDFControllerTest</members> |
| | | <members>ControllerResponse</members> |
| | | <members>ControllerResponseTest</members> |
| | | <members>DeleteBatch</members> |
| | | <members>DeveloperUtility</members> |
| | | <members>DIrectReturnToReceivingAddressController</members> |
| | | <members>DeleteBatchTest</members> |
| | | <members>FieldInfo</members> |
| | | <members>FieldInfoTest</members> |
| | | <members>FileUploadController</members> |
| | | <members>FileUploadControllerTest</members> |
| | | <members>FixtureRentalPDFController</members> |
| | | <members>FixtureRentalPDFControllerTest</members> |
| | | <members>InsReportPDFController</members> |
| | | <members>InsReportPDFControllerTest</members> |
| | | <members>InstructReportController</members> |
| | | <members>InstructReportControllerTest</members> |
| | | <members>LayoutDescriberHelper</members> |
| | | <members>LayoutDescriberHelperTest</members> |
| | | <members>LeadIntentionController</members> |
| | | <members>LeadIntentionControllerTest</members> |
| | | <members>LightningUtil</members> |
| | | <members>LightningUtilTest</members> |
| | | <members>MetaDataUtility</members> |
| | | <members>NewAgencyContactController</members> |
| | | <members>NewAgencyContactControllerTest</members> |
| | | <members>NewAndEditAddressController</members> |
| | | <members>NewAndEditAddressControllerTest</members> |
| | | <members>NewAndEditAgencyContactController</members> |
| | | <members>NewAndEditAgencyContactControllerTest</members> |
| | | <members>NewAndEditASEActivityController</members> |
| | | <members>NewAndEditASEActivityControllerTest</members> |
| | | <members>NewAndEditBaseController</members> |
| | | <members>NewAndEditBaseControllerTest</members> |
| | | <members>NewAndEditCampaignMemberController</members> |
| | | <members>NewAndEditCampaignMemberControllerTest</members> |
| | | <members>NewAndEditCaseController</members> |
| | | <members>NewAndEditCaseControllerTest</members> |
| | | <members>NewAndEditContactController</members> |
| | | <members>NewAndEditContactControllerTest</members> |
| | | <members>NewAndEditEventController</members> |
| | | <members>NewAndEditEventControllerTest</members> |
| | | <members>NewAndEditInquiryFormController</members> |
| | | <members>NewAndEditInquiryFormControllerTest</members> |
| | | <members>NewAndEditInspectionReportController</members> |
| | | <members>NewAndEditInspectionReportControllerTest</members> |
| | | <members>NewAndEditLeadController</members> |
| | | <members>NewAndEditLeadControllerTest</members> |
| | | <members>NewAndEditQISController</members> |
| | | <members>NewAndEditQISControllerTest</members> |
| | | <members>NewAndEditRepairSubOrderController</members> |
| | | <members>NewAndEditRepairSubOrderControllerTest</members> |
| | | <members>NewAndEditReportController</members> |
| | | <members>NewAndEditReportControllerTest</members> |
| | | <members>NewAndEditTenderinformationController</members> |
| | | <members>NewAndEditTenderinformationControlTest</members> |
| | | <members>NewConsumApplyController</members> |
| | | <members>NewConsumApplyControllerTest</members> |
| | | <members>NewConsumApplyEquipSetDetailController</members> |
| | | <members>NewConsumApplyEquipSetDetailControlTest</members> |
| | | <members>NewListOfConsumablesController</members> |
| | | <members>NewRepairController</members> |
| | | <members>NewRepairControllerTest</members> |
| | | <members>NFM103Controller</members> |
| | | <members>NFM103ControllerTest</members> |
| | | <members>NFM115ControllerTest</members> |
| | | <members>NFM203Rest</members> |
| | | <members>NFM203RestTest</members> |
| | | <members>NFM501Controller</members> |
| | | <members>NFM501ControllerTest</members> |
| | | <members>NFM501FutureController</members> |
| | | <members>NFM501FutureControllerTest</members> |
| | | <members>NFM502Controller</members> |
| | | <members>NFM502ControllerTest</members> |
| | | <members>NFM503Controller</members> |
| | | <members>NFM503InfoFileBatch</members> |
| | | <members>NFM503InfoFileBatchTest</members> |
| | | <members>NFM606Controller</members> |
| | | <members>NFM606ControllerTest</members> |
| | | <members>NFM607Rest</members> |
| | | <members>NFM607RestTest</members> |
| | | <members>NFM612Rest</members> |
| | | <members>NFM612RestTest</members> |
| | | <members>NFM620Rest</members> |
| | | <members>NFM620RestBatch</members> |
| | | <members>NFM620RestBatchTest</members> |
| | | <members>NFM620RestSchedule</members> |
| | | <members>NFM620RestScheduleTest</members> |
| | | <members>NFM620RestTest</members> |
| | | <members>NFM623Rest</members> |
| | | <members>NFM623RestBatch</members> |
| | | <members>NFM623RestSchedule</members> |
| | | <members>NFM623RestScheduleTest</members> |
| | | <members>NFM623RestTest</members> |
| | | <members>NFM624Batch</members> |
| | | <members>NFM624BatchSchedulable</members> |
| | | <members>NFM624Rest</members> |
| | | <members>NFM624RestTest</members> |
| | | <members>NFM702Controller</members> |
| | | <members>NFM702ControllerHandler</members> |
| | | <members>NFM702ControllerTest</members> |
| | | <members>NFM702WebService</members> |
| | | <members>NFM702WebServiceTest</members> |
| | | <members>NFMUtil</members> |
| | | <members>NFMUtilTest</members> |
| | | <members>OFSInsReportLayoutController</members> |
| | | <members>OFSInsReportLayoutControllerTest</members> |
| | | <members>OnCallController</members> |
| | | <members>OnCallControllerTest</members> |
| | | <members>Option</members> |
| | | <members>PIHelper</members> |
| | | <members>PIHelperTest</members> |
| | | <members>QISPDFController</members> |
| | | <members>QISPDFControllerTest</members> |
| | | <members>RentalApplyController</members> |
| | | <members>RentalApplyControllerTest</members> |
| | | <members>SearchContactController</members> |
| | | <members>SearchContactControllerTest</members> |
| | | <members>SearchLeadController</members> |
| | | <members>SearchLeadControllerTest</members> |
| | | <members>SearchVisitorController</members> |
| | | <members>SearchVistorControllerTest</members> |
| | | <members>SimpleEventRegisterController</members> |
| | | <members>SimpleEventRegisterControllerTester</members> |
| | | <members>SLAReportDetailsController</members> |
| | | <members>SLAReportDetailsControllerTest</members> |
| | | <members>SObjectHelper</members> |
| | | <members>SObjectHelperTest</members> |
| | | <members>SoqlHelper</members> |
| | | <members>SoqlHelperTest</members> |
| | | <members>StartTradingController</members> |
| | | <members>StartTradingControllerTest</members> |
| | | <members>StraightBackAddressController</members> |
| | | <members>TestClass</members> |
| | | <members>TestController</members> |
| | | <members>StraightBackAddressControllerTest</members> |
| | | <members>UpdateContractAimAmountHandler</members> |
| | | <members>UpdateContractAimAmountHandlerTest</members> |
| | | <members>ViewParticipantsController</members> |
| | | <members>ViewParticipantsControllerTest</members> |
| | | <members>WeeklyReportCmp</members> |
| | | <members>WeeklyReportCmpTest</members> |
| | | <members>XinDailyReportController</members> |
| | | <members>ContactTriggerHandler</members> |
| | | <members>XinDailyReportControllerTest</members> |
| | | <name>ApexClass</name> |
| | | </types> |
| | | <types> |