| 
															
																@@ -379,7 +379,7 @@ class TaskViewSet(viewsets.ModelViewSet): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 # 任务回滚 
															 | 
															
															 | 
															
																 # 任务回滚 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 class TaskRollbackMixin: 
															 | 
															
															 | 
															
																 class TaskRollbackMixin: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    @transaction.atomic 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+     
															 | 
														
													
												
													
														
															| 
															 | 
															
																     def rollback_task(self, request, task_id, *args, **kwargs): 
															 | 
															
															 | 
															
																     def rollback_task(self, request, task_id, *args, **kwargs): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         """ 
															 | 
															
															 | 
															
																         """ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         撤销入库任务并回滚相关状态 
															 | 
															
															 | 
															
																         撤销入库任务并回滚相关状态 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -650,7 +650,7 @@ class ContainerWCSViewSet(viewsets.ModelViewSet): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 status=status.HTTP_500_INTERNAL_SERVER_ERROR 
															 | 
															
															 | 
															
																                 status=status.HTTP_500_INTERNAL_SERVER_ERROR 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             ) 
															 | 
															
															 | 
															
																             ) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    @transaction.atomic 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+     
															 | 
														
													
												
													
														
															| 
															 | 
															
																     # def generate_container_operate(self, container_obj, bound_number,allocation_target_location): 
															 | 
															
															 | 
															
																     # def generate_container_operate(self, container_obj, bound_number,allocation_target_location): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     def generate_container_operate(self, container_obj, allocation_target_location): 
															 | 
															
															 | 
															
																     def generate_container_operate(self, container_obj, allocation_target_location): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   
															 | 
															
															 | 
															
																   
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -698,7 +698,7 @@ class ContainerWCSViewSet(viewsets.ModelViewSet): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 memo=f"WCS入库: 批次: {batch_obj.bound_number}, 数量: {goods_qty}"  # 使用实际容器中的数量 
															 | 
															
															 | 
															
																                 memo=f"WCS入库: 批次: {batch_obj.bound_number}, 数量: {goods_qty}"  # 使用实际容器中的数量 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             ) 
															 | 
															
															 | 
															
																             ) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																          
															 | 
															
															 | 
															
																          
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    @transaction.atomic 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+     
															 | 
														
													
												
													
														
															| 
															 | 
															
																     def generate_move_container_operate(self, container_obj, allocation_target_location): 
															 | 
															
															 | 
															
																     def generate_move_container_operate(self, container_obj, allocation_target_location): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																       
															 | 
															
															 | 
															
																       
															 | 
														
													
												
													
														
															| 
															 | 
															
																         # 获取容器中所有有效的批次明细 
															 | 
															
															 | 
															
																         # 获取容器中所有有效的批次明细 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -747,7 +747,7 @@ class ContainerWCSViewSet(viewsets.ModelViewSet): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 memo=f"托盘移动: 批次: {batch_obj.bound_number}, 数量: {goods_qty}" 
															 | 
															
															 | 
															
																                 memo=f"托盘移动: 批次: {batch_obj.bound_number}, 数量: {goods_qty}" 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             ) 
															 | 
															
															 | 
															
																             ) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    @transaction.atomic 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+     
															 | 
														
													
												
													
														
															| 
															 | 
															
																     def generate_move_container_operate_no_batch(self, container_obj, bound_number,allocation_target_location): 
															 | 
															
															 | 
															
																     def generate_move_container_operate_no_batch(self, container_obj, bound_number,allocation_target_location): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         ContainerOperationModel.objects.create( 
															 | 
															
															 | 
															
																         ContainerOperationModel.objects.create( 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             month = int(timezone.now().strftime("%Y%m")), 
															 | 
															
															 | 
															
																             month = int(timezone.now().strftime("%Y%m")), 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -763,7 +763,7 @@ class ContainerWCSViewSet(viewsets.ModelViewSet): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             memo=f"托盘组移库:从{container_obj.current_location}移库到{allocation_target_location}" 
															 | 
															
															 | 
															
																             memo=f"托盘组移库:从{container_obj.current_location}移库到{allocation_target_location}" 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																         ) 
															 | 
															
															 | 
															
																         ) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    @transaction.atomic 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+     
															 | 
														
													
												
													
														
															| 
															 | 
															
																     def generate_container_operate_no_batch(self, container_obj, bound_number,allocation_target_location): 
															 | 
															
															 | 
															
																     def generate_container_operate_no_batch(self, container_obj, bound_number,allocation_target_location): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         
															 | 
															
															 | 
															
																         
															 | 
														
													
												
													
														
															| 
															 | 
															
																         ContainerOperationModel.objects.create( 
															 | 
															
															 | 
															
																         ContainerOperationModel.objects.create( 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -780,7 +780,7 @@ class ContainerWCSViewSet(viewsets.ModelViewSet): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             memo=f"WCS入库: 批次: {bound_number}, 数量: 1" 
															 | 
															
															 | 
															
																             memo=f"WCS入库: 批次: {bound_number}, 数量: 1" 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																         ) 
															 | 
															
															 | 
															
																         ) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    @transaction.atomic 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+     
															 | 
														
													
												
													
														
															| 
															 | 
															
																     def generate_task(self, container, current_location, target_location,batch_id,location_c_number): 
															 | 
															
															 | 
															
																     def generate_task(self, container, current_location, target_location,batch_id,location_c_number): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         batch = BoundBatchModel.objects.filter(bound_number=batch_id).first() 
															 | 
															
															 | 
															
																         batch = BoundBatchModel.objects.filter(bound_number=batch_id).first() 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         batch_detail = BoundDetailModel.objects.filter(bound_batch=batch).first() 
															 | 
															
															 | 
															
																         batch_detail = BoundDetailModel.objects.filter(bound_batch=batch).first() 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1087,7 +1087,7 @@ class ContainerWCSViewSet(viewsets.ModelViewSet): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         self.inport_update_task(task.id, container_code) 
															 | 
															
															 | 
															
																         self.inport_update_task(task.id, container_code) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         return task 
															 | 
															
															 | 
															
																         return task 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    @transaction.atomic 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+     
															 | 
														
													
												
													
														
															| 
															 | 
															
																     def inport_update_task(self, wcs_id,container_id): 
															 | 
															
															 | 
															
																     def inport_update_task(self, wcs_id,container_id): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         try: 
															 | 
															
															 | 
															
																         try: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             task_obj = ContainerWCSModel.objects.filter(id=wcs_id).first() 
															 | 
															
															 | 
															
																             task_obj = ContainerWCSModel.objects.filter(id=wcs_id).first() 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2252,7 +2252,7 @@ class OutTaskViewSet(ViewSet): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             2: 2   # 空盘最低 
															 | 
															
															 | 
															
																             2: 2   # 空盘最低 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         }.get(goods_class, 99) 
															 | 
															
															 | 
															
																         }.get(goods_class, 99) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    @transaction.atomic 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+     
															 | 
														
													
												
													
														
															| 
															 | 
															
																     def _update_allocation_status(self, allocate_container, allocate_qty,bound_list_id): 
															 | 
															
															 | 
															
																     def _update_allocation_status(self, allocate_container, allocate_qty,bound_list_id): 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         """事务化更新分配状态""" 
															 | 
															
															 | 
															
																         """事务化更新分配状态""" 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         try: 
															 | 
															
															 | 
															
																         try: 
															 |