From eeb7c0a2d6f037d515bb822d739036b69c4dc73a Mon Sep 17 00:00:00 2001
From: 沙世明 <shashiming@prec-tech.com>
Date: 星期五, 08 四月 2022 17:14:12 +0800
Subject: [PATCH] Merge branch 'master' of http://47.92.229.245:8089/r/OlyMEBG

---
 force-app/main/default/classes/RetrospectiveWeeklyReportController.cls |  187 ++++++++++++++++++++++++++++------------------
 1 files changed, 115 insertions(+), 72 deletions(-)

diff --git a/force-app/main/default/classes/RetrospectiveWeeklyReportController.cls b/force-app/main/default/classes/RetrospectiveWeeklyReportController.cls
index 4f7d67c..afbc386 100644
--- a/force-app/main/default/classes/RetrospectiveWeeklyReportController.cls
+++ b/force-app/main/default/classes/RetrospectiveWeeklyReportController.cls
@@ -6,20 +6,14 @@
     @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() {
     }
     public void UserDoin(){
-        system.debug('222222222222222================>');
-
         User UserProTypec = LightningUtil.loginUserId();
-        system.debug('3333333333333================>'+UserProTypec);
-
         this.UserProType = '';
         this.UserProType = UserProTypec.UserPro_Type__c;
-        system.debug('444444444444444================>'+this.UserProType);
-        
     }
     
     public void setalldata()
@@ -41,7 +35,7 @@
         tmp.add(space);
         
         // 浠g悊搴楁媴褰撹�� AgencyPerson__c
-        List<Contact> agency_person_data = LightningUtil.selectAgencyPerson01();
+        List<Contact> agency_person_data = LightningUtil.selectAgencyPerson03();
         for(Contact var : agency_person_data) {
             Map<String,String> om = new Map<String,String>();
             om.put('label', var.Name);
@@ -90,7 +84,7 @@
         this.allselectlist.put('StageName__c', RetrospectiveWeeklyReportController.getPicklistValues('Agency_Opportunity__c','StageName__c'));
 
         //鍏朵粬鍝佺墝鑰楁潗
-        this.allselectlist.put('OtherBrandConsumables__c', RetrospectiveWeeklyReportController.getPicklistValues('Agency_Report__c','OtherBrandConsumables__c'));
+        this.allselectlist.put('WarlockClassification__c', RetrospectiveWeeklyReportController.getPicklistValues('Agency_Report__c','WarlockClassification__c'));
 
         //浜у搧绫诲埆
         this.allselectlist.put('ProductCcategory__c', RetrospectiveWeeklyReportController.getPicklistValues('Agency_Report__c','ProductCcategory__c'));
@@ -107,6 +101,9 @@
         // 瑕嬪嚭銇楄ō瀹�
         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')));
     }
     
     
@@ -202,7 +199,6 @@
     @AuraEnabled
     public static RetrospectiveWeeklyReportController getalldata(){
         RetrospectiveWeeklyReportController li = new RetrospectiveWeeklyReportController();
-        system.debug('1111111111111111111111================>');
         li.UserDoin();
         li.setalldata();
         return li;
@@ -221,6 +217,7 @@
         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);
@@ -240,12 +237,21 @@
     @AuraEnabled
     public static List<Agency_Hospital_Link__c> getHospitalList(String hospital_name) {
         User login_user_id = LightningUtil.loginUserId();
-        
+        String SignInId = UserInfo.getUserId();
+        // List<Contact> conStrList = [select AccountId from contact where  id in (select ContactId from User where id =: SignInId)];
+        Contact conStrList = [select AccountId from contact where  id in (select ContactId from User where id =: SignInId)];
+
+        system.debug('conStrListconStrListr===============>'+conStrList);
+        String strAgencyId =conStrList.AccountId;
+        // for(Contact conStr : conStrList){
+        //     strAgencyId = conStr.AccountId;
+        // }
+        system.debug('strAgencyIdstrAgencyId==============>'+strAgencyId);
         hospital_name = '%' + hospital_name.trim() + '%'; 
         if(login_user_id.UserPro_Type__c == 'ENG'){
-            return [select Hospital_Name_readonly__c, Id, Hospital__c from Agency_Hospital_Link__c where Hospital_Name_readonly__c like :hospital_name and AgencyHos_ENG__c = true];
+            return [select Hospital_Name_readonly__c, Id, Hospital__c from Agency_Hospital_Link__c where Agency__c =: strAgencyId and Hospital_Name_readonly__c like :hospital_name and AgencyHos_ENG__c = true];
         }else {
-            return [select Hospital_Name_readonly__c, Id, Hospital__c from Agency_Hospital_Link__c where Hospital_Name_readonly__c like :hospital_name and AgencyHos_ET__c = true];
+            return [select Hospital_Name_readonly__c, Id, Hospital__c from Agency_Hospital_Link__c where Agency__c =: strAgencyId and Hospital_Name_readonly__c like :hospital_name and AgencyHos_ET__c = true];
         }
         
     }
