| | |
| | | |
| | | String recordTypeId = LightingButtonConstant.DEVELOPER_NAME_ASAC_DECISION; |
| | | try{ |
| | | PAE_DecisionRecord__c rCPAEDIdList = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_QIS__c = :qisReportId And RecordType.DeveloperName = :recordTypeId limit 1]; |
| | | res.pAEid = rCPAEDIdList.id; |
| | | PAE_DecisionRecord__c RCPAEDIdList = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_QIS__c = :qisReportId And RecordType.DeveloperName = :recordTypeId limit 1]; |
| | | res.pAEid = RCPAEDIdList.id; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | |
| | | String recordTypeId = LightingButtonConstant.DEVELOPER_NAME_ASRC_DECISION; |
| | | try{ |
| | | PAE_DecisionRecord__c aSRCDIdList = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_QIS__c = :qisReportId And RecordType.DeveloperName = :recordTypeId Limit 1]; |
| | | res.pAEid = aSRCDIdList.id; |
| | | PAE_DecisionRecord__c ASRCDIdList = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_QIS__c = :qisReportId And RecordType.DeveloperName = :recordTypeId Limit 1]; |
| | | res.pAEid = ASRCDIdList.id; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | public static InitData initForlexCreateRepairButton (String recordId){ |
| | | InitData res = new initData(); |
| | | ID myUserID = UserInfo.getUserId(); |
| | | List<RecordType> RecordTypeList = [select id,name from RecordType where name = '2.OCSM' or name = '1.FSE' or name = '戦略科室分類 消化科' |
| | | or name = '戦略科室分類 消化科' or name = '戦略科室分類 呼吸科' or name = '戦略科室分類ET' |
| | | or name = '戦略科室分類 普外科' or name = '戦略科室分類 泌尿科' or name = '戦略科室分類 耳鼻喉科' |
| | | or name = '戦略科室分類 婦人科' or name = '戦略科室分類 その他']; |
| | | User userinfo = [SELECT id,RepairSalesPoint_Province_China__c FROM User WHERE Id = :myUserID LIMIT 1]; |
| | | QIS_Report__c report = [SELECT id,Owner.name,FailureQInHospital__c,InformationFrom__c,Delay15Min__c, |
| | | AfterFailureInformation__c,Set_usage_product__c,BreakORFallOff__c,Opera_Name__c, |
| | |
| | | Parent.Parent.FSE_GI_Main_Leader__r.Work_Location__c, |
| | | Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c FROM Account WHERE id = :report.Hospital_Department__c limit 1]; |
| | | try{ |
| | | for (RecordType rec :RecordTypeList) { |
| | | if (rec.name == '1.FSE') { |
| | | res.oneFSE = rec.id.to15(); |
| | | } |
| | | if (rec.name == '2.OCSM') { |
| | | res.twoOCSM = rec.id.to15(); |
| | | } |
| | | if (rec.name == '戦略科室分類 消化科') { |
| | | res.xiaohua = rec.id.to15(); |
| | | } |
| | | if (rec.name == '戦略科室分類 呼吸科') { |
| | | res.huxi = rec.id.to15(); |
| | | } |
| | | if (rec.name == '戦略科室分類ET') { |
| | | res.eT = rec.id.to15(); |
| | | } |
| | | if (rec.name == '戦略科室分類 普外科') { |
| | | res.puwai = rec.id.to15(); |
| | | } |
| | | if (rec.name == '戦略科室分類 泌尿科') { |
| | | res.miniao = rec.id.to15(); |
| | | } |
| | | if (rec.name == '戦略科室分類 耳鼻喉科') { |
| | | res.erbihou = rec.id.to15(); |
| | | } |
| | | if (rec.name == '戦略科室分類 婦人科') { |
| | | res.fuke = rec.id.to15(); |
| | | } |
| | | if (rec.name == '戦略科室分類 その他') { |
| | | res.qita = rec.id.to15(); |
| | | } |
| | | |
| | | } |
| | | res.Id = report.Id; |
| | | res.qisRecordTypeId = report.RecordType_ID__c; |
| | | res.oCMjudgement = report.OCM_judgement__c; |
| | |
| | | } |
| | | return re; |
| | | } |
| | | |
| | | // 新建QIS |
| | | @AuraEnabled |
| | | public static InitData initForlexCreateQISFromAssetButton (String recordId){ |
| | | InitData res = new initData(); |
| | | ID myUserID = UserInfo.getUserId(); |
| | | Asset ass = [SELECT id,AssetMark__c FROM Asset WHERE Id = :recordId LIMIT 1]; |
| | | try{ |
| | | Date fomatToday = Date.today().addDays(-10); |
| | | QIS_Report__c report = [SELECT id,QIS_Submit_day__c FROM QIS_Report__c WHERE nonyushohin__c=:recordId and QIS_Submit_day__c != null and QIS_Submit_day__c >= :fomatToday]; |
| | | Repair__c rep = [SELECT id,Name FROM Repair__c WHERE Delivered_Product__c = :recordId and Status2__c!='00.删除' and Status2__c!='00.取消' and FSE_ApplyForRepair_Day__c >= :fomatToday order by FSE_ApplyForRepair_Day__c desc limit 1]; |
| | | res.Id = report.id; |
| | | res.repId = rep.id; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | @AuraEnabled |
| | | public String repId; |
| | | @AuraEnabled |
| | | public String qISSCReport; |
| | | @AuraEnabled |
| | |
| | | @AuraEnabled |
| | | public String failuerSituation; |
| | | @AuraEnabled |
| | | public String sourceOnCall; |
| | | public ID sourceOnCall; |
| | | @AuraEnabled |
| | | public String sourceOnCallname; |
| | | @AuraEnabled |
| | | public String hospitalId; |
| | | public ID hospitalId; |
| | | @AuraEnabled |
| | | public String hospitalname; |
| | | @AuraEnabled |
| | | public String departmentClassId; |
| | | public ID departmentClassId; |
| | | @AuraEnabled |
| | | public String departmentClassname; |
| | | @AuraEnabled |
| | | public String hospitalDepartment; |
| | | public ID hospitalDepartment; |
| | | @AuraEnabled |
| | | public String hospitalDepartmentname; |
| | | @AuraEnabled |
| | | public String nonyushohinId; |
| | | public ID nonyushohinId; |
| | | @AuraEnabled |
| | | public String nonyushohinIdname; |
| | | @AuraEnabled |
| | |
| | | @AuraEnabled |
| | | public String failureQInHospital; |
| | | @AuraEnabled |
| | | public String ownerId; |
| | | public ID ownerId; |
| | | @AuraEnabled |
| | | public String ownername; |
| | | @AuraEnabled |
| | |
| | | @AuraEnabled |
| | | public String contractnumber; |
| | | @AuraEnabled |
| | | public String oneFSE; |
| | | @AuraEnabled |
| | | public String twoOCSM; |
| | | @AuraEnabled |
| | | public String huxi; |
| | | @AuraEnabled |
| | | public String xiaohua; |
| | | @AuraEnabled |
| | | public String eT; |
| | | @AuraEnabled |
| | | public String puwai; |
| | | @AuraEnabled |
| | | public String miniao; |
| | | @AuraEnabled |
| | | public String erbihou; |
| | | @AuraEnabled |
| | | public String fuke; |
| | | @AuraEnabled |
| | | public String qita; |
| | | @AuraEnabled |
| | | public Date rCinspectionDate; |
| | | @AuraEnabled |
| | | public Date qISReplyDay; |