| | |
| | | public static Integer pagesize { get; set; } |
| | | public static Integer pageToken { get; set; } |
| | | public static String sortField { get; set; } |
| | | public static String sortOrder{ get; set; } |
| | | public static String sortOrder { get; set; } |
| | | |
| | | |
| | | public static Integer totalcount { get; set; } |
| | | // public static Integer pagecount { get; set; } |
| | | // public static Integer currentpage { get; set; } |
| | |
| | | // }; |
| | | |
| | | public static String[] proLimitAndDate = new List<String>{}; |
| | | private static Map<String, Date> productkucun = new Map<String, Date>(); |
| | | public static Map<String, Date> productkucun = new Map<String, Date>(); |
| | | public static List<SelectOption> categoryOptionList { get; set; } |
| | | @AuraEnabled |
| | | public static Map<String, String> categoryOptionMap { get; set; } |
| | |
| | | public static String category1 { get; set; } |
| | | public static Boolean editAble { get; set; } |
| | | // 经销商在库产品ID |
| | | public static List<String> orderDetZaikuList = new List<String>(); |
| | | public static List<String> orderDetZaikuList { get; set; } |
| | | // 产品 ID |
| | | public static String ESetId { get; set; } |
| | | public static String idCheck { get; set; } |
| | |
| | | // add by rentx 2021-3-10 |
| | | |
| | | public LexInventoryViewController() { |
| | | orderDetZaikuList = new List<String>(); |
| | | consumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>(); |
| | | consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>(); |
| | | editAble = false; |
| | |
| | | // pagesize = Integer.valueof(system.label.orderdetLimitsize); |
| | | // currentpage = 0; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static ResponseBodyLWC init2(Integer pageSizeLWC,Integer pageTokenLWC,String sortFieldLWC,String sortOrderLWC) { |
| | | return new ResponseBodyLWC('Error', 500, '测试 init2', ''); |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static ResponseBodyLWC init(Integer pageSizeLWC, Integer pageTokenLWC, String sortFieldLWC, String sortOrderLWC) { |
| | | pageSize =pageSizeLWC; |
| | | pageSize = pageSizeLWC; |
| | | pageToken = pageTokenLWC; |
| | | sortField = sortFieldLWC; |
| | | sortOrder = sortOrderLWC; |
| | | |
| | | |
| | | |
| | | |
| | | ResponseBodyLWC res = new ResponseBodyLWC(); |
| | | Map<String, object> data = new Map<String, object>(); |
| | |
| | | categoryOptionMap = new Map<String, String>(); |
| | | category4OptionMap = new Map<String, String>(); |
| | | category5OptionMap = new Map<String, String>(); |
| | | |
| | | // sortKey = '2'; |
| | | // preSortKey = '2'; |
| | | // sortOrderAsc = false; |
| | | // sortOrder = new List<String>(8); |
| | | // sortOrder = new List<String>{ ' ', '', ' ', ' ', '', '', '', '↓' }; |
| | | |
| | | // 取用户ID |
| | | String userId = UserInfo.getUserId(); |
| | |
| | | } |
| | | if (newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) { |
| | | ConsumableorderdetailsInfo Jstage = newMidPieceMap.get( |
| | | CountDel[i].Consumable_Product__c + |
| | | CountDel[i].Box_Piece__c + |
| | | tex |
| | | CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex |
| | | ) |
| | | .clone(); |
| | | Jstage.allnumber = Jstage.allnumber + 1; |
| | |
| | | PaginatedAccounts paginatedAccounts = new PaginatedAccounts(); |
| | | paginatedAccounts.nextPageToken = (pageToken + pageSize < totalCount) ? pageToken + pageSize : null; |
| | | paginatedAccounts.recordStart = pageToken + 1; |
| | | paginatedAccounts.pageNumber = pageToken/pageSize + 1; |
| | | paginatedAccounts.pageNumber = pageToken / pageSize + 1; |
| | | Integer recordEnd = pageSize * paginatedAccounts.pageNumber; |
| | | paginatedAccounts.recordEnd = totalCount >= recordEnd ? recordEnd : totalCount; |
| | | paginatedAccounts.totalRecords = totalCount; |
| | | |
| | | |
| | | |
| | | data.put('paginatedAccounts', paginatedAccounts); |
| | | |
| | |
| | | data.put('userWorkLocation', userWorkLocation); |
| | | data.put('agencyProType', agencyProType); |
| | | data.put('pageRecords', pageRecords); |
| | | data.put('consumableorderdetailsRecords', consumableorderdetailsRecords); |
| | | data.put('hasHos', hasHos); |
| | | data.put('productLimtAndDate', proLimitAndDate); |
| | | data.put('productkucun', productkucun); |
| | | res.status = 'Success'; |
| | | res.code = 200; |
| | | System.debug('res = ' + res); |
| | | System.debug('productkucun = ' + productkucun); |
| | | return res; |
| | | } |
| | | |
| | | public static void categoryAllload() { |
| | | @AuraEnabled |
| | | public static ResponseBodyLWC categoryAllload(String category3LWC, String agencyProTypeLWC) { |
| | | ResponseBodyLWC res = new ResponseBodyLWC(); |
| | | // Map<String, object> data = new Map<String, object>(); |
| | | // dataselect = new List<SelectOption>(); |
| | | // res.entity = dataselect; |
| | | Map<String, object> data = new Map<String, object>(); |
| | | res.entity = data; |
| | | category3 = category3LWC; |
| | | agencyProType = '%' + agencyProTypeLWC + '%'; |
| | | |
| | | System.debug('category3LWC===>' + category3LWC); |
| | | System.debug('agencyProType===>' + agencyProType); |
| | | |
| | | AggregateResult[] category4List = [ |
| | | SELECT Count(id), Category4_text__c c4c |
| | | FROM Product2__c |
| | |
| | | ]; |
| | | category4OptionList = new List<SelectOption>(); |
| | | category4OptionList.add(new SelectOption('', '-无-')); |
| | | category4OptionMap = new Map<String, String>(); |
| | | category4OptionMap.put('', '-无-'); |
| | | |
| | | for (AggregateResult category4Search : category4List) { |
| | | String deliverycnt4 = String.valueOf(category4Search.get('c4c')); |
| | | category4OptionList.add(new SelectOption(deliverycnt4, deliverycnt4)); |
| | | category4OptionMap.put(deliverycnt4, deliverycnt4); |
| | | } |
| | | |
| | | AggregateResult[] category5List = [ |
| | |
| | | |
| | | category5OptionList = new List<SelectOption>(); |
| | | category5OptionList.add(new SelectOption('', '-无-')); |
| | | category5OptionMap = new Map<String, String>(); |
| | | category5OptionMap.put('', '-无-'); |
| | | for (AggregateResult category5Search : category5List) { |
| | | String deliverycnt5 = String.valueOf(category5Search.get('c5c')); |
| | | category5OptionList.add(new SelectOption(deliverycnt5, deliverycnt5)); |
| | | category5OptionMap.put(deliverycnt5, deliverycnt5); |
| | | } |
| | | |
| | | // data.put('category4OptionList'+category4OptionList); |
| | | // data.put('category5OptionList'+category5OptionList); |
| | | // res.status = 'Success'; |
| | | // res.code = '200'; |
| | | // return res; |
| | | System.debug('类别4' + category4OptionList); |
| | | System.debug('类别5' + category5OptionList); |
| | | data.put('category4OptionMap', category4OptionMap); |
| | | data.put('category5OptionMap', category5OptionMap); |
| | | res.status = 'Success'; |
| | | res.code = 200; |
| | | System.debug('res = ' + res); |
| | | return res; |
| | | } |
| | | |
| | | public static void categoryload() { |
| | |
| | | String accountName, |
| | | string agencyProType, |
| | | string userWorkLocation, |
| | | Integer pageSizeLWC, Integer pageTokenLWC, String sortFieldLWC, String sortOrderLWC |
| | | Integer pageSizeLWC, |
| | | Integer pageTokenLWC, |
| | | String sortFieldLWC, |
| | | String sortOrderLWC, |
| | | Map<String, Date> productkucunLWC |
| | | ) { |
| | | try { |
| | | pageSize =pageSizeLWC; |
| | | pageToken = pageTokenLWC; |
| | | sortField = sortFieldLWC; |
| | | sortOrder = sortOrderLWC; |
| | | System.debug('orderDetZaikuListLWC===>' + orderDetZaikuListLWC); |
| | | System.debug('productkucun===>' + productkucun); |
| | | pageSize = pageSizeLWC; |
| | | pageToken = pageTokenLWC; |
| | | sortField = sortFieldLWC; |
| | | sortOrder = sortOrderLWC; |
| | | productkucun = new Map<String, Date>(); |
| | | orderDetZaikuList = new List<String>(); |
| | | productkucun = productkucunLWC; |
| | | |
| | | orderDetZaikuList = orderDetZaikuListLWC; |
| | | sqlagencyProType = '%' + agencyProType + '%'; |
| | |
| | | System.debug('orderDetZaikuList = ' + orderDetZaikuList); |
| | | System.debug('accountName = ' + accountName); |
| | | System.debug('soql====>' + soql); |
| | | if(String.isNotBlank(sortField) && String.isNotBlank(sortOrder)){ |
| | | soql += ' ORDER BY ' + sortField + ' ' + sortOrder; |
| | | } |
| | | //排序 |
| | | // if (String.isNotBlank(sortField) && String.isNotBlank(sortOrder)) { |
| | | // if(sortFieldLWC != 'limitCount'){ |
| | | // soql += ' ORDER BY ' + sortField + ' ' + sortOrder; |
| | | |
| | | // } |
| | | // } |
| | | System.debug('soql = ' + soql); |
| | | //soql += ' ORDER BY ' + this.columus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last'); |
| | | List<Product2__c> queryList = Database.query(soql); |
| | | System.debug('queryList = ' + queryList); |
| | | |
| | | for (Integer i = 0; i < queryList.size(); i++) { |
| | | MidMap.put(queryList[i].Id, queryList[i]); |
| | | } |
| | |
| | | } |
| | | if (newMidBoxMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) { |
| | | ConsumableorderdetailsInfo Jstage = newMidBoxMap.get( |
| | | CountDel[i].Consumable_Product__c + |
| | | CountDel[i].Box_Piece__c + |
| | | tex |
| | | CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex |
| | | ) |
| | | .clone(); |
| | | Jstage.allnumber = Jstage.allnumber + 1; |
| | |
| | | } |
| | | if (newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) { |
| | | ConsumableorderdetailsInfo Jstage = newMidPieceMap.get( |
| | | CountDel[i].Consumable_Product__c + |
| | | CountDel[i].Box_Piece__c + |
| | | tex |
| | | CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex |
| | | ) |
| | | .clone(); |
| | | Jstage.allnumber = Jstage.allnumber + 1; |
| | |
| | | PaginatedAccounts paginatedAccounts = new PaginatedAccounts(); |
| | | paginatedAccounts.nextPageToken = (pageToken + pageSize < totalCount) ? pageToken + pageSize : null; |
| | | paginatedAccounts.recordStart = pageToken + 1; |
| | | paginatedAccounts.pageNumber = pageToken/pageSize + 1; |
| | | paginatedAccounts.pageNumber = pageToken / pageSize + 1; |
| | | Integer recordEnd = pageSize * paginatedAccounts.pageNumber; |
| | | paginatedAccounts.recordEnd = totalCount >= recordEnd ? recordEnd : totalCount; |
| | | paginatedAccounts.totalRecords = totalCount; |
| | | |
| | | |
| | | |
| | | List<ConsumableorderdetailsInfo> pageRecordsCompare = new List<ConsumableorderdetailsInfo>(); |
| | | System.debug('queryList = ' + JSON.serialize(queryList)); |
| | | for (Integer i = 0; i < queryList.size(); i++) { |
| | | for (ConsumableorderdetailsInfo ci : pageRecords) { |
| | | if (queryList[i].Id == ci.Prod.Id) { |
| | | System.debug('queryList[i].Id =' + queryList[i].Id); |
| | | System.debug('ci.Prod.Id =' + queryList[i].Id); |
| | | pageRecordsCompare.add(ci); |
| | | } |
| | | } |
| | | } |
| | | data.put('paginatedAccounts', paginatedAccounts); |
| | | data.put('accountid', accountid); |
| | | data.put('userWorkLocation', userWorkLocation); |
| | | data.put('agencyProType', agencyProType); |
| | | data.put('pageRecords', pageRecords); |
| | | system.debug('===========>pageRecords' + pageRecords); |
| | | data.put('pageRecords', pageRecordsCompare); |
| | | data.put('hasHos', hasHos); |
| | | system.debug('===========>pageRecords' + pageRecordsCompare); |
| | | system.debug('===========>data' + data); |
| | | if (pageRecords.isEmpty()) { |
| | | res.msg = '未搜索到相关消耗品订单!'; |
| | |
| | | // public static void SortStore() { |
| | | // if (sortKey == preSortKey) { |
| | | // // 方向が変わるのみ |
| | | // sortOrderAsc = !sortOrderAsc; |
| | | // sortOrder = !sortOrder; |
| | | // sortOrder[Integer.valueOf(sortKey)] = (sortOrderAsc == true ? '↑' : '↓'); |
| | | // } else { |
| | | // sortOrderAsc = true; |
| | |
| | | |
| | | //检索sql文做成 |
| | | private static String makeSoql(String CateName, String CateCode, String Category3, String Category4, String Category5) { |
| | | System.debug('orderDetZaikuList = ' + orderDetZaikuList); |
| | | String sqlTail = '(\''; |
| | | for (Integer i = 0; i < orderDetZaikuList.size(); i++) { |
| | | if (i < orderDetZaikuList.size() - 1) { |
| | |
| | | // } |
| | | |
| | | //刷新当前页 |
| | | public static PageReference refreshPageSize() { |
| | | makeCurrentPageRecords(); |
| | | return null; |
| | | } |
| | | // public static PageReference refreshPageSize() { |
| | | // makeCurrentPageRecords(); |
| | | // return null; |
| | | // } |
| | | |
| | | //编辑当前页内容 |
| | | public static void makeCurrentPageRecords() { |
| | |
| | | Integer endIdx; |
| | | pageRecords = new List<ConsumableorderdetailsInfo>(); |
| | | startIdx = pageToken; |
| | | endIdx = pageToken+pageSize; |
| | | if (endIdx > consumableorderdetailsRecords.size()){ |
| | | endIdx = pageToken + pageSize; |
| | | if (endIdx > consumableorderdetailsRecords.size()) { |
| | | endIdx = consumableorderdetailsRecords.size(); |
| | | } |
| | | for(Integer i=startIdx; i < endIdx ; i++){ |
| | | } |
| | | for (Integer i = startIdx; i < endIdx; i++) { |
| | | pageRecords.add(consumableorderdetailsRecords.get(i)); |
| | | } |
| | | } |
| | | |
| | | |
| | | //分页Bean |
| | | public class PaginatedAccounts { |
| | | @AuraEnabled |
| | | public List<Account> records; |
| | | @AuraEnabled |
| | | public Integer nextPageToken; |
| | | @AuraEnabled |
| | | public Integer pageNumber {get;set;} |
| | | public Integer pageNumber { get; set; } |
| | | @AuraEnabled |
| | | public Integer totalRecords {get;set;} |
| | | public Integer totalRecords { get; set; } |
| | | @AuraEnabled |
| | | public Integer recordStart {get;set;} |
| | | public Integer recordStart { get; set; } |
| | | @AuraEnabled |
| | | public Integer recordEnd {get;set;} |
| | | public Integer recordEnd { get; set; } |
| | | } |
| | | |
| | | // Data Bean |
| | | @TestVisible |
| | | class ConsumableorderdetailsInfo implements Comparable { |
| | | @AuraEnabled |
| | | public Consumable_order_details2__c esd { get; set; } |