예제 #1
0
        public string PageList(string pid)
        {
            var query = _client.Queryable <Wms_invmovedetail, Wms_material, Wms_inventorymove, Sys_user, Sys_user, Sys_user>
                            ((s, m, i, c, u, a) => new object[] {
                JoinType.Left, s.MaterialId == m.MaterialId,
                JoinType.Left, s.InventorymoveId == i.InventorymoveId,
                JoinType.Left, s.CreateBy == c.UserId,
                JoinType.Left, s.ModifiedBy == u.UserId,
                JoinType.Left, s.AuditinId == a.UserId,
            })
                        .Where((s, m, i, c, u, a) => s.IsDel == 1)
                        .Select((s, m, i, c, u, a) => new
            {
                MoveDetailId    = s.MoveDetailId.ToString(),
                InventorymoveId = s.InventorymoveId.ToString(),
                m.MaterialNo,
                m.MaterialName,
                s.Status,
                s.PlanQty,
                s.ActQty,
                s.IsDel,
                s.Remark,
                s.AuditinTime,
                AName = a.UserNickname,
                CName = c.UserNickname,
                s.CreateDate,
                UName = u.UserNickname,
                s.ModifiedDate
            }).MergeTable();

            query.Where(c => c.InventorymoveId == pid).OrderBy(c => c.CreateDate, OrderByType.Desc);
            var list = query.ToList();

            return(Bootstrap.GridData(list, list.Count).JilToJson());
        }
        public string PageList(PubParams.InventoryBoxBootstrapParams bootstrap)
        {
            int totalNumber = 0;

            if (bootstrap.offset != 0)
            {
                bootstrap.offset = bootstrap.offset / bootstrap.limit + 1;
            }
            var query = _client.Queryable <Wms_inventorybox, Wms_storagerack, Sys_user, Sys_user>
                            ((ib, sr, su, su2) => new object[] {
                JoinType.Left, ib.StorageRackId == sr.StorageRackId && sr.IsDel == 1,
                JoinType.Left, ib.CreateBy == su.UserId && su.IsDel == 1,
                JoinType.Left, ib.ModifiedBy == su2.UserId,
            })
                        .Where((ib, sr, su, su2) => ib.WarehouseId == bootstrap.storeId && ib.IsDel == 1)
                        .Select((ib, sr, su, su2) => new
            {
                InventoryBoxId = ib.InventoryBoxId.ToString(),
                ib.InventoryBoxNo,
                ib.InventoryBoxName,
                ib.Size,
                StorageRackId = sr.StorageRackId.ToString(),
                sr.StorageRackNo,
                sr.StorageRackName,
                sr.Row,
                sr.Column,
                sr.Floor,
                ib.IsDel,
                Status = (int)ib.Status,
                ib.Remark,
                CName = su.UserNickname,
                ib.CreateDate,
                UName = su2.UserNickname,
                ib.ModifiedDate
            }).MergeTable();

            if (!bootstrap.StorageRackId.IsEmpty())
            {
                query.Where(s => s.StorageRackId == bootstrap.StorageRackId);
            }
            if (!bootstrap.datemin.IsEmpty() && !bootstrap.datemax.IsEmpty())
            {
                query.Where(s => s.CreateDate > bootstrap.datemin.ToDateTimeB() && s.CreateDate <= bootstrap.datemax.ToDateTimeE());
            }
            if (!bootstrap.search.IsEmpty())
            {
                query.Where(s => s.InventoryBoxNo.Contains(bootstrap.search) || s.InventoryBoxName.Contains(bootstrap.search));
            }
            if (bootstrap.order.Equals("desc", StringComparison.OrdinalIgnoreCase))
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} desc");
            }
            else
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} asc");
            }
            var list = query.ToPageList(bootstrap.offset, bootstrap.limit, ref totalNumber);

            return(Bootstrap.GridData(list, totalNumber).JilToJson());
        }
