Files
GateDge2023_ljy/Kingdee.K3.SCM.Sal.Report.PlugInEx/SaleOutStockDetailRptEx.cs
PastSaid ddb5043b65 q
2023-12-26 10:44:19 +08:00

64 lines
1.9 KiB
C#

using Kingdee.BOS;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Contracts;
using Kingdee.BOS.Core.Report;
using Kingdee.BOS.Util;
using Kingdee.K3.SCM.App.Sal.Report;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Net;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace HW.App.Sal.Report.PlugInEx
{
[Description("销售出库明细报表数据源插件-扩展"), HotUpdate]
public class SaleOutStockDetailRptEx : SaleOutStockDetailRpt
{
private string[] TempTableName;
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
{
//创建临时表用于保存自己的数据
IDBService dbservice = Kingdee.BOS.App.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 FSALESCATEGORY
INTO {tableName}
FROM
{strTable} A
LEFT JOIN T_SAL_OUTSTOCK B ON A.FID = B.FID AND A.FBILLNUMBER = B.FBILLNO
LEFT JOIN T_SAL_OUTSTOCKENTRY 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 = Kingdee.BOS.App.ServiceHelper.GetService<IDBService>();
dbservice.DeleteTemporaryTableName(this.Context, TempTableName);
base.CloseReport();
}
}
}