Exemplo n.º 1
0
        //看板明细设置
        private void SetPanelDetailsControlValue(WatchPanelDetails panelDetail)
        {
            panelDetail._sscode        = _ssCode;
            panelDetail._workShopCode  = _workShopCode;
            panelDetail._maxLineCount  = _maxLineCount;
            panelDetail._pageScrolling = _pageScrolling;
            DBTimeDimension timeObj = (DBTimeDimension)m_WatchPanelFacade.GetDBTimeDimension(_CuerrtDay);

            if (timeObj == null)
            {
                MessageBox.Show("数据库中缺少当前日期的时间维度,请检查Tbltimedimension表");
                return;
            }
            string divideTyep = string.Empty;

            if (_dividedHoursByDay)
            {
                divideTyep = TimeDimension.Day;
            }
            if (_dividedHoursByMonth)
            {
                divideTyep = TimeDimension.Month;
            }
            if (_dividedHoursByWeek)
            {
                divideTyep = TimeDimension.Week;
            }
            object[] panelDetailDataSource = this.m_WatchPanelFacade.QueryPanelDetailsData(_ssCode, _CuerrtDay, _workShopCode, timeObj, divideTyep);
            panelDetail.panlDetailsDataSource = panelDetailDataSource;

            this.WorkShopTimer.Enabled = false;
            this.AutoTimer.Enabled     = false;

            panelDetail.InitControlsValue();
        }
