| | |
| | | * 开始方法 |
| | | */ |
| | | public PageReference init(){ |
| | | System.debug('RepairId-----'+RepairId); |
| | | String RepairSql = makeTextRepairSql(RepairId); |
| | | System.debug('RepairSql-----'+RepairSql); |
| | | try{ |
| | | pc = Database.query(RepairSql); |
| | | system.debug('pc = ' + pc); |
| | |
| | | }catch(exception e){ |
| | | //失败提示 |
| | | ApexPages.addMessages(e); |
| | | System.debug(e.getMessage()); |
| | | System.debug(e.getlineNumber()); |
| | | } |
| | | insUpdData = new Address__c(); |
| | | newCon = new Contact(); |
| | |
| | | try{ |
| | | //保存数据到修理表中 |
| | | Repair__c rc = new Repair__c(); |
| | | rc.id=RepairId; |
| | | rc.id = RepairId; |
| | | rc.Address_AWS_Data_Id__c = tableData[i].address.AWS_Data_Id__c; |
| | | rc.Contact_AWS_Data_Id__c = contactawsDataId; |
| | | rc.address_Contacts__c = contactsName; |
| | |
| | | List<Address__c> dataList = Database.query(AddressSql); |
| | | if(dataList != null && dataList.size()> 0){ |
| | | indexCou += dataList.size(); |
| | | System.debug('dataList-----'+dataList); |
| | | for(Integer i = 0;i<dataList.size();i++){ |
| | | String createID = dataList[i].CreatedByid; |
| | | createId = createId.substring(0,15); |
| | | //办事处的地址不可修改 |
| | | |
| | | if(dataList[i].Address_Classification__c == '办事处'){ |
| | | tableData.add(new AddressData(dataList[i],'none','none','inline')); |
| | | tableData.add(new AddressData(dataList[i],'none','none','inline')); |
| | | }else{ |
| | | //只能改自己创建的地址数据,系统管理员、GPI_系统管理员New 没限制 |
| | | if(loginPerson == createId ||loginPerson == '00e10000000dzzG' ||loginPerson == '00e10000000Y3o5'){ |
| | |
| | | } |
| | | } |
| | | //判断联系人是否都为空 |
| | | |
| | | if(insUpdData.Contacts__c == null || String.isBlank(insUpdData.Contacts__c)){ |
| | | //判断新建联系人是否为空 |
| | | if(insUpdData.Create_Contacts__c == null || String.isBlank(insUpdData.Create_Contacts__c)){ |