| | |
| | | // 取得分页数据 |
| | | private void setPageRecord() { |
| | | checkIdList = new List<String> (); |
| | | for (AssetInfo ass : this.checkedAssets) { |
| | | if (!ass.isManual) { |
| | | checkIdList.add(ass.rec.Id); |
| | | } |
| | | } |
| | | |
| | | |
| | | if ((currPage * selctRecordNum) <= 2000) { |
| | | String notInId = '(\''; |
| | |
| | | this.estimate.Contract_Range__c.addError('必须输入合同月数!'); |
| | | return null; |
| | | } |
| | | NextMaintenanceContract(); |
| | | //add by rentx 2020-11-13 LJPH-BV93RZ end |
| | | // add 维修合同报价,保存时,把记录类型赋值一下 2021.6.8 fxk start |
| | | Id Maintenance_Contract = Schema.SObjectType.Maintenance_Contract_Estimate__c.getRecordTypeInfosByDeveloperName().get('Maintenance_Quote').getRecordTypeId(); |
| | |
| | | * 決定メソッド |
| | | */ |
| | | public PageReference decide() { |
| | | System.debug('decide start'); |
| | | System.debug('decide start'); |
| | | NextMaintenanceContract(); |
| | | inDicideFlag = true; |
| | | // TODO check decide 资格 |
| | | Savepoint sp = Database.setSavepoint(); |
| | |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | // public PageReference dosomething() { |
| | | // System.debug('dosomething start'); |
| | | // NextMaintenanceContract(); |
| | | // return null; |
| | | // } |
| | | public void NextMaintenanceContract() { |
| | | // 20220810 询价2期开发 |
| | | List<String> asslocalList = new List<String>(); |
| | | List<String> mcalocalList = new List<String>(); |
| | | Map<Id, Maintenance_Contract__c> map3 = new Map<Id, Maintenance_Contract__c>(); |
| | | |
| | | List<Maintenance_Contract_Asset__c> mcaupdateList = new List<Maintenance_Contract_Asset__c>(); |
| | | for (AssetInfo ass : this.checkedAssets) { |
| | | if (!ass.isManual) { |
| | | asslocalList.add(ass.rec.Id); |
| | | map3.put(ass.rec.Id,this.contract); |
| | | } |
| | | } |
| | | System.debug('asslocalList====%%%' +asslocalList); |
| | | List<Maintenance_Contract_Asset__c> mcalist1 = [select id,Asset__c,Next_Maintenance_Contract__c,Maintenance_Contract__c |
| | | from Maintenance_Contract_Asset__c |
| | | where id in (select CurrentContract_F_asset__c |
| | | from asset |
| | | where id in :asslocalList and CurrentContract_F_asset__c!=null)]; |
| | | System.debug('mcalist1====%%%' +mcalist1); |
| | | System.debug('map3====%%%' +map3); |
| | | for (Maintenance_Contract_Asset__c mca : mcalist1) { |
| | | Maintenance_Contract_Asset__c mca3 = new Maintenance_Contract_Asset__c(); |
| | | if (map3.containsKey(mca.Asset__c)) { |
| | | mca3.id = mca.id; |
| | | mca3.Next_Maintenance_Contract__c = map3.get(mca.Asset__c).id; |
| | | System.debug('mca3.id====%%%' +mca3.id); |
| | | if (mca3.id!=null&&!mcaupdateList.contains(mca3)) { |
| | | mcaupdateList.add(mca3); |
| | | } |
| | | } |
| | | } |
| | | System.debug('mcaupdateList====%%%' +mcaupdateList); |
| | | if (mcaupdateList!=null&&!mcaupdateList.isEmpty()) { |
| | | update mcaupdateList; |
| | | } |
| | | System.debug('更新完成mcaupdateList'); |
| | | } |
| | | |
| | | public PageReference decideCancle() { |
| | |
| | | this.estimate.Contract_Range__c.addError('必须输入合同月数!'); |
| | | return null; |
| | | } |
| | | NextMaintenanceContract(); |
| | | //add by rentx 2020-11-13 LJPH-BV93RZ end |
| | | if (syncEstimate(false, false)) { |
| | | PageReference ret = null; |
| | |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | SelectAssetEstimateController saec = new SelectAssetEstimateController(); |
| | | saec.targetEstimateId = strId; |
| | | saec.isPageAction = true; |