예제 #3
0
        public string SearchInventory(PubParams.InventoryBootstrapParams bootstrap)
        {
            int totalNumber = 0;

            if (bootstrap.offset != 0)
            {
                bootstrap.offset = bootstrap.offset / bootstrap.limit + 1;
            }
            var query = _client.Queryable <Wms_inventory, Wms_inventorybox, Wms_material, Wms_storagerack, Sys_user, Sys_user>
                            ((s, sb, p, d, c, u) => new object[] {
                JoinType.Left, s.MaterialId == p.MaterialId,
                JoinType.Left, s.InventoryBoxId == sb.InventoryBoxId,
                JoinType.Left, sb.StorageRackId == d.StorageRackId,
                JoinType.Left, s.CreateBy == c.UserId,
                JoinType.Left, s.ModifiedBy == u.UserId,
            })
                        .Where((s, sb, p, d, c, u) => s.IsDel == 1 && sb.IsDel == 1 && d.IsDel == 1 && c.IsDel == 1)
                        .Select((s, sb, p, d, c, u) => new
            {
                InventoryId    = s.InventoryId.ToString(),
                InventoryBoxId = s.InventoryBoxId.ToString(),
                s.Qty,
                MaterialId = p.MaterialId.ToString(),
                p.MaterialNo,
                p.MaterialName,
                StorageRackId = d.StorageRackId.ToString(),
                d.StorageRackNo,
                d.StorageRackName,
                s.IsDel,
                s.Remark,
                CName = c.UserNickname,
                s.CreateDate,
                UName = u.UserNickname,
                s.ModifiedDate
            }).MergeTable();

            if (!bootstrap.search.IsEmpty())
            {
                query.Where((s) => s.MaterialId == bootstrap.search);
            }
            if (!bootstrap.StorageRackId.IsEmpty())
            {
                query.Where((s) => s.StorageRackId == bootstrap.StorageRackId);
            }
            if (!bootstrap.InventoryBoxId.IsEmpty())
            {
                query.Where((s) => s.InventoryBoxId == bootstrap.InventoryBoxId);
            }
            if (bootstrap.order.Equals("desc", StringComparison.OrdinalIgnoreCase))
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} desc");
            }
            else
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} asc");
            }
            var list = query.ToPageList(bootstrap.offset, bootstrap.limit, ref totalNumber);

            return(Bootstrap.GridData(list, totalNumber).JilToJson());
        }
예제 #4
0
        public string PageList(string pid)
        {
            var query = _client.Queryable <Wms_stockindetail, Wms_material, Wms_stockin, Sys_user, Sys_user>
                            ((s, m, p, c, u) => new object[] {
                JoinType.Left, s.MaterialId == m.MaterialId && m.IsDel == 1,
                JoinType.Left, s.StockInId == p.StockInId && p.IsDel == 1,
                JoinType.Left, s.CreateBy == c.UserId && c.IsDel == 1,
                JoinType.Left, s.ModifiedBy == u.UserId && u.IsDel == 1
            })
                        //.Where((s, m, p, c, u) => )
                        .Select((s, m, p, c, u) => new
            {
                StockInId       = s.StockInId.ToString(),
                StockInDetailId = s.StockInDetailId.ToString(),
                UniqueIndex     = s.UniqueIndex,
                m.MaterialNo,
                m.MaterialName,
                s.Status,
                s.PlanInQty,
                s.ActInQty,
                s.IsDel,
                s.Remark,
                CName = c.UserNickname,
                s.CreateDate,
                UName = u.UserNickname,
                s.ModifiedDate
            })
                        .MergeTable();

            query.Where(c => c.StockInId == pid).OrderBy(c => c.CreateDate, OrderByType.Desc)
            ;

            var list = query.ToList().Select(item => new
            {
                Detail = item,
                Tasks  = _client.Queryable <Wms_stockindetail_box, Wms_inventoryboxTask, Wms_inventorybox, Sys_user>(
                    (stb, st, ib, ou) => new object[] {
                    JoinType.Left, stb.InventoryBoxTaskId == st.InventoryBoxTaskId,
                    JoinType.Left, st.InventoryBoxId == ib.InventoryBoxId,
                    JoinType.Left, st.OperaterId == ou.UserId
                })
                         .Where((stb, st, ib, ou) => stb.StockinDetailId.ToString() == item.StockInDetailId)
                         .Select((stb, st, ib, ou) => new
                {
                    InventoryBoxTaskId = st.InventoryBoxTaskId.ToString(),
                    InventoryBoxId     = st.InventoryBoxId.ToString(),
                    TaskStatus         = (int)st.Status,
                    ib.InventoryBoxNo,
                    ib.InventoryBoxName,
                    Status = (int)ib.Status,
                    ou.UserNickname
                })
                         .MergeTable().ToList()
            });

            //var list = query.ToList();
            return(Bootstrap.GridData(list, list.Count()).JilToJson());
        }
