From 217b1d1672e84cfb3421f485d6f1a2ac0316c7fa Mon Sep 17 00:00:00 2001 From: ddlucky Date: Wed, 15 Mar 2023 13:52:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=89=AF=E9=80=9A=E6=8D=B7=E8=BF=90=E7=9A=84?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E4=BB=93=E5=82=A8=E9=83=A8=E5=88=86=EF=BC=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9=E4=B8=BA=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E6=96=B9=E5=BC=8F=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs | 8 +++- .../Controllers/WMSDetailController.cs | 7 +-- DSWeb/Areas/MvcShipping/DAL/WMS/WMSDAL.cs | 47 ++++++++++++------- .../Viewsjs/WMSImport/WMSDetailIndex.js | 27 +++++++++-- 4 files changed, 64 insertions(+), 25 deletions(-) diff --git a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs index abad1d82..25623f73 100644 --- a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs +++ b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs @@ -46,6 +46,7 @@ using Aspose.Cells.Drawing; using DSWeb.MvcShipping.Models.MsOp_BLISSUE; using System.Data.Entity.Migrations; using DSWeb.MvcContainer.Models.MsOpPrice; +using Microsoft.Owin; namespace DSWeb.Areas.CommMng.DAL { @@ -5836,9 +5837,10 @@ namespace DSWeb.Areas.CommMng.DAL /// /// 分页查询语句 + /// strSql查询语句必须包含where子句,没有的也要以where 1=1 结尾 。 /// /// - /// strSql查询语句必须以where 1=1 结尾 。 + /// /// public static StringBuilder PagedQuaryStr(PagedQuaryParam PagedQuaryParam) { @@ -5847,6 +5849,10 @@ namespace DSWeb.Areas.CommMng.DAL result.Append(@"SELECT * from (SELECT row_number() over ("); + //if (PagedQuaryParam.sortstring.IndexOf("[{") >= 0) { + // PagedQuaryParam.sortstring = DatasetSort.Getsortstring(PagedQuaryParam.sortstring); + //} + if (!string.IsNullOrEmpty(PagedQuaryParam.sortstring)) { result.Append(" order by " + PagedQuaryParam.sortstring); diff --git a/DSWeb/Areas/MvcShipping/Controllers/WMSDetailController.cs b/DSWeb/Areas/MvcShipping/Controllers/WMSDetailController.cs index 6ff46c00..0efb6416 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/WMSDetailController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/WMSDetailController.cs @@ -51,11 +51,12 @@ namespace DSWeb.MvcShipping.Controllers public ContentResult GetDataList ( int start, int limit, string sort, string condition ) { - var dataList = WMSDAL.GetDetailList(condition, sort); + var _count = 0; + var dataList = WMSDAL.GetDetailList( start, limit,condition, sort,out _count); - var list = dataList.Skip(start).Take(limit); + var list = dataList; - var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() }); + var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = _count, data = list.ToList() }); return new ContentResult() { Content = json }; } diff --git a/DSWeb/Areas/MvcShipping/DAL/WMS/WMSDAL.cs b/DSWeb/Areas/MvcShipping/DAL/WMS/WMSDAL.cs index 25f24c70..803e4840 100644 --- a/DSWeb/Areas/MvcShipping/DAL/WMS/WMSDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/WMS/WMSDAL.cs @@ -17,6 +17,7 @@ using DSWeb.EntityDA; using DSWeb.Models; using HcUtility.Comm; using DSWeb.Areas.CommMng.DAL; +using static DSWeb.Areas.CommMng.DAL.BasicDataRefDAL; namespace DSWeb.MvcShipping.DAL.WMS { @@ -2072,24 +2073,38 @@ namespace DSWeb.MvcShipping.DAL.WMS #region 出入库明细表 - static public List GetDetailList ( string strCondition, string sort ) + static public List GetDetailList (int start, int limit, string strCondition, string sort,out int recordcount) { //库存信息 - var strSql = new StringBuilder(); - strSql.Append(" select v.* from VW_WMS_DETAIL V WITH(NOLOCK)"); - - if (!string.IsNullOrEmpty(strCondition)) - { - strSql.Append(" where " + strCondition.Replace("~", "")); - } + //var strSql = new StringBuilder(); + //strSql.Append(" select v.* from VW_WMS_DETAIL V WITH(NOLOCK)"); + var sortstring = DatasetSort.Getsortstring(sort); - if (!string.IsNullOrEmpty(sortstring)) - { - strSql.Append(" order by " + sortstring); - } - else - { - strSql.Append(" order by v.MODIFIEDTIME "); - } + + PagedQuaryParam pp = new PagedQuaryParam(); + + pp.strSql = $" select v.* from VW_WMS_DETAIL V WITH(NOLOCK) where 1=1 "; + pp.start = start; + pp.limit = limit; + pp.strCondition = strCondition; + pp.defaultsortstr = "CUSTNO"; + pp.sortstring = sortstring; + + var strSql = PagedQuaryStr(pp); + + recordcount = PagedCount(pp); + //if (!string.IsNullOrEmpty(strCondition)) + //{ + // strSql.Append(" where " + strCondition.Replace("~", "")); + //} + //var sortstring = DatasetSort.Getsortstring(sort); + //if (!string.IsNullOrEmpty(sortstring)) + //{ + // strSql.Append(" order by " + sortstring); + //} + //else + //{ + // strSql.Append(" order by v.MODIFIEDTIME "); + //} return SetDetailData(strSql); } diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/WMSImport/WMSDetailIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/WMSImport/WMSDetailIndex.js index be97fe8b..d218878d 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/WMSImport/WMSDetailIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/WMSImport/WMSDetailIndex.js @@ -673,7 +673,23 @@ Ext.extend(Shipping.WMSDetailIndex, Ext.Panel, { } ]; - + + this.Pagenum = Ext.create('Ext.form.field.Number', { + name: 'bottles', + fieldLabel: '每页记录数', //'每页记录数', + labelAlign: 'right', + value: this.PageSize, + maxValue: 100000, + width: 180, + minValue: 0, + listeners: { + specialkey: function (field, e) { + if (e.getKey() == e.ENTER) { + _this.onRefreshClick(); + } + } + } + }); this.cellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 @@ -702,12 +718,13 @@ Ext.extend(Shipping.WMSDetailIndex, Ext.Panel, { // hideGroupedHeader: false, // enableGroupingMenu: true // }], - bbar: Ext.create('Ext.PagingToolbar', { + + bbar: [Ext.create('Ext.PagingToolbar', { store: this.storeList, displayInfo: true, - displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', - emptyMsg: "没有数据" - }) + displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', //'当前显示 {0} - {1}条记录 /共 {2}条记录', + emptyMsg: "没有数据"//'没有数据' + }), this.Pagenum] }); /////////////以下部分为获取存储的gridpanel显示样式