private object[] LoadDataSource(bool isForCompare, bool roundDate)
        {
            string inputOutput  = UCWhereConditions1.UserSelectInputOutput;
            string byTimeType   = UCGroupConditions1.UserSelectByTimeType;
            string compareType  = UCGroupConditions1.UserSelectCompareType;
            string completeType = UCGroupConditions1.UserSelectCompleteType;

            if (!isForCompare)
            {
                compareType = string.Empty;
            }

            bool bigSSChecked = UCGroupConditions1.BigSSChecked;
            bool opResChecked = UCGroupConditions1.OPChecked || UCGroupConditions1.ResChecked;
            bool segSSChecked = UCGroupConditions1.SegChecked || UCGroupConditions1.SSChecked;

            string groupFieldsX = this.UCGroupConditions1.GetGroupFieldList(preferredTable, "X");
            string groupFieldsY = this.UCGroupConditions1.GetGroupFieldList(preferredTable, "Y");


            ReportSQLEngine engine = new ReportSQLEngine(this.DataProvider, this.languageComponent1);

            engine.DetailedCoreTable = GetCoreTableDetail();
            engine.Formular          = GetFormular();
            engine.WhereCondition    = this.UCWhereConditions1.GetWhereSQLStatement(preferredTable, byTimeType, roundDate, 0);

            engine.GroupFieldsX = groupFieldsX;
            engine.GroupFieldsY = groupFieldsY;

            return(engine.GetReportDataSource(byTimeType, 0));
        }
Ejemplo n.º 2
0
        private object[] LoadDataSource()
        {
            int  dateAdjust = 0;
            bool roundDate  = false;

            string byTimeType = UCGroupConditions1.UserSelectByTimeType;

            string groupFieldsX = this.UCGroupConditions1.GetGroupFieldList(preferredTable, "X");
            string groupFieldsY = this.UCGroupConditions1.GetGroupFieldList(preferredTable, "Y");

            ReportSQLHelper sqlHelper = new ReportSQLHelper(this.DataProvider);
            string          sql       = sqlHelper.GetPerformanceReportSQL(
                UCGroupConditions1.FacCodeChecked,
                UCGroupConditions1.FacCodeChecked || !UCGroupConditions1.SSChecked,
                UCGroupConditions1.ExcludeReworkOutputChecked,
                UCGroupConditions1.ExcludeLostManHourChecked,
                UCGroupConditions1.ShowIncludeIndirectManHour && UCGroupConditions1.IncludeIndirectManHourChecked,
                UCWhereConditions1.GetWhereSQLStatement(preferredTable, byTimeType, roundDate, dateAdjust),
                groupFieldsX,
                groupFieldsY,
                sqlHelper.GetFormularForManHourPerProduct(UCGroupConditions1.ExcludeLostManHourChecked, UCGroupConditions1.ShowIncludeIndirectManHour && UCGroupConditions1.IncludeIndirectManHourChecked)
                );


            ReportSQLEngine engine = new ReportSQLEngine(this.DataProvider, this.languageComponent1);

            return(engine.GetReportDataSource(sql, byTimeType, dateAdjust));
        }