@@ -270,9 +276,10 @@
         space.put('selected', 'true');
         ret.add(space);
         
-        // 鎴︾暐绉戝ID銈掑彇寰椼仐銇︺�併仢銈屻倰銈傘仺銇¨瀹€倰SELECT
         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)
         {
@@ -281,6 +288,7 @@
             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;
@@ -289,24 +297,26 @@
     @RemoteAction
     @AuraEnabled
     public static String saveAgencyReport(String Department_Cateogy,Decimal ConsumptionOfConsumables, 
-                                            Boolean WorkMark,Decimal warlocksNumber,String DealerPersonnel,String ProductCcategory,String productCategories ,String OtherBrandConsumables,
+                                            Boolean WorkMark,Decimal warlocksNumber,String DealerPersonnel,String ProductCcategory,String productCategories ,String WarlockClassification,
                                             String ProductClassification,String WorkRecord,String EffectProgress, String Agency_Report_Header,
                                                 String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
                                                 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,OtherBrandConsumables,ProductClassification, WorkRecord,
+        WorkMark,warlocksNumber,DealerPersonnel,ProductCcategory,productCategories,WarlockClassification,ProductClassification, WorkRecord,
         EffectProgress,Agency_Report_Header,
             Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
             UseProduct1, UseProduct2, UseProduct3,
             StageName, oppAmount, oppOCMPrice, Close_Forecasted_Date, Report_Date);
 
-        agency_report = LightningUtil.insertAgencyReport(agency_report);
+        agency_report = insertAgencyReport(agency_report);
         return agency_report.Id;
     }
     public static Agency_Report__c makeAgencyReport(String Department_Cateogy,Decimal ConsumptionOfConsumables, 
-    boolean WorkMark,Decimal warlocksNumber, String DealerPersonnel,String ProductCcategory,String productCategories,String OtherBrandConsumables,
+    boolean WorkMark,Decimal warlocksNumber, String DealerPersonnel,String ProductCcategory,String productCategories,String WarlockClassification,
     String ProductClassification, String WorkRecord, String EffectProgress,String Agency_Report_Header,
             String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
             String UseProduct1, String UseProduct2, String UseProduct3,
@@ -330,7 +340,6 @@
         }
         //缁忛攢鍟嗕汉鍛�
         if (DealerPersonnel != '') {
-           
             if(DealerPersonnel.contains(';')){
                 DealerPersonnel = DealerPersonnel.split(';')[0];
             }
@@ -346,6 +355,7 @@
         if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; }
         if (ConsumptionOfConsumables != null) { agency_report.ConsumptionOfConsumables__c = ConsumptionOfConsumables; }
         if (WorkRecord != '') { agency_report.WorkRecord__c = WorkRecord; }
+        // system.debug('EffectProgress==================>'+EffectProgress);
         if (EffectProgress != '') { agency_report.EffectProgress__c = EffectProgress; }
         // ET    
         if (ProductClassification != '') { agency_report.ProductClassification__c = ProductClassification; }
@@ -354,8 +364,10 @@
         if (UseProduct1 != '') { agency_report.UseProduct1__c = UseProduct1; }
         if (UseProduct2 != '') { agency_report.UseProduct2__c = UseProduct2; }
         if (UseProduct3 != '') { agency_report.UseProduct3__c = UseProduct3; }
-        if (OtherBrandConsumables != '') { agency_report.OtherBrandConsumables__c = OtherBrandConsumables; }  
+        if (WarlockClassification != '') { agency_report.WarlockClassification__c = WarlockClassification; }  
+        system.debug('ProductCcategory==================>'+ProductCcategory);
         if (ProductCcategory != '') { agency_report.ProductCcategory__c = ProductCcategory; }
+        system.debug('productCategories==================>'+productCategories);
         if (productCategories != '') { agency_report.productCategories__c = productCategories; }
         if (warlocksNumber != null) { agency_report.warlocksNumber__c = warlocksNumber; }
         if (WorkMark != false) {
@@ -363,12 +375,34 @@
         }
         return agency_report;  
     }
+    //鏂板缓鏂规硶
+    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();
+        data.WeeklyReportClassification__c = userPro.UserPro_Type__c;
+        system.debug('data==================>'+data);
 
+        insert data;
+        return data;
+    }
     @RemoteAction
     @AuraEnabled
     public static String editAgencyReport(String Agency_Report_Id, String Department_Cateogy,
                                         Decimal ConsumptionOfConsumables,boolean WorkMark,Decimal warlocksNumber,
-                                        String DealerPersonnel,String OtherBrandConsumables,String ProductCcategory,String productCategories,String ProductClassification,
+                                        String DealerPersonnel,String WarlockClassification,String ProductCcategory,String productCategories,String ProductClassification,
                                         String EffectProgress, String WorkRecord, String Agency_Report_Header,
                                         String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
                                         String UseProduct1, String UseProduct2, String UseProduct3, 
@@ -377,7 +411,7 @@
         if (String.isBlank(Agency_Report_Id)) {
             return null;
         }
-        Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,OtherBrandConsumables__c,
+        Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__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
                                             from Agency_Report__c where id=:Agency_Report_Id];
@@ -417,7 +451,7 @@
         if (UseProduct3 != '') { agency_report.UseProduct3__c = UseProduct3; } else { agency_report.UseProduct3__c = null; }  
         if (ProductCcategory != '') { agency_report.ProductCcategory__c = ProductCcategory; } else { agency_report.ProductCcategory__c = null; }
         if (productCategories != '') { agency_report.productCategories__c = productCategories; } else { agency_report.productCategories__c = null; }
-        if (OtherBrandConsumables != '') { agency_report.OtherBrandConsumables__c = OtherBrandConsumables; } else { agency_report.OtherBrandConsumables__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);
@@ -444,7 +478,6 @@
     }
     
     public void get_reports(String date_str, String person_str) {     
-        // 閫卞牨銉囥兗銈裤倰鍙栧緱
         Date week = Date.valueOf(date_str);
         this.reports = LightningUtil.selectAgencyReport01(week, person_str);
     }
@@ -452,8 +485,10 @@
     @RemoteAction
     @AuraEnabled
     public static List<Agency_Report__c> getReportsById(String report_id) {
+        system.debug('==report_id================>'+report_id);
         List<Agency_Report__c> ret = new List<Agency_Report__c>();
-        ret = LightningUtil.selectAgencyReportById(report_id);
+        ret = LightningUtil.selectAgencyReportById01(report_id);
+        system.debug('==Agency_Report_Header__r.WeeklyReportClassification__c=================>'+ret);
         return ret;
     }
     
@@ -464,8 +499,8 @@
         Date date1_date = Date.valueOf(date1);
         Date date2_date = Date.valueOf(date2);
         RetrospectiveWeeklyReportController li = new RetrospectiveWeeklyReportController();
