

日志
CODE:O1531492
Error:15_102_1_-2146232060
SQL:SELECT b.WareHouseName AS '仓库', CASE a.MoveType WHEN 1 THEN '产品爆旺平移库' WHEN 2 THEN '合并库位移库' WHEN 3 THEN '重型货架移库' WHEN 4 THEN '特定SKU移库' END AS '移库类型', rp.SKU AS '系统SKU', rp.ClientSKU AS '自定义SKU', CASE a.ProductVitalityType WHEN 0 THEN '普通款' WHEN 1 THEN '爆款' WHEN 2 THEN '平款' WHEN 3 THEN '旺款' WHEN 4 THEN '滞销款' END AS '产品爆旺平', wps.PositionCode AS '当前库位', CASE a.PositionVitalityType WHEN 0 THEN '未设置' WHEN 1 THEN '爆款' WHEN 2 THEN '平款' WHEN 3 THEN '旺款' WHEN 4 THEN '滞销款' END AS '库位爆旺平', a.AvaliableStockNumber AS '库位可用库存', wa.AreaName AS '库位区域', a.OutFrequency AS '出库频次', a.AddTime AS '加载时间' FROM RB_Region_MovePosition_RecommandProduct a WITH(NOLOCK) INNER JOIN RB_Product rp(NOLOCK) ON a.SKU=rp.SKU AND a.CustomerID=rp.CustomerIDINNER JOIN RB_WareHouse wh(NOLOCK) ON a.WareHouseID = wh.ID AND a.CustomerID = wh.CustomerIDINNER JOIN RB_WareHouse_Position wps(NOLOCK) ON a.PositionID = wps.ID AND a.CustomerID = wps.CustomerIDINNER JOIN RB_WareHouseArea wa(NOLOCK) ON a.WarehouseAreaID = wa.ID AND a.CustomerID = wa.CustomerID a.CustomerID=1 AND a.MoveStatus=0 ORDER BY a.ID DESC
MESSAGE:“a”附近有语法错误。
TRACE: 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
在 System.Data.SqlClient.SqlInternalConnection.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.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
在 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
在 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)
在 GotDotNet.ApplicationBlocks.Data.AdoHelper.ExecuteDataset(IDbCommand command)
在 Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(SqlCommand command)
在 PandaBuy.ERP.DAL.DBOperator.GetDSExecuteSqlNoTimeOut(String p_Sql, Boolean IsWriteDB) 在 PandaBuy.ERP.DAL.DBOperator.E8mARE5em(SqlException , String )
在 PandaBuy.ERP.DAL.DBOperator.GetDSExecuteSqlNoTimeOut(String p_Sql, Boolean IsWriteDB)
在 Biz.TaskApply.ReportTaskApply.ReportTaskExecute_OLD(RB_ReportApply_Task task)
在 Biz.TaskApply.ReportTaskApply.ProcessExportExcel(RB_ReportApply_Task task)
在 RB.Utility.TaskSmartManager`1.execute(Func`2 execFunction)
在 RB.Utility.TaskSmartManager`1.<>c__DisplayClass17_0.<TaskExecute>b__0()
在 System.Threading.Tasks.Task.InnerInvoke()
在 System.Threading.Tasks.Task.Execute()
在 System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
在 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.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
在 System.Threading.ThreadPoolWorkQueue.Dispatch()
在 System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
-------------------------------------------------------------


bug原因:
导出的时候sql语句拼接错误,关键词和sql语句之间没有留空格
bug解决后的效果
1、单个关键词搜索
2、批量搜索