예제 #5
0
        public string PageList(Bootstrap.BootstrapParams bootstrap)
        {
            int totalNumber = 0;

            if (bootstrap.offset != 0)
            {
                bootstrap.offset = bootstrap.offset / bootstrap.limit + 1;
            }
            var query = _client.Queryable <Wms_storagerack, Wms_reservoirarea, Wms_warehouse, Sys_user, Sys_user>
                            ((s, r, w, c, u) => new object[] {
                JoinType.Left, s.ReservoirAreaId == r.ReservoirAreaId,
                JoinType.Left, r.WarehouseId == w.WarehouseId,
                JoinType.Left, s.CreateBy == c.UserId,
                JoinType.Left, s.ModifiedBy == u.UserId,
            })
                        .Where((s, r, w, c, u) => s.WarehouseId == bootstrap.storeId && s.IsDel == 1 && r.IsDel == 1 && w.IsDel == 1)
                        .Select((s, r, w, c, u) => new
            {
                StorageRackId = s.StorageRackId.ToString(),
                s.StorageRackNo,
                s.StorageRackName,
                r.ReservoirAreaNo,
                r.ReservoirAreaName,
                s.Row,
                s.Column,
                s.Floor,
                w.WarehouseNo,
                w.WarehouseName,
                s.IsDel,
                s.Remark,
                CName = c.UserNickname,
                s.CreateDate,
                UName = u.UserNickname,
                s.ModifiedDate
            }).MergeTable();

            if (!bootstrap.search.IsEmpty())
            {
                query.Where((s) => s.WarehouseName.Contains(bootstrap.search) || s.WarehouseNo.Contains(bootstrap.search));
            }
            if (!bootstrap.datemin.IsEmpty() && !bootstrap.datemax.IsEmpty())
            {
                query.Where(s => s.CreateDate > bootstrap.datemin.ToDateTimeB() && s.CreateDate <= bootstrap.datemax.ToDateTimeE());
            }
            if (bootstrap.order.Equals("desc", StringComparison.OrdinalIgnoreCase))
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} desc");
            }
            else
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} asc");
            }
            var list = query.ToPageList(bootstrap.offset, bootstrap.limit, ref totalNumber);

            return(Bootstrap.GridData(list, totalNumber).JilToJson());
        }