Ejemplo n.º 3
0
        private object[] LoadDataSource(bool isForCompare, bool roundDate)
        {
            string byTimeType  = UCGroupConditions1.UserSelectByTimeType;
            string compareType = UCGroupConditions1.UserSelectCompareType;

            if (!isForCompare)
            {
                compareType = string.Empty;
            }

            string groupFieldsX = this.UCGroupConditions1.GetGroupFieldList(preferredTable, "X");
            string groupFieldsY = this.UCGroupConditions1.GetGroupFieldList(preferredTable, "Y");

            //用于环比同期比时的修改时间过滤条件
            int dateAdjust = 0;

            if (string.Compare(compareType, NewReportCompareType.LastYear, true) == 0)
            {
                dateAdjust = -12;
            }
            else if (string.Compare(compareType, NewReportCompareType.Previous, true) == 0)
            {
                dateAdjust = -1;
            }

            ReportSQLEngine engine = new ReportSQLEngine(this.DataProvider, this.languageComponent1);

            engine.DetailedCoreTable = GetCoreTableDetail();
            engine.Formular          = GetFormular(compareType);
            engine.WhereCondition    = this.UCWhereConditions1.GetWhereSQLStatement(preferredTable, byTimeType, roundDate, dateAdjust);
            engine.GroupFieldsX      = groupFieldsX;
            engine.GroupFieldsY      = groupFieldsY;

            return(engine.GetReportDataSource(byTimeType, dateAdjust));;
        }
        private object[] LoadDataSource()
        {
            string byTimeType = UCGroupConditions1.UserSelectByTimeType;

            string exceptionOrDuty = UCGroupConditions1.UserExceptionOrDuty;
            string dataField       = "ExceptionCode";

            if (exceptionOrDuty == NewReportExceptionOrDuty.Exception)
            {
                dataField = "ExceptionDesc";
            }
            else if (exceptionOrDuty == NewReportExceptionOrDuty.Duty)
            {
                dataField = "DutyDesc";
            }

            //内部SQL
            ReportSQLEngine engineInner = new ReportSQLEngine(this.DataProvider, this.languageComponent1);

            engineInner.DetailedCoreTable = GetCoreTableDetail();
            engineInner.Formular          = "SUM(lostmanhour) AS lostmanhour";
            engineInner.WhereCondition    = this.UCWhereConditions1.GetWhereSQLStatement(preferredTableInner, byTimeType, true, 0);
            engineInner.GroupFieldsX      = this.UCGroupConditions1.GetGroupFieldList(preferredTableInner, "X");
            engineInner.GroupFieldsY      = this.UCGroupConditions1.GetGroupFieldList(preferredTableInner, "Y");
            if (engineInner.GroupFieldsY.Trim().Length > 0)
            {
                engineInner.GroupFieldsY += ",";
            }
            engineInner.GroupFieldsY += dataField;


            //外部SQL
            string groupFields = string.Empty;

            groupFields += this.UCGroupConditions1.GetGroupFieldAliasList(preferredTable, "X");
            if (groupFields.IndexOf("dweek") == 0 || groupFields.IndexOf("dmonth") == 0)
            {
                groupFields += ",year";
            }
            groupFields += "," + dataField;
            string groupFieldsY = this.UCGroupConditions1.GetGroupFieldAliasList(preferredTable, "Y");

            if (groupFieldsY.Trim().Length > 0)
            {
                groupFields += "," + groupFieldsY;
            }

            ReportSQLEngine engine = new ReportSQLEngine(this.DataProvider, this.languageComponent1);

            engine.DetailedCoreTable = engineInner.GetReportSQL();
            engine.Formular          = groupFields + ",**.lostmanhour, **.lostmanhour / SUM(**.lostmanhour) OVER() AS lostmanhourpercent";
            engine.WhereCondition    = string.Empty;
            engine.GroupFieldsX      = string.Empty;
            engine.GroupFieldsY      = string.Empty;
            engine.OrderFields       = groupFields;

            return(engine.GetReportDataSource(byTimeType, 0));;
        }
        private object[] LoadDataSource()
        {
            string byTimeType = UCGroupConditions1.UserSelectByTimeType;

            string groupFieldsX = this.UCGroupConditions1.GetGroupFieldList(preferredTable, "X");
            string groupFieldsY = this.UCGroupConditions1.GetGroupFieldList(preferredTable, "Y");

            ReportSQLEngine engine = new ReportSQLEngine(this.DataProvider, this.languageComponent1);

            engine.DetailedCoreTable = GetDetailedCoreTable();
            engine.Formular          = GetFormular();
            engine.WhereCondition    = this.UCWhereConditions1.GetWhereSQLStatement(preferredTable, byTimeType, false, 0);
            engine.GroupFieldsX      = groupFieldsX;
            engine.GroupFieldsY      = groupFieldsY;

            return(engine.GetReportDataSource(byTimeType, 0));;
        }
