| | |
| | | @AuraEnabled public List<Map<String,String>> doctorList{get;set;} |
| | | @AuraEnabled public String UserProType{get;set;} |
| | | @AuraEnabled public Map<String,Agency_Report__c> AgencyReportMap{get;set;} |
| | | |
| | | @AuraEnabled public Map<String,string> PIConfig{get;set;} |
| | | |
| | | public RetrospectiveWeeklyReportController() { |
| | | } |
| | |
| | | // 見出し設定 |
| | | this.fieldsMap = new Map<String,String>(); |
| | | this.fieldsMap = this.getfiledsmap(); |
| | | |
| | | this.PIConfig = new Map<String,string>(); |
| | | this.PIConfig.put('staticResourceAgencyContact', JSON.serialize(PIHelper.getPIIntegrationInfo('Agency_Contact__c'))); |
| | | } |
| | | |
| | | |
| | |
| | | agency_report_header = LightningUtil.upsertAgencyReportHeader(agency_report_header); |
| | | return agency_report_header.Id; |
| | | } |
| | | //新建周报一览 |
| | | public static Agency_Report_Header__c makeReportHeader(String name, String s_date, String s_agency, String head_key){ |
| | | User login_user_id = LightningUtil.loginUserId(); |
| | | Date week = Date.valueOf(s_date); |
| | |
| | | ret.add(space); |
| | | |
| | | Agency_Hospital_Link__c ahl = [select Hospital__c from Agency_Hospital_Link__c where id = :hospital_id]; |
| | | List<Agency_Contact__c> doctor_list = [select id,Name,Doctor_Division1__c,Type__c,Agency_Hospital__c |
| | | List<Agency_Contact__c> doctor_list = [select id,Name,Doctor_Division1__c, |
| | | AWS_Data_Id__c,// PI改造 By Bright 20220328 |
| | | Type__c,Agency_Hospital__c |
| | | FROM Agency_Contact__c WHERE Hospital_ID18__c=:ahl.Hospital__c order by Name]; |
| | | for (Agency_Contact__c row : doctor_list) |
| | | { |
| | |
| | | tmp.put('value', row.Id); |
| | | tmp.put('selected', 'false'); |
| | | tmp.put('Doctor_Division1__c', row.Doctor_Division1__c); |
| | | tmp.put('AWS_Data_Id__c', row.AWS_Data_Id__c);// PI改造 By Bright 20220328 |
| | | ret.add(tmp); |
| | | } |
| | | return ret; |
| | |
| | | String UseProduct1, String UseProduct2, String UseProduct3, |
| | | String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date) |
| | | { |
| | | Department_Cateogy = GetDepartment_Cateogy(Department_Cateogy); |
| | | system.debug('Department_Cateogy+++'+Department_Cateogy); |
| | | Agency_Report__c agency_report = makeAgencyReport(Department_Cateogy,ConsumptionOfConsumables, |
| | | WorkMark,warlocksNumber,DealerPersonnel,ProductCcategory,productCategories,WarlockClassification,ProductClassification, WorkRecord, |
| | | EffectProgress,Agency_Report_Header, |
| | |
| | | //新建方法 |
| | | public static Agency_Report__c insertAgencyReport(Agency_Report__c data) { |
| | | if (String.isBlank(data.Hospital__c)) { |
| | | system.debug('data.Agency_Hospital__c+++'+data.Agency_Hospital__c); |
| | | List<Agency_Hospital_Link__c> agency_hospital_link = [select Id, Hospital__c from Agency_Hospital_Link__c where Id=:data.Agency_Hospital__c]; |
| | | system.debug('agency_hospital_link+++'+agency_hospital_link); |
| | | data.Hospital__c = agency_hospital_link[0].Hospital__c; |
| | | } |
| | | if (String.isBlank(data.Department_Class__c)) { |
| | | system.debug('data.Department_Cateogy__c+++'+data.Department_Cateogy__c); |
| | | String record_type_id = LightningUtil.getRecordTypeId(data.Department_Cateogy__c); |
| | | system.debug('RecordTypeId+++'+record_type_id); |
| | | List<Account> account = [select Id, RecordTypeId from account where Hospital_Department_Class__c=:data.Hospital__c and RecordTypeId=:record_type_id]; |
| | | system.debug('account+++'+account); |
| | | data.Department_Class__c = account[0].Id; |
| | | } |
| | | User userPro = LightningUtil.loginUserId(); |
| | |
| | | } |
| | | } |
| | | if(EffectProgressMap.containsKey(lineList[12])){ |
| | | agencyReport.EffectProgress__c = EffectProgressMap.get(lineList[12]).Id; |
| | | agencyReport.EffectProgress__c = EffectProgressMap.get(lineList[12]).EffectProgress__c; |
| | | } |
| | | if(lineList[13] != null){ |
| | | agencyReport.ConsumptionOfConsumables__c = Decimal.valueOf(lineList[13]); |
| | | } |
| | | if(OtherBrandConsumablesMap.containsKey(lineList[14])){ |
| | | agencyReport.WarlockClassification__c = OtherBrandConsumablesMap.get(lineList[14]).Id; |
| | | agencyReport.WarlockClassification__c = OtherBrandConsumablesMap.get(lineList[14]).WarlockClassification__c; |
| | | } |
| | | if(ProductCcategorynMap.containsKey(lineList[15])){ |
| | | agencyReport.ProductCcategory__c = ProductCcategorynMap.get(lineList[15]).Id; |
| | | agencyReport.ProductCcategory__c = ProductCcategorynMap.get(lineList[15]).ProductCcategory__c; |
| | | } |
| | | if(productCategoriesMap.containsKey(lineList[16])){ |
| | | agencyReport.productCategories__c = productCategoriesMap.get(lineList[16]).Id; |
| | | agencyReport.productCategories__c = productCategoriesMap.get(lineList[16]).productCategories__c; |
| | | } |
| | | if(lineList[17] != null){ |
| | | agencyReport.warlocksNumber__c = Decimal.valueOf(lineList[17]); |
| | |
| | | for(FieldClassification__c efptc : eftpcList){ |
| | | Map<String,String> efptcMap = new Map<String,String>(); |
| | | efptcMap.put('label', efptc.EffectProgress__c); |
| | | efptcMap.put('value', efptc.Id); |
| | | efptcMap.put('value', efptc.EffectProgress__c); |
| | | options.add(efptcMap); |
| | | } |
| | | system.debug('options===============>'+options); |
| | |
| | | for(FieldClassification__c WarlockClassification : WarlockClassificationList){ |
| | | Map<String,String> WarlockClassificationMap = new Map<String,String>(); |
| | | WarlockClassificationMap.put('label', WarlockClassification.WarlockClassification__c); |
| | | WarlockClassificationMap.put('value', WarlockClassification.Id); |
| | | WarlockClassificationMap.put('value', WarlockClassification.WarlockClassification__c); |
| | | options.add(WarlockClassificationMap); |
| | | } |
| | | return options; |
| | |
| | | for(FieldClassification__c ProductCcategory : ProductCcategoryList){ |
| | | Map<String,String> ProductCcategorynMap = new Map<String,String>(); |
| | | ProductCcategorynMap.put('label', ProductCcategory.ProductCcategory__c); |
| | | ProductCcategorynMap.put('value', ProductCcategory.Id); |
| | | ProductCcategorynMap.put('value', ProductCcategory.ProductCcategory__c); |
| | | options.add(ProductCcategorynMap); |
| | | } |
| | | return options; |
| | |
| | | for(FieldClassification__c productCategories : productCategoriesList){ |
| | | Map<String,String> productCategoriesMap = new Map<String,String>(); |
| | | productCategoriesMap.put('label', productCategories.productCategories__c); |
| | | productCategoriesMap.put('value', productCategories.Id); |
| | | productCategoriesMap.put('value', productCategories.productCategories__c); |
| | | options.add(productCategoriesMap); |
| | | } |
| | | System.debug('options=============>'+options); |