| | |
| | | //2021-10-20 mzy 任务管理改善 start |
| | | private Boolean IsGeneratePlan; //是否生成计划 |
| | | //2021-10-20 mzy 任务管理改善 end |
| | | //Add By Li Jun 20220224 for PIPL start |
| | | public String idVisitor1PI{set;get;} |
| | | public String idVisitor2PI{set;get;} |
| | | public String staticResource {get; set;} |
| | | public String contactAWSIds{set;get;} |
| | | //Add By Li Jun 20220224 for PIPL end |
| | | public SimpleEventRegisterController(ApexPages.StandardController controller) { |
| | | this.isHospital = true; |
| | | this.isAgent = false; |
| | |
| | | System.debug('-----:inputDatetime=' + inputDatetime); |
| | | this.targetEvent.StartDateTime = inputDatetime; |
| | | } |
| | | //Add by Li Jun 20220303 for PIPL Start |
| | | PIHelper.PIIntegration piIntegration = PIHelper.getPIIntegrationInfo('Contact'); |
| | | staticResource = JSON.serialize(piIntegration); |
| | | system.debug('static resource:'+JSON.serialize(staticResource)); |
| | | //Add by Li Jun 20220303 for PIPL End |
| | | } |
| | | |
| | | public void init() { |
| | |
| | | //2021-07-28 mzy SWAG-C4YB9J 事件页面优化 今天的事件 如果已经生成报告一览,则不允许进行取消和延期操作 end |
| | | allDisable = true; |
| | | } |
| | | //Add By Li Jun for PIPL 20220303 Start |
| | | List<String> conAWSIds = new List<String>(); |
| | | Set<String> contactIdsForReport = new Set<String>(); |
| | | List<String> visitorList = new List<String>{'Visitor1_ID__c','Visitor2_ID__c','Visitor3_ID__c','Visitor4_ID__c','Visitor5_ID__c'}; |
| | | for(String visitorValue:visitorList){ |
| | | if(String.isNotEmpty((String)targetEvent.get(visitorValue))&&String.isNotBlank((String)targetEvent.get(visitorValue))){ |
| | | contactIdsForReport.add((String)targetEvent.get(visitorValue)); |
| | | } |
| | | } |
| | | List<Contact> conListForReport = new List<Contact>([select id,AWS_Data_Id__c from Contact where id in:contactIdsForReport and AWS_Data_Id__c!='']); |
| | | for(Contact con:conListForReport){ |
| | | conAWSIds.add(con.AWS_Data_Id__c); |
| | | } |
| | | contactAWSIds = JSON.serialize(conAWSIds); |
| | | system.debug('Contact AWSIDs:'+contactAWSIds); |
| | | //Add By Li Jun for PIPL 20220303 End |
| | | } |
| | | //20210324 zh WLIG-BX3DQ5 【委托】Outlook日历和SFDC日历同步 end |
| | | if (targetEvent.OPDPlan_Flag__c) { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | //20201123 zh 创建主动任务与维修合同关联 end |
| | | if (LoginUser.Job_Category__c.equals('销售推广')) { |
| | | if (this.targetEvent.Activity_Type2__c == '病院') { |
| | | |
| | | // 2021-06-11 mzy sla 注释掉了询价3 因为现在的页面没有给询价3赋值,所以会显示 询价3不等于空字符串而是等于null ,导致后面的判断进不去 |
| | | // if (this.targetEvent.Related_Opportunity1__c != '' || this.targetEvent.Related_Opportunity2__c != '' || this.targetEvent.Related_Opportunity3__c != '') { |
| | | System.debug('测试询价任务:' +'询价1:' +this.targetEvent.Related_Opportunity1__c +'---询价2:'+this.targetEvent.Related_Opportunity2__c); |
| | |
| | | taskType = System.Label.OpportunityFollow; // 询价跟进任务 |
| | | } else if (this.targetEvent.OPDPlan_Flag__c) { |
| | | taskType = System.Label.OPD; // OPD任务 |
| | | } else if (accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).Is_Target_Account_Energy__c == 1 || accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).Is_Target_Account__c == 1) { |
| | | taskType = System.Label.TargetAccountVisit; // 目标客户拜访任务 |
| | | } else if (accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).OCM_Category__c == 'H1' || accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).OCM_Category__c == 'H0') { |
| | | taskType = System.Label.visitHLevel; // H层拜访任务 |
| | | } else if (!accToNumTarget.isEmpty() && !accToDepMap.isEmpty() && (accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).Is_Target_Account_Energy__c == 1 || accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).Is_Target_Account__c == 1)) { |
| | | taskType = System.Label.TargetAccountVisit; // 目标客户拜访任务 |
| | | } else if (!accToNumTarget.isEmpty() && !accToDepMap.isEmpty() && (accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).OCM_Category__c == 'H1' || accToNumTarget.get(accToDepMap.get(this.targetEvent.whatid__c)).OCM_Category__c == 'H0')) { |
| | | taskType = System.Label.visitHLevel; // H层拜访任务 |
| | | } else { |
| | | taskType = System.Label.DailyVisit;// 日程拜访任务 |
| | | } |
| | | } |
| | | if (this.targetEvent.Activity_Type2__c == '販売店') { |
| | | taskType = System.Label.AgencyVisit; // 经销商拜访任务 |
| | | taskType = System.Label.AgencyVisit; // 经销商支持任务 |
| | | } |
| | | if (this.targetEvent.Activity_Type2__c == '社外イベント') { |
| | | taskType = System.Label.campaignFollow; // 学术会议跟进任务 |
| | |
| | | //2021-11-02 mzy 任务管理改善开发计划 end |
| | | //5.申请类型 |
| | | tempCancelPostponePlan.ApplyType__c = '延期'; |
| | | |
| | | tempCancelPostponePlan.isDailyReportDelay__c = true;//2022-4-22 yjk 事件延期odp增加标识,防止循环 |
| | | insert tempCancelPostponePlan; |
| | | |
| | | } |