global without sharing class StraightBackAddressController { /** * 页面顶部检索数据 */ public String typeText { get; set; } //第一个下拉列表 public Address__c optionAddressClassification{get;set;} public String txtName{get;set;}//客户名 public String txtAddress{get;set;}//地址 /***************表格数据*********************/ public List tableData { get; set; } //add by Wang Xueqin 2023/06/30 start //public String tableDataJson{ get; set; } //deloitte-zhj 20231114 PIPL还原 //add by Wang Xueqin 2023/06/30 end public String tableDataStr{ get; set; } //deloitte-zhj 20231011 PIPL还原 // public String staticResource {get; set;} // public String staticResourceContact {get; set;} // public String staticResourceRepair {get; set;} //zzm 20231026 start public String Province_Name {get; set;} //zzm 20231026 end public Contact newCon{get; set;} /***************底部 编辑和新增的 对象*******************/ public Address__c insUpdData{get;set;} public String insUpdDataStr{get;set;} /***************被编辑数据的id********************/ public String UpdId{get;set;} /***************复选框选中id*********************/ public String adoptId{get;set;} /***************联系人的对象*********************/ public Contact addContact{get;set;} /***************修理表的对象*********************/ public Repair__c pc{get;set;} /***************url传来的修理单id********************/ public String RepairId{get;set;} /***************获取科室的类型*********************/ public String hospitalTypp {get;set;} /*******************修理表上医院的id**********************/ public String hospitalId{get;set;} /*******************修理表上保有设备的id**********************/ public String equipmentlId{get;set;} /**************采用按钮展示名称(采用,采用并上传SAP)*************/ public String FSEApplyForRepairTime{get;set;} /**************是否上传SAP*************/ public Boolean isUpload{get;set;} /**************判断页面是否需要检索*************/ public Boolean isSearchBtn{get;set;} /**************当前登录人*************/ public String loginPerson{get;set;} /***************经销商名*************/ public String addressDealers{get;set;} /***************是否发生数据接口的序号*************/ public Integer AddressTypeIndex{get;set;} public String contactId{set;get;}//For Lookup field // Add by Li Jun for PIPL 20220308 Start public String contactNameValue{set;get;} public String contactIdValue{set;get;} public String addressDataIds{set;get;} public String sfRecordId{set;get;} // Add by Li Jun for PIPL 20220308 End public String accRecordTypeId {set;get;}//当前 记录类型id public String accOfficeTypeId {set;get;}//记录类型id 办事处 public String accAgencyTypeId {set;get;}//记录类型id 販売店 public String accAgencyContactTypeId {set;get;}//记录类型id 经销商联系人 public StraightBackAddressController() { //获取url数据 RepairId = System.currentPageReference().getParameters().get('id'); //获取当前登录人 loginPerson = (Userinfo.getUserId()).substring(0,15); typeText = ''; tableData = new List(); insUpdData = new Address__c(); pc = new Repair__c(); optionAddressClassification = new Address__c(); FSEApplyForRepairTime = ''; isUpload = false; UpdId = ''; adoptId = ''; hospitalId = ''; equipmentlId = ''; addressDealers = ''; isSearchBtn = true; AddressTypeIndex = 0; addContact = new Contact(); //查询到所有的科室类别 hospitalTypp = '診療科 その他,診療科 呼吸科,診療科 婦人科,診療科 普外科,診療科 泌尿科,診療科 消化科,診療科 耳鼻喉科,診療科(共通)'; //deloitte-zhj 20231114 PIPL还原 // staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Address__c')); // staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact')); // staticResourceRepair = JSON.serialize(PIHelper.getPIIntegrationInfo('Repair__c')); // System.debug('staticResourceRepair===>'+staticResourceRepair); } /** * 开始方法 */ public PageReference init(){ Schema.RecordTypeInfo recordTypeValue = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Office'); if(recordTypeValue == null){ recordTypeValue = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('office'); } accOfficeTypeId = recordTypeValue.getRecordTypeId(); accAgencyTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); accAgencyContactTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('AgencyContact').getRecordTypeId(); String RepairSql = makeTextRepairSql(RepairId); try{ pc = Database.query(RepairSql); system.debug('pc = ' + pc); //20230921 zzm DB202306407163 【P】直返地址:返品方式和修理页面的返品方式希望能自动匹配。 String FSE_State = pc.FSE_State__c; Province_Name = pc.FSE_State__c; if(FSE_State == '宁夏自治区') { Province_Name = '宁夏回族自治区'; } else if(FSE_State == '新疆自治区') { Province_Name = '新疆维吾尔自治区'; } else if(FSE_State == '内蒙古') { Province_Name = '内蒙古自治区'; } else if(FSE_State == '黑龙江省') { Province_Name = '黑龙江'; } //20230921 zzm DB202306407163 【P】直返地址:返品方式和修理页面的返品方式希望能自动匹配。 //给一个全局变量赋值医院id if(!String.isBlank(pc.HP_ID__c)){ hospitalId = pc.HP_ID__c; } //获取修理表上的保有设备id if(!String.isBlank(pc.Delivered_Product__c)){ equipmentlId = pc.Delivered_Product__c; } //获取当前修理的申请修理时间 SAP_Transfer_time__c:SAP修理申请时间 if(!String.isBlank(pc.SAP_Transfer_time__c+'')){ FSEApplyForRepairTime = pc.SAP_Transfer_time__c+''; } //主要用于记录是否需要触发接口使用 if(pc.Address_Type_Index__c != null){ AddressTypeIndex = pc.Address_Type_Index__c.intValue(); } if(!String.isBlank(pc.Returns_Product_way__c)){ System.debug('返品方式:'+pc.Returns_Product_way__c); if('返送医院'.equals(pc.Returns_Product_way__c)){ //获取修理表的医院,用于第一次进入页面时,检索条件:客户名 的默认值 if(!String.isBlank(pc.HP_Name__c)){ txtName = pc.HP_Name__c; optionAddressClassification.Address_Classification__c = '医院'; } }else if('返送办事处'.equals(pc.Returns_Product_way__c)){ optionAddressClassification.Address_Classification__c = '办事处'; // }else if ('备品中心'.equals(pc.Returns_Product_way__c)) { optionAddressClassification.Address_Classification__c = '备品'; // }else{ //获取当前修理的返送经销商 if(!String.isBlank(pc.Dealer__c) && '返送经销商'.equals(pc.Returns_Product_way__c)){ txtName = pc.Dealer__r.Name; optionAddressClassification.Address_Classification__c = '经销商'; } } } //所有的查询方法 searchBtn(); }catch(exception e){ //失败提示 System.debug('error : ' + e.getMessage() + ' -- ' + e.getLineNumber()); ApexPages.addMessages(e); } insUpdData = new Address__c(); newCon = new Contact(); return null; } //查询客户记录类型 public PageReference queryRecordType(){ if(insUpdData.Customer__c!=null){ String accid = insUpdData.Customer__c; Account acc = [SELECT id,name,RecordTypeId FROM Account WHERE id =: accid]; System.debug('acc---'+acc); System.debug('insUpdData---'+insUpdData); if(acc!=null&&acc.RecordTypeId!=null&&insUpdData.Customer__c!=null){ accRecordTypeId = acc.RecordTypeId; } } return null; } //编辑获取数据 public PageReference onEditor(){ if(!String.isBlank(UpdId)){ if(tableData != null && tableData.size() > 0){ insUpdData = new Address__c(); ID newId = ID.valueOf(UpdId); for(Integer i = 0;i 0){ if('空'.equals(UpdId)){//如果为 空 ,那么证明此数据是从修理表上带过来的数据 insUpdData = new Address__c(); insUpdData = tableData[0].address.clone(); }else{ insUpdData = new Address__c(); ID newId = ID.valueOf(UpdId); for(Integer i = 0;i(); insUpdData = new Address__c(); String typeSearchId = ''; //由于salseforce 的选项列表中的 无 删除不了,所以默认如果为 无,那么就是 医院 if(String.isBlank(typeText)){ typeText = '办事处'; } try{ if(('医院'.equals(typeText)) && pc.HP_ID__c != null){ //HP_ID__c 医院id typeSearchId = pc.HP_ID__c; String AccountSql = makeTextAccountSql(pc.HP_ID__c); //获取地址信息 List accoutList = Database.query(AccountSql); if(accoutList != null && accoutList.size() > 0){ indexCou++; tableData.add(new AddressData(accoutList[0],'none','inline','none','医院')); } } // //备品: // if(('备品'.equals(typeText))){ // //HP_ID__c 医院id // typeSearchId = pc.HP_ID__c; // String AccountSql = makeTextAccountSql(pc.HP_ID__c); // //获取地址信息 // List accoutList = Database.query(AccountSql); // if(accoutList != null && accoutList.size() > 0){ // indexCou++; // tableData.add(new AddressData(accoutList[0],'none','inline','none','备品')); // } // } //经销商: //1:如果查到多条经销商,并且在地址中查到有数据,只显示地址数据,如果地址数据没查不到,就不显示, //2:如果查到有一条经销商,那么第一行就是此经销商数据,从第二行开始为地址数据 if('经销商'.equals(typeText) && txtName != ''){ String AccountSql = makeTextAccountDealersSQl(); //获取地址信息 List accoutList = Database.query(AccountSql); if(accoutList != null && accoutList.size() > 0){//防止一条也没查到 if(accoutList.size() == 1){ indexCou++; tableData.add(new AddressData(accoutList[0],'none','inline','none','经销商')); }else{ tableData = new List(); } } } //获取地址信息 //参数:typeSearchId 类型为医院值为:医院的id 如果类型为经销商:值为返送经销商id 办事处:参数为空 String AddressSql = makeTextAddressSql(typeSearchId,Province_Name);//zzm 20231026 List dataList = Database.query(AddressSql); if(dataList != null && dataList.size()> 0){ indexCou += dataList.size(); System.debug('dataList-----'+dataList); for(Integer i = 0;i(); ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '共有 0 条数据,如果没有想要的经销商地址,请尝试精确检索条件。')); return null; } } } ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '共有 '+indexCou+' 条数据')); tableDataStr = JSON.serialize(tableData); //deloitte-zhj 20231114 PIPL还原 //add by Wang Xueqin 2023/06/30 start // List ids = new List(); // for(AddressData ad : tableData){ // ids.add(ad.address.Id); // } // tableDataJson = JSON.serialize(ids); // system.debug('tableDataJson = ' + tableDataJson); system.debug('tableDataStr = ' + tableDataStr); //add by Wang Xueqin 2023/06/30 end }catch(Exception e){ //失败提示 ApexPages.addMessages(e); } return null; } /** * 保存和修改的方法 */ public PageReference save(){ system.debug('Address value:'+JSON.serialize(insUpdData)); // WLIG-CCX4BB 【委托】修理直返收货地址功能改造 thh 20220513 start // if(String.isNotBlank(contactIdValue)&&String.isNotEmpty(contactIdValue)){ // system.debug('Contact Value:'+contactIdValue); // insUpdData.Contacts__c = contactIdValue; // } // WLIG-CCX4BB 【委托】修理直返收货地址功能改造 thh 20220513 end system.debug('Address value:'+JSON.serialize(insUpdData)); savepoint sp = Database.setsavepoint(); if(insUpdData != null){ boolean flag = true; //类型不能为空 if(String.isBlank(insUpdData.Address_Classification__c)){ flag = false; this.insUpdData.Address_Classification__c.addError('不能为空!'); }else if(insUpdData.Address_Classification__c == '办事处'){ this.insUpdData.Address_Classification__c.addError('办事处地址不能新增和修改!'); flag = false; return null; } //省份不能为空 if(String.isBlank(insUpdData.Province__c)){ flag = false; this.insUpdData.Province__c.addError('不能为空!'); } //市不能为空 if(String.isBlank(insUpdData.City__c)){ flag = false; this.insUpdData.City__c.addError('不能为空!'); } //电话不能为空 if(String.isBlank(insUpdData.Telephone__c)){ flag = false; this.insUpdData.Telephone__c.addError('不能为空!'); } //详细地址不能为空 System.debug('insUpdData.Detailed_Address__c1:' + insUpdData.Detailed_Address__c); if(String.isBlank(insUpdData.Detailed_Address__c)){ flag = false; this.insUpdData.Detailed_Address__c.addError('详细地址不能为空!'); } //客户不能为空 if(String.isBlank(String.valueOf(insUpdData.Customer__c))){ flag = false; this.insUpdData.Customer__c.addError('不能为空!'); }else{ //如果类型为医院,那么客户字段必须选择修理表下医院的科室 if(insUpdData.Address_Classification__c == '医院'){ String ty = insUpdData.Customer__c; String AccSQl = makeAccoutSoql(ty); System.debug('AccSQl>>>>> ' + AccSQl); System.debug('hospitalId>>>>> ' + hospitalId); List AccList = new List(); try{ AccList = Database.query(AccSQl); if(AccList != null && AccList.size() > 0){ for(Integer i = 0;i= 2){ // monicker = surname.substring(1,surname.length()); // surname = surname.substring(0,1); // } // System.debug('newCon = '+newCon); // addContact = new Contact(LastName = surname, // FirstName = monicker, // AccountId = insUpdData.Customer__c, // RecordTypeId = typeL, // LastName_Encrypted__c = newCon.LastName_Encrypted__c); // try{ // //新增一条联系人数据 // insert addContact; // sfRecordId = addContact.id; // insUpdData.Create_Contacts__c = ''; // }catch(Exception e){ // //ApexPages.addMessages(e); // Database.rollback(sp); // //失败提示 // System.debug('myException caught when save or submit: ' + e.getMessage() + e.getStackTraceString()); // ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, e.getMessage())); // isSearchBtn = false; // return null; // } // insUpdData.Contacts__c = addContact.id; // //name赋值 // /*if(insUpdData.Contacts__c == null){ // insUpdData.name = insUpdData.Customer__r.Name+'_'+insUpdData.Contacts__r.Name; // }else{ // insUpdData.name = insUpdData.Customer__r.Name+'_'+insUpdData.Create_Contacts__c; // }*/ // } // } } // else{//联系人和新建联系人不能都有值 // //判断新建联系人是否为空 // if(!String.isBlank(insUpdData.Create_Contacts__c)){ // flag = false; // this.insUpdData.Create_Contacts__c.addError('【联系人】和【联系人(新建)】不能同时都有值!'); // } // } //WLIG-CCX4BB 【委托】修理直返收货地址功能改造 thh 20220513 end if(flag){ try{ //新增或修改数据 upsert insUpdData; ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '保存成功!')); isSearchBtn = true; //保存成功,需要初始化一下此对象,防止再次点击此按钮保存一个条同样的数据 insUpdData = new Address__c(); //deloitte-zhj 20231128 PIPL还原 //deloitte-zhj 20231026 前台进行跳转 //zzm 20231026 start PageReference ref = new Pagereference('/apex/StraightBackAddress?id=' + RepairId); ref.setRedirect(true); return ref; //zzm 20231026 start }catch(Exception e){ ApexPages.addMessages(e); //ApexPages.addMessages(e); Database.rollback(sp); //失败提示 System.debug('myException caught when save or submit: ' + e.getMessage() + e.getStackTraceString()); ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, e.getMessage())); isSearchBtn = false; return null; } }else{ //判断保存是否成功,如果失败不需要刷新列表 isSearchBtn = false; } } return null; } //查询修理表数据 private String makeTextRepairSql(String uuid){ //zzm 20231026 FSE_State__c start String RepairSql = 'SELECT ID,NAME,FSE_State__c,HP_ID__c,HP_Name__c,Delivered_Product__c,FSE_ApplyForRepair_time__c,SAP_Transfer_time__c,Dealer__c,Dealer__r.Name,Returns_Product_way__c,Address_Type_Index__c,Incharge_Staff__r.UserRole.name,Incharge_Staff__r.Branch__c,Incharge_Staff__r.Profile.name FROM Repair__c where id = \''+RepairId+'\''; //zzm 20231026 FSE_State__c end return RepairSql; } //查询地址表数据 private String makeTextAddressSql(String typeSearchId,String Province_Name) { //zzm 20231026 //private String makeTextAddressSql(String typeSearchId) { //zzm 20231026 // DB202212270703 备品修理直返地址项目导入 start // String beipCenter = ''; // if (pc.Returns_Product_way__c == '备品中心') { // if (pc.Incharge_Staff__r.Profile.name.startsWith('2B2')) { // if (pc.Incharge_Staff__r.Branch__c == '北京') { // beipCenter = '北京备品中心'; // }else if (pc.Incharge_Staff__r.Branch__c == '上海') { // beipCenter = '华东备品中心'; // }else if (pc.Incharge_Staff__r.Branch__c == '广州') { // beipCenter = '广州备品中心'; // } // }else if (pc.Incharge_Staff__r.UserRole.name == 'CTEC教育本部') { // if (pc.Incharge_Staff__r.Branch__c == '北京') { // beipCenter = '北京C-TEC'; // }else if (pc.Incharge_Staff__r.Branch__c == '上海') { // beipCenter = '上海C-TEC'; // }else if (pc.Incharge_Staff__r.Branch__c == '广州') { // beipCenter = '广州C-TEC'; // } // } // } // DB202212270703 备品修理直返地址项目导入 end // WLIG-CCX4BB 【委托】修理直返收货地址功能改造 thh 20220513 start //deloitte-zhj 20231114 PIPL还原 去除AWS_Data_Id__c String AddressSql = 'SELECT ID,Address_Classification__c,Customer__c,Customer__r.Name,Customer__r.Type,Customer__r.RecordTypeId,Contacts__c,Contacts__r.Name,ContactName__c,Telephone__c' //zhj 新方案改造 去除Encrypted__c 2022-12-05 +',Province__c,Province__r.Name,City__c,City__r.name,Detailed_Address__c,Create_Contacts__c,ZipCode__c,CreatedByid' + ' FROM Address__c where id != null '; // WLIG-CCX4BB 【委托】修理直返收货地址功能改造 thh 20220513 end //类型筛选 if(!String.isBlank(typeText)){ if('医院'.equals(typeText)){ if(String.isBlank(typeSearchId)){ AddressSql += ' and Address_Classification__c LIKE \'%' + typeText.trim() + '%\'' ; }else{ //查询医院id为修理表上医院id AddressSql += ' and Hospital__c = \'' + typeSearchId + '\' and Address_Classification__c LIKE \'%' + typeText.trim() + '%\''; } } if('办事处'.equals(typeText)){ //20231104 zzm DB202306407163 【P】直返地址:返品方式和修理页面的返品方式希望能自动匹配。 AddressSql += ' and Province_Name__c=:Province_Name and Address_Classification__c LIKE \'%' + typeText.trim() + '%\'' ; //20231104 zzm DB202306407163 【P】直返地址:返品方式和修理页面的返品方式希望能自动匹配。 } if('备品'.equals(typeText)){ AddressSql += ' and Address_Classification__c LIKE \'%' + typeText.trim() + '%\'' ; // if (String.isNotBlank(beipCenter)) { // AddressSql += ' and Beipin_Center__c = \'' + String.escapeSingleQuotes(beipCenter) +'\'' ; // } } if('经销商'.equals(typeText)){ if(String.isBlank(typeSearchId)){ AddressSql += ' and Address_Classification__c LIKE \'%' + typeText.trim() + '%\'' ; } } } //客户筛选 if(!String.isBlank(txtName)){ AddressSql += ' and Customer__r.Name LIKE \'%' + txtName.trim() + '%\'' ; } //详细地址筛选 //deloitte-zhj 20231114 PIPL还原 if(!String.isBlank(txtAddress)){ AddressSql += ' and Detailed_Address__c LIKE \'%' + txtAddress.trim() + '%\'' ; } //排序,根据上次修改时间和采用时间进行降序排序,值为空放到后面 AddressSql += ' order by LastModifiedDate desc,Using_Datetime__c desc NULLS LAST'; //如果修理表的经销商或医院为空,那么查询地址表前200条的经销商或医院地址 if(String.isBlank(typeSearchId)){ AddressSql += ' limit 500 '; } System.debug('AddressSql = '+AddressSql); return AddressSql; } //查询医院客户人员信息 private String makeTextAccountSql(String accId){ String AccountSql = 'SELECT ID,NAME,Phone,State_Master__c,State_Master__r.name,City_Master__c,City_Master__r.name,Address__c ' + ' FROM Account WHERE ID = \'' + accId + '\''; if(!String.isBlank(txtName)){ AccountSql += ' and Name LIKE \'%' + txtName.trim() + '%\'' ; } if(!String.isBlank(txtAddress)){ AccountSql += ' and Address__c LIKE \'%' + txtAddress.trim() + '%\'' ; } return AccountSql; } //查询经销商信息 private String makeTextAccountDealersSQl(){ String AccountSQl = 'SELECT ID,NAME,Phone,State_Master__c,State_Master__r.name,City_Master__c,City_Master__r.name,Address__c ' + ' FROM Account WHERE ID != null '; if(!String.isBlank(txtName)){ AccountSQl += ' and Name LIKE \'%' + txtName.trim() + '%\'' ; } if(!String.isBlank(txtAddress)){ AccountSQl += ' and Address__c LIKE \'%' + txtAddress.trim() + '%\'' ; } return AccountSQl; } //查询办事处信息 /*private String makeTextAccOfficeSql(){ String AccountOfficeSql = 'SELECT ID,NAME,Phone,State_Master__c,State_Master__r.name,City_Master__c,City_Master__r.name,Address__c ' +' FROM Account WHERE Whether_Office__c = true'; if(!String.isBlank(txtName)){ AccountOfficeSql += ' and Name LIKE \'%' + txtName.trim() + '%\'' ; } if(!String.isBlank(txtAddress)){ AccountOfficeSql += ' and Address__c LIKE \'%' + txtAddress.trim() + '%\'' ; } return AccountOfficeSql; }*/ //获取account 表的所有数据 private String makeAccoutSoql(String accId){ String AccountSql = 'SELECT ID,NAME,Phone,State_Master__c,State_Master__r.name,City_Master__c,City_Master__r.name,Address__c,' + ' RecordType.name,Parent.Parent.Id FROM Account WHERE ID = \'' + accId + '\''; return AccountSql; } @RemoteAction global static string SaveEx(string repaire_json,string asset_json, string address_id){ return SaveExCore(repaire_json,asset_json,address_id); } public static string SaveExCore(string repaire_json,string asset_json, string address_id){ string message = null; string savemessage = null; savepoint sp = Database.setsavepoint(); try { Repair__c r = (Repair__c)JSON.deserialize(repaire_json,Repair__c.class); Asset ast = (Asset)JSON.deserialize(asset_json,Asset.class); Address__c add = new Address__c(Id=address_id,Using_Datetime__c = Datetime.now()); update r; update ast; update add; }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); message ='保存失败,原因:'+ e.getDmlMessage(index); savemessage = e.getMessage()+e.getStackTraceString(); } catch (Exception e) { System.debug('into catch'+e.getMessage()); Database.rollback(sp); savemessage = e.getMessage()+e.getStackTraceString(); message = '保存失败'; } finally { PIHelper.saveTransLog('StraightBackAddressController',address_id,address_id,address_id, repaire_json ,'success',message); } return message; } /** * 为了方便前段table获取值 */ class AddressData { //数据 public Address__c address { get; set; } public string addressJson { get{ if (address == null) { return null; } return JSON.serialize(address); } } //编辑按钮是否展示 public String canEdit { get; private set; } //编辑按钮是否展示 public String canCopy {get;private set;} //采用按钮是否展示 public String canAdopt{get;private set;} public AddressData(Address__c record) { address = record; canEdit = ''; } //主要用于判断是否那修改此调数据 public AddressData(Address__c record,String disCanEdit,String disCanCopy,String canAdopt) { address = record; canEdit = disCanEdit; canCopy = disCanCopy; canAdopt = canAdopt; } //主要是用于第一行展示和复选框是否显示 public AddressData(Account record,String disCanEdit,String disCanCopy,String disCanAdopt,String AccType) { this.address = new Address__c( Address_Classification__c = AccType, Customer__c= record.id, Telephone__c = record.phone, Province__c = record.State_Master__c, City__c = record.City_Master__c, Detailed_Address__c = record.Address__c); canEdit = disCanEdit; canCopy = disCanCopy; canAdopt = disCanAdopt; } } }