良通捷运的明细仓储部分,查询修改为通用分页方式;

DS7_JinGang
ddlucky 2 years ago
parent 2d17c38117
commit 217b1d1672

@ -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
/// <summary>
/// 分页查询语句
/// strSql查询语句必须包含where子句没有的也要以where 1=1 结尾 。
/// </summary>
/// <param name="PagedQuaryParam"></param>
/// strSql查询语句必须以where 1=1 结尾 。
///
/// <returns></returns>
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);

@ -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 };
}

@ -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<WMSDetailmb> GetDetailList ( string strCondition, string sort )
static public List<WMSDetailmb> 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);
}

@ -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显示样式

Loading…
Cancel
Save