You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

62 lines
2.6 KiB

using NFine.Domain._03_Entity.SRM;
using NFine.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NFine.Data.Extensions;
using System.Data;
using NFine.Code;
using System.Data.Common;
using Newtonsoft.Json;
using System.Configuration;
using System.Net;
using System.IO;
using Newtonsoft.Json.Linq;
namespace NFine.Application.WMS
{
public class PrintLotNoOverall : RepositoryFactory<ICSVendor>
{
public DataTable GetGridJson(string queryJson, ref Pagination jqgridparam)
{
DataTable dt = new DataTable();
var queryParam = queryJson.ToJObject();
List<DbParameter> parameter = new List<DbParameter>();
string sql = @"SELECT DISTINCT a.ID,a.LotNo,a.InvCode,a.ProductDate,a.ExpirationDate,a.Quantity,a.Amount,a.Type,a.PrintTimes,a.LastPrintUser,a.LastPrintTime,a.MUSER,a.MUSERName,a.MTIME,a.WorkPoint,
c.ProjectCode,c.BatchCode,c.Version,c.Brand,c.cFree1,c.cFree2,c.cFree3,cFree4,cFree5,c.cFree6,c.cFree7,c.cFree8,cFree9,cFree10
FROM ICSInventoryLot a
LEFT JOIN ICSExtension c ON c.ID=a.ExtensionID
WHERE 1=1 AND a.Type IN ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','101') ";
if (!string.IsNullOrWhiteSpace(queryJson))
{
if (!string.IsNullOrWhiteSpace(queryParam["STNO"].ToString()))
{
sql += " and a.LotNo like '%" + queryParam["STNO"].ToString() + "%' ";
}
if (!string.IsNullOrWhiteSpace(queryParam["TimeFrom"].ToString()))
{
sql += " and a.MTIME >= '" + queryParam["TimeFrom"].ToString() + "' ";
}
if (!string.IsNullOrWhiteSpace(queryParam["TimeTo"].ToString()))
{
sql += " and a.MTIME <= '" + queryParam["TimeTo"].ToString() + "' ";
}
}
//多站点
if (NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode != "admin")
{
sql += " and a.WorkPoint in (" + NFine.Code.OperatorProvider.Provider.GetCurrent().Location.TrimEnd(',') + ")";
}
//if (NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode == "Vendor")
//{
// sql += " and a.VenCode='" + NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode + "'";
//}
return Repository().FindTablePageBySql(sql.ToString(), parameter.ToArray(), ref jqgridparam);
}
}
}