You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
268 lines
9.8 KiB
268 lines
9.8 KiB
using NFine.Application.SRM;
|
|
using NFine.Code;
|
|
using NFine.Domain._03_Entity.SRM;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Mvc;
|
|
|
|
namespace NFine.Web.Areas.SRM.Controllers
|
|
{
|
|
public class BicDoc_BidController : ControllerBase
|
|
{
|
|
private BicDoc_SellerApp App = new BicDoc_SellerApp();
|
|
//
|
|
// GET: /SRM/BicDoc_Bid/
|
|
public ActionResult ICSBidding_Bid()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult ICSBiddingAdd_Bid()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult ICSBiddingAdd_BidInfo()
|
|
{
|
|
return View();
|
|
}
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetGridJson(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetGridJsonBid(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetSubGridJson(string STNO, Pagination pagination, string WorkPoint)
|
|
{
|
|
DataTable ListData = App.GetSubGridJsonBid(STNO, ref pagination, WorkPoint);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
public ActionResult SearchBidDocBDInfoByBidCode(string BidCode, Pagination pagination)
|
|
{
|
|
DataTable ListData = App.SearchBidDocBDInfoByBidCode(BidCode, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
public ActionResult SearchBidDocGYSInfoByBidCode(string BidCode, Pagination pagination)
|
|
{
|
|
DataTable ListDatas = App.SearchBidDocGYSInfoByBidCode(BidCode, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListDatas,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetBidInfoByBidCodeAndBDID(string BidCode, string ID, string WorkPoint)
|
|
{
|
|
DataTable ListData = App.GetBidInfoByBidCodeAndBDID(BidCode, ID, WorkPoint);
|
|
var JsonData = new
|
|
{
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
public ActionResult SearchBidDocBDInfoByBidCodeAndID(string BidCode, string ID, string WorkPoint)
|
|
{
|
|
DataTable ListData = App.SearchBidDocBDInfoByBidCodeAndID(BidCode, ID, WorkPoint);
|
|
var JsonData = new
|
|
{
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpPost]
|
|
public ActionResult SaveFormZB(ICSBidInfoDetail main)
|
|
{
|
|
try
|
|
{
|
|
App.SaveFormZB(main);
|
|
return Success("保存成功");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Error(ex.Message);
|
|
}
|
|
|
|
}
|
|
public ActionResult SaveFormTiJiaoZB(string BidCode, ICSBidInfoDetail main)
|
|
{
|
|
try
|
|
{
|
|
App.SaveFormTiJiaoZB(BidCode, main);
|
|
return Success("保存成功");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Error(ex.Message);
|
|
}
|
|
|
|
}
|
|
public ActionResult SaveFormQuX(string BidCode, string WorkPoint)
|
|
{
|
|
try
|
|
{
|
|
App.SaveFormQuX(BidCode, WorkPoint);
|
|
return Success("保存成功");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Error(ex.Message);
|
|
}
|
|
|
|
}
|
|
public ActionResult SelectColumnName(string BidCode)
|
|
{
|
|
var data = App.SelectColumnName(BidCode);
|
|
return Content(data.ToJson());
|
|
}
|
|
[HttpGet]
|
|
public ActionResult GetListGridJsonTOZ(Pagination pagination, string BidCode)
|
|
{
|
|
DataTable ListData = App.GetListGridJsonTOZ(BidCode, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpGet]
|
|
public ActionResult GetListGridJsonTOZSUM(Pagination pagination, string BidCode)
|
|
{
|
|
DataTable ListData = App.GetListGridJsonTOZSUM(BidCode, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetECNSubmitPerson(string BidCode)
|
|
{
|
|
DataTable dt = App.GetECNSubmitPerson(BidCode);
|
|
return Content(dt.ToJson());
|
|
}
|
|
[HttpPost]
|
|
public void DownloadFile( string BidCode)
|
|
{
|
|
//获取服务器中的文件路径
|
|
List<string> listFJ = new List<string>();//保存附件路径
|
|
string filePath = Server.MapPath("~\\File\\ZTBFile\\ddddXX二期开发计划.xlsx");
|
|
listFJ.Add(filePath);
|
|
|
|
//foreach (string path in list)
|
|
//{
|
|
// string filepath = Server.MapPath("../../UploadFile/GongGong/" + path);
|
|
// //FTD.Unit.PublicMethod.DownloadFile(Server.MapPath("~"), filepath);
|
|
// listFJ.Add(filepath);
|
|
// listFJName.Add(path);
|
|
//}
|
|
string time = DateTime.Now.Ticks.ToString();
|
|
//压缩文件
|
|
//ZipFileMain(listFJ.ToArray(), null, Server.MapPath("~\\File\\ZTBFile\\" + time + ".zip"), 9);
|
|
//下载文件
|
|
DownloadFile("文件.zip", Server.MapPath("~\\File\\ZTBFile\\" + time + ".zip"));
|
|
//FTD.Unit.PublicMethod.DownloadFile(Server.MapPath("~"), "../../UploadFile/GongGong/" + time + ".zip");
|
|
}
|
|
private void DownloadFile(string fileName, string filePath)
|
|
{
|
|
FileInfo fileInfo = new FileInfo(filePath);
|
|
Response.Clear();
|
|
Response.ClearContent();
|
|
Response.ClearHeaders();
|
|
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
|
|
Response.AddHeader("Content-Length", fileInfo.Length.ToString());
|
|
Response.AddHeader("Content-Transfer-Encoding", "binary");
|
|
Response.ContentType = "application/octet-stream";
|
|
Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
|
|
Response.WriteFile(fileInfo.FullName);
|
|
Response.Flush();
|
|
System.IO.File.Delete(filePath);//删除已下载文件
|
|
Response.End();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 压缩文件
|
|
/// </summary>
|
|
/// <param name="filenames">要压缩的所有文件(完全路径)</param>
|
|
/// <param name="filename">名称</param>
|
|
/// <param name="name">压缩后文件路径</param>
|
|
/// <param name="Level">压缩级别</param>
|
|
//public void ZipFileMain(string[] filenames, string[] filename, string name, int Level)
|
|
//{
|
|
// ZipOutputStream s = new ZipOutputStream(System.IO.File.Create(name));
|
|
// Crc32 crc = new Crc32();
|
|
// //压缩级别
|
|
// s.SetLevel(Level);// 0 - store only to 9 - means best compression
|
|
// try
|
|
// {
|
|
// int m = 0;
|
|
// foreach (string file in filenames)
|
|
// {
|
|
// //打开压缩文件
|
|
// FileStream fs = System.IO.File.OpenRead(file);//文件地址
|
|
// byte[] buffer = new byte[fs.Length];
|
|
// fs.Read(buffer, 0, buffer.Length);
|
|
// //建立压缩实体
|
|
// ZipEntry entity = new ZipEntry(filename[m].ToString());//源文件名
|
|
// //时间
|
|
// entity.DateTime = DateTime.Now;
|
|
// //控件大小
|
|
// entity.Size = fs.Length;
|
|
// fs.Close();
|
|
// crc.Reset();
|
|
// crc.Update(buffer);
|
|
// entity.Crc = crc.Value;
|
|
// s.PutNextEntry(entity);
|
|
// s.Write(buffer, 0, buffer.Length);
|
|
// m++;
|
|
// }
|
|
// }
|
|
// catch (Exception)
|
|
// {
|
|
// throw;
|
|
// }
|
|
// finally
|
|
// {
|
|
// s.Finish();
|
|
// s.Close();
|
|
// }
|
|
//}
|
|
}
|
|
}
|