Example #1
0
        public ActionResult GetBigCodePage(BigScaleSearch condition)
        {
            string where = string.Empty;
            if (!string.IsNullOrWhiteSpace(condition.KeyWord))
            {
                where += string.Format(" and ProductNumber+ProductName+ProducctNo+BarCode like '%{0}%'", Common.Filter(condition.KeyWord));
            }
            if (!string.IsNullOrWhiteSpace(condition.OrderNo))
            {
                where += string.Format(" and OrderNo like '{0}%'", Common.Filter(condition.OrderNo));
            }
            if (!string.IsNullOrWhiteSpace(condition.DatCreateB))
            {
                where += string.Format(" and ReturnTime >={0} ", CommonFunc.GetTimestamp(Convert.ToDateTime(condition.DatCreateB + " 00:00:00")));
            }
            if (!string.IsNullOrWhiteSpace(condition.DatCreateE))
            {
                where += string.Format(" and ReturnTime <={0} ", CommonFunc.GetTimestamp(Convert.ToDateTime(condition.DatCreateE + " 23:59:59")));
            }

            PageJsonModel <ScaleRtnStokeDetail> page = new PageJsonModel <ScaleRtnStokeDetail>();

            page.pageIndex = condition.pageIndex;
            page.pageSize  = condition.pageSize;
            page.strForm   = "View_RtnRecord";
            page.strSelect = " OrderNo, RtnWay, BarCode, ProducctNo, ReturnTime, OperaUser, BarCount, ProductImg, ProductNumber, ProductName, PUserName, PRealName, Name ";
            page.strWhere  = where;
            page.strOrder  = " ReturnTime desc";
            page.LoadList();

            return(Json(page.pageResponse, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public ActionResult ExportExcel(BigScaleSearch condition)
        {
            StringBuilder where = new StringBuilder();
            where.Append("select BigCode,SmallCode,p.ProductName ProductName,s.DatCreate DatCreate,c.UserName UserName,c.Name Name,c.Province,c.City,c.Area from ScaleOutStoke s left join Product p on s.P_ID=p.ProductNumber left join C_User c on s.Consignee=c.UserName left join Supplier s1 on s1.ID=s.GID where 1=1 ");

            if (!string.IsNullOrWhiteSpace(condition.SmallCode))
            {
                where.Append(string.Format(" and (ProductName like '%{0}%' or c.UserName like '%{0}%' or c.Name like '%{0}%' or c.Province like '%{0}%' or SmallCode like '%{0}%' or BigCode like '%{0}%' )", condition.SmallCode));
            }
            DataTable dt = ExportWay.ExcelDataTable(where.ToString());

            string[] list = { "外箱条码", "产品条码", "产品名称", "出库时间", "客户编号", "客户名称", "省份", "城市", "乡镇" };
            return(File(ExportWay.GetExcel(dt, list), "application/vnd.ms-excel", "条码追踪信息" + DateTime.Now.ToShortTimeString() + ".xls"));
        }
Example #3
0
        public ActionResult GetBigCodePage(BigScaleSearch condition)
        {
            string where = string.Empty;

            if (!string.IsNullOrWhiteSpace(condition.KeyWord))
            {
                where += " and a.BigCode+a.MiddleCode+a.SmallCode+b.ProductName+b.ProductNumber like '%" + Common.FilteSQLStr(condition.KeyWord) + "%'";
            }
            if (!string.IsNullOrWhiteSpace(condition.DatCreateB))
            {
                where += string.Format(" and a.IntoTime >={0} ", CommonFunc.GetTimestamp(Convert.ToDateTime(condition.DatCreateB + " 00:00:00")));
            }
            if (!string.IsNullOrWhiteSpace(condition.DatCreateE))
            {
                where += string.Format(" and a.IntoTime <={0} ", CommonFunc.GetTimestamp(Convert.ToDateTime(condition.DatCreateE + " 23:59:59")));
            }
            if (!string.IsNullOrWhiteSpace(condition.PUserName) && condition.PUserName != "All")
            {
                where += string.Format(" and a.IntoPDAUser='******'", Common.FilteSQLStr(condition.PUserName));
            }

            if (CurrentUser.DeptID != 0)
            {
                where += " and c.ID=" + CurrentUser.DeptID.ToString();
            }

            PageJsonModel <ScaleInStokeDetail> page = new PageJsonModel <ScaleInStokeDetail>();

            page.pageIndex = condition.pageIndex;
            page.pageSize  = condition.pageSize;
            page.strSelect = " a.ID,a.IntoOrderNo,a.BigCode,a.MiddleCode,a.SmallCode,a.IntoTime,b.ProductImg,b.ProductNumber,b.ProductName,a.IntoPDAUser,c.PRealName ";
            page.strForm   = " Scale a left join Product b on a.ProductNo=b.ProductNumber left join PDAUser as c on a.IntoPDAUser=c.PUserName ";
            page.strWhere  = " and a.IsInto=1 " + where;
            if (string.IsNullOrWhiteSpace(condition.orderby) == false)
            {
                page.strOrder = Common.FilteSQLStr(condition.orderby);
            }
            else
            {
                page.strOrder = " a.IntoTime desc";
            }

            page.LoadList();

            if (page.pageResponse != null && page.pageResponse.RtnList != null && page.pageResponse.RtnList.Count > 0)
            {
                return(Json(page.pageResponse, JsonRequestBehavior.AllowGet));
            }
            return(Json("", JsonRequestBehavior.AllowGet));
        }
Example #4
0
        public ActionResult GetBigCodePage(BigScaleSearch condition)
        {
            string where = string.Empty;

            if (!string.IsNullOrWhiteSpace(condition.KeyWord))
            {
                where += string.Format(" and ( BigCode='{0}' or MiddleCode='{0}' or SmallCode='{0}')", Common.Filter(condition.KeyWord));
            }
            if (!string.IsNullOrWhiteSpace(condition.ProductNumber))
            {
                where += string.Format(" and ProductNo='{0}'", condition.ProductNumber);
            }
            if (!string.IsNullOrWhiteSpace(condition.DatCreateB))
            {
                where += string.Format(" and OutTime >={0} ", CommonFunc.GetTimestamp(Convert.ToDateTime(condition.DatCreateB + " 00:00:00")));
            }
            if (!string.IsNullOrWhiteSpace(condition.DatCreateE))
            {
                where += string.Format(" and OutTime <={0} ", CommonFunc.GetTimestamp(Convert.ToDateTime(condition.DatCreateE + " 23:59:59")));
            }
            if (!string.IsNullOrWhiteSpace(condition.OutOrderNo))
            {
                where += string.Format(" and OutOrderNo like '%{0}%' ", Common.Filter(condition.OutOrderNo));
            }

            PageJsonModel <ScaleOutStokeDetails> page = new PageJsonModel <ScaleOutStokeDetails>();

            page.pageIndex = condition.pageIndex;
            page.pageSize  = condition.pageSize;

            page.strSelect = " a.OutOrderNo,a.BigCode,a.MiddleCode,a.SmallCode,a.OutTime,b.ProductImg,b.ProductNumber,b.ProductName,a.OutPDAUser,a.UserName,c.Name C_Name  ";
            page.strForm   = " Scale as a left join Product b on a.ProductNo=b.ProductNumber left join C_User as c on a.UserName=c.UserName ";
            page.strWhere  = " and a.IsOut=1 " + where;
            page.strOrder  = " a.OutTime desc";

            page.LoadList();

            if (page.pageResponse != null && page.pageResponse.RtnList != null && page.pageResponse.RtnList.Count > 0)
            {
                return(Json(page.pageResponse, JsonRequestBehavior.AllowGet));
            }
            return(Json("", JsonRequestBehavior.AllowGet));
        }
Example #5
0
        public ActionResult GetBigCodePageKuCun(BigScaleSearch condition)
        {
            string where = string.Empty;
            if (!string.IsNullOrWhiteSpace(condition.BigCode))
            {
                where += " and ( b.ProductNumber+b.ProductName like '%" + condition.BigCode + "%' )";
            }

            PageJsonModel <BigScale> page = new PageJsonModel <BigScale>();

            page.pageIndex = condition.pageIndex;
            page.pageSize  = condition.pageSize;
            page.strForm   = "(select COUNT(SmallCode) as SmallCount,sum(b.kw) as [money],b.ProductName,b.ProductNumber,b.ProductImg" +
                             " from Scale as a left join Product as b on a.ProductNo=b.ProductNumber" +
                             " where StateID in (6,9)" + where +
                             " group by b.ProductName,b.ProductNumber,b.ProductImg) as BigScale";
            page.strSelect = " * ";

            if (string.IsNullOrWhiteSpace(condition.orderby) == false)
            {
                page.strOrder = Common.FilteSQLStr(condition.orderby);
            }
            else
            {
                page.strOrder = " ProductName ";
            }
            page.LoadList();

            if (page.pageResponse != null && page.pageResponse.RtnList != null && page.pageResponse.RtnList.Count > 0)
            {
                ScaleCodeCount OutCodeCount = Scale.GetStockCount(where);
                page.pageResponse.SmallCount = OutCodeCount.SmallCount;
                page.pageResponse.SumPrice   = OutCodeCount.SumPrice;
                return(Json(page.pageResponse, JsonRequestBehavior.AllowGet));
            }

            return(Json("", JsonRequestBehavior.AllowGet));
        }
Example #6
0
        public ActionResult GetBigCodePage(BigScaleSearch condition)
        {
            string where = string.Empty;
            if (!string.IsNullOrWhiteSpace(condition.BigCode))
            {
                where += " and BigCode='" + condition.BigCode + "'";
            }
            PageJsonModel <BigScale> page = new PageJsonModel <BigScale>();

            page.pageIndex = condition.pageIndex;
            page.pageSize  = condition.pageSize;
            page.strForm   = "(select COUNT(*) SmallCount,BigCode from Scale group by BigCode) as BigScale";
            page.strSelect = " * ";
            page.strWhere  = where;
            page.strOrder  = " SmallCount asc";
            page.LoadList();

            if (page.pageResponse != null && page.pageResponse.RtnList != null && page.pageResponse.RtnList.Count > 0)
            {
                return(Json(page.pageResponse, JsonRequestBehavior.AllowGet));
            }
            return(Json("", JsonRequestBehavior.AllowGet));
        }
Example #7
0
        public ActionResult GetCodePage(BigScaleSearch condition)
        {
            string where = string.Empty;
            if (!string.IsNullOrWhiteSpace(condition.SmallCode))
            {
                where += " and SmallCode='" + condition.SmallCode + "'";
            }

            PageJsonModel <Scale> page = new PageJsonModel <Scale>();

            page.pageIndex = condition.pageIndex;
            page.pageSize  = condition.pageSize;
            page.strForm   = " Scale as a left join C_User as b on a.UserName=b.UserName left join Supplier as c on a.SupplierId=c.ID ";
            page.strSelect = " a.*,b.Name,c.Name as SupplierName ";
            page.strWhere  = where;
            page.strOrder  = " a.StateID desc ";
            page.LoadList();

            if (page.pageResponse != null && page.pageResponse.RtnList != null && page.pageResponse.RtnList.Count > 0)
            {
                return(Json(page.pageResponse, JsonRequestBehavior.AllowGet));
            }
            return(Json("", JsonRequestBehavior.AllowGet));
        }