| | |
| | | private static String cate1ForSort = null; |
| | | private static Date cate2ForSort = Date.today(); |
| | | private static Date cate2 = Date.today(); |
| | | private static String[] columus = new String[]{ 'Product2__c.Name'}; |
| | | private static String[] columus = new List<String>{ 'Product2__c.Name' }; |
| | | // 产品 ID |
| | | private static String ESetId = ''; |
| | | private static String accountid = null; |
| | |
| | | try { |
| | | // coc = new Consumable_order__c(); |
| | | String userId = UserInfo.getUserId(); |
| | | List<user> Useracc = New List<user>(); |
| | | Useracc = [select accountid, Work_Location__c,UserPro_Type__c from user where id =:userId]; |
| | | List<user> Useracc = new List<user>(); |
| | | Useracc = [ |
| | | SELECT accountid, Work_Location__c, UserPro_Type__c |
| | | FROM user |
| | | WHERE id = :userId |
| | | ]; |
| | | accountid = Useracc[0].accountid; |
| | | userWorkLocation = Useracc[0].Work_Location__c; |
| | | agencyProType = Useracc[0].UserPro_Type__c; |
| | |
| | | agencyProType = 'ET'; |
| | | } |
| | | // 获得订单一览 |
| | | Map<String, Schema.FieldSet> fsMap = Schema.getGlobalDescribe().get('Consumable_order__c').getDescribe().fieldSets.getMap(); |
| | | Map<String, Schema.FieldSet> fsMap = Schema.getGlobalDescribe() |
| | | .get('Consumable_order__c') |
| | | .getDescribe() |
| | | .fieldSets.getMap(); |
| | | Schema.FieldSet fs = fsMap.get('arrive_view'); |
| | | // 获得订单中的所有项目 |
| | | List<FieldSetMember> fsmList = fs.getFields(); |
| | |
| | | for (String s : column) { |
| | | soql += ',' + s; |
| | | } |
| | | soql += ' from Consumable_order__c where Order_type__c = \''+'订单'+'\' and recordtypeid =\'' + System.Label.RT_ConOrder_Delivery + '\' and Dealer_Info__c =\'' + accountid +'\' and Order_ProType__c =\'' + agencyProType +'\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_Owner_WorkLocal__c = \'' + userWorkLocation + '\' and showFalseNotshowTrue__c = false order by Deliver_date__c'; // |
| | | soql += |
| | | ' from Consumable_order__c where Order_type__c = \'' + |
| | | '订单' + |
| | | '\' and recordtypeid =\'' + |
| | | System.Label.RT_ConOrder_Delivery + |
| | | '\' and Dealer_Info__c =\'' + |
| | | accountid + |
| | | '\' and Order_ProType__c =\'' + |
| | | agencyProType + |
| | | '\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_Owner_WorkLocal__c = \'' + |
| | | userWorkLocation + |
| | | '\' and showFalseNotshowTrue__c = false order by Deliver_date__c'; // |
| | | // soql = 'select id,name,ContractNo__c,Total_num__c,OrderNumber_arrived__c,Delivery_detail_count__c,OrderNumber_notarrive__c,More_than_seven_days__c,Shipment_date__c,First_Delivery__c from Consumable_order__c where id in :idList'; |
| | | raesList = Database.query(soql); |
| | | //20200904 ljh add start |
| | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static Results searchConsumableorderdetails(String category1Str, Date cate2Str, String accountidStr, String userWorkLocationStr, String agencyProTypeStr){ |
| | | public static Results searchConsumableorderdetails( |
| | | String category1Str, |
| | | Date cate2Str, |
| | | String accountidStr, |
| | | String userWorkLocationStr, |
| | | String agencyProTypeStr |
| | | ) { |
| | | Results results = new Results(); |
| | | category1 = category1Str; |
| | | cate2 = cate2Str; |
| | |
| | | try { |
| | | // cate2 = coc.Shipment_date__c; |
| | | // 获得订单一览 |
| | | Map<String, Schema.FieldSet> fsMap = Schema.getGlobalDescribe().get('Consumable_order__c').getDescribe().fieldSets.getMap(); |
| | | Map<String, Schema.FieldSet> fsMap = Schema.getGlobalDescribe() |
| | | .get('Consumable_order__c') |
| | | .getDescribe() |
| | | .fieldSets.getMap(); |
| | | Schema.FieldSet fs = fsMap.get('arrive_view'); |
| | | // 获得订单中的所有项目 |
| | | List<FieldSetMember> fsmList = fs.getFields(); |
| | |
| | | for (String s : column) { |
| | | soql += ',' + s; |
| | | } |
| | | soql += ' from Consumable_order__c where Order_type__c = \''+'订单'+'\' and recordtypeid =\'' + System.Label.RT_ConOrder_Delivery + '\' and Dealer_Info__c =\'' + accountid +'\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) '; |
| | | soql += |
| | | ' from Consumable_order__c where Order_type__c = \'' + |
| | | '订单' + |
| | | '\' and recordtypeid =\'' + |
| | | System.Label.RT_ConOrder_Delivery + |
| | | '\' and Dealer_Info__c =\'' + |
| | | accountid + |
| | | '\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) '; |
| | | soql += 'and Order_Owner_WorkLocal__c = \'' + userWorkLocation + '\' '; |
| | | soql += 'and showFalseNotshowTrue__c = false'; |
| | | if (!String.isBlank(category1)) { |
| | | soql += ' and Name like \'%' + String.escapeSingleQuotes(category1.replaceAll('%', '\\%')) + '%\' '; |
| | | soql += |
| | | ' and Name like \'%' + |
| | | String.escapeSingleQuotes(category1.replaceAll('%', '\\%')) + |
| | | '%\' '; |
| | | } |
| | | if(cate2 != null){ |
| | | soql += ' and Shipment_date__c = :cate2 '; |