| | |
| | | @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() { |
| | | } |
| | |
| | | // 科室分类 Department_Cateogy__c AgencyReportMap |
| | | this.allselectlist.put('Department_Cateogy__c', RetrospectiveWeeklyReportController.getPicklistValues('Agency_Report__c','Department_Cateogy__c')); |
| | | |
| | | // 工作记录会 WorkRecord__c |
| | | // 活动区分会 WorkRecord__c |
| | | this.allselectlist.put('WorkRecord__c', RetrospectiveWeeklyReportController.getPicklistValues('Agency_Report__c','WorkRecord__c')); |
| | | |
| | | // 效果进度 EffectProgress__c |
| | |
| | | // if(login_user_id.UserPro_Type__c == 'ET') |
| | | this.allselectlist.put('ProductClassification__c', RetrospectiveWeeklyReportController.getPicklistValues1('Agency_Report__c','ProductClassification__c')); |
| | | |
| | | // 科室同类耗材月使用量 ConsumptionOfConsumables__c |
| | | // 产品1同类耗材科室月使用量 ConsumptionOfConsumables__c |
| | | this.allselectlist.put('ConsumptionOfConsumables__c', RetrospectiveWeeklyReportController.getPicklistValues('Agency_Report__c','ConsumptionOfConsumables__c')); |
| | | |
| | | //阶段 StageName__c |
| | |
| | | |
| | | //产品类别 |
| | | this.allselectlist.put('WorkMark__c', RetrospectiveWeeklyReportController.getPicklistValues('Agency_Report__c','WorkMark__c')); |
| | | |
| | | //拜访人 |
| | | // //fy 20220414 |
| | | // this.allselectlist.put('doctor3__c', RetrospectiveWeeklyReportController.getPicklistValues('Agency_Report__c','doctor3__c')); |
| | | // 見出し設定 |
| | | 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'))); |
| | | } |
| | | |
| | | |
| | | @RemoteAction |
| | | @AuraEnabled |
| | | public static List<Map<String,String>> selectdoctor3c(){ |
| | | |
| | | List<Map<String,String>> options = new List<Map<String,String>>(); |
| | | options = RetrospectiveWeeklyReportController.getPicklistValues('Agency_Report__c','doctor3__c'); |
| | | |
| | | return options; |
| | | } |
| | | public static List<Map<String,String>> getPicklistValues(String objstr, String fld){ |
| | | List<Map<String,String>> options = new List<Map<String,String>>(); |
| | | Map<String,String> space = new Map<String,String>(); |
| | |
| | | if (!a.isActive()) continue; |
| | | Map<String,String> ses = new Map<String,String>(); |
| | | if(fag){ |
| | | if(a.getValue() != '腹腔镜手术'){ |
| | | if(a.getValue() != '腹腔镜手术'&&a.getValue() != '开腹手术'){ |
| | | ses.put('label', a.getLabel()); |
| | | ses.put('value', a.getValue()); |
| | | ses.put('selected', 'false'); |
| | | options.add(ses); |
| | | } |
| | | }else{ |
| | | if(a.getValue() == '腹腔镜手术'){ |
| | | }else{//fy 20220414 |
| | | if(a.getValue() == '腹腔镜手术'||a.getValue() == '开腹手术'){ |
| | | ses.put('label', a.getLabel()); |
| | | ses.put('value', a.getValue()); |
| | | ses.put('selected', 'false'); |
| | |
| | | lab = dfield.getLabel(); |
| | | mappingmap.put(dfield.name,lab); |
| | | } |
| | | // Agency_Report__c 周报明细 |
| | | // Agency_Report__c 日报明细 |
| | | fieldMap = schemaMap.get('Agency_Report__c').getDescribe().fields.getMap(); |
| | | for(Schema.SObjectField sfield : fieldMap.Values()) |
| | | { |
| | |
| | | |
| | | @RemoteAction |
| | | @AuraEnabled |
| | | public static ProductTypes__c getProduct(String id){ |
| | | return [select Department_Cateogy__c, OPD_Flg__c, Id, SIS_Flg__c from ProductTypes__c where Id =:id]; |
| | | public static ProductTypes__c getProduct(String id){//fy 修改Department_Cateogy_text__c |
| | | return [select Department_Cateogy__c,Department_Cateogy_text__c, OPD_Flg__c, Id, SIS_Flg__c from ProductTypes__c where Id =:id]; |
| | | } |
| | | |
| | | @RemoteAction |
| | |
| | | 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); |
| | |
| | | @AuraEnabled |
| | | public static List<Product2> getUseProduct1(String UseProduct1Name,String select_ProductClassification) { |
| | | String UseProduct1Name01 = '%' + UseProduct1Name.trim() + '%'; |
| | | List<Product2> Product2List = [select Id, Name from Product2 where Category3__c =: select_ProductClassification AND Name like :UseProduct1Name01]; |
| | | User UserProTypec = LightningUtil.loginUserId(); |
| | | List<Product2> Product2List=new List<Product2>(); |
| | | List<String> select_ProductClassificationList = new List<String>(); |
| | | if(select_ProductClassification=='其他'){ |
| | | select_ProductClassificationList.add('基干'); |
| | | select_ProductClassificationList.add('模型'); |
| | | select_ProductClassificationList.add('其他'); |
| | | select_ProductClassificationList.add('其他ET'); |
| | | select_ProductClassificationList.add('外科ET'); |
| | | select_ProductClassificationList.add('附属品'); |
| | | }else if(select_ProductClassification=='呼吸科'){ |
| | | select_ProductClassificationList.add('呼吸科ET'); |
| | | }else{ |
| | | select_ProductClassificationList.add(select_ProductClassification); |
| | | } |
| | | if(UserProTypec.UserPro_Type__c == 'ET'){ |
| | | Product2List = [select Id, Name ,Asset_Model_No__c from Product2 where Category3__c in: select_ProductClassificationList AND Asset_Model_No__c like :UseProduct1Name01 AND Dealer_Object__c = true AND Estimation_Entry_Possibility__c = '○']; |
| | | }else{ |
| | | Product2List = [select Id, Name,Asset_Model_No__c from Product2 where Category3__c in: select_ProductClassificationList AND Category4__c='Thunderbeat' AND Asset_Model_No__c like :UseProduct1Name01 AND ENG_DeaerProFlag__c = true AND Estimation_Entry_Possibility__c = '○']; |
| | | } |
| | | // if(UserProTypec.UserPro_Type__c == 'ET'){ |
| | | // Product2List = [select Id, Name ,Asset_Model_No__c from Product2 where Category3__c =: select_ProductClassification AND Asset_Model_No__c like :UseProduct1Name01 AND Dealer_Object__c = true AND Estimation_Entry_Possibility__c = '○']; |
| | | // }else{ |
| | | // Product2List = [select Id, Name,Asset_Model_No__c from Product2 where Category3__c =: select_ProductClassification AND Category4__c='Thunderbeat' AND Asset_Model_No__c like :UseProduct1Name01 AND ENG_DeaerProFlag__c = true AND Estimation_Entry_Possibility__c = '○']; |
| | | // } |
| | | return Product2List; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | //删除周报明细 |
| | | @RemoteAction |
| | | @AuraEnabled |
| | | public static String deleteAgencyReport(String agencyReport_id){ |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try{ |
| | | System.debug('agencyReport_id'+agencyReport_id); |
| | | Agency_Report__c arrays = new Agency_Report__c(); |
| | | arrays.Id=agencyReport_id; |
| | | delete arrays; |
| | | return 'success'; |
| | | }catch(Exception e){ |
| | | Database.rollback(sp); |
| | | System.debug('exception'+e); |
| | | return e.getLineNumber()+'exception'+e; |
| | | } |
| | | } |
| | | |
| | | @RemoteAction |
| | |
| | | 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('Agency_Report_Header+++'+Agency_Report_Header); |
| | | Agency_Report__c agency_report = makeAgencyReport(Department_Cateogy,ConsumptionOfConsumables, |
| | | WorkMark,warlocksNumber,DealerPersonnel,ProductCcategory,productCategories,WarlockClassification,ProductClassification, WorkRecord, |
| | | EffectProgress,Agency_Report_Header, |
| | |
| | | } else { |
| | | agency_report.DealerPersonnel__c = null; |
| | | } |
| | | //更新经销商医院的 最近周报跟新日 , |
| | | //更新经销商医院的 最近日报跟新日 , |
| | | if (Agency_Hospital != '') { |
| | | LightningUtil.updateAccMaxActivityDate(Agency_Hospital, week); |
| | | } |
| | | if (doctor != '') { agency_report.doctor2__c = doctor; } else { agency_report.doctor2__c = null; } |
| | | if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; } |
| | | //fy 20220414 |
| | | if (doctor != '') { |
| | | if(WorkRecord == '科室会'){ |
| | | agency_report.doctor3__c = doctor; |
| | | }else{ |
| | | agency_report.doctor2__c = doctor; |
| | | } |
| | | }else { |
| | | if(WorkRecord == '科室会'){ |
| | | agency_report.doctor3__c = null; |
| | | }else{ |
| | | agency_report.doctor2__c = null; |
| | | } |
| | | } |
| | | // if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; } |
| | | if (Department_Cateogy != '') { agency_report.Department_Cateogy_text__c = Department_Cateogy; } |
| | | if (ConsumptionOfConsumables != null) { agency_report.ConsumptionOfConsumables__c = ConsumptionOfConsumables; } |
| | | if (WorkRecord != '') { agency_report.WorkRecord__c = WorkRecord; } |
| | | // system.debug('EffectProgress==================>'+EffectProgress); |
| | |
| | | //新建方法 |
| | | 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)) { |
| | | String record_type_id = LightningUtil.getRecordTypeId(data.Department_Cateogy__c); |
| | | List<Account> account = [select Id, RecordTypeId from account where Hospital_Department_Class__c=:data.Hospital__c and RecordTypeId=:record_type_id]; |
| | | data.Department_Class__c = account[0].Id; |
| | | } |
| | | // 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(); |
| | | data.WeeklyReportClassification__c = userPro.UserPro_Type__c; |
| | | system.debug('data==================>'+data); |
| | |
| | | { |
| | | if (String.isBlank(Agency_Report_Id)) { |
| | | return null; |
| | | } |
| | | Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,WarlockClassification__c, |
| | | }//fy Department_Cateogy_text__c |
| | | Agency_Report__c agency_report = [select Id,Hospital__c, Name, Department_Cateogy__c,Department_Cateogy_text__c, ConsumptionOfConsumables__c, WorkRecord__c,WarlockClassification__c, |
| | | ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c, |
| | | UseProduct2__c, UseProduct3__c, Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c |
| | | UseProduct2__c, UseProduct3__c, Person_In_Charge2__c,doctor2__c,doctor3__c,Submit_date__c,Report_Date__c |
| | | from Agency_Report__c where id=:Agency_Report_Id]; |
| | | Date week = Date.valueOf(Submit_date); |
| | | agency_report.Submit_date__c = week; |
| | |
| | | LightningUtil.updateAccMaxActivityDate(Agency_Hospital, week); |
| | | } |
| | | // WRITE Agency Report__c String EffectProgress, ConsumptionOfConsumables__c WorkMark__c,warlocksNumber__c, |
| | | if (doctor != '') { agency_report.doctor2__c = doctor; } else { agency_report.doctor2__c = null; } |
| | | if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; } else { agency_report.Department_Cateogy__c = null; } |
| | | if (doctor != '') { |
| | | if(WorkRecord == '科室会'){ |
| | | agency_report.doctor3__c = doctor; |
| | | }else{ |
| | | agency_report.doctor2__c = doctor; |
| | | } |
| | | } else { |
| | | if(WorkRecord == '科室会'){ |
| | | agency_report.doctor3__c = null; |
| | | }else{ |
| | | agency_report.doctor2__c = null; |
| | | } |
| | | } |
| | | // if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; } else { agency_report.Department_Cateogy__c = null; } |
| | | if (Department_Cateogy != '') { agency_report.Department_Cateogy_text__c = Department_Cateogy; } else { agency_report.Department_Cateogy_text__c = null; } |
| | | if (WorkRecord != '') { agency_report.WorkRecord__c = WorkRecord; } else { agency_report.WorkRecord__c = null; } |
| | | if (ConsumptionOfConsumables != null) { agency_report.ConsumptionOfConsumables__c = ConsumptionOfConsumables; } else { agency_report.ConsumptionOfConsumables__c = null; } |
| | | if (EffectProgress != '') { agency_report.EffectProgress__c = EffectProgress; } else { agency_report.EffectProgress__c = null; } |
| | |
| | | if (WarlockClassification != '') { agency_report.WarlockClassification__c = WarlockClassification; } else { agency_report.WarlockClassification__c = null; } |
| | | if (WorkMark != false) { agency_report.WorkMark__c = WorkMark; } else { agency_report.WorkMark__c = false; } |
| | | if (warlocksNumber != null) { agency_report.warlocksNumber__c = warlocksNumber; } else { agency_report.warlocksNumber__c = null; } |
| | | agency_report = LightningUtil.updateAgencyReport(agency_report); |
| | | //fy 20220414 |
| | | // agency_report = LightningUtil.updateAgencyReport(agency_report); |
| | | agency_report = updateAgencyReport(agency_report); |
| | | |
| | | return agency_report.Id; |
| | | } |
| | | |
| | | //fy 20220414 |
| | | public static Agency_Report__c updateAgencyReport(Agency_Report__c data) { |
| | | system.debug('data.Agency_Hospital__c++'+data.Agency_Hospital__c); |
| | | system.debug('data.Id++'+data.Id); |
| | | if (String.isBlank(data.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]; |
| | | data.Hospital__c = agency_hospital_link[0].Hospital__c; |
| | | } |
| | | update data; |
| | | return data; |
| | | } |
| | | @RemoteAction |
| | | @AuraEnabled |
| | | public static List<Agency_Opportunity__c> selectOpportunityByIdAndHospitalLinkId(String opportunity_id, String agency_hospital_link_id) { |
| | |
| | | return ret; |
| | | } |
| | | |
| | | // 批量添加周报by vivek start |
| | | // 批量添加日报by vivek start |
| | | @RemoteAction |
| | | @AuraEnabled |
| | | public static List<Agency_Report__c> getReportsByDate(String date1, String date2) { |
| | |
| | | String login_user_id = UserInfo.getUserId(); |
| | | return [select id, Name, Agency_User__c from contact]; |
| | | } |
| | | |
| | | // fy 导入 20220506 start |
| | | @AuraEnabled |
| | | public static String processDataAWSId(String fileData) { |
| | | System.debug('fileData:::'+filedata); |
| | | String errorMag = ''; |
| | | // 创建日报 |
| | | try{ |
| | | if(fileData!=null){ |
| | | String[] fileLines = new String[]{}; |
| | | fileLines = fileData.split('\n'); |
| | | |
| | | // 经销商医院名称list |
| | | List<String> ahlNameList = new List<String>(); |
| | | //for content |
| | | system.debug('fileLines.size()==============>'+fileLines.size()); |
| | | for (Integer i=1,j=fileLines.size();i<j;i++){ |
| | | List<String> inputvalues = new List<String>(); |
| | | system.debug('fileLines[i]= '+fileLines[i].replace(',','').trim()+' +++'); |
| | | if(fileLines[i].replace(',','').trim()!=''){ |
| | | inputvalues = fileLines[i].split(','); |
| | | if(inputvalues != null){ |
| | | if(inputvalues[1] == '' || inputvalues[1] == null){ |
| | | errorMag += 'error1 第'+i+'行数据医院不能为空'; |
| | | } |
| | | ahlNameList.add(inputvalues[1]); |
| | | } |
| | | } |
| | | } |
| | | system.debug('ahlNameList==============>'+ahlNameList); |
| | | // 经销商医院的ocsm医院id的list |
| | | List<String> ahlOcsmIdList = new List<String>(); |
| | | List<Agency_Hospital_Link__c> ahlList = [select id,name,Hospital__c,MaxActivityDate__c from Agency_Hospital_Link__c where name = :ahlNameList and Agency_Campaign_Obj__c = true]; |
| | | |
| | | for(Agency_Hospital_Link__c ahl : ahlList){ |
| | | ahlOcsmIdList.add(ahl.Hospital__c); |
| | | } |
| | | //List<Agency_Contact__c> doctor2list = [select id,Name,Doctor_Division1__c,Type__c,Agency_Hospital__c,AWS_Data_Id__c,Name_Encrypted__c FROM Agency_Contact__c WHERE Hospital_ID18__c= :ahlOcsmIdList order by Name]; |
| | | List<Agency_Contact__c> doctor2list = [select id,Name,Doctor_Division1__c,Type__c,Agency_Hospital__c,AWS_Data_Id__c FROM Agency_Contact__c WHERE Hospital_ID18__c= :ahlOcsmIdList order by Name]; //zhj 去掉Name_Encrypted__c 新方案改造 2023-12-21 |
| | | if(errorMag != ''){ |
| | | return errorMag; |
| | | } |
| | | String doctor2listStr = JSON.serialize(doctor2list); |
| | | return doctor2listStr; |
| | | } |
| | | }catch(Exception e){ |
| | | System.debug('exception'+e); |
| | | return e.getLineNumber()+'exception:'+e; |
| | | } |
| | | return 'success'; |
| | | } |
| | | //fy 调用pi改造的 获取url 和 token的方法 |
| | | @AuraEnabled |
| | | public static Map<String,String> getAwsurl(String sobj){ |
| | | system.debug('进入getAwsurl'); |
| | | PIHelper.PIIntegration piIntegration = PIHelper.getPIIntegrationInfo(sobj); |
| | | Map<String,String> awsmap = new Map<String,String>(); |
| | | awsmap.put('token', piIntegration.token); |
| | | awsmap.put('newUrl', piIntegration.newUrl); |
| | | awsmap.put('searchUrl', piIntegration.searchUrl); |
| | | awsmap.put('transactionURL', piIntegration.transactionURL); |
| | | return awsmap; |
| | | } |
| | | // fy 导入 20220506 end |
| | | @AuraEnabled |
| | | public static String processData(String fileData,String sobjectName,List<String> fields) { |
| | | String errorMag = ''; |
| | | System.debug('fileData=================>'+fileData); |
| | | // 创建周报 |
| | | // 创建日报 |
| | | try{ |
| | | if(fileData!=null){ |
| | | User UserProTypec = LightningUtil.loginUserId(); |
| | | String SignInId = UserInfo.getUserId(); |
| | | |
| | | String[] fileLines = new String[]{}; |
| | | fileLines = fileData.split('\n'); |
| | | // 担当名称的list |
| | |
| | | //for content |
| | | for (Integer i=1,j=fileLines.size();i<j;i++){ |
| | | List<String> inputvalues = new List<String>(); |
| | | inputvalues = fileLines[i].split(','); |
| | | system.debug('inputvalues:::::::'+inputvalues); |
| | | if(inputvalues != null){ |
| | | if(inputvalues[1] == '' || inputvalues[1] == null){ |
| | | errorMag += 'error1 第'+i+'行数据担当不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[2] == '' || inputvalues[2] == null){ |
| | | errorMag += 'error1 第'+i+'行数据活动日不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[3] == '' || inputvalues[3] == null){ |
| | | errorMag += 'error1 第'+i+'行数据医院不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[4] == '' || inputvalues[4] == null){ |
| | | errorMag += 'error1 第'+i+'行数据科室不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | if(fileLines[i].replace(',','').trim()!=''){ |
| | | inputvalues = fileLines[i].split(','); |
| | | system.debug('inputvalues:::::::'+inputvalues); |
| | | if(inputvalues != null){ |
| | | // if(inputvalues[0] == '' || inputvalues[0] == null){ |
| | | // errorMag += 'error1 第'+i+'行数据周不能为空'; |
| | | // errorMag += '='; |
| | | // } |
| | | // if(inputvalues[0] == '' || inputvalues[0] == null){ |
| | | // errorMag += 'error1 第'+i+'行数据担当不能为空'; |
| | | // errorMag += '='; |
| | | // } |
| | | if(inputvalues[0] == '' || inputvalues[0] == null){ |
| | | errorMag += 'error1 第'+i+'行数据活动日不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[1] == '' || inputvalues[1] == null){ |
| | | errorMag += 'error1 第'+i+'行数据医院不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[2] == '' || inputvalues[2] == null){ |
| | | errorMag += 'error1 第'+i+'行数据科室不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | //fy 20220414 |
| | | // String departmentstr = GetDepartment_Cateogy(inputvalues[2]); |
| | | // if(departmentstr == 'no' && inputvalues[2] != '' && inputvalues[2] != null){ |
| | | // if(inputvalues[2] != '' && inputvalues[2] != null){ |
| | | // errorMag += 'error3 第'+i+'行数据科室选项列表的值'+inputvalues[2]+'不存在'; |
| | | // errorMag += '='; |
| | | // } |
| | | if(inputvalues[3] == '' || inputvalues[3] == null){ |
| | | errorMag += 'error1 第'+i+'行数据经销商人员不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[4] == '' || inputvalues[4] == null){ |
| | | errorMag += 'error1 第'+i+'行数据活动区分不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | boolean purposeType = GetPurposeType(inputvalues[4]); |
| | | if(!purposeType && inputvalues[4] != '' && inputvalues[4] != null){ |
| | | errorMag += 'error3 第'+i+'行数据活动区分选项列表的值'+inputvalues[4]+'不存在'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[4] == 'SIS'||inputvalues[4] == '科室会'||inputvalues[4] == '院内入院申请'||inputvalues[4] == '收费项目申请'){ |
| | | if(inputvalues[5] == '' || inputvalues[5] == null){ |
| | | errorMag += 'error1 第'+i+'行数据拜访人不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | if(inputvalues[6] == '' || inputvalues[6] == null){ |
| | | errorMag += 'error1 第'+i+'行数据产品分类(第三分类)不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | // if(inputvalues[4] != '临床信息(使用量)收集' && inputvalues[4] != 'QIS处理'){ |
| | | if(inputvalues[4] != '临床信息(使用量)收集' ){ |
| | | if(inputvalues[7] == '' || inputvalues[7] == null){ |
| | | errorMag += 'error1 第'+i+'行数据使用产品1不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | if((inputvalues[8] != '' && inputvalues[8] != null)&& inputvalues[7] == inputvalues[8]){ |
| | | errorMag += 'error1 第'+i+'行数据使用产品1和使用产品2的值不能重复'; |
| | | errorMag += '='; |
| | | } |
| | | if((inputvalues[9] != '' && inputvalues[9] != null)&& inputvalues[7] == inputvalues[9]){ |
| | | errorMag += 'error1 第'+i+'行数据使用产品1和使用产品3的值不能重复'; |
| | | errorMag += '='; |
| | | } |
| | | if((inputvalues[8] != '' && inputvalues[8] != null) && (inputvalues[9] != '' && inputvalues[9] != null) && inputvalues[8] == inputvalues[9]){ |
| | | errorMag += 'error1 第'+i+'行数据使用产品2和使用产品3的值不能重复'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[4] != '临床信息(使用量)收集' && inputvalues[4] != '市场推广类活动'){ |
| | | if(inputvalues[10] == '' || inputvalues[10] == null){ |
| | | errorMag += 'error1 第'+i+'行数据效果/进度不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | if(inputvalues[4] == '临床信息(使用量)收集'){ |
| | | if(inputvalues[11] == '' || inputvalues[11] == null){ |
| | | errorMag += 'error1 第'+i+'行数据产品1同类耗材科室月使用量不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | if(inputvalues[11] != '' && inputvalues[11] != null){ |
| | | boolean wanked = wncc(inputvalues[11]); |
| | | // if(!wanked && inputvalues[11] == '' || inputvalues[11] == null){ |
| | | if(!wanked){ |
| | | errorMag += 'error3 第'+i+'行数据错误,请检查你的产品1同类耗材科室月使用量!'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | //暂时注掉因为ENG的术士分类为空所以暂时注掉 |
| | | if(inputvalues[4] == '临床信息(使用量)收集'){ |
| | | if(inputvalues[12] == '' || inputvalues[12] == null){ |
| | | errorMag += 'error1 第'+i+'行数据产品1对应术式分类不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | if(inputvalues[4] == '临床信息(使用量)收集'){ |
| | | if(inputvalues[13] == '' || inputvalues[13] == null){ |
| | | errorMag += 'error1 第'+i+'行数据已采用其他产品不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | //暂时注掉因为ET的其他品牌产品类别没有数据 |
| | | if(inputvalues[4] == '临床信息(使用量)收集' && UserProTypec.UserPro_Type__c =='ENG'){ |
| | | if(inputvalues[14] == '' || inputvalues[14] == null){ |
| | | errorMag += 'error1 第'+i+'行数据术士使用产品对应数量不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | if(inputvalues[4] == '临床信息(使用量)收集'){ |
| | | if(inputvalues[15] == '' || inputvalues[15] == null){ |
| | | errorMag += 'error1 第'+i+'行数据产品用量不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | if(inputvalues[15] != '' && inputvalues[15] != null){ |
| | | boolean wankeds = wncc(inputvalues[15]); |
| | | if(!wankeds){ |
| | | errorMag += 'error3 第'+i+'行数据错误,请检查你的产品用量!'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | system.debug('inputvalues[0]====='+inputvalues[0]); |
| | | system.debug('inputvalues[1]====='+inputvalues[1]); |
| | | system.debug('inputvalues[2]====='+inputvalues[2]); |
| | | system.debug('inputvalues[3]====='+inputvalues[3]); |
| | | system.debug('inputvalues[4]====='+inputvalues[4]); |
| | | system.debug('inputvalues[5]====='+inputvalues[5]); |
| | | system.debug('inputvalues[6]====='+inputvalues[6]); |
| | | system.debug('inputvalues[7]====='+inputvalues[7]); |
| | | system.debug('inputvalues[8]====='+inputvalues[8]); |
| | | system.debug('inputvalues[9]====='+inputvalues[9]); |
| | | system.debug('inputvalues[10]====='+inputvalues[10]); |
| | | system.debug('inputvalues[11]====='+inputvalues[11]); |
| | | system.debug('inputvalues[12]====='+inputvalues[12]); |
| | | system.debug('inputvalues[13]====='+inputvalues[13]); |
| | | system.debug('inputvalues[14]====='+inputvalues[14]); |
| | | system.debug('inputvalues[15]====='+inputvalues[15]); |
| | | system.debug('inputvalues[16]====='+inputvalues[16]); |
| | | // system.debug('inputvalues[17]====='+inputvalues[17]); |
| | | //担当 |
| | | // nameList.add(inputvalues[1]); |
| | | //报告日 |
| | | dateList.add(Date.valueOf(inputvalues[0].replace('/','-'))); |
| | | |
| | | String departmentstr = GetDepartment_Cateogy(inputvalues[4]); |
| | | if(departmentstr == 'no' && inputvalues[4] != '' && inputvalues[4] != null){ |
| | | errorMag += 'error3 第'+i+'行数据科室选项列表的值'+inputvalues[4]+'不存在'; |
| | | errorMag += '='; |
| | | //经销商医院 |
| | | ahlNameList.add(inputvalues[1]); |
| | | //使用产品1 |
| | | Product2NameList.add(inputvalues[7]); |
| | | //使用产品2 |
| | | Product2NameList.add(inputvalues[8]); |
| | | //使用产品3 |
| | | Product2NameList.add(inputvalues[9]); |
| | | //效果进度 |
| | | EffectProgressList.add(inputvalues[10]); |
| | | //术士分类 |
| | | OtherBrandConsumablesList.add(inputvalues[12]); |
| | | //已采用其他品牌 |
| | | ProductCcategoryList.add(inputvalues[13]); |
| | | //其他品牌产品类别 |
| | | productCategoriesList.add(inputvalues[14]); |
| | | //科室 |
| | | // departmentSet.add('%'+GetDepartment_Cateogy(inputvalues[2])+'%'+'-'+GetEPurposeType(inputvalues[8])); |
| | | //导入的数据 |
| | | inputList.add(inputvalues); |
| | | } |
| | | if(inputvalues[5] == '' || inputvalues[5] == null){ |
| | | errorMag += 'error1 第'+i+'行数据经销商人员不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[6] == '' || inputvalues[6] == null){ |
| | | errorMag += 'error1 第'+i+'行数据工作记录不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | boolean purposeType = GetPurposeType(inputvalues[6]); |
| | | if(!purposeType && inputvalues[6] != '' && inputvalues[6] != null){ |
| | | errorMag += 'error3 第'+i+'行数据工作记录选项列表的值'+inputvalues[6]+'不存在'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[7] == '' || inputvalues[7] == null){ |
| | | errorMag += 'error1 第'+i+'行数据医院人员不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[8] == '' || inputvalues[8] == null){ |
| | | errorMag += 'error1 第'+i+'行数据产品分类(第三分类)不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[9] == '' || inputvalues[9] == null){ |
| | | errorMag += 'error1 第'+i+'行数据使用产品1不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | if((inputvalues[10] != '' && inputvalues[10] != null)&& inputvalues[9] == inputvalues[10]){ |
| | | errorMag += 'error1 第'+i+'行数据使用产品1和使用产品2的值不能重复'; |
| | | errorMag += '='; |
| | | } |
| | | if((inputvalues[11] != '' && inputvalues[11] != null)&& inputvalues[9] == inputvalues[11]){ |
| | | errorMag += 'error1 第'+i+'行数据使用产品1和使用产品3的值不能重复'; |
| | | errorMag += '='; |
| | | } |
| | | if((inputvalues[10] != '' && inputvalues[10] != null) && (inputvalues[11] != '' && inputvalues[11] != null) && inputvalues[10] == inputvalues[11]){ |
| | | errorMag += 'error1 第'+i+'行数据使用产品2和使用产品3的值不能重复'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[12] == '' || inputvalues[12] == null){ |
| | | errorMag += 'error1 第'+i+'行数据效果/进度不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | if(inputvalues[13] == '' || inputvalues[13] == null){ |
| | | errorMag += 'error1 第'+i+'行数据科室同类耗材月使用量不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | boolean wanked = wncc(inputvalues[13]); |
| | | if(!wanked && inputvalues[13] == '' || inputvalues[13] == null){ |
| | | errorMag += 'error3 第'+i+'行数据错误,请检查你的科室同类耗材月使用量!'; |
| | | errorMag += '='; |
| | | } |
| | | //暂时注掉因为ENG的术士分类为空所以暂时注掉 |
| | | // if(inputvalues[14] == '' || inputvalues[14] == null){ |
| | | // errorMag += 'error1 第'+i+'行数据其他品牌耗材使用不能为空'; |
| | | // errorMag += '='; |
| | | // } |
| | | if(inputvalues[15] == '' || inputvalues[15] == null){ |
| | | errorMag += 'error1 第'+i+'行数据已采用其他产品不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | //暂时注掉因为ET的其他品牌产品类别没有数据 |
| | | // if(inputvalues[16] == '' || inputvalues[16] == null){ |
| | | // errorMag += 'error1 第'+i+'行数据术士使用产品对应数量不能为空'; |
| | | // errorMag += '='; |
| | | // } |
| | | if(inputvalues[17] == '' || inputvalues[17] == null){ |
| | | errorMag += 'error1 第'+i+'行数据术产品用量不能为空'; |
| | | errorMag += '='; |
| | | } |
| | | boolean wankeds = wncc(inputvalues[17]); |
| | | if(!wankeds && inputvalues[17] == '' || inputvalues[17] == null){ |
| | | errorMag += 'error3 第'+i+'行数据错误,请检查你的产品用量!'; |
| | | errorMag += '='; |
| | | } |
| | | system.debug('inputvalues[1]====='+inputvalues[1]); |
| | | system.debug('inputvalues[2]====='+inputvalues[2]); |
| | | system.debug('inputvalues[3]====='+inputvalues[3]); |
| | | system.debug('inputvalues[4]====='+inputvalues[4]); |
| | | system.debug('inputvalues[5]====='+inputvalues[5]); |
| | | system.debug('inputvalues[6]====='+inputvalues[6]); |
| | | system.debug('inputvalues[7]====='+inputvalues[7]); |
| | | system.debug('inputvalues[8]====='+inputvalues[8]); |
| | | system.debug('inputvalues[9]====='+inputvalues[9]); |
| | | system.debug('inputvalues[10]====='+inputvalues[10]); |
| | | system.debug('inputvalues[11]====='+inputvalues[11]); |
| | | system.debug('inputvalues[12]====='+inputvalues[12]); |
| | | system.debug('inputvalues[13]====='+inputvalues[13]); |
| | | system.debug('inputvalues[14]====='+inputvalues[14]); |
| | | system.debug('inputvalues[15]====='+inputvalues[15]); |
| | | system.debug('inputvalues[16]====='+inputvalues[16]); |
| | | system.debug('inputvalues[17]====='+inputvalues[17]); |
| | | system.debug('inputvalues[18]====='+inputvalues[18]); |
| | | //担当 |
| | | nameList.add(inputvalues[1]); |
| | | //报告日 |
| | | dateList.add(Date.valueOf(inputvalues[2].replace('/','-'))); |
| | | |
| | | //经销商医院 |
| | | ahlNameList.add(inputvalues[3]); |
| | | //使用产品1 |
| | | Product2NameList.add(inputvalues[9]); |
| | | //使用产品2 |
| | | Product2NameList.add(inputvalues[10]); |
| | | //使用产品3 |
| | | Product2NameList.add(inputvalues[11]); |
| | | //效果进度 |
| | | EffectProgressList.add(inputvalues[12]); |
| | | //术士分类 |
| | | OtherBrandConsumablesList.add(inputvalues[14]); |
| | | //已采用其他品牌 |
| | | ProductCcategoryList.add(inputvalues[15]); |
| | | //其他品牌产品类别 |
| | | productCategoriesList.add(inputvalues[16]); |
| | | //科室 |
| | | // departmentSet.add('%'+GetDepartment_Cateogy(inputvalues[4])+'%'+'-'+GetEPurposeType(inputvalues[10])); |
| | | //导入的数据 |
| | | inputList.add(inputvalues); |
| | | } |
| | | } |
| | | // 担当名称匹配的map |
| | |
| | | Map<String,FieldClassification__c> EffectProgressMap = new Map<String,FieldClassification__c>(); |
| | | // 术士分类 |
| | | Map<String,FieldClassification__c> OtherBrandConsumablesMap = new Map<String,FieldClassification__c>(); |
| | | Map<String,AggregateResult> OtherBrandConsumablesMap2 = new Map<String,AggregateResult>(); |
| | | // 已采用其他产品 |
| | | Map<String,FieldClassification__c> ProductCcategorynMap = new Map<String,FieldClassification__c>(); |
| | | // 其他品牌产品类别 |
| | |
| | | Map<String,String> DealerPersonnelMap = new Map<String,String>(); |
| | | // 经销商询价的map |
| | | Map<String,Agency_Opportunity__c> aoMap = new Map<String,Agency_Opportunity__c>(); |
| | | //术式分类 的连个下拉选项 |
| | | List<FieldClassification__c> FieldClassification2List; |
| | | List<AggregateResult> WarlockClassificationList2; |
| | | |
| | | List<Contact> conList = LightningUtil.selectAgencyPerson03(); |
| | | List<OlympusCalendar__c> olympusDateList = [select Id,Date__c,FirstDayOfWeek__c,DayOfTheWeek__c from OlympusCalendar__c where Date__c= :dateList ]; |
| | | List<Agency_Hospital_Link__c> ahlList = [select id,name,Hospital__c,MaxActivityDate__c from Agency_Hospital_Link__c where name = :ahlNameList and Agency_Campaign_Obj__c = true]; |
| | | List<Product2> pr2List = [select id,name from Product2 where name in:Product2NameList]; |
| | | //医院 |
| | | List<Agency_Hospital_Link__c> ahlList; |
| | | Contact conStrList = [select AccountId from contact where id in (select ContactId from User where id =: SignInId)]; |
| | | String strAgencyId =conStrList.AccountId; |
| | | System.debug('UserProTypec.UserPro_Type__c = ' + UserProTypec.UserPro_Type__c); |
| | | if(UserProTypec.UserPro_Type__c == 'ENG'){ |
| | | ahlList = [select id,name,Hospital__c,MaxActivityDate__c from Agency_Hospital_Link__c where Agency__c =: strAgencyId and name = :ahlNameList and AgencyHos_ENG__c = true and Agency_Campaign_Obj__c = true]; |
| | | }else { |
| | | ahlList = [select id,name,Hospital__c,MaxActivityDate__c from Agency_Hospital_Link__c where Agency__c =: strAgencyId and name = :ahlNameList and AgencyHos_ET__c = true and Agency_Campaign_Obj__c = true]; |
| | | } |
| | | // List<Agency_Hospital_Link__c> ahlList = [select id,name,Hospital__c,MaxActivityDate__c from Agency_Hospital_Link__c where name = :ahlNameList and Agency_Campaign_Obj__c = true]; |
| | | //使用产品 |
| | | List<Product2> pr2List; |
| | | if(UserProTypec.UserPro_Type__c == 'ET'){ |
| | | pr2List = [select Id, Name,Category3__c,Asset_Model_No__c from Product2 where Asset_Model_No__c in:Product2NameList AND Dealer_Object__c = true AND Estimation_Entry_Possibility__c = '○']; |
| | | }else{ |
| | | pr2List = [select Id, Name,Category3__c,Asset_Model_No__c from Product2 where Category4__c='Thunderbeat' AND Asset_Model_No__c in:Product2NameList AND ENG_DeaerProFlag__c = true AND Estimation_Entry_Possibility__c = '○']; |
| | | } |
| | | system.debug('pr2List++'+pr2List); |
| | | // List<Product2> pr2List = [select id,name from Product2 where name in:Product2NameList]; |
| | | List<FieldClassification__c> FieldClassification1List = [select id,EffectProgress__c from FieldClassification__c where EffectProgress__c in :EffectProgressList]; |
| | | List<FieldClassification__c> FieldClassification2List = [select id,WarlockClassification__c from FieldClassification__c where WarlockClassification__c in :OtherBrandConsumablesList]; |
| | | if(UserProTypec.UserPro_Type__c =='ET'){ |
| | | FieldClassification2List = [select id,WarlockClassification__c from FieldClassification__c where WarlockClassification__c in :OtherBrandConsumablesList]; |
| | | }else{ |
| | | WarlockClassificationList2 = [select count(id) sum, Category4__c from product2 where ENG_DeaerProFlag__c = true group by Category4__c ]; |
| | | } |
| | | List<FieldClassification__c> FieldClassification3List = [select id,ProductCcategory__c from FieldClassification__c where ProductCcategory__c in :ProductCcategoryList]; |
| | | List<FieldClassification__c> FieldClassification4List = [select id,productCategories__c from FieldClassification__c where productCategories__c in :productCategoriesList]; |
| | | |
| | |
| | | for(OlympusCalendar__c olym : olympusIdList){ |
| | | dateIdMap.put(olym.FirstDayOfWeek__c, olym.id); |
| | | } |
| | | for(Contact con :conList){ |
| | | nameIdMap.put(con.Name.replace(' ',''), con.Id); |
| | | nameConMap.put(con.Id, con.Name); |
| | | } |
| | | // for(Contact con :conList){ |
| | | // nameIdMap.put(con.Name.replace(' ',''), con.Id); |
| | | // nameConMap.put(con.Id, con.Name); |
| | | // } |
| | | // return testuse; |
| | | System.debug('ahlList = ' + ahlList); |
| | | for(Agency_Hospital_Link__c ahl : ahlList){ |
| | | ahlMap.put(ahl.Name, ahl); |
| | | ahlOcsmIdList.add(ahl.Hospital__c); |
| | | ahlIdList.add(ahl.Id); |
| | | } |
| | | for(Product2 pr2 : pr2List){ |
| | | UseProductMap.put(pr2.Name, pr2); |
| | | UseProductMap.put(pr2.Asset_Model_No__c, pr2); |
| | | UseProductIdList.add(pr2.Id); |
| | | } |
| | | for(FieldClassification__c ep : FieldClassification1List){ |
| | | EffectProgressMap.put(ep.EffectProgress__c, ep); |
| | | EffectProgressIdList.add(ep.Id); |
| | | } |
| | | for(FieldClassification__c oc : FieldClassification2List){ |
| | | OtherBrandConsumablesMap.put(oc.WarlockClassification__c, oc); |
| | | OtherBrandConsumablesIdList.add(oc.Id); |
| | | //术式分类 |
| | | if(UserProTypec.UserPro_Type__c =='ET'){ |
| | | for(FieldClassification__c oc : FieldClassification2List){ |
| | | OtherBrandConsumablesMap.put(oc.WarlockClassification__c, oc); |
| | | OtherBrandConsumablesIdList.add(oc.Id); |
| | | } |
| | | }else{ |
| | | for(AggregateResult oc : WarlockClassificationList2){ |
| | | OtherBrandConsumablesMap2.put(string.valueOf(oc.get('Category4__c')), oc); |
| | | } |
| | | } |
| | | |
| | | for(FieldClassification__c pc : FieldClassification3List){ |
| | | ProductCcategorynMap.put(pc.ProductCcategory__c, pc); |
| | | ProductCcategorynIdList.add(pc.Id); |
| | |
| | | productCategoriesMap.put(pct.productCategories__c, pct); |
| | | productCategoriesIdList.add(pct.Id); |
| | | } |
| | | List<Agency_Contact__c> doctor2list = [select id,Name,Doctor_Division1__c,Type__c,Agency_Hospital__c FROM Agency_Contact__c WHERE Hospital_ID18__c= :ahlOcsmIdList order by Name]; |
| | | // List<Agency_Contact__c> doctor2list = [select id,Name,Doctor_Division1__c,Type__c,Agency_Hospital__c FROM Agency_Contact__c WHERE Hospital_ID18__c= :ahlOcsmIdList order by Name]; |
| | | //List<Agency_Contact__c> doctor2list = [select id,Name,Doctor_Division1__c,Type__c,Agency_Hospital__c,AWS_Data_Id__c,Name_Encrypted__c FROM Agency_Contact__c WHERE Hospital_ID18__c= :ahlOcsmIdList order by Name]; |
| | | List<Agency_Contact__c> doctor2list = [select id,Name,Doctor_Division1__c,Type__c,Agency_Hospital__c,AWS_Data_Id__c FROM Agency_Contact__c WHERE Hospital_ID18__c= :ahlOcsmIdList order by Name]; //zhj 去掉Name_Encrypted__c 新方案改造 2022-12-21 |
| | | for(Agency_Contact__c ac : doctor2list){ |
| | | doctor2Map.put(ac.Name.replace(' ',''), ac.Id); |
| | | // doctor2Map.put(ac.Name.replace(' ',''), ac.Id); |
| | | //doctor2Map.put(ac.Name_Encrypted__c, ac.Id); //zhj 新方案改造 2022-12-21 |
| | | doctor2Map.put(ac.AWS_Data_Id__c, ac.Id); |
| | | } |
| | | //经销商人员 DealerPersonnel |
| | | List<contact> conListLighrningUtil = LightningUtil.selectAgencyPerson02(); |
| | | for(contact de : conListLighrningUtil){ |
| | | DealerPersonnelMap.put(de.Name.replace(' ',''), de.Id); |
| | | } |
| | | // 创建周报 |
| | | // 创建日报 |
| | | List<Agency_Report_Header__c> agency_report_headerlist = new List<Agency_Report_Header__c>(); |
| | | Map<String,Agency_Report_Header__c> agency_report_headerMap = new Map<String,Agency_Report_Header__c>(); |
| | | //zxk 存放担当 |
| | |
| | | Date week = Date.today(); |
| | | String s_agency = null; |
| | | String s_agencyname = null; |
| | | if(dateMap.get(Date.valueOf(lineList[2].replace('/','-'))) != null){ |
| | | System.debug('dateMap====不等于空'); |
| | | week = dateMap.get(Date.valueOf(lineList[2].replace('/','-'))); |
| | | System.debug('===='+week); |
| | | if(dateMap.get(Date.valueOf(lineList[0].replace('/','-'))) != null){ |
| | | week = dateMap.get(Date.valueOf(lineList[0].replace('/','-'))); |
| | | } |
| | | System.debug('lineList[1].replace()'+lineList[1].replace(' ','')); |
| | | if(nameIdMap.get(lineList[1].replace(' ','')) != null){ |
| | | System.debug('nameIdMap====不等于空'); |
| | | s_agency = nameIdMap.get(lineList[1].replace(' ','')); |
| | | s_agencyname = nameConMap.get(nameIdMap.get(lineList[1].replace(' ',''))); |
| | | System.debug('===='+s_agency); |
| | | // if(nameIdMap.get(lineList[0].replace(' ','')) != null){ |
| | | // s_agency = nameIdMap.get(lineList[0].replace(' ','')); |
| | | // s_agencyname = nameConMap.get(nameIdMap.get(lineList[0].replace(' ',''))); |
| | | if(conList != null &&conList.size()!=0){ |
| | | s_agency = conList[0].Id; |
| | | s_agencyname = conList[0].Name; |
| | | } |
| | | Agency_Report_Header__c agency_report_header = new Agency_Report_Header__c(); |
| | | agency_report_header.Name = s_agencyname + ' (' + week.format().replace('/','-') + ')'; |
| | |
| | | User UserPro = LightningUtil.loginUserId(); |
| | | String UserProTypeStr = UserPro.UserPro_Type__c; |
| | | for(List<String> lineList :inputList){ |
| | | // 创建周报明细 |
| | | // 创建日报明细 |
| | | Date week = null; |
| | | String s_agency = null; |
| | | if(dateMap.get(Date.valueOf(lineList[2].replace('/','-'))) != null){ |
| | | System.debug('dateMap====不等于空'); |
| | | week = dateMap.get(Date.valueOf(lineList[2].replace('/','-'))); |
| | | System.debug('===='+week); |
| | | if(dateMap.get(Date.valueOf(lineList[0].replace('/','-'))) != null){ |
| | | week = dateMap.get(Date.valueOf(lineList[0].replace('/','-'))); |
| | | } |
| | | if(nameIdMap.get(lineList[1].replace(' ','')) != null){ |
| | | System.debug('nameIdMap====不等于空'); |
| | | s_agency = nameIdMap.get(lineList[1].replace(' ','')); |
| | | System.debug('===='+s_agency); |
| | | // if(nameIdMap.get(lineList[0].replace(' ','')) != null){ |
| | | // s_agency = nameIdMap.get(lineList[0].replace(' ','')); |
| | | // } |
| | | if(conList != null &&conList.size()!=0){ |
| | | s_agency = conList[0].Id; |
| | | } |
| | | Agency_Report__c agencyReport = new Agency_Report__c(); |
| | | if(week == null && lineList[2] != '' && lineList[2] != null){ |
| | | errorMag += 'error2 第'+hang+'行数据报告日'+lineList[2]+'填写有误'; |
| | | if(week == null && lineList[0] != '' && lineList[0] != null){ |
| | | errorMag += 'error2 第'+hang+'行数据报告日 '+lineList[0]+'填写有误'; |
| | | errorMag += '='; |
| | | } |
| | | agencyReport.Submit_date__c = week; |
| | | if((s_agency == null || s_agency == '')&& lineList[1] != '' && lineList[1] != null){ |
| | | errorMag += 'error2 第'+hang+'行数据担当'+lineList[1]+'不存在'; |
| | | errorMag += '='; |
| | | } |
| | | // if((s_agency == null || s_agency == '')&& lineList[0] != '' && lineList[0] != null){ |
| | | // errorMag += 'error2 第'+hang+'行数据担当'+lineList[0]+'不存在'; |
| | | // errorMag += '='; |
| | | // } |
| | | agencyReport.Person_In_Charge2__c = s_agency; |
| | | if(lineList[2] != null && lineList[2] != ''){ |
| | | agencyReport.Report_Date__c = Date.valueOf(lineList[2].replace('/','-')); |
| | | if(lineList[0] != null && lineList[0] != ''){ |
| | | agencyReport.Report_Date__c = Date.valueOf(lineList[0].replace('/','-')); |
| | | } |
| | | if(ahlMap.containsKey(lineList[3])){ |
| | | agencyReport.Agency_Hospital__c = ahlMap.get(lineList[3]).Id; |
| | | ahlMap.get(lineList[3]).MaxActivityDate__c = week; |
| | | System.debug('ahlMap = ' + ahlMap); |
| | | System.debug('lineList[1] = ' + lineList[1]); |
| | | if(ahlMap.containsKey(lineList[1])){ |
| | | agencyReport.Agency_Hospital__c = ahlMap.get(lineList[1]).Id; |
| | | ahlMap.get(lineList[1]).MaxActivityDate__c = week; |
| | | }else{ |
| | | if(lineList[1] != '' && lineList[1] != null){ |
| | | errorMag += 'error2 第'+hang+'行数据经销商医院 '+lineList[1]+'不存在'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | // String departmentE = GetDepartment_Cateogy(lineList[2]); |
| | | // if(departmentE != 'no'){// fy Department_Cateogy_text__c |
| | | // agencyReport.Department_Cateogy__c = departmentE; |
| | | agencyReport.Department_Cateogy_text__c =lineList[2]; |
| | | // }else{ |
| | | // } |
| | | if(DealerPersonnelMap.containsKey(lineList[3].replace(' ',''))){ |
| | | agencyReport.DealerPersonnel__c = DealerPersonnelMap.get(lineList[3].replace(' ','')); |
| | | }else{ |
| | | if(lineList[3] != '' && lineList[3] != null){ |
| | | errorMag += 'error2 第'+hang+'行数据经销商医院'+lineList[3]+'不存在'; |
| | | errorMag += 'error2 第'+hang+'行数据经销商人员 '+lineList[3]+'不存在'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | String departmentE = GetDepartment_Cateogy(lineList[4]); |
| | | if(departmentE != 'no'){ |
| | | agencyReport.Department_Cateogy__c = departmentE; |
| | | }else{ |
| | | if(GetPurposeType(lineList[4])){ |
| | | agencyReport.WorkRecord__c = lineList[4]; |
| | | } |
| | | if(DealerPersonnelMap.containsKey(lineList[5].replace(' ',''))){ |
| | | agencyReport.DealerPersonnel__c = DealerPersonnelMap.get(lineList[5].replace(' ','')); |
| | | if(agencyReport.WorkRecord__c == '科室会'){ |
| | | if(lineList[5]=='医生'||lineList[5]=='医生+护士'||lineList[5]=='医生+护士'){ |
| | | agencyReport.doctor3__c = lineList[5]; |
| | | }else{ |
| | | if(lineList[5] != '' && lineList[5] != null){ |
| | | errorMag += 'error2 第'+hang+'行数据拜访人 '+lineList[5]+'不存在'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | }else{ |
| | | if(lineList[5] != '' && lineList[5] != null){ |
| | | errorMag += 'error2 第'+hang+'行数据经销商人员'+lineList[5]+'不存在'; |
| | | errorMag += '='; |
| | | // if(doctor2Map.containsKey(lineList[5].replace(' ',''))){ |
| | | if(doctor2Map.containsKey(lineList[5])){ |
| | | // if(agencyReport.WorkRecord__c == '科室会'){ |
| | | // agencyReport.doctor3__c = doctor2Map.get(lineList[5].replace(' ','')); |
| | | // }else{ |
| | | // agencyReport.doctor2__c = doctor2Map.get(lineList[5].replace(' ','')); |
| | | agencyReport.doctor2__c = doctor2Map.get(lineList[5]); |
| | | // } |
| | | }else{ |
| | | if(lineList[5] != '' && lineList[5] != null){ |
| | | errorMag += 'error2 第'+hang+'行数据客户人员 '+lineList[5]+'不存在'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | } |
| | | if(GetPurposeType(lineList[6])){ |
| | | agencyReport.WorkRecord__c = lineList[6]; |
| | | if(GetProductClassification(lineList[6])){ |
| | | agencyReport.ProductClassification__c = lineList[6]; |
| | | } |
| | | if(doctor2Map.containsKey(lineList[7].replace(' ',''))){ |
| | | agencyReport.doctor2__c = doctor2Map.get(lineList[7].replace(' ','')); |
| | | system.debug('UseProductMap+++'+UseProductMap); |
| | | system.debug('agencyReport.ProductClassification__c+++'+agencyReport.ProductClassification__c); |
| | | if(UseProductMap.containsKey(lineList[7])){ |
| | | if(UseProductMap.get(lineList[7]).Category3__c==agencyReport.ProductClassification__c){ |
| | | agencyReport.UseProduct1__c = UseProductMap.get(lineList[7]).Id; |
| | | }else{ |
| | | errorMag += 'error2 第'+hang+'行数据使用产品1产品型号 '+lineList[7]+'和第三分类无法匹配'; |
| | | errorMag += '='; |
| | | } |
| | | // agencyReport.UseProduct1__c = UseProductMap.get(lineList[7]).Id; |
| | | }else{ |
| | | if(lineList[7] != '' && lineList[7] != null){ |
| | | errorMag += 'error2 第'+hang+'行数据客户人员'+lineList[7]+'不存在'; |
| | | errorMag += 'error2 第'+hang+'行数据使用产品1 '+lineList[7]+'不存在'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | if(GetProductClassification(lineList[8])){ |
| | | agencyReport.ProductClassification__c = lineList[8]; |
| | | |
| | | if(UseProductMap.containsKey(lineList[8])){ |
| | | if(UseProductMap.get(lineList[8]).Category3__c==agencyReport.ProductClassification__c){ |
| | | agencyReport.UseProduct2__c = UseProductMap.get(lineList[8]).Id; |
| | | }else{ |
| | | errorMag += 'error2 第'+hang+'行数据使用产品2产品型号 '+lineList[8]+'和第三分类无法匹配'; |
| | | errorMag += '='; |
| | | } |
| | | // agencyReport.UseProduct2__c = UseProductMap.get(lineList[8]).Id; |
| | | }else{ |
| | | if(lineList[8] != '' && lineList[8] != null){ |
| | | errorMag += 'error2 第'+hang+'行数据使用产品2 '+lineList[8]+'不存在'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | if(UseProductMap.containsKey(lineList[9])){ |
| | | agencyReport.UseProduct1__c = UseProductMap.get(lineList[9]).Id; |
| | | if(UseProductMap.get(lineList[9]).Category3__c==agencyReport.ProductClassification__c){ |
| | | agencyReport.UseProduct3__c = UseProductMap.get(lineList[9]).Id; |
| | | }else{ |
| | | errorMag += 'error2 第'+hang+'行数据使用产品3产品型号 '+lineList[9]+'和第三分类无法匹配'; |
| | | errorMag += '='; |
| | | } |
| | | // agencyReport.UseProduct3__c = UseProductMap.get(lineList[9]).Id; |
| | | }else{ |
| | | if(lineList[9] != '' && lineList[9] != null){ |
| | | errorMag += 'error2 第'+hang+'行数据使用产品1'+lineList[9]+'不存在'; |
| | | errorMag += 'error2 第'+hang+'行数据使用产品3 '+lineList[9]+'不存在'; |
| | | errorMag += '='; |
| | | } |
| | | } |
| | | if(UseProductMap.containsKey(lineList[10])){ |
| | | agencyReport.UseProduct2__c = UseProductMap.get(lineList[10]).Id; |
| | | if(EffectProgressMap.containsKey(lineList[10])){ |
| | | agencyReport.EffectProgress__c = EffectProgressMap.get(lineList[10]).EffectProgress__c; |
| | | } |
| | | boolean wankeds1 = wncc(lineList[11]); |
| | | if(lineList[11] != null && lineList[11] != ''&&wankeds1){ |
| | | agencyReport.ConsumptionOfConsumables__c = Decimal.valueOf(lineList[11]); |
| | | } |
| | | if(UserProTypec.UserPro_Type__c =='ET'){ |
| | | if(OtherBrandConsumablesMap.containsKey(lineList[12])){ |
| | | agencyReport.WarlockClassification__c = OtherBrandConsumablesMap.get(lineList[12]).WarlockClassification__c; |
| | | } |
| | | // else{ |
| | | // if(lineList[12]!=null &&lineList[12]!=''){ |
| | | // errorMag += 'error2 第'+hang+'行数据产品1对应术式分类'+lineList[12]+'不存在'; |
| | | // errorMag += '='; |
| | | // } |
| | | // } |
| | | }else{ |
| | | if(lineList[10] != '' && lineList[10] != null){ |
| | | errorMag += 'error2 第'+hang+'行数据使用产品2'+lineList[10]+'不存在'; |
| | | errorMag += '='; |
| | | if(OtherBrandConsumablesMap2.containsKey(lineList[12])){ |
| | | agencyReport.WarlockClassification__c = string.valueOf(OtherBrandConsumablesMap2.get(lineList[12]).get('Category4__c')); |
| | | } |
| | | // else{ |
| | | // if(lineList[12]!=null &&lineList[12]!=''){ |
| | | // errorMag += 'error2 第'+hang+'行数据产品1对应术式分类'+lineList[12]+'不存在'; |
| | | // errorMag += '='; |
| | | // } |
| | | // } |
| | | } |
| | | if(ProductCcategorynMap.containsKey(lineList[13])){ |
| | | agencyReport.ProductCcategory__c = ProductCcategorynMap.get(lineList[13]).ProductCcategory__c; |
| | | } |
| | | if(UserProTypec.UserPro_Type__c == 'ENG'){ |
| | | if(productCategoriesMap.containsKey(lineList[14])){ |
| | | agencyReport.productCategories__c = productCategoriesMap.get(lineList[14]).productCategories__c; |
| | | } |
| | | } |
| | | if(UseProductMap.containsKey(lineList[11])){ |
| | | agencyReport.UseProduct3__c = UseProductMap.get(lineList[11]).Id; |
| | | }else{ |
| | | if(lineList[11] != '' && lineList[11] != null){ |
| | | errorMag += 'error2 第'+hang+'行数据使用产品3'+lineList[11]+'不存在'; |
| | | errorMag += '='; |
| | | } |
| | | boolean wankeds2 = wncc(lineList[15]); |
| | | if(lineList[15] != null && lineList[15] != ''&&wankeds2){ |
| | | agencyReport.warlocksNumber__c = Decimal.valueOf(lineList[15]); |
| | | } |
| | | if(EffectProgressMap.containsKey(lineList[12])){ |
| | | 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]).WarlockClassification__c; |
| | | } |
| | | if(ProductCcategorynMap.containsKey(lineList[15])){ |
| | | agencyReport.ProductCcategory__c = ProductCcategorynMap.get(lineList[15]).ProductCcategory__c; |
| | | } |
| | | if(productCategoriesMap.containsKey(lineList[16])){ |
| | | agencyReport.productCategories__c = productCategoriesMap.get(lineList[16]).productCategories__c; |
| | | } |
| | | if(lineList[17] != null){ |
| | | agencyReport.warlocksNumber__c = Decimal.valueOf(lineList[17]); |
| | | } |
| | | if(lineList[18] == 'true'){ |
| | | system.debug('lineList[16]=='+lineList[16]+'+++'); |
| | | String workmarkvalue=lineList[16].trim(); |
| | | system.debug('workmarkvalue==++'+workmarkvalue+'+++'); |
| | | if(workmarkvalue=='需要'){ |
| | | agencyReport.WorkMark__c = true; |
| | | }else{ |
| | | agencyReport.WorkMark__c = false; |
| | | } |
| | | system.debug('agencyReport.WorkMark__c+++'+agencyReport.WorkMark__c); |
| | | agencyReport.WeeklyReportClassification__c = UserProTypeStr; |
| | | String headerStr = createHeader(week,s_agency); |
| | | if(agency_report_headerMap.containsKey(headerStr)){ |
| | |
| | | if(ahlMap.values().size() > 0 ){ |
| | | update ahlMap.values(); |
| | | } |
| | | // 新增周报明细 |
| | | // 新增日报明细 |
| | | if(arList.size() > 0 ){ |
| | | system.debug('arList==================>'+arList); |
| | | LightningUtil.insertMAgencyReport(arList); |
| | |
| | | return 'success'; |
| | | }catch(Exception e){ |
| | | System.debug('exception'+e); |
| | | return 'exception'+e; |
| | | return e.getLineNumber()+'exception'+e; |
| | | } |
| | | } |
| | | |
| | |
| | | return departmentE; |
| | | } |
| | | |
| | | // 判断工作记录是否存在 |
| | | // 判断活动区分是否存在 |
| | | public static boolean GetPurposeType(String purposeType){ |
| | | Schema.DescribeFieldResult fieldResult = Agency_Report__c.WorkRecord__c.getDescribe(); |
| | | List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues(); |
| | |
| | | } |
| | | return ''; |
| | | } |
| | | // 批量添加周报by vivek end |
| | | // 批量添加日报by vivek end |
| | | //SWAG-CF58C3 fy start |
| | | @RemoteAction |
| | | @AuraEnabled |
| | | public static Map<String, String> saveAgencyContact(String name, String type,String doctorDivision1, String agencyHospitalid, String awsid) { |
| | | //String name, String nameEncrypt, String type, String typeEncrypt, String doctorDivision1, String doctorDivision1Encrypt, String agencyHospitalid, String awsid //zhj 新方案改造 2023-12-21 |
| | | Agency_Contact__c agency_contact = new Agency_Contact__c(); |
| | | |
| | | agency_contact.Name = name; |
| | | //agency_contact.Name_Encrypted__c = nameEncrypt; //zhj 新方案改造 2023-12-21 |
| | | agency_contact.Type__c = type; |
| | | //agency_contact.Type_Encrypted__c = typeEncrypt; //zhj 新方案改造 2023-12-21 |
| | | agency_contact.Doctor_Division1__c = doctorDivision1; |
| | | //agency_contact.Doctor_Division1_Encrypted__c = doctorDivision1Encrypt; //zhj 新方案改造 2023-12-21 |
| | | agency_contact.Agency_Hospital__c = agencyHospitalid; |
| | | agency_contact.AWS_Data_Id__c = awsid; |
| | | |
| | | Map<String, String> acMap = new Map<String, String>(); |
| | | |
| | | acMap = LightningUtil.insertAgencyContact(agency_contact); |
| | | return acMap; |
| | | } |
| | | //SWAG-CF58C3 fy start |
| | | @RemoteAction |
| | | @AuraEnabled |
| | | public static List<Map<String,String>> newlyBuild(String hospital_id,String nameer, String type, String doctorDivision1){ |
| | |
| | | @RemoteAction |
| | | @AuraEnabled |
| | | public static List<Map<String,String>> selectProductClassificationc(String select_ProductClassification){ |
| | | //fy |
| | | List<FieldClassification__c> WarlockClassificationList; |
| | | List<AggregateResult> WarlockClassificationList2; |
| | | User UserProTypec = LightningUtil.loginUserId(); |
| | | if(String.isNotBlank(select_ProductClassification)){ |
| | | // WarlockClassificationList = [select id, Name , ProductClassification__c from WarlockClassification__c where ProductClassification__c =: select_ProductClassification]; |
| | | WarlockClassificationList = [select id , ProductClassification__c,WarlockClassification__c from FieldClassification__c where ProductClassification__c =: select_ProductClassification]; |
| | | |
| | | if(UserProTypec.UserPro_Type__c =='ET'){ |
| | | WarlockClassificationList = [select id , ProductClassification__c,WarlockClassification__c from FieldClassification__c where ProductClassification__c =: select_ProductClassification]; |
| | | }else{ |
| | | // WarlockClassificationList2 = [select count(id) sum, Category4__c from product2 where Category3__c =: select_ProductClassification and ENG_DeaerProFlag__c = true group by Category4__c ]; |
| | | WarlockClassificationList2 = [select count(id) sum, Category4__c from product2 where ENG_DeaerProFlag__c = true group by Category4__c ]; |
| | | } |
| | | } |
| | | List<Map<String,String>> options = new List<Map<String,String>>(); |
| | | Map<String,String> space = new Map<String,String>(); |
| | | space.put('label', ''); |
| | | space.put('value', ''); |
| | | options.add(space); |
| | | for(FieldClassification__c WarlockClassification : WarlockClassificationList){ |
| | | Map<String,String> WarlockClassificationMap = new Map<String,String>(); |
| | | WarlockClassificationMap.put('label', WarlockClassification.WarlockClassification__c); |
| | | WarlockClassificationMap.put('value', WarlockClassification.WarlockClassification__c); |
| | | options.add(WarlockClassificationMap); |
| | | if(UserProTypec.UserPro_Type__c =='ET'){ |
| | | for(FieldClassification__c WarlockClassification : WarlockClassificationList){ |
| | | Map<String,String> WarlockClassificationMap = new Map<String,String>(); |
| | | WarlockClassificationMap.put('label', WarlockClassification.WarlockClassification__c); |
| | | WarlockClassificationMap.put('value', WarlockClassification.WarlockClassification__c); |
| | | options.add(WarlockClassificationMap); |
| | | } |
| | | }else{ |
| | | for(AggregateResult WarlockClassification2 : WarlockClassificationList2){ |
| | | Map<String,String> WarlockClassificationMap2 = new Map<String,String>(); |
| | | WarlockClassificationMap2.put('label', string.valueOf(WarlockClassification2.get('Category4__c'))); |
| | | WarlockClassificationMap2.put('value', string.valueOf(WarlockClassification2.get('Category4__c'))); |
| | | options.add(WarlockClassificationMap2); |
| | | } |
| | | } |
| | | return options; |
| | | } |
| | |
| | | List<FieldClassification__c> productCategoriesList; |
| | | User UserProETENG = LightningUtil.loginUserId(); |
| | | System.debug('UserProETENG.UserPro_Type__c=============>'+UserProETENG.UserPro_Type__c); |
| | | FieldClassification__c fi = [Select ProductCcategory__c from FieldClassification__c where ID =: select_ProductCcategory]; |
| | | System.debug('select_ProductCcategory=============>'+select_ProductCcategory); |
| | | FieldClassification__c fi = [Select ProductCcategory__c from FieldClassification__c where ProductCcategory__c =: select_ProductCcategory limit 1]; |
| | | if(UserProETENG.UserPro_Type__c == 'ET'){ |
| | | productCategoriesList = [select id, productCategories__c,ET_ENG_classification__c,ProductCcategory__c from FieldClassification__c where ProductCcategory__c =: fi.ProductCcategory__c AND ET_ENG_classification__c =: 'ET']; |
| | | }else{ |
| | |
| | | System.debug('options=============>'+options); |
| | | return options; |
| | | } |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | @AuraEnabled |
| | | public static ControllerResponse searchAgencyDataId(String hospitalId){ |
| | | ControllerResponse r = new ControllerResponse(); |
| | | try{ |
| | | if(String.isBlank(hospitalId)){ |
| | | r.IsSuccess = true; |
| | | r.Message = 'noHospitalId'; |
| | | return r; |
| | | } |
| | | List<Agency_Contact__c> acList = [select id,AWS_Data_Id__c,Agency_Hospital__r.Name from Agency_Contact__c where Agency_Hospital__c=:hospitalId]; |
| | | r.IsSuccess = true; |
| | | r.Message = ''; |
| | | r.Data = acList; |
| | | return r; |
| | | }catch(Exception e) { |
| | | System.debug('into catch'+e.getMessage()); |
| | | r.IsSuccess = false; |
| | | r.message = e.getMessage()+e.getStackTraceString(); |
| | | return r; |
| | | } |
| | | } |
| | | public static void improveTestRate(){ |
| | | Integer i = 0; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | } |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | } |