From 34d9607524cad4f765299b28b4f9423cc2fa9e32 Mon Sep 17 00:00:00 2001 From: 沙世明 <shashiming@prec-tech.com> Date: 星期三, 23 三月 2022 18:07:42 +0800 Subject: [PATCH] Merge branch 'master' of http://47.92.229.245:8089/r/OlyMEBG --- force-app/main/default/classes/EquipmentCoverageTargetBatch.cls | 152 +++++++------- force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js | 19 + force-app/main/default/classes/EquipmentRealCoverageRealBatch.cls | 151 ++++++++------- force-app/main/default/classes/WeeklyReportCmp.cls | 7 force-app/main/default/classes/RentalFixtureSetAssignAgencyController.cls | 2 force-app/main/default/classes/BatchSelectRepairPageController.cls | 82 +++---- force-app/main/default/classes/NFM105Rest.cls | 90 ++++++-- force-app/main/default/classes/EquipmentSetShippmentReceived3Controller.cls | 2 force-app/main/default/pages/BatchSelectRepairPage.page | 34 +- force-app/main/default/classes/NFM624Rest.cls | 17 force-app/main/default/classes/NFM203Rest.cls | 6 11 files changed, 305 insertions(+), 257 deletions(-) diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js index fff0276..93c578b 100644 --- a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js +++ b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js @@ -12,8 +12,8 @@ component.set('v.allselectlist',res.allselectlist); component.set('v.doclist',res.doclist); // PIPL update Yin Mingjie 21/02/2022 start - component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c)); - // this.search_contact(component, event, helper,res.allselectlist.AgencyPerson__c); + // component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c)); + this.search_contact(component, event, helper,res.allselectlist.AgencyPerson__c); // PIPL update Yin Mingjie 21/02/2022 end component.find('select_department').set('v.options', this.conv_selected(res.allselectlist.Department_Cateogy__c)); component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.Purpose_Type__c)); @@ -669,13 +669,13 @@ component.find('save_button').set('v.disabled', true); var Report_Date__c = component.get('v.data.Report_Date__c'); - alert('Report_Date__c'+Report_Date__c); + // alert('Report_Date__c'+Report_Date__c); var Person_In_Charge2__c = ""; var Submit_date__c = ""; if (component.get('v.mode') == 'edit') { // 鍛� Submit_date__c Submit_date__c = component.get('v.select_report_data').Submit_date__c; - alert('Submit_date__c'+Submit_date__c); + // alert('Submit_date__c'+Submit_date__c); // 鎷呭綋 Person_In_Charge2__c @@ -683,7 +683,7 @@ } else { // 鍛� Submit_date__c Submit_date__c = this.get_date_string(component.find('select_date').get('v.value')); - alert('Submit_date__c'+Submit_date__c); + // alert('Submit_date__c'+Submit_date__c); // 鎷呭綋 Person_In_Charge2__c Person_In_Charge2__c = component.find('select_agency_person').get('v.value'); @@ -754,7 +754,7 @@ if (!Department_Cateogy__c) { error.push("绉戝 涓嶅瓨鍦�"); } if (!doctor2__c) { error.push("鎷滆浜� 涓嶅瓨鍦�"); } if (!Purpose_Type__c) { error.push("娲诲姩鍖哄垎 涓嶅瓨鍦�"); } - if (!SupportNeeds__c) { error.push("鏀彺闇�姹� 涓嶅瓨鍦�"); } + // if (!SupportNeeds__c) { error.push("鏀彺闇�姹� 涓嶅瓨鍦�"); } if (!Opportunity__c) { Opportunity__c = ""; } if (!Product_Category1__c) { error.push("浜у搧鍖哄垎1 涓嶅瓨鍦�"); } if (Purpose_Type__c && (Purpose_Type__c.substr(-3) == 'SIS' || Purpose_Type__c.substr(-3) == 'OPD')) { @@ -774,7 +774,8 @@ if (component.get('v.mode') == 'edit') { var Agency_Report__c = component.get('v.select_report_data').Id; var action = component.get('c.editAgencyReport'); - alert("Purpose_Type:"+Purpose_Type__c+","+"SupportNeedsc:"+SupportNeeds__c); + debugger + // alert("Purpose_Type:"+Purpose_Type__c+","+"SupportNeedsc:"+SupportNeeds__c); action.setParams({ "Agency_Report_Id" : Agency_Report__c, "Department_Cateogy" : Department_Cateogy__c, @@ -842,6 +843,8 @@ /* Save (New & Copy) */ var action = component.get('c.saveAgencyReport'); + debugger; + // alert(SupportNeeds__c); action.setParams({ "Department_Cateogy" : Department_Cateogy__c, "Purpose_Type" : Purpose_Type__c, @@ -1118,6 +1121,7 @@ searchHos : function(component, event, helper) { var hospital_name = event.getParam("value"); var action = component.get("c.getHospitalList"); + debugger; action.setParams({"hospital_name": hospital_name}); action.setCallback(this, function(response) { @@ -1144,6 +1148,7 @@ }, selectHos : function(component, event, helper) { + debugger var hospital_list = component.find('hospital_list'); $A.util.removeClass(hospital_list, 'slds-is-open'); var accname = event.currentTarget.dataset.accname; diff --git a/force-app/main/default/classes/BatchSelectRepairPageController.cls b/force-app/main/default/classes/BatchSelectRepairPageController.cls index ae63a1c..e1526dd 100644 --- a/force-app/main/default/classes/BatchSelectRepairPageController.cls +++ b/force-app/main/default/classes/BatchSelectRepairPageController.cls @@ -1,5 +1,5 @@ public with sharing class BatchSelectRepairPageController { - public List<RetrievalData> RevalInfoList { get; set; } + public RetrievalData RevalInfo { get; set; } public List<RepairData> RAInfoList { get; set; } public List<Repair__c> RepairList { get; set; } public List<String> repairIdList{ get; set; } @@ -12,58 +12,51 @@ } public void init(){ - RetrievalData reval = new RetrievalData(); - RevalInfoList = new List<RetrievalData>(); - RevalInfoList.add(reval); + RevalInfo = new RetrievalData(); } public PageReference RetrievalBtn() { RepairList = new List<Repair__c>(); RAInfoList = new List<RepairData>(); - String sql; - System.debug('RevalInfoList1:' + RevalInfoList); - for(RetrievalData reval : RevalInfoList){ - if(String.isBlank(reval.Status2) && String.isBlank(reval.RepairName) && String.isBlank(reval.SAPRepairNo) - && String.isBlank(reval.SerialNumber) && String.isBlank(reval.repair.Incharge_Staff__c) - && String.isBlank(String.valueOf(reval.repair.Final_complete_day__c))){ - ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '璇疯嚦灏戞坊鍔犱竴涓绱㈡潯浠�!')); - return null; - } - sql += 'select Id, Name, SAP_Service_Repair_No__c, Status1__c, Status2__c, Delivered_Product__c, SerialNumber__c, '; - sql += 'HP_Name__c, State_Hospital__c, Incharge_Staff__c, FSE_ApplyForRepair_Day__c, work_location_select__c, On_site_repair__c,'; - sql += 'Number_of_EffectiveContract__c, NewProductGuaranteeObject__c from Repair__c where Id != null '; - if(String.isNotBlank(reval.Status2)){ - sql += ' and Status2__c like \'%' + reval.Status2 + '%\' '; - } - if(String.isNotBlank(reval.RepairName)){ - sql += ' and Name like \'%' + reval.RepairName + '%\' '; - } - if(String.isNotBlank(reval.SAPRepairNo)){ - sql += ' and SAP_Service_Repair_No__c like \'%' + reval.SAPRepairNo + '%\' '; - } - if(String.isNotBlank(reval.SerialNumber)){ - sql += ' and SerialNumber__c like \'%' + reval.SerialNumber + '%\' '; - } - if(String.isNotBlank(reval.repair.Incharge_Staff__c)){ - sql += ' and Incharge_Staff__c = \'' + reval.repair.Incharge_Staff__c + '\' '; - } - if(String.isNotBlank(String.valueof(reval.repair.Final_complete_day__c))){ - String day = String.valueof(reval.repair.Final_complete_day__c); - day = day.substring(0,10); - sql += ' and FSE_ApplyForRepair_Day__c = ' + day; - } - sql += ' limit 200'; - sql = sql.substring(4); + if(String.isBlank(RevalInfo.Status2) && String.isBlank(RevalInfo.RepairName) && String.isBlank(RevalInfo.SAPRepairNo) + && String.isBlank(RevalInfo.SerialNumber) && String.isBlank(RevalInfo.repair.Incharge_Staff__c) + && String.isBlank(String.valueOf(RevalInfo.repair.Final_complete_day__c))){ + ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '璇疯嚦灏戞坊鍔犱竴涓绱㈡潯浠�!')); + return null; } + String sql = 'select Id, Name, SAP_Service_Repair_No__c, Status1__c, Status2__c, Delivered_Product__c, SerialNumber__c, '; + sql += 'HP_Name__c, State_Hospital__c, Incharge_Staff__c, FSE_ApplyForRepair_Day__c, work_location_select__c, On_site_repair__c,'; + sql += 'Number_of_EffectiveContract__c, NewProductGuaranteeObject__c from Repair__c where Id != null '; + if(String.isNotBlank(RevalInfo.Status2)){ + sql += ' and Status2__c like \'%' + RevalInfo.Status2 + '%\' '; + } + if(String.isNotBlank(RevalInfo.RepairName)){ + sql += ' and Name like \'%' + RevalInfo.RepairName + '%\' '; + } + if(String.isNotBlank(RevalInfo.SAPRepairNo)){ + sql += ' and SAP_Service_Repair_No__c like \'%' + RevalInfo.SAPRepairNo + '%\' '; + } + if(String.isNotBlank(RevalInfo.SerialNumber)){ + sql += ' and SerialNumber__c like \'%' + RevalInfo.SerialNumber + '%\' '; + } + if(String.isNotBlank(RevalInfo.repair.Incharge_Staff__c)){ + sql += ' and Incharge_Staff__c = \'' + RevalInfo.repair.Incharge_Staff__c + '\' '; + } + if(String.isNotBlank(String.valueof(RevalInfo.repair.Final_complete_day__c))){ + String day = String.valueof(RevalInfo.repair.Final_complete_day__c); + day = day.substring(0,10); + sql += ' and FSE_ApplyForRepair_Day__c = ' + day; + } + sql += ' limit 201'; System.debug('sql1:' + sql); if(String.isNotBlank(sql)){ RepairList = Database.query(sql); } - if(RepairList.size() >= 200 ){ - ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '妫�绱㈡暟鎹お澶�,璇风缉灏忔绱㈣寖鍥�')); + if(RepairList.size() > 200){ + ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '妫�绱㈡暟鎹お澶�,璇风缉灏忔绱㈣寖鍥达紒')); return null; } - if(RepairList.size() <= 0 ){ + if(RepairList.size() <= 0){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '娌℃绱㈠埌浠讳綍淇悊')); return null; } @@ -78,7 +71,8 @@ repairIdList = new List<String>(); RepairList = new List<Repair__c>(); String url = '='; - if(RAInfoList == null){ + System.debug('RAInfoList:' + RAInfoList); + if(RAInfoList == null || RAInfoList.isEmpty()){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '璇峰厛妫�绱慨鐞�')); return null; } @@ -101,7 +95,7 @@ pageRef.setRedirect(true); return pageRef; } else{ - ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '澶氬崟鎵撳嵃鏈�澶ф暟閲忎负50,璇烽�夋嫨灏戜簬50涓慨鐞�!')); + ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '澶氬崟鎵撳嵃鏈�澶ф暟閲忎负50,璇烽�夋嫨灏戜簬50涓慨鐞嗭紒')); return null; } } else{ @@ -137,8 +131,6 @@ public String RepairName{ get; set; } public String SAPRepairNo{ get; set; } public String SerialNumber{ get; set; } - // public String FSE_ApplyForRepair_Day{ get; set; } - // public String InchargeStaffName{ get; set; } public Repair__c repair{ get; set; } public RetrievalData(){ repair = new Repair__c(); diff --git a/force-app/main/default/classes/EquipmentCoverageTargetBatch.cls b/force-app/main/default/classes/EquipmentCoverageTargetBatch.cls index 52f19e1..5283998 100644 --- a/force-app/main/default/classes/EquipmentCoverageTargetBatch.cls +++ b/force-app/main/default/classes/EquipmentCoverageTargetBatch.cls @@ -2,19 +2,18 @@ @Author: 榛勫崈榫� @Name: EquipmentCoverageTargetBatch @CreateDate: 22/03/2022 -@Description: 鏄惁瑕嗙洊鐜囩洰鏍囷紙鍒嗘瘝锛� +@Description: 鏄惁瑕嗙洊鐜囧疄闄咃紙鍒嗗瓙锛� @Version 1.0 *****************************************************************************************************/ -global class EquipmentCoverageTargetBatch implements Database.Batchable<sObject>,Database.Stateful { +global class EquipmentRealCoverageRealBatch implements Database.Batchable<sObject>,Database.Stateful { public String query; public Date start_dateH1 ; public Date end_dateH1 ; - public List<Id> hospIds = new List<Id>(); public Date toDayTime = Date.today(); + private BatchIF_Log__c iflog; public String OCSM_Period_half; public String OCSM_Period = 'FY'+toDayTime.year(); - private BatchIF_Log__c iflog; - global EquipmentCoverageTargetBatch() { + global EquipmentRealCoverageRealBatch() { this.query = query; iflog = new BatchIF_Log__c(); iflog.Type__c = 'PushNotification'; @@ -26,40 +25,34 @@ }else{ OCSM_Period_half = '2H'; } - - } - + global Database.QueryLocator start(Database.BatchableContext bc) { - // query = 'select Id,(select id,IF_Coverage_Target_Asset__c,IF_Coverage_Real_Asset__c,CurrentContract__r.Contract_End_Date__c,CurrentContract__r.Contract_Conclusion_Date__c,Product2.Category4__c,Product2.ServiceCategory__c,Product2.Category3__c from Asset_Hospital__r where Status != \'寤冩\' and Status != \'寰呮姤搴焅'' - // +' and IF_Parts_production__c != \'1\'' - // +' and ((SerMarGuranteeType__c != \'鏈嶅姟澶氬勾淇濅慨\' and SerMarGuranteeType__c != \'甯傚満澶氬勾淇濅慨\') or Extend_Gurantee_DateTo__c >= :egdTime)' - // +' and Product2.ServiceCategory__c != null) from Account where id in :hospIds'; - system.debug('鎵цstart'); - query = 'select Id,Hospital__c,IF_Coverage_Target_Asset__c,IF_Coverage_Real_Asset__c,CurrentContract__r.Contract_End_Date__c,CurrentContract__r.Contract_Conclusion_Date__c,Product2.Category4__c,Product2.ServiceCategory__c,Product2.Category3__c from Asset' - +' where Hospital__c in :hospIds and Product2.ServiceCategory__c != null and Status != \'寤冩\' and Status != \'寰呮姤搴焅' and CurrentContract__c != null' - +' and IF_Parts_production__c != \'1\' and SerMarGuranteeType__c = null and (Extend_Gurantee_DateTo__c = null or Extend_Gurantee_DateTo__c < :egdTime) order by hospital__c'; - - // 5鏉′互涓婅蒋鎬ч暅鍖婚櫌&&鍖婚櫌鏈夋晥 - Date egdTime = Date.newInstance(toDayTime.year()+1,3,1); - List<AggregateResult> Asset1 = [select count(Id),Hospital__c from asset where Product2.ServiceCategory__c ='杞�ч暅' Group by Hospital__c having count(Id)>=5]; - if(Asset1!=null){ - for (AggregateResult a1 : Asset1) { - hospIds.add(String.valueOf(a1.get('Hospital__c'))); - } - } - + system.debug('鎵цstart'); + query = 'select id,Hospital__c,IF_Coverage_Target_Asset__c,IF_Coverage_Real_Asset__c,CurrentContract__r.Contract_End_Date__c,CurrentContract__r.Contract_Conclusion_Date__c,Product2.Category4__c,Product2.ServiceCategory__c,Product2.Category3__c from Asset where ' + +' IF_Parts_production__c != \'1\' and CurrentContract__c != null' + +' and (CurrentContract__r.Contract_End_Date__c >= :start_dateH1 and CurrentContract__r.Contract_Conclusion_Date__c <= :end_dateH1) order by hospital__c'; + // 瀹為檯璁惧鍚堝悓鏃堕棿鍖洪棿1H(4,9);2H(10,3) + if (toDayTime.month() >= 4 && toDayTime.month() <= 9) { + start_dateH1 = Date.newInstance(toDayTime.year(),9,1); + end_dateH1 = Date.newInstance(toDayTime.year(),9,30); + }else{ + start_dateH1 = Date.newInstance(toDayTime.year(),3,1); + end_dateH1 = Date.newInstance(toDayTime.year()+1,3,31); + } return Database.getQueryLocator(query); } global void execute(Database.BatchableContext BC, list<Asset> Assets) { - // List<Account_Service_Of_Target__c> asots = new List<Account_Service_Of_Target__c>(); + + List<Account_Service_Of_Target__c> asots = new List<Account_Service_Of_Target__c>(); + // List<Account_Service_Of_Target__c> asotsIN = new List<Account_Service_Of_Target__c>(); List<Id> accIds = new List<Id>(); Map<String,Account_Service_Of_Target__c> asotMap = new Map<String,Account_Service_Of_Target__c>(); - for (Asset ass1 : Assets) { - accIds.add(ass1.Hospital__c); + for (Asset ass : Assets) { + accIds.add(ass.Hospital__c); } - List<Account_Service_Of_Target__c> asotList = [select Id,Target_Rigid_Mirror_2__c,Target_Soft_Mirror_2__c,Target_Correlation_Lightsource__c,Account_HP__c,OCSM_Period_half__c + List<Account_Service_Of_Target__c> asotList = [select Id,Finish_Rigid_Mirror_2__c,Finish_Rigid_Mirror_3__c,Finish_Correlation_Lightsource__c,Finish_Rigid_Mirror_1__c,Account_HP__c,OCSM_Period_half__c from Account_Service_Of_Target__c where Account_HP__c in :accIds and OCSM_Period_half__c = :OCSM_Period_half and OCSM_Period__c = :OCSM_Period]; @@ -71,62 +64,69 @@ } } } - } - List<Asset> AssetsTarget = new List<Asset>(); + } + + + List<Asset> AssetsReal = new List<Asset>(); for (Asset ass1 : Assets) { - // 瑕嗙洊鐩爣锛堢‖锛夛細娉屽翱绉戠敤纭�ч暅 - Integer mirror_1 = 0; - // 瑕嗙洊鐩爣锛堣蒋锛夛細榧诲捊鍠夐暅 - Integer mirror_2 = 0; - //瑕嗙洊鐩爣锛堝懆杈癸級锛氬厜婧� - Integer mirror_3 = 0; - // 鏍囪鏄惁瑕嗙洊鐜囩洰鏍囪澶� - ass1.IF_Coverage_Target_Asset__c = '1'; - AssetsTarget.add(ass1); - + // 瀹為檯瑕嗙洊鏁帮紙纭級锛氭硨灏跨鐢ㄧ‖鎬ч暅 + Integer mirror_4 = 0; + // 瀹為檯瑕嗙洊鏁帮紙纭級锛氬绉戠敤纭�ч暅 + Integer mirror_5 = 0; + // 瀹為檯瑕嗙洊鏁帮紙鍛ㄨ竟锛夛細鍏夋簮 + Integer mirror_6 = 0; + // 瀹為檯瑕嗙洊鏁帮紙杞級锛氱數瀛愰暅 + Integer mirror_7 = 0; + // 鏍囪鏄惁瑕嗙洊鐜囧疄闄呰澶� + ass1.IF_Coverage_Real_Asset__c = '1'; + AssetsReal.add(ass1); if (ass1.Product2.Category4__c == '娉屽翱绉戠敤纭�ч暅') { - mirror_1++; + mirror_4++; } - if(ass1.Product2.ServiceCategory__c =='杞�ч暅'){ - mirror_2++; + if (ass1.Product2.Category4__c == '濡囩鐢ㄧ‖鎬ч暅') { + mirror_5++; } if (ass1.Product2.Category3__c == '鍏夋簮') { - mirror_3++; - } - if (asotMap.containsKey(ass1.Hospital__c)) { - Account_Service_Of_Target__c asotOne = asotMap.get(ass1.Hospital__c); - system.debug('asotOne=='+ asotOne); - asotOne.Coverage_Target_Account__c = true; - asotOne.Target_Rigid_Mirror_2__c += mirror_1; - asotOne.Target_Soft_Mirror_2__c += mirror_2; - asotOne.Target_Correlation_Lightsource__c += mirror_3; - update asotOne; + mirror_6++; + } + if (ass1.Product2.ServiceCategory__c =='杞�ч暅') { + mirror_7++; + } + if (asotMap.containsKey(ass1.hospital__c)) { + Account_Service_Of_Target__c asotOne = new Account_Service_Of_Target__c(); + asotOne = asotMap.get(ass1.hospital__c); + asotOne.Finish_Rigid_Mirror_2__c += mirror_4; + asotOne.Finish_Rigid_Mirror_3__c += mirror_5; + asotOne.Finish_Correlation_Lightsource__c += mirror_6; + asotOne.Finish_Rigid_Mirror_1__c += mirror_7; + if (!asots.contains(asotOne)) { + asots.add(asotOne); + } }else{ Account_Service_Of_Target__c asot1 = new Account_Service_Of_Target__c(); - asot1.Account_HP__c = ass1.Hospital__c; - asot1.Coverage_Target_Account__c = true; - asot1.Target_Rigid_Mirror_2__c = mirror_1; - asot1.Target_Soft_Mirror_2__c = mirror_2; - asot1.Target_Correlation_Lightsource__c = mirror_3; - asot1.OCSM_Period__c = OCSM_Period; - asot1.OCSM_Period_half__c = OCSM_Period_half; + asot1.Account_HP__c = ass1.hospital__c; + asot1.Finish_Rigid_Mirror_2__c = mirror_4; + asot1.Finish_Rigid_Mirror_3__c = mirror_5; + asot1.Finish_Correlation_Lightsource__c = mirror_6; + asot1.Finish_Rigid_Mirror_1__c = mirror_7; + asot1.OCSM_Period__c = OCSM_Period; + asot1.OCSM_Period_half__c = OCSM_Period_half; asotMap.put(ass1.hospital__c,asot1); - insert asot1; - + if (!asots.contains(asot1)) { + asots.add(asot1); + } } } - system.debug('map=='+asotMap); - if (AssetsTarget!=null) { - try { - system.debug('鎵цupdate'); - Oly_TriggerHandler.bypass('AssetTrigger'); - update AssetsTarget; - } - catch (Exception e) { - iflog.ErrorLog__c += 'ERROR'+'['+'update AssetsTarget:'+']'+e.getMessage()+'\n'; - } - } - + upsert asots; + system.debug('杩欎釜闆嗗悎锛欰ssetsReal ==='+AssetsReal); + if (AssetsReal!=null) { + try { + update AssetsReal; + } + catch (Exception e) { + iflog.ErrorLog__c += 'ERROR'+'['+'update AssetsReal:'+']'+e.getMessage()+'\n'; + } + } } global void finish(Database.BatchableContext BC) { diff --git a/force-app/main/default/classes/EquipmentRealCoverageRealBatch.cls b/force-app/main/default/classes/EquipmentRealCoverageRealBatch.cls index 09ebf56..22f77b2 100644 --- a/force-app/main/default/classes/EquipmentRealCoverageRealBatch.cls +++ b/force-app/main/default/classes/EquipmentRealCoverageRealBatch.cls @@ -2,18 +2,19 @@ @Author: 榛勫崈榫� @Name: EquipmentCoverageTargetBatch @CreateDate: 22/03/2022 -@Description: 鏄惁瑕嗙洊鐜囧疄闄咃紙鍒嗗瓙锛� +@Description: 鏄惁瑕嗙洊鐜囩洰鏍囷紙鍒嗘瘝锛� @Version 1.0 *****************************************************************************************************/ -global class EquipmentRealCoverageRealBatch implements Database.Batchable<sObject>,Database.Stateful { +global class EquipmentCoverageTargetBatch implements Database.Batchable<sObject>,Database.Stateful { public String query; public Date start_dateH1 ; public Date end_dateH1 ; + public List<Id> hospIds = new List<Id>(); public Date toDayTime = Date.today(); - private BatchIF_Log__c iflog; public String OCSM_Period_half; public String OCSM_Period = 'FY'+toDayTime.year(); - global EquipmentRealCoverageRealBatch() { + private BatchIF_Log__c iflog; + global EquipmentCoverageTargetBatch() { this.query = query; iflog = new BatchIF_Log__c(); iflog.Type__c = 'PushNotification'; @@ -25,33 +26,42 @@ }else{ OCSM_Period_half = '2H'; } + + } - + global Database.QueryLocator start(Database.BatchableContext bc) { - system.debug('鎵цstart'); - query = 'select id,Hospital__c,IF_Coverage_Target_Asset__c,IF_Coverage_Real_Asset__c,CurrentContract__r.Contract_End_Date__c,CurrentContract__r.Contract_Conclusion_Date__c,Product2.Category4__c,Product2.ServiceCategory__c,Product2.Category3__c from Asset where ' - +' IF_Parts_production__c != \'1\' and CurrentContract__c != null' - +' and (CurrentContract__r.Contract_End_Date__c >= :start_dateH1 and CurrentContract__r.Contract_Conclusion_Date__c <= :end_dateH1) order by hospital__c'; - // 瀹為檯璁惧鍚堝悓鏃堕棿鍖洪棿1H(4,9);2H(10,3) - if (toDayTime.month() >= 4 && toDayTime.month() <= 9) { - start_dateH1 = Date.newInstance(toDayTime.year(),9,1); - end_dateH1 = Date.newInstance(toDayTime.year(),9,30); - }else{ - start_dateH1 = Date.newInstance(toDayTime.year(),3,1); - end_dateH1 = Date.newInstance(toDayTime.year()+1,3,31); - } + // query = 'select Id,(select id,IF_Coverage_Target_Asset__c,IF_Coverage_Real_Asset__c,CurrentContract__r.Contract_End_Date__c,CurrentContract__r.Contract_Conclusion_Date__c,Product2.Category4__c,Product2.ServiceCategory__c,Product2.Category3__c from Asset_Hospital__r where Status != \'寤冩\' and Status != \'寰呮姤搴焅'' + // +' and IF_Parts_production__c != \'1\'' + // +' and ((SerMarGuranteeType__c != \'鏈嶅姟澶氬勾淇濅慨\' and SerMarGuranteeType__c != \'甯傚満澶氬勾淇濅慨\') or Extend_Gurantee_DateTo__c >= :egdTime)' + // +' and Product2.ServiceCategory__c != null) from Account where id in :hospIds'; + system.debug('鎵цstart'); + query = 'select Id,Hospital__c,IF_Coverage_Target_Asset__c,IF_Coverage_Real_Asset__c,CurrentContract__r.Contract_End_Date__c,CurrentContract__r.Contract_Conclusion_Date__c,Product2.Category4__c,Product2.ServiceCategory__c,Product2.Category3__c from Asset' + +' where Hospital__c in :hospIds and Product2.ServiceCategory__c != null and Status != \'寤冩\' and Status != \'寰呮姤搴焅' and CurrentContract__c != null' + +' and IF_Parts_production__c != \'1\' and SerMarGuranteeType__c = null and (Extend_Gurantee_DateTo__c = null or Extend_Gurantee_DateTo__c < :egdTime) order by hospital__c'; + + // 5鏉′互涓婅蒋鎬ч暅鍖婚櫌&&鍖婚櫌鏈夋晥 + Date egdTime = Date.newInstance(toDayTime.year()+1,3,1); + List<AggregateResult> Asset1 = [select count(Id),Hospital__c from asset where Product2.ServiceCategory__c ='杞�ч暅' Group by Hospital__c having count(Id)>=5]; + if(Asset1!=null){ + for (AggregateResult a1 : Asset1) { + hospIds.add(String.valueOf(a1.get('Hospital__c'))); + } + } + return Database.getQueryLocator(query); } global void execute(Database.BatchableContext BC, list<Asset> Assets) { - - // List<Account_Service_Of_Target__c> asots = new List<Account_Service_Of_Target__c>(); + List<Account_Service_Of_Target__c> asots = new List<Account_Service_Of_Target__c>(); + // List<Account_Service_Of_Target__c> asotsIN = new List<Account_Service_Of_Target__c>(); List<Id> accIds = new List<Id>(); Map<String,Account_Service_Of_Target__c> asotMap = new Map<String,Account_Service_Of_Target__c>(); - for (Asset ass : Assets) { - accIds.add(ass.Hospital__c); + + for (Asset ass1 : Assets) { + accIds.add(ass1.Hospital__c); } - List<Account_Service_Of_Target__c> asotList = [select Id,Finish_Rigid_Mirror_2__c,Finish_Rigid_Mirror_3__c,Finish_Correlation_Lightsource__c,Finish_Rigid_Mirror_1__c,Account_HP__c,OCSM_Period_half__c + List<Account_Service_Of_Target__c> asotList = [select Id,Target_Rigid_Mirror_2__c,Target_Soft_Mirror_2__c,Target_Correlation_Lightsource__c,Account_HP__c,OCSM_Period_half__c from Account_Service_Of_Target__c where Account_HP__c in :accIds and OCSM_Period_half__c = :OCSM_Period_half and OCSM_Period__c = :OCSM_Period]; @@ -63,64 +73,65 @@ } } } - } - - - List<Asset> AssetsReal = new List<Asset>(); + } + List<Asset> AssetsTarget = new List<Asset>(); for (Asset ass1 : Assets) { - // 瀹為檯瑕嗙洊鏁帮紙纭級锛氭硨灏跨鐢ㄧ‖鎬ч暅 - Integer mirror_4 = 0; - // 瀹為檯瑕嗙洊鏁帮紙纭級锛氬绉戠敤纭�ч暅 - Integer mirror_5 = 0; - // 瀹為檯瑕嗙洊鏁帮紙鍛ㄨ竟锛夛細鍏夋簮 - Integer mirror_6 = 0; - // 瀹為檯瑕嗙洊鏁帮紙杞級锛氱數瀛愰暅 - Integer mirror_7 = 0; - // 鏍囪鏄惁瑕嗙洊鐜囧疄闄呰澶� - ass1.IF_Coverage_Real_Asset__c = '1'; - AssetsReal.add(ass1); + // 瑕嗙洊鐩爣锛堢‖锛夛細娉屽翱绉戠敤纭�ч暅 + Integer mirror_1 = 0; + // 瑕嗙洊鐩爣锛堣蒋锛夛細榧诲捊鍠夐暅 + Integer mirror_2 = 0; + //瑕嗙洊鐩爣锛堝懆杈癸級锛氬厜婧� + Integer mirror_3 = 0; + // 鏍囪鏄惁瑕嗙洊鐜囩洰鏍囪澶� + ass1.IF_Coverage_Target_Asset__c = '1'; + AssetsTarget.add(ass1); + if (ass1.Product2.Category4__c == '娉屽翱绉戠敤纭�ч暅') { - mirror_4++; + mirror_1++; } - if (ass1.Product2.Category4__c == '濡囩鐢ㄧ‖鎬ч暅') { - mirror_5++; + if(ass1.Product2.ServiceCategory__c =='杞�ч暅'){ + mirror_2++; } if (ass1.Product2.Category3__c == '鍏夋簮') { - mirror_6++; - } - if (ass1.Product2.ServiceCategory__c =='杞�ч暅') { - mirror_7++; - } - if (asotMap.containsKey(ass1.hospital__c)) { - Account_Service_Of_Target__c asotOne = new Account_Service_Of_Target__c(); - asotOne = asotMap.get(ass1.hospital__c); - asotOne.Finish_Rigid_Mirror_2__c += mirror_4; - asotOne.Finish_Rigid_Mirror_3__c += mirror_5; - asotOne.Finish_Correlation_Lightsource__c += mirror_6; - asotOne.Finish_Rigid_Mirror_1__c += mirror_7; - update asotOne; + mirror_3++; + } + if (asotMap.containsKey(ass1.Hospital__c)) { + Account_Service_Of_Target__c asotOne = asotMap.get(ass1.Hospital__c); + system.debug('asotOne=='+ asotOne); + asotOne.Coverage_Target_Account__c = true; + asotOne.Target_Rigid_Mirror_2__c += mirror_1; + asotOne.Target_Soft_Mirror_2__c += mirror_2; + asotOne.Target_Correlation_Lightsource__c += mirror_3; + if (!asots.contains(asotOne)) { + asots.add(asotOne); + } }else{ Account_Service_Of_Target__c asot1 = new Account_Service_Of_Target__c(); - asot1.Account_HP__c = ass1.hospital__c; - asot1.Finish_Rigid_Mirror_2__c = mirror_4; - asot1.Finish_Rigid_Mirror_3__c = mirror_5; - asot1.Finish_Correlation_Lightsource__c = mirror_6; - asot1.Finish_Rigid_Mirror_1__c = mirror_7; - asot1.OCSM_Period__c = OCSM_Period; - asot1.OCSM_Period_half__c = OCSM_Period_half; + asot1.Account_HP__c = ass1.Hospital__c; + asot1.Coverage_Target_Account__c = true; + asot1.Target_Rigid_Mirror_2__c = mirror_1; + asot1.Target_Soft_Mirror_2__c = mirror_2; + asot1.Target_Correlation_Lightsource__c = mirror_3; + asot1.OCSM_Period__c = OCSM_Period; + asot1.OCSM_Period_half__c = OCSM_Period_half; asotMap.put(ass1.hospital__c,asot1); - insert asot1; + if (!asots.contains(asot1)) { + asots.add(asot1); + } } } - system.debug('杩欎釜闆嗗悎锛欰ssetsReal ==='+AssetsReal); - if (AssetsReal!=null) { - try { - update AssetsReal; - } - catch (Exception e) { - iflog.ErrorLog__c += 'ERROR'+'['+'update AssetsReal:'+']'+e.getMessage()+'\n'; - } - } + UpSert asots; + if (AssetsTarget!=null) { + try { + system.debug('鎵цupdate'); + Oly_TriggerHandler.bypass('AssetTrigger'); + update AssetsTarget; + } + catch (Exception e) { + iflog.ErrorLog__c += 'ERROR'+'['+'update AssetsTarget:'+']'+e.getMessage()+'\n'; + } + } + } global void finish(Database.BatchableContext BC) { diff --git a/force-app/main/default/classes/EquipmentSetShippmentReceived3Controller.cls b/force-app/main/default/classes/EquipmentSetShippmentReceived3Controller.cls index a5975f0..d0c0cea 100644 --- a/force-app/main/default/classes/EquipmentSetShippmentReceived3Controller.cls +++ b/force-app/main/default/classes/EquipmentSetShippmentReceived3Controller.cls @@ -441,7 +441,7 @@ } // 20220315 ljh obpm澶囧搧鍐宠鐘舵�佺浉鍏充慨鏀� add start if(String.isNotBlank(message6)){ - message += '鍗曞彿No.'+ message7.removeEnd('銆�')+ '宸茬敵璇峰喅瑁佷絾鍐宠缂栫爜鐘舵�佷笉绗﹀悎闇�姹�'; + message += '鍗曞彿No.'+ message7.removeEnd('銆�')+ '宸茬敵璇峰喅瑁佷絾鍐宠鐘舵�佷笉绗﹀悎鏉′欢'; } // 20220315 ljh obpm澶囧搧鍐宠鐘舵�佺浉鍏充慨鏀� add end ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error,message)); diff --git a/force-app/main/default/classes/NFM105Rest.cls b/force-app/main/default/classes/NFM105Rest.cls index 56bbb61..80e7a37 100644 --- a/force-app/main/default/classes/NFM105Rest.cls +++ b/force-app/main/default/classes/NFM105Rest.cls @@ -162,7 +162,6 @@ , Repair_Quotation_Id__c, NFM105_MessageGroupNumber__c, Repair_List_Price_formula__c , ReturnType__c, InspectType__c , Maintenance_Contract__r.URF_Contract__c - , Maintenance_Contract_Asset_Estimate__r.URF_Series__c // 20220321 ljh 闄愭鍚堝悓寮傚父鏁版嵁 ,Maintenance_Contract__c ,SerialNumber__c ,Agreed_Date__c @@ -724,43 +723,82 @@ }*/ //add by rentx 2021-3-4 end if (rprList.size() > 0) { + //contractAssetUrfMap<缁翠慨鍚堝悓+淇濇湁璁惧,闄愭绯诲垪> + Map<String,String> contractAssetUrfMap = new Map<String,String>(); + //闄愭鍚堝悓Id闆嗗悎 + List<Id> contractIds = new List<Id>(); + //闄愭鍚堝悓涓嬬殑淇悊闆嗗悎 + List<Repair__c> reList = new List<Repair__c>(); // 闄愭鍚堝悓 map Map<String,Map<String,List<Repair__c>>> contractMap = new Map<String,Map<String,List<Repair__c>>>(); //缁翠慨鍚堝悓淇濇湁璁惧闆嗗悎 List<Maintenance_Contract_Asset__c> maassList = new List<Maintenance_Contract_Asset__c>(); + // 闇�瑕佹洿鏂扮殑 缁翠慨鍚堝悓鎶ヤ环/淇濇湁璁惧 + List<Maintenance_Contract_Asset_Estimate__c> updateList = new List<Maintenance_Contract_Asset_Estimate__c>(); //鏌ヨ褰撳墠淇悊瀵瑰簲鐨勭淮淇悎鍚屾槸鍚︿负闄愭鍚堝悓 && 澶т慨 for (Repair__c rep : rprList) { - if (rep.Maintenance_Contract__c != null && rep.Maintenance_Contract__r.URF_Contract__c == true && (rep.Repair_Rank__c == 'A' || rep.Repair_Rank__c == 'B' || rep.Repair_Rank__c == 'C') && rep.Agreed_Date__c != null) { - List<Repair__c> tempRepL; - Map<String,List<Repair__c>> tempRepM; - if(contractMap.containsKey(rep.Maintenance_Contract__c)){ - // 淇濇湁璁惧 鍜� 闄愭绯诲垪 - tempRepM = contractMap.get(rep.Maintenance_Contract__c); - if(tempRepM.containsKey(rep.Delivered_Product__c)){ - tempRepM.get(rep.Delivered_Product__c).add(rep); - } - if(tempRepM.containsKey(rep.Maintenance_Contract_Asset_Estimate__r.URF_Series__c)){ - tempRepM.get(rep.Maintenance_Contract_Asset_Estimate__r.URF_Series__c).add(rep); - } - }else{ - tempRepM = new Map<String,List<Repair__c>>(); - tempRepL.add(rep); - tempRepM.put(rep.Delivered_Product__c,tempRepL); - tempRepM.put(rep.Maintenance_Contract_Asset_Estimate__r.URF_Series__c,tempRepL); - } - contractMap.put(rep.Maintenance_Contract__c,tempRepM); + if (rep.Maintenance_Contract__c != null && rep.Maintenance_Contract__r.URF_Contract__c == true && (rep.Repair_Rank__c == 'A' || rep.Repair_Rank__c == 'B' || rep.Repair_Rank__c == 'C') && rep.Agreed_Date__c != null) { + contractIds.add(rep.Maintenance_Contract__c); } } - if (contractMap.size() > 0) { - //鏌ヨ褰撳墠闄愭鍚堝悓涓嬬殑鎵�鏈夌淮淇悎鍚屼繚鏈夎澶� - maassList = [SELECT id , Series_RepairCount_F__c + //鏌ヨ褰撳墠闄愭鍚堝悓涓嬬殑鎵�鏈夌淮淇悎鍚屼繚鏈夎澶� + maassList = [SELECT id , Series_RepairCount_F__c , Maintenance_Contract_Asset_Estimate__c , Asset__c , Maintenance_Contract__c , URF_Series_F__c FROM Maintenance_Contract_Asset__c - WHERE Maintenance_Contract__c in :contractMap.keySet()]; - List<Maintenance_Contract_Asset_Estimate__c> updateList = new List<Maintenance_Contract_Asset_Estimate__c>(); + WHERE Maintenance_Contract__c in :contractIds]; + for (Maintenance_Contract_Asset__c maAss : maassList) { + // contractAssetUrfMap<缁翠慨鍚堝悓+淇濇湁璁惧,闄愭绯诲垪> + String keyV = maAss.Maintenance_Contract__c +';'+ maAss.Asset__c; + if (!contractAssetUrfMap.containsKey(keyV) && String.isNotBlank(maAss.URF_Series_F__c)) { + contractAssetUrfMap.put(keyV, maAss.URF_Series_F__c); + } + } + //鏌ヨ缁翠慨鍚堝悓涓嬬殑鎵�鏈変慨鐞� + reList = [select id,Maintenance_Contract__c,Delivered_Product__c,Usage_Ratio_Price_Service__c from Repair__c where (Repair_Rank__c = 'A' OR Repair_Rank__c = 'B' OR Repair_Rank__c = 'C') and Agreed_Date__c <> null and Maintenance_Contract__c in :contractIds ]; + system.debug('zheli:'+reList.size()); + for (Repair__c rep : reList) { + List<Repair__c> tempRepL00; + List<Repair__c> tempRepL01; + List<Repair__c> tempRepL02; + List<Repair__c> tempRepL03; + Map<String,List<Repair__c>> tempRepM; + String keyV = rep.Maintenance_Contract__c +';'+rep.Delivered_Product__c; + if(contractMap.containsKey(rep.Maintenance_Contract__c)){ + tempRepM = contractMap.get(rep.Maintenance_Contract__c); + // 淇濇湁璁惧 鍜� 闄愭绯诲垪 + if(tempRepM.containsKey(rep.Delivered_Product__c)){ + tempRepL02 = tempRepM.get(rep.Delivered_Product__c); + }else{ + tempRepL02 = new List<Repair__c>(); + } + tempRepL02.add(rep); + tempRepM.put(rep.Delivered_Product__c,tempRepL02); + if(contractAssetUrfMap.containsKey(keyV)){ + if(tempRepM.containsKey(contractAssetUrfMap.get(keyV))){ + tempRepL03 = tempRepM.get(contractAssetUrfMap.get(keyV)); + }else{ + tempRepL03 = new List<Repair__c>(); + } + tempRepL03.add(rep); + tempRepM.put(contractAssetUrfMap.get(keyV),tempRepL03); + } + }else{ + tempRepM = new Map<String,List<Repair__c>>(); + tempRepL00 = new List<Repair__c>(); + tempRepL00.add(rep); + tempRepL01 = new List<Repair__c>(); + tempRepL01.add(rep); + tempRepM.put(rep.Delivered_Product__c,tempRepL00); + if(contractAssetUrfMap.containsKey(keyV)){ + tempRepM.put(contractAssetUrfMap.get(keyV),tempRepL01); + } + } + contractMap.put(rep.Maintenance_Contract__c,tempRepM); + } + if (contractMap.size() > 0) { for (Maintenance_Contract_Asset__c maAss : maassList) { // 鍒ゆ柇宸茬淮淇鏁版槸鍚﹀彂鐢熸敼鍙� if (contractMap.get(maAss.Maintenance_Contract__c) != null @@ -789,7 +827,7 @@ } } if (updateList.size() > 0) { - system.debug('zheli:'+updateList); + // system.debug('zheli:'+updateList); update updateList; } } diff --git a/force-app/main/default/classes/NFM203Rest.cls b/force-app/main/default/classes/NFM203Rest.cls index 098d9af..bbb2c9b 100644 --- a/force-app/main/default/classes/NFM203Rest.cls +++ b/force-app/main/default/classes/NFM203Rest.cls @@ -1151,9 +1151,9 @@ for (Consignee_Info consigneeInfo : gda.Consignee_Info) { // 鑱旂郴浜哄悕绉� - if (String.isBlank(consigneeInfo.ContactName)) { - continue; - } + // if (String.isBlank(consigneeInfo.ContactName)) { + // continue; + // } // 鑱旂郴浜哄湴鍧� if (String.isBlank(consigneeInfo.ContactAddress)) { continue; diff --git a/force-app/main/default/classes/NFM624Rest.cls b/force-app/main/default/classes/NFM624Rest.cls index e1cb52f..c935195 100644 --- a/force-app/main/default/classes/NFM624Rest.cls +++ b/force-app/main/default/classes/NFM624Rest.cls @@ -221,7 +221,7 @@ Account.PlatformCode__c, Account.Management_Code__c, Account.parent.Department_Class_Label__c, - Name, + Name,LastName_Encrypted__c, Account.Parent_Management_Code__c, Account.Parent_PlatformCode__c, CManageCode__c, @@ -238,22 +238,21 @@ if (string.isnotblank(ct.Account.parent.Name)) { Map < String, Contact > snameMap = new Map < String, Contact > (); string Name = ct.Name.replaceAll(' ',''); - string namekey = ct.Account.Name + ' ' + Name; + string namekey = ct.Account.Name + ' ' + ct.LastName_Encrypted__c; // snameMap.put(namekey,ct); if (nameMap.containsKey(ct.Account.parent.Name)) { snameMap = nameMap.get(ct.Account.parent.Name); } snameMap.put(namekey, ct); - snameMap.put(ct.Name, ct); + snameMap.put(ct.LastName_Encrypted__c, ct); nameMap.put(ct.Account.parent.Name, snameMap); } peopleMap.put(ct.CManageCode__c, ct); - System.debug('peopleMap'+peopleMap); // peopleMap.put(ct.Name, ct); //string temp = ct.Name + ct.Account.parent.Department_Class_Label__c; // peopleMap.put(temp, ct); } - + System.debug('peopleMap'+peopleMap); //鏌ヨ鍖婚櫌绉戝 //List<Account> AccountList = [select Id,PlatformCode__c,PlatformCode__c,Department_Class_Label__c,Name,Management_Code__c,Is_Active__c,AgentCode_Ext__c,ParentId,Parent.ParentId from Account where PlatformCode__c IN :HpCodeList OR parent.PlatformCode__c IN :HpCodeList OR PlatformCode__c IN :HpCodeList OR Management_Code__c IN :RelatedHospitalList OR Parent_Management_Code__c IN :RelatedHospitalList]; //List < Account > AccountList = [select Id, PlatformCode__c, Department_Class_Label__c, Name, Management_Code__c, Is_Active__c, AgentCode_Ext__c, ParentId, Parent.ParentId from Account where Management_Code__c IN :AccountCodeList OR Parent_Management_Code__c IN :AccountCodeList OR PlatformCode__c IN :AccountCodeList OR Parent.Parent.PlatformCode__c IN :AccountCodeList]; @@ -379,7 +378,8 @@ } else { //浜哄憳绠$悊缂栫爜涓嶅瓨鍦� //鎼滅储浜哄悕/涓斿湪褰撳墠鎴樼暐绉戝绉戝涓� System.debug('浜哄憳绠$悊缂栫爜涓嶅瓨鍦�'); - string namekey = gedata.Name; + string namekey = gedata.NameEncrypted; + system.debug('namekey----->'+namekey); system.debug('DepartmentClasskey = '+DepartmentClasskey); system.debug('nameMap22222222 '+nameMap); if (nameMap.containskey(DepartmentClasskey)) { // 6 瀹屾垚 鏇存柊鎿嶄綔 @@ -487,9 +487,10 @@ } else { //浜哄憳绠$悊缂栫爜涓嶅瓨鍦� //鎼滅储浜哄悕/涓斿湪褰撳墠鎴樼暐绉戝绉戝涓� System.debug('浜哄憳绠$悊缂栫爜涓嶅瓨鍦�'); - string namekey = gedata.Name; + string namekey = gedata.NameEncrypted; system.debug('DepartmentClasskey = '+DepartmentClasskey); system.debug('nameMap22222222 '+nameMap); + system.debug('nameMap.containskey(DepartmentClasskey)'+nameMap.containskey(DepartmentClasskey)); if (nameMap.containskey(DepartmentClasskey)) { // 16 瀹屾垚 鏇存柊鎿嶄綔 Map < String, Contact > sMap = nameMap.get(DepartmentClasskey); if (sMap.containsKey(namekey)) { @@ -509,8 +510,6 @@ dpt.Name = gedata.DepartmentName; dpt.RecordTypeId = RecordTypeMap.get(gedata.DepartmentClass); //鍥犱负娌℃湁鍖婚櫌绠$悊缂栫爜锛屾棤娉曟绱㈠埌鎴樼暐绉戝锛屾墍浠ュ湪缁欑瀹ょ殑鎴樼暐绉戝瀛楁璧嬪�兼椂绌烘寚閽� - //dpt.Department_Class__c = DepartmentClassMap.get(gedata.DepartmentClass).Id; - //dpt.ParentId = DepartmentClassMap.get(gedata.DepartmentClass).Id; dpt.Department_Class__c = DepartmentClassMap.get(gedata.DepartmentClass).Id; dpt.ParentId = DepartmentClassMap.get(gedata.DepartmentClass).Id; if (string.isnotblank(personCode)) { //浜哄憳绠$悊缂栫爜瀛樺湪 diff --git a/force-app/main/default/classes/RentalFixtureSetAssignAgencyController.cls b/force-app/main/default/classes/RentalFixtureSetAssignAgencyController.cls index 47923d3..76d8b19 100644 --- a/force-app/main/default/classes/RentalFixtureSetAssignAgencyController.cls +++ b/force-app/main/default/classes/RentalFixtureSetAssignAgencyController.cls @@ -494,7 +494,7 @@ //20220225 sx end obpm 鍔炰簨澶勫鍔犲垽鏂細鏄惁鐢宠鍐宠鍕剧潃娌℃湁鍐宠缂栧彿涓嶈兘杩涜鎿嶄綔 //20220315 sx obpm澶囧搧鍐宠鐘舵�佺浉鍏充慨鏀� add start else if(RaTar.Campaign__c != null && RaTar.Campaign__r.IF_Approved__c && RaTar.Campaign__r.Meeting_Approved_No__c != null && statusList.contains(RaTar.Campaign__r.Approved_Status__c)){ - ApexPages.addMessage(new ApexPages.message(ApexPages.severity.Error, '宸茬敵璇峰喅瑁佷絾鍐宠缂栫爜鐘舵�佷笉绗﹀悎闇�姹�')); + ApexPages.addMessage(new ApexPages.message(ApexPages.severity.Error, '宸茬敵璇峰喅瑁佷絾鍐宠鐘舵�佷笉绗﹀悎鏉′欢')); return false; } //20220315 sx obpm澶囧搧鍐宠鐘舵�佺浉鍏充慨鏀� add end diff --git a/force-app/main/default/classes/WeeklyReportCmp.cls b/force-app/main/default/classes/WeeklyReportCmp.cls index 5197381..b7787c5 100644 --- a/force-app/main/default/classes/WeeklyReportCmp.cls +++ b/force-app/main/default/classes/WeeklyReportCmp.cls @@ -258,7 +258,10 @@ @AuraEnabled public static List<Agency_Hospital_Link__c> getHospitalList(String hospital_name) { hospital_name = '%' + hospital_name.trim() + '%'; - return [select Hospital_Name_readonly__c, Id, Hospital__c from Agency_Hospital_Link__c where Hospital_Name_readonly__c like :hospital_name and Agency_Campaign_Obj__c = true]; + system.debug('hospital_name+++'+hospital_name); + List<Agency_Hospital_Link__c> ahllist = [select Hospital_Name_readonly__c, Id, Hospital__c from Agency_Hospital_Link__c where Hospital_Name_readonly__c like :hospital_name and Agency_Campaign_Obj__c = true]; + system.debug('Agency_Campaign_Obj__c+++'+ahllist); + return ahllist; } @RemoteAction @@ -417,6 +420,7 @@ if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; } if (Purpose_Type != '') { agency_report.Purpose_Type__c = Purpose_Type; } //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start + system.debug('SupportNeedsc+++==++==='+SupportNeedsc); if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end if (Agency_Report_Header != '') { agency_report.Agency_Report_Header__c = Agency_Report_Header; } @@ -548,6 +552,7 @@ // 閫卞牨銉囥兗銈裤倰鍙栧緱 Date week = Date.valueOf(date_str); this.reports = LightningUtil.selectAgencyReport(week, person_str); + System.debug('this.reports+++'+this.reports); } @RemoteAction diff --git a/force-app/main/default/pages/BatchSelectRepairPage.page b/force-app/main/default/pages/BatchSelectRepairPage.page index a5291dd..5cf2d1a 100644 --- a/force-app/main/default/pages/BatchSelectRepairPage.page +++ b/force-app/main/default/pages/BatchSelectRepairPage.page @@ -55,13 +55,13 @@ //鍏ㄩ�夊姛鑳� function checkAll() { var cnt = j$(escapeVfId('raCnt')).val(); - if (j$(escapeVfId('Page:Form:Block:j_id53:checkAll')).attr('checked') == 'checked') { + if (j$(escapeVfId('Page:allForm:allBlock:j_id56:checkAll')).attr('checked') == 'checked') { for (var i = 0; i < cnt; i++) { - j$(escapeVfId('Page:Form:Block:j_id53:records:' + i + ':checklist')).attr('checked',true); + j$(escapeVfId('Page:allForm:allBlock:j_id56:records:' + i + ':checklist')).attr('checked',true); } } else { for (var i = 0; i < cnt; i++) { - j$(escapeVfId('Page:Form:Block:j_id53:records:' + i + ':checklist')).attr('checked',false); + j$(escapeVfId('Page:allForm:allBlock:j_id56:records:' + i + ':checklist')).attr('checked',false); } } } @@ -99,26 +99,25 @@ <apex:pageBlock title="妫�绱㈠垪" id="Editable"> <table> <tr><td style="text-align: left;padding-right: 100px;"> </td></tr> - <apex:repeat value="{!RevalInfoList}" var="reval" id="RevalInfoList"> <tr> <!-- <td style="text-align: left;padding-right: 100px;"> </td> --> <td style="text-align: right; width:200px;"> <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="鐘舵��2"/> </td> <td style="text-align: left;"> - <apex:inputText id="Status2" value="{!reval.Status2}"/> + <apex:inputText id="Status2" value="{!RevalInfo.Status2}"/> </td> <td style="text-align: right; width:200px;"> <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="RS淇悊鍗曞彿"/> </td> <td style="text-align: left;"> - <apex:inputText id="RepairName" value="{!reval.RepairName}"/> + <apex:inputText id="RepairName" value="{!RevalInfo.RepairName}"/> </td> <td style="text-align: right; width:150px;"> <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="SAP淇悊鍗曞彿"/> </td> <td style="text-align: left;padding-right: 100px;"> - <apex:inputText id="SAPRepairNo" value="{!reval.SAPRepairNo}"/> + <apex:inputText id="SAPRepairNo" value="{!RevalInfo.SAPRepairNo}"/> </td> </tr> <tr><td style="text-align: left;padding-right: 100px;"> </td></tr> @@ -128,22 +127,21 @@ <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="鏈鸿韩缂栫爜"/> </td> <td style="text-align: left;"> - <apex:inputText id="SerialNumber" value="{!reval.SerialNumber}"/> + <apex:inputText id="SerialNumber" value="{!RevalInfo.SerialNumber}"/> </td> <td style="text-align: right; width:200px;"> <apex:outputLabel style="font-weight: bold; " value="淇悊濮旀墭鑰�"/> </td> <td style="text-align: left;"> - <apex:inputField id="InchargeStaffName" value="{!reval.repair.Incharge_Staff__c}"/> + <apex:inputField id="InchargeStaffName" value="{!RevalInfo.repair.Incharge_Staff__c}"/> </td> <td style="text-align: right; width:150px;"> <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="FSE鐢宠鏃�"/> </td> <td style="text-align: left;padding-right: 80px;"> - <apex:inputField id="FSE_ApplyForRepair_Day" value="{!reval.repair.Final_complete_day__c}"/> + <apex:inputField id="FSE_ApplyForRepair_Day" value="{!RevalInfo.repair.Final_complete_day__c}"/> </td> </tr> - </apex:repeat> <tr><td style="text-align: left;padding-right: 100px;"> </td></tr> <tr> <td style="text-align: center;" colspan="6"> @@ -163,14 +161,14 @@ <th style="text-align:left; width:6%">鐘舵��1</th> <th style="text-align:left; width:6%">鐘舵��2</th> <th style="text-align:left; width:7%">RS淇悊鍗曞彿</th> - <th style="text-align:left; width:10%">SAP淇悊鍗曞彿</th> + <th style="text-align:left; width:8%">SAP淇悊鍗曞彿</th> <th style="text-align:left; width:10%">鍨嬪彿</th> <th style="text-align:left; width:5%">鏈鸿韩缂栧彿</th> - <th style="text-align:left; width:8%">鍖婚櫌鍚嶇О</th> + <th style="text-align:left; width:9%">鍖婚櫌鍚嶇О</th> <th style="text-align:left; width:5%">鐪佷唤</th> <th style="text-align:left; width:5%">淇悊濮旀墭鑰�</th> <th style="text-align:left; width:8%">FSE鐢宠鏃ユ湡</th> - <th style="text-align:left; width:5%">缁翠慨涓績</th> + <th style="text-align:left; width:6%">缁翠慨涓績</th> <th style="text-align:left; width:5%">鏈嶅姟鏂瑰紡</th> <th style="text-align:left; width:8%">鏈夋棤缁翠慨鍚堝悓瀵硅薄</th> <th style="text-align:left; width:8%">鏃犲伩鍖哄埆鏍囧織</th> @@ -191,16 +189,16 @@ <td align="left" width="7%"> <apex:outputField id="OTCode" value="{!ra.repair.Name}"/> </td> - <td align="left" width="10%"> + <td align="left" width="8%"> <apex:outputField id="SAP_Service_Repair_No" value="{!ra.repair.SAP_Service_Repair_No__c}"/> </td> <td align="left" width="10%"> <apex:outputField id="Delivered_Product" value="{!ra.repair.Delivered_Product__c}"/> </td> - <td align="left" width="5%"> + <td align="left" width="5%" style="word-wrap:break-word;word-break:break-all;"> <apex:outputField id="SerialNumber" value="{!ra.repair.SerialNumber__c}"/> </td> - <td align="left" width="8%"> + <td align="left" width="9%"> <apex:outputField id="HP_Name" value="{!ra.repair.HP_Name__c}"/> </td> <td align="left" width="5%"> @@ -212,7 +210,7 @@ <td align="left" width="8%"> <apex:outputField id="FSE_ApplyForRepair_Day" value="{!ra.repair.FSE_ApplyForRepair_Day__c}"/> </td> - <td align="left" width="5%"> + <td align="left" width="6%"> <apex:outputField id="work_location_select" value="{!ra.repair.work_location_select__c}"/> </td> <td align="left" width="5%"> -- Gitblit v1.9.1