Ejemplo n.º 6
0
        private object[] LoadDataSource(bool isForCompare, bool roundDate)
        {
            string inputOutput  = UCWhereConditions1.UserSelectInputOutput;
            string byTimeType   = UCGroupConditions1.UserSelectByTimeType;
            string compareType  = UCGroupConditions1.UserSelectCompareType;
            string completeType = UCGroupConditions1.UserSelectCompleteType;

            if (!isForCompare)
            {
                compareType = string.Empty;
            }

            bool bigSSChecked = UCGroupConditions1.BigSSChecked;
            bool opResChecked = UCGroupConditions1.OPChecked || UCGroupConditions1.ResChecked;
            bool segSSChecked = UCGroupConditions1.SegChecked || UCGroupConditions1.SSChecked;

            string groupFieldsX = this.UCGroupConditions1.GetGroupFieldList(preferredTable, "X");
            string groupFieldsY = this.UCGroupConditions1.GetGroupFieldList(preferredTable, "Y");

            //用于环比同期比时的修改时间过滤条件
            int dateAdjust = 0;

            if (string.Compare(compareType, NewReportCompareType.LastYear, true) == 0)
            {
                dateAdjust = -12;
            }
            else if (string.Compare(compareType, NewReportCompareType.Previous, true) == 0)
            {
                dateAdjust = -1;
            }

            ReportSQLEngine engine = new ReportSQLEngine(this.DataProvider, this.languageComponent1);

            engine.DetailedCoreTable = GetDetailedCoreTable();
            engine.Formular          = GetFormular(inputOutput, compareType, completeType, bigSSChecked, opResChecked, segSSChecked);
            engine.WhereCondition    = this.UCWhereConditions1.GetWhereSQLStatement(preferredTable, byTimeType, roundDate, dateAdjust);
            engine.HavingCondition   = GetHavingCondition(inputOutput, compareType, completeType, bigSSChecked, opResChecked, segSSChecked);
            engine.GroupFieldsX      = groupFieldsX;
            engine.GroupFieldsY      = groupFieldsY;

            return(engine.GetReportDataSource(byTimeType, dateAdjust));;
        }
        private object[] LoadDataSource(bool isForCompare, bool roundDate)
        {
            string inputOutput  = UCWhereConditions1.UserSelectInputOutput;
            string byTimeType   = UCGroupConditions1.UserSelectByTimeType;
            string compareType  = UCGroupConditions1.UserSelectCompareType;
            string completeType = UCGroupConditions1.UserSelectCompleteType;

            if (!isForCompare)
            {
                compareType = string.Empty;
            }

            //用于环比同期比时的修改时间过滤条件
            int dateAdjust = 0;

            if (string.Compare(compareType, NewReportCompareType.LastYear, true) == 0)
            {
                dateAdjust = -12;
            }
            else if (string.Compare(compareType, NewReportCompareType.Previous, true) == 0)
            {
                dateAdjust = -1;
            }

            bool bigSSChecked = UCGroupConditions1.BigSSChecked;
            bool opResChecked = UCGroupConditions1.OPChecked || UCGroupConditions1.ResChecked;
            bool segSSChecked = UCGroupConditions1.SegChecked || UCGroupConditions1.SSChecked;


            //内部SQL
            string groupFieldsYInner = this.UCGroupConditions1.GetGroupFieldList(preferredTableInner, "Y");

            if (groupFieldsYInner.Trim().Length > 0)
            {
                groupFieldsYInner += ",";
            }
            groupFieldsYInner += "**.ecsgcode";

            ReportSQLEngine engineInner = new ReportSQLEngine(this.DataProvider, this.languageComponent1);

            engineInner.DetailedCoreTable = GetCoreTableDetail();
            engineInner.Formular          = GetFormular(inputOutput, compareType, completeType, bigSSChecked, opResChecked, segSSChecked);
            engineInner.WhereCondition    = this.UCWhereConditions1.GetWhereSQLStatement(preferredTableInner, byTimeType, roundDate, dateAdjust);
            engineInner.GroupFieldsX      = string.Empty;;
            engineInner.GroupFieldsY      = groupFieldsYInner;


            //外部SQL
            string groupFields = string.Empty;

            groupFields += this.UCGroupConditions1.GetGroupFieldAliasList(preferredTable, "Y");
            if (groupFields.Trim().Length > 0)
            {
                groupFields += ",";
            }
            groupFields += "**.ecsgcode";

            ReportSQLEngine engine = new ReportSQLEngine(this.DataProvider, this.languageComponent1);

            engine.DetailedCoreTable = engineInner.GetReportSQL();
            engine.Formular          = groupFields + ",**.errorcount, **.errorcount / SUM(**.errorcount) OVER() AS errorpercent";
            engine.WhereCondition    = string.Empty;
            engine.GroupFieldsX      = string.Empty;
            engine.GroupFieldsY      = string.Empty;
            engine.OrderFields       = groupFields;

            return(engine.GetReportDataSource(byTimeType, dateAdjust));;
        }
