using DataSendApi.Program; using DataSendApi.Program.BLL; using DataSendApi.Program.BLL.Token; using DataSendApi.Program.Oracle; using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Web; using System.Web.Mvc; namespace DataSendApi.Controllers { public class HomeController : Controller { public ActionResult Index() { var sss = Common.GGSJZDLst; return View(); } public JsonResult UploadExcel() { HttpPostedFileBase file = Request.Files[0]; string directoryPath = ConfigurationManager.AppSettings["UploadPathExcelDataFilePath"] + "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/"; if (!System.IO.Directory.Exists(directoryPath)) { System.IO.Directory.CreateDirectory(directoryPath); } var strExt = System.IO.Path.GetExtension(file.FileName); var strGuidName = Guid.NewGuid().ToString().Replace("-", ""); string strRealName = strGuidName + strExt; string savePath = directoryPath + strRealName; file.SaveAs(savePath); var ret = new BusinessProcess().HandleByDatabase(savePath); return Json(ret); } public JsonResult GetPushJson(string tablename) { return Json(new BusinessProcess().ExecDataPush(tablename.ToUpper())); } public JsonResult GetDataAdd(string tableName, string startTime, string endTime, int page, int limit) { return Json(new BusinessProcess().GetPushDataAddCount(tableName, startTime, endTime, page, limit)); } public JsonResult GetTableCount(string tableName) { return Json(new BusinessProcess().GetTableCount(tableName)); } public JsonResult UpdatePushStatus(string tableName) { return Json(new BusinessProcess().UpdatePushStatus(tableName)); } } }