-        List<Contact> conMList = LightningUtil.selectAgencyPerson01();
-        return LightningUtil.selectMAgencyReport(date1_date, date2_date, conMList);
+        List<Contact> conMList = LightningUtil.selectAgencyPerson03();
+        return LightningUtil.selectMAgencyReport01(date1_date, date2_date, conMList);
     }
 
     public List<contact> selectMAgencyPerson() {
@@ -663,13 +698,13 @@
                 // 浣跨敤浜у搧1锛�2锛�3
                 Map<String,Product2> UseProductMap = new Map<String,Product2>();
                 // 鏁堟灉杩涘害
-                Map<String,EffectProgress__c> EffectProgressMap = new Map<String,EffectProgress__c>();
+                Map<String,FieldClassification__c> EffectProgressMap = new Map<String,FieldClassification__c>();
                 // 鏈+鍒嗙被
-                Map<String,WarlockClassification__c> OtherBrandConsumablesMap = new Map<String,WarlockClassification__c>();
+                Map<String,FieldClassification__c> OtherBrandConsumablesMap = new Map<String,FieldClassification__c>();
                 // 宸查噰鐢ㄥ叾浠栦骇鍝�
-                Map<String,ProductCcategory__c> ProductCcategorynMap = new Map<String,ProductCcategory__c>();  
+                Map<String,FieldClassification__c> ProductCcategorynMap = new Map<String,FieldClassification__c>();  
                  // 鍏朵粬鍝佺墝浜у搧绫诲埆
-                 Map<String,productCategories__c> productCategoriesMap = new Map<String,productCategories__c>();  
+                 Map<String,FieldClassification__c> productCategoriesMap = new Map<String,FieldClassification__c>();  
                 // 浣跨敤浜у搧id鐨凩ist
                 List<String> UseProductIdList = new List<String>();
                  // 鏁堟灉杩涘害id鐨凩ist
@@ -692,14 +727,14 @@
                 Map<String,String> DealerPersonnelMap = new Map<String,String>();
                 // 缁忛攢鍟嗚浠风殑map
                 Map<String,Agency_Opportunity__c> aoMap = new Map<String,Agency_Opportunity__c>();
-                List<Contact> conList = LightningUtil.selectAgencyPerson01();      
+                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<EffectProgress__c> epList = [select id,name from EffectProgress__c where name in :EffectProgressList]; 
-                List<WarlockClassification__c> ocList = [select id,name from WarlockClassification__c where name in :OtherBrandConsumablesList];
-                List<ProductCcategory__c> PCList = [select id,name from ProductCcategory__c where name in :ProductCcategoryList];
-                List<productCategories__c> PctList = [select id,name from productCategories__c where name in :productCategoriesList];
+                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];
+                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 : olympusDateList){
                     if(olym.DayOfTheWeek__c == 'Sun'){
@@ -727,20 +762,20 @@
                     UseProductMap.put(pr2.Name, pr2);
                     UseProductIdList.add(pr2.Id);
                 }
-                for(EffectProgress__c ep : epList){
-                    EffectProgressMap.put(ep.Name, ep);
+                for(FieldClassification__c ep : FieldClassification1List){
+                    EffectProgressMap.put(ep.EffectProgress__c, ep);
                     EffectProgressIdList.add(ep.Id);
                 }
-                for(WarlockClassification__c oc : ocList){ 
-                    OtherBrandConsumablesMap.put(oc.Name, oc);
+                for(FieldClassification__c oc : FieldClassification2List){ 
+                    OtherBrandConsumablesMap.put(oc.WarlockClassification__c, oc);
                     OtherBrandConsumablesIdList.add(oc.Id);
                 }
-                for(ProductCcategory__c pc : PCList){ 
-                    ProductCcategorynMap.put(pc.Name, pc);
+                for(FieldClassification__c pc : FieldClassification3List){ 
+                    ProductCcategorynMap.put(pc.ProductCcategory__c, pc);
                     ProductCcategorynIdList.add(pc.Id);
                 }
-                for(productCategories__c pct : PctList){ 
-                    productCategoriesMap.put(pct.Name, pct);
+                for(FieldClassification__c pct : FieldClassification4List){ 
+                    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];
@@ -791,6 +826,8 @@
 				}
                 List<Agency_Report__c> arList = new List<Agency_Report__c>();
                 Integer hang = 1;
+                User UserPro = LightningUtil.loginUserId();
+                String UserProTypeStr = UserPro.UserPro_Type__c;
                 for(List<String> lineList :inputList){
                     // 鍒涘缓鍛ㄦ姤鏄庣粏
                     Date week = null;
@@ -880,19 +917,19 @@
                         }
                     }
                     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.OtherBrandConsumables__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]); 
@@ -902,6 +939,7 @@
                     }else{
                         agencyReport.WorkMark__c =  false; 
                     }
+                    agencyReport.WeeklyReportClassification__c = UserProTypeStr;
                     String headerStr = createHeader(week,s_agency);
                     if(agency_report_headerMap.containsKey(headerStr)){
                         agencyReport.Agency_Report_Header__c = agency_report_headerMap.get(headerStr).Id;
@@ -920,6 +958,7 @@
                 }
                 // 鏂板鍛ㄦ姤鏄庣粏
                 if(arList.size() > 0 ){
+                    system.debug('arList==================>'+arList);
                     LightningUtil.insertMAgencyReport(arList);
                 }
             }
