Beispiel #1
0
        private void AnalyzeOneDay(vw_employment _emp, tatrosdtl curRosterDtl, tatshift curShift, tatroshi curRosterHistory, DateTime _calcStart, DateTime _calcEnd, totaplctn _otApp, bool _isSaveDetail)
        {
            store         = new AtCalculationInfo();
            store.EmpInfo = _emp;
            store.CurDay  = _calcStart;

            //curDayR = store.CurDay;

            //取得标准班次设定时间
            analatBll.GetStandardValue(curRosterDtl, curShift, ref store);

            //判断是否是休息日
            analatBll.CheckIsRestDay(curRosterDtl, curShift, curRosterHistory, lstPriCalendar, ref store);

            AnalyzeOT(ref store, curShift, lstOriAtData, _isSaveDetail);

            TotalOTHours += store.OTHours;
        }
Beispiel #2
0
        private void AnalyzeOneDay(vw_employment _emp, tatrosdtl curRosterDtl, tatshift curShift, tatroshi curRosterHistory, DateTime _calcStart, DateTime _calcEnd, tlvleaapp _leaveApp, bool _isSaveDetail)
        {
            store         = new AtCalculationInfo();
            store.EmpInfo = _emp;
            store.CurDay  = _calcStart;

            //curDayR = store.CurDay;

            //取得标准班次设定时间
            analatBll.GetStandardValue(curRosterDtl, curShift, ref store);

            //判断是否是休息日
            analatBll.CheckIsRestDay(curRosterDtl, curShift, curRosterHistory, lstPriCalendar, ref store);

            if (store.IsRestDay == false)
            {
                #region 非休息日
                if ((_calcStart <= store.StdTimeIn) && (_calcEnd >= store.StdTimeOut))
                {
                    //抓班次设定的工作小时数和天数
                    store.LvStart = store.StdTimeIn;
                    store.LvEnd   = store.StdTimeOut;

                    store.LvHours = Convert.ToDouble(curShift.wkhr);
                    store.LvDays  = Convert.ToDouble(curShift.wkda);
                }
                else
                {
                    if (_calcStart <= store.StdTimeIn)
                    {
                        store.LvStart = store.StdTimeIn;
                    }
                    else
                    {
                        store.LvStart = _calcStart;
                    }

                    if (_calcEnd >= store.StdTimeOut)
                    {
                        store.LvEnd = store.StdTimeOut;
                    }
                    else
                    {
                        store.LvEnd = _calcEnd;
                    }

                    store.LvHours = CountLeaveTime(store.LvStart, store.LvEnd, curShift, store);
                    store.LvHours = Math.Round(store.LvHours, 2);
                    //计算天数
                    store.LvDays = Math.Round((store.LvHours / Convert.ToDouble(curShift.wkhr)) * Convert.ToDouble(curShift.wkda), 2);
                }
                #endregion
            }
            else
            {
                #region 休息日
                store.LvHours = 0;
                store.LvDays  = 0;
                #endregion
            }

            TotalLvHours += store.LvHours;
            TotalLvDays  += store.LvDays;

            if ((_isSaveDetail) && (_leaveApp != null) && (store.LvHours > 0))
            {
                //如果需要保存则保存每一条明细到DTL表
                tlvleaapd newdtl = new tlvleaapd();

                newdtl.emno = _emp.emno;
                newdtl.days = store.LvDays;
                newdtl.hurs = store.LvHours;
                newdtl.ltcd = _leaveApp.ltcd;
                newdtl.apno = _leaveApp.apno;
                newdtl.totm = store.LvEnd.Value;
                newdtl.frtm = store.LvStart.Value;

                DoInsert <tlvleaapd>(newdtl);
            }
        }