public with sharing class ChoiceAssetController { /*****************検索用******************/ public String FuselageNumber { get; set; } // 机身号码 public String AssetModel { get; set; } // 设备型号 public String HospitalName { get; set; } // 医院名称 public String RepairSubOrderId; // 报修子单Id public String dataType; //数据类型 public String soql; public RepairSubOrder__c repairSubOrder; //报修子单 public List < ChoiceAssetInfo > choiceAssetInfoRecordsview { get; set; } public String text1 { get; set; } // 对象 public static List textOpts { get; private set; } static { textOpts = new List(); textOpts.add(new SelectOption('Like', '-无-')); textOpts.add(new SelectOption('=' , '等于')); textOpts.add(new SelectOption('!=' , '不等于')); textOpts.add(new SelectOption('Like' , '包含')); textOpts.add(new SelectOption('NOT Like', '不包含')); } public ChoiceAssetController(ApexPages.StandardController stdController) { } public ChoiceAssetController() { RepairSubOrderId = ApexPages.currentPage().getParameters().get('Id'); dataType = ApexPages.currentPage().getParameters().get('Type'); choiceAssetInfoRecordsview = new List < ChoiceAssetInfo > (); } // 画面初始化 public void init() { if (String.isNotBlank(RepairSubOrderId)) { //获取报价子单的内容 repairSubOrder = [ SELECT Id, Name, RepairSubOrderNo__c, RepairOrderNo__c, Hospital__c, Hospital__r.Name, StrategicDepartment__c, Department__c, EquipmentCategory__c, RepairApplicant__c,RepairApplicantName__c, RepairApplicantTel__c, AssetType__c, RepairTime__c, FaultType__c, ProblemDescription__c, ResponseResultType__c, ReceiverType__c, ApplicantType__c, Applicant__c, ApplicationTime__c, AssetModel__c, AssetCode__c, AirframeCodeEngineer__c, RepairSubOrderType__c, FaultTime__c, ReceiverTime__c, PlannedVisitDay__c,ActualVisitTimeSecond__c, ActualVisitTimeThird__c, ResponseResultDesc__c, ProcessResult__c, Status__c, Department__r.Name, Department__r.Id,ActualVisitDateThird__c, EndTimeFirst__c,RepairsReportDate__c,ActualVisitDateFirst__c,ActualVisitDateSecon__c, // 2023-3-6 zyh add start DateReceiptQuestions__c,IfDeadHurt__c,ProblemOccurred__c,ProblemOccurredSelect__c,ReportAdverseEvents__c,WhatProject__c,OperationOrExaminationName__c,BreakORFallOff__c,UseFailProductFinish__c,SupportingProducts__c,AfterFailureInformation__c,Delay15Min__c,InformationFrom__c,FailureQInHospital__c,DelayReportReason__c,IsProductFaultRelated__c,IsOts__c,SenderOrgCode__c,SenderCompany__c,SenderName__c,SenderMobilePhone__c,SenderAddress__c,RecepientCompany__c,RecepientName__c,RecepientMobilePhone__c,RecepientAddress__c,OrderNumber__c,FailureReason__c,LogisticsSendDate__c,Item0010__c,Item0020__c,Item0030__c,Item0040__c,Item0050__c, ReturnWayType__c, // 2023-04-25 zyh add 小程序新需求 // 2023-3-6 zyh add end OwnerId,Owner.Name FROM RepairSubOrder__c WHERE Id =: RepairSubOrderId ]; } if (repairSubOrder != null) { FuselageNumber = repairSubOrder.AirframeCodeEngineer__c; AssetModel = null; HospitalName = null; } //1.只查找100条保有设备数据 String fuselageNumberTrim = String.isNotBlank(FuselageNumber)?FuselageNumber.trim():''; String serialNumber = '%' + String.escapeSingleQuotes(fuselageNumberTrim.replaceAll('%', '\\%')) + '%'; List < Asset > assetListed = [SELECT Id,name,SerialNumber,InstallDate, // Information_From__c,// 20220927 ljh XLIU-CJN62G Asset_situation__c, Order_No__c,Account.Name,Status,Department_Class__c,Hospital__r.Owner.Name, Hospital__r.Owner.Phone,Installation_Site__c,CurrentContract__c, Product2.Asset_Model_No__c,Hospital__r.Name,Department_Class__r.Name , Department_Class__r.Id, // Ji_Zhong_Guan_Li_Ku_Cun__c,// 20220927 ljh XLIU-CJN62G Posting_Date__c,Extend_Gurantee_DateTo__c,CurrentContract_End_Date__c,// 20220927 ljh XLIU-CJN62G Account.RecordTypeId ,Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c ,Account.Parent.FSE_SP_Main_Leader__r.Work_Location__c //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 start ,NoPartRiskDate_F__c //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 end FROM Asset where Id != null AND Repairing_Count__c >= 0 AND SerialNumber like :serialNumber LIMIT 100 ]; for (Asset ast: assetListed) { choiceAssetInfoRecordsview.add(new ChoiceAssetInfo(ast)); } } // 检索 public void searchAsset() { List < Asset > assetListed = new List < Asset > (); List < ChoiceAssetInfo > checkedRecords = new List < ChoiceAssetInfo > (); Map < Id, Asset > assetMap = new Map < Id, Asset > (); for (ChoiceAssetInfo info: choiceAssetInfoRecordsview) { if (info.check) { checkedRecords.add(info); assetMap.put(info.ast.Id, info.ast); } } choiceAssetInfoRecordsview = checkedRecords; soql = this.makeSoql(); assetListed = Database.query(soql); for (Asset ast: assetListed) { if (!assetMap.containsKey(ast.Id)) { choiceAssetInfoRecordsview.add(new ChoiceAssetInfo(ast)); } } } // 保存按钮 public PageReference save() { if (String.isBlank(RepairSubOrderId)) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '报修子单Id 不能为空')); return null; } //00N10000002Dx1X system.debug('choiceAssetInfoRecordsview--->' + choiceAssetInfoRecordsview); Integer quantity = 0; Asset ast = new Asset(); for (ChoiceAssetInfo info: choiceAssetInfoRecordsview) { if (info.check) { ast = info.ast; quantity += 1; // if (info.ast.Ji_Zhong_Guan_Li_Ku_Cun__c <= 0){ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '设备集中管理库存不足')); // return null; // } } } if (quantity == 0) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '请选择一个保有设备')); return null; } else if (quantity > 1) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '只能选择一个保有设备')); return null; } //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 start List ass = [select id,Product_ID__c from Asset where ID = :ast.Id]; List p2 = [select id,Name,Can_Repair__c from Product2 where ID = :ass[0].Product_ID__c]; String canRepair = p2[0].Can_Repair__c; if (canRepair=='第三方'){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '非我司修理对象,无法新建修理,如有不明请咨询CIC')); return null; } if (canRepair=='不' || String.isBlank(canRepair)){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '本设备无法新建修理')); return null; } //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 end return createData(ast); } public PageReference createData(Asset ast) { String url = '/'; String joint_1 = '='; String joint_2 = '_lkid='; String joint_3 = '&CF'; String joint_4 = '&'; //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 start List ass = [select id,Product_ID__c from Asset where ID = :ast.Id]; List p2 = [select id,Name,Can_Repair__c from Product2 where ID = :ass[0].Product_ID__c]; String canRepair = p2[0].Can_Repair__c; system.debug('1111111111111111111'+canRepair); //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 end if ('Repair'.equals(dataType)) { String Delivered_Product_Id = System.Label.Delivered_Product_Id; //设备型号 niwu changed 为自定义标签 -00N10000002Dx1X String Account_Id = System.Label.keshi; //科室 -00N10000002Dx5n String Repair_Detail_Id = System.Label.problem_description; //问题内容描述 -00N10000002Dx6I String hospitalId = System.Label.Hosp_Id; //医院 -00N10000002Dx66 String zhanlueKeshiId = System.Label.Strategy_department; //战略科室 00N10000002Dx5t String keshiId = System.Label.keshi; //科室 String guzhang = System.Label.malfunction_day; //故障发生日 -00N10000002Dx5y //add wangweipeng 2022/01/26 start String guzhangxcx = System.Label.malfunction_day_App; //1.故障发生日(小程序)-00N1m000006vXqw //add wangweipeng 2022/01/26 end String Repair_Source_Id = System.Label.new_repaire_source;//新建修理来源 -00N10000002FH86 String Incharge_Staff_Id = System.Label.repair_Owner;//修理委托者(FSE) -00N10000002EMHw //add wangweipeng 2022/01/26 start String SalesOfficeCode_selection_Id = System.Label.repair_place;//修理品返送地-00N10000006P6SM //add wangweipeng 2022/01/26 end String RepairApplicant_Id = ''; //报修人 String RepairApplicantPosition_Id = ''; //报修人岗位 String RepairApplicantHospital_Id = ''; //报修人医院 String RepairApplicantDepartment_Id = ''; //报修人科室 String baoxiuzidan = ''; //报修子单 String faqiri = ''; //报修发起日 String shouliri = ''; //工程师受理日 String PlannedVisitDay_Id= '';//计划上门日 String ActualVisitDateFirst_Id= '';//一次上门日 String ActualVisitDateSecond_Id= '';//二次上门日 String ActualVisitDateThird_Id= '';//三次上门日 String SubOrderCompleteDate_Id= '';//报修单处理完成日 String SubOrderCreatedDate_Id= '';//报修单申请修理日 //LLIU-CGX5E9 LY 20220812 start String DateReceiptQuestions_Id = '';//问题联络收到日 //LLIU-CGX5E9 LY 20220812 end //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 start String Excwork_location_Id = '';//跳过维修中心 //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 end // 2023-3-6 zyh add start // String dateReceiptQuestions;已存在 String SupportingProducts = System.Label.SupportingProducts;//配套使用产品SupportingProducts__c -00N10000008rsW4 String IfDeadHurt = System.Label.IfDeadHurt;//是否有死亡、伤害、感染- 00N10000008rsW7 String ProblemOccurred = System.Label.ProblemOccurred;//问题发生时间情况 -00N10000008rsVv String ProblemOccurredSelect = System.Label.ProblemOccurredSelect;//问题发生时间情况 其它 - 00N10000009hsvI String ReportAdverseEvents = System.Label.ReportAdverseEvents;//医院有没有向政府机关报告不良事件或疑似不良事件 -00N10000008rsW2 String WhatProject = System.Label.WhatProject;//做的是哪个项目 -00N10000008rsW6 String OperationOrExaminationName = System.Label.OperationOrExaminationName;//手术/检查名称-00N10000008rsVk String BreakORFallOff = System.Label.BreakORFallOff;//是否有发生断裂或脱落 -00N10000008rsVN String UseFailProductFinish = System.Label.UseFailProductFinish;//是否用该产品完成了手术/检查 -00N10000008rsW5 // String SupportingProducts = '00N10000008rsW4';//配套使用产品 String AfterFailureInformation = System.Label.AfterFailureInformation;//发现故障后,医院对患者的处理情况 -00N10000008rsVL String Delay15Min = System.Label.Delay15Min;//发现故障现象后,有延误15分钟以上的手术实施的情况发生吗 -00N10000008rsVR String InformationFrom = System.Label.InformationFrom;//信息是从医院的谁那里得到的 -00N10000008rsVZ String FailureQInHospital = System.Label.FailureQInHospital;//在医院,故障发生的频率是多少 -00N10000008rsVT String DelayReportReason = System.Label.DelayReportReason;//超时报告理由 -00N10000008rsVS String IsProductFaultRelated = System.Label.IsProductFaultRelated;//是否和这次的产品故障有关 -00N10000008rsVw String IsOts = System.Label.IsOts; // 修理:送修物流单号=======报修子弹:Ots订单号 -00N10000009H1rC String SenderOrgCode = ''; String SenderCompany = ''; String SenderName = ''; String SenderMobilePhone = ''; String SenderAddress = ''; String RecepientCompany = ''; String RecepientName = ''; String RecepientMobilePhone = ''; String RecepientAddress = ''; String ReturnWayType = System.Label.ReturnWayType;//niwu-00N10000009i1Z2 String OrderNumber = ''; String FailureReason = ''; String LogisticsSendDate = System.Label.LogisticsSendDate;//niwu - 00N10000009H1rk String Item0010 = ''; String Item0020 = ''; String Item0030 = ''; String Item0040 = ''; String Item0050 = ''; // 2023-3-6 zyh add end String engineerSendDate_Id= '';//工程师修理品寄送日 // if (NFMUtil.isSandbox()) { //测试环境 // RepairApplicant_Id = '00N1m0000054ufW'; //报修人 // // RepairApplicantPosition_Id = '00N1m0000054ufV'; //报修人岗位 // RepairApplicantHospital_Id = '00N1m0000054ufU'; //报修人医院 // RepairApplicantDepartment_Id = '00N1m0000054ufT'; //报修人科室 // //baoxiuzidan = '00N1m0000054ufZ'; //报修子单 // baoxiuzidan = '00N10000009H1rR'; //报修子单 // faqiri = '00N1m0000054ufa'; //报修发起日 // shouliri = '00N1m0000054ufS'; //工程师受理日 // PlannedVisitDay_Id= '00N1m000005SRiF';//计划上门日 // ActualVisitDateFirst_Id= '00N1m000005SRiK';//一次上门日 // ActualVisitDateSecond_Id= '00N1m000005SRiP';//二次上门日 // ActualVisitDateThird_Id= '00N1m000005SRiU';//三次上门日 // SubOrderCompleteDate_Id= '00N1m000005SRmg';//报修单处理完成日 // SubOrderCreatedDate_Id= '00N1m000005SRmW';//报修单申请修理日 // } else { //正式环境 RepairApplicant_Id = System.Label.RepairMan; //报修人 -00N10000009H1rQ // RepairApplicantPosition_Id = ''; //报修人岗位 RepairApplicantHospital_Id = System.Label.RepairApplicantHospital_Id; //报修人医院 - 00N10000009H1rP RepairApplicantDepartment_Id = System.Label.RepairApplicantDepartment_Id; //报修人科室 -00N10000009H1rO baoxiuzidan = System.Label.baoxiuzidan; //报修子单 -00N10000009H1rR faqiri = System.Label.faqiri; //报修发起日 -00N10000009H1rS shouliri = System.Label.shouliri; //工程师受理日 -00N10000009H1rN PlannedVisitDay_Id= System.Label.PlannedVisitDay_Id;//计划上门日 -00N10000009H1rM ActualVisitDateFirst_Id= System.Label.ActualVisitDateFirst_Id;//一次上门日 -00N10000009H1r6 ActualVisitDateSecond_Id= System.Label.ActualVisitDateSecond_Id;//二次上门日 -00N10000009H1r7 ActualVisitDateThird_Id= System.Label.ActualVisitDateThird_Id;//三次上门日 -00N10000009H1r8 SubOrderCompleteDate_Id= System.Label.SubOrderCompleteDate_Id;//报修单处理完成日 -00N10000009H1ri SubOrderCreatedDate_Id= System.Label.SubOrderCreatedDate_Id;//报修单申请修理日 -00N10000009H1rj //LLIU-CGX5E9 LY 20220812 start DateReceiptQuestions_Id= System.Label.DateReceiptQuestions_Id;//问题联络收到日 -00N10000008rsVQ //LLIU-CGX5E9 LY 20220812 end //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 start Excwork_location_Id = System.Label.Excwork_location_Id;//跳过维修中心 -00N10000009HAJl //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 end //} url += 'a0J/e?retURL=%2F'; //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 start if (canRepair=='RC送修'){ url += joint_4 + Excwork_location_Id + joint_1 + true; } //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 end url += joint_3 + Delivered_Product_Id + joint_1 + ast.Name; url += joint_3 + Delivered_Product_Id + joint_2 + ast.Id; url += joint_3 + baoxiuzidan + joint_1 + repairSubOrder.Name; url += joint_3 + baoxiuzidan + joint_2 + repairSubOrder.Id; url += joint_3 + hospitalId + joint_1 + ast.Hospital__r.Name; url += joint_3 + hospitalId + joint_2 + ast.Hospital__r.Id; url += joint_4 + Repair_Source_Id + joint_1 + '从报修子单'; if (String.isNotBlank(ast.Department_Class__c)) { url += joint_3 + zhanlueKeshiId + joint_1 + ast.Department_Class__r.Name; url += joint_3 + zhanlueKeshiId + joint_2 + ast.Department_Class__r.Id; } url += joint_3 + keshiId + joint_1 + ast.Account.Name; url += joint_3 + keshiId + joint_2 + ast.Account.Id; url += joint_4 + RepairApplicant_Id + joint_1 + repairSubOrder.RepairApplicantName__c;//报修人 // url += joint_4 + RepairApplicantPosition_Id + joint_1 + '';//报修人岗位 url += joint_4 + RepairApplicantHospital_Id + joint_1 + repairSubOrder.Hospital__r.Name;//报修人医院 url += joint_4 + RepairApplicantDepartment_Id + joint_1 + repairSubOrder.Department__r.Name;//报修人科室 if (repairSubOrder.ResponseResultDesc__c != null) { //2022/04/07 zhangyuheng ProblemDescription__c>ResponseResultDesc__c url += joint_4 + Repair_Detail_Id + joint_1 + repairSubOrder.ResponseResultDesc__c; } url += joint_4 + guzhang + joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.FaultTime__c); //add wangweipeng 2022/02/11 start url += joint_4 + guzhangxcx + joint_1 + NFMUtil.formatDateTime2StrDateTime(repairSubOrder.FaultTime__c); //add wangweipeng 2022/02/11 end url += joint_4 + faqiri + joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.RepairsReportDate__c); url += joint_4 + PlannedVisitDay_Id + joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.PlannedVisitDay__c);//计划上门日 url += joint_4 + ActualVisitDateFirst_Id+ joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.ActualVisitDateFirst__c);//一次上门日 url += joint_4 + ActualVisitDateSecond_Id+ joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.ActualVisitDateSecon__c);//二次上门日 url += joint_4 + ActualVisitDateThird_Id+ joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.ActualVisitDateThird__c);//三次上门日 url += joint_4 + SubOrderCompleteDate_Id+ joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.ApplicationTime__c);//报修单处理完成日 //LLIU-CGX5E9 LY 20220812 start url += joint_4 + DateReceiptQuestions_Id+ joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.ApplicationTime__c);//问题联络收到日 //LLIU-CGX5E9 LY 20220812 end url += joint_4 + SubOrderCreatedDate_Id+ joint_1 + NFMUtil.formatDateTime2StrSprit(Date.today());//报修单申请修理日 url += joint_4 + shouliri + joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.ReceiverTime__c); //add wangweipeng 2022/01/26 start // url += joint_4 + SalesOfficeCode_selection_Id+ joint_1 + ast.Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c;//修理品返送地 //2022/4/7 zhangyuheng 注释 //add wangweipeng 2022/01/26 end //add zhangyuheng 2022/04/07 start if (String.isNotBlank(ast.Account.RecordTypeId)) { if (ast.Account.RecordTypeId == System.Label.strategy_ET || //战略科室 ET niwu changedTO custom Lable -01210000000QemQAAS ast.Account.RecordTypeId == System.Label.gastroenterology || //战略科室 消化科 ast.Account.RecordTypeId == System.Label.Other || //战略科室 其他 ast.Account.RecordTypeId == System.Label.unKonw || //战略科室 不明 - 01210000000Qf03 ast.Account.RecordTypeId == System.Label.pneumology || //战略科室 呼吸科 ast.Account.RecordTypeId == System.Label.gynecology_department || //战略科室 妇科 ast.Account.RecordTypeId == System.Label.general_surgery || //战略科室 普外科 ast.Account.RecordTypeId == System.Label.urology_department || //战略科室 泌尿科 ast.Account.RecordTypeId == System.Label.otolaryngology_department //战略科室 耳鼻喉科 ) { //战略科室 if (String.isNotBlank(ast.Account.Parent.FSE_SP_Main_Leader__r.Work_Location__c)) { url += joint_4 + SalesOfficeCode_selection_Id+ joint_1 + ast.Account.Parent.FSE_SP_Main_Leader__r.Work_Location__c;//修理品返送地 }else { // continue; } } if (ast.Account.RecordTypeId == System.Label.pneumology_department || //科室 呼吸科 -01210000000QfmRAAS ast.Account.RecordTypeId == System.Label.general_surgeryF || //科室 普外科 -01210000000QfmH ast.Account.RecordTypeId == System.Label.Other_department || //科室 其他 -01210000000Qfmb ast.Account.RecordTypeId == System.Label.gynecology_department_F || //科室 妇科 -01210000000QfmM ast.Account.RecordTypeId == System.Label.urology_department_F || //科室 泌尿科 -01210000000QfmC ast.Account.RecordTypeId == System.Label.Digestive_Department || //科室 消化科 -01210000000Qfm7 ast.Account.RecordTypeId == System.Label.otolaryngology_department //科室 耳鼻喉科 -01210000000Qfm2 ) { //科室 if (String.isNotBlank(ast.Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c)) { url += joint_4 + SalesOfficeCode_selection_Id+ joint_1 + ast.Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c;//修理品返送地 }else { // continue; } } } //add zhangyuheng 2022/04/07 end url += joint_3 + Incharge_Staff_Id + joint_1 + repairSubOrder.Owner.Name; url += joint_3 + Incharge_Staff_Id + joint_2 + repairSubOrder.OwnerId; // 2023-3-7 zyh add start if(repairSubOrder.SupportingProducts__c != null){ url += joint_3 + SupportingProducts + joint_2 + repairSubOrder.SupportingProducts__c;//配套使用产品 } if(repairSubOrder.IfDeadHurt__c != null){ url += joint_3 + IfDeadHurt + joint_2 + repairSubOrder.IfDeadHurt__c;//是否有死亡、伤害、感染 } if(repairSubOrder.ReturnWayType__c != null){ url += joint_3 + ReturnWayType + joint_2 + repairSubOrder.ReturnWayType__c;//返品方式 } if(repairSubOrder.ProblemOccurred__c != null){ url += joint_3 + ProblemOccurred + joint_2 + repairSubOrder.ProblemOccurred__c;//问题发生时间情况 } if(repairSubOrder.ProblemOccurredSelect__c != null){ url += joint_3 + ProblemOccurredSelect + joint_2 + repairSubOrder.ProblemOccurredSelect__c;//问题发生时间情况 其它 } if(repairSubOrder.ReportAdverseEvents__c != null){ url += joint_3 + ReportAdverseEvents + joint_2 + repairSubOrder.ReportAdverseEvents__c;//医院有没有向政府机关报告不良事件或疑似不良事件 } if(repairSubOrder.WhatProject__c != null){ url += joint_3 + WhatProject + joint_2 + repairSubOrder.WhatProject__c;//做的是哪个项目 } if(repairSubOrder.OperationOrExaminationName__c != null){ url += joint_3 + OperationOrExaminationName + joint_2 + repairSubOrder.OperationOrExaminationName__c;//手术/检查名称 } if(repairSubOrder.BreakORFallOff__c != null){ url += joint_3 + BreakORFallOff + joint_2 + repairSubOrder.BreakORFallOff__c;//是否有发生断裂或脱落 } if(repairSubOrder.UseFailProductFinish__c != null){ url += joint_3 + UseFailProductFinish + joint_2 + repairSubOrder.UseFailProductFinish__c;//是否用该产品完成了手术/检查 } if(repairSubOrder.AfterFailureInformation__c != null){ url += joint_3 + AfterFailureInformation + joint_2 + repairSubOrder.AfterFailureInformation__c;//发现故障后,医院对患者的处理情况 } if(repairSubOrder.Delay15Min__c != null){ url += joint_3 + Delay15Min + joint_2 + repairSubOrder.Delay15Min__c;//发现故障现象后,有延误15分钟以上的手术实施的情况发生吗 } if(repairSubOrder.InformationFrom__c != null){ url += joint_3 + InformationFrom + joint_2 + repairSubOrder.InformationFrom__c;//信息是从医院的谁那里得到的 } if(repairSubOrder.FailureQInHospital__c != null){ url += joint_3 + FailureQInHospital + joint_2 + repairSubOrder.FailureQInHospital__c;//在医院,故障发生的频率是多少 } if(repairSubOrder.DelayReportReason__c != null){ url += joint_3 + DelayReportReason + joint_2 + repairSubOrder.DelayReportReason__c;//超时报告理由 } if(repairSubOrder.IsProductFaultRelated__c != null){ url += joint_3 + IsProductFaultRelated + joint_2 + repairSubOrder.IsProductFaultRelated__c;//是否和这次的产品故障有关 } if(repairSubOrder.LogisticsSendDate__c != null){ url += joint_3 + LogisticsSendDate + joint_2 + repairSubOrder.LogisticsSendDate__c;//是否和这次的产品故障有关 } if(repairSubOrder.OrderNumber__c != null){ url += joint_3 + IsOts + joint_2 + repairSubOrder.OrderNumber__c; // 修理:送修物流单号=======报修子弹:Ots订单号 } // 2023-3-7 zyh add start } else if ('QIS'.equals(dataType)) { String Delivered_Product_Id = System.Label.Equipment_Model; //设备型号 -00N10000002FHFK String hospitalId = System.Label.hospital_CA; //医院 -00N10000006P4qS String zhanlueKeshiId = System.Label.tactic_department; //战略科室 -00N10000006P4og String keshiId = System.Label.keshi_CA; //科室 -00N10000002FHF7 String baoxiuzidan = ''; //报修子单 String fuzeren = System.Label.fuzren; //院方负责人 -00N10000002FHFI String lianxidianhua = System.Label.lianxidianhua; //联系电话 -00N10000002FHEx String Generation_Source_Id = System.Label.Generation_Source_Id;//QIS来源 -00N10000002FHF6 String Name_Id = 'Name';//QIS管理号码 // if (NFMUtil.isSandbox()) { // baoxiuzidan = '00N1m000005STFv'; //报修子单 // } else { baoxiuzidan = System.Label.baoxiudanzi; //报修子单 -00N10000009H22X // } url += System.Label.recordtype_CA; // niwu changed a0f/e?retURL=%2Fa0f%2Fo&RecordType=01210000000RLWc&ent=01I10000000T5b1 url += joint_3 + Delivered_Product_Id + joint_1 + ast.Name; url += joint_3 + Delivered_Product_Id + joint_2 + ast.Id; url += joint_3 + hospitalId + joint_1 + ast.Hospital__r.Name; url += joint_3 + hospitalId + joint_2 + ast.Hospital__r.Id; if (String.isNotBlank(ast.Department_Class__c)) { url += joint_3 + zhanlueKeshiId + joint_1 + ast.Department_Class__r.Name; url += joint_3 + zhanlueKeshiId + joint_2 + ast.Department_Class__r.Id; } url += joint_3 + keshiId + joint_1 + ast.Account.Name; url += joint_3 + keshiId + joint_2 + ast.Account.Id; url += joint_3 + baoxiuzidan + joint_1 + repairSubOrder.Name; url += joint_3 + baoxiuzidan + joint_2 + repairSubOrder.Id; url += joint_4 + fuzeren + joint_1 + ast.Hospital__r.Owner.Name; url += joint_4 + Name_Id + joint_1 + '*'; url += joint_4 + Generation_Source_Id + joint_1 + '报修单'; if (ast.Hospital__r.Owner.Phone != null) { url += joint_4 + lianxidianhua + joint_1 + ast.Hospital__r.Owner.Phone; } } System.debug('---------'+url); PageReference ref = new Pagereference(url); ref.setRedirect(true); return ref; } //SQL拼写 private String makeSoql() { String start = ''; String soql = 'select Id,name,SerialNumber,InstallDate,Asset_situation__c,Order_No__c,Account.Name,Status,Department_Class__c, '; soql += 'Hospital__r.Owner.Name,Hospital__r.Owner.Phone,Installation_Site__c,CurrentContract__c,Product2.Asset_Model_No__c,Hospital__r.Name,Department_Class__r.Name ,Department_Class__r.Id,'; soql += 'Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c,Account.RecordTypeId'; soql += ',Posting_Date__c,Extend_Gurantee_DateTo__c,CurrentContract_End_Date__c ';// 20220927 ljh XLIU-CJN62G soql += ',NoPartRiskDate_F__c ';//XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 soql += ' from Asset where Id != null AND Repairing_Count__c = 0 '; if (String.isNotBlank(FuselageNumber) || String.isNotBlank(AssetModel) || String.isNotBlank(HospitalName)) { soql += ' AND ('; if (String.isNotBlank(FuselageNumber)) { String fuselageNumberTrim = FuselageNumber.trim(); start = ' SerialNumber like \'%' + String.escapeSingleQuotes(fuselageNumberTrim.replaceAll('%', '\\%')) + '%\' '; } if (String.isNotBlank(HospitalName)) { String hospitalNameTrim = HospitalName.trim(); if (String.isNotBlank(start)) { start += ' AND '; } start += ' Hospital__r.Name like \'%' + String.escapeSingleQuotes(hospitalNameTrim.replaceAll('%', '\\%')) + '%\''; } if (String.isNotBlank(AssetModel)) { String assetModelTrim = AssetModel.trim(); if (String.isNotBlank(start)) { start += ' AND '; } start += ' Product2.Asset_Model_No__c like \'%' + String.escapeSingleQuotes(assetModelTrim.replaceAll('%', '\\%')) + '%\''; } soql += start + ')'; } soql += ' limit 10'; system.debug('soql---->' + soql); return soql; } class ChoiceAssetInfo { public Boolean check { get; set; } public Asset ast { get; set; } public Boolean canSelect { get; set; } public ChoiceAssetInfo(Asset e) { check = false; ast = e; canSelect = true; } } }