| | |
| | | /*gzw 优化Maximum view state size limit 追加 Transient */ |
| | | global class SelectAssetEstimateVMController { |
| | | //test |
| | | private String targetHospitalId = null; // 今後系列病院用 |
| | |
| | | public Asset ass { get; set; } |
| | | // 2021、8、26 合同报价页面的优化,无保有设备点检对象选择框变黑 fxk end |
| | | // 病院配下の納入機器の情報を格納する。 |
| | | private List<Asset> assetRecords; // TODO 系列病院の場合、この配列は固定できないです。 |
| | | private Transient List<Asset> assetRecords; // TODO 系列病院の場合、この配列は固定できないです。 |
| | | public List<AssetInfo> checkedAssets { get; set; } |
| | | private List<AssetInfo> unCheckedAssets = new List<AssetInfo>(); |
| | | |
| | |
| | | } |
| | | } |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 start OwnershipMachine_No__c Product2.ProductURF__c |
| | | //tcm 添加 Management_Code__c 20211201 start |
| | | //tcm 添加 Management_Code__c 20211201 start |
| | | String soql = 'SELECT Id, Name,OwnershipMachine_No__c, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, ' |
| | | + 'Posting_Date__c,Management_Code__c,IF_Warranty__c,Reson_Can_not_Warranty__c, InstallDate,isNewDate_use__c, ' |
| | | + 'Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__c, ' |
| | |
| | | // 納入機器の情報を取得 |
| | | if (!String.isBlank(this.targetHospitalId) && (this.targetHospitalId.length() == 15 || this.targetHospitalId.length() == 18)) { |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 start OwnershipMachine_No__c Product2.ProductURF__c |
| | | //tcm 添加 Management_Code__c 20211201 start |
| | | //tcm 添加 Management_Code__c 20211201 start |
| | | assetRecords = [SELECT Id, Name,OwnershipMachine_No__c,Product2.ProductURF__c, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, Posting_Date__c, Management_Code__c, IF_Warranty__c, Reson_Can_not_Warranty__c, |
| | | InstallDate, isNewDate_use__c, Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__c, CurrentContract_End_Date__c, EquipmentGuaranteeFlg__c, |
| | | CurrentContract_F__c, CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c, CurrentContract_F__r.RecordType_DeveloperName__c, CurrentContract_F__r.Estimate_Num__c, CurrentContract_F__r.Contract_End_Date__c, CurrentContract_F__r.Estimate_Contract_endDate__c, |
| | |
| | | CurrentContract_F__r.First_Estimate_Date__c, |
| | | CurrentContract_F__r.Contract_Consumption_rate__c, CurrentContract_F__r.First_contract_usage_Rate__c, |
| | | CurrentContract_F__r.Contract_Range__c, AssetMark__c, |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | CurrentContract_F__r.Open_RenewalQuotation__c, |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 end |
| | | // 2021-01-29 LJPH-BX9CVX mzy add 合同报价时判断零件风险 |
| | | NoPartRiskDate_F__c, NoPartRiskDate__c, SignableFlag__c, |
| | | Product2.PartSupplyFinishDate__c, Product2.PartSupplyFinishDateExp__c |
| | |
| | | Asset__r.CurrentContract_F__r.Estimate_Contract_endDate__c, |
| | | Asset__r.CurrentContract_F__r.Contract_Range__c, |
| | | Asset__r.CurrentContract_F__r.Contract_End_Date__c, |
| | | Asset__r.CurrentContract_F__r.Gurantee_Estimate_startDate__c |
| | | Asset__r.CurrentContract_F__r.Gurantee_Estimate_startDate__c, |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | Asset__r.CurrentContract_F__r.Open_RenewalQuotation__c |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 end |
| | | from Maintenance_Contract_Asset__c |
| | | where Maintenance_Contract__c = :this.targetMaintenanceContractId |
| | | ]; |
| | |
| | | Asset__r.CurrentContract_F__r.Contract_Range__c, |
| | | Asset__r.CurrentContract_F__r.Contract_End_Date__c, |
| | | Asset__r.CurrentContract_F__r.Gurantee_Estimate_startDate__c, |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | Asset__r.CurrentContract_F__r.Open_RenewalQuotation__c, |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 end |
| | | LastMContract_Price__c, |
| | | Asset__r.CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c, |
| | | Asset__r.CurrentContract_F_asset__r.endDateGurantee_Text__c, |
| | |
| | | } |
| | | notInId += '\')'; |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 start OwnershipMachine_No__c Product2.ProductURF__c |
| | | //tcm 添加 Management_Code__c 20211201 start |
| | | //tcm 添加 Management_Code__c 20211201 start |
| | | String sqlStr = 'SELECT Id, Name,OwnershipMachine_No__c, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, ' |
| | | + 'Posting_Date__c,Management_Code__c,IF_Warranty__c,Reson_Can_not_Warranty__c, InstallDate,isNewDate_use__c, ' |
| | | + 'Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__c, ' |
| | | + 'CurrentContract_End_Date__c, Extend_Gurantee_DateTo__c,EquipmentGuaranteeFlg__c, ' |
| | | + 'CurrentContract_F__c,CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c,CurrentContract_F__r.RecordType_DeveloperName__c,CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_Date__c,' |
| | | + 'CurrentContract_F__c,CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c,CurrentContract_F__r.RecordType_DeveloperName__c, CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_Date__c,' |
| | | + 'CurrentContract_F_asset__c,CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c,CurrentContract_F_asset__r.endDateGurantee_Text__c,CurrentContract_F__r.Gurantee_Estimate_startDate__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,' |
| | |
| | | t = this.estimate.Contract_Start_Date__c.addMonths(Integer.valueOf(this.estimate.Contract_Range__c)); |
| | | t = t.addDays(-1); |
| | | this.estimate.Contract_End_Date__c = t; |
| | | //以提交报价的时点,锁定经销商的先款状态,decide时不再更新经销商的性质 thh 20220407 start |
| | | //add wangweipeng 2021/12/26 start |
| | | if(String.isNotBlank(this.estimate.Dealer__c)){ |
| | | checkDealerId = this.estimate.Dealer__c; |
| | | onChDealerUpdate(); |
| | | }else{ |
| | | this.estimate.Is_RecognitionModel__c = false; |
| | | } |
| | | // if(String.isNotBlank(this.estimate.Dealer__c)){ |
| | | // checkDealerId = this.estimate.Dealer__c; |
| | | // onChDealerUpdate(); |
| | | // }else{ |
| | | // this.estimate.Is_RecognitionModel__c = false; |
| | | // } |
| | | //add wangweipeng 2021/12/26 end |
| | | //以提交报价的时点,锁定经销商的先款状态,decide时不再更新经销商的性质 thh 20220407 end |
| | | System.debug('---------345----'+this.estimate.Dealer__c+'-------'+this.estimate.Dealer__r.FirstParagraphEnd__c); |
| | | // 位置调整 在1951 line |
| | | // Date createdDate = this.estimate.CreatedDate == null ? System.today() : this.estimate.CreatedDate.date(); |
| | |
| | | //1.合同期不满一年时,合同期超过一半才可开始续签报价。(eg:11个月的合同从6个月后才可报价。) |
| | | //2.一年以上的合同,在结束前6个月开始可以开放续签报价。 |
| | | //3.管理员跳过, |
| | | if (UserInfo.getProfileId() != System.Label.ProfileId_SystemAdmin && String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c != 'VM_Contract') { |
| | | |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220413 |
| | | if (input.rec.CurrentContract_F__r.Open_RenewalQuotation__c == false && UserInfo.getProfileId() != System.Label.ProfileId_SystemAdmin && |
| | | String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c != 'VM_Contract') { |
| | | |
| | | Integer noOfDays = today.daysBetween(input.rec.CurrentContract_F__r.Contract_End_Date__c); |
| | | Decimal monthCon = (Decimal)noOfDays / 365 * 12; |
| | | // 可开始报价的月数限制 |
| | |
| | | } |
| | | } |
| | | // 多年保判断 |
| | | if ( String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c == 'VM_Contract') { |
| | | if (String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c == 'VM_Contract') { |
| | | //if (UserInfo.getProfileId() != System.Label.ProfileId_SystemAdmin && String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c == 'VM_Contract') { |
| | | |
| | | //Integer noOfDays = today.daysBetween(input.rec.CurrentContract_F_asset__r.endDateGurantee_Text__c); |
| | |
| | | public Asset rec { get; set; } |
| | | public Maintenance_Contract_Asset_Estimate__c mcae { get; set; } |
| | | public Boolean isManual { get; set; } |
| | | public Decimal orgPrice {get; private set;} |
| | | public Decimal orgPrice12 {get; private set;} |
| | | public Transient Decimal orgPrice {get; private set;} |
| | | public Transient Decimal orgPrice12 {get; private set;} |
| | | // add by fxk 2021/9/9 控制点检对象是否可选 Star |
| | | public Boolean CheckRows {get; private set;} |
| | | // add by fxk 2021/9/9 控制点检对象是否可选 End |
| | | |
| | | //add by rentx 2020-11-12 LJPH-BV93RZ start |
| | | public String proName; |
| | | public String proSerialNumber; |
| | | public String proSerialName; |
| | | public Transient String proName; |
| | | public Transient String proSerialNumber; |
| | | public Transient String proSerialName; |
| | | //add by rentx 2020-11-12 LJPH-BV93RZ end |
| | | //add by mzy 2020-11-12 LJPH-BX9CVX start |
| | | //public Date NoPartRiskDate; |
| | |
| | | // return returnValue; |
| | | // 2021-09-10 tcm 排序逻辑调整 end |
| | | } |
| | | } |
| | | } |