a
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
using Kingdee.BOS.App;
|
||||
using Kingdee.BOS.App.Data;
|
||||
using Kingdee.BOS.Contracts;
|
||||
using Kingdee.BOS.Core.Report;
|
||||
using Kingdee.K3.SCM.App.Purchase.Report;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Trinomab.PUR_RPT_POOrderTrace
|
||||
{
|
||||
public class POOrderTraceServiceEx : POOrderTraceService
|
||||
{
|
||||
private string[] TempTableName;
|
||||
|
||||
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
|
||||
{
|
||||
//创建临时表用于保存自己的数据
|
||||
IDBService dbservice = ServiceHelper.GetService<IDBService>();
|
||||
TempTableName = dbservice.CreateTemporaryTableName(this.Context, 1);
|
||||
string strTable = TempTableName[0];
|
||||
|
||||
//调用基类方式获取初步查询数据
|
||||
base.BuilderReportSqlAndTempTable(filter, strTable);
|
||||
|
||||
string strSql = $@"/*dialect*/
|
||||
SELECT
|
||||
A.*
|
||||
,BE.F_ORA_TEXT2 AS FAPPLYDEPTID
|
||||
INTO {tableName}
|
||||
FROM
|
||||
{strTable} A
|
||||
LEFT JOIN t_PUR_POOrder B ON A.FID = B.FID AND A.FBILLNO = B.FBILLNO
|
||||
LEFT JOIN t_PUR_POOrderEntry BE ON A.FID = B.FID AND BE.FENTRYID = A.FENTRYID
|
||||
";
|
||||
|
||||
DBUtils.Execute(this.Context, strSql);
|
||||
}
|
||||
|
||||
public override void CloseReport()
|
||||
{
|
||||
//删除临时表
|
||||
if (TempTableName == null || TempTableName.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IDBService dbservice = ServiceHelper.GetService<IDBService>();
|
||||
|
||||
dbservice.DeleteTemporaryTableName(this.Context, TempTableName);
|
||||
|
||||
|
||||
base.CloseReport();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user