| | |
| | | + 'CurrentContract_F__r.First_Estimate_Date__c,CurrentContract_F__r.Estimate_Contract_endDate__c,' |
| | | + 'CurrentContract_F__r.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c,CurrentContract_F__r.Contract_Range__c,' |
| | | + 'Product2.ProductURF__c,Product2.ProductURF__r.URFLimitSerial__c,Product2.ProductURF__r.UFR_MaxRepairCount__c,Product2.ProductURF__r.UFR_Maintenance_Price_Month__c,' |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | + 'Product2.ProductURF__r.Maintenance_Price_Year_URF_Max__c, Product2.ProductURF__r.Maintenance_Price_Year_URF__c,' |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | + 'CurrentContract_End_Date__c, Extend_Gurantee_DateTo__c,EquipmentGuaranteeFlg__c,AssetMark__c FROM Asset WHERE Product2.ProductURF__c != null AND Hospital__c = \'' + this.targetHospitalId + '\' '; |
| | | //HWAG-BDJ43R ---XHL---20190729--- |
| | | //soql += ' AND AssetMark__c != \'耗材\' AND Product2.Family != \'ET\' '; |
| | |
| | | // 限次合同信息 add by gzw start |
| | | , Product2.ProductURF__c, Product2.ProductURF__r.URFLimitSerial__c, Product2.ProductURF__r.UFR_MaxRepairCount__c, Product2.ProductURF__r.UFR_Maintenance_Price_Month__c |
| | | // 限次合同信息 add by gzw end |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | , Product2.ProductURF__r.Maintenance_Price_Year_URF_Max__c, Product2.ProductURF__r.Maintenance_Price_Year_URF__c |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | FROM Asset WHERE Hospital__c = :this.targetHospitalId AND ( AssetMark__c != '耗材' OR Product2.Family != 'ET' ) ORDER BY ID, IF_Warranty__c asc]; |
| | | //JZHG-BSDUT4 ---20200825---update By rentongxiao---Start |
| | | // assetRecords = [SELECT Id, Name, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, Posting_Date__c,Management_Code__c,IF_Warranty__c,Reson_Can_not_Warranty__c, |
| | |
| | | Asset__r.Product2.ProductURF__r.UFR_MaxRepairCount__c, |
| | | Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c |
| | | // 20210315 gzw 追加限次产品信息 start |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | , Asset__r.Product2.ProductURF__r.Maintenance_Price_Year_URF_Max__c, Asset__r.Product2.ProductURF__r.Maintenance_Price_Year_URF__c |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | from Maintenance_Contract_Asset__c |
| | | where Maintenance_Contract__c = :this.targetMaintenanceContractId AND Asset__r.Product2.ProductURF__c != null |
| | | ]; |
| | |
| | | Product_Manual__r.ProductURF__r.URFLimitSerial__c, |
| | | Product_Manual__r.ProductURF__r.UFR_MaxRepairCount__c, |
| | | Product_Manual__r.ProductURF__r.UFR_Maintenance_Price_Month__c, |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | Product_Manual__r.ProductURF__r.Maintenance_Price_Year_URF_Max__c, |
| | | Product_Manual__r.ProductURF__r.Maintenance_Price_Year_URF__c, |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 start |
| | | Product_Manual__r.Asset_Model_No__c, |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 end |
| | |
| | | Asset__r.Product2.ProductURF__r.URFLimitSerial__c, |
| | | Asset__r.Product2.ProductURF__r.UFR_MaxRepairCount__c, |
| | | Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c, |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | Asset__r.Product2.ProductURF__r.Maintenance_Price_Year_URF_Max__c, |
| | | Asset__r.Product2.ProductURF__r.Maintenance_Price_Year_URF__c, |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | URF_Series__c, |
| | | Series_RepairCount__c, |
| | | Series_MaxRepairCount__c, |
| | |
| | | + 'CurrentContract_F__r.First_Estimate_Date__c,CurrentContract_F__r.Estimate_Contract_endDate__c,' |
| | | + 'CurrentContract_F__r.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c,' |
| | | + 'Product2.ProductURF__c,Product2.ProductURF__r.URFLimitSerial__c,Product2.ProductURF__r.UFR_MaxRepairCount__c,Product2.ProductURF__r.UFR_Maintenance_Price_Month__c,' |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | + 'Product2.ProductURF__r.Maintenance_Price_Year_URF__c, Product2.ProductURF__r.Maintenance_Price_Year_URF_Max__c,' |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | + 'CurrentContract_F__r.Contract_Range__c,AssetMark__c FROM Asset WHERE Product2.ProductURF__c != null AND Hospital__c = \'' + this.targetHospitalId + '\' ' |
| | | + 'AND Id NOT IN ' + notInId; |
| | | //HWAG-B4R3SS START 20181026 |
| | |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 start Asset_Model_No__c |
| | | List<Product2> prd = [select Id,Asset_Model_No__c, Maintenance_Price_Month__c, EquipmentGuaranteeFlg__c, Name, |
| | | ProductURF__c, ProductURF__r.URFLimitSerial__c, ProductURF__r.UFR_MaxRepairCount__c, ProductURF__r.UFR_Maintenance_Price_Month__c |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | , ProductURF__r.Maintenance_Price_Year_URF__c, ProductURF__r.Maintenance_Price_Year_URF_Max__c |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | from Product2 where Id = :ai.mcae.Product_Manual__c]; |
| | | ai.mcae.EquipmentGuaranteeFlgTxt__c = prd[0].EquipmentGuaranteeFlg__c; |
| | | ai.etGFlg = prd[0].EquipmentGuaranteeFlg__c; |
| | |
| | | } |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 end |
| | | // 限次信息 gzw 20210316 end |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | ai.uFRMaxPrice = prd[0].ProductURF__r.Maintenance_Price_Year_URF_Max__c; |
| | | ai.uFRMinPrice = prd[0].ProductURF__r.Maintenance_Price_Year_URF__c; |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | } |
| | | } |
| | | } |
| | |
| | | // add点检改善:新增一个点检对象复选框字段,默认为true 2021.6.8 fxk End |
| | | // Decimal listPrice = ass.rec.Maintenance_Price_Month__c; |
| | | Decimal listPrice = ass.rec.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c; |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220510 start |
| | | Decimal MaxPrice = ass.rec.Product2.ProductURF__r.Maintenance_Price_Year_URF_Max__c; |
| | | Decimal MinPrice = ass.rec.Product2.ProductURF__r.Maintenance_Price_Year_URF__c; |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220510 end |
| | | if (ass.rec_checkBox_c) { |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO , 'unCheckedAssets ' )); |
| | | // xudan 20160110 新品判断ここ要らない、contractStartDateChangeがやる |
| | |
| | | Check_Object__c = isCheck, |
| | | // add点检改善:新增一个点检对象复选框字段,默认为true 2021.6.8 fxk end |
| | | Estimate_List_Price__c = listPrice, |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | Adjustment_Upper_price__c = MaxPrice, |
| | | Adjustment_Lower_price__c = MinPrice, |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | EquipmentGuaranteeFlgTxt__c = ass.rec.EquipmentGuaranteeFlg__c |
| | | ); |
| | | ass.mcae = mcae; |
| | |
| | | } |
| | | // 2021-09-10 tcm 排序逻辑调整 end |
| | | |
| | | |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | Integer Contract_year = 0; |
| | | System.debug('this.estimate.Contract_Range__c1:' + this.estimate.Contract_Range__c); |
| | | if(this.estimate.Contract_Range__c != null){ |
| | | if(this.estimate.Contract_Range__c <= 12){ |
| | | Contract_year = 1; |
| | | } else{ |
| | | Decimal year = this.estimate.Contract_Range__c / 12; |
| | | Contract_year = (Integer)year.round(System.RoundingMode.CEILING); |
| | | } |
| | | } |
| | | System.debug('Contract_year1:' + Contract_year); |
| | | // 限次汇总信息 |
| | | Map<String, Decimal> uFRSerialMap = getLimitSerialData(); |
| | | Map<String, Decimal> uFRSerialMap = getLimitSerialData(Contract_year); |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | // ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO, 'lastMContractRes +++++!' + lastMContractRes)); |
| | | // if (true) { |
| | | // return false; |
| | |
| | | input.mcae.Series_RepairCount__c = 0; |
| | | input.mcae.Series_MaxRepairCount__c = uFRSerialMap.get(input.uFRSerial); |
| | | input.mcae.Asset_RepairCount__c = 0; |
| | | input.mcae.Asset_MaxRepairCount__c = input.uFRRepairCount; |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | input.mcae.Asset_MaxRepairCount__c = input.uFRRepairCount * Contract_year; |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | |
| | | |
| | | // 限次信息保存 |
| | |
| | | public Decimal uFRRepairCount {get; private set;} |
| | | |
| | | // 限次价格 add by gzw end |
| | | |
| | | |
| | | // XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | public Decimal uFRMaxPrice {get; set;} |
| | | public Decimal uFRMinPrice {get; set;} |
| | | // XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | |
| | | public Id getRecId() { |
| | | Id rtn = null; |
| | |
| | | // add by fxk 2021/9/9 控制点检对象是否可选 Star |
| | | this.CheckRows = true; |
| | | // add by fxk 2021/9/9 控制点检对象是否可选 End |
| | | |
| | | // XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | this.uFRMaxPrice = mcae.Product_Manual__r.ProductURF__r.Maintenance_Price_Year_URF_Max__c; |
| | | this.uFRMinPrice = mcae.Product_Manual__r.ProductURF__r.Maintenance_Price_Year_URF__c; |
| | | // XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | } |
| | | // 選択された用(非Manual) |
| | | public AssetInfo(Integer lineNo, Asset record, Boolean isNew, Decimal listPrice, Maintenance_Contract_Asset_Estimate__c mcae) { |
| | |
| | | this.uFRPrice = record.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c; |
| | | this.uFRSerial = record.Product2.ProductURF__r.URFLimitSerial__c; |
| | | this.uFRRepairCount = record.Product2.ProductURF__r.UFR_MaxRepairCount__c; |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | this.uFRMaxPrice = record.Product2.ProductURF__r.Maintenance_Price_Year_URF_Max__c; |
| | | this.uFRMinPrice = record.Product2.ProductURF__r.Maintenance_Price_Year_URF__c; |
| | | // XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | } |
| | | // 選択された用、未納品用(Manual) |
| | | public AssetInfo(Integer lineNo, Maintenance_Contract_Asset_Estimate__c mcae) { |
| | |
| | | this.ProductModelNoc = mcae.Product_Manual__r.Asset_Model_No__c; |
| | | this.AssetModelNoc = mcae.Asset__r.OwnershipMachine_No__c; |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 end |
| | | // XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | this.uFRMaxPrice = mcae.Product_Manual__r.ProductURF__r.Maintenance_Price_Year_URF_Max__c; |
| | | this.uFRMinPrice = mcae.Product_Manual__r.ProductURF__r.Maintenance_Price_Year_URF__c; |
| | | // XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | } |
| | | // 選択されなかった用 |
| | | public AssetInfo(Integer lineNo, Asset record) { |
| | |
| | | this.uFRPrice = record.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c; |
| | | this.uFRSerial = record.Product2.ProductURF__r.URFLimitSerial__c; |
| | | this.uFRRepairCount = record.Product2.ProductURF__r.UFR_MaxRepairCount__c; |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | this.uFRMaxPrice = record.Product2.ProductURF__r.Maintenance_Price_Year_URF_Max__c; |
| | | this.uFRMinPrice = record.Product2.ProductURF__r.Maintenance_Price_Year_URF__c; |
| | | // XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | } |
| | | } |
| | | |
| | |
| | | // return data; |
| | | // } |
| | | // 计算限次系列次数 |
| | | public Map<String, Decimal> getLimitSerialData() { |
| | | public Map<String, Decimal> getLimitSerialData(Integer Contract_year) { |
| | | Map<String, Decimal> limitSerial = new Map<String, Decimal>(); |
| | | |
| | | for (AssetInfo input : this.checkedAssets) { |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | if (String.isNotBlank(input.uFRSerial) && limitSerial.containsKey(input.uFRSerial)) { |
| | | limitSerial.put(input.uFRSerial, limitSerial.get(input.uFRSerial) + input.uFRRepairCount); |
| | | limitSerial.put(input.uFRSerial, limitSerial.get(input.uFRSerial) + input.uFRRepairCount * Contract_year); |
| | | } else { |
| | | limitSerial.put(input.uFRSerial, input.uFRRepairCount); |
| | | limitSerial.put(input.uFRSerial, input.uFRRepairCount * Contract_year); |
| | | } |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | // if (!input.isManual || input.isManual && !String.isBlank(input.mcae.Product_Manual__c)) { |
| | | // if (String.isBlank(input.mcae.Check_Result__c)) { |
| | | // input.mcae.Check_Result__c.addError('点检结果必填'); |