Wang_to_U8.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using Common.Logging;
  2. using cuidian.Common;
  3. using cuidian.Sql;
  4. using Quartz;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Data;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading;
  11. using System.Threading.Tasks;
  12. using TempDbToUfida;
  13. using TempDbToUfida.OpenApi;
  14. using WangToTempDb;
  15. namespace TaskSchedule
  16. {
  17. [DisallowConcurrentExecution]
  18. public class Wang_to_U8 : IJob
  19. {
  20. private static readonly ILog Logger = LogManager.GetLogger("job2");
  21. #region 旺店通到中间初始化
  22. //List<IUpLoad> iup = new List<IUpLoad>
  23. //{
  24. // new DispatchListSendUpLoad()//销售出库8
  25. //};
  26. #endregion
  27. #region 中间到U8初始化
  28. //List<IDownLoad> idow = new List<IDownLoad>
  29. // {
  30. // new DownLoadReturnorder()//销售出库8
  31. // };
  32. #endregion
  33. List<string> entitys = new List<string>("供应商,仓库,存货,其他入库,其他出库,采购订单,采购入库,采购退货,销售出库".Split(','));
  34. Dictionary<string, string> args = new Dictionary<string, string>();
  35. //wang到u8
  36. public void Execute(IJobExecutionContext context)
  37. {
  38. #region 实现旺店通到中间
  39. //取表数据
  40. DataTable dt = DbUtils.Fill("select entitytype,lasttime from transtime", ConnectionUtils.Instance.GetConnection("TempDB"));
  41. //取初始时间
  42. args["start_time"] = Convert.ToDateTime(dt.Rows[8].ItemArray[1].ToString()).ToString("yyyy-MM-dd HH:mm:ss");
  43. //记录现在时间
  44. args["end_time"] = DateTime.Now.AddMinutes(-10).ToString("yyyy-MM-dd HH:mm:ss");
  45. new DispatchListUpLoad().UpLoad(args);
  46. Realize.GetDaysAndExecute(args, new DispatchListSendUpLoad(), entitys[8]);
  47. using (System.IO.StreamWriter sw = new System.IO.StreamWriter("C:\\销售出库到中间.txt", true))
  48. {
  49. Console.WriteLine("旺店通到中间" + "销售出库到中间");
  50. sw.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + "job3().to____" + "销售出库到中间");
  51. }
  52. #endregion
  53. Console.WriteLine("中间导入到U8" + "中间到U8的销售单");
  54. new DownLoadReturnorder().DownLoad();
  55. new DownLoadReturnorder().DownLoad();
  56. using (System.IO.StreamWriter sw = new System.IO.StreamWriter("C:\\销售出库到U8.txt", true))
  57. {
  58. sw.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + "endjob4().to____" + "中间到U8的销售单");
  59. }
  60. }
  61. }
  62. }