| | |
| | | public string staticResourceFile { get; private set; } |
| | | public Boolean addFlag { get; private set; }//敏感地址使用标记 |
| | | public String qrcode { get; private set; } |
| | | public String barcode { get; private set; } |
| | | public FixtureRentalPDFController() { |
| | | pageNum = Integer.valueOf(ApexPages.currentPage().getParameters().get('page')); |
| | | rentalApplyIdIMG = ApexPages.currentPage().getParameters().get('raid'); |
| | | //Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=8'); |
| | | // rentalApplyId = ApexPages.currentPage().getParameters().get('raid');//20201120 ljh |
| | | String tempStr = ApexPages.currentPage().getParameters().get('raid'); |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Rental_Apply__c')); |
| | | staticResourceFile = JSON.serialize(PIHelper.getPIIntegrationInfo('Document')); |
| | | |
| | | addFlag = false; |
| | | rentalApplyId = new List<String>(); |
| | | if(tempStr != null){ |
| | |
| | | |
| | | // 画面初始化 |
| | | public void init() { |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Rental_Apply__c')); |
| | | staticResourceFile = JSON.serialize(PIHelper.getPIIntegrationInfo('Document')); |
| | | // 新规奥林巴斯备品签收单PDF画面初始化 |
| | | PageCutList = new List<List<String>>(); |
| | | List<Rental_Apply__c> ApplyList = new List<Rental_Apply__c>(); |
| | |
| | | if(ApplyList.size()>0){ |
| | | ApplyHeadShow = ApplyList[0]; |
| | | qrcode = ConsumTrialPDFController.GetImageBase64(ApplyHeadShow.QRId__c); |
| | | barcode = ConsumTrialPDFController.GetImageBase64(ApplyHeadShow.BRId__c); |
| | | } |
| | | //增加借出备品SET一览List,为了获取借出备品SET一览明细 |
| | | List<String> RAESSearchList = New List<String>(); |
| | |
| | | mainCnt = 0; |
| | | accessoryCnt = 0; |
| | | for (Rental_Apply_Equipment_Set_Detail__c ra : RAESDLine) { |
| | | if (ra.Is_Body__c) { |
| | | if (ra.Is_Body__c) { |
| | | mainCnt += 1; |
| | | } else { |
| | | accessoryCnt += 1; |
| | |
| | | public without sharing class LeadIntentionController { |
| | | public List<PCLInfo> pclInfos { get; set; } |
| | | public List<PCLInfo> pclInfos { get; set; } |
| | | |
| | | /*****************検索用******************/ |
| | | |
| | |
| | | public String[] sortOrder { get; set; } |
| | | public String[] columus = new String[]{'Contact_Name__c', 'Hospital_Name__c', 'Department_Class__c', 'Company__c', 'Status__c' |
| | | ,'Request1__c', 'Inquiry_No__c', 'Phone__c', 'Email__c', 'Cancel_Reason__c' |
| | | ,'Opp_Name_Search__c', 'Opportunity_Division__c', 'LeadSource__c', 'Campaign__c' |
| | | ,'Opp_Name_Search__c', 'Opportunity_Division__c', 'LeadSource__c', 'Campaign__c' |
| | | ,'Urgent__c', 'Request_Detail__c','Contact_Id__c','Hospital_ID__c','Department_ID__c','Opp_Name_Search_ID__c' |
| | | ,'Campaign_ID__c','Id','Name','Family_Name__c','Last_Name__c','Reasons_options__c','Product1__c' |
| | | }; |
| | |
| | | } |
| | | soqlWithoutSort = this.makeSoql(false, accSearch, ownerSearch, |
| | | text, condition, value, text2, condition2, value2, text3, condition3, value3); |
| | | String soql = soqlWithoutSort + ' order by CreatedDate desc limit ' + Integer.valueOf(limits); |
| | | String soql = soqlWithoutSort + ' order by CreatedDate desc limit ' + Integer.valueOf(limits); |
| | | |
| | | soqlForMoneyWithoutSort = this.makeSoql(true, accSearch, ownerSearch, |
| | | text, condition, value, text2, condition2, value2, text3, condition3, value3); |
| | | String soqlForMoney = soqlForMoneyWithoutSort + ' order by CreatedDate desc limit ' + Integer.valueOf(System.Label.TotalLimit); |
| | | String soqlForMoney = soqlForMoneyWithoutSort + ' order by CreatedDate desc limit ' + Integer.valueOf(System.Label.TotalLimit); |
| | | System.debug('soqlWithoutSort:' + soqlWithoutSort); |
| | | system.debug('aaaaaaaaaa'+soql); |
| | | system.debug('bbbbbbb:'+soqlForMoney); |
| | |
| | | List<Inquiry_form__c> updateInquiryform = new List<Inquiry_form__c>(); |
| | | Inquiry_form__c inquiryForm = new Inquiry_form__c(); |
| | | inquiryForm.Id = inquiryformId; |
| | | inquiryForm.Status__c = '不需要'; |
| | | inquiryForm.Status__c = '02.不需要'; |
| | | //不需要的时候 的确认日期 |
| | | system.debug('ccccccc:'+opp_ID); |
| | | inquiryForm.Confirmation_Date__c = Date.toDay(); |
| | |
| | | system.debug('输出的值为:'+oi.reasonFlg); |
| | | if (oi.reasonFlg == '1') { |
| | | oi.reasonFlg = '0'; |
| | | oi.rec.Status__c = '不需要'; |
| | | oi.rec.Status__c = '02.不需要'; |
| | | oi.rec.Reasons_options__c=batchReason; |
| | | oi.rec.Cancel_Reason__c = batchReason; |
| | | oi.rec.Confirmation_Date__c = Date.toDay(); |
| | |
| | | @isTest |
| | | private class LeadIntentionControllerTest { |
| | | |
| | | @testSetup |
| | | static void setUp(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations( new string[]{'Inquiry_form__c'}); |
| | | } |
| | | |
| | | static testMethod void testMethod1() { |
| | | //医院 |
| | | List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; |
| | | //医院 |
| | | List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; |
| | | if (rectHp.size() == 0) { |
| | | return; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; |
| | | Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; |
| | | |
| | | User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '北京', 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); |
| | | insert hpOwner; |
| | | User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '重庆', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | insert hpOwner2; |
| | | User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '北京', 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); |
| | | insert hpOwner; |
| | | User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '重庆', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | insert hpOwner2; |
| | | |
| | | |
| | | |
| | | Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id); |
| | | Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id); |
| | | hp.FSE_GI_Main_Leader__c = hpOwner.Id; |
| | | hp.FSE_SP_Main_Leader__c = hpOwner2.Id; |
| | | insert hp; |
| | |
| | | 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 = '需要报价'; |
| | |
| | | page.setRedirect(true); |
| | | System.Test.setCurrentPage(page); |
| | | |
| | | |
| | | // LeadIntentionController conTest = new LeadIntentionController(new ApexPages.StandardController(dpt)); |
| | | LeadIntentionController conTest = new LeadIntentionController(); |
| | | System.Test.startTest(); |
| | | conTest.inquiryformId = inquiryform.Id; |
| | | |
| | | // LeadIntentionController conTest = new LeadIntentionController(new ApexPages.StandardController(dpt)); |
| | | LeadIntentionController conTest = new LeadIntentionController(); |
| | | System.Test.startTest(); |
| | | conTest.inquiryformId = inquiryform.Id; |
| | | |
| | | conTest.init(); |
| | | conTest.init(); |
| | | |
| | | conTest.searchOpp(); |
| | | conTest.sortTable(); |
| | | conTest.save(); |
| | | conTest.cancel(); |
| | | conTest.searchOpp(); |
| | | conTest.sortTable(); |
| | | conTest.save(); |
| | | conTest.cancel(); |
| | | |
| | | // conTest.pclInfos.reasonFlg ='1'; |
| | | conTest.saveInquiryOpts(); |
| | | conTest.saveInquiryOpts(); |
| | | |
| | | } |
| | | //测试 选择一些筛选条件 |
| | | static testMethod void testMethod2() { |
| | | //医院 |
| | | //医院 |
| | | List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; |
| | | if (rectHp.size() == 0) { |
| | | return; |
| | |
| | | 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 = '需要报价'; |
| | |
| | | public String UpdateStatus;//直返修改标识 |
| | | //add by wangweipeng 2021/07/14 end |
| | | //add pi 加密 sushanhu 20220222 start |
| | | public String DataId;//AWS存储凭证 |
| | | //public String DataId;//AWS存储凭证 |
| | | //add pi 加密 sushanhu 20220222 end |
| | | |
| | | //20220330 lt WLIG-CCT9UG 【委托】关于市场多年保计提金调整 start |
| | | public Datetime QuotationDate; |
| | | public String QuotationDate; |
| | | //20220330 lt WLIG-CCT9UG 【委托】关于市场多年保计提金调整 end |
| | | |
| | | |
| | |
| | | ,Returns_Product_way__c //返品方式 |
| | | ,FSE_ApplyForRepair_time__c //申请修理时间 |
| | | //add by wangweipeng 2021/07/14 start |
| | | ,AWS_Data_Id__c //add by sushanhu AWSDateID for PIPL |
| | | //,AWS_Data_Id__c //add by sushanhu AWSDateID for PIPL |
| | | //20220330 lt WLIG-CCT9UG 【委托】关于市场多年保计提金调整 start |
| | | ,Delivered_Product__r.Backorder__r.Opportunity__r.SAP_Send_OK_Date__c |
| | | //20220330 lt WLIG-CCT9UG 【委托】关于市场多年保计提金调整 end |
| | |
| | | element.TradeType = NFMUtil.getMapValue(transferMap, 'Trade__c', rpr.Delivered_Product__r.Backorder__r.Opportunity__r.Trade__c, iflog); |
| | | |
| | | //20220330 lt WLIG-CCT9UG 【委托】关于市场多年保计提金调整 start |
| | | //element.QuotationDate = NFMUtil.getMapValue(transferMap, 'SAP_Send_OK_Date__c', rpr.Delivered_Product__r.Backorder__r.Opportunity__r.SAP_Send_OK_Date__c, iflog); |
| | | element.QuotationDate = rpr.Delivered_Product__r.Backorder__r.Opportunity__r.SAP_Send_OK_Date__c; |
| | | element.QuotationDate = NFMUtil.formatDateTime2StrSprit(rpr.Delivered_Product__r.Backorder__r.Opportunity__r.SAP_Send_OK_Date__c).replaceAll('/', ''); |
| | | //20220330 lt WLIG-CCT9UG 【委托】关于市场多年保计提金调整 end |
| | | |
| | | // 多年保修 LHJ Start |
| | |
| | | }*/ |
| | | // 2021-01-07 mzy update 多年保修外贸NFM103接口修改 start |
| | | String tradeType = rpr.Delivered_Product__r.Backorder__r.Opportunity__r.Trade__c; |
| | | |
| | | //20220330 lt WLIG-CCT9UG 【委托】关于市场多年保计提金调整 start |
| | | //Date QuotationDate = rpr.Delivered_Product__r.Backorder__r.Opportunity__r.SAP_Send_OK_Date__c; |
| | | //20220330 lt WLIG-CCT9UG 【委托】关于市场多年保计提金调整 end |
| | | |
| | | String NewProductGuaranteeObject = rpr.NewProductGuaranteeObject__c == null ? '': rpr.NewProductGuaranteeObject__c; |
| | | |
| | |
| | | element.UpdateStatus = rpr.Address_type__c; //申请修理时间 |
| | | //add by wangweipeng 2021/07/14 end |
| | | //add pi 密文 sushanhu 20220222 start |
| | | element.DataId =rpr.AWS_Data_Id__c;//aws存储凭证 |
| | | //element.DataId =rpr.AWS_Data_Id__c;//aws存储凭证 |
| | | //add pi 密文 sushanhu 20220222 end |
| | | |
| | | } |
| | |
| | | // NFM103修改Rest end |
| | | |
| | | // WLIG-BXQBH6 start |
| | | // NFMUtil.response response = |
| | | // NFMUtil.sendToSapStatusAndBody(rowDataStr, NFMUtil.NFM103_ENDPOINT); |
| | | NFMUtil.response response = |
| | | NFMUtil.sendToSapStatusAndBody(rowDataStr, NFMUtil.NFM103_ENDPOINT); |
| | | //update to aws 20220222 sushanhu start for PIPL |
| | | NFMUtil.response res = NFMUtil.getAwsToken(); |
| | | String token=res.responseBody; |
| | | if(String.isBlank(token)){ |
| | | iflog.ErrorLog__c='NFM103'+'获取aws token 失败'; |
| | | |
| | | } |
| | | NFMUtil.response response = NFMUtil.sendToPiAWS(rowDataStr, NFMUtil.NFM103_ENDPOINT,token); |
| | | // PIHelper.PIIntegration NFM103AWS =PIHelper.getPIIntegrationInfo('NFM103'); |
| | | // NFMUtil.response response = NFMUtil.sendToPiAWS(rowDataStr, NFM103AWS.newUrl,NFM103AWS.token); |
| | | //update to aws 20220222 sushanhu end for PIPL |
| | | status = response.status; |
| | | system.debug('AWS Response status:'+status); |
| | | ResponseBody = response.responseBody; |
| | | //update to aws 20220302 sushanhu start for PIPL |
| | | Map<String, Object> results = (Map<String, Object>)JSON.deserializeUntyped(ResponseBody); |
| | | system.System.debug('NGM103 AWS result--'+ ResponseBody); |
| | | // Map<String, Object> results = (Map<String, Object>)JSON.deserializeUntyped(ResponseBody); |
| | | // system.System.debug('NGM103 AWS result--'+ ResponseBody); |
| | | //update to aws 20220302 sushanhu end for PIPL |
| | | NFM103Response NFM103Response = new NFM103Response(); |
| | | system.debug(ResponseBody); |
| | |
| | | public String TenId; |
| | | public String bidInfoFileID; |
| | | //add staic sushanhu 20220302 start |
| | | public static String transUrl; |
| | | public static String transId; |
| | | public static String token; |
| | | public static String transUrl; |
| | | public static String transId; |
| | | public static String token; |
| | | public static integer isSuccess=0; |
| | | public static List<String> sfRecordIds =new List<String>(); |
| | | //add staic sushanhu 20220302 end |
| | | //add staic sushanhu 20220302 end |
| | | Boolean IsNeedExecute = false; //2021-06-28 mzy WLIG-BYHD79 SFDC环境batch合并调查 是否符合执行条件 |
| | | //add nfm 503 aws response start sushanhu 20220301 |
| | | global class File{ |
| | |
| | | queryfileList.add(bidInfoFile.infoAddress__c); |
| | | try { |
| | | //update 同staic 20220302 satrt |
| | | // String token; |
| | | //update 同staic 20220302 end |
| | | // String token; |
| | | //update 同staic 20220302 end |
| | | Datetime oldTime; |
| | | // 从转换表中获取token |
| | | BatchIF_Transfer__c token503 = [Select ID, NFM501_Token__c |
| | |
| | | timeslot = newTime.getTime() - oldTime.getTime(); |
| | | } |
| | | // System.debug('++++1++++' + token + ' : ' + timeslot); |
| | | PIHelper.piIntegration pi =PIHelper.getPIIntegrationInfo('NFM503'); |
| | | if (string.isblank(token) || timeslot > 1800000) { |
| | | //UP TO AWAS TOKEN 20220225 SUSHANHU START |
| | | NFMUtil.response response = NFMUtil.getAWSToken(); |
| | | //UP TO AWAS TOKEN 20220225 SUSHANHU END |
| | | if (String.isBlank(response.responseBody)) { |
| | | bidInfoFile.ErrorMessage__c = '503token:' + response.status; |
| | | } |
| | | token = response.responseBody; |
| | | // NFMUtil.response response = NFMUtil.getAWSToken(); |
| | | // //UP TO AWAS TOKEN 20220225 SUSHANHU END |
| | | // if (String.isBlank(response.responseBody)) { |
| | | // bidInfoFile.ErrorMessage__c = '503token:' + response.status; |
| | | // } |
| | | token = pi.token; |
| | | oldTime = Datetime.now(); |
| | | token503.NFM501_Token__c = token; |
| | | oldTime503.NFM501_Gain_End_Time__c = oldTime; |
| | |
| | | //UP TO NEW AWS method sushanhu start 20220301 |
| | | // List< Tender_information__c> updateTenderList = new List< Tender_information__c>(); |
| | | List<FileAddress__c> fileList = new List<FileAddress__c>(); |
| | | PIHelper.piIntegration pi =PIHelper.getPIIntegrationInfo('NFM503'); |
| | | transUrl =pi.searchUrl; |
| | | NFMUtil.response response = NFMUtil.getAWSQLMData(pi.newUrl ,JSON.serialize(queryfileList), token); |
| | | system.debug('aws result'+response.responseBody); |
| | |
| | | // add 确认事务 sushanhu 20220302 start |
| | | |
| | | if (fileList.size() > 0 ) { |
| | | for (FileAddress__c fileAddress : fileList) { |
| | | for (FileAddress__c fileAddress : fileList) { |
| | | system.debug('fileAddress.Id---'+json.serialize(fileAddress)); |
| | | sfRecordIds.add(fileAddress.Id); |
| | | sfRecordIds.add(fileAddress.Id); |
| | | system.debug('fileAddress.Id---'+fileAddress.Id); |
| | | } |
| | | } |
| | | } |
| | | system.debug('成功的token'+token); |
| | | isSuccess =1; |
| | | |
| | | // if (!confirm) { |
| | | // //回滚 |
| | | // //回滚 |
| | | // if (sp != null) { |
| | | // Database.rollback(sp); |
| | | // } |
| | | // } |
| | | // } |
| | | // add 确认事务 sushanhu 20220302 end |
| | | if (System.Test.isRunningTest()) { |
| | | throw new ControllerUtil.myException('aaa'); |
| | |
| | | taskType = System.Label.OpportunityFollow; // 询价跟进任务 |
| | | } else if (this.targetEvent.OPDPlan_Flag__c) { |
| | | taskType = System.Label.OPD; // OPD任务 |
| | | } else if (accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).Is_Target_Account_Energy__c == 1 || accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).Is_Target_Account__c == 1) { |
| | | } else if (!accToNumTarget.isEmpty() && !accToDepMap.isEmpty() && (accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).Is_Target_Account_Energy__c == 1 || accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).Is_Target_Account__c == 1)) { |
| | | taskType = System.Label.TargetAccountVisit; // 目标客户拜访任务 |
| | | } else if (accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).OCM_Category__c == 'H1' || accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).OCM_Category__c == 'H0') { |
| | | } else if (!accToNumTarget.isEmpty() && !accToDepMap.isEmpty() && (accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).OCM_Category__c == 'H1' || accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).OCM_Category__c == 'H0')) { |
| | | taskType = System.Label.visitHLevel; // H层拜访任务 |
| | | } else { |
| | | taskType = System.Label.DailyVisit;// 日程拜访任务 |
| | |
| | | //wangweipeng 20210727 end |
| | | |
| | | if ((Trigger.isAfter && Trigger.isInsert) || (Trigger.isAfter && Trigger.isUpdate) || (Trigger.isAfter && Trigger.isDelete)) { |
| | | if(!(System.isFuture()||System.isBatch())){// Add By Lijun 20220303 to avoid mutiple execute |
| | | // if(!(System.isFuture()||System.isBatch())){// Add By Lijun 20220303 to avoid mutiple execute |
| | | NFM103Controller.NFM103Trigger(Trigger.new, Trigger.newMap, Trigger.old, Trigger.oldMap); |
| | | NFM603Controller.NFM603Trigger(Trigger.new, Trigger.newMap, Trigger.old, Trigger.oldMap); |
| | | RepairTrigger.UpdateAssert(Trigger.new, Trigger.newMap, Trigger.old, Trigger.oldMap); |
| | | } |
| | | // } |
| | | } |
| | | // ---------------------------------------------------------------------- |
| | | // ここより、修理のサービスコントラクト項目を自動的に更新するロジック |