binxie
2023-06-26 d3e4451e36fbe25da4427bccd4e6b41aefd473c8
newclass0626formate
1个文件已修改
55 ■■■■ 已修改文件
force-app/main/default/classes/LexArriveGoodsMainController.cls 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexArriveGoodsMainController.cls
@@ -7,7 +7,7 @@
    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;
@@ -34,8 +34,12 @@
        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;
@@ -43,7 +47,10 @@
                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();
@@ -62,7 +69,18 @@
            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
@@ -108,7 +126,13 @@
    }
    @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;
@@ -118,7 +142,10 @@
        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();
@@ -137,11 +164,21 @@
            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 ';