예제 #6
0
        public string PageList(PubParams.InventoryBootstrapParams bootstrap)
        {
            int totalNumber = 0;

            if (bootstrap.offset != 0)
            {
                bootstrap.offset = bootstrap.offset / bootstrap.limit + 1;
            }
            var query = _client.Queryable <Wms_inventoryrecord, Wms_stockindetail, Wms_material, Sys_user, Sys_user, Wms_stockin, Wms_storagerack>
                            ((s, p, d, c, u, i, w) => new object[] {
                JoinType.Left, s.StockInDetailId == p.StockInDetailId,
                JoinType.Left, p.MaterialId == d.MaterialId,
                JoinType.Left, s.CreateBy == c.UserId,
                JoinType.Left, s.ModifiedBy == u.UserId,
                JoinType.Left, p.StockInId == i.StockInId,
                JoinType.Left, w.StorageRackId == p.StoragerackId
            })
                        .Where((s, p, d, c, u, i, w) => s.IsDel == 1 && d.IsDel == 1 && c.IsDel == 1 && i.IsDel == 1 && w.IsDel == 1)
                        .Select((s, p, d, c, u, i, w) => new
            {
                InventoryrecordId = s.InventoryrecordId.ToString(),
                i.StockInNo,
                s.Qty,
                d.MaterialNo,
                d.MaterialName,
                w.StorageRackNo,
                w.StorageRackName,
                s.IsDel,
                s.Remark,
                CName = c.UserNickname,
                s.CreateDate,
                UName = u.UserNickname,
                s.ModifiedDate
            }).MergeTable();

            if (!bootstrap.search.IsEmpty())
            {
                query.Where((s) => s.MaterialNo.Contains(bootstrap.search) || s.MaterialName.Contains(bootstrap.search) || s.StockInNo.Contains(bootstrap.search));
            }
            if (!bootstrap.datemin.IsEmpty() && !bootstrap.datemax.IsEmpty())
            {
                query.Where(s => s.CreateDate > bootstrap.datemin.ToDateTimeB() && s.CreateDate <= bootstrap.datemax.ToDateTimeE());
            }
            if (bootstrap.order.Equals("desc", StringComparison.OrdinalIgnoreCase))
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} desc");
            }
            else
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} asc");
            }
            var list = query.ToPageList(bootstrap.offset, bootstrap.limit, ref totalNumber);

            return(Bootstrap.GridData(list, totalNumber).JilToJson());
        }
예제 #7
0
        public string PageList(Bootstrap.BootstrapParams bootstrap)
        {
            int totalNumber = 0;

            if (bootstrap.offset != 0)
            {
                bootstrap.offset = bootstrap.offset / bootstrap.limit + 1;
            }
            var query = _client.Queryable <Wms_material, Sys_dict, Sys_dict, Wms_warehouse, Sys_user, Sys_user>
                            ((s, t, ut, w, c, u) => new object[] {
                JoinType.Left, s.MaterialType == t.DictId,
                JoinType.Left, s.Unit == ut.DictId,
                JoinType.Left, s.WarehouseId == w.WarehouseId,
                JoinType.Left, s.CreateBy == c.UserId,
                JoinType.Left, s.ModifiedBy == u.UserId,
            })
                        .Where((s, t, ut, w, c, u) => s.WarehouseId == bootstrap.storeId && s.IsDel == 1 && t.IsDel == 1 && ut.IsDel == 1 && w.IsDel == 1)
                        .Select((s, t, ut, w, c, u) => new
            {
                MaterialId = s.MaterialId.ToString(),
                s.MaterialOnlyId,
                s.MaterialNo,
                s.MaterialName,
                w.WarehouseNo,
                w.WarehouseName,
                MaterialType = t.DictName,
                Unit         = ut.DictName,
                s.IsDel,
                s.Remark,
                CName = c.UserNickname,
                s.CreateDate,
                UName = u.UserNickname,
                s.ModifiedDate
            }).MergeTable();

            if (!bootstrap.search.IsEmpty())
            {
                query.Where((s) => s.MaterialNo.Contains(bootstrap.search) || s.MaterialName.Contains(bootstrap.search) || s.MaterialOnlyId.Contains(bootstrap.search));
            }
            if (!bootstrap.datemin.IsEmpty() && !bootstrap.datemax.IsEmpty())
            {
                query.Where(s => s.CreateDate > bootstrap.datemin.ToDateTimeB() && s.CreateDate <= bootstrap.datemax.ToDateTimeE());
            }
            if (bootstrap.order.Equals("desc", StringComparison.OrdinalIgnoreCase))
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} desc");
            }
            else
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} asc");
            }
            var list = query.ToPageList(bootstrap.offset, bootstrap.limit, ref totalNumber);

            return(Bootstrap.GridData(list, totalNumber).JilToJson());
        }
