From d8dc84a3d56df839895f1c417a4d9cbee763d262 Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期五, 03 三月 2023 14:50:59 +0800
Subject: [PATCH] gzw 测试环境代码更新

---
 force-app/main/default/classes/DirectAssignController.cls |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/force-app/main/default/classes/DirectAssignController.cls b/force-app/main/default/classes/DirectAssignController.cls
index 4e13a23..d916e9a 100644
--- a/force-app/main/default/classes/DirectAssignController.cls
+++ b/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,

--
Gitblit v1.9.1