重现步骤

[步骤]

 select top 200 * from RB_ReportApply_Task (nolock) where TaskType=221    order by AddTime desc ; 

[10:04:23]  -------------------------------------------------------------
CODE:N1004232
Error:11_-2_0_-2146232060
SQL:SELECT ros.OrderSourceName                  '订单来源渠道',
                                   al.AddAdminName                      '建单人员',
                                   Isnull(outWh.WareHouseName, '')      '调出仓库',
                                   Isnull(inWh.WareHouseName, '')       '调入仓库',
                                   al.OrginNumber                       '关联单号',
                                   'D' + Cast(rpo.PackageID AS VARCHAR) '发货包裹号',
                                   Isnull(rt.TransportName, '')         '运输方式',
                                   al.AllocationNumber                  '调拨单号',
                                   case 
                                        when ISNULL(al.CreateSourceType,0)=0 THEN '直接创建'
                                        when ISNULL(al.CreateSourceType,0)=1 THEN '调仓任务'
                                   else '-' end '数据来源',
                                   al.AddTime                           '调拨单生成时间',
                                   al.Remark                            '单据备注',
                                   ( CASE
                                       WHEN al.Status = 0 THEN '在途中'
                                       WHEN al.Status = 1 THEN '部分入库'
                                       WHEN al.Status = 2 THEN '已入库'
                                       WHEN al.Status = 3 THEN '作废'
                                       WHEN al.Status = 4 THEN '待审核'
                                       WHEN al.Status = 5 THEN '审核通过'
                                       WHEN al.Status = 6 THEN '审核失败'
                                       WHEN al.Status = 7 THEN '撤销'
                                       WHEN al.Status = 11 THEN '异常收货'
                                       ELSE '未识别状态'
                                     END )                              '调拨单状态',
                                   ( CASE
                                       WHEN ald.Status = 0 THEN '在途中'
                                       WHEN ald.Status = 1 THEN '部分入库'
                                       WHEN ald.Status = 2 THEN '已入库'
                                       WHEN ald.Status = 3 THEN '作废'
                                       WHEN ald.Status = 4 THEN '待审核'
                                       WHEN ald.Status = 5 THEN '审核通过'
                                       WHEN ald.Status = 6 THEN '审核失败'
                                       WHEN ald.Status = 7 THEN '撤销'
                                       WHEN ald.Status = 11 THEN '异常收货'
                                       ELSE '未识别状态'
                                     END )                              '调拨明细状态',
                                   ald.SKU                              '系统SKU',
                                   rpd.ClientSKU                        '自定义SKU',
                                   ald.OrderSourceSKU                   '海外仓SKU',
                                   rpd.ProductNameCN                    '产品名',
                                   ald.BuyPrice                         '采购价',
                                   ald.ShipNum                          '发货数量',
                                   ald.ReceiveNum                       '收货数量',
                                   ( CASE
                                       WHEN Isnull(rid.Status, 0) = 0 THEN '待处理'
                                       WHEN Isnull(H.ID, -1) = -1 THEN '未生成差异'
                                       WHEN H.Status = 4 THEN '待审核'
                                       WHEN H.Status = 5 THEN '审核通过'
                                       WHEN H.Status = 6 THEN '审核失败'
                                     END )                              '差异结果',
                                   Isnull(H.Number, 0)                  '差异数量',
                                   al.TrackNumber                       '物流单号',
                                   ald.Remark as '备注'
                            FROM   RB_Inventory_AllocationBill al WITH(nolock)
                                   LEFT JOIN RB_Inventory_AllocationDetailBill ald WITH(NOLOCK)
                                     ON al.CustomerID = ald.CustomerID
                                        AND al.ID = ald.AllocationBillID
                                   LEFT JOIN RB_Product rpd WITH(NOLOCK)
                                     ON ald.CustomerID = rpd.CustomerID
                                        AND ald.SKU = rpd.SKU
                                   LEFT JOIN RB_WareHouse outWh WITH(nolock)
                                     ON al.CustomerID = outWh.CustomerID
                                        AND al.OutWareHouseID = outWh.ID
                                   LEFT JOIN RB_WareHouse inWh WITH(nolock)
                                     ON al.CustomerID = outWh.CustomerID
                                        AND al.InWareHouseID = inWh.ID
                                   LEFT JOIN RB_Transport rt WITH(nolock)
                                     ON al.CustomerID = rt.CustomerID
                                        AND rt.ID = al.TransportID
                                   LEFT JOIN RB_OrderList rol WITH(NOLOCK)
                                     ON rol.CustomerID = ald.CustomerID
                                        AND rol.ID = ald.OrderListID
                                   LEFT JOIN RB_OrderInfo ri WITH(NOLOCK)
                                     ON rol.CustomerID = ri.CustomerID
                                        AND rol.OrderCode = ri.OrderCode
                                   LEFT JOIN RB_OrderSource ros WITH(NOLOCK)
                                     ON ri.CustomerID = ros.CustomerID
                                        AND ri.OrderSourceID = ros.ID
                                   LEFT JOIN RB_Procurement_Order_Package_OrderDetail rpo WITH(NOLOCK)
                                     ON ri.CustomerID = rpo.CustomerID
                                        AND rol.ID = rpo.OrderListID
                                   LEFT JOIN RB_Inventory_DifferentiationBill rid WITH(NOLOCK)
                                     ON rid.CustomerID = ald.CustomerID
                                        AND ald.ID = rid.RelationID
                                   LEFT JOIN RB_Inventory_InOutBallance H WITH(NOLOCK)
                                     ON rid.CustomerID = H.CustomerID
                                        AND rid.BallanceNumber = H.BallanceNumber
                            WHERE  al.CustomerID = @CustomerID   AND inWh.WareHouseType = @WareHouseType AND al.AddTime>=@AddTimeBegin AND al.AddTime<DATEADD(DAY,1,@AddTimeEnd)