예제 #8
0
        public string PageList(Bootstrap.BootstrapParams bootstrap)
        {
            int totalNumber = 0;

            if (bootstrap.offset != 0)
            {
                bootstrap.offset = bootstrap.offset / bootstrap.limit + 1;
            }
            var query = _client.Queryable <Wms_inventorymove, Wms_storagerack, Wms_storagerack, Sys_user, Sys_user>
                            ((w, s, a, c, u) => new object[] {
                JoinType.Left, w.SourceStoragerackId == s.StorageRackId,
                JoinType.Left, w.AimStoragerackId == a.StorageRackId,
                JoinType.Left, w.CreateBy == c.UserId,
                JoinType.Left, w.ModifiedBy == u.UserId,
            })
                        .Where((w, s, a, c, u) => w.IsDel == 1 && (s.WarehouseId == bootstrap.storeId || a.WarehouseId == bootstrap.storeId))
                        .Select((w, s, a, c, u) => new
            {
                InventorymoveId = w.InventorymoveId.ToString(),
                w.InventorymoveNo,
                w.Status,
                SourceStorageRackNo   = s.StorageRackNo,
                SourceStorageRackName = s.StorageRackName,
                AimStorageRackNo      = a.StorageRackNo,
                AimStorageRackName    = a.StorageRackName,
                w.IsDel,
                w.Remark,
                CName = c.UserNickname,
                w.CreateDate,
                UName = u.UserNickname,
                w.ModifiedDate
            }).MergeTable();

            if (!bootstrap.search.IsEmpty())
            {
                query.Where((s) => s.InventorymoveNo.Contains(bootstrap.search));
            }
            if (!bootstrap.datemin.IsEmpty() && !bootstrap.datemax.IsEmpty())
            {
                query.Where(s => s.CreateDate > bootstrap.datemin.ToDateTimeB() && s.CreateDate <= bootstrap.datemax.ToDateTimeE());
            }

            if (bootstrap.order.Equals("desc", StringComparison.OrdinalIgnoreCase))
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} desc");
            }
            else
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} asc");
            }
            var list = query.ToPageList(bootstrap.offset, bootstrap.limit, ref totalNumber);

            return(Bootstrap.GridData(list, totalNumber).ToJsonL());
            //return Bootstrap.GridData(list, totalNumber).JilToJson();
        }
예제 #9
0
        public string PageList(Bootstrap.BootstrapParams bootstrap)
        {
            int totalNumber = 0;

            if (bootstrap.offset != 0)
            {
                bootstrap.offset = bootstrap.offset / bootstrap.limit + 1;
            }
            var query = _client.Queryable <Wms_delivery, Wms_stockout, Wms_Carrier, Sys_user, Sys_user>
                            ((s, p, d, c, u) => new object[] {
                JoinType.Left, s.StockOutId == p.StockOutId,
                JoinType.Left, s.CarrierId == d.CarrierId,
                JoinType.Left, s.CreateBy == c.UserId,
                JoinType.Left, s.ModifiedBy == u.UserId,
            })
                        .Where((s, p, d, c, u) => s.IsDel == 1)
                        .Select((s, p, d, c, u) => new
            {
                DeliveryId = s.DeliveryId.ToString(),
                s.DeliveryDate,
                s.TrackingNo,
                p.StockOutNo,
                d.CarrierNo,
                d.CarrierName,
                d.CarrierPerson,
                d.Tel,
                s.IsDel,
                s.Remark,
                CName = c.UserNickname,
                s.CreateDate,
                UName = u.UserNickname,
                s.ModifiedDate
            }).MergeTable();

            if (!bootstrap.search.IsEmpty())
            {
                query.Where((s) => s.TrackingNo.Contains(bootstrap.search) || s.StockOutNo.Contains(bootstrap.search));
            }
            if (!bootstrap.datemin.IsEmpty() && !bootstrap.datemax.IsEmpty())
            {
                query.Where(s => s.CreateDate > bootstrap.datemin.ToDateTimeB() && s.CreateDate <= bootstrap.datemax.ToDateTimeE());
            }
            if (bootstrap.order.Equals("desc", StringComparison.OrdinalIgnoreCase))
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} desc");
            }
            else
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} asc");
            }
            var list = query.ToPageList(bootstrap.offset, bootstrap.limit, ref totalNumber);

            return(Bootstrap.GridData(list, totalNumber).JilToJson());
        }
