Merge branch 'master' of http://47.92.229.245:8089/r/OlyMEBG
| | |
| | | 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)); |
| | |
| | | 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 |
| | |
| | | } 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'); |
| | |
| | | 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')) { |
| | |
| | | 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, |
| | |
| | | /* 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, |
| | |
| | | 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) { |
| | |
| | | }, |
| | | |
| | | 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; |
| | |
| | | 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; } |
| | |
| | | } |
| | | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | | } |
| | |
| | | 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{ |
| | |
| | | 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(); |
| | |
| | | @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'; |
| | |
| | | }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]; |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | 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('这个集合:AssetsReal ==='+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) { |
| | |
| | | @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'; |
| | |
| | | }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]; |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | 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('这个集合:AssetsReal ==='+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) { |
| | |
| | | } |
| | | // 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)); |
| | |
| | | , 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 |
| | |
| | | }*/ |
| | | //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 |
| | |
| | | } |
| | | } |
| | | if (updateList.size() > 0) { |
| | | system.debug('zheli:'+updateList); |
| | | // system.debug('zheli:'+updateList); |
| | | update updateList; |
| | | } |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | 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, |
| | |
| | | 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]; |
| | |
| | | } 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 完成 更新操作 |
| | |
| | | } 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)) { |
| | |
| | | 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)) { //人员管理编码存在 |
| | |
| | | //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 |
| | |
| | | @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 |
| | |
| | | if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; } |
| | | if (Purpose_Type != '') { agency_report.Purpose_Type__c = Purpose_Type; } |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | system.debug('SupportNeedsc+++==++==='+SupportNeedsc); |
| | | if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | if (Agency_Report_Header != '') { agency_report.Agency_Report_Header__c = Agency_Report_Header; } |
| | |
| | | // 週報データを取得 |
| | | Date week = Date.valueOf(date_str); |
| | | this.reports = LightningUtil.selectAgencyReport(week, person_str); |
| | | System.debug('this.reports+++'+this.reports); |
| | | } |
| | | |
| | | @RemoteAction |
| | |
| | | //全选功能 |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | <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> |
| | |
| | | <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"> |
| | |
| | | <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> |
| | |
| | | <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%"> |
| | |
| | | <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%"> |