PackingData.ashx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. left join TP_PM_GroutingDailyDetail gdd on gdd.groutingdailydetailid = ip.groutingdailydetailid
  23. WHERE ip.procedureid in(10,9,57,67,15,16,81)
  24. and gt.goodstypecode like '001001%'
  25. and ip.reworkprocedureid is null
  26. and (gdd.luociflag is null or gdd.luociflag = 0)
  27. and gdd.goodscode not in('H0190P')
  28. group by ip.goodscode
  29. order by count(ip.barcode) desc
  30. ";
  31. //直接获取不分页数据
  32. DataTable dt = conn.ExecuteDatatable(sqlStr);
  33. context.Response.Write(new JsonResult(dt).ToJson());
  34. }
  35. //服务器时间
  36. if (context.Request["m"].ToString() == "fwq")
  37. {
  38. string time = DateTime.Now.ToString("yyyy年MM月dd日 HH:mm ");
  39. Dictionary<string, string> d = new Dictionary<string, string>();
  40. JObject json = new JObject(
  41. new JProperty("success", true),
  42. new JProperty("sj", time)
  43. );
  44. context.Response.Write(json.ToString());
  45. }
  46. }
  47. }
  48. public bool IsReusable {
  49. get {
  50. return false;
  51. }
  52. }
  53. }