예제 #10
0
        public string PageList(PubParams.DictBootstrapParams bootstrap)
        {
            int totalNumber = 0;

            if (bootstrap.offset != 0)
            {
                bootstrap.offset = bootstrap.offset / bootstrap.limit + 1;
            }
            var query = _client.Queryable <Sys_dict, Sys_user, Sys_user>
                            ((s, c, u) => new object[] {
                JoinType.Left, s.CreateBy == c.UserId,
                JoinType.Left, s.ModifiedBy == u.UserId
            })
                        .Select((s, c, u) => new
            {
                DictId = s.DictId.ToString(),
                s.DictNo,
                s.DictName,
                s.DictType,
                s.IsDel,
                s.Remark,
                CName = c.UserNickname,
                s.CreateDate,
                UName = u.UserNickname,
                s.ModifiedDate
            }).MergeTable().Where((s) => s.IsDel == 1);

            if (!bootstrap.search.IsEmpty())
            {
                query.Where((s) => s.DictName.Contains(bootstrap.search));
            }
            if (!bootstrap.DictType.IsEmpty())
            {
                query.Where((s) => s.DictType == bootstrap.DictType);
            }
            if (!bootstrap.datemin.IsEmpty() && !bootstrap.datemax.IsEmpty())
            {
                query.Where(s => s.CreateDate > bootstrap.datemin.ToDateTimeB() && s.CreateDate <= bootstrap.datemax.ToDateTimeE());
            }
            if (bootstrap.order.Equals("desc", StringComparison.OrdinalIgnoreCase))
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} desc");
            }
            else
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} asc");
            }
            var list = query.ToPageList(bootstrap.offset, bootstrap.limit, ref totalNumber);

            return(Bootstrap.GridData(list, totalNumber).JilToJson());
        }
예제 #11
0
        public string PageList(string pid)
        {
            var query = _client.Queryable <Wms_stockindetail, Wms_material, Wms_stockin, Wms_storagerack, Sys_user, Sys_user, Sys_user>
                            ((s, m, p, g, c, u, a) => new object[] {
                JoinType.Left, s.MaterialId == m.MaterialId,
                JoinType.Left, s.StockInId == p.StockInId,
                JoinType.Left, s.StoragerackId == g.StorageRackId,
                JoinType.Left, s.CreateBy == c.UserId,
                JoinType.Left, s.ModifiedBy == u.UserId,
                JoinType.Left, s.AuditinId == a.UserId,
            })
                        .Where((s, m, p, g, c, u, a) => s.IsDel == 1 && p.IsDel == 1 && g.IsDel == 1 && c.IsDel == 1)
                        .Select((s, m, p, g, c, u, a) => new
            {
                StockInId       = s.StockInId.ToString(),
                StockInDetailId = s.StockInDetailId.ToString(),
                m.MaterialNo,
                m.MaterialName,
                g.StorageRackNo,
                g.StorageRackName,
                s.Status,
                s.PlanInQty,
                s.ActInQty,
                s.IsDel,
                s.Remark,
                s.AuditinTime,
                AName = a.UserNickname,
                CName = c.UserNickname,
                s.CreateDate,
                UName = u.UserNickname,
                s.ModifiedDate
            }).MergeTable();

            query.Where(c => c.StockInId == pid).OrderBy(c => c.CreateDate, OrderByType.Desc);
            //if (bootstrap.order.Equals("desc", StringComparison.OrdinalIgnoreCase))
            //{
            //    query.OrderBy($"MergeTable.{bootstrap.sort} desc");
            //}
            //else
            //{
            //    query.OrderBy($"MergeTable.{bootstrap.sort} asc");
            //}
            //var list = query.ToPageList(bootstrap.offset, bootstrap.limit, ref totalNumber);
            var list = query.ToList();

            return(Bootstrap.GridData(list, list.Count).JilToJson());
        }