PARAMS:@CustomerID = 1 ,@WareHouseType = 1 ,@AddTimeBegin = 2025/5/9 0:00:00 ,@AddTimeEnd = 2025/6/9 0:00:00 ,
MESSAGE:执行超时已过期。完成操作之前已超时或服务器未响应。 
TRACE:   在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   在 System.Data.SqlClient.SqlDataReader.get_MetaData()
   在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
   在 RB.DAL.DBOperator.Query(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB)   在 RB.DAL.DBOperator.toCommonTipException(SqlException ex, String sql, SqlParameter[] cmdParms)
   在 RB.DAL.DBOperator.Query(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB)
   在 RB.DALExtend.Generate.RB_Inventory_AllocationBillExtend.ExportDataInventoryAllocationCurrentFilter(RB_Inventory_AllocationBill_PSParameters parameters)
   在 Biz.TaskApply.ReportTaskMethods.GetDataInventoryAllocationCurrentFilter(InventoryAllocationReportParameter parameter)
   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   在 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   在 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   在 Biz.TaskApply.ReportTaskApply.ReportTaskExecute(RB_ReportApply_Task task)
   在 Biz.TaskApply.ReportTaskApply.ProcessExportExcel(RB_ReportApply_Task task)
   在 RB.Utility.TaskSmartManager`1.execute(Func`2 execFunction)
   在 System.Threading.Tasks.Task.Execute()
   在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   在 System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
   在 System.Threading.ThreadPoolWorkQueue.Dispatch()

-------------------------------------------------------------


[结果]


[期望]

排查问题,提升导出效率
历史记录  
  1. 2025-06-09 11:00:25, 由 袁慧斌 创建。
  2. 2025-06-09 11:08:12, 由 李乐同 指派给 程伟。
    修改了 指派给,旧值为 "liletong",新值为 "chengwei"。
  3. 2025-06-09 14:43:38, 由 袁慧斌 编辑。
    修改了 优先级 ,旧值为 "2",新值为 "1"。
    修改了 解决时效,旧值为 "0",新值为 "-1"。
  4. 2025-06-09 16:04:43, 由 程伟 指派给 谢业福。
    修改了 指派给,旧值为 "chengwei",新值为 "xieyefu"。
  5. 2025-06-09 16:17:41, 由 谢业福 解决,方案为 性能问题 。
    修改了 解决方案,旧值为 "",新值为 "performance"。
    修改了 解决版本,旧值为 "",新值为 "trunk"。
    修改了 解决日期,旧值为 "",新值为 "2025-06-09 16:17:00"。
    修改了 指派给 ,旧值为 "xieyefu",新值为 "liuchao"。
    修改了 Bug状态 ,旧值为 "active",新值为 "resolved"。
    修改了 是否确认,旧值为 "0",新值为 "1"。
    修改了 解决者 ,旧值为 "",新值为 "xieyefu"。

    关联表太多 1分半左右 延长一下时间

  6. 2025-06-10 09:10:12, 由 刘超 编辑。
    修改了 优先级 ,旧值为 "1",新值为 "2"。
    修改了 解决时效,旧值为 "0",新值为 "5.28"。
  7. 2025-06-17 09:08:12, 由 刘超 编辑。
    修改了 测试责任人,旧值为 "",新值为 "liuchao"。
  8. 2025-06-17 09:08:51, 由 刘超 编辑。
    修改了 上线时间,旧值为 "0000-00-00 00:00:00",新值为 "2025-06-09 18:00"。
    修改了 上线时效,旧值为 "-1",新值为 "6.99"。
  9. 2025-06-17 09:08:54, 由 刘超 关闭。
    修改了 Bug状态 ,旧值为 "resolved",新值为 "closed"。
    修改了 指派给 ,旧值为 "liuchao",新值为 "closed"。
    修改了 由谁关闭,旧值为 "",新值为 "liuchao"。
    修改了 关闭日期,旧值为 "",新值为 "2025-06-17 09:08:54"。
所属项目 技术中心-需求池
所属模块 供应链   仓储物流   物流
所属计划
所属迭代
Bug类型
严重程度 一般
优先级 P2
Bug状态 已关闭
业务部门 供应链管理中心
影响功能
开发责任人 谢业福
测试责任人 刘超
解决时效 5.28
激活次数 0
激活日期
是否确认 是
当前指派 Closed 于 2025-06-17 09:08:54
截止日期 0000-00-00
上线时间 2025-06-09 18:00:00
上线时效 6.99
操作系统
浏览器
关键词
抄送给
所属迭代
相关需求
相关任务
由谁创建 袁慧斌 于 2025-06-09 11:00:25
影响环境 生产环境-业务反馈
由谁解决 谢业福 于 2025-06-09 16:17:00
解决版本 主干
解决方案 性能问题
由谁关闭 刘超 于 2025-06-17 09:08:54
最后修改 刘超 于 2025-06-17 09:08:54
相关Bug