Ejemplo n.º 8
0
        private object[] LoadDataSource(bool isForCompare, bool roundDate)
        {
            string inputOutput  = UCWhereConditions1.UserSelectInputOutput;
            string byTimeType   = UCGroupConditions1.UserSelectByTimeType;
            string compareType  = UCGroupConditions1.UserSelectCompareType;
            string completeType = UCGroupConditions1.UserSelectCompleteType;

            if (!isForCompare)
            {
                compareType = string.Empty;
            }

            //用于环比同期比时的修改时间过滤条件
            int dateAdjust = 0;

            if (string.Compare(compareType, NewReportCompareType.LastYear, true) == 0)
            {
                dateAdjust = -12;
            }
            else if (string.Compare(compareType, NewReportCompareType.Previous, true) == 0)
            {
                dateAdjust = -1;
            }

            bool bigSSChecked = UCGroupConditions1.BigSSChecked;
            bool opResChecked = UCGroupConditions1.OPChecked || UCGroupConditions1.ResChecked;
            bool segSSChecked = UCGroupConditions1.SegChecked || UCGroupConditions1.SSChecked;


            //拼内部SQL
            string groupFieldsXInner = this.UCGroupConditions1.GetGroupFieldList(preferredTableInner, "X");
            string groupFieldsYInner = this.UCGroupConditions1.GetGroupFieldList(preferredTableInner, "Y");

            if (groupFieldsYInner.Trim().Length > 0)
            {
                groupFieldsYInner += ",";
            }
            groupFieldsYInner += "tblmesentitylist.tpcode";
            if (groupFieldsYInner.IndexOf("shiftday") < 0 && byTimeType != NewReportByTimeType.ShiftDay)
            {
                groupFieldsYInner += ",**.shiftday";
            }

            ReportSQLEngine engineInner = new ReportSQLEngine(this.DataProvider, this.languageComponent1);

            engineInner.DetailedCoreTable = GetDetailedCoreTable();
            engineInner.Formular          = GetFormularInner(inputOutput, compareType, completeType, bigSSChecked, opResChecked, segSSChecked);
            engineInner.WhereCondition    = this.UCWhereConditions1.GetWhereSQLStatement(preferredTableInner, byTimeType, roundDate, dateAdjust);
            engineInner.GroupFieldsX      = groupFieldsXInner;
            engineInner.GroupFieldsY      = groupFieldsYInner;


            //拼外部SQL
            string groupFieldsX = this.UCGroupConditions1.GetGroupFieldAliasList(preferredTable, "X");
            string groupFieldsY = this.UCGroupConditions1.GetGroupFieldAliasList(preferredTable, "Y");

            ReportSQLEngine engine = new ReportSQLEngine(this.DataProvider, this.languageComponent1);

            engine.DetailedCoreTable = engineInner.GetReportSQL();
            engine.Formular          = GetFormular(inputOutput, compareType, completeType, bigSSChecked, opResChecked, segSSChecked);
            engine.WhereCondition    = string.Empty;
            engine.HavingCondition   = GetHavingCondition(inputOutput, compareType, completeType, bigSSChecked, opResChecked, segSSChecked);
            engine.GroupFieldsX      = groupFieldsX;
            engine.GroupFieldsY      = groupFieldsY;

            return(engine.GetReportDataSource(byTimeType, dateAdjust));;
        }
        private object[] LoadDataSource(bool isForCompare, bool roundDate)
        {
            string inputOutput  = UCWhereConditions1.UserSelectInputOutput;
            string byTimeType   = UCGroupConditions1.UserSelectByTimeType;
            string compareType  = UCGroupConditions1.UserSelectCompareType;
            string completeType = UCGroupConditions1.UserSelectCompleteType;

            if (!isForCompare)
            {
                compareType = string.Empty;
            }

            bool bigSSChecked = UCGroupConditions1.BigSSChecked;
            bool opResChecked = UCGroupConditions1.OPChecked || UCGroupConditions1.ResChecked;
            bool segSSChecked = UCGroupConditions1.SegChecked || UCGroupConditions1.SSChecked;

            string groupFieldsX = this.UCGroupConditions1.GetGroupFieldList(preferredTable, "X");
            string groupFieldsY = this.UCGroupConditions1.GetGroupFieldList(preferredTable, "Y");

            groupFieldsY = OrderFieldsY(groupFieldsY);

            if (string.IsNullOrEmpty(groupFieldsX))
            {
                groupFieldsX += "**.OPCODE || '-' || tblop.opdesc as opcode";
            }
            else
            {
                groupFieldsX += ",**.OPCODE || '-' || tblop.opdesc as opcode";
            }

            //用于环比同期比时的修改时间过滤条件
            int dateAdjust = 0;

            if (string.Compare(compareType, NewReportCompareType.LastYear, true) == 0)
            {
                dateAdjust = -12;
            }
            else if (string.Compare(compareType, NewReportCompareType.Previous, true) == 0)
            {
                dateAdjust = -1;
            }

            ReportSQLEngine engine = new ReportSQLEngine(this.DataProvider, this.languageComponent1);

            engine.DetailedCoreTable = GetCoreTableDetail();
            engine.Formular          = GetFormular(inputOutput, compareType, completeType, bigSSChecked, opResChecked, segSSChecked);
            engine.WhereCondition    = this.UCWhereConditions1.GetWhereSQLStatement(preferredTable, byTimeType, roundDate, dateAdjust);

            //if (engine.WhereCondition.IndexOf("itemtype_finishedproduct") >= 0)
            //{
            //    engine.WhereCondition = engine.WhereCondition.Replace("itemtype_finishedproduct", "FINISHEDSTR");
            //}

            //if (engine.WhereCondition.IndexOf("itemtype_semimanufacture") >= 0)
            //{
            //    engine.WhereCondition = engine.WhereCondition.Replace("itemtype_semimanufacture", "SEMIFINISHEDSTR");
            //}
            engine.GroupFieldsX = groupFieldsX;
            engine.GroupFieldsY = groupFieldsY;

            return(engine.GetReportDataSource(byTimeType, dateAdjust));;
        }