| | |
| | | public class StartTradingController { |
| | | public without sharing class StartTradingController { |
| | | |
| | | /** リードID */ |
| | | public String leadId{get;set;} |
| | |
| | | /** リードOnwer */ |
| | | public User leadOnwer{get; set;} |
| | | |
| | | public String staticResource {get; set;} |
| | | |
| | | /** コンストラクタ */ |
| | | public StartTradingController(ApexPages.StandardController controller){ |
| | | // リードID設定 |
| | | this.leadId = system.currentPageReference().getParameters().get('leadId'); |
| | | System.debug('this.leadId'+this.leadId); |
| | | this.SI_Flg = false; |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact')); |
| | | } |
| | | |
| | | /** 引合ID */ |
| | |
| | | |
| | | /** 販売店から引合をConvertするフラグ **/ |
| | | private Boolean isAgencyOpp = false; |
| | | |
| | | |
| | | |
| | | /** 初期処理 */ |
| | | public void init(){ |
| | | // リード情報を取得 |
| | | this.lead = [select id,SI_OppoLeadSec__c,owner_not_automatically_update__c, Hospital_Name__c, Opportunity_stage__c,Hospital_Name__r.RecordType.DeveloperName, Hospital_Name__r.Parent.RecordType.DeveloperName, |
| | | this.lead = [select id,SI_OppoLeadSec__c,owner_not_automatically_update__c, Hospital_Name__c, Contact_Name__c, Contact_Name__r.Name, |
| | | Opportunity_stage__c,Hospital_Name__r.RecordType.DeveloperName, Hospital_Name__r.Parent.RecordType.DeveloperName, |
| | | LastName, FirstName, LeadSource, Other_Society__c, Opp_Name__c, Purchase_Reason__c, Trade__c, Sales_Root__c, |
| | | Close_Forecasted_Date__c, Competitor__c, Hospital_Budget__c, Promise_Class__c, Dicision_Maker__c, Purchase_Type__c, |
| | | Sales_Method__c, Fund_Basis__c, OwnerId, Wholesale_Price__c, Lead_No__c,CreatedDate,CreatedById |
| | | Sales_Method__c, Fund_Basis__c, OwnerId, Wholesale_Price__c, Lead_No__c,Inquiry_Num__c,CreatedDate,CreatedById |
| | | from Lead where id =: this.leadId]; |
| | | |
| | | // 診療科選択リストの取得(条件:病院=リード情報の病院名称) |
| | |
| | | } |
| | | // 診療科選択リストの設定 |
| | | this.depList = new List<SelectOption>(); |
| | | this.depList.add(new SelectOption(NONE, NONE)); |
| | | // 2022-04-13 ssm 紧急应对 科室和客户人员必填 start |
| | | // this.depList.add(new SelectOption(NONE, NONE)); |
| | | // 2022-04-13 ssm 紧急应对 科室和客户人员必填 end |
| | | Set<ID> depIdList = new Set<ID>(); |
| | | for(Account d : departmentList){ |
| | | depIdList.add(d.id); |
| | | this.depList.add(new SelectOption(String.valueOf(d.get('id')),String.valueOf(d.get('name')))); |
| | | } |
| | | this.sltDep = NONE; |
| | | // 2022-04-13 ssm 紧急应对 科室和客户人员必填 start |
| | | // this.sltDep = NONE; |
| | | this.sltDep = this.lead.Hospital_Name__c; |
| | | this.sltCon = this.lead.Contact_Name__c; |
| | | // 2022-04-13 ssm 紧急应对 科室和客户人员必填 end |
| | | |
| | | // 担当者リスト(初期設定) |
| | | this.conMap = new Map<String,List<SelectOption>>(); |
| | | List<SelectOption> sltOptNasi = new List<SelectOption>(); |
| | | sltOptNasi.add(new SelectOption(NONE, NONE)); |
| | | this.conMap.put(NONE, sltOptNasi); |
| | | // 2022-04-13 ssm 紧急应对 科室和客户人员必填 start |
| | | // sltOptNasi.add(new SelectOption(NONE, NONE)); |
| | | sltOptNasi.add(new SelectOption(this.lead.Contact_Name__c, this.lead.Contact_Name__r.Name)); |
| | | // this.conMap.put(NONE, sltOptNasi); |
| | | // 2022-04-13 ssm 紧急应对 科室和客户人员必填 end |
| | | this.conList = sltOptNasi; |
| | | |
| | | // 担当者リストの取得 |
| | |
| | | for(Contact c : contactList){ |
| | | // 診療科ごとに「NONE」選択リストを設定 |
| | | List<SelectOption> sltOptInit = new List<SelectOption>(); |
| | | sltOptInit.add(new SelectOption(NONE, NONE)); |
| | | // 2022-04-13 ssm 紧急应对 科室和客户人员必填 start |
| | | // sltOptInit.add(new SelectOption(NONE, NONE)); |
| | | // 2022-04-13 ssm 紧急应对 科室和客户人员必填 end |
| | | this.conMap.put(c.AccountId,sltOptInit); |
| | | } |
| | | |
| | |
| | | /** 診療科選択リスト変更イベント */ |
| | | public void depChange(){ |
| | | // 診療科選択値によって、担当者選択リストを入れ替える |
| | | this.conList = this.conMap.get(sltDep); |
| | | this.conList = this.conMap.get(sltDep); |
| | | } |
| | | |
| | | /** キャンセルボタン **/ |
| | |
| | | |
| | | /** 取引の開始ボタン **/ |
| | | public PageReference start(){ |
| | | system.debug('进入start()'); |
| | | |
| | | // LHJ 20181012 CHAN-B5G6EZ 购买意向转询价报错 Start |
| | | try { |
| | |
| | | else{ |
| | | opp.Name = '*'; |
| | | } |
| | | //20220412 SWAG-CBUB2W you start |
| | | opp.Inquiry_Num__c = this.lead.Inquiry_Num__c; |
| | | //20220412 SWAG-CBUB2W you end |
| | | opp.From_Lead_TF__c = true; |
| | | opp.Trade__c = (String.isBlank(this.lead.Trade__c)) ? '内貿' : this.lead.Trade__c; |
| | | opp.StageName = '引合'; |