예제 #12
0
        public string PageList(string pid)
        {
            var query = _client.Queryable <Wms_stockoutdetail, Wms_material, Wms_stockout, Wms_storagerack, Sys_user, Sys_user, Sys_user>
                            ((s, m, p, g, c, u, a) => new object[] {
                JoinType.Left, s.MaterialId == m.MaterialId,
                JoinType.Left, s.StockOutId == p.StockOutId,
                JoinType.Left, s.StoragerackId == g.StorageRackId,
                JoinType.Left, s.CreateBy == c.UserId,
                JoinType.Left, s.ModifiedBy == u.UserId,
                JoinType.Left, s.AuditinId == a.UserId,
            })
                        .Where((s, m, p, g, c, u, a) => s.IsDel == 1 && m.IsDel == 1 && p.IsDel == 1 && g.IsDel == 1)
                        .Select((s, m, p, g, c, u, a) => new
            {
                StockOutId       = s.StockOutId.ToString(),
                StockOutDetailId = s.StockOutDetailId.ToString(),
                m.MaterialNo,
                m.MaterialName,
                g.StorageRackNo,
                g.StorageRackName,
                s.Status,
                s.PlanOutQty,
                s.ActOutQty,
                s.IsDel,
                s.Remark,
                s.AuditinTime,
                AName = a.UserNickname,
                CName = c.UserNickname,
                s.CreateDate,
                UName = u.UserNickname,
                s.ModifiedDate
            }).MergeTable();

            query.Where(c => c.StockOutId == pid).OrderBy(c => c.CreateDate, OrderByType.Desc);
            var list = query.ToList();

            return(Bootstrap.GridData(list, list.Count).JilToJson());
        }
예제 #13
0
        public string PageList(Bootstrap.BootstrapParams bootstrap)
        {
            var totalNumber = 0;

            if (bootstrap.offset != 0)
            {
                bootstrap.offset = bootstrap.offset / bootstrap.limit + 1;
            }
            //var order = ExpressionExt.InitO<Sys_user>(bootstrap.sort);

            var query = _client.Queryable <Sys_user, Sys_user, Sys_user, Sys_dept, Sys_role>
                            ((s, c, u, d, r) => new object[] {
                JoinType.Left, s.CreateBy == c.UserId,
                JoinType.Left, s.ModifiedBy == u.UserId,
                JoinType.Left, s.DeptId == d.DeptId,
                JoinType.Left, s.RoleId == r.RoleId
            }).Where((s, c, u, d, r) => s.IsDel == 1 && d.IsDel == 1 && r.IsDel == 1)
                        .Select((s, c, u, d, r) => new
            {
                UserId = s.UserId.ToString(),
                s.UserName,
                s.UserNickname,
                d.DeptName,
                r.RoleName,
                s.Tel,
                s.Email,
                s.Sex,
                s.IsEabled,
                s.Remark,
                CName = c.UserNickname,
                s.CreateDate,
                UName = u.UserNickname,
                s.ModifiedDate
            }).MergeTable();

            if (!bootstrap.search.IsEmpty())
            {
                query.Where((s) => s.UserName == bootstrap.search || s.UserNickname == bootstrap.search);
            }
            if (!bootstrap.datemin.IsEmpty() && !bootstrap.datemax.IsEmpty())
            {
                query.Where(s => s.CreateDate > bootstrap.datemin.ToDateTimeB() && s.CreateDate <= bootstrap.datemax.ToDateTimeE());
            }
            if (bootstrap.order.Equals("desc", StringComparison.OrdinalIgnoreCase))
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} desc");
            }
            else
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} asc");
            }
            var list = query.ToPageList(bootstrap.offset, bootstrap.limit, ref totalNumber);

            //var list = _client.Queryable("Sys_User", "s")
            //   .AddJoinInfo("Sys_User", "c", "s.CreateBy=c.UserId")
            //   .AddJoinInfo("Sys_User", "u", "s.ModifiedBy=u.UserId");
            //if (!bootstrap.search.IsEmpty())
            //{
            //    list.Where("s.IsDel=@id and s.UserName=@UserName or s.UserNickname=@UserName")
            //    .AddParameters(new { id = 1, UserName = bootstrap.search });
            //}
            //else
            //{
            //    list.Where("s.IsDel=@id ")
            //   .AddParameters(new { id = 1 });
            //}
            //if (bootstrap.offset != 0)
            //{
            //    bootstrap.offset = bootstrap.offset / bootstrap.limit + 1;
            //}
            //list.OrderBy($"s.{bootstrap.sort}")
            //.Select("s.*,c.UserNickname AS CNAME,u.UserNickname AS UNAME")
            //.ToPageList(bootstrap.offset, bootstrap.limit, ref totalNumber);
            return(Bootstrap.GridData(list, totalNumber).JilToJson());
        }
