王 垚
2020-12-31 f8eaad3fa2ffcae47ff149cd7a826c8983a69b00
src/BLL/Demo.Report/PRD/prd_ExtractionPlanDetail.cs
@@ -23,6 +23,7 @@
    /// </summary>
    public class prd_ExtractionPlanDetail : SysReportBaseService
    {
        string date = "";
        //初始化
        public override void Initialize()
        {
@@ -108,17 +109,27 @@
        public override ReportHeader GetReportHeaders(IRptParams filter)
        {
            ReportHeader header = new ReportHeader();
            ReportHeader headerch = new ReportHeader();
            header.AddChild("FRogNUMBER", new LocaleValue("供应商信息&采购组织", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
            header.AddChild("FNAME", new LocaleValue("供应商信息&供应商", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
            header.AddChild("FNUMBER", new LocaleValue("供应商信息&物料", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
            DataSet ds = DBServiceHelper.ExecuteDataSet(Context, "/*dialect*/select distinct convert(nvarchar(50),FHDATE,111) FHDATE from Cg_PODemandPlanBillMain ");
            header.AddChild("FNUMBER", new LocaleValue("物料信息&物料", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
            header.AddChild("FMATERIALNAME", new LocaleValue("物料信息&物料名称", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
            header.AddChild("FSPECIFICATION", new LocaleValue("物料信息&物料规格", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
            header.AddChild("FBASEUNIT", new LocaleValue("物料信息&单位", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
            header.AddChild("FPROUNIT", new LocaleValue("物料信息&计量单位", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
            header.AddChild("FQTY", new LocaleValue("物料信息&库存数量", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
            header.AddChild("FTRANSITQTY", new LocaleValue("物料信息&在途数量", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
            //header.AddChild("FNUMBER", new LocaleValue("拖期明细&拖期数量", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
            //header.AddChild("FNUMBER", new LocaleValue("计划明细&合计", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar);
            DataSet ds = DBServiceHelper.ExecuteDataSet(Context, "/*dialect*/select distinct convert(nvarchar(50),FHDATE,111) FHDATE from Cg_PODemandPlanBillMain");
            DataTable dt = ds.Tables[0];
            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    header.AddChild(dr[0].ToString(), new LocaleValue("日期&" + dr[0].ToString() + "", this.Context.UserLocale.LCID), SqlStorageType.SqlDecimal);
                    header.AddChild(dr[0].ToString(), new LocaleValue("计划明细&" + dr[0].ToString() + "", this.Context.UserLocale.LCID), SqlStorageType.SqlDecimal);
                }
            }
            return header;
@@ -149,6 +160,7 @@
            string startValue = (customFilter["FBeginConveyDate"] == null) ? string.Empty : Convert.ToDateTime(customFilter["FBeginConveyDate"]).ToString("yyyy/MM/d");
            string endValue = (customFilter["FEndConveyDate"] == null) ? string.Empty : Convert.ToDateTime(customFilter["FEndConveyDate"]).ToString("yyyy/MM/d");
            strwhere.AppendLine(string.Format(" AND FHDate>=''{0}'' and FHDate<=''{1}'' ", startValue, endValue));
            date = string.Format("  FHDate>=''{0}'' and FHDate<=''{1}'' ", startValue, endValue);
            //物料
            var baseDataNameValue = customFilter["FMATERIALID"];
            string MaterailName = baseDataNameValue == null
@@ -161,7 +173,7 @@
            //供应商
            var baseSuppName = customFilter["FSUPPLIERID"];
            string SuppName = baseSuppName == null
                ? " " : string.Format(" AND a.FSUPPLIERID IN ({0}) ", (customFilter["FSUPPLIERID"] as DynamicObject)["Id"].ToString());
                ? " " : string.Format(" AND a.FSUPPLIERID IN ({0}) ", (customFilter["FSUPPLIERID"] as DynamicObject)["Id"].ToString());
            strwhere.AppendLine(SuppName);
            string text2 = string.IsNullOrWhiteSpace(filter.FilterParameter.FilterString) ? " " : " AND " + filter.FilterParameter.FilterString.Replace("{ts", "").Replace("}", "");
            strwhere.AppendLine(text2);