2025-03-14 10:00:24 +08:00
|
|
|
|
using Kingdee.BOS.App.Data;
|
|
|
|
|
using Kingdee.BOS;
|
|
|
|
|
using Kingdee.BOS.Contracts.Report;
|
|
|
|
|
using Kingdee.BOS.Core.Report;
|
|
|
|
|
using Kingdee.BOS.Util;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Kingdee.BOS.Orm.DataEntity;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using Pilot.Report.Exploitation.PublicClass;
|
2025-03-14 19:50:18 +08:00
|
|
|
|
using Pilot.Report.Exploitation.Common;
|
2025-03-14 10:00:24 +08:00
|
|
|
|
|
|
|
|
|
namespace Pilot.Report.Exploitation.ResultsKanbanSummary
|
|
|
|
|
{
|
|
|
|
|
[Description("【列表插件】绩效看板汇总报表【报表】"), HotUpdate]
|
|
|
|
|
public class ResultsKanbanSumReport: SysReportBaseService
|
|
|
|
|
{
|
|
|
|
|
private string tableNameView = EnvironmentTEST.tableNameView_TEST;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 初始化
|
|
|
|
|
/// </summary>
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
base.Initialize();
|
|
|
|
|
this.ReportProperty.ReportName = new LocaleValue("绩效看板汇总", base.Context.UserLocale.LCID);
|
|
|
|
|
this.ReportProperty.IsUIDesignerColumns = false;
|
|
|
|
|
// 简单账表类型:普通、树形、分页
|
|
|
|
|
this.ReportProperty.ReportType = ReportType.REPORTTYPE_NORMAL;
|
|
|
|
|
this.IsCreateTempTableByPlugin = true;
|
|
|
|
|
//
|
|
|
|
|
this.IsCreateTempTableByPlugin = true;
|
|
|
|
|
//
|
|
|
|
|
this.ReportProperty.IsGroupSummary = true;
|
|
|
|
|
//
|
|
|
|
|
this.ReportProperty.SimpleAllCols = false;
|
|
|
|
|
//
|
|
|
|
|
this.ReportProperty.IsDefaultOnlyDspSumAndDetailData = true;
|
|
|
|
|
|
|
|
|
|
// 设置精度控制
|
|
|
|
|
var list = new List<DecimalControlField>
|
|
|
|
|
{
|
|
|
|
|
new DecimalControlField("FDECIMALS", "OrigInvoiceAmount"),
|
|
|
|
|
new DecimalControlField("FDECIMALS", "ExchangeRate"),
|
|
|
|
|
new DecimalControlField("FDECIMALS", "InvoiceAmountTHB"),
|
|
|
|
|
new DecimalControlField("FDECIMALS", "MonthEndExRate"),
|
|
|
|
|
new DecimalControlField("FDECIMALS", "RevaluationAountInTHB"),
|
|
|
|
|
new DecimalControlField("FDECIMALS", "UnrealizedGainLoss"),
|
|
|
|
|
};
|
|
|
|
|
this.ReportProperty.DecimalControlFieldList = list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 报表列表头
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="filter"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public override ReportHeader GetReportHeaders(IRptParams filter)
|
|
|
|
|
{
|
|
|
|
|
DynamicObject customFilter = filter.FilterParameter.CustomFilter;
|
|
|
|
|
|
|
|
|
|
base.GetReportHeaders(filter);
|
|
|
|
|
|
|
|
|
|
ReportHeader header = new ReportHeader();
|
|
|
|
|
|
|
|
|
|
// 下单时间
|
2025-03-20 11:55:59 +08:00
|
|
|
|
string fDate = customFilter["FSDate"]?.ToString();
|
2025-03-14 10:00:24 +08:00
|
|
|
|
|
|
|
|
|
int year = Convert.ToInt32(fDate.Split('-')[0]);
|
|
|
|
|
|
2025-03-20 11:55:59 +08:00
|
|
|
|
header.AddChild("F_SBU", new LocaleValue("SBU"), SqlStorageType.Sqlvarchar);
|
|
|
|
|
header.AddChild("F_MXQY", new LocaleValue("明细区域"), SqlStorageType.Sqlvarchar);
|
2025-03-19 18:36:07 +08:00
|
|
|
|
header.AddChild("销售员", new LocaleValue("销售员"), SqlStorageType.Sqlvarchar);
|
|
|
|
|
header.AddChild("本年业绩目标_万元", new LocaleValue(""+year+"年业绩目标(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
header.AddChild("本年派诺业绩_万元", new LocaleValue(""+year+ "派诺业绩(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
header.AddChild("本年兴诺业绩_万元", new LocaleValue(""+year+ "兴诺业绩(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
header.AddChild("本年武汉派诺_万元", new LocaleValue(""+year+ "武汉派诺(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
header.AddChild("本年碳索业绩_万元", new LocaleValue(""+year+ "碳索业绩(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
header.AddChild("本年香港派诺业绩_万元", new LocaleValue(""+year+ "香港派诺业绩(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
header.AddChild("本年华夏云联业绩_万元", new LocaleValue(""+year+ "华夏云联业绩(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
header.AddChild("往年订单变更金额_万元", new LocaleValue("往年订单变更金额(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
header.AddChild("本年业绩合计_万元", new LocaleValue(""+year+ "合计业绩额(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
header.AddChild("达标率", new LocaleValue("达标率"), SqlStorageType.Sqlvarchar);
|
|
|
|
|
header.AddChild("去年合计业绩额_万元", new LocaleValue(""+(year-1)+ "合计业绩额(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
header.AddChild("同比增长率", new LocaleValue("同比增长率"), SqlStorageType.Sqlvarchar);
|
|
|
|
|
header.AddChild("本年回款目标_万元", new LocaleValue(""+year+"回款目标(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
header.AddChild("回款额_万元", new LocaleValue("回款额(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
header.AddChild("回款率", new LocaleValue("回款率"), SqlStorageType.Sqlvarchar);
|
|
|
|
|
header.AddChild("已发货应收款_万元", new LocaleValue("已发货应收款(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
header.AddChild("已到期应收款_万元", new LocaleValue("已到期应收款(万元)"), SqlStorageType.SqlDecimal);
|
|
|
|
|
|
2025-03-14 10:00:24 +08:00
|
|
|
|
foreach (var item in header.GetChilds())
|
|
|
|
|
{
|
|
|
|
|
item.Width = 160;
|
|
|
|
|
}
|
|
|
|
|
return header;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示报表数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="filter"></param>
|
|
|
|
|
/// <param name="tableName"></param>
|
|
|
|
|
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
|
|
|
|
|
{
|
|
|
|
|
DynamicObject customFilter = filter.FilterParameter.CustomFilter;
|
|
|
|
|
|
2025-03-20 11:55:59 +08:00
|
|
|
|
DynamicObject dynamic = customFilter["F_Salesperson"] as DynamicObject;
|
2025-03-14 10:00:24 +08:00
|
|
|
|
|
|
|
|
|
// 开始日期
|
2025-03-20 11:55:59 +08:00
|
|
|
|
string fStrartDate = Convert.ToString(customFilter["FSDate"]);
|
2025-03-14 10:00:24 +08:00
|
|
|
|
|
|
|
|
|
// 结束日期
|
2025-03-20 11:55:59 +08:00
|
|
|
|
string fEndDate = Convert.ToString(customFilter["FEDate"]);
|
2025-03-14 10:00:24 +08:00
|
|
|
|
|
|
|
|
|
base.BuilderReportSqlAndTempTable(filter, tableName);
|
|
|
|
|
|
2025-03-20 11:55:59 +08:00
|
|
|
|
string sql = string.Format(@"/*dialect*/
|
|
|
|
|
EXEC GZ_JXKBHZB_LTH '{0}','{1}'
|
|
|
|
|
SELECT
|
|
|
|
|
ROW_NUMBER() OVER (ORDER BY F_SBU DESC) AS FID,
|
|
|
|
|
ROW_NUMBER() OVER (ORDER BY F_SBU DESC) AS FIDENTITYID,
|
|
|
|
|
* INTO {2} FROM JXKBHZB
|
|
|
|
|
", fStrartDate,fEndDate,tableName);
|
2025-03-14 10:00:24 +08:00
|
|
|
|
DBUtils.Execute(this.Context, sql);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|