如题,选择业务员查询某个月,提示“查询出现异常。事务(进程 ID 64)与另一个进程被死锁在 锁 资源上,并且已被选作死锁牺牲品。请重新运行该事务。”
报错信息:“INSERT INTO #TM_CB_PRODIMPROFITRPT (FDATE, FSETTLEORGID, FCUSTOMERID, FSALEDEPTID, FSALERID, FSRCBILLNO, FENTRYID, FPRODUCTID, FBASEUNITID, FSALEQTY, FSALEAMOUNT, FCOSTQTY, FCOSTAMOUNT, FSRCCURRENCYID, FTAXRATE, FTARGETCURRENCYID, FAMOUNTDIGITS, FPRICEDIGITS, FRATETYPEID, FLINEDATATYPE, FFORMTYPE) SELECT HEAD.FDATE, HEAD.FSETTLEORGID, HEAD.FCUSTOMERID, HEAD.FSALEDEPTID, HEAD.FSALEERID, HEAD.FBILLNO, ENTRY.FENTRYID, ENTRY.FMATERIALID, ENTRY.FBASICUNITID, ENTRY.FBASICUNITQTY fsaleqty, ENTRY.FNOTAXAMOUNT fsaleamount, 0 fcostqty, 0 fcostamount, HEAD.FCURRENCYID, 1 ftaxrate, CURR.FCURRENCYID ftargetcurrencyid, CURR.FAMOUNTDIGITS, CURR.FPRICEDIGITS, ACCTPOLICY.FRATETYPEID, 0 flinedatatype, 'AR_receivable' fformtype FROM T_AR_RECEIVABLE HEAD INNER JOIN T_AR_RECEIVABLEENTRY ENTRY ON HEAD.FID = ENTRY.FID INNER JOIN T_BD_CUSTOMER CUS ON CUS.FCUSTID = HEAD.FCUSTOMERID INNER JOIN V_BD_SALESMAN SALER ON SALER.FID = HEAD.FSALEERID INNER JOIN t_bd_Material MAT ON MAT.FMATERIALID = ENTRY.FMATERIALID INNER JOIN t_BD_MaterialBase MAB ON MAB.FMATERIALID = ENTRY.FMATERIALID LEFT OUTER JOIN T_FA_ACCTPOLICY ACCTPOLICY ON ACCTPOLICY.FACCTPOLICYID = 1 LEFT OUTER JOIN T_BD_CURRENCY CURR ON CURR.FCURRENCYID = 1 WHERE (HEAD.FACCOUNTSYSTEM IN (0, 1) AND (HEAD.FSETTLEORGID IN (100001) AND ((((((MAB.FERPCLSID IN ('1', '2', '3', '4', '5', '7', '9') AND (SALER.FNUMBER >= '055')) AND (SALER.FNUMBER <= '055')) AND HEAD.FDOCUMENTSTATUS = 'C') AND HEAD.FCANCELSTATUS = 'A') AND (HEAD.FDATE >= @StartDate)) AND (HEAD.FDATE < @EndDate)))) UNION ALL SELECT HEAD.FDATE, SOKF.FSETTLEORGID, HEAD.FCUSTOMERID, HEAD.FSALEDEPTID, HEAD.FSALESMANID, HEAD.FBILLNO, ENTRY.FENTRYID, ENTRY.FMATERIALID, ENTRY.FBASEUNITID, 0 fsaleqty, 0 fsaleamount, ENTRY.FBASEUNITQTY fcostqty, COST.FAMOUNT_LC fcostamount, 0, 0, 0, CURR.FAMOUNTDIGITS, CURR.FPRICEDIGITS, ACCTPOLICY.FRATETYPEID, 0 flinedatatype, 'SAL_OUTSTOCK' fformtype FROM T_SAL_OUTSTOCK HEAD INNER JOIN T_SAL_OUTSTOCKENTRY ENTRY ON HEAD.FID = ENTRY.FID INNER JOIN T_SAL_OUTSTOCKFIN SOKF ON SOKF.FID = HEAD.FID INNER JOIN T_SAL_OUTSTOCKentry_C COST ON COST.FENTRYID = ENTRY.FENTRYID INNER JOIN T_HS_CALDIMENSIONS HSCAL ON (HSCAL.FDIMENSIONID = COST.FDIMENSIONID AND HSCAL.FDIMENSIONID = 5) INNER JOIN T_BD_CUSTOMER CUS ON CUS.FCUSTID = HEAD.FCUSTOMERID INNER JOIN V_BD_SALESMAN SALER ON SALER.FID = HEAD.FSALESMANID INNER JOIN t_bd_Material MAT ON MAT.FMATERIALID = ENTRY.FMATERIALID INNER JOIN t_BD_MaterialBase MAB ON MAB.FMATERIALID = ENTRY.FMATERIALID LEFT OUTER JOIN T_FA_ACCTPOLICY ACCTPOLICY ON ACCTPOLICY.FACCTPOLICYID = 1 LEFT OUTER JOIN T_BD_CURRENCY CURR ON CURR.FCURRENCYID = 1 WHERE (SOKF.FSETTLEORGID IN (100001) AND ((((((MAB.FERPCLSID IN ('1', '2', '3', '4', '5', '7', '9') AND (SALER.FNUMBER >= '055')) AND (SALER.FNUMBER <= '055')) AND HEAD.FDOCUMENTSTATUS = 'C') AND HEAD.FCANCELSTATUS = 'A') AND (HEAD.FDATE >= @StartDate)) AND (HEAD.FDATE < @EndDate))) UNION ALL SELECT HEAD.FDATE, SRKF.FSETTLEORGID, HEAD.FRETCUSTID, HEAD.FSALEDEPTID, HEAD.FSALESMANID, HEAD.FBILLNO, ENTRY.FENTRYID, ENTRY.FMATERIALID, ENTRY.FBASEUNITID, 0 fsaleqty, 0 fsaleamount, (-1 * ENTRY.FBASEUNITQTY) fcostqty, (-1 * COST.FAMOUNT_LC) fcostamount, 0, 0, 0, CURR.FAMOUNTDIGITS, CURR.FPRICEDIGITS, ACCTPOLICY.FRATETYPEID, 0 flinedatatype, 'SAL_RETURNSTOCK' fformtype FROM T_SAL_RETURNSTOCK HEAD INNER JOIN T_SAL_RETURNSTOCKENTRY ENTRY ON ENTRY.FID = HEAD.FID INNER JOIN T_SAL_RETURNSTOCKFIN SRKF ON SRKF.FID = HEAD.FID INNER JOIN T_SAL_RETURNSTOCKENTRY_C COST ON COST.FENTRYID = ENTRY.FENTRYID INNER JOIN T_HS_CALDIMENSIONS HSCAL ON (HSCAL.FDIMENSIONID = COST.FDIMENSIONID AND HSCAL.FDIMENSIONID = 5) INNER JOIN T_BD_CUSTOMER CUS ON CUS.FCUSTID = HEAD.FRETCUSTID INNER JOIN V_BD_SALESMAN SALER ON SALER.FID = HEAD.FSALESMANID INNER JOIN t_bd_Material MAT ON MAT.FMATERIALID = ENTRY.FMATERIALID INNER JOIN t_BD_MaterialBase MAB ON MAB.FMATERIALID = ENTRY.FMATERIALID LEFT OUTER JOIN T_FA_ACCTPOLICY ACCTPOLICY ON ACCTPOLICY.FACCTPOLICYID = 1 LEFT OUTER JOIN T_BD_CURRENCY CURR ON CURR.FCURRENCYID = 1 WHERE (SRKF.FSETTLEORGID IN (100001) AND ((((((MAB.FERPCLSID IN ('1', '2', '3', '4', '5', '7', '9') AND (SALER.FNUMBER >= '055')) AND (SALER.FNUMBER <= '055')) AND HEAD.FDOCUMENTSTATUS = 'C') AND HEAD.FCANCELSTATUS = 'A') AND (HEAD.FDATE >= @StartDate)) AND (HEAD.FDATE < @EndDate))) UNION ALL SELECT HEAD.FDATE, ENTRY.FOWNERID, CUS.FCUSTID, 0 fsaledeptid, 0 fsalesmanid, HEAD.FBILLNO, ENTRY.FENTRYID, ENTRY.FMATERIALID, ENTRY.FBASEUNITID, 0 fsaleqty, 0 fsaleamount, ENTRY.FBASEQTY fcostqty, COST.FAMOUNT_LC fcostamount, 0, 0, 0, CURR.FAMOUNTDIGITS, CURR.FPRICEDIGITS, ACCTPOLICY.FRATETYPEID, 0 flinedatatype, 'STK_TRANSFEROUT' fformtype FROM T_STK_STKTRANSFEROUT HEAD INNER JOIN T_STK_STKTRANSFEROUTENTRY ENTRY ON ENTRY.FID = HEAD.FID INNER JOIN T_STK_STKTRANSFEROUTENTRY_C COST ON COST.FENTRYID = ENTRY.FENTRYID INNER JOIN T_HS_CALDIMENSIONS HSCAL ON (HSCAL.FDIMENSIONID = COST.FDIMENSIONID AND HSCAL.FDIMENSIONID = 5) INNER JOIN T_BD_CUSTOMER CUS ON (CUS.FCORRESPONDORGID = HEAD.FOWNERINID AND CUS.FUSEORGID = HEAD.FSTOCKORGID) INNER JOIN t_bd_Material MAT ON MAT.FMATERIALID = ENTRY.FMATERIALID INNER JOIN t_BD_MaterialBase MAB ON MAB.FMATERIALID = ENTRY.FMATERIALID LEFT OUTER JOIN T_FA_ACCTPOLICY ACCTPOLICY ON ACCTPOLICY.FACCTPOLICYID = 1 LEFT OUTER JOIN T_BD_CURRENCY CURR ON CURR.FCURRENCYID = 1 WHERE (HEAD.FTransferDirect = 'GENERAL' AND ((ENTRY.FOWNERID IN (100001) AND ENTRY.FOWNERINID NOT IN (100001)) AND ((((MAB.FERPCLSID IN ('1', '2', '3', '4', '5', '7', '9') AND HEAD.FDOCUMENTSTATUS = 'C') AND HEAD.FCANCELSTATUS = 'A') AND (HEAD.FDATE >= @StartDate)) AND (HEAD.FDATE < @EndDate)))) UNION ALL SELECT HEAD.FDATE, ENTRY.FOWNERID, CUS.FCUSTID, 0 fsaledeptid, 0 fsalerid, HEAD.FBILLNO, ENTRY.FENTRYID, ENTRY.FMATERIALID, ENTRY.FBASEUNITID, 0 fsaleqty, 0 fsaleamount, (-1 * ENTRY.FBASEQTY) fcostqty, (-1 * COST.FAMOUNT_LC) fcostamount, 0, 0, 0, CURR.FAMOUNTDIGITS, CURR.FPRICEDIGITS, ACCTPOLICY.FRATETYPEID, 0 flinedatatype, 'STK_TRANSFERIN' fformtype FROM T_STK_STKTRANSFERIN HEAD INNER JOIN T_STK_STKTRANSFERINENTRY ENTRY ON ENTRY.FID = HEAD.FID INNER JOIN T_STK_STKTRANSFERINENTRY_C COST ON COST.FENTRYID = ENTRY.FENTRYID INNER JOIN T_HS_CALDIMENSIONS HSCAL ON (HSCAL.FDIMENSIONID = COST.FDIMENSIONID AND HSCAL.FDIMENSIONID = 5) INNER JOIN T_BD_CUSTOMER CUS ON (CUS.FCORRESPONDORGID = HEAD.FOWNEROUTID AND CUS.FUSEORGID = HEAD.FSTOCKORGID) INNER JOIN t_bd_Material MAT ON MAT.FMATERIALID = ENTRY.FMATERIALID INNER JOIN t_BD_MaterialBase MAB ON MAB.FMATERIALID = ENTRY.FMATERIALID LEFT OUTER JOIN T_FA_ACCTPOLICY ACCTPOLICY ON ACCTPOLICY.FACCTPOLICYID = 1 LEFT OUTER JOIN T_BD_CURRENCY CURR ON CURR.FCURRENCYID = 1 WHERE (HEAD.FTransferDirect = 'RETURN' AND ((ENTRY.FOWNERID IN (100001) AND ENTRY.FOWNEROUTID NOT IN (100001)) AND ((((MAB.FERPCLSID IN ('1', '2', '3', '4', '5', '7', '9') AND HEAD.FDOCUMENTSTATUS = 'C') AND HEAD.FCANCELSTATUS = 'A') AND (HEAD.FDATE >= @StartDate)) AND (HEAD.FDATE < @EndDate))))
Server stack trace:
at Kingdee.BOS.App.Data.AbstractDatabase.ExecuteNonQuery(DbCommand command, IEnumerable`1 listParam)
at Kingdee.BOS.App.Data.DBUtils.ExecuteBatchWithTime(Context ctx, List`1 lstSqlObj, Int32 commandTimeout)
at Kingdee.K3.FIN.CB.App.Report.ProDimProfitRpt.InsertDataToTempTable(String tempTable)
at Kingdee.K3.FIN.CB.App.Report.ProDimProfitRpt.BuilderReportSqlAndTempTable(IRptParams filter, String tableName)
at Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.CreateTempTable(IRptParams filter, String tablename)
at Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetDataForVirtual(IRptParams filter)
at Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetData(IRptParams filter)
at Kingdee.BOS.App.Core.PlugInProxy.SysReportServicePlugInProxy.GetReportData(ReportServiceParameter parameter)
at Kingdee.BOS.App.Core.SysReportService.GetReportData(ReportServiceParameter parameter)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Kingdee.BOS.Contracts.ISysReportService.GetReportData(ReportServiceParameter parameter)
at Kingdee.BOS.ServiceHelper.SysReportServiceHelper.GetReportData(ReportServiceParameter parameter)
at Kingdee.BOS.Model.Report.SysReportModel.GetData(Int32 start, Int32 rows)
at Kingdee.BOS.Web.Report.SysReportView.GetListData()
at Kingdee.BOS.Web.Report.SysReportView.<>c__DisplayClass3d.
推荐阅读