111
This commit is contained in:
@@ -239,6 +239,11 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
|
||||
if (tb.Rows.Count > 0 && tbTitle.Rows.Count > 0)
|
||||
{
|
||||
string jlAuditer = tb.Rows[0]["JLAuditID"].ToString();
|
||||
string glgsAuditer = tb.Rows[0]["GLGSAuditID"].ToString();
|
||||
var getJLInfo = BLL.Sys_UserService.GetSingtrueImageUrl(jlAuditer);
|
||||
var getGLGSInfo = BLL.Sys_UserService.GetSingtrueImageUrl(glgsAuditer);
|
||||
|
||||
var tbNum = tb.Rows.Count;
|
||||
var pageNum =
|
||||
tbNum < 17 ? 1
|
||||
@@ -247,6 +252,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
//循环页
|
||||
for (int i = 1; i <= pageNum; i++)
|
||||
{
|
||||
|
||||
#region 头部
|
||||
|
||||
ws = ClExcelCreateRow(ws, hssfworkbook, rowIndex, rowIndex + 5, style, 0, 20, true);
|
||||
@@ -461,7 +467,15 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
ws.GetRow(rowIndex + 8).GetCell(9).SetCellValue("年 月 日");
|
||||
ws.GetRow(rowIndex + 8).GetCell(12).SetCellValue("年 月 日");
|
||||
ws.GetRow(rowIndex + 8).GetCell(18).SetCellValue("年 月 日");
|
||||
|
||||
//插入签名图片
|
||||
if (!string.IsNullOrEmpty(getJLInfo.Item1))
|
||||
{
|
||||
InsertImage(hssfworkbook, ws, rowIndex + 6, 2, rowIndex + 6, 4, Server.MapPath(getJLInfo.Item1), 1, 1, 10);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(getGLGSInfo.Item1))
|
||||
{
|
||||
InsertImage(hssfworkbook, ws, rowIndex + 6, 5, rowIndex + 6, 6, Server.MapPath(getJLInfo.Item1), 1, 8);
|
||||
}
|
||||
#endregion
|
||||
|
||||
ws = ClExcelCreateRow(ws, hssfworkbook, rowIndex + 9, rowIndex + 9, style, 0, 20, false, true);
|
||||
@@ -502,6 +516,11 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
|
||||
if (tb.Rows.Count > 0 && tbTitle.Rows.Count > 0)
|
||||
{
|
||||
string jlAuditer = tb.Rows[0]["JLAuditID"].ToString();
|
||||
string glgsAuditer = tb.Rows[0]["GLGSAuditID"].ToString();
|
||||
var getJLInfo = BLL.Sys_UserService.GetSingtrueImageUrl(jlAuditer);
|
||||
var getGLGSInfo = BLL.Sys_UserService.GetSingtrueImageUrl(glgsAuditer);
|
||||
|
||||
var tbNum = tb.Rows.Count;
|
||||
var pageNum =
|
||||
tbNum < 15 ? 1
|
||||
@@ -792,8 +811,16 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
ws.GetRow(rowIndex + 8).GetCell(7).SetCellValue(" 年 月 日");
|
||||
ws.GetRow(rowIndex + 8).GetCell(11).SetCellValue(" 年 月 日");
|
||||
//尾部行9
|
||||
|
||||
|
||||
//插入签名图片
|
||||
if (!string.IsNullOrEmpty(getJLInfo.Item1))
|
||||
{
|
||||
InsertImage(hssfworkbook, ws, rowIndex + 6, 2, rowIndex + 6, 4, Server.MapPath(getJLInfo.Item1), 1, 1, 10);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(getGLGSInfo.Item1))
|
||||
{
|
||||
InsertImage(hssfworkbook, ws, rowIndex + 6, 5, rowIndex + 6, 6, Server.MapPath(getJLInfo.Item1), 1, 8);
|
||||
}
|
||||
#endregion
|
||||
|
||||
ws = WsExcelCreateRow(ws, hssfworkbook, rowIndex + 11, rowIndex + 11, style, 0, 12, 3, true);
|
||||
@@ -849,7 +876,16 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
#endregion
|
||||
|
||||
#region 私有方法
|
||||
private void InsertImage(XSSFWorkbook hssfworkbook, XSSFSheet ws, int row1, int col1, int row2, int col2, string img, double w, double h, int dx1 = 0, int dy1 = 0, int dx2 = 0, int dy2 = 0)
|
||||
{
|
||||
int pictureIdx = hssfworkbook.AddPicture(System.IO.File.ReadAllBytes(img), PictureType.PNG);
|
||||
IDrawing drawing = ws.CreateDrawingPatriarch();
|
||||
IClientAnchor anchor = new XSSFClientAnchor(dx1 * XSSFShape.EMU_PER_PIXEL, dy1 * XSSFShape.EMU_PER_POINT, dx2 * XSSFShape.EMU_PER_PIXEL, dy2 * XSSFShape.EMU_PER_POINT, col1, row1, col2, row2);
|
||||
IDrawing patriarch = ws.CreateDrawingPatriarch();
|
||||
IPicture pict = (XSSFPicture)patriarch.CreatePicture(anchor, pictureIdx);
|
||||
pict.Resize(w, h);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取某一列的所有值
|
||||
/// </summary>
|
||||
|
||||
@@ -727,6 +727,9 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
XSSFWorkbook hssfworkbook = new XSSFWorkbook();
|
||||
XSSFSheet ws = new XSSFSheet();
|
||||
string trustBatchId = this.tvControlItem.SelectedNodeID;
|
||||
|
||||
|
||||
|
||||
//头部
|
||||
var listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@TrustBatchId", trustBatchId));
|
||||
@@ -1049,6 +1052,11 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
|
||||
if (tb.Rows.Count > 0 && tbTitle.Rows.Count > 0)
|
||||
{
|
||||
string jlAuditer = tb.Rows[0]["JLAuditID"].ToString();
|
||||
string glgsAuditer = tb.Rows[0]["GLGSAuditID"].ToString();
|
||||
var getJLInfo = BLL.Sys_UserService.GetSingtrueImageUrl(jlAuditer);
|
||||
var getGLGSInfo=BLL.Sys_UserService.GetSingtrueImageUrl(glgsAuditer);
|
||||
|
||||
var tbNum = tb.Rows.Count;
|
||||
var pageNum =
|
||||
tbNum < 15 ? 1
|
||||
@@ -1311,6 +1319,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
region = new CellRangeAddress(hb, hb, 11, 12);
|
||||
ws.AddMergedRegion(region);
|
||||
}
|
||||
|
||||
//尾部行1
|
||||
ws.GetRow(rowIndex + 1).GetCell(0).SetCellValue("施工单位");
|
||||
ws.GetRow(rowIndex + 1).GetCell(2).SetCellValue("监理单位");
|
||||
@@ -1346,7 +1355,15 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
}
|
||||
ws.GetRow(rowIndex + 8).GetCell(7).SetCellValue(" 年 月 日");
|
||||
ws.GetRow(rowIndex + 8).GetCell(11).SetCellValue(" 年 月 日");
|
||||
|
||||
//插入签名图片
|
||||
if (!string.IsNullOrEmpty(getJLInfo.Item1))
|
||||
{
|
||||
InsertImage(hssfworkbook, ws, rowIndex + 6, 2, rowIndex + 6, 4, Server.MapPath(getJLInfo.Item1), 1, 1,10);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(getGLGSInfo.Item1))
|
||||
{
|
||||
InsertImage(hssfworkbook, ws, rowIndex + 6, 5, rowIndex + 6, 6, Server.MapPath(getJLInfo.Item1), 1, 8);
|
||||
}
|
||||
//尾部行9
|
||||
|
||||
#endregion
|
||||
@@ -1394,7 +1411,16 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
}
|
||||
|
||||
#region 私有方法
|
||||
private void InsertImage(XSSFWorkbook hssfworkbook, XSSFSheet ws, int row1, int col1, int row2, int col2, string img, double w, double h, int dx1 = 0, int dy1 = 0, int dx2 = 0, int dy2 = 0)
|
||||
{
|
||||
int pictureIdx = hssfworkbook.AddPicture(System.IO.File.ReadAllBytes(img), PictureType.PNG);
|
||||
IDrawing drawing = ws.CreateDrawingPatriarch();
|
||||
IClientAnchor anchor = new XSSFClientAnchor(dx1 * XSSFShape.EMU_PER_PIXEL, dy1 * XSSFShape.EMU_PER_POINT, dx2 * XSSFShape.EMU_PER_PIXEL, dy2 * XSSFShape.EMU_PER_POINT, col1, row1, col2, row2);
|
||||
IDrawing patriarch = ws.CreateDrawingPatriarch();
|
||||
IPicture pict = (XSSFPicture)patriarch.CreatePicture(anchor, pictureIdx);
|
||||
pict.Resize(w, h);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取某一列的所有值
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user