From 1998f3a802df15de34030ea7deac62ed0b494e53 Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期日, 28 二月 2021 10:07:31 +0800
Subject: [PATCH] 报表
---
src/BLL/Demo.Report/PRD/prd_TimelinessRateReport.cs | 110 +++++++++++++++++++++++++++
src/BLL/Demo.Report/PRD/prd_CompleteSetRateReport.cs | 108 +++++++++++++++++++++++++++
2 files changed, 218 insertions(+), 0 deletions(-)
diff --git a/src/BLL/Demo.Report/PRD/prd_CompleteSetRateReport.cs b/src/BLL/Demo.Report/PRD/prd_CompleteSetRateReport.cs
new file mode 100644
index 0000000..6ee019c
--- /dev/null
+++ b/src/BLL/Demo.Report/PRD/prd_CompleteSetRateReport.cs
@@ -0,0 +1,108 @@
+锘縰sing Kingdee.BOS;
+using Kingdee.BOS.App.Data;
+using Kingdee.BOS.Contracts;
+using Kingdee.BOS.Contracts.Report;
+using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
+using Kingdee.BOS.Core.List;
+using Kingdee.BOS.Core.Report;
+using Kingdee.BOS.Orm.DataEntity;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Kingdee.BOS.ServiceHelper;
+using Kingdee.BOS.Util;
+using Newtonsoft.Json;
+using ZD.Cloud.Logger;
+
+namespace Demo.Report
+{
+ /// <summary>
+ /// 榻愬鐜囨姤琛�
+ /// </summary>
+ [Description("榻愬鐜囨姤琛�")]
+ [HotUpdate]
+ public class prd_ExtractionPlanDetail : SysReportBaseService
+ {
+
+ public override void Initialize()
+ {
+ //base.Initialize();
+ //this.ReportProperty.ReportType = ReportType.REPORTTYPE_NORMAL;
+ //this.ReportProperty.ReportName = new LocaleValue("渚涘簲鍟嗛�佹枡璁″垝鍒楄〃璁㈠崟", base.Context.UserLocale.LCID);
+ //this.ReportProperty.IsUIDesignerColumns = true;
+ //this.ReportProperty.IsGroupSummary = true;
+ //this.ReportProperty.SimpleAllCols = false;
+
+ base.Initialize();
+ // 绠�鍗曡处琛ㄧ被鍨嬶細鏅�氥�佹爲褰€�佸垎椤�
+ this.ReportProperty.ReportType = ReportType.REPORTTYPE_NORMAL;
+ this.IsCreateTempTableByPlugin = true;
+ //鍙栦唬鐮佷腑閰嶇疆鐨勫垪
+ this.ReportProperty.IsUIDesignerColumns = false;
+ //鏄惁鍒嗙粍姹囨��
+ this.ReportProperty.IsGroupSummary = true;
+
+
+
+ }
+
+ public override ReportHeader GetReportHeaders(IRptParams filter)
+ {
+ ReportHeader header = new ReportHeader();
+
+ header.AddChild("FROWID", new LocaleValue("搴忓彿"), SqlStorageType.Sqlvarchar).ColIndex = 0;
+ header.AddChild("FHDATE", new LocaleValue("鎻愭枡璁″垝鏃ユ湡"), SqlStorageType.Sqlvarchar).ColIndex = 1;
+ header.AddChild("FHSOURCEBILLNO", new LocaleValue("鐢熶骇璁㈠崟缂栧彿"), SqlStorageType.Sqlvarchar).ColIndex = 2;
+ //header.AddChild("Fcolumn3", new LocaleValue("鐢熶骇绾�"), SqlStorageType.Sqlvarchar).ColIndex = 3;
+ header.AddChild("FSUPPLIERNUMBER", new LocaleValue("渚涘簲鍟嗙紪鐮�"), SqlStorageType.Sqlvarchar).ColIndex = 4;
+ header.AddChild("FSUPPLIERNAME", new LocaleValue("渚涘簲鍟嗗悕绉�"), SqlStorageType.Sqlvarchar).ColIndex = 5;
+ //header.AddChild("Fcolumn6", new LocaleValue("浜у搧缂栫爜"), SqlStorageType.Sqlvarchar).ColIndex = 6;
+ //header.AddChild("Fcolumn7", new LocaleValue("浜у搧鍚嶇О"), SqlStorageType.Sqlvarchar).ColIndex = 7;
+ //header.AddChild("Fcolumn8", new LocaleValue("浜у搧瑙勬牸"), SqlStorageType.Sqlvarchar).ColIndex = 8;
+ header.AddChild("FMATERIALNUMBER", new LocaleValue("鍘熸潗鏂欑紪鐮�"), SqlStorageType.Sqlvarchar).ColIndex = 9;
+ header.AddChild("FMATERIALNAME", new LocaleValue("鍘熸潗鏂欏悕绉�"), SqlStorageType.Sqlvarchar).ColIndex = 10;
+ header.AddChild("FSPECIFICATION", new LocaleValue("鍘熸潗鏂欒鏍�"), SqlStorageType.Sqlvarchar).ColIndex = 11;
+ header.AddChild("FHQTY", new LocaleValue("璁㈠崟鏁伴噺")).ColIndex = 11;
+ header.AddChild("FREALQTY", new LocaleValue("瀹為檯鍒拌揣鏁伴噺")).ColIndex = 11;
+ header.AddChild("FRKDATE", new LocaleValue("瀹為檯鍒拌揣鏃堕棿"), SqlStorageType.Sqlvarchar).ColIndex = 12;
+
+ return header;
+ }
+
+ public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
+ {
+ base.BuilderReportSqlAndTempTable(filter, tableName);
+ DynamicObject customFil = filter.FilterParameter.CustomFilter;
+ string FDATE = ""; //鎻愭枡鏃ユ湡
+ string FProductLine = ""; //鐢熶骇绾�
+ string FMoBillNo = ""; //鐢熶骇璁㈠崟鍙�
+ string FMaterialID = ""; //鐗╂枡
+ string FSupplyID = ""; //渚涘簲鍟�
+
+ FDATE = customFil["FDATE"].ToString();
+ FMoBillNo = customFil["FMoBillNo"].ToString();
+ if (((DynamicObject)customFil["FMaterialID"]) != null)
+ {
+ FMaterialID = ((DynamicObject)customFil["FMaterialID"])["Id"].ToString();
+ }
+ if (((DynamicObject)customFil["FProductLine"]) != null)
+ {
+ FProductLine = ((DynamicObject)customFil["FProductLine"])["Id"].ToString();
+ }
+ if (((DynamicObject)customFil["FSupplyID"]) != null)
+ {
+ FSupplyID = ((DynamicObject)customFil["FSupplyID"])["Id"].ToString();
+ }
+ string sql = string.Format($"/*dialect*/ EXEC pr_TimelinessRateReport '{tableName}','{FDATE}','{FMoBillNo}','{FProductLine}','{FSupplyID}','{FMaterialID}'");
+ LogHelper.Info(sql);
+ DBUtils.Execute(this.Context, sql);
+ }
+ public override void CloseReport()
+ {
+
+ }
+ }
+}
diff --git a/src/BLL/Demo.Report/PRD/prd_TimelinessRateReport.cs b/src/BLL/Demo.Report/PRD/prd_TimelinessRateReport.cs
new file mode 100644
index 0000000..e5ff6f1
--- /dev/null
+++ b/src/BLL/Demo.Report/PRD/prd_TimelinessRateReport.cs
@@ -0,0 +1,110 @@
+锘縰sing Kingdee.BOS;
+using Kingdee.BOS.App.Data;
+using Kingdee.BOS.Contracts;
+using Kingdee.BOS.Contracts.Report;
+using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
+using Kingdee.BOS.Core.List;
+using Kingdee.BOS.Core.Report;
+using Kingdee.BOS.Orm.DataEntity;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Kingdee.BOS.ServiceHelper;
+using Kingdee.BOS.Util;
+using Newtonsoft.Json;
+using ZD.Cloud.Logger;
+
+namespace Demo.Report
+{
+ /// <summary>
+ /// 榻愬鐜囨姤琛�
+ /// </summary>
+ [Description("榻愬鐜囨姤琛�")]
+ [HotUpdate]
+ public class prd_TimelinessRateReport : SysReportBaseService
+ {
+
+ public override void Initialize()
+ {
+ //base.Initialize();
+ //this.ReportProperty.ReportType = ReportType.REPORTTYPE_NORMAL;
+ //this.ReportProperty.ReportName = new LocaleValue("渚涘簲鍟嗛�佹枡璁″垝鍒楄〃璁㈠崟", base.Context.UserLocale.LCID);
+ //this.ReportProperty.IsUIDesignerColumns = true;
+ //this.ReportProperty.IsGroupSummary = true;
+ //this.ReportProperty.SimpleAllCols = false;
+
+ base.Initialize();
+ // 绠�鍗曡处琛ㄧ被鍨嬶細鏅�氥�佹爲褰€�佸垎椤�
+ this.ReportProperty.ReportType = ReportType.REPORTTYPE_NORMAL;
+ this.IsCreateTempTableByPlugin = true;
+ //鍙栦唬鐮佷腑閰嶇疆鐨勫垪
+ this.ReportProperty.IsUIDesignerColumns = false;
+ //鏄惁鍒嗙粍姹囨��
+ this.ReportProperty.IsGroupSummary = true;
+ this.ReportProperty.PrimaryKeyFieldName = "FIDENTITYID";
+
+ }
+
+ public override ReportHeader GetReportHeaders(IRptParams filter)
+ {
+ ReportHeader header = new ReportHeader();
+
+ header.AddChild("FIDENTITYID", new LocaleValue("搴忓彿"), SqlStorageType.SqlInt).ColIndex = 1;
+ header.AddChild("FHDATE", new LocaleValue("鎻愭枡璁″垝鏃ユ湡", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar).ColIndex = 1;
+ header.AddChild("FHSOURCEBILLNO", new LocaleValue("鐢熶骇璁㈠崟缂栧彿", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar).ColIndex = 2;
+ header.AddChild("FSOURCENAME", new LocaleValue("鐢熶骇绾�"), SqlStorageType.Sqlvarchar).ColIndex = 3;
+ header.AddChild("FSUPPLIERNUMBER", new LocaleValue("渚涘簲鍟嗙紪鐮�", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar).ColIndex = 4;
+ header.AddChild("FSUPPLIERNAME", new LocaleValue("渚涘簲鍟嗗悕绉�", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar).ColIndex = 5;
+ header.AddChild("FMATERIALNUMBER2", new LocaleValue("浜у搧缂栫爜"), SqlStorageType.Sqlvarchar).ColIndex = 6;
+ header.AddChild("FMATERIALNAME2", new LocaleValue("浜у搧鍚嶇О"), SqlStorageType.Sqlvarchar).ColIndex = 7;
+ header.AddChild("FSPECIFICATION2", new LocaleValue("浜у搧瑙勬牸"), SqlStorageType.Sqlvarchar).ColIndex = 8;
+ header.AddChild("FMATERIALNUMBER", new LocaleValue("鍘熸潗鏂欑紪鐮�", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar).ColIndex = 9;
+ header.AddChild("FMATERIALNAME", new LocaleValue("鍘熸潗鏂欏悕绉�", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar).ColIndex = 10;
+ header.AddChild("FSPECIFICATION", new LocaleValue("鍘熸潗鏂欒鏍�", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar).ColIndex = 11;
+ header.AddChild("FHQTY", new LocaleValue("璁㈠崟鏁伴噺", this.Context.UserLocale.LCID),SqlStorageType.SqlDecimal).ColIndex = 11;
+ header.AddChild("FREALQTY", new LocaleValue("瀹為檯鍒拌揣鏁伴噺", this.Context.UserLocale.LCID), SqlStorageType.SqlDecimal).ColIndex = 11;
+ header.AddChild("FRKDATE", new LocaleValue("瀹為檯鍒拌揣鏃堕棿", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar).ColIndex = 12;
+ header.AddChild("FTYPE", new LocaleValue("绫诲瀷", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar).ColIndex = 12;
+ header.AddChild("FJSRATE", new LocaleValue("鍒拌揣鍙婃椂鐜�", this.Context.UserLocale.LCID), SqlStorageType.SqlDecimal).ColIndex = 12;
+
+ return header;
+ }
+
+ public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
+ {
+ base.BuilderReportSqlAndTempTable(filter, tableName);
+ DynamicObject customFil = filter.FilterParameter.CustomFilter;
+ string FDATE = ""; //鎻愭枡鏃ユ湡
+ string FProductLine = ""; //鐢熶骇绾�
+ string FMoBillNo = ""; //鐢熶骇璁㈠崟鍙�
+ string FMaterialID = ""; //鐗╂枡
+ string FSupplyID = ""; //渚涘簲鍟�
+
+ FDATE = customFil["FDATE"].ToString();
+ FMoBillNo = customFil["FMoBillNo"]?.ToString();
+
+ if (((DynamicObject)customFil["FMaterialID"]) != null)
+ {
+ FMaterialID = ((DynamicObject)customFil["FMaterialID"])["Id"].ToString();
+ }
+ if (((DynamicObject)customFil["FProductLine"]) != null)
+ {
+ FProductLine = ((DynamicObject)customFil["FProductLine"])["Id"].ToString();
+ }
+ if (((DynamicObject)customFil["FSupplyID"]) != null)
+ {
+ FSupplyID = ((DynamicObject)customFil["FSupplyID"])["Id"].ToString();
+ }
+ string sql = string.Format($"/*dialect*/ EXEC pr_TimelinessRateReport '{tableName}','{FDATE}','{FMoBillNo}','{FProductLine}','{FSupplyID}','{FMaterialID}'");
+ LogHelper.Info(sql);
+ DBUtils.Execute(this.Context, sql);
+ }
+ public override void CloseReport()
+ {
+
+ }
+ }
+}
--
Gitblit v1.9.1