高章伟
2023-03-03 d8dc84a3d56df839895f1c417a4d9cbee763d262
force-app/main/default/classes/DirectAssignController.cls
@@ -24,7 +24,7 @@
      // 暂定分配数据指定给对象有的情况
      targetId = ApexPages.currentPage().getParameters().get('targetId');
      if(String.isNotEmpty(recordId)){
         raesd = [SELECT Id,Fixture_Model_No_text__c,Asset__c,Rental_Apply__r.Name,Rental_Apply_Equipment_Set__r.Name,
         List<Rental_Apply_Equipment_Set_Detail__c> TempList = [SELECT Id,Fixture_Model_No_text__c,Asset__c,Rental_Apply__r.Name,Rental_Apply_Equipment_Set__r.Name,
               Queue_Day__c,Queue_Number__c,Rental_Apply__r.WorkPlace__c,Rental_Apply__r.Person_In_Charge__r.Name,
               Rental_Apply__r.demo_purpose2__c,Queue_Conment__c,Equipment_Type_text__c,Salesdepartment_before__c,
               Internal_asset_location_before__c,jumpReason__c,Queue_User__r.Name,Rental_Apply__r.Hospital__r.Name,Rental_Apply__c,
@@ -32,6 +32,7 @@
                FROM Rental_Apply_Equipment_Set_Detail__c 
                WHERE Is_Body__c=true 
                AND Rental_Apply_Equipment_Set__c=:recordId limit 1];
         raesd = TempList[0];
         assetId = raesd.Asset__c; 
         String soql = null;
         if (String.isNotEmpty(targetId)) {
@@ -294,6 +295,7 @@
       detail.Shipment_Status_Text__c = '暂定分配';
       // 备品存放地(借出时)
       detail.Internal_asset_location_before__c = raesd.Internal_asset_location_before__c;
       detail.UniqueKey_Queue__c = null;
       // if(detail.Queue_Day__c == null){
       //    detail.Queue_User__c   = UserInfo.getUserId();
     //        detail.Queue_Day__c    = Date.today();
@@ -368,6 +370,7 @@
    }
    public static void reQueue(Rental_Apply_Equipment_Set_Detail__c detail,String updownType){
       List<Rental_Apply_Equipment_Set_Detail__c> updList = new List<Rental_Apply_Equipment_Set_Detail__c>();
       detail =  [SELECT Id, Rental_Apply_Equipment_Set__c, Asset__c,Rental_Apply_Equipment_Set__r.Fixture_Set__r.Product_Type__c,QuenType__c,
                                               FSD_Fixture_Model_No__c, Fixture_Model_No_text__c,Externalkey__c,Rental_Apply__r.Product_category__c,
@@ -466,7 +469,7 @@
            }
        }
        System.debug(LoggingLevel.INFO, '*** detail: ' + detail);
        update detail;
        updList.add(detail);
        insert allsequenceList;
        if(updownType != 'bottom'){
           Integer i = 2;
@@ -474,15 +477,16 @@
              sdetail.Queue_Number__c = i;
              i ++;
           }
           update updateList;
           updList.addAll(updateList);
        }else{
           Integer i = 1;
           for(Rental_Apply_Equipment_Set_Detail__c sdetail:updateList){
              sdetail.Queue_Number__c = i;
              i ++;
           }
           update updateList;
           updList.addAll(updateList);
        }
        update updList;
        allsequenceList = [SELECT Id,ExternalKey__c,Demo_Purpose2__c,Rental_Apply__r.Request_shipping_day__c,Rental_Apply__r.EquipmentGuaranteeFlg__c,
                                                        Apply_Set_Detail__c,Apply_Set_Detail_ExternalKey__c,Rental_Apply__r.Request_approval_time__c,Apply_Set_Detail__r.IsAdjust__c,
                                                        Series_No__c,Salesdepartment__c,Product_category__c,Apply_Set_Detail__r.Queue_Day__c,Apply_Set_Detail__r.Queue_Time__c,