Exemplo n.º 2
0
        //综合看板和看板明细
        private void SetFacProductMessageControlValue(FacProductMessageControlNew facProductMessageControlNew)
        {
            try
            {
                #region  画面切换设置
                //如果是车间看板
                if (string.IsNullOrEmpty(_ssCode))
                {
                    if (!this.WorkShopTimer.Enabled && !this.AutoTimer.Enabled)
                    {
                        this.WorkShopTimer.Enabled = true;
                        this.AutoTimer.Enabled     = true;
                        this._loadedCount          = 0;
                        _ssCodeInWrokShopCode      = string.Empty;
                    }
                }
                else
                {
                    //产线看板
                    this.AutoTimer.Enabled = true;
                }

                #endregion

                #region 空间维度: 车间/产线  时间维度:日,周,月来统计数据,
                //时间维度为日时,x轴用各个时段;为周时,x轴用该周下的每一天来表示;为月时,x周用该周下的每一周来显示
                //当空间维度是车间时,直通率和投入产出图要分别刷显示车间下的每条产线
                string          ssCode  = string.Empty;
                DBTimeDimension timeObj = (DBTimeDimension)m_WatchPanelFacade.GetDBTimeDimension(_CuerrtDay);
                if (timeObj == null)
                {
                    MessageBox.Show("数据库中缺少当前日期的时间维度,请检查Tbltimedimension表");
                    return;
                }

                if (string.IsNullOrEmpty(_ssCode) && _ssCodeListInWorkShop != null)
                {
                    facProductMessageControlNew.IsWorkShopPanel = true;
                    if (string.IsNullOrEmpty(_ssCodeInWrokShopCode))
                    {
                        _ssCodeInWrokShopCode = (_ssCodeListInWorkShop[0] as StepSequence).StepSequenceCode;
                    }
                    ssCode = _ssCodeInWrokShopCode;
                }
                else
                {
                    facProductMessageControlNew.IsWorkShopPanel = false;
                    ssCode = _ssCode;
                }

                #region   良原因
                object[] peiDataSource = null;
                if (_dividedHoursByDay)
                {
                    peiDataSource = m_WatchPanelFacade.QueryErrorCasueTopFiveBySSCode(_CuerrtDay, _ssCode, _workShopCode);
                }
                if (_dividedHoursByWeek)
                {
                    peiDataSource = m_WatchPanelFacade.QueryErrorCasueTopFiveByWeek(_ssCode, _workShopCode, timeObj);
                }
                if (_dividedHoursByMonth)
                {
                    peiDataSource = m_WatchPanelFacade.QueryErrorCasueTopFiveByMonth(_ssCode, _workShopCode, timeObj);
                }
                #endregion

                #region 投入产出柱状图
                int      seq = m_WatchPanelFacade.GetSEQForLineChar(ssCode);
                object[] todayQtyDataSource = null;
                if (_dividedHoursByDay)
                {
                    todayQtyDataSource = m_WatchPanelFacade.QueryLineCharDataSource(ssCode, _CuerrtDay, seq);
                }
                else
                {
                    if (timeObj == null)
                    {
                        MessageBox.Show("数据库中缺少当前日期的时间维度,请检查Tbltimedimension表");
                        return;
                    }
                    if (_dividedHoursByMonth)
                    {
                        //得到当前CurrentDay对应的月数传入
                        todayQtyDataSource = m_WatchPanelFacade.QueryInputOutputByShiftDay(ssCode, _workShopCode, _CuerrtDay, TimeDimension.Month, timeObj);
                    }
                    if (_dividedHoursByWeek)
                    {
                        //得到当前CurrentDay对应的周数传入
                        todayQtyDataSource = m_WatchPanelFacade.QueryInputOutputByShiftDay(ssCode, _workShopCode, _CuerrtDay, TimeDimension.Week, timeObj);
                    }
                }
                #endregion

                #region  直通率,按照不同的时间维度统计
                object[] weekQtyDataSource = null;
                if (_dividedHoursByDay)
                {
                    weekQtyDataSource = m_WatchPanelFacade.QueryFPYBySSCodeForPeriod(ssCode, _CuerrtDay, seq);
                }
                else
                {
                    if (_dividedHoursByMonth)
                    {
                        //得到当前CurrentDay对应的月数传入
                        weekQtyDataSource = m_WatchPanelFacade.QueryFPYBySSCodeForMonth(ssCode, _CuerrtDay, _workShopCode, timeObj);
                    }

                    if (_dividedHoursByWeek)
                    {
                        //得到当前CurrentDay对应的周数传入
                        weekQtyDataSource = m_WatchPanelFacade.QueryFPYBySSCodeForWeek(ssCode, _CuerrtDay, _workShopCode, timeObj);
                    }
                }
                #endregion

                #region  总投入和总产出
                int    inputOutPutShiftday = 0;
                string divideTyep          = string.Empty;
                if (_dividedHoursByDay)
                {
                    inputOutPutShiftday = _CuerrtDay;
                    divideTyep          = TimeDimension.Day;
                }
                else
                {
                    inputOutPutShiftday = -1;
                    if (_dividedHoursByMonth)
                    {
                        divideTyep = TimeDimension.Month;
                    }
                    else
                    {
                        divideTyep = TimeDimension.Week;
                    }
                }
                object inputOutputByShifDay = m_WatchPanelFacade.GetInputOutputQtyByShiftDay(inputOutPutShiftday, _ssCode.Trim(), _workShopCode.Trim(), timeObj, divideTyep);
                #endregion

                #region  岗人数
                int opValue = m_WatchPanelFacade.GetOnPostManCount(_CuerrtDay, _ssCode, _workShopCode, timeObj, divideTyep);   //上岗人数
                #endregion

                #endregion

                #region  参数到综合看板
                facProductMessageControlNew.PeiDataSource      = peiDataSource;
                facProductMessageControlNew.InputQutputQty     = inputOutputByShifDay;
                facProductMessageControlNew.TodayQtyDataSource = todayQtyDataSource;
                facProductMessageControlNew.WeekQtyDataSource  = weekQtyDataSource;
                facProductMessageControlNew.OpValue            = opValue.ToString();
                facProductMessageControlNew.Sscode             = ssCode;

                facProductMessageControlNew.WorkShopCode = _workShopCode;
                if (_dividedHoursByDay)
                {
                    facProductMessageControlNew.Dimension = TimeDimension.Day;
                }
                if (_dividedHoursByWeek)
                {
                    facProductMessageControlNew.Dimension = TimeDimension.Week;
                }
                if (_dividedHoursByMonth)
                {
                    facProductMessageControlNew.Dimension = TimeDimension.Month;
                }
                facProductMessageControlNew.InitControlsValue();
                #endregion
            }
            catch
            {
            }
        }