PackingData.ashx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <%@ WebHandler Language="C#" Class="SmallKanban" %>
  2. using System;
  3. using System.Web;
  4. using System.Web.SessionState;
  5. using System.Configuration;
  6. using System.Data;
  7. using Curtain.DataAccess;
  8. using Curtain.Log;
  9. using DK.XuWei.WebMes;
  10. using Newtonsoft.Json.Linq;
  11. using System.Collections.Generic;
  12. public class SmallKanban : IHttpHandler {
  13. public void ProcessRequest (HttpContext context) {
  14. using (IDataAccess conn = DataAccess.Create())
  15. {
  16. if (context.Request["m"].ToString() == "s")
  17. {
  18. string sqlStr = @"
  19. SELECT ip.goodscode ,count(ip.barcode) qty FROM Tp_Pm_Inproduction ip
  20. left join tp_mst_goods g on ip.goodsid = g.goodsid
  21. left join tp_mst_goodstype gt on g.goodstypeid = gt.goodstypeid
  22. WHERE ip.procedureid in(10,9,57,67,15,16,81)
  23. and gt.goodstypecode like '001001%'
  24. and ip.reworkprocedureid is null
  25. group by ip.goodscode
  26. order by count(ip.barcode) desc
  27. ";
  28. //直接获取不分页数据
  29. DataTable dt = conn.ExecuteDatatable(sqlStr);
  30. context.Response.Write(new JsonResult(dt).ToJson());
  31. }
  32. //服务器时间
  33. if (context.Request["m"].ToString() == "fwq")
  34. {
  35. string time = DateTime.Now.ToString("yyyy年MM月dd日 HH:mm ");
  36. Dictionary<string, string> d = new Dictionary<string, string>();
  37. JObject json = new JObject(
  38. new JProperty("success", true),
  39. new JProperty("sj", time)
  40. );
  41. context.Response.Write(json.ToString());
  42. }
  43. }
  44. }
  45. public bool IsReusable {
  46. get {
  47. return false;
  48. }
  49. }
  50. }