/** * 2021-05-19 mzy * 页面提醒当前用户招标信息 */ public with sharing class TenderManageController { public TenderManageController() { } //获取当前用户招投标项目信息 public static TenderInformation getCurrentTenderInformation(){ //1.根据当前用户信息进行查找 List AllTender = goSelectByCurrentUser(); //2.分组 // 1) 待确认的招投标项目 List MyTBCTender = new List(); // 2) 待关联询价的招投标项目 List MyTBRTender = new List(); // 3) 待应标的招投标项目 List MyTBBTender = new List(); // 4) 分组 if(AllTender.size()>0){ for(Tender_information__c tempT : AllTender){ //待确认 if( tempT.ViewWaitConfirm__c && '01.待确认'.equals(tempT.status__c)){ MyTBCTender.add(tempT); } //DB202306372336 you 20230714 start //待关联询价 //if(tempT.ViewRelatedOpp__c && '04.待关联询价'.equals(tempT.status__c)){ // MyTBRTender.add(tempT); //} if(tempT.ViewRelatedOpp__c) { MyTBRTender.add(tempT); } //DB202306372336 you 20230714 end //待应标 zys 20210709 应标确认 变为 待应标确认 //20210716 mzy 添加 ViewBidConfirm__c 判断 排除2s6-2s9的助理的提醒 if(tempT.ViewBidConfirm__c&&'03.是否应标'.equals(tempT.status__c)&&tempT.NotBidApprovalStatus__c != '申请中'){ MyTBBTender.add(tempT); } } } //3.封装 // zq 20231029 千里马任务修改 start // TenderInformation MyTenderInformation= new TenderInformation(MyTBCTender,MyTBRTender,MyTBBTender); TenderInformation MyTenderInformation= new TenderInformation(MyTBCTender,MyTBRTender,MyTBBTender,new List(),new List()); // zq 千里马任务修改 end return MyTenderInformation; } //kk 20231207 DB202309519775 start public static TenderTansforSubmmit getCurrentTenderTransfInformation(){ List AllTenderTransf = goSelectTransfByCurrentUser(); List MyTDPTenderTransf = new List(); if(AllTenderTransf.size()>0){ for( TenderTansforSubmmit__c tts : AllTenderTransf){ MyTDPTenderTransf.add(tts); } } TenderTansforSubmmit MyTenderTransfInformation= new TenderTansforSubmmit(MyTDPTenderTransf); return MyTenderTransfInformation; } //kk 20231207 DB202309519775 end //lwt 20231212 DB202311717846 start public static Integer goModifyOwnerAgreementInfomation(){ return goModifyOwnerAgreementByCurrentUser(); } //lwt 20231212 DB202311717846 end //获取当前用户招投标项目信息 2023-10-16 千里马六大区显示 zq start public static TenderInformation getOBSATenderInformation(){ //1.根据当前用户信息进行查找 List AllMyOBSATender = goSelectByOBSA(); //2.分组 // 1) OBSA待确认的招投标项目 List MyOBSATBCTender = new List(); // 1) 千里马六大区 OBSA待确认的招投标项目 List MyOBSASixAreasTender = new List(); // 4) 分组 if(AllMyOBSATender.size()>0){ Integer MyOBSAFirstAreaNumber = 0; Integer MyOBSASecondAreaNumber = 0; Integer MyOBSAThirdAreaNumber = 0; Integer MyOBSAFourthAreaNumber = 0; Integer MyOBSAFifthAreaNumber = 0; Integer MyOBSASixthAreaNumber = 0; for(Tender_information__c tempT : AllMyOBSATender){ //待确认 if( tempT.ViewWaitConfirm__c && '01.待确认'.equals(tempT.status__c)){ MyOBSATBCTender.add(tempT); } if('1.华北'.equals(tempT.Salesdepartment_SAP__c)){ MyOBSAFirstAreaNumber = MyOBSAFirstAreaNumber + 1; } if('2.东北'.equals(tempT.Salesdepartment_SAP__c)){ MyOBSASecondAreaNumber = MyOBSASecondAreaNumber + 1; } if('3.西北'.equals(tempT.Salesdepartment_SAP__c)){ MyOBSAThirdAreaNumber = MyOBSAThirdAreaNumber + 1; } if('4.西南'.equals(tempT.Salesdepartment_SAP__c)){ MyOBSAFourthAreaNumber = MyOBSAFourthAreaNumber + 1; } if('5.华东'.equals(tempT.Salesdepartment_SAP__c)){ MyOBSAFifthAreaNumber = MyOBSAFifthAreaNumber + 1; } if('6.华南'.equals(tempT.Salesdepartment_SAP__c)){ MyOBSASixthAreaNumber = MyOBSASixthAreaNumber + 1; } } // String OBSANum = MyOBSAFirstAreaNumber + ';' + MyOBSASecondAreaNumber +';'+ MyOBSAThirdAreaNumber +';'+ MyOBSAFourthAreaNumber +';'+MyOBSAFifthAreaNumber+';'+MyOBSASixthAreaNumber; MyOBSASixAreasTender.add(MyOBSAFirstAreaNumber); MyOBSASixAreasTender.add(MyOBSASecondAreaNumber); MyOBSASixAreasTender.add(MyOBSAThirdAreaNumber); MyOBSASixAreasTender.add(MyOBSAFourthAreaNumber); MyOBSASixAreasTender.add(MyOBSAFifthAreaNumber); MyOBSASixAreasTender.add(MyOBSASixthAreaNumber); // MyOBSASixAreasTender = [MyOBSAFirstAreaNumber,MyOBSASecondAreaNumber,MyOBSAThirdAreaNumber,MyOBSAFourthAreaNumber,MyOBSAFifthAreaNumber,MyOBSASixthAreaNumber]; } //3.封装 TenderInformation MyTenderInformation= new TenderInformation(new List(),new List(),new List(),MyOBSATBCTender,MyOBSASixAreasTender); return MyTenderInformation; } //2023-10-16 千里马六大区显示 zq end //根据当前用户查找招标项目 public static List goSelectByCurrentUser(){ //定义List封装查询结果 List AllTender = new List(); //查询 String query = 'SELECT id,ViewRelatedOppAlert__c,status__c,NotBidApprovalStatus__c,ViewWaitConfirm__c,ViewRelatedOpp__c,ViewBidConfirm__c '; query += 'FROM Tender_information__c '; //待确认 // 20221013 ljh SWAG-CK28WT update start // query += 'WHERE ( status__c = \'01.待确认\' AND ViewWaitConfirm__c = true ) '; // query += 'WHERE (( status__c = \'01.待确认\' AND ViewWaitConfirm__c = true ) '; //DB202306372336 you 20230714 start // 20231230 ssm 跳过众成补充数据,待确认数据通用改造,增加自定义标签补充soql start query += 'WHERE (( status__c = \'01.待确认\' AND ViewWaitConfirm__c = true '; String more_query = System.Label.HomePage_NormalTen1_More; query += String.isNotBlank(more_query) && more_query != '无' ? more_query : ''; query += ') '; // 20231230 ssm 跳过众成补充数据,待确认数据通用改造,增加自定义标签补充soql end //待关联询价 //query += 'OR ( status__c =\'04.待关联询价\' AND ViewRelatedOpp__c = true ) '; query += 'OR ( ViewRelatedOpp__c = true ) '; //DB202306372336 you 20230714 end //待应标 zys 20210709 应标确认 变为 待应标确认 // query += 'OR ( status__c = \'03.是否应标\' AND NotBidApprovalStatus__c != \'申请中\' ) '; query += 'OR ( status__c = \'03.是否应标\' AND NotBidApprovalStatus__c != \'申请中\' )) '; // 20221013 ljh SWAG-CK28WT update end // 20221013 ljh SWAG-CK28WT add start String proId = UserInfo.getProfileId(); String p_2M4 = System.Label.ProfileId_2M4; if(proId.substring(0,15) == p_2M4.substring(0,15)){ query += ' AND OwnerId =\''+UserInfo.getUserId()+'\''; } System.debug('query:'+query); // 20221013 ljh SWAG-CK28WT add end AllTender = Database.query(query); return AllTender; } // kk 20231207 DB202309519775 start 根据当前用户查找待审批的招标转科室 //根据当前用户查找招标项目 public static List goSelectTransfByCurrentUser(){ //定义List封装查询结果 List AllTenderTransf = new List(); //查询 AllTenderTransf = [SELECT id FROM TenderTansforSubmmit__c WHERE status__c='审批中']; return AllTenderTransf; } // kk 20231207 DB202309519775 end // lwt 20231212 DB202311717846 start 根据当前用户查找待审批的招标转科室 //根据当前用户查找需要修改拥有者的契约 public static Integer goModifyOwnerAgreementByCurrentUser(){ String uId=Userinfo.getUserId(); List aL=[SELECT id from Account where Is_Active_Formula__c='有效' and Acc_Record_Type__c = '契約' and Business_Assistant__c!=null and Business_Assistant__c=:uId and OwnerId =:uId and (ENG_Dealer__c=true OR ET_SP_Dealer__c=true OR SP_DealerContact__c=true)]; return aL.size(); } // lwt 20231212 DB202311717846 end //根据OBSA查找招标项目 2023-10-16 千里马六大区显示 zq start public static List goSelectByOBSA(){ //定义List封装查询结果 List AllTender = new List(); //查询 String query = 'SELECT id,ViewRelatedOppAlert__c,status__c,NotBidApprovalStatus__c,ViewWaitConfirm__c,ViewRelatedOpp__c,ViewBidConfirm__c,Salesdepartment_SAP__c '; query += 'FROM Tender_information__c '; //待确认 // 20221013 ljh SWAG-CK28WT update start // query += 'WHERE ( status__c = \'01.待确认\' AND ViewWaitConfirm__c = true ) '; query += 'WHERE (( status__c = \'01.待确认\' AND ViewWaitConfirm__c = true )) '; // 20231230 ssm 跳过众成补充数据,待确认数据通用改造,增加自定义标签补充soql start String more_query = System.Label.HomePage_NormalTen1_More; query += String.isNotBlank(more_query) && more_query != '无' ? more_query : ''; // 20231230 ssm 跳过众成补充数据,待确认数据通用改造,增加自定义标签补充soql end // 20221013 ljh SWAG-CK28WT add start String proId = UserInfo.getProfileId(); String p_2M4 = System.Label.ProfileId_2M4; if(proId.substring(0,15) == p_2M4.substring(0,15)){ query += ' AND OwnerId =\''+UserInfo.getUserId()+'\''; } System.debug('query:'+query); // 20221013 ljh SWAG-CK28WT add end AllTender = Database.query(query); return AllTender; } // 2023-10-16 千里马六大区显示 zq end public class TenderInformation { //待确认的招投标项目 : GI / SP AND 01.待确认 public List MyTBCTender; //待关联询价的招投标项目 : GI / SP AND 04.确认应标 public List MyTBRTender; //待应标的招投标项目 : AccountOwner public List MyTBBTender; // 2023-10-16千里马六大区显示 zq start //待确认的OBSA全国招投标项目 : GI / SP AND 01.待确认 public List MyOBSATender; //待确认的OBSA 千里马六大区 public List MyOBSASixAreasTender; // 2023-10-16千里马六大区显示 zq end public TenderInformation(list MyTBCTender, list MyTBRTender, list MyTBBTender, list MyOBSATender,list MyOBSASixAreasTender) { this.MyTBCTender = MyTBCTender; this.MyTBRTender = MyTBRTender; this.MyTBBTender = MyTBBTender; // 2023-10-16千里马六大区显示 zq start this.MyOBSATender = MyOBSATender; this.MyOBSASixAreasTender = MyOBSASixAreasTender; // 2023-10-16千里马六大区显示 zq end } } // kk 20231207 DB202309519775 start public class TenderTansforSubmmit { //待审批的招标转科室申请 public List MyTDPTenderTransf; public TenderTansforSubmmit(list MyTDPTenderTransf) { this.MyTDPTenderTransf = MyTDPTenderTransf; } } // kk 20231207 DB202309519775 end }