2025-03-31 19:09:19 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Kingdee.BOS;
|
|
|
|
|
|
using Kingdee.BOS.App.Data;
|
|
|
|
|
|
using Kingdee.BOS.Contracts;
|
|
|
|
|
|
using Kingdee.BOS.Contracts.Report;
|
|
|
|
|
|
using Kingdee.BOS.Core.Metadata;
|
|
|
|
|
|
using Kingdee.BOS.Core.Report;
|
|
|
|
|
|
using Kingdee.BOS.Core.SqlBuilder;
|
|
|
|
|
|
using Kingdee.BOS.Orm.DataEntity;
|
|
|
|
|
|
using Kingdee.BOS.Util;
|
|
|
|
|
|
|
|
|
|
|
|
namespace GZ_LTHReportForms.YingShouBaoBiao
|
|
|
|
|
|
{
|
|
|
|
|
|
[Description("应收情况概况表按(签订年份)区分"), HotUpdate]
|
|
|
|
|
|
public class YingShouQDNF : SysReportBaseService
|
|
|
|
|
|
{
|
|
|
|
|
|
//对报表进行初始化
|
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
//设置报表类型为普通类型
|
|
|
|
|
|
this.ReportProperty.ReportType = ReportType.REPORTTYPE_NORMAL;
|
|
|
|
|
|
//设置是否通过插件创建临时表
|
|
|
|
|
|
this.IsCreateTempTableByPlugin = true;
|
|
|
|
|
|
//设置是否分组汇总
|
|
|
|
|
|
this.ReportProperty.IsGroupSummary = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
//设置单据列
|
|
|
|
|
|
public override ReportHeader GetReportHeaders(IRptParams filter)
|
|
|
|
|
|
{
|
2025-07-02 10:10:05 +08:00
|
|
|
|
DynamicObject customFilter = filter.FilterParameter.CustomFilter;
|
|
|
|
|
|
|
|
|
|
|
|
//当前时间格式化
|
|
|
|
|
|
string FEndDate = (customFilter["F_EDate"] == null) ? string.Empty : Convert.ToDateTime(
|
|
|
|
|
|
customFilter["F_EDate"]).ToString("yyyy年MM月");
|
|
|
|
|
|
|
|
|
|
|
|
//过去时间格式化
|
|
|
|
|
|
DateTime currentDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
DateTime lastYearDecember = new DateTime(currentDate.Year - 1, 12, 31);
|
|
|
|
|
|
|
|
|
|
|
|
string FLastDate = lastYearDecember.ToString("yyyy年MM月");
|
|
|
|
|
|
|
2025-03-31 19:09:19 +08:00
|
|
|
|
//创建表头对象
|
|
|
|
|
|
ReportHeader header = new ReportHeader();
|
|
|
|
|
|
header.AddChild("签订年份", new LocaleValue("签订年份", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
|
2025-07-02 10:10:05 +08:00
|
|
|
|
header.AddChild("期初到期应收款额", new LocaleValue(FEndDate + "到期应收款额", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
|
|
|
|
|
|
header.AddChild("本月到期应收款额", new LocaleValue(FLastDate + "到期应收款额", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
|
2025-03-31 19:09:19 +08:00
|
|
|
|
header.AddChild("占比", new LocaleValue("占比", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
|
|
|
|
|
|
header.AddChild("变化", new LocaleValue("变化", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
|
|
|
|
|
|
foreach (var item in header.GetChilds())
|
|
|
|
|
|
{
|
|
|
|
|
|
item.Width = 200;
|
|
|
|
|
|
}
|
|
|
|
|
|
return header;
|
|
|
|
|
|
}
|
|
|
|
|
|
//创建临时表
|
|
|
|
|
|
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
|
|
|
|
|
|
{
|
2025-04-15 11:11:33 +08:00
|
|
|
|
base.BuilderReportSqlAndTempTable (filter, tableName);
|
2025-03-31 19:09:19 +08:00
|
|
|
|
|
2025-07-02 10:10:05 +08:00
|
|
|
|
DynamicObject customFilter = filter.FilterParameter.CustomFilter;
|
2025-03-31 19:09:19 +08:00
|
|
|
|
|
2025-07-02 10:10:05 +08:00
|
|
|
|
//组织
|
|
|
|
|
|
var ZZ = (customFilter["F_YKQC_OrgId_uky"] as DynamicObject);
|
|
|
|
|
|
var ZZFID = string.Empty;
|
|
|
|
|
|
if (ZZ != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
ZZFID = ZZ["Id"]?.ToString();
|
|
|
|
|
|
}
|
2025-03-31 19:09:19 +08:00
|
|
|
|
|
2025-07-02 10:10:05 +08:00
|
|
|
|
//结束日期
|
|
|
|
|
|
string FEndDate = (customFilter["F_EDate"] == null) ? string.Empty : Convert.ToDateTime(
|
|
|
|
|
|
customFilter["F_EDate"]).ToString("yyyy-MM-dd");
|
2025-03-31 19:09:19 +08:00
|
|
|
|
|
2025-07-02 10:10:05 +08:00
|
|
|
|
string sql = string.Format(@"/*dialect*/
|
|
|
|
|
|
EXEC YSQKGKQDNF_GZTH '{0}','{1}'
|
|
|
|
|
|
SELECT
|
|
|
|
|
|
ROW_NUMBER() OVER (ORDER BY [签订年份] DESC) AS FID,
|
|
|
|
|
|
ROW_NUMBER() OVER (ORDER BY [签订年份] DESC) AS FIDENTITYID,
|
|
|
|
|
|
* INTO {2} FROM YSQKGK_QDNF_GZTH
|
|
|
|
|
|
",FEndDate,ZZFID, tableName);
|
2025-03-31 19:09:19 +08:00
|
|
|
|
//执行SQL并动态创建报表
|
|
|
|
|
|
DBUtils.ExecuteDynamicObject(this.Context, sql);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//添加合计列
|
|
|
|
|
|
public override List<SummaryField> GetSummaryColumnInfo(IRptParams filter)
|
|
|
|
|
|
{
|
|
|
|
|
|
var result = base.GetSummaryColumnInfo(filter);
|
2025-07-02 10:10:05 +08:00
|
|
|
|
result.Add(new SummaryField("期初到期应收款额", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
|
|
|
|
|
|
result.Add(new SummaryField("本月到期应收款额", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
|
2025-03-31 19:09:19 +08:00
|
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|