예제 #1
0
 public ActionResult List(GridCommand command, PickTaskSearchModel searchModel)
 {
     ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
     SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
     ViewBag.SearchModel = searchModel;
     return View();
 }
예제 #2
0
 public ActionResult _AjaxList(GridCommand command, PickTaskSearchModel searchModel)
 {
     if (String.IsNullOrEmpty(searchModel.LocationFrom))
     {
         return PartialView(new GridModel(new List<PickTask>()));
     }
     SearchStatementModel searchStatementModel = this.PrepareSearchStatement(command, searchModel);
     return PartialView(GetAjaxPageData<PickTask>(searchStatementModel, command));
 }
예제 #3
0
        public ActionResult List(GridCommand command, PickTaskSearchModel searchModel)
        {
            ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
            SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
            if (String.IsNullOrEmpty(searchModel.LocationFrom))
            {
                SaveWarningMessage("请选择来源库位!");
            }

            ViewBag.SearchModel = searchModel;
            return View();
        }
예제 #4
0
        private SearchStatementModel PrepareSearchStatement(GridCommand command, PickTaskSearchModel searchModel)
        {
            string whereStatement = string.Empty;
            
            IList<object> param = new List<object>();
            HqlStatementHelper.AddEqStatement("PickId", searchModel.PickId, "c", ref whereStatement, param);

            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

            SearchStatementModel searchStatementModel = new SearchStatementModel();
            searchStatementModel.SelectCountStatement = "select count(*) from PickResult  c";
            searchStatementModel.SelectStatement = "select c from PickResult as c";
            searchStatementModel.WhereStatement = whereStatement;
            searchStatementModel.SortingStatement = sortingStatement;
            searchStatementModel.Parameters = param.ToArray<object>();

            return searchStatementModel;
        }
