/// <summary> /// 图片数据 /// </summary> /// <param name="userId">用户</param> /// <param name="entId">企业</param> /// <param name="sqlvalue"></param> /// <param name="type"></param> /// <param name="arguments"></param> /// <returns></returns> public ActionResult PicturesDownLoad(string userId, string entId, string sqlvalue, string type, string arguments = "") { try { if (string.IsNullOrEmpty(userId) || string.IsNullOrEmpty(entId)) { return(Json(new { success = false, message = "用户未登录,请先登录" })); } string str = HttpRuntime.AppDomainAppPath; string path, fileName; if (!string.IsNullOrEmpty(arguments)) { //同一批号图片进行处理 path = str + "FPImgupload\\" + type + "\\" + sqlvalue + "\\" + arguments; fileName = arguments; } else { path = str + "FPImgupload\\" + type + "\\" + sqlvalue; fileName = sqlvalue; } QualityInspectionReport report = new QualityInspectionReport(); var by = report.DlZipDir(path, fileName); return(File(by, "application/zip", "" + fileName + ".zip")); } catch (Exception ex) { LogQueue.Write(LogType.Error, "QualityInspectionReport/PicturesData", ex.Message.ToString()); return(Json(new { success = false, message = ex.Message.ToString() })); } }
/// <summary> /// 华烁质检报告打包下载 /// </summary> /// <param name="userId"></param> /// <param name="entId"></param> /// <param name="picUrls"></param> /// <returns></returns> public ActionResult QualityZipDown(string userId, string entId, List <string> picUrls) { try { if (string.IsNullOrEmpty(userId) || string.IsNullOrEmpty(entId)) { return(Json(new { success = false, message = "用户未登录,请先登录" })); } QualityInspectionReport report = new QualityInspectionReport(); string filePath = ""; report.QualityZipDown(picUrls, ref filePath); string zipName = DateTime.Now.ToString("yyyyMMddHHmmssfff"); var by = report.DlZipDir(filePath, zipName); return(File(by, "application/zip", zipName + ".zip")); } catch (Exception ex) { LogQueue.Write(LogType.Error, "QualityInspectionReport/QualityZipDown", ex.Message.ToString()); return(Json(new { success = false, message = ex.Message.ToString() })); } }