@@ -1057,20 +1096,21 @@
     @AuraEnabled
     public static List<Map<String,String>> selectPurposeTypes(String doctor_value){
         system.debug('doctor_value===============>'+doctor_value);
-
-        List<EffectProgress__c> eftpcList;
+        List<FieldClassification__c> eftpcList;
         if(String.isNotBlank(doctor_value)){
-            eftpcList = [select id, Name , WorkRecord__c from EffectProgress__c where WorkRecord__c =: doctor_value];
+            // eftpcList = [select id, Name , WorkRecord__c from EffectProgress__c where WorkRecord__c =: doctor_value];
+            eftpcList = [Select Id,WorkRecord__c,EffectProgress__c from FieldClassification__c where WorkRecord__c =: doctor_value];
+
         }
         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(EffectProgress__c efptc : eftpcList){
+        for(FieldClassification__c efptc : eftpcList){
             Map<String,String> efptcMap = new Map<String,String>();
-            efptcMap.put('label', efptc.Name);
-            efptcMap.put('value', efptc.Id);
+            efptcMap.put('label', efptc.EffectProgress__c);
+            efptcMap.put('value', efptc.EffectProgress__c);
             options.add(efptcMap);
         }
         system.debug('options===============>'+options);
@@ -1079,19 +1119,21 @@
     @RemoteAction
     @AuraEnabled
     public static List<Map<String,String>> selectProductClassificationc(String select_ProductClassification){
-        List<WarlockClassification__c> WarlockClassificationList;
+        List<FieldClassification__c> WarlockClassificationList;
         if(String.isNotBlank(select_ProductClassification)){
-            WarlockClassificationList = [select id, Name , ProductClassification__c from WarlockClassification__c where ProductClassification__c =: 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];
+
         }
         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(WarlockClassification__c WarlockClassification : WarlockClassificationList){
+        for(FieldClassification__c WarlockClassification : WarlockClassificationList){
             Map<String,String> WarlockClassificationMap = new Map<String,String>();
-            WarlockClassificationMap.put('label', WarlockClassification.Name);
-            WarlockClassificationMap.put('value', WarlockClassification.Id);
+            WarlockClassificationMap.put('label', WarlockClassification.WarlockClassification__c);
+            WarlockClassificationMap.put('value', WarlockClassification.WarlockClassification__c);
             options.add(WarlockClassificationMap);
         }
         return options;
@@ -1099,22 +1141,22 @@
     @RemoteAction
     @AuraEnabled
     public static List<Map<String,String>> selectProductCcategory(){
-        List<ProductCcategory__c> ProductCcategoryList;
+        List<FieldClassification__c> ProductCcategoryList;
         User UserProETENG = LightningUtil.loginUserId();
         if(UserProETENG.UserPro_Type__c == 'ET'){
-            ProductCcategoryList = [select id, Name , ConsumablesClassification__c from ProductCcategory__c where ConsumablesClassification__c =: 'ET'];
+            ProductCcategoryList = [select id,  ProductCcategory__c from FieldClassification__c where classification__c =: 'ET'];
         }else{
-            ProductCcategoryList = [select id, Name , ConsumablesClassification__c from ProductCcategory__c where ConsumablesClassification__c =: 'ENG'];
+            ProductCcategoryList = [select id,  ProductCcategory__c from FieldClassification__c where classification__c =: 'ENG'];
         }
         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(ProductCcategory__c ProductCcategory : ProductCcategoryList){
+        for(FieldClassification__c ProductCcategory : ProductCcategoryList){
             Map<String,String> ProductCcategorynMap = new Map<String,String>();
-            ProductCcategorynMap.put('label', ProductCcategory.Name);
-            ProductCcategorynMap.put('value', ProductCcategory.Id);
+            ProductCcategorynMap.put('label', ProductCcategory.ProductCcategory__c);
+            ProductCcategorynMap.put('value', ProductCcategory.ProductCcategory__c);
             options.add(ProductCcategorynMap);
         }
         return options;
@@ -1122,23 +1164,24 @@
     @RemoteAction
     @AuraEnabled
     public static List<Map<String,String>> selectProductCcategory01(String select_ProductCcategory){
-        List<productCategories__c> productCategoriesList;
+        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];
         if(UserProETENG.UserPro_Type__c == 'ET'){
-            productCategoriesList = [select id, Name,ET_ENG_classification__c,ProductCcategory__c from productCategories__c where ProductCcategory__c =:select_ProductCcategory AND ET_ENG_classification__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{
-            productCategoriesList = [select id, Name,ET_ENG_classification__c,ProductCcategory__c from productCategories__c where ProductCcategory__c =:select_ProductCcategory AND ET_ENG_classification__c =: 'ENG'];
+            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 =: 'ENG'];
         }
         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(productCategories__c productCategories : productCategoriesList){
+        for(FieldClassification__c productCategories : productCategoriesList){
             Map<String,String> productCategoriesMap = new Map<String,String>();
-            productCategoriesMap.put('label', productCategories.Name);
-            productCategoriesMap.put('value', productCategories.Id);
+            productCategoriesMap.put('label', productCategories.productCategories__c);
+            productCategoriesMap.put('value', productCategories.productCategories__c);
             options.add(productCategoriesMap);
         }
         System.debug('options=============>'+options);

--
Gitblit v1.9.1