产品成本还原对比分析表查询打不开【金蝶K/3 Cloud】【7.0...
799次浏览
编辑于2017年11月27日 10:44:03
产品成本还原对比分析表查询打不开,查询出现异常。尝试在数据库 2 中提取逻辑页 (1:74513) 失败。该逻辑页属于分配单元 422439980826624,而非 7421946875393277952。
INSERT INTO #TM_CB_PRORESTORECOSTDIFF (FPRODUCTID, FBASICUNITID, FCOSTITEMID, FMATERIALID, FEXPENSEITEMID, FCURRUSEDHOUR, FCURRPRICE, FCURRCOSTAMOUNT, FCURRAMOUNT, FDIFFUSEDHOUR, FDIFFPRICE, FDIFFCOSTAMOUNT, FDIFFAMOUNT, FQUANTITYDIFF, FPRICEDIFF, FTOTALDIFFAMOUNT, FQTYDIGITS, FPRICEDIGITS, FAMOUNTDIGITS, FEXPTYPE, FLINEDATATYPE, FIDENTITYID, FSELECTTYPE) SELECT TMP.FPRODUCTID, baseunit.FBaseUnitId, TMP.FCOSTITEMID, TMP.FMATERIALID, TMP.FEXPENSEITEMID, 0 fcurrusedhour, 0 fcurrprice, SUM(TMP.FCURRCOSTAMOUNT) fcurrcostamount, SUM(TMP.FCURRCOSTAMOUNT) fcurramount, 0 fdiffusedhour, 0 fdiffprice, SUM(TMP.FDIFFCOSTAMOUNT) fdiffcostamount, SUM(TMP.FDIFFCOSTAMOUNT) fdiffamount, 0 fquantitydiff, 0 fpricediff, (SUM(TMP.FCURRCOSTAMOUNT) - SUM(TMP.FDIFFCOSTAMOUNT)) ftotaldiffamount, CURR.FPRICEDIGITS fqtydigits, CURR.FPRICEDIGITS, 10 famountdigits, TMP.FEXPTYPE, 10 flinedatatype, ROW_NUMBER() OVER( ORDER BY FPRODUCTID ASC) fidentityid, 0 fselecttype FROM (SELECT productDime.FPRODUCTID fproductid, COSTM.FMATERIALID, COSTM.FEXPTYPE, COSTMD.FCOSTITEMID, COSTMD.FEXPENSESITEMID fexpenseitemid, (SUM(COSTMD.FQUALIFIEDINAMOUNT) + SUM(COSTMD.FDYSINAMOUNT) + SUM(COSTMD.FWASTEINAMOUNT)) fcurrcostamount, 0 fdiffcostamount FROM T_CB_PROORDERINFO_H product INNER JOIN T_CB_PROORDERDIME productDime ON product.FProductDimeId = productDime.FProductDimeId INNER JOIN T_HS_OUTACCTG acctg ON product.FACCTGID = acctg.FId INNER JOIN T_CB_CostMatterial_H COSTM ON product.FID = COSTM.FID INNER JOIN T_CB_CostMatterialDetail_H COSTMD ON COSTM.FENTRYID = COSTMD.FENTRYID INNER JOIN T_BD_MATERIAL MAT ON MAT.FMATERIALID = productDime.FPRODUCTID LEFT OUTER JOIN T_CB_COSTCENTER CC ON CC.FCOSTCENTERID = productDime.FCOSTCENTERID WHERE (((product.FENDINITKEY = '1' AND acctg.FDIMENSIONID = @FDIMEID) AND (product.FACCTGID >= @FSTARTACCTGID)) AND (product.FACCTGID <= @FENDACCTGID)) GROUP BY productDime.FPRODUCTID, COSTM.FMATERIALID, COSTM.FEXPTYPE, COSTMD.FCOSTITEMID, COSTMD.FEXPENSESITEMID UNION ALL SELECT productDime.FPRODUCTID fproductid, COSTM.FMATERIALID, COSTM.FEXPTYPE, COSTMD.FCOSTITEMID, COSTMD.FEXPENSESITEMID fexpenseitemid, 0 fcurrcostamount, (SUM(COSTMD.FQUALIFIEDINAMOUNT) + SUM(COSTMD.FDYSINAMOUNT) + SUM(COSTMD.FWASTEINAMOUNT)) fdiffcostamount FROM T_CB_PROORDERINFO_H product INNER JOIN T_CB_PROORDERDIME productDime ON product.FProductDimeId = productDime.FProductDimeId INNER JOIN T_HS_OUTACCTG acctg ON product.FACCTGID = acctg.FId INNER JOIN T_CB_CostMatterial_H COSTM ON product.FID = COSTM.FID INNER JOIN T_CB_CostMatterialDetail_H COSTMD ON COSTM.FENTRYID = COSTMD.FENTRYID INNER JOIN T_BD_MATERIAL MAT ON MAT.FMATERIALID = productDime.FPRODUCTID LEFT OUTER JOIN T_CB_COSTCENTER CC ON CC.FCOSTCENTERID = productDime.FCOSTCENTERID WHERE (((product.FENDINITKEY = '1' AND acctg.FDIMENSIONID = @FDIMEID1) AND (product.FACCTGID >= @FSTARTACCTGID1)) AND (product.FACCTGID <= @FENDACCTGID1)) GROUP BY productDime.FPRODUCTID, COSTM.FMATERIALID, COSTM.FEXPTYPE, COSTMD.FCOSTITEMID, COSTMD.FEXPENSESITEMID) tmp INNER JOIN T_BD_MATERIALBASE baseunit ON baseunit.FMaterialId = TMP.FPRODUCTID INNER JOIN T_BD_CURRENCY CURR ON CURR.FCURRENCYID = 1 WHERE (((TMP.FCURRCOSTAMOUNT <> 0) OR (TMP.FDIFFCOSTAMOUNT <> 0)) AND NOT EXISTS (SELECT 1 FROM #TM_CB_PRORESTORECOSTDIFF df WHERE (df.FNeedRestore = 1 AND df.FMATERIALID = TMP.FMATERIALID))) GROUP BY TMP.FPRODUCTID, baseunit.FBaseUnitId, TMP.FMATERIALID, TMP.FEXPTYPE, TMP.FCOSTITEMID, TMP.FEXPENSEITEMID, CURR.FPRICEDIGITS
Server stack trace:
在 Kingdee.BOS.App.Data.AbstractDatabase.ExecuteNonQuery(DbCommand command, IEnumerable`1 listParam)
在 Kingdee.BOS.App.Data.DBUtils.ExecuteBatchWithTime(Context ctx, List`1 lstSqlObj, Int32 commandTimeout)
在 Kingdee.K3.FIN.CB.App.Report.ProductRestoreCostDiffRpt.InsertTempSubExpenseDataForNoNeedRestore(String strTempTable, String strProductRangeTable)
在 Kingdee.K3.FIN.CB.App.Report.ProductRestoreCostDiffRpt.BuilderReportSqlAndTempTable(IRptParams filter, String tableName)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.CreateTempTable(IRptParams filter, String tablename)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetDataForVirtual(IRptParams filter)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetData(IRptParams filter)
在 Kingdee.BOS.App.Core.PlugInProxy.SysReportServicePlugInProxy.GetReportData(ReportServiceParameter parameter)
在 Kingdee.BOS.App.Core.SysReportService.GetReportData(ReportServiceParameter parameter)
Exception rethrown at [0]:
在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
在 Kingdee.BOS.Contracts.ISysReportService.GetReportData(ReportServiceParameter parameter)
在 Kingdee.BOS.ServiceHelper.SysReportServiceHelper.GetReportData(ReportServiceParameter parameter)
在 Kingdee.BOS.Model.Report.SysReportModel.GetData(Int32 start, Int32 rows)
在 Kingdee.BOS.Web.Report.SysReportView.GetListData()
在 Kingdee.BOS.Web.Report.SysReportView.<>c__DisplayClass55.b__51()
INSERT INTO #TM_CB_PRORESTORECOSTDIFF (FPRODUCTID, FBASICUNITID, FCOSTITEMID, FMATERIALID, FEXPENSEITEMID, FCURRUSEDHOUR, FCURRPRICE, FCURRCOSTAMOUNT, FCURRAMOUNT, FDIFFUSEDHOUR, FDIFFPRICE, FDIFFCOSTAMOUNT, FDIFFAMOUNT, FQUANTITYDIFF, FPRICEDIFF, FTOTALDIFFAMOUNT, FQTYDIGITS, FPRICEDIGITS, FAMOUNTDIGITS, FEXPTYPE, FLINEDATATYPE, FIDENTITYID, FSELECTTYPE) SELECT TMP.FPRODUCTID, baseunit.FBaseUnitId, TMP.FCOSTITEMID, TMP.FMATERIALID, TMP.FEXPENSEITEMID, 0 fcurrusedhour, 0 fcurrprice, SUM(TMP.FCURRCOSTAMOUNT) fcurrcostamount, SUM(TMP.FCURRCOSTAMOUNT) fcurramount, 0 fdiffusedhour, 0 fdiffprice, SUM(TMP.FDIFFCOSTAMOUNT) fdiffcostamount, SUM(TMP.FDIFFCOSTAMOUNT) fdiffamount, 0 fquantitydiff, 0 fpricediff, (SUM(TMP.FCURRCOSTAMOUNT) - SUM(TMP.FDIFFCOSTAMOUNT)) ftotaldiffamount, CURR.FPRICEDIGITS fqtydigits, CURR.FPRICEDIGITS, 10 famountdigits, TMP.FEXPTYPE, 10 flinedatatype, ROW_NUMBER() OVER( ORDER BY FPRODUCTID ASC) fidentityid, 0 fselecttype FROM (SELECT productDime.FPRODUCTID fproductid, COSTM.FMATERIALID, COSTM.FEXPTYPE, COSTMD.FCOSTITEMID, COSTMD.FEXPENSESITEMID fexpenseitemid, (SUM(COSTMD.FQUALIFIEDINAMOUNT) + SUM(COSTMD.FDYSINAMOUNT) + SUM(COSTMD.FWASTEINAMOUNT)) fcurrcostamount, 0 fdiffcostamount FROM T_CB_PROORDERINFO_H product INNER JOIN T_CB_PROORDERDIME productDime ON product.FProductDimeId = productDime.FProductDimeId INNER JOIN T_HS_OUTACCTG acctg ON product.FACCTGID = acctg.FId INNER JOIN T_CB_CostMatterial_H COSTM ON product.FID = COSTM.FID INNER JOIN T_CB_CostMatterialDetail_H COSTMD ON COSTM.FENTRYID = COSTMD.FENTRYID INNER JOIN T_BD_MATERIAL MAT ON MAT.FMATERIALID = productDime.FPRODUCTID LEFT OUTER JOIN T_CB_COSTCENTER CC ON CC.FCOSTCENTERID = productDime.FCOSTCENTERID WHERE (((product.FENDINITKEY = '1' AND acctg.FDIMENSIONID = @FDIMEID) AND (product.FACCTGID >= @FSTARTACCTGID)) AND (product.FACCTGID <= @FENDACCTGID)) GROUP BY productDime.FPRODUCTID, COSTM.FMATERIALID, COSTM.FEXPTYPE, COSTMD.FCOSTITEMID, COSTMD.FEXPENSESITEMID UNION ALL SELECT productDime.FPRODUCTID fproductid, COSTM.FMATERIALID, COSTM.FEXPTYPE, COSTMD.FCOSTITEMID, COSTMD.FEXPENSESITEMID fexpenseitemid, 0 fcurrcostamount, (SUM(COSTMD.FQUALIFIEDINAMOUNT) + SUM(COSTMD.FDYSINAMOUNT) + SUM(COSTMD.FWASTEINAMOUNT)) fdiffcostamount FROM T_CB_PROORDERINFO_H product INNER JOIN T_CB_PROORDERDIME productDime ON product.FProductDimeId = productDime.FProductDimeId INNER JOIN T_HS_OUTACCTG acctg ON product.FACCTGID = acctg.FId INNER JOIN T_CB_CostMatterial_H COSTM ON product.FID = COSTM.FID INNER JOIN T_CB_CostMatterialDetail_H COSTMD ON COSTM.FENTRYID = COSTMD.FENTRYID INNER JOIN T_BD_MATERIAL MAT ON MAT.FMATERIALID = productDime.FPRODUCTID LEFT OUTER JOIN T_CB_COSTCENTER CC ON CC.FCOSTCENTERID = productDime.FCOSTCENTERID WHERE (((product.FENDINITKEY = '1' AND acctg.FDIMENSIONID = @FDIMEID1) AND (product.FACCTGID >= @FSTARTACCTGID1)) AND (product.FACCTGID <= @FENDACCTGID1)) GROUP BY productDime.FPRODUCTID, COSTM.FMATERIALID, COSTM.FEXPTYPE, COSTMD.FCOSTITEMID, COSTMD.FEXPENSESITEMID) tmp INNER JOIN T_BD_MATERIALBASE baseunit ON baseunit.FMaterialId = TMP.FPRODUCTID INNER JOIN T_BD_CURRENCY CURR ON CURR.FCURRENCYID = 1 WHERE (((TMP.FCURRCOSTAMOUNT <> 0) OR (TMP.FDIFFCOSTAMOUNT <> 0)) AND NOT EXISTS (SELECT 1 FROM #TM_CB_PRORESTORECOSTDIFF df WHERE (df.FNeedRestore = 1 AND df.FMATERIALID = TMP.FMATERIALID))) GROUP BY TMP.FPRODUCTID, baseunit.FBaseUnitId, TMP.FMATERIALID, TMP.FEXPTYPE, TMP.FCOSTITEMID, TMP.FEXPENSEITEMID, CURR.FPRICEDIGITS
Server stack trace:
在 Kingdee.BOS.App.Data.AbstractDatabase.ExecuteNonQuery(DbCommand command, IEnumerable`1 listParam)
在 Kingdee.BOS.App.Data.DBUtils.ExecuteBatchWithTime(Context ctx, List`1 lstSqlObj, Int32 commandTimeout)
在 Kingdee.K3.FIN.CB.App.Report.ProductRestoreCostDiffRpt.InsertTempSubExpenseDataForNoNeedRestore(String strTempTable, String strProductRangeTable)
在 Kingdee.K3.FIN.CB.App.Report.ProductRestoreCostDiffRpt.BuilderReportSqlAndTempTable(IRptParams filter, String tableName)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.CreateTempTable(IRptParams filter, String tablename)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetDataForVirtual(IRptParams filter)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetData(IRptParams filter)
在 Kingdee.BOS.App.Core.PlugInProxy.SysReportServicePlugInProxy.GetReportData(ReportServiceParameter parameter)
在 Kingdee.BOS.App.Core.SysReportService.GetReportData(ReportServiceParameter parameter)
Exception rethrown at [0]:
在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
在 Kingdee.BOS.Contracts.ISysReportService.GetReportData(ReportServiceParameter parameter)
在 Kingdee.BOS.ServiceHelper.SysReportServiceHelper.GetReportData(ReportServiceParameter parameter)
在 Kingdee.BOS.Model.Report.SysReportModel.GetData(Int32 start, Int32 rows)
在 Kingdee.BOS.Web.Report.SysReportView.GetListData()
在 Kingdee.BOS.Web.Report.SysReportView.<>c__DisplayClass55.
TIM图片20171127104307.png(6.66KB)
推荐阅读