| | |
| | | /// <summary> |
| | | /// Excel导入文件上传、模板验证、数据量、验证 |
| | | /// </summary> |
| | | /// <param name="files">上传文件</param> |
| | | /// <param name="FileCode">文件编码</param> |
| | | /// <param name="files">上传文件</param> |
| | | /// <returns></returns> |
| | | [Route(template: "ExcelModelCheck")] |
| | | [HttpPost] |
| | |
| | | else if (Directory.Exists(path) == false)//如果不存在就创建file文件夹 |
| | | { |
| | | Directory.CreateDirectory(path); //添加文件夹 |
| | | files.SaveAs(savePath); //将选择的文件保存到指定文件夹下 |
| | | mes.code = "200"; |
| | | mes.Message = "文件上传成功!"; |
| | | } |
| | | else if (Directory.Exists(savePath) == true) //如果存在重名文件就提示 |
| | | { |
| | |
| | | /// <param name="FileCode">文件编码</param> |
| | | /// <param name="FileName">文件名称</param> |
| | | /// <returns></returns> |
| | | [HiddenApi] |
| | | [Route(template: "ExcelCheckData")] |
| | | [HttpPost] |
| | | public HttpResponseMessage ExcelCheckData(string FileCode = null, string FileName = null) |
| | | { |
| | | string message = ""; |
| | |
| | | /// <param name="FileCode">文件编码</param> |
| | | /// <param name="FileName">文件名称</param> |
| | | /// <returns></returns> |
| | | [HiddenApi] |
| | | [Route(template: "ExcelImportSubmit")] |
| | | [HttpPost] |
| | | public HttpResponseMessage ExcelImportSubmit(string FileCode = null, string FileName = null) |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //登录用户名 |