20240429 修改综合管理导入导出

This commit is contained in:
2024-04-29 19:13:54 +08:00
parent fc56b1f6c2
commit a3e123957d
48 changed files with 560 additions and 266 deletions
@@ -239,7 +239,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
protected void btnOut_Click(object sender, EventArgs e)
{
string rootPath = Server.MapPath("~/");
string initTemplatePath = Const.ConTechnologyDisclosureTempUrl;
string initTemplatePath = Const.ConTechnologyDisclosureTemUrl;
string uploadfilepath = string.Empty;
string newUrl = string.Empty;
uploadfilepath = rootPath + initTemplatePath;
@@ -259,10 +259,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{
lists = lists.Where(x => x.DisclosureCode.Contains(this.txtCode.Text.Trim()));
}
lists = lists.OrderBy(x => x.UnitId);
lists = lists.OrderBy(x => x.RemarkCode);
if (lists != null)
{
newUrl = uploadfilepath.Replace("施工技术交底管理模板.xls", "施工技术交底管理.xls");
string projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
newUrl = uploadfilepath.Replace("施工技术交底管理导入模板", "施工技术交底管理("+projectName+DateTime.Now.ToString("yyyyMMdd")+"");
File.Copy(uploadfilepath, newUrl);
// 第一步:读取文件流
NPOI.SS.UserModel.IWorkbook workbook;
@@ -297,7 +298,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
NPOI.SS.UserModel.ICell cell;
int i = 1;
int i = 2;
foreach (var item in lists)
{
// 第二步:创建新数据行
@@ -350,6 +351,10 @@ namespace FineUIPro.Web.CQMS.Comprehensive
cell = row.CreateCell(7);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.AttendMan);//参加人员
cell = row.CreateCell(8);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.RemarkCode.HasValue ? item.RemarkCode.ToString() : "");//标志编号
i++;
}
// 第三步:写入文件流