智慧大脑
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

70 satır
2.0 KiB

  1. using DataSendApi.Program;
  2. using DataSendApi.Program.BLL;
  3. using DataSendApi.Program.BLL.Token;
  4. using DataSendApi.Program.Oracle;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Configuration;
  8. using System.Linq;
  9. using System.Web;
  10. using System.Web.Mvc;
  11. namespace DataSendApi.Controllers
  12. {
  13. public class HomeController : Controller
  14. {
  15. public ActionResult Index()
  16. {
  17. var sss = Common.GGSJZDLst;
  18. return View();
  19. }
  20. public JsonResult UploadExcel()
  21. {
  22. HttpPostedFileBase file = Request.Files[0];
  23. string directoryPath = ConfigurationManager.AppSettings["UploadPathExcelDataFilePath"] + "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
  24. if (!System.IO.Directory.Exists(directoryPath))
  25. {
  26. System.IO.Directory.CreateDirectory(directoryPath);
  27. }
  28. var strExt = System.IO.Path.GetExtension(file.FileName);
  29. var strGuidName = Guid.NewGuid().ToString().Replace("-", "");
  30. string strRealName = strGuidName + strExt;
  31. string savePath = directoryPath + strRealName;
  32. file.SaveAs(savePath);
  33. var ret = new BusinessProcess().HandleByDatabase(savePath);
  34. return Json(ret);
  35. }
  36. public JsonResult GetPushJson(string tablename)
  37. {
  38. return Json(new BusinessProcess().ExecDataPush(tablename.ToUpper()));
  39. }
  40. public JsonResult GetDataAdd(string tableName,
  41. string startTime,
  42. string endTime,
  43. int page,
  44. int limit)
  45. {
  46. return Json(new BusinessProcess().GetPushDataAddCount(tableName, startTime, endTime, page, limit));
  47. }
  48. public JsonResult GetTableCount(string tableName)
  49. {
  50. return Json(new BusinessProcess().GetTableCount(tableName));
  51. }
  52. public JsonResult UpdatePushStatus(string tableName)
  53. {
  54. return Json(new BusinessProcess().UpdatePushStatus(tableName));
  55. }
  56. }
  57. }