产品成本还原对比分析表打不开
金蝶云社区-Marjore
Marjore
0人赞赏了该文章 1,042次浏览 未经作者许可,禁止转载编辑于2017年10月12日 23:11:49

cloud 7.0
产品成本还原对比分析表查询打不开,查询出现异常。尝试在数据库 2 中提取逻辑页 (1:232) 失败。该逻辑页属于分配单元 8574853705834364928,而非 5764607542000615424。

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, 0 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.FEXPENSESITEMID UNION ALL SELECT productDime.FPRODUCTID fproductid, COSTM.FMATERIALID, COSTM.FEXPTYPE, 0 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.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:
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.ProductRestoreCostDiffRpt.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__DisplayClass55.b__51()