/// <summary>
        /// 生产入库态势(天)
        /// </summary>
        /// <param name="currentUser"></param>
        /// <returns></returns>
        public async Task <ResponseObject <ProductionWarehousingModel> > GetProductionWarehousingDay(CurrentUser currentUser)
        {
            try
            {
                DateTime _thisDateTime = DateTime.Now;
                String   y             = _thisDateTime.ToString("yyyy");
                String   m             = _thisDateTime.ToString("MM");
                int      day           = System.Threading.Thread.CurrentThread.CurrentUICulture.Calendar.GetDaysInMonth(DateTime.Now.Year, DateTime.Now.Month);
                var      today         = await _db.Instance.Queryable <TWMProductionWhMainDbModel>()
                                         .Where(t => t.CompanyId == currentUser.CompanyID && t.AuditStatus == 2 && t.DeleteFlag == false)
                                         .GroupBy(n => n.WarehousingDate)
                                         .Select(n => new { n.WarehousingDate, Number = SqlFunc.AggregateSum(n.Number) })
                                         .ToListAsync();

                string s1 = "";
                string s2 = "";
                for (int i = 0; i < day; i++)
                {
                    s1 += "|" + (i + 1);
                    int Count = today.Where(n => n.WarehousingDate == Convert.ToDateTime(y + "-" + m + "-" + (i + 1))).Count();
                    if (Count > 0)
                    {
                        var model = today.Where(n => n.WarehousingDate == Convert.ToDateTime(y + "-" + m + "-" + (i + 1)));
                        if (model != null)
                        {
                            s2 += "|" + String.Format("{0:N2}", model.Select(n => n.Number).ToList()[0]);
                        }
                    }
                    else
                    {
                        s2 += "|0.00";
                    }
                }
                ProductionWarehousingModel _model = new ProductionWarehousingModel {
                    xAxisData = s1.Substring(1).Split('|'), SeriesData = s2.Substring(1).Split('|')
                };
                return(ResponseUtil <ProductionWarehousingModel> .SuccessResult(_model));
            }
            catch (Exception ex)
            {
                return(ResponseUtil <ProductionWarehousingModel>
                       .FailResult(null, $"生产入库态势(天) 发生异常{System.Environment.NewLine} {ex.Message}"));
            }
        }
        /// <summary>
        /// 生产入库态势(周)
        /// </summary>
        /// <param name="currentUser"></param>
        /// <returns></returns>
        public async Task <ResponseObject <ProductionWarehousingModel> > GetProductionWarehousingWeek(CurrentUser currentUser)
        {
            try
            {
                DateTime _thisDateTime = DateTime.Now;
                int      y             = Convert.ToInt32(_thisDateTime.ToString("yyyy"));
                int      m             = Convert.ToInt32(_thisDateTime.ToString("MM"));
                //获取本月的天数
                var      date_count = System.Threading.Thread.CurrentThread.CurrentUICulture.Calendar.GetDaysInMonth(DateTime.Now.Year, DateTime.Now.Month);
                DateTime firstDay   = _thisDateTime.AddDays(1 - _thisDateTime.Day);
                int      weekday    = (int)firstDay.DayOfWeek == 0 ? 7 : (int)firstDay.DayOfWeek;
                //本月第一周有几天
                int firstWeekEndDay = 7 - (weekday - 1);
                var days            = date_count;
                var mod             = firstWeekEndDay; //本月第一周有几天
                var count           = 1;
                var start           = 1;               //起始日期 1 号开始
                var s1  = "";
                var s2  = "";
                var ss1 = "";
                var ss2 = "";
                var end = start + mod - 1;//截止日期
                while (days >= 0)
                {
                    //var end = start + 6;
                    end  = end > date_count ? date_count : end;
                    ss1 += "第" + count + "周:" + y + "年" + m + "月" + "(" + start + "-" + end + ");" + "\n";
                    s1  += ",第" + count + "周";
                    DateTime dt1 = Convert.ToDateTime("" + y + "-" + m + "-" + start);

                    DateTime dt2;
                    if ((end + 1) > date_count)
                    {
                        dt2 = Convert.ToDateTime("" + y + "-" + (m + 1) + "-01");
                    }
                    else
                    {
                        dt2 = Convert.ToDateTime("" + y + "-" + m + "-" + (end + 1));
                    }

                    var today = await _db.Instance.Queryable <TWMProductionWhMainDbModel>()
                                .Where(t => t.CompanyId == currentUser.CompanyID && t.AuditStatus == 2 && t.DeleteFlag == false &&
                                       t.WarehousingDate >= dt1 && t.WarehousingDate < dt2
                                       ).Select(t => SqlFunc.AggregateSum(t.Number)).ToListAsync();

                    if (today.Count > 0)
                    {
                        s2 += "|" + String.Format("{0:N2}", today[0]);
                    }
                    else
                    {
                        s2 += "|0.00";
                    }
                    start = end + 1;
                    end  += 7;
                    days -= 7;
                    ss2  += days + ",";
                    count++;
                }
                ProductionWarehousingModel _model = new ProductionWarehousingModel {
                    xAxisData = s1.Substring(1).Split(','), SeriesData = s2.Substring(1).Split('|')
                };
                return(ResponseUtil <ProductionWarehousingModel> .SuccessResult(_model));
            }
            catch (Exception ex)
            {
                return(ResponseUtil <ProductionWarehousingModel>
                       .FailResult(null, $"生产入库态势(周) 发生异常{System.Environment.NewLine} {ex.Message}"));
            }
        }
        /// <summary>
        /// 生产入库态势(月)
        /// </summary>
        /// <param name="currentUser"></param>
        /// <returns></returns>
        public async Task <ResponseObject <ProductionWarehousingModel> > GetProductionWarehousingMonth(CurrentUser currentUser)
        {
            try
            {
                DateTime _thisDateTime = DateTime.Now;
                String   y             = _thisDateTime.ToString("yyyy");
                String   m             = _thisDateTime.ToString("MM");
                int      day           = System.Threading.Thread.CurrentThread.CurrentUICulture.Calendar.GetDaysInMonth(DateTime.Now.Year, DateTime.Now.Month);
                //                var queryData = _db.Instance.Queryable<TWMProductionWhMainDbModel>()
                //.Where(t => t.CompanyId == currentUser.CompanyID && t.AuditStatus == 2 && t.DeleteFlag == false);
                string s1 = "";
                string s2 = "";
                for (int i = 0; i < 12; i++)
                {
                    s1 += "|" + (i + 1);
                    var      Month = (y + "-" + (i + 1));
                    DateTime dt1   = Convert.ToDateTime("" + y + "-" + (i + 1) + "-01");
                    DateTime dt2;
                    if ((i + 1) == 12)
                    {
                        dt2 = Convert.ToDateTime("" + (Convert.ToInt32(y) + 1) + "-01-01");
                    }
                    else
                    {
                        dt2 = Convert.ToDateTime("" + y + "-" + (i + 2) + "-01");
                    }
                    //            var query = await queryData.Where(t => t.WarehousingDate >= dt1 && t.WarehousingDate < dt2
                    //).Select(t => SqlFunc.AggregateSum(t.Number)).ToListAsync();
                    //            if (query.Count > 0)
                    //            {
                    //                s2 += "," + String.Format("{0:N2}", query[0]);
                    //            }
                    //            else
                    //            {
                    //                s2 += ", " + queryData.Where(t => t.WarehousingDate >= dt1 && t.WarehousingDate < dt2
                    //).Select(t => SqlFunc.AggregateSum(t.Number)).ToSql();
                    //            }

                    var today = await _db.Instance.Queryable <TWMProductionWhMainDbModel>()
                                .Where(t => t.CompanyId == currentUser.CompanyID && t.AuditStatus == 2 && t.DeleteFlag == false &&
                                       t.WarehousingDate >= dt1 && t.WarehousingDate < dt2
                                       ).Select(t => SqlFunc.AggregateSum(t.Number)).ToListAsync();

                    if (today.Count > 0)
                    {
                        s2 += "|" + String.Format("{0:N2}", today[0]);
                    }
                    else
                    {
                        s2 += "|0.00";
                    }
                }
                ProductionWarehousingModel _model = new ProductionWarehousingModel {
                    xAxisData = s1.Substring(1).Split('|'), SeriesData = s2.Substring(1).Split('|')
                };
                return(ResponseUtil <ProductionWarehousingModel> .SuccessResult(_model));
            }
            catch (Exception ex)
            {
                return(ResponseUtil <ProductionWarehousingModel>
                       .FailResult(null, $"生产入库态势(月) 发生异常{System.Environment.NewLine} {ex.Message}"));
            }
        }