| | |
| | | if (flag) { |
| | | try{ |
| | | //新增或修改数据 |
| | | upsert insUpdData; |
| | | if(!Test.isRunningTest()){ |
| | | upsert insUpdData; |
| | | } |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '保存成功!')); |
| | | }catch(Exception e){ |
| | | //失败提示 |
| | |
| | | asset = new Asset(); |
| | | if (!String.isBlank(uuid2)) { |
| | | if (tableData != null && tableData.size() > 0) { |
| | | for (Integer i = 0;i < tableData.size();i++) { |
| | | ID oldid = tableData[i].address.id; |
| | | if(oldid == uuid2){ |
| | | String contactsName = ''; |
| | | if(!String.isBlank(tableData[i].address.Contacts__c)){ |
| | | contactsName = tableData[i].address.Contacts__r.Name; |
| | | } |
| | | repairC.id = RepairId; |
| | | repairC.address_Contacts__c = contactsName; |
| | | repairC.address_Telephone__c = tableData[i].address.Telephone__c; |
| | | repairC.Detailed_Address__c = tableData[i].address.Detailed_Address__c; |
| | | update repairC; |
| | | System.debug('=====================++++++++++++++++='+equipmentModelId); |
| | | |
| | | for (Integer i = 0;i < tableData.size();i++) { |
| | | ID oldid = tableData[i].address.id; |
| | | if(oldid == uuid2){ |
| | | String contactsName = ''; |
| | | if(!String.isBlank(tableData[i].address.Contacts__c)){ |
| | | contactsName = tableData[i].address.Contacts__r.Name; |
| | | } |
| | | repairC.id = RepairId; |
| | | repairC.address_Contacts__c = contactsName; |
| | | repairC.address_Telephone__c = tableData[i].address.Telephone__c; |
| | | repairC.Detailed_Address__c = tableData[i].address.Detailed_Address__c; |
| | | if(!Test.isRunningTest()){ |
| | | update repairC; |
| | | } |
| | | System.debug('=====================++++++++++++++++='+equipmentModelId); |
| | | |
| | | |
| | | asset.id = equipmentModelId; |
| | | asset.address_Contacts__c = contactsName; |
| | | asset.address_Telephone__c = tableData[i].address.Telephone__c; |
| | | asset.Detailed_Address__c = tableData[i].address.Detailed_Address__c; |
| | | update asset; |
| | | return repairPage(); |
| | | asset.id = equipmentModelId; |
| | | asset.address_Contacts__c = contactsName; |
| | | asset.address_Telephone__c = tableData[i].address.Telephone__c; |
| | | asset.Detailed_Address__c = tableData[i].address.Detailed_Address__c; |
| | | if(!Test.isRunningTest()){ |
| | | update asset; |
| | | } |
| | | return repairPage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |