Browse Source

形态转换增加查询条件

master
yangtm 9 months ago
parent
commit
f6529b1ea0
  1. 19
      WMS-BS/NFine.Application/WMS/ICSMTDOCApp.cs
  2. 23
      WMS-BS/NFine.Web/Areas/WMS/Views/ICSMTDOC/Metamorphosis.cshtml

19
WMS-BS/NFine.Application/WMS/ICSMTDOCApp.cs

@ -30,7 +30,9 @@ namespace NFine.Application.WMS
List<DbParameter> parameter = new List<DbParameter>(); List<DbParameter> parameter = new List<DbParameter>();
#region [SQL] #region [SQL]
string sql = @" SELECT * FROM (select row_number() over(partition by a.MTDOCCode ORDER BY a.CreateDateTime) as row, a.MTDOCCode,a.CreatePerson,a.CreateDateTime,a.Status,a.MUSER,a.MUSERName,a.MTIME from ICSMTDOC a";
string sql = @" SELECT * FROM (select row_number() over(partition by a.MTDOCCode ORDER BY a.CreateDateTime) as row, a.MTDOCCode,a.CreatePerson,a.CreateDateTime,a.Status,a.MUSER,a.MUSERName,a.MTIME
from ICSMTDOC a
LEFT JOIN ICSInventoryDetail detail on a.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint ";
sql += " WHERE 1=1"; sql += " WHERE 1=1";
sql = string.Format(sql, DbHelper.GetErpIp(), DbHelper.GetErpName()); sql = string.Format(sql, DbHelper.GetErpIp(), DbHelper.GetErpName());
#endregion #endregion
@ -41,15 +43,19 @@ namespace NFine.Application.WMS
{ {
sql += " and a.MTDOCCode like '%" + queryParam["MTDOCCode"].ToString() + "%' "; sql += " and a.MTDOCCode like '%" + queryParam["MTDOCCode"].ToString() + "%' ";
} }
if (!string.IsNullOrWhiteSpace(queryParam["Area"].ToString()))
{
sql += " and detail.LocationCode='" + queryParam["Area"].ToString() + "'";
}
if (!string.IsNullOrWhiteSpace(queryParam["ReleaseState"].ToString()))
{
sql += " and a.Status = '" + queryParam["ReleaseState"].ToString() + "' ";
}
} }
if (NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode != "admin") if (NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode != "admin")
{ {
sql += " and a.WorkPoint='" + NFine.Code.OperatorProvider.Provider.GetCurrent().Location + "'"; sql += " and a.WorkPoint='" + NFine.Code.OperatorProvider.Provider.GetCurrent().Location + "'";
} }
//if (NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode == "Vendor")
//{
// sql += " and a.VenCode='" + NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode + "'";
//}
sql += " ) t WHERE t.Row=1"; sql += " ) t WHERE t.Row=1";
return Repository().FindTablePageBySql(sql.ToString(), parameter.ToArray(), ref jqgridparam); return Repository().FindTablePageBySql(sql.ToString(), parameter.ToArray(), ref jqgridparam);
} }
@ -61,11 +67,12 @@ namespace NFine.Application.WMS
string sql = string.Empty; string sql = string.Empty;
List<DbParameter> parameter = new List<DbParameter>(); List<DbParameter> parameter = new List<DbParameter>();
string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location.TrimEnd(','); string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location.TrimEnd(',');
sql = @" select a.ID,a.DepCode,d.DepName,a.WHCode,c.WarehouseName,a.Sequence,b.InvCode,b.InvName,a.Quantity,a.Amount,a.MTDOCQuantity,case WHEN a.MTDOCType='1' then '转换前' ELSE '转换后' END as MTDOCType
sql = @" select a.ID,a.DepCode,d.DepName,a.WHCode,c.WarehouseName,a.Sequence,b.InvCode,b.InvName,a.Quantity,a.Amount,a.MTDOCQuantity,case WHEN a.MTDOCType='1' then '转换前' ELSE '转换后' END as MTDOCType , detail.LocationCode AS Area
from ICSMTDOC a from ICSMTDOC a
left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint
left join ICSWarehouse c on a.WHCode=c.WarehouseCode and a.WorkPoint=c.WorkPoint left join ICSWarehouse c on a.WHCode=c.WarehouseCode and a.WorkPoint=c.WorkPoint
left join ICSDepartment d on a.DepCode=d.DepCode and a.WorkPoint=d.WorkPoint left join ICSDepartment d on a.DepCode=d.DepCode and a.WorkPoint=d.WorkPoint
LEFT JOIN ICSInventoryDetail detail on b.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint
WHERE a.MTDOCCode='{0}' and a.WorkPoint in ('{1}') order by a.Sequence "; WHERE a.MTDOCCode='{0}' and a.WorkPoint in ('{1}') order by a.Sequence ";
sql = string.Format(sql, MTDOCCode, WorkPoint); sql = string.Format(sql, MTDOCCode, WorkPoint);
return Repository().FindTableBySql(sql.ToString()); return Repository().FindTableBySql(sql.ToString());

