diff --git a/Pilot.Report.Exploitation/Pilot.Report.Exploitation.csproj b/Pilot.Report.Exploitation/Pilot.Report.Exploitation.csproj index 2786c60..788d8bf 100644 --- a/Pilot.Report.Exploitation/Pilot.Report.Exploitation.csproj +++ b/Pilot.Report.Exploitation/Pilot.Report.Exploitation.csproj @@ -188,11 +188,9 @@ - - diff --git a/Pilot.Report.Exploitation/ResultsKanbanSummary/ResultsKanbanSumReport.cs b/Pilot.Report.Exploitation/ResultsKanbanSummary/ResultsKanbanSumReport.cs index c3b2f36..ace1435 100644 --- a/Pilot.Report.Exploitation/ResultsKanbanSummary/ResultsKanbanSumReport.cs +++ b/Pilot.Report.Exploitation/ResultsKanbanSummary/ResultsKanbanSumReport.cs @@ -38,8 +38,6 @@ namespace Pilot.Report.Exploitation.ResultsKanbanSummary this.ReportProperty.IsGroupSummary = true; // this.ReportProperty.SimpleAllCols = false; - // 单据主键:两行FID相同,则为同一单的两条分录,单据编号可以不重复显示 - this.ReportProperty.PrimaryKeyFieldName = "FID"; // this.ReportProperty.IsDefaultOnlyDspSumAndDetailData = true; @@ -70,14 +68,12 @@ namespace Pilot.Report.Exploitation.ResultsKanbanSummary ReportHeader header = new ReportHeader(); // 下单时间 - string fDate = customFilter["F_Date"]?.ToString(); + string fDate = customFilter["FSDate"]?.ToString(); int year = Convert.ToInt32(fDate.Split('-')[0]); - //int year = 2011; - //header.AddChild("ID", new LocaleValue("序号"), SqlStorageType.Sqlvarchar); - header.AddChild("SBU", new LocaleValue("SBU"), SqlStorageType.Sqlvarchar); - header.AddChild("明细区域", new LocaleValue("明细区域"), SqlStorageType.Sqlvarchar); + header.AddChild("F_SBU", new LocaleValue("SBU"), SqlStorageType.Sqlvarchar); + header.AddChild("F_MXQY", new LocaleValue("明细区域"), SqlStorageType.Sqlvarchar); header.AddChild("销售员", new LocaleValue("销售员"), SqlStorageType.Sqlvarchar); header.AddChild("本年业绩目标_万元", new LocaleValue(""+year+"年业绩目标(万元)"), SqlStorageType.SqlDecimal); header.AddChild("本年派诺业绩_万元", new LocaleValue(""+year+ "派诺业绩(万元)"), SqlStorageType.SqlDecimal); @@ -113,34 +109,23 @@ namespace Pilot.Report.Exploitation.ResultsKanbanSummary { DynamicObject customFilter = filter.FilterParameter.CustomFilter; - // 销售员列表 - var salesperson = (customFilter["F_Salesperson"] as DynamicObjectCollection)?.Select(n => (n["F_Salesperson"] as DynamicObject)["msterID"].ToString()).ToList(); - - // 销售员 - var salespersonString = salesperson == null ? "" : string.Join(",", salesperson); - - // 组织列表 - var organizationList = (customFilter["FZuZhi"] as DynamicObjectCollection)?.Select(n => (n["FZuZhi"] as DynamicObject)["ID"].ToString()).ToList(); - - // 组织 - var organization = organizationList == null ? "" : (string.Join(",", organizationList)); + DynamicObject dynamic = customFilter["F_Salesperson"] as DynamicObject; // 开始日期 - string fStrartDate = customFilter["FSDate"]?.ToString(); + string fStrartDate = Convert.ToString(customFilter["FSDate"]); // 结束日期 - string fEndDate = customFilter["FEDate"]?.ToString(); + string fEndDate = Convert.ToString(customFilter["FEDate"]); base.BuilderReportSqlAndTempTable(filter, tableName); - string sql = string.Format("EXEC GZ_JXKBHZB_LTH '{0}','{1}' " + - "SELECT" + - "ROW_NUMBER() OVER (ORDER BY SBU DESC) AS FID," + - "ROW_NUMBER() OVER (ORDER BY SBU DESC) AS FIDENTITYID," + - " * INTO {2} FROM JXKBHZB", fStrartDate,fEndDate,tableName); - - Loghelp.Log("BuilderReportSqlAndTempTable"); - Loghelp.Log(sql); + 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); DBUtils.Execute(this.Context, sql); } diff --git a/Pilot.Report.Exploitation/ResultsKanbanSummary/ResultsReportServicePlugIn.cs b/Pilot.Report.Exploitation/ResultsKanbanSummary/ResultsReportServicePlugIn.cs deleted file mode 100644 index 41e6d03..0000000 --- a/Pilot.Report.Exploitation/ResultsKanbanSummary/ResultsReportServicePlugIn.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Kingdee.BOS.Core.Metadata; -using Kingdee.BOS.Core.Report.PlugIn; -using Kingdee.BOS.Core.Report.PlugIn.Args; -using Kingdee.BOS.Util; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Pilot.Report.Exploitation.ResultsKanbanSummary -{ - [Description("【报表表单插件】绩效看板汇总报表插件"), HotUpdate] - public class ResultsReportServicePlugIn: AbstractSysReportPlugIn - { - List _rates = new string[] { "AttainmentRate", "SameGrowthRate", "PaymentRate" }.ToList(); - public override void FormatCellValue(FormatCellValueArgs args) - { - // 格式化日期 - base.FormatCellValue(args); - if (args.Header.ColType == Kingdee.BOS.SqlStorageType.SqlDatetime) - { - DateTime value = Convert.ToDateTime(args.FormateValue); - string afterValue = value.ToString("yyyy-MM-dd"); - args.FormateValue = afterValue; - } - // 格式化金额 汇率不格式化 - if (args.Header.ColType == Kingdee.BOS.SqlStorageType.SqlDecimal) - { - decimal value = decimal.Parse(args.FormateValue); - // 千分位 - string afterValue = value.ToString("N"); - args.FormateValue = afterValue; - } - if (args.Header.ColType == Kingdee.BOS.SqlStorageType.Sqlvarchar && _rates.Contains(args.Header.Key)) - { - decimal value = decimal.Parse(args.FormateValue); - // 不显示小数 - string afterValue = value.ToString("N") + "%"; // "F" 表示固定点格式,"0" 表示小数位数为0 - args.FormateValue = afterValue; - } - - } - public override void OnFormatRowConditions(ReportFormatConditionArgs args) - { - base.OnFormatRowConditions(args); - - //行背景色:FROWNO为偶数的行,背景色设为灰色 - if (Convert.ToInt32(args.DataRow["Sort"]) == 0 || Convert.ToInt32(args.DataRow["Sort"]) == 3) - { - FormatCondition FRow_FC = new FormatCondition() - { - BackColor = "#FCE4D6", - }; - args.FormatConditions.Add(FRow_FC); - } - } - } -}