예제 #5
0
        private SearchStatementModel PrepareSearchStatement(GridCommand command, PickTaskSearchModel searchModel)
        {
            string whereStatement = string.Empty;
            if (!searchModel.IncludeFinished)
            {
                whereStatement += " where c.OrderedQty > c.PickedQty ";
            }
            IList<object> param = new List<object>();
            HqlStatementHelper.AddEqStatement("PickId", searchModel.PickId, "c", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("LocationFrom", searchModel.LocationFrom, "c", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("OrderNo", searchModel.OrderNo, "c", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Picker", searchModel.Picker, "c", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Item", searchModel.Item, "c", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Flow", searchModel.Flow, "c", ref whereStatement, param);
            //HqlStatementHelper.AddEqStatement("IncludeFinished", searchModel.IncludeFinished, "c", ref whereStatement, param);
            if (searchModel.ReleaseStart != null)
            {
                HqlStatementHelper.AddGeStatement("ReleaseDate", searchModel.ReleaseStart.Value, "c", ref whereStatement, param);
            }
            if (searchModel.ReleaseEnd != null)
            {
                HqlStatementHelper.AddLtStatement("ReleaseDate", searchModel.ReleaseEnd.Value, "c", ref whereStatement, param);
            }
            if (searchModel.WindowStart != null)
            {
                HqlStatementHelper.AddGeStatement("WindowTime", searchModel.WindowStart.Value, "c", ref whereStatement, param);
            }
            if (searchModel.WindowEnd != null)
            {
                HqlStatementHelper.AddLtStatement("WindowTime", searchModel.WindowEnd.Value, "c", ref whereStatement, param);
            }
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

            SearchStatementModel searchStatementModel = new SearchStatementModel();
            searchStatementModel.SelectCountStatement = "select count(*) from PickTask  c";
            searchStatementModel.SelectStatement = "select c from PickTask as c";
            searchStatementModel.WhereStatement = whereStatement;
            searchStatementModel.SortingStatement = sortingStatement;
            searchStatementModel.Parameters = param.ToArray<object>();

            return searchStatementModel;
        }
예제 #6
0
 public ActionResult _AjaxList(GridCommand command, PickTaskSearchModel searchModel)
 {
     SearchStatementModel searchStatementModel = this.PrepareSearchStatement(command, searchModel);
     return PartialView(GetAjaxPageData<PickResult>(searchStatementModel, command));
 }
예제 #7
0
        public ActionResult _AjaxListOrderDetail(GridCommand command, PickTaskSearchModel searchModel)
        {
            string whereStatement = "select c.* from view_orderdet c inner join view_ordermstr o on c.orderno = o.orderno where "
               + "(o.Status = " + (int)CodeMaster.OrderStatus.Submit
                                                   + " or o.Status = "
                                                   + (int)CodeMaster.OrderStatus.InProcess
                                                   + ") and c.orderno = '" + searchModel.OrderNo
                                                   + "' and not exists (select 1 from ord_picktask as s where s.orddetid = c.id)";
            IList<OrderDetail> ods = base.genericMgr.FindEntityWithNativeSql<OrderDetail>(whereStatement);

            GridModel<OrderDetail> GridModel = new GridModel<OrderDetail>();
            GridModel.Total = ods.Count;
            GridModel.Data = ods;
            ViewBag.Total = GridModel.Total;
            return PartialView(GridModel);
        }
예제 #8
0
        public ActionResult _AjaxListHandle(GridCommand command, PickTaskSearchModel searchModel)
        {
            if (String.IsNullOrEmpty(searchModel.LocationFrom))
            {
                return PartialView(new GridModel(new List<PickTask>()));
            }
            //SearchStatementModel searchStatementModel = this.PrepareHandleSearchStatement(command, searchModel);
            //return PartialView(GetAjaxPageData<PickTask>(searchStatementModel, command));
            string whereStatement = "select c.* from ord_picktask c inner join view_ordermstr o on c.orderno = o.orderno where "
                + "(o.Status = " + (int)CodeMaster.OrderStatus.Submit
                                                    + " or o.Status = "
                                                    + (int)CodeMaster.OrderStatus.InProcess
                                                    + ") and c.orderedqty > c.pickedqty ";
            if (searchModel.ShowHold)
            {
                whereStatement += " and c.IsHold = 1 ";
            }
            else
            {
                whereStatement += " and c.IsHold = 0 ";
            }
            if (!String.IsNullOrEmpty(searchModel.PickId)) {
                whereStatement += " and c.PickId = '" + searchModel.PickId + "'";
            }
            if (!String.IsNullOrEmpty(searchModel.LocationFrom))
            {
                whereStatement += " and c.LocationFrom = '" + searchModel.LocationFrom + "'";
            }
            if (!String.IsNullOrEmpty(searchModel.OrderNo))
            {
                whereStatement += " and c.OrderNo = '" + searchModel.OrderNo + "'";
            }
            if (!String.IsNullOrEmpty(searchModel.Picker))
            {
                whereStatement += " and c.Picker = '" + searchModel.Picker + "'";
            }
            if (!String.IsNullOrEmpty(searchModel.Item))
            {
                whereStatement += " and c.Item = '" + searchModel.Item + "'";
            }
            if (!String.IsNullOrEmpty(searchModel.Flow))
            {
                whereStatement += " and c.Flow = '" + searchModel.Flow + "'";
            }
            if (searchModel.ReleaseStart != null)
            {
                whereStatement += " and c.ReleaseDate >= '" + searchModel.ReleaseStart + "'";
            }
            if (searchModel.ReleaseEnd != null)
            {
                whereStatement += " and c.ReleaseDate < '" + searchModel.ReleaseEnd + "'";
            }
            if (searchModel.WindowStart != null)
            {
                whereStatement += " and c.WindowTime >= '" + searchModel.WindowStart + "'";
            }
            if (searchModel.WindowEnd != null)
            {
                whereStatement += " and c.WindowTime < '" + searchModel.WindowEnd + "'";
            }

            IList<PickTask> pts = base.genericMgr.FindEntityWithNativeSql<PickTask>(whereStatement);

            foreach(PickTask pt in pts)
            {
                pt.NewPicker = pickTaskMgr.GetDefaultPicker(pt);
            }

            GridModel<PickTask> GridModel = new GridModel<PickTask>();
            GridModel.Total = pts.Count;
            GridModel.Data = pts;
            ViewBag.Total = GridModel.Total;
            return PartialView(GridModel);
        }