예제 #14
0
        public string PageList(PubParams.InventoryBootstrapParams bootstrap)
        {
            int totalNumber = 0;

            if (bootstrap.offset != 0)
            {
                bootstrap.offset = bootstrap.offset / bootstrap.limit + 1;
            }
            var query = _client.Queryable <Wms_inventory, Wms_inventorybox, Wms_material, Wms_storagerack, Sys_user, Sys_user>
                            ((s, sb, m, sr, scu, smu) => new object[] {
                JoinType.Left, s.InventoryBoxId == sb.InventoryBoxId,
                JoinType.Left, s.MaterialId == m.MaterialId,
                JoinType.Left, sb.StorageRackId == sr.StorageRackId,
                JoinType.Left, s.CreateBy == scu.UserId,
                JoinType.Left, s.ModifiedBy == smu.UserId,
            })
                        .Where((s, sb, m, sr, scu, smu) => sb.WarehouseId == bootstrap.storeId && s.IsDel == 1 && sb.IsDel == 1 && sr.IsDel == 1 && scu.IsDel == 1)
                        .Select((s, sb, m, sr, scu, smu) => new
            {
                InventoryId    = s.InventoryId.ToString(),
                InventoryBoxId = sb.InventoryBoxId.ToString(),
                s.Qty,
                s.IsLocked,
                MaterialId = m.MaterialId.ToString(),
                m.MaterialNo,
                m.MaterialName,
                StorageRackId = sr.StorageRackId.ToString(),
                sr.StorageRackNo,
                sr.StorageRackName,
                sb.InventoryBoxNo,
                sb.InventoryBoxName,
                s.IsDel,
                s.Remark,
                CName = scu.UserNickname,
                s.CreateDate,
                UName = smu.UserNickname,
                s.ModifiedDate
            }).MergeTable();

            if (!bootstrap.search.IsEmpty())
            {
                query.Where((s) => s.MaterialNo.Contains(bootstrap.search) || s.MaterialName.Contains(bootstrap.search));
            }
            if (!bootstrap.StorageRackId.IsEmpty())
            {
                query.Where(s => s.StorageRackId == bootstrap.StorageRackId);
            }
            if (!bootstrap.InventoryBoxId.IsEmpty())
            {
                query.Where(s => s.InventoryBoxId == bootstrap.InventoryBoxId);
            }
            if (!bootstrap.MaterialId.IsEmpty())
            {
                query.Where(s => s.MaterialId == bootstrap.MaterialId);
            }
            if (!bootstrap.datemin.IsEmpty() && !bootstrap.datemax.IsEmpty())
            {
                query.Where(s => s.CreateDate > bootstrap.datemin.ToDateTimeB() && s.CreateDate <= bootstrap.datemax.ToDateTimeE());
            }
            if (bootstrap.order.Equals("desc", StringComparison.OrdinalIgnoreCase))
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} desc");
            }
            else
            {
                query.OrderBy($"MergeTable.{bootstrap.sort} asc");
            }
            var list = query.ToPageList(bootstrap.offset, bootstrap.limit, ref totalNumber);

            return(Bootstrap.GridData(list, totalNumber).JilToJson());
        }