Пример #1
0
        /// <summary>
        /// 获取品质报表汇总数据
        /// </summary>
        public PagedListModel <QEboardSumModel> GetStaticQESumData(string projectName, string dataTime)
        {
            var totalCount            = 0;
            var result                = NoticeRepository.GetStaticQESumData(projectName, dataTime);
            var OneDirectTarget       = 100.0;
            var OneDirectTargetActual = 100.0;
            var TwoDirectTarget       = 100.0;
            var TwoDirectTargetActual = 100.0;

            foreach (var item in result)
            {
                OneDirectTarget       *= item.OneTargetYield.Equals(0) ? 1 : item.OneTargetYield;
                OneDirectTargetActual *= item.OneYield.Equals(0) ? 1 : item.OneYield;
                TwoDirectTarget       *= item.SecondTargetYield.Equals(0) ? 1 : item.SecondTargetYield;
                TwoDirectTargetActual *= item.SecondYield.Equals(0) ? 1 : item.SecondYield;
            }

            foreach (var item in result)
            {
                item.OneDirectTarget       = OneDirectTarget.ToString("F2") + '%';
                item.OneDirectTargetActual = OneDirectTargetActual.ToString("F2") + '%';
                item.TwoDirectTarget       = TwoDirectTarget.ToString("F2") + '%';
                item.TwoDirectTargetActual = TwoDirectTargetActual.ToString("F2") + '%';
            }

            return(new PagedListModel <QEboardSumModel>(totalCount, result));
        }