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

  1. using NFine.Domain._03_Entity.SRM;
  2. using NFine.Repository;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using NFine.Data.Extensions;
  9. using System.Data;
  10. using NFine.Code;
  11. using System.Data.Common;
  12. using Newtonsoft.Json;
  13. using System.Configuration;
  14. using System.Net;
  15. using System.IO;
  16. using Newtonsoft.Json.Linq;
  17. namespace NFine.Application.WMS
  18. {
  19. public class PrintLotNoOverall : RepositoryFactory<ICSVendor>
  20. {
  21. public DataTable GetGridJson(string queryJson, ref Pagination jqgridparam)
  22. {
  23. DataTable dt = new DataTable();
  24. var queryParam = queryJson.ToJObject();
  25. List<DbParameter> parameter = new List<DbParameter>();
  26. 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,
  27. c.ProjectCode,c.BatchCode,c.Version,c.Brand,c.cFree1,c.cFree2,c.cFree3,cFree4,cFree5,c.cFree6,c.cFree7,c.cFree8,cFree9,cFree10
  28. FROM ICSInventoryLot a
  29. LEFT JOIN ICSExtension c ON c.ID=a.ExtensionID
  30. WHERE 1=1 AND a.Type IN ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','101') ";
  31. if (!string.IsNullOrWhiteSpace(queryJson))
  32. {
  33. if (!string.IsNullOrWhiteSpace(queryParam["STNO"].ToString()))
  34. {
  35. sql += " and a.LotNo like '%" + queryParam["STNO"].ToString() + "%' ";
  36. }
  37. if (!string.IsNullOrWhiteSpace(queryParam["TimeFrom"].ToString()))
  38. {
  39. sql += " and a.MTIME >= '" + queryParam["TimeFrom"].ToString() + "' ";
  40. }
  41. if (!string.IsNullOrWhiteSpace(queryParam["TimeTo"].ToString()))
  42. {
  43. sql += " and a.MTIME <= '" + queryParam["TimeTo"].ToString() + "' ";
  44. }
  45. }
  46. //多站点
  47. if (NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode != "admin")
  48. {
  49. sql += " and a.WorkPoint in (" + NFine.Code.OperatorProvider.Provider.GetCurrent().Location.TrimEnd(',') + ")";
  50. }
  51. //if (NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode == "Vendor")
  52. //{
  53. // sql += " and a.VenCode='" + NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode + "'";
  54. //}
  55. return Repository().FindTablePageBySql(sql.ToString(), parameter.ToArray(), ref jqgridparam);
  56. }
  57. }
  58. }