23
WMS-BS/NFine.Web/Areas/WMS/Views/ICSMTDOC/Metamorphosis.cshtml

@ -15,6 +15,8 @@
var $gridList = $("#gridList"); var $gridList = $("#gridList");
var queryJson = { var queryJson = {
MTDOCCode: $("#txt_MTDOCCode").val(), MTDOCCode: $("#txt_MTDOCCode").val(),
Area: $("#txt_Area").val(),
ReleaseState: $("#selShow").val(),
} }
$gridList.dataGrid({ $gridList.dataGrid({
url: "/WMS/ICSMTDOC/GetGridJson" + "?" + Math.random(), url: "/WMS/ICSMTDOC/GetGridJson" + "?" + Math.random(),
@ -76,6 +78,8 @@
var warehouse = $("#warehouse a.active").attr('data-value'); var warehouse = $("#warehouse a.active").attr('data-value');
var queryJson = { var queryJson = {
MTDOCCode: $("#txt_MTDOCCode").val(), MTDOCCode: $("#txt_MTDOCCode").val(),
Area: $("#txt_Area").val(),
ReleaseState: $("#selShow").val(),
} }
$gridList.jqGrid('setGridParam', { $gridList.jqGrid('setGridParam', {
postData: { queryJson: JSON.stringify(queryJson) }, postData: { queryJson: JSON.stringify(queryJson) },
@ -107,6 +111,7 @@
{ label: '部门代码', name: 'DepCode', width: 100, align: 'left' }, { label: '部门代码', name: 'DepCode', width: 100, align: 'left' },
{ label: '部门名称', name: 'DepName', width: 100, align: 'left' }, { label: '部门名称', name: 'DepName', width: 100, align: 'left' },
{ label: '仓库代码', name: 'WHCode', width: 100, align: 'left' }, { label: '仓库代码', name: 'WHCode', width: 100, align: 'left' },
{ label: '区域', name: 'Area', width: 100, align: 'left' },
{ label: '仓库名称', name: 'WarehouseName', width: 100, align: 'left' }, { label: '仓库名称', name: 'WarehouseName', width: 100, align: 'left' },
//{ label: '条码', name: 'LotNo', width: 100, align: 'left' }, //{ label: '条码', name: 'LotNo', width: 100, align: 'left' },
{ label: '料品编码', name: 'InvCode', width: 100, align: 'left' }, { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
@ -204,6 +209,24 @@
<input id="txt_MTDOCCode" type="text" class="form-control" style="width: 100px;"> <input id="txt_MTDOCCode" type="text" class="form-control" style="width: 100px;">
</div> </div>
</td> </td>
<td style="text-align:right;"><label class="lglabel " for="txt_Area">&nbsp;&nbsp;&nbsp;&nbsp;区域</label>:</td>
<td>
<div class="input-group ">
<input id="txt_Area" type="text" class="form-control " style="width: 100px;">
</div>
</td>
<td>
<label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;单据状态:</label>
</td>
<td>
<div class="input-group">
<select id="selShow" name="F_Target" class="form-control" style="width: 105px;">
<option value="1">开立</option>
<option value="2">审核</option>
<option value="3">关闭</option>
</select>
</div>
</td>
<td> <td>
<span class="input-group-btn"> <span class="input-group-btn">
<button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button> <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>

Loading…
Cancel
Save