| | |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | | public static String sobjectTypeValue = 'Address__c'; |
| | | public Boolean isNewMode{set;get;} |
| | | public Boolean isCloneMode{protected set;get;} |
| | | public String rtTypeId {get; set;} |
| | | public String AWSDataId{set;get;} |
| | | public String contactId{set;get;}//For Lookup field |
| | |
| | | // public String CurrentUserName{private set; get;} |
| | | public NewAndEditAddressController(ApexPages.StandardController controller) { |
| | | isNewMode = true; |
| | | isCloneMode = false; |
| | | Input_Required_Field_Msg = Label.Input_Required_Field_Msg; |
| | | PIPL_Name_Label = Label.PIPL_Name_Label; |
| | | PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg; |
| | |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Address__c').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList);} |
| | | controller.addFields(fieldList); |
| | | } |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | if(mso != null && mso.containsKey('newclone')){ |
| | | isCloneMode = true; |
| | | } |
| | | SObject obj = controller.getRecord(); |
| | | if(obj.Id != null){ |
| | | //更新 |
| | |
| | | if(String.isNotBlank(dt)&&dt.contains('T')){ |
| | | dt = dt.replace('T',' '); |
| | | addressInfo.put(fieldAPI, Datetime.valueOfGmt(dt)); |
| | | }else if(String.isNotBlank(fieldValue)) { |
| | | fieldValue = fieldValue.replace('/', '-') + ':00'; |
| | | addressInfo.put(fieldAPI, Datetime.valueOf(fieldValue)); |
| | | }else { |
| | | addressInfo.put(fieldAPI,fieldValue); |
| | | } |
| | |
| | | String status = 'success'; |
| | | Response resp = new Response(); |
| | | Savepoint sp = Database.setSavepoint(); |
| | | Boolean isClone = false; |
| | | // String rid = ''; |
| | | String awsDataId = ''; |
| | | try{ |
| | | System.debug('abcde'); |
| | | if(isNew){ |
| | | awsDataId = (String)addressInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Address__c[] addresses = [select id from Address__c where AWS_Data_Id__c =:awsDataId]; |
| | | if(!isNew){ |
| | | isClone = addresses.size() == 0; |
| | | } |
| | | System.debug('isClone---------'+isClone); |
| | | if(isNew || isClone){ |
| | | System.debug('addressInfoNancy = ' + addressInfo); |
| | | insert addressInfo; |
| | | }else{ |
| | | System.debug('into update'); |
| | | awsDataId = (String)addressInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Address__c[] addresses = [select id from Address__c where AWS_Data_Id__c =:awsDataId]; |
| | | // awsDataId = (String)addressInfo.get('AWS_Data_Id__c'); |
| | | // System.debug('awsDataId = ' + awsDataId); |
| | | // Address__c[] addresses = [select id from Address__c where AWS_Data_Id__c =:awsDataId]; |
| | | System.debug('addresses[0].id = ' + addresses[0].id); |
| | | addressInfo.put('Id',addresses[0].id);//For testing; |
| | | update addressInfo; |
| | |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | | public String sobjectTypeValue {private set; get;} |
| | | public Boolean isNewMode{set;get;} |
| | | public Boolean isCloneMode{protected set;get;} |
| | | public String rtTypeId {get; set;} |
| | | public String AWSDataId{set;get;} |
| | | public String CurrentUserId{private set;get;} |
| | |
| | | system.debug('obj='+sobjectTypeValue); |
| | | |
| | | isNewMode = true; |
| | | isCloneMode = false; |
| | | List<Sobject> lso = Database.query('select id from RecordType where SobjectType = :sobjectTypeValue'); |
| | | |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | if(mso != null && mso.containsKey('newclone')){ |
| | | isCloneMode = true; |
| | | } |
| | | if(obj.Id != null){ |
| | | recordId = obj.Id; |
| | | isNewMode = false; |
| | |
| | | System.debug('sobjectTypeValue:'+sobjectTypeValue+' Info:' + JSON.serialize(leadJson)); |
| | | System.debug('json length='+leadJson.length()); |
| | | System.debug('leadJson---------'+leadJson); |
| | | System.debug('isNew---------'+isNew); |
| | | //1. Prepare the payload for Lead |
| | | Schema.SObjectType leadSchema = schemaMap.get(sobjectTypeValue); |
| | | Map<String, Schema.SObjectField> fieldAPIToTypeMap = leadSchema.getDescribe().fields.getMap(); |
| | | Map<String,Object> fieldValueMap = (Map<String,Object>)JSON.deserializeUntyped(leadJson); |
| | | |
| | | |
| | | |
| | | Boolean isClone = false; |
| | | //2. Save Record Process |
| | | String status = 'success'; |
| | | Response resp = new Response(); |
| | |
| | | Savepoint sp = Database.setSavepoint(); |
| | | Sobject leadInfo = sobj; |
| | | try{ |
| | | System.debug('abcde'); |
| | | |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | system.debug('field API='+fieldAPI); |
| | | if(!fieldAPIToTypeMap.containskey(fieldAPI)){ |
| | |
| | | } |
| | | |
| | | system.debug('for (String fieldAPI: fieldValueMap.keySet()) end'); |
| | | awsDataId = (String)leadInfo.get('AWS_Data_Id__c'); |
| | | if (string.isBlank(awsDataId)) { |
| | | throw new DMLException('更新时AWS_Data_Id__c不能为空'); |
| | | } |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Sobject[] sobjects = Database.query('select id from '+sobjectTypeValue+' where AWS_Data_Id__c =:awsDataId'); |
| | | |
| | | if(isNew){ |
| | | |
| | | if(!isNew){ |
| | | isClone = sobjects.size() == 0; |
| | | } |
| | | System.debug('isNew---------'+isNew); |
| | | |
| | | if(isNew || isClone){ |
| | | System.debug('leadInfozhj = ' + leadInfo); |
| | | if(!Test.isRunningTest()){ |
| | | insert leadInfo; |
| | | } |
| | | }else{ |
| | | System.debug('into update'); |
| | | awsDataId = (String)leadInfo.get('AWS_Data_Id__c'); |
| | | if (string.isBlank(awsDataId)) { |
| | | throw new DMLException('更新时AWS_Data_Id__c不能为空'); |
| | | } |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Sobject[] leads = Database.query('select id from '+sobjectTypeValue+' where AWS_Data_Id__c =:awsDataId'); |
| | | System.debug('leads[0].id = ' + leads[0].id); |
| | | leadInfo.put('Id',leads[0].id);//For testing; |
| | | System.debug('sobjects[0].id = ' + sobjects[0].id); |
| | | leadInfo.put('Id',sobjects[0].id);//For testing; |
| | | if(!Test.isRunningTest()){ |
| | | update leadInfo; |
| | | } |
| | |
| | | }else{ |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | system.debug('mso='+mso); |
| | | system.debug('url='+ApexPages.currentPage().getUrl()); |
| | | if(mso.containsKey('con4_lkid')){ |
| | | controller.getRecord().put('AccountId',mso.get('con4_lkid')); |
| | | } |
| | |
| | | system.debug(mso); |
| | | PageReference pg = null; |
| | | mso.remove('sfdc.override'); |
| | | mso.remove('save_new'); |
| | | system.debug('recordId='+recordId); |
| | | if(string.isBlank(recordId)){ |
| | | pg = new PageReference('/003/e'); |
| | | }else{ |
| | | pg = new PageReference('/'+recordId+'/e'); |
| | | } |
| | | //pg.getParameters().putAll(mso); |
| | | pg.getParameters().put('RecordType',mso.get('RecordType')); |
| | | pg.getParameters().put('accid',mso.get('accid')); |
| | | pg.getParameters().putAll(mso); |
| | | //pg.getParameters().put('RecordType',mso.get('RecordType')); |
| | | //pg.getParameters().put('accid',mso.get('accid')); |
| | | pg.getParameters().put('nooverride','1'); |
| | | pg.setRedirect(true); |
| | | return pg; |
| | |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | | public static String sobjectTypeValue = 'Lead'; |
| | | public Boolean isNewMode{set;get;} |
| | | public Boolean isCloneMode{protected set;get;} |
| | | public String rtTypeId {get; set;} |
| | | public String AWSDataId{set;get;} |
| | | public String AWSDataIdInquiryForm{set;get;} |
| | |
| | | ApiPrefix = 'PIBackApi'; |
| | | isDecryptContact = '0'; |
| | | isNewMode = true; |
| | | isCloneMode = false; |
| | | Input_Required_Field_Msg = Label.Input_Required_Field_Msg; |
| | | PIPL_Name_Label = Label.PIPL_Name_Label; |
| | | PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg; |
| | | sobjecttypeForFrontEnd = sobjectTypeValue; |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | if(mso != null && mso.containsKey('newclone')){ |
| | | isCloneMode = true; |
| | | } |
| | | //获取所有字段 |
| | | 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 |
| | |
| | | contactsInfo = JSON.serialize(sfIdToAWSIdMap); |
| | | }else{ |
| | | //看链接中有无带过来的参数(客户人员) |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | // Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | for(String key : mso.keySet()){ |
| | | System.debug('key=' + key + ',value=' + mso.get(key)); |
| | | } |
| | |
| | | String status = 'success'; |
| | | Response resp = new Response(); |
| | | Savepoint sp = Database.setSavepoint(); |
| | | Boolean isClone = false; |
| | | String rid = ''; |
| | | String awsDataId = ''; |
| | | try{ |
| | | System.debug('abcde'); |
| | | if(isNew){ |
| | | awsDataId = (String)leadInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Lead[] leads = [select id from Lead where AWS_Data_Id__c =:awsDataId]; |
| | | |
| | | if(!isNew){ |
| | | isClone = leads.size() == 0; |
| | | } |
| | | System.debug('isClone---------'+isClone); |
| | | |
| | | if(isNew || isClone){ |
| | | System.debug('leadInfozhj = ' + leadInfo); |
| | | if(!Test.isRunningTest()){ |
| | | insert leadInfo; |
| | | } |
| | | }else{ |
| | | System.debug('into update'); |
| | | String awsDataId = (String)leadInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Lead[] leads = [select id from Lead where AWS_Data_Id__c =:awsDataId]; |
| | | // String awsDataId = (String)leadInfo.get('AWS_Data_Id__c'); |
| | | // System.debug('awsDataId = ' + awsDataId); |
| | | // Lead[] leads = [select id from Lead where AWS_Data_Id__c =:awsDataId]; |
| | | System.debug('leads[0].id = ' + leads[0].id); |
| | | leadInfo.put('Id',leads[0].id);//For testing; |
| | | if(!Test.isRunningTest()){ |
| | |
| | | System.debug('resp from sfdx back-end' + resp); |
| | | return resp; |
| | | |
| | | } catch(DmlException e) { |
| | | 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)leadInfo.get('AWS_Data_Id__c'),rid,transId, leadJson ,status,e.getMessage()+e.getStackTraceString()); |
| | | return resp; |
| | | |
| | | } catch(Exception e) { |
| | | System.debug('into catch'+e.getMessage()); |
| | | Database.rollback(sp); |
| | |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | | public static String sobjectTypeValue = 'Report__c'; |
| | | public Boolean isNewMode{set;get;} |
| | | public Boolean isCloneMode{protected set;get;} |
| | | public String rtTypeId {get; set;} |
| | | public String AWSDataId{set;get;} |
| | | public String contactId{set;get;}//For Lookup field |
| | |
| | | AWSToSobjectEncryptedMap = new Map<string,string>(); |
| | | sobjectId = [SELECT CustomObjectId,CustomObjectName FROM CustomObjectUserLicenseMetrics where CustomObjectName ='Report' limit 1].CustomObjectId; |
| | | isNewMode = true; |
| | | isCloneMode = false; |
| | | Input_Required_Field_Msg = Label.Input_Required_Field_Msg; |
| | | PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg; |
| | | sobjecttypeForFrontEnd = sobjectTypeValue; |
| | |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | if(mso != null && mso.containsKey('newclone')){ |
| | | isCloneMode = true; |
| | | } |
| | | SObject obj = controller.getRecord(); |
| | | if(obj.Id != null){ |
| | |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | }else{ |
| | | //新建 |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | // Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | //医院/科室/经销商(手写) |
| | | if(mso.containsKey('00N10000002GE3Z')){ |
| | | controller.getRecord().put('Manual_Name__c',mso.get('00N10000002GE3Z')); |
| | |
| | | Savepoint sp = Database.setSavepoint(); |
| | | String rid = ''; |
| | | //自定义格式转换 |
| | | Boolean isClone = false; |
| | | try{ |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | if(!fieldAPIToTypeMap.containskey(fieldAPI)){ |
| | |
| | | } |
| | | System.debug('自定义格式转换结束'); |
| | | |
| | | String awsDataId = (String)reportInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | report__c[] reports = [select id from report__c where AWS_Data_Id__c =:awsDataId]; |
| | | |
| | | if(!isNew){ |
| | | isClone = reports.size() == 0; |
| | | } |
| | | if(isNew){ |
| | | System.debug('reportInfo = ' + reportInfo); |
| | | if(!Test.isRunningTest()){ |
| | |
| | | } |
| | | }else{ |
| | | System.debug('into update'); |
| | | String awsDataId = (String)reportInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | report__c[] reports = [select id from report__c where AWS_Data_Id__c =:awsDataId]; |
| | | // String awsDataId = (String)reportInfo.get('AWS_Data_Id__c'); |
| | | // System.debug('awsDataId = ' + awsDataId); |
| | | // 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()){ |
| | |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | | public static String sobjectTypeValue = 'Consum_Apply__c'; |
| | | public Boolean isNewMode{set;get;} |
| | | public Boolean isCloneMode{protected set;get;} |
| | | public String rtTypeId {get; set;} |
| | | public String AWSDataId{set;get;} |
| | | public List<String> encryptedAPIList{set;get;} |
| | |
| | | public NewConsumApplyController(ApexPages.StandardController controller) { |
| | | ApiPrefix = 'PIBackApi'; |
| | | isNewMode = true; |
| | | isCloneMode = false; |
| | | Input_Required_Field_Msg = Label.Input_Required_Field_Msg; |
| | | PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg; |
| | | //获取所有字段 |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Consum_Apply__c').getDescribe().fields.getMap().keyset()); |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | if(mso != null && mso.containsKey('newclone')){ |
| | | isCloneMode = true; |
| | | } |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | |
| | | //新建 |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | // Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | system.debug('mso='+mso); |
| | | if(mso.containsKey('00N10000008rdgs')){ |
| | | controller.getRecord().put('demo_purpose2__c',mso.get('00N10000008rdgs')); |
| | |
| | | Response resp = new Response(); |
| | | Savepoint sp = Database.setSavepoint(); |
| | | String rid = ''; |
| | | Boolean isClone = false; |
| | | String awsDataId = ''; |
| | | |
| | | try{ |
| | | System.debug('abcde'); |
| | | if(isNew){ |
| | | awsDataId = (String)consumApplyInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Consum_Apply__c[] ConsumApplys = [select id from Consum_Apply__c where AWS_Data_Id__c =:awsDataId]; |
| | | if(!isNew){ |
| | | isClone = ConsumApplys.size() == 0; |
| | | } |
| | | if(isNew || isClone){ |
| | | System.debug('consumApplyInfozhj = ' + consumApplyInfo); |
| | | insert consumApplyInfo; |
| | | System.debug('consumApplyInfo.Id' + consumApplyInfo.Id); |
| | | }else{ |
| | | System.debug('into update'); |
| | | String awsDataId = (String)consumApplyInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Consum_Apply__c[] ConsumApplys = [select id from Consum_Apply__c where AWS_Data_Id__c =:awsDataId]; |
| | | // String awsDataId = (String)consumApplyInfo.get('AWS_Data_Id__c'); |
| | | // System.debug('awsDataId = ' + awsDataId); |
| | | // Consum_Apply__c[] ConsumApplys = [select id from Consum_Apply__c where AWS_Data_Id__c =:awsDataId]; |
| | | System.debug('ConsumApplys[0].id = ' + ConsumApplys[0].id); |
| | | consumApplyInfo.put('Id',ConsumApplys[0].id);//For testing; |
| | | update consumApplyInfo; |
| | |
| | | public String sobjectPrefix{set;get;} |
| | | public String sobjecttypeForFrontEnd{set;get;} |
| | | public String sobjectId{set;get;} |
| | | public String workLocationSelect{set;get;} |
| | | public String RepairSubOrderAWSDataId{set;get;} |
| | | public String staticResourceRepairSubOrder{set;get;} |
| | | public NewRepairController(ApexPages.StandardController controller) { |
| | | sobjectId = [SELECT CustomObjectId,CustomObjectName FROM CustomObjectUserLicenseMetrics where CustomObjectName ='Repair' limit 1].CustomObjectId; |
| | | isNewMode = true; |
| | |
| | | //新建 |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | system.debug('mso='+mso); |
| | | //修理品返送地 |
| | | if(mso.containsKey('00N10000006P6SM')){ |
| | | controller.getRecord().put('SalesOfficeCode_selection__c',mso.get('00N10000006P6SM')); |
| | | } |
| | | if(mso.containsKey('00N10000002FH86')){ |
| | | controller.getRecord().put('On_site_repair__c',mso.get('00N10000002FH86')); |
| | | //controller.getRecord().put('On_site_repair__c',mso.get('00N10000002FH86')); |
| | | //Repair_Source__c |
| | | controller.getRecord().put('Repair_Source__c',mso.get('00N10000002FH86')); |
| | | } |
| | | if(mso.containsKey('00N10000006P6Rn')){ |
| | | controller.getRecord().put('work_location_select__c',mso.get('00N10000006P6Rn')); |
| | | workLocationSelect = mso.get('00N10000006P6Rn'); |
| | | System.debug('workLocationSelect = ' + workLocationSelect); |
| | | } |
| | | //问题内容描述00N10000002Dx6I |
| | | if(mso.containsKey('00N10000002Dx6I')){ |
| | | controller.getRecord().put('Repair_Detail__c',mso.get('00N10000002Dx6I')); |
| | | } |
| | | //问题联络收到日00N10000008rsVQ |
| | | if(mso.containsKey('00N10000008rsVQ')){ |
| | | String o = mso.get('00N10000008rsVQ'); |
| | | controller.getRecord().put('DateReceiptQuestions__c',(String.isBlank(o)||String.isEmpty(o))? null:Date.valueOf(o.replace('/', '-'))); |
| | | } |
| | | |
| | | //是否有死亡、伤害、感染00N10000008rsW7 |
| | | if(mso.containsKey('00N10000008rsW7')){ |
| | | controller.getRecord().put('ifDeadHurt__c',mso.get('00N10000008rsW7')); |
| | | } |
| | | //是否和这次的产品故障有关00N10000008rsVw |
| | | if(mso.containsKey('00N10000008rsVw')){ |
| | | controller.getRecord().put('ProductFailureRelated__c',mso.get('00N10000008rsVw')); |
| | | } |
| | | //医院有没有向政府机关报告不良事件或疑似不良事件00N10000008rsW2 |
| | | if(mso.containsKey('00N10000008rsW2')){ |
| | | controller.getRecord().put('ReportAdverseEvents__c',mso.get('00N10000008rsW2')); |
| | | } |
| | | //做的是哪个项目00N10000008rsW6 |
| | | if(mso.containsKey('00N10000008rsW6')){ |
| | | controller.getRecord().put('WhatProject__c',mso.get('00N10000008rsW6')); |
| | | } |
| | | //手术/检查名称00N10000008rsVk |
| | | if(mso.containsKey('00N10000008rsVk')){ |
| | | controller.getRecord().put('OperationOrExaminationName__c',mso.get('00N10000008rsVk')); |
| | | } |
| | | //是否有发生断裂或脱落00N10000008rsVN |
| | | if(mso.containsKey('00N10000008rsVN')){ |
| | | controller.getRecord().put('BreakORFallOff__c',mso.get('00N10000008rsVN')); |
| | | } |
| | | //配套使用产品00N10000008rsW4 |
| | | if(mso.containsKey('00N10000008rsW4')){ |
| | | controller.getRecord().put('SupportingProducts__c',mso.get('00N10000008rsW4')); |
| | | } |
| | | //发现故障后,医院对患者的处理情况00N10000008rsVL |
| | | if(mso.containsKey('00N10000008rsVL')){ |
| | | controller.getRecord().put('AfterFailureInformation__c',mso.get('00N10000008rsVL')); |
| | | } |
| | | //发现故障现象后,有延误15分钟以上的手术实施的情况发生吗00N10000008rsVR |
| | | if(mso.containsKey('00N10000008rsVR')){ |
| | | controller.getRecord().put('Delay15Min__c',mso.get('00N10000008rsVR')); |
| | | } |
| | | //信息是从医院的谁那里得到的00N10000008rsVZ |
| | | if(mso.containsKey('00N10000008rsVZ')){ |
| | | controller.getRecord().put('InformationFrom__c',mso.get('00N10000008rsVZ')); |
| | | } |
| | | //在医院,故障发生的频率是多少00N10000008rsVT |
| | | if(mso.containsKey('00N10000008rsVT')){ |
| | | controller.getRecord().put('FailureQInHospital__c',mso.get('00N10000008rsVT')); |
| | | } |
| | | //问题发生时间情况00N10000008rsVv |
| | | if(mso.containsKey('00N10000008rsVv')){ |
| | | controller.getRecord().put('ProblemOccurred__c',mso.get('00N10000008rsVv')); |
| | | } |
| | | //是否用该产品完成了手术/检查00N10000008rsW5 |
| | | if(mso.containsKey('00N10000008rsW5')){ |
| | | if(mso.get('00N10000008rsW5') != 'undefined'){ |
| | | controller.getRecord().put('UseFailProductFinish__c',mso.get('00N10000008rsW5')); |
| | | } |
| | | } |
| | | //故障发生日00N10000002Dx5y |
| | | if(mso.containsKey('00N10000002Dx5y')){ |
| | | String o = mso.get('00N10000002Dx5y'); |
| | | controller.getRecord().put('Failure_Occurrence_Date__c',(String.isBlank(o)||String.isEmpty(o))? null:Date.valueOf(o.replace('/', '-'))); |
| | | } |
| | | //修理委托者(FSE)CF00N10000002EMHw_lkid |
| | | if(mso.containsKey('CF00N10000002EMHw_lkid')){ |
| | | controller.getRecord().put('Incharge_Staff__c',mso.get('CF00N10000002EMHw_lkid')); |
| | | } |
| | | //原修理受付番号00N1m000005gt1l |
| | | if(mso.containsKey('00N1m000005gt1l')){ |
| | | controller.getRecord().put('Old_Name__c',mso.get('00N1m000005gt1l')); |
| | | } |
| | | //设备型号CF00N10000002Dx1X_lkid |
| | | if(mso.containsKey('CF00N10000002Dx1X_lkid')){ |
| | | controller.getRecord().put('Delivered_Product__c',mso.get('CF00N10000002Dx1X_lkid')); |
| | | } |
| | | //维修委托书号码00N10000006P1dw |
| | | if(mso.containsKey('00N10000006P1dw')){ |
| | | controller.getRecord().put('PaperRepairRequestNo__c',mso.get('00N10000006P1dw')); |
| | | } |
| | | |
| | | //通过id查 |
| | | Repair__c rc = null; |
| | | if (mso.containsKey('RepairId')) { |
| | | String RepairId = mso.get('RepairId'); |
| | | rc = [select Hospital__c,Department_Class__c,Account__c,Dealer__c,Incharge_Staff_Contact__c,Incharge_Staff__c from Repair__c where id =:RepairId ]; |
| | | //医院 |
| | | controller.getRecord().put('Hospital__c',rc.Hospital__c); |
| | | //战略科室分类 |
| | | controller.getRecord().put('Department_Class__c',rc.Department_Class__c); |
| | | //科室 |
| | | controller.getRecord().put('Account__c',rc.Account__c); |
| | | //经销商名 |
| | | controller.getRecord().put('Dealer__c',rc.Dealer__c); |
| | | //修理委托者(员工) |
| | | controller.getRecord().put('Incharge_Staff_Contact__c',rc.Incharge_Staff_Contact__c); |
| | | //修理委托者(FSE) |
| | | controller.getRecord().put('Incharge_Staff__c',rc.Incharge_Staff__c); |
| | | } |
| | | |
| | | //市场多年保修 有偿/无偿修理00N10000008rG4p |
| | | if(mso.containsKey('00N10000008rG4p')){ |
| | | controller.getRecord().put('RepairCostType__c',mso.get('00N10000008rG4p')); |
| | | } |
| | | //服务方式00N10000002F6dW |
| | | if(mso.containsKey('00N10000002F6dW')){ |
| | | controller.getRecord().put('On_site_repair__c',mso.get('00N10000002F6dW')); |
| | | } |
| | | //返品方式00N1m000004QmcJ |
| | | if(mso.containsKey('00N1m000004QmcJ')){ |
| | | controller.getRecord().put('Returns_Product_way__c',mso.get('00N1m000004QmcJ')); |
| | | } |
| | | //问题内容描述(图片)00N10000008rsVuEAI |
| | | if(mso.containsKey('00N10000008rsVuEAI')){ |
| | | controller.getRecord().put('ProblemDescription__c',mso.get('00N10000008rsVuEAI')); |
| | | } |
| | | //报修人00N1m0000054ufW |
| | | if(mso.containsKey('00N1m0000054ufW')){ |
| | | controller.getRecord().put('RepairApplicant__c',mso.get('00N1m0000054ufW')); |
| | | } |
| | | //报修人医院00N1m0000054ufU |
| | | if(mso.containsKey('00N1m0000054ufU')){ |
| | | controller.getRecord().put('RepairApplicantHospital__c',mso.get('00N1m0000054ufU')); |
| | | } |
| | | //报修人科室00N1m0000054ufT |
| | | if(mso.containsKey('00N1m0000054ufT')){ |
| | | controller.getRecord().put('RepairApplicantDepartment__c',mso.get('00N1m0000054ufT')); |
| | | } |
| | | //送修物流方式00N1m0000054ufE |
| | | if(mso.containsKey('00N1m0000054ufE')){ |
| | | controller.getRecord().put('DeliveryLogisticsMode__c',mso.get('00N1m0000054ufE')); |
| | | } |
| | | //送修物流最新状态00N1m0000054ufk |
| | | if(mso.containsKey('00N1m0000054ufk')){ |
| | | controller.getRecord().put('LogisticsLatestStatus__c',mso.get('00N1m0000054ufk')); |
| | | } |
| | | //送修物流单号00N1m0000054ufF |
| | | if(mso.containsKey('00N1m0000054ufF')){ |
| | | controller.getRecord().put('DeliveryLogisticsNo__c',mso.get('00N1m0000054ufF')); |
| | | } |
| | | //送修物流信息备注00N1m0000054ufD |
| | | if(mso.containsKey('00N1m0000054ufD')){ |
| | | controller.getRecord().put('DeliveryLogisticsAnnotation__c',mso.get('00N1m0000054ufD')); |
| | | } |
| | | //超时报告的理由00N10000008rsVS |
| | | if(mso.containsKey('00N10000008rsVS')){ |
| | | controller.getRecord().put('DelayReportReason__c',mso.get('00N10000008rsVS')); |
| | | } |
| | | //报修子单CF00N1m0000054ufZ_lkid |
| | | if(mso.containsKey('CF00N1m0000054ufZ_lkid')){ |
| | | controller.getRecord().put('RepairSubOrder__c',mso.get('CF00N1m0000054ufZ_lkid')); |
| | | //查询AWSDataId |
| | | List<RepairSubOrder__c> rso = [select AWS_Data_Id__c from RepairSubOrder__c where Id=:mso.get('CF00N1m0000054ufZ_lkid')]; |
| | | if(rso.size() > 0){ |
| | | RepairSubOrderAWSDataId = rso[0].AWS_Data_Id__c; |
| | | } |
| | | } |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | if(String.isBlank(rtTypeId)||String.isEmpty(rtTypeId)){ |
| | |
| | | PIHelper.PIIntegration piIntegration = PIHelper.getPIIntegrationInfo('Repair__c'); |
| | | PIHelper.PIIntegration piIntegrationAddress = PIHelper.getPIIntegrationInfo('Address__c'); |
| | | PIHelper.PIIntegration piIntegrationContact = PIHelper.getPIIntegrationInfo('Contact'); |
| | | PIHelper.PIIntegration piIntegrationRepairSubOrder = PIHelper.getPIIntegrationInfo('RepairSubOrder__c'); |
| | | staticResource = JSON.serialize(piIntegration); |
| | | staticResourceAddress = JSON.serialize(piIntegrationAddress); |
| | | staticResourceContact = JSON.serialize(piIntegrationContact); |
| | | staticResourceRepairSubOrder = JSON.serialize(piIntegrationRepairSubOrder); |
| | | encryptedAPIList = piIntegration.PIFields; |
| | | sobjectPrefix = piIntegration.sobjectPrefix; |
| | | } |
| | |
| | | } |
| | | |
| | | @RemoteAction |
| | | global static Response EncryptUpdate(string rid){ |
| | | |
| | | boolean b = AWSServiceTool2.EncryptPushData(new string[]{rid}); |
| | | Response r = new Response(); |
| | | r.status = b ? 'success' : 'failed'; |
| | | r.message = b ? '' : '加密推送失败'; |
| | | r.recordId = rid; |
| | | return r; |
| | | } |
| | | |
| | | @RemoteAction |
| | | global static Response saveRepair(String repairJson,String transId,Boolean isNew) { |
| | | System.debug('Repair__c Info:' + JSON.serialize(repairJson)); |
| | | //1. Prepare the payload for Repair__c |
| | |
| | | url = ApexPages.currentPage().getParameters().put('00N10000006P6Rn','北京办事处'); |
| | | url = ApexPages.currentPage().getParameters().put('RecordType',recordTypeId); |
| | | |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx66_lkid','0011000000V9TM6'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx66','%E5%89%91%E9%98%81%E5%8E%BF%E4%BA%BA%E6%B0%91%E5%8C%BB%E9%99%A2'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx5t_lkid','0011000000VAFmh'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx5t','%E5%89%91%E9%98%81%E5%8E%BF%E4%BA%BA%E6%B0%91%E5%8C%BB%E9%99%A2+ET'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx5n_lkid','0011000000VAFmh'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx5n','%E5%89%91%E9%98%81%E5%8E%BF%E4%BA%BA%E6%B0%91%E5%8C%BB%E9%99%A2+ET'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx1X_lkid','02i10000004FhGu'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx1X','MH-443%3A%E5%90%B8%E5%BC%95%E6%8C%89%E9%92%AE'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000002FH86','%e5%8f%aa%e4%bf%ae%e7%90%86'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000006P6Rn','%E5%8C%97%E4%BA%AC%E5%8A%9E%E4%BA%8B%E5%A4%84'); |
| | | |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002FIJZ_lkid','a0f1000000cS7qH'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002FIJZ','OCSM-%E8%A5%BF%E5%8C%97-153PA-07878'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx66_lkid','0011000000V9SnP'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx66','%E6%B7%AE%E6%BB%A8%E5%8E%BF%E4%BA%BA%E6%B0%91%E5%8C%BB%E9%99%A2'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx5t_lkid','0011000000V9ZEI'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx5t','%E6%B7%AE%E6%BB%A8%E5%8E%BF%E4%BA%BA%E6%B0%91%E5%8C%BB%E9%99%A2+%E6%B6%88%E5%8C%96%E7%A7%91'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx5n_lkid','0011000000VALNX'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx5n','%E6%B7%AE%E6%BB%A8%E5%8E%BF%E4%BA%BA%E6%B0%91%E5%8C%BB%E9%99%A2+%E6%B6%88%E5%8C%96%E7%A7%91+%E8%83%83%E9%95%9C%E5%AE%A4'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx1X_lkid','02i10000004ExNO'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002Dx1X','GIF-H170%3A%E7%94%B5%E5%AD%90%E4%B8%8A%E6%B6%88%E5%8C%96%E9%81%93%E5%86%85%E7%AA%A5%E9%95%9C'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002EMHw_lkid','00510000005sFUG'); |
| | | url = ApexPages.currentPage().getParameters().put('CF00N10000002EMHw','%E5%90%95%20%E5%85%A8%E5%A5%BD'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000002Dx5y','2020/08/05'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000006P6SM','%E9%83%91%E5%B7%9E'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000002FH86','%E4%BB%8EQIS'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000006P6Rn','%E5%8C%97%E4%BA%AC%E5%8A%9E%E4%BA%8B%E5%A4%84'); |
| | | |
| | | Repair__c repTest = TestDataUtility.CreateRepairs(1)[0]; |
| | | url = ApexPages.currentPage().getParameters().put('RepairId',repTest.Id); |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(new Repair__c()); |
| | | NewRepairController repDetail = new NewRepairController(con); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod3(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Repair__c'); |
| | | NewRepairController.EncryptUpdate('a0J1m000001QqXk'); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 03-28-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | global without sharing class OnCallController { |
| | | public String layoutSectionsStr {get; set;}//for dynamic add readonly attribute |
| | | public List <LayoutDescriberHelper.LayoutSection > layoutSections{set;get;} |
| | |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | | public static String sobjectTypeValue = 'On_Call__c'; |
| | | public Boolean isNewMode{set;get;} |
| | | public Boolean isCloneMode{protected set;get;} |
| | | public String rtTypeId {get; set;} |
| | | public String AWSDataId{set;get;} |
| | | public List<String> encryptedAPIList{set;get;} |
| | |
| | | public OnCallController(ApexPages.StandardController controller) { |
| | | // sobjectId = [SELECT CustomObjectId,CustomObjectName FROM CustomObjectUserLicenseMetrics where CustomObjectName ='OnCall' limit 1].CustomObjectId; |
| | | isNewMode = true; |
| | | isCloneMode = false; |
| | | Input_Required_Field_Msg = Label.Input_Required_Field_Msg; |
| | | PIPL_Name_Label = Label.PIPL_Name_Label; |
| | | PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg; |
| | |
| | | if(!Test.isRunningTest()){ |
| | | controller.addFields(fieldList); |
| | | } |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | System.debug('mso:' + mso); |
| | | if(mso != null && mso.containsKey('newclone')){ |
| | | isCloneMode = true; |
| | | } |
| | | System.debug('isClone:' + isCloneMode); |
| | | SObject obj = controller.getRecord(); |
| | | if(obj.Id != null){ |
| | | //更新 |
| | |
| | | On_Call__c onCallInfo = new On_Call__c(); |
| | | //自定义格式转换 |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | system.debug('field API'+fieldAPI); |
| | | if(!fieldAPIToTypeMap.containskey(fieldAPI)){ |
| | | continue; |
| | | } |
| | | system.debug('field API='+fieldAPI); |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | system.debug('Field Type:'+fielddataType+' field Value='+fieldValue); |
| | | if(String.valueOf(fielddataType)=='DATE'){ |
| | | onCallInfo.put(fieldAPI,(String.isBlank(fieldValue)||String.isEmpty(fieldValue))? null:Date.valueOf(fieldValue.replace('/', '-'))); |
| | | }else if(String.valueOf(fielddataType)=='DATETIME'){ |
| | | if(String.isNotBlank(fieldValue)&&fieldValue.contains('T')){ |
| | | fieldValue = fieldValue.replace('T',' '); |
| | | onCallInfo.put(fieldAPI, Datetime.valueOfGmt(fieldValue)); |
| | | //20220405 By ChenYanan Start |
| | | }else if(String.isNotBlank(fieldValue)) { |
| | | fieldValue = fieldValue.replace('/', '-') + ':00'; |
| | | System.debug('fieldValue = ' + fieldValue); |
| | | onCallInfo.put(fieldAPI, Datetime.valueOf(fieldValue)); |
| | | //20220405 By ChenYanan End |
| | | }else{ |
| | | onCallInfo.put(fieldAPI, null); |
| | | } |
| | | |
| | | }else if(String.valueOf(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='CURRENCY'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | onCallInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?null:Decimal.valueOf(fieldValue.replace(',', ''))); |
| | | }else if(String.valueof(fielddataType)=='CURRENCY'|| String.valueof(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | onCallInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?0:Decimal.valueOf(fieldValue)); |
| | | } else if(String.valueof(fielddataType)=='BOOLEAN'){ |
| | | onCallInfo.put(fieldAPI, fieldValueMap.get(fieldAPI)); |
| | | }else { |
| | | onCallInfo.put(fieldAPI, String.valueOf(fieldValueMap.get(fieldAPI))); |
| | | onCallInfo.put(fieldAPI,fieldValue); |
| | | } |
| | | } |
| | | |
| | |
| | | Response resp = new Response(); |
| | | Savepoint sp = Database.setSavepoint(); |
| | | String rid = ''; |
| | | Boolean isClone = false; |
| | | String awsDataId = ''; |
| | | try{ |
| | | System.debug('abcde'); |
| | | if(isNew){ |
| | | System.debug('abcde'+isNew); |
| | | awsDataId = (String)onCallInfo.get('AWS_Data_Id__c'); |
| | | if (string.isBlank(awsDataId)) { |
| | | throw new DMLException('更新时AWS_Data_Id__c不能为空'); |
| | | } |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | On_Call__c[] onCalls = Database.query('select id from On_Call__c where AWS_Data_Id__c =:awsDataId'); |
| | | if(!isNew){ |
| | | isClone = onCalls.size() == 0; |
| | | } |
| | | if(isNew || isClone){ |
| | | System.debug('onCallInfozhj = ' + onCallInfo); |
| | | insert onCallInfo; |
| | | }else{ |
| | | System.debug('into update'); |
| | | String awsDataId = (String)onCallInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | On_Call__c[] onCalls = [select id from On_Call__c where AWS_Data_Id__c =:awsDataId]; |
| | | // String awsDataId = (String)onCallInfo.get('AWS_Data_Id__c'); |
| | | // System.debug('awsDataId = ' + awsDataId); |
| | | // On_Call__c[] onCalls = [select id from On_Call__c where AWS_Data_Id__c =:awsDataId]; |
| | | System.debug('onCalls[0].id = ' + onCalls[0].id); |
| | | onCallInfo.put('Id',onCalls[0].id);//For testing; |
| | | update onCallInfo; |
| | |
| | | /** |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 03-28-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | global without sharing class RentalApplyController { |
| | | public String layoutSectionsStr {get; set;}//for dynamic add readonly attribute |
| | | public List <LayoutDescriberHelper.LayoutSection > layoutSections{set;get;} |
| | |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | | public static String sobjectTypeValue = 'Rental_Apply__c'; |
| | | public Boolean isNewMode{set;get;} |
| | | public Boolean isCloneMode{protected set;get;} |
| | | public String rtTypeId {get; set;} |
| | | public String AWSDataId{set;get;} |
| | | public List<String> encryptedAPIList{set;get;} |
| | |
| | | public RentalApplyController(ApexPages.StandardController controller) { |
| | | ApiPrefix = 'PIBackApi'; |
| | | isNewMode = true; |
| | | isCloneMode = false; |
| | | Input_Required_Field_Msg = Label.Input_Required_Field_Msg; |
| | | PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg; |
| | | //获取所有字段 |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Rental_Apply__c').getDescribe().fields.getMap().keyset()); |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | if(mso != null && mso.containsKey('newclone')){ |
| | | isCloneMode = true; |
| | | } |
| | | if(!Test.isRunningTest()){ |
| | | controller.addFields(fieldList); |
| | | } |
| | |
| | | contactsInfo = JSON.serialize(sfIdToAWSIdMap); |
| | | }else{ |
| | | //新建 |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | // Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | system.debug('mso='+mso); |
| | | if(mso.containsKey('Name')){ |
| | | controller.getRecord().put('Name',mso.get('Name')); |
| | |
| | | Response resp = new Response(); |
| | | Savepoint sp = Database.setSavepoint(); |
| | | String rid = ''; |
| | | Boolean isClone = false; |
| | | String awsDataId = ''; |
| | | try{ |
| | | System.debug('abcde'); |
| | | if(isNew){ |
| | | awsDataId = (String)rentalApplyInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Rental_Apply__c[] RentalApplys = [select id from Rental_Apply__c where AWS_Data_Id__c =:awsDataId]; |
| | | if(!isNew){ |
| | | isClone = RentalApplys.size() == 0; |
| | | } |
| | | |
| | | if(isNew || isClone){ |
| | | System.debug('rentalApplyInfozhj = ' + rentalApplyInfo); |
| | | insert rentalApplyInfo; |
| | | System.debug('rentalApplyInfo.Id' + rentalApplyInfo.Id); |
| | | }else{ |
| | | System.debug('into update'); |
| | | String awsDataId = (String)rentalApplyInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Rental_Apply__c[] RentalApplys = [select id from Rental_Apply__c where AWS_Data_Id__c =:awsDataId]; |
| | | // String awsDataId = (String)rentalApplyInfo.get('AWS_Data_Id__c'); |
| | | // System.debug('awsDataId = ' + awsDataId); |
| | | // Rental_Apply__c[] RentalApplys = [select id from Rental_Apply__c where AWS_Data_Id__c =:awsDataId]; |
| | | System.debug('RentalApplys[0].id = ' + RentalApplys[0].id); |
| | | rentalApplyInfo.put('Id',RentalApplys[0].id);//For testing; |
| | | update rentalApplyInfo; |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-23-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="ASEActivity__c" extensions="NewAndEditASEActivityController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | |
| | | |
| | | //payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | |
| | | function ProcessPI(sobjJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode}) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(sobjJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(sobjJson, payloadForNewPI) |
| | |
| | | <div class="ptBody"> |
| | | <div class="content"> |
| | | <img src="/img/s.gif" alt="{! SobjectLabel}" class="pageTitleIcon" title="{! SobjectLabel}" /> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText> |
| | | <span class="titleSeparatingColon">:</span> |
| | | </h1> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <div class="blank"> </div> |
| | | </div> |
| | | <div class="links"> |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-23-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Address__c" extensions="NewAndEditAddressController" id="page"> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | |
| | | var VLookUpFields = new Set(['Contacts__c', 'Province__c', 'City__c', 'Customer__c']); |
| | | function ProcessPI(addressJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode}) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(addressJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(addressJson, payloadForNewPI) |
| | |
| | | payloadJson.Detailed_Address_Encrypted__c = r.object[0].detailedAddressEncrypt; |
| | | //payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | |
| | | //payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | var VLookUpFields = {! VLookUpFieldsJson}; |
| | | function ProcessPI(sobjJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode}) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(sobjJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(sobjJson, payloadForNewPI) |
| | |
| | | <div class="ptBody"> |
| | | <div class="content"> |
| | | <img src="/img/s.gif" alt="{! SobjectLabel}" class="pageTitleIcon" title="{! SobjectLabel}" /> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText> |
| | | <span class="titleSeparatingColon">:</span> |
| | | </h1> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <div class="blank"> </div> |
| | | </div> |
| | | <div class="links"> |
| | |
| | | <tr> |
| | | <td class="pbTitle"> |
| | | <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" /> |
| | | <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText></h2> |
| | | <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText></h2> |
| | | </td> |
| | | <td class="pbButton" id="topButtonRow"> |
| | | <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" /> |
| | |
| | | |
| | | //payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | var VLookUpFields = {! VLookUpFieldsJson}; |
| | | function ProcessPI(sobjJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode}) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(sobjJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(sobjJson, payloadForNewPI) |
| | |
| | | <div class="ptBody"> |
| | | <div class="content"> |
| | | <img src="/img/s.gif" alt="{! SobjectLabel}" class="pageTitleIcon" title="{! SobjectLabel}" /> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText> |
| | | <span class="titleSeparatingColon">:</span> |
| | | </h1> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <div class="blank"> </div> |
| | | </div> |
| | | <div class="links"> |
| | |
| | | <tr> |
| | | <td class="pbTitle"> |
| | | <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" /> |
| | | <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText></h2> |
| | | <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText></h2> |
| | | </td> |
| | | <td class="pbButton" id="topButtonRow"> |
| | | <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" /> |
| | |
| | | } |
| | | } |
| | | jQuery('a[data-id="OwnerId"]').remove(); |
| | | |
| | | /* |
| | | jQuery(".lookupInput").each(function(i,e){ |
| | | let je =jQuery(e).find('input'); |
| | | je.attr("readonly",""); |
| | | je.css("background","unset"); |
| | | |
| | | let dataid = je.attr('data-id'); |
| | | if(['Hospital_Name__c','Department_Class__c','OwnerId'].indexOf(dataid) > -1) return; |
| | | jQuery(e).children(":last-child").before('<img class="closeIcon" data-id="'+dataid+'" generate="" alt="Clear" src="/s.gif" style="display: inline-block;">'); |
| | | }) |
| | | |
| | | jQuery(".lookupInput").on("mouseenter","img[generate]",function(e){ |
| | | this.className = "closeIconOn"; |
| | | }); |
| | | |
| | | jQuery(".lookupInput").on("mouseleave","img[generate]",function(e){ |
| | | this.className = "closeIcon" |
| | | }); |
| | | |
| | | jQuery(".lookupInput").on("click","img[generate]",function(e){ |
| | | let id = jQuery("input[data-id='"+jQuery(this).attr("data-id")+ "']").attr("id"); |
| | | let input = document.getElementById(id); |
| | | if(input){ |
| | | input.value = ''; |
| | | let hidden = document.getElementById(id+'_lkid'); |
| | | if(hidden){ |
| | | hidden.value = ''; |
| | | } |
| | | } |
| | | });*/ |
| | | |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | |
| | | |
| | | //payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | var VLookUpFields = {! VLookUpFieldsJson}; |
| | | function ProcessPI(sobjJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode}) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(sobjJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(sobjJson, payloadForNewPI) |
| | |
| | | <div class="ptBody"> |
| | | <div class="content"> |
| | | <img src="/img/s.gif" alt="{! SobjectLabel}" class="pageTitleIcon" title="{! SobjectLabel}" /> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText> |
| | | <span class="titleSeparatingColon">:</span> |
| | | </h1> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <div class="blank"> </div> |
| | | </div> |
| | | <div class="links"> |
| | |
| | | <tr> |
| | | <td class="pbTitle"> |
| | | <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" /> |
| | | <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText></h2> |
| | | <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText></h2> |
| | | </td> |
| | | <td class="pbButton" id="topButtonRow"> |
| | | <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" /> |
| | |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | // jQuery(".lookupInput").on("click","img.closeIconOn",function(){ |
| | | // if (jQuery(this).siblings("input").attr("data-id") == 'Hospital_Name__c'){ |
| | | // clearVlookup('Department_Class__c'); |
| | | // clearVlookup('Hospital__c'); |
| | | // } |
| | | // }); |
| | | |
| | | jQuery("body").on("change","input[data-id='Hospital_Name__c']",function(){ |
| | | setTimeout(() => { |
| | |
| | | |
| | | //payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | var VLookUpFields = {! VLookUpFieldsJson}; |
| | | function ProcessPI(sobjJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode}) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(sobjJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(sobjJson, payloadForNewPI) |
| | |
| | | <div class="ptBody"> |
| | | <div class="content"> |
| | | <img src="/img/s.gif" alt="{! SobjectLabel}" class="pageTitleIcon" title="{! SobjectLabel}" /> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText> |
| | | <span class="titleSeparatingColon">:</span> |
| | | </h1> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <div class="blank"> </div> |
| | | </div> |
| | | <div class="links"> |
| | |
| | | var VLookUpFields = new Set(['Hospital_Name__c', 'Department_Class__c', 'Contact_Name__c', 'Campaign__c', 'Lead_Inquiry_form__c', 'Opp_Name_Search__c']); |
| | | function ProcessPI(leadJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode |
| | | }) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(leadJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(leadJson, payloadForNewPI) |
| | |
| | | payloadJson.Email_Encrypted__c = r.object[0].emailEncrypt; |
| | | //payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | |
| | | //payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | var VLookUpFields = {! VLookUpFieldsJson}; |
| | | function ProcessPI(sobjJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode}) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(sobjJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(sobjJson, payloadForNewPI) |
| | |
| | | return error_msg; |
| | | } |
| | | |
| | | function getCKEinstance(api_name){ |
| | | let t = jQuery("label[for$='textAreaDelegate_"+api_name+"']").parent().next().find("textarea")[0]; |
| | | if(t && t.id){ |
| | | return CKEDITOR.instances[t.id] |
| | | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | function getSobjectInformation() { |
| | | //api_id_map |
| | | //let nodelist = document.getElementsByClassName(config.ApiPrefix); |
| | |
| | | // } |
| | | } |
| | | //赋值富文本区域 |
| | | //问题内容描述(图片)-FSE-OCSM-OSH |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:4:j_id51:j_id52:15:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.problem_detail_photo__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:4:j_id51:j_id52:15:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | if(getCKEinstance('problem_detail_photo__c')){ |
| | | result.problem_detail_photo__c = getCKEinstance('problem_detail_photo__c').getData() |
| | | } |
| | | //问题内容描述(图片)-OSH回答完毕-现场结案-final |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:5:j_id51:j_id52:15:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.problem_detail_photo__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:5:j_id51:j_id52:15:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | |
| | | if(getCKEinstance('Photo_1__c')){ |
| | | result.Photo_1__c = getCKEinstance('Photo_1__c').getData() |
| | | |
| | | } |
| | | //照片1 - OCSM-现场结案-final |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:14:j_id51:j_id52:0:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_1__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:14:j_id51:j_id52:0:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | if(getCKEinstance('Photo_2__c')){ |
| | | result.Photo_2__c = getCKEinstance('Photo_2__c').getData() |
| | | } |
| | | //照片2-OCSM-现场结案-final |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:14:j_id51:j_id52:1:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_2__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:14:j_id51:j_id52:1:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | if(getCKEinstance('Photo_3__c')){ |
| | | result.Photo_3__c = getCKEinstance('Photo_3__c').getData() |
| | | } |
| | | //照片3 -OCSM-现场结案-final |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:14:j_id51:j_id52:2:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_3__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:14:j_id51:j_id52:2:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | if(getCKEinstance('Photo_4__c')){ |
| | | result.Photo_4__c = getCKEinstance('Photo_4__c').getData() |
| | | } |
| | | //照片4 -OCSM-现场结案-final |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:14:j_id51:j_id52:3:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_4__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:14:j_id51:j_id52:3:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | |
| | | if(getCKEinstance('Photo_OSH_1__c')){ |
| | | result.Photo_OSH_1__c = getCKEinstance('Photo_OSH_1__c').getData() |
| | | } |
| | | //照片OSH1 - OCSM |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:19:j_id51:j_id52:0:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_1__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:19:j_id51:j_id52:0:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | if(getCKEinstance('Photo_OSH_2__c')){ |
| | | result.Photo_OSH_2__c = getCKEinstance('Photo_OSH_2__c').getData() |
| | | } |
| | | //照片OSH2-OCSM |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:19:j_id51:j_id52:1:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_2__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:19:j_id51:j_id52:1:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | if(getCKEinstance('Photo_OSH_3__c')){ |
| | | result.Photo_OSH_3__c = getCKEinstance('Photo_OSH_3__c').getData() |
| | | } |
| | | //照片OSH3 -OCSM |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:19:j_id51:j_id52:2:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_3__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:19:j_id51:j_id52:2:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片OSH4 -OCSM |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:19:j_id51:j_id52:3:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_4__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:19:j_id51:j_id52:3:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片OSH1 - OSH回答完毕 |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:18:j_id51:j_id52:0:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_1__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:18:j_id51:j_id52:0:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片OSH2-OSH回答完毕 |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:18:j_id51:j_id52:1:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_2__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:18:j_id51:j_id52:1:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片OSH3 -OSH回答完毕 |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:18:j_id51:j_id52:2:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_3__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:18:j_id51:j_id52:2:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片OSH4 -OSH回答完毕 |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:18:j_id51:j_id52:3:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_4__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:18:j_id51:j_id52:3:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片1 - OSH |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:13:j_id51:j_id52:0:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_1__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:13:j_id51:j_id52:0:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片2-OSH |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:13:j_id51:j_id52:1:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_2__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:13:j_id51:j_id52:1:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片3 -OSH |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:13:j_id51:j_id52:2:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_3__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:13:j_id51:j_id52:2:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片4 -OSH |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:13:j_id51:j_id52:3:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_4__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:13:j_id51:j_id52:3:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片OSH1 - OSH |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:16:j_id51:j_id52:0:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_1__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:16:j_id51:j_id52:0:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片OSH2-OSH |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:16:j_id51:j_id52:1:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_2__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:16:j_id51:j_id52:1:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片OSH3 -OSH |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:16:j_id51:j_id52:2:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_3__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:16:j_id51:j_id52:2:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片OSH4 -OSH |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:16:j_id51:j_id52:3:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_4__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:16:j_id51:j_id52:3:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片OSH1 -现场结案-final |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:17:j_id51:j_id52:0:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_1__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:17:j_id51:j_id52:0:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片OSH2-现场结案-final |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:17:j_id51:j_id52:1:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_2__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:17:j_id51:j_id52:1:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片OSH3 -现场结案-final |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:17:j_id51:j_id52:2:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_3__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:17:j_id51:j_id52:2:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片OSH4 -现场结案-final |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:17:j_id51:j_id52:3:j_id53:textAreaDelegate_problem_detail_photo__c']")){ |
| | | result.Photo_OSH_4__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id50:17:j_id51:j_id52:3:j_id53:textAreaDelegate_problem_detail_photo__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | if(getCKEinstance('Photo_OSH_4__c')){ |
| | | result.Photo_OSH_4__c = getCKEinstance('Photo_OSH_4__c').getData() |
| | | } |
| | | return result; |
| | | } |
| | |
| | | <div class="ptBody"> |
| | | <div class="content"> |
| | | <img src="/img/s.gif" alt="{! SobjectLabel}" class="pageTitleIcon" title="{! SobjectLabel}" /> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText> |
| | | <span class="titleSeparatingColon">:</span> |
| | | </h1> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <div class="blank"> </div> |
| | | </div> |
| | | <div class="links"> |
| | |
| | | errorMsgNode.className = ''; |
| | | } |
| | | |
| | | function getCKEinstance(api_name){ |
| | | let t = jQuery("label[for$='textAreaDelegate_"+api_name+"']").parent().next().find("textarea")[0]; |
| | | if(t && t.id){ |
| | | return CKEDITOR.instances[t.id] |
| | | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | //1。获取所有字段值 |
| | | function getReportInformation() { |
| | | let nodelist = document.querySelectorAll("[data-id]"); |
| | |
| | | } else if (nodelist[index].type == 'select-multiple') { |
| | | //nodelist[index].getAttribute("data-id") |
| | | let multiple = nodelist[index].getAttribute("data-id"); |
| | | let targets = document.querySelector("[data-id=" + multiple + "]").nextSibling.children[0].children[1].children[2].innerText; |
| | | targets = targets.replace(/\n/g, ";"); |
| | | console.log('targets = ' + targets); |
| | | result[nodelist[index].getAttribute("data-id")] = targets; |
| | | //let targets = document.querySelector("[data-id=" + multiple + "]").nextSibling.children[0].children[1].children[2].innerText; |
| | | //Before Update By Li Jun 20220411 |
| | | // let targets = document.querySelector("[data-id=" + multiple + "]").parentNode.children[2].children[0].children[1].children[2].children[0].innerText; |
| | | // targets = targets.replace(/\n/g, ";"); |
| | | // console.log('targets = ' + targets); |
| | | // result[nodelist[index].getAttribute("data-id")] = targets; |
| | | //Before Update By Li Jun 20220411 |
| | | |
| | | //After Update By Li Jun 20220411 Start |
| | | let targets = document.querySelector("[data-id=" + multiple + "]").options; |
| | | let selValues = []; |
| | | for(i=0; i < targets.length; i++){ |
| | | if(targets[i].selected){ |
| | | selValues.push(targets[i].value); |
| | | } |
| | | } |
| | | let setValuesStr = JSON.stringify(selValues); |
| | | setValuesStr = setValuesStr.substring(1,setValuesStr.length-1); |
| | | if(setValuesStr){ |
| | | setValuesStr = setValuesStr.replace(/"/g,""); |
| | | if(setValuesStr.indexOf(',')!=-1){ |
| | | setValuesStr = setValuesStr.replace(/,/g,";"); |
| | | } |
| | | } |
| | | console.log('targets = ' + setValuesStr); |
| | | result[nodelist[index].getAttribute("data-id")] = setValuesStr; |
| | | //After Update By Li Jun 20220411 End |
| | | |
| | | |
| | | } else { |
| | | result[nodelist[index].getAttribute("data-id")] = nodelist[index].value; |
| | | } |
| | |
| | | result.Purpose2__c = document.getElementById('page:form:j_id5:j_id35:2:j_id36:j_id37:1:j_id38').value; |
| | | } |
| | | //富文本框赋值 |
| | | if(getCKEinstance('Customer_sigh_photo__c')){ |
| | | result.Customer_sigh_photo__c = getCKEinstance('Customer_sigh_photo__c').getData() |
| | | } |
| | | if(getCKEinstance('Photo1__c')){ |
| | | result.Photo1__c = getCKEinstance('Photo1__c').getData() |
| | | } |
| | | if(getCKEinstance('Photo2__c')){ |
| | | result.Photo2__c = getCKEinstance('Photo2__c').getData() |
| | | } |
| | | if(getCKEinstance('Photo3__c')){ |
| | | result.Photo3__c = getCKEinstance('Photo3__c').getData() |
| | | } |
| | | if(getCKEinstance('VOC_follow_up_result__c')){ |
| | | result.VOC_follow_up_result__c = getCKEinstance('VOC_follow_up_result__c').getData() |
| | | } |
| | | if(getCKEinstance('VOC_follow_up_result1__c')){ |
| | | result.VOC_follow_up_result1__c = getCKEinstance('VOC_follow_up_result1__c').getData() |
| | | } |
| | | //用户签字的照片 |
| | | if(document.querySelector("[aria-describedby = 'cke_34']")){ |
| | | result.Customer_sigh_photo__c = document.querySelector("[aria-describedby = 'cke_34']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片1 Photo1__c |
| | | if(document.querySelector("[aria-describedby = 'cke_42']")){ |
| | | result.Photo1__c = document.querySelector("[aria-describedby = 'cke_42']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片2 Photo2__c |
| | | if(document.querySelector("[aria-describedby = 'cke_75']")){ |
| | | result.Photo2__c = document.querySelector("[aria-describedby = 'cke_75']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //照片3 Photo3__c |
| | | if(document.querySelector("[aria-describedby = 'cke_108']")){ |
| | | result.Photo3__c = document.querySelector("[aria-describedby = 'cke_108']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //对应结果 VOC_follow_up_result__c cke_38 |
| | | if(document.querySelector("[aria-describedby = 'cke_38']")){ |
| | | result.VOC_follow_up_result__c = document.querySelector("[aria-describedby = 'cke_38']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | //对应结果第一次 VOC_follow_up_result1__c cke_71 |
| | | if(document.querySelector("[aria-describedby = 'cke_71']")){ |
| | | result.VOC_follow_up_result1__c = document.querySelector("[aria-describedby = 'cke_71']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | // if(document.querySelector("[aria-describedby = 'cke_34']")){ |
| | | // result.Customer_sigh_photo__c = document.querySelector("[aria-describedby = 'cke_34']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | // } |
| | | // //照片1 Photo1__c |
| | | // if(document.querySelector("[aria-describedby = 'cke_42']")){ |
| | | // result.Photo1__c = document.querySelector("[aria-describedby = 'cke_42']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | // } |
| | | // //照片2 Photo2__c |
| | | // if(document.querySelector("[aria-describedby = 'cke_75']")){ |
| | | // result.Photo2__c = document.querySelector("[aria-describedby = 'cke_75']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | // } |
| | | // //照片3 Photo3__c |
| | | // if(document.querySelector("[aria-describedby = 'cke_108']")){ |
| | | // result.Photo3__c = document.querySelector("[aria-describedby = 'cke_108']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | // } |
| | | // //对应结果 VOC_follow_up_result__c cke_38 |
| | | // if(document.querySelector("[aria-describedby = 'cke_38']")){ |
| | | // result.VOC_follow_up_result__c = document.querySelector("[aria-describedby = 'cke_38']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | // } |
| | | // //对应结果第一次 VOC_follow_up_result1__c cke_71 |
| | | // if(document.querySelector("[aria-describedby = 'cke_71']")){ |
| | | // result.VOC_follow_up_result1__c = document.querySelector("[aria-describedby = 'cke_71']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | // } |
| | | if(result.From__c){ |
| | | result.From__c = result.From__c.replace(/\//g, '-')+':00'; |
| | | } |
| | |
| | | //5.新建或编辑 |
| | | function ProcessPI(reportJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode}) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(reportJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(reportJson, payloadForNewPI) |
| | |
| | | payloadJson.age_Encrypted__c = result.object[0].ageEncrypt; |
| | | payloadJson.Medical_History_Encrypted__c = result.object[0].medicalHistoryEncrypt; |
| | | payloadJson.sex_Encrypted__c = result.object[0].sexEncrypt; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = result.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | |
| | | //payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | var VLookUpFields = {! VLookUpFieldsJson}; |
| | | function ProcessPI(sobjJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode}) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(sobjJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(sobjJson, payloadForNewPI) |
| | |
| | | <div class="ptBody"> |
| | | <div class="content"> |
| | | <img src="/img/s.gif" alt="{! SobjectLabel}" class="pageTitleIcon" title="{! SobjectLabel}" /> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText> |
| | | <h1 class="pageType">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText> |
| | | <span class="titleSeparatingColon">:</span> |
| | | </h1> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <h2 class="pageDescription"> <apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText>{! SobjectLabel}</h2> |
| | | <div class="blank"> </div> |
| | | </div> |
| | | <div class="links"> |
| | |
| | | <tr> |
| | | <td class="pbTitle"> |
| | | <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" /> |
| | | <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText></h2> |
| | | <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText></h2> |
| | | </td> |
| | | <td class="pbButton" id="topButtonRow"> |
| | | <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" /> |
| | |
| | | payloadJson.Phone_Number_Encrypt__c = r.object[0].phoneNumberEncrypt; |
| | | payloadJson.Direct_Shippment_Address_Encrypt__c = r.object[0].directShippmentAddressEncrypt; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | // New Or Edit |
| | | function ProcessPI(consumApplyJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode |
| | | }) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(consumApplyJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(consumApplyJson, payloadForNewPI) |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-24-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="On_Call__c" extensions="OnCallController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | |
| | | payloadJson.Caller_Phone_Encrypt__c = r.object[0].callerPhoneEncrypt; |
| | | payloadJson.Responsible_PersonHP_Encrypt__c = r.object[0].responsiblePersonHPEncrypt; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode|| {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | // New Or Edit |
| | | function ProcessPI(onCallJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode |
| | | }) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(onCallJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(onCallJson, payloadForNewPI) |
| | |
| | | <!-- |
| | | @description : |
| | | @author : Dennis |
| | | @group : |
| | | @last modified on : 04-01-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Rental_Apply__c" extensions="RentalApplyController" id="page"> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | |
| | | payloadJson.Phone_Number_Encrypt__c = r.object[0].phoneNumberEncrypt; |
| | | payloadJson.Direct_Shippment_Address_Encrypt__c = r.object[0].directShippmentAddressEncrypt; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | // New Or Edit |
| | | function ProcessPI(rentalApplyJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode |
| | | }) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(rentalApplyJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(rentalApplyJson, payloadForNewPI) |
| | |
| | | //Redirect Required Parameter |
| | | var redirectCallBack = function redirectCallBack(sfId, errorMessage) { |
| | | if (sfId) { |
| | | Visualforce.remoting.Manager.invokeAction( |
| | | 'NewRepairController.EncryptUpdate', // example |
| | | sfId, |
| | | function (result, event) { |
| | | console.log(result); |
| | | if(result.message){ |
| | | alert(result.message); |
| | | } |
| | | if (redirectMode == 'Save') { |
| | | window.open('/' + sfId, '_self'); |
| | | } else if (redirectMode == 'SaveAndNew') { |
| | | window.open('/setup/ui/recordtypeselect.jsp?ent=' + '{!sobjectId}' + '&retURL=/' + '{!sobjectPrefix}' + '/o&save_new_url=/' + '{!sobjectPrefix}' + '/e?retURL=%2F' + '{!sobjectPrefix}' + '%2Fo', '_self'); |
| | | } |
| | | |
| | | }, |
| | | { escape: true } |
| | | ); |
| | | |
| | | } else { |
| | | // alert(errorMessage); |
| | | alertErrorMessage(errorMessage); |
| | | } |
| | | } |
| | |
| | | if(e){ |
| | | result.Repair_Determine_result_ConfirmationUser__c = e.value; |
| | | } |
| | | //未修理归还理由 |
| | | //page:form:block:j_id34:17:j_id35:j_id36:2:j_id37 |
| | | //page:form:block:j_id34:17:j_id35:j_id36:2:j_id37 |
| | | if(document.getElementById('page:form:block:j_id34:17:j_id35:j_id36:2:j_id37')){ |
| | | result.Return_Without_Repair_Reason__c = document.getElementById('page:form:block:j_id34:17:j_id35:j_id36:2:j_id37').value; |
| | | } |
| | | console.log(JSON.stringify(result)); |
| | | return result; |
| | | } |
| | |
| | | |
| | | <!--Each section has layoutFields, let's iterate them as well--> |
| | | <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField"> |
| | | <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Repair__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}" |
| | | <apex:inputField html-title="{!layoutField.fieldAPI}" styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Repair__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}" |
| | | required="{!layoutField.isRequired}" /> |
| | | <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}"> |
| | | </apex:pageblocksectionitem> |
| | |
| | | }) |
| | | }) |
| | | |
| | | //维修中心 |
| | | if('{!workLocationSelect}' != ''){ |
| | | let wlNode = document.getElementById('page:form:block:j_id34:1:j_id35:j_id36:18:j_id37'); |
| | | if(wlNode){ |
| | | wlNode.removeAttribute("disabled") |
| | | var o = new Option() |
| | | o.text = '{!workLocationSelect}' |
| | | wlNode.options.add(o) |
| | | wlNode.value = '{!workLocationSelect}' |
| | | } |
| | | } |
| | | |
| | | //如果从报修子单过来,需要解密报修人 |
| | | if('{!RepairSubOrderAWSDataId}' != ''){ |
| | | var staticResourceRepairSubOrder = JSON.parse('{!staticResourceRepairSubOrder}'); |
| | | let queryBackRepairSubOrder = function queryBackRepairSubOrder(data) { |
| | | document.querySelector("[data-id='RepairApplicant__c']").value = data.object.repairApplicantName; |
| | | }; |
| | | AWSService.query(staticResourceRepairSubOrder.queryUrl, '{!RepairSubOrderAWSDataId}', queryBackRepairSubOrder, staticResourceRepairSubOrder.token); |
| | | } |
| | | |
| | | // jQuery(".lookupInput").each(function(i,e){ |
| | | // let je =jQuery(e).find('input'); |
| | | // je.attr("readonly",""); |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
| | | <Package xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <types> |
| | | <members>NewAndEditBaseController</members> |
| | | <members>NewAndEditBaseControllerTest</members> |
| | | <members>NewRepairController</members> |
| | | <members>NewRepairControllerTest</members> |
| | | <members>NewAndEditAddressController</members> |
| | | <members>NewAndEditAddressControllerTest</members> |
| | | <members>NewAndEditContactController</members> |
| | | <members>NewAndEditContactControllerTest</members> |
| | | <members>OnCallController</members> |
| | | <members>OnCallControllerTest</members> |
| | | <members>NewAndEditLeadController</members> |
| | | <members>NewAndEditLeadControllerTest</members> |
| | | <members>NewConsumApplyController</members> |
| | | <members>NewConsumApplyControllerTest</members> |
| | | <members>RentalApplyController</members> |
| | | <members>RentalApplyControllerTest</members> |
| | | <members>NewAndEditReportController</members> |
| | | <members>NewAndEditReportControllerTest</members> |
| | | <name>ApexClass</name> |
| | | </types> |
| | | <types> |
| | | <members>NewAndEditReport</members> |
| | | <members>NewRepair</members> |
| | | <members>NewAndEditTenderinformation</members> |
| | | <members>NewAndEditAgencyContact</members> |
| | | <members>NewRentalApply</members> |
| | | <members>NewConsumApply</members> |
| | | <members>NewAndEditLead</members> |
| | | <members>NewAndEditASEActivity</members> |
| | | <members>NewAndEditInspectionReport</members> |
| | | <members>NewAndEditAddress</members> |
| | | <members>NewOnCall</members> |
| | | <members>NewAndEditQIS</members> |
| | | <members>NewAndEditContact</members> |
| | | <members>NewAndEditInquiryForm</members> |
| | | <name>ApexPage</name> |
| | | </types> |
| | | <version>52.0</version> |
| | | </Package> |