2023-09-12 17:09:35 +08:00
|
|
|
|
using Aspose.Words;
|
|
|
|
|
|
using BLL;
|
2023-09-12 09:09:49 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Data.SqlClient;
|
2023-09-12 17:09:35 +08:00
|
|
|
|
using System.IO;
|
2023-09-12 09:09:49 +08:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.DigData
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class CQMSDataCollect : PageBase
|
|
|
|
|
|
{
|
|
|
|
|
|
#region 加载
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 加载页面
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
|
{
|
|
|
|
|
|
ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, false);
|
|
|
|
|
|
this.drpYear.SelectedValue = DateTime.Now.Year.ToString();
|
|
|
|
|
|
var getCQMSDataCollect = CQMSDataCollectService.GetCQMSDataCollectByYear(DateTime.Now.Year);
|
|
|
|
|
|
if (getCQMSDataCollect == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
CQMSDataCollectService.CreateCQMSDataCollectByYear(DateTime.Now.Year);
|
|
|
|
|
|
}
|
|
|
|
|
|
// 绑定表格
|
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
|
this.BindGrid2();
|
|
|
|
|
|
if (this.CurrUser.PersonId == Const.sysglyId || this.CurrUser.PersonId == Const.hfnbdId)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.btnRefresh.Hidden = false;
|
|
|
|
|
|
this.btnDel.Hidden = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 绑定数据Grid1
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绑定数据Grid1
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void BindGrid()
|
|
|
|
|
|
{
|
|
|
|
|
|
var getData = Funs.DB.Sp_DigData_CQMSDataCollect(Funs.GetNewIntOrZero(this.drpYear.SelectedValue));
|
|
|
|
|
|
DataTable tb = GetTreeDataTable(getData.ToList()); //this.LINQToDataTable(getData.ToList());
|
|
|
|
|
|
Grid1.RecordCount = tb.Rows.Count;
|
|
|
|
|
|
var table = this.GetPagedDataTable(Grid1, tb);
|
|
|
|
|
|
Grid1.DataSource = table;
|
|
|
|
|
|
Grid1.DataBind();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取模拟树表格
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public DataTable GetTreeDataTable(List<Model.DigDataCQMSDataCollectItem> getData)
|
|
|
|
|
|
{
|
|
|
|
|
|
DataTable table = new DataTable();
|
|
|
|
|
|
table.Columns.Add(new DataColumn("CQMSDataCollectItemId", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("ParentId", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("SortIndex", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("CQMSContent", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("MeasureUnit", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("Month1", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("Month2", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("Month3", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("Month4", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("Month5", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("Month6", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("Month7", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("Month8", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("Month9", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("Month10", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("Month11", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("Month12", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("MonthSum", typeof(string)));
|
|
|
|
|
|
table.Columns.Add(new DataColumn("IntS", typeof(int)));
|
|
|
|
|
|
DataRow row;
|
|
|
|
|
|
for (int i = 1; i <= 4; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
row = table.NewRow();
|
|
|
|
|
|
row[0] = i.ToString();
|
|
|
|
|
|
row[1] = "-1";
|
|
|
|
|
|
row[2] = i.ToString();
|
|
|
|
|
|
row[3] = getSupCQMSContent(i);
|
|
|
|
|
|
row[18] = i;
|
|
|
|
|
|
table.Rows.Add(row);
|
|
|
|
|
|
}
|
2023-09-12 17:09:35 +08:00
|
|
|
|
decimal sum5 = 0, sum6 = 0, sum9 = 0, sum10 = 0, sum12 = 0, sum13 = 0, sum15 = 0, sum16 = 0, sum18 = 0, sum20 = 0, sum22 = 0, sum24 = 0;
|
2023-09-12 09:09:49 +08:00
|
|
|
|
foreach (var item in getData)
|
|
|
|
|
|
{
|
|
|
|
|
|
row = table.NewRow();
|
|
|
|
|
|
row[0] = item.CQMSDataCollectItemId;
|
|
|
|
|
|
row[1] = getSupID(item.SortIndex);
|
|
|
|
|
|
row[2] = row[1].ToString() + "." + getNewSortIndex(item.SortIndex);
|
|
|
|
|
|
row[3] = item.CQMSContent;
|
|
|
|
|
|
row[4] = item.MeasureUnit;
|
|
|
|
|
|
row[5] = item.Month1;
|
|
|
|
|
|
row[6] = item.Month2;
|
|
|
|
|
|
row[7] = item.Month3;
|
|
|
|
|
|
row[8] = item.Month4;
|
|
|
|
|
|
row[9] = item.Month5;
|
|
|
|
|
|
row[10] = item.Month6;
|
|
|
|
|
|
row[11] = item.Month7;
|
|
|
|
|
|
row[12] = item.Month8;
|
|
|
|
|
|
row[13] = item.Month9;
|
|
|
|
|
|
row[14] = item.Month10;
|
|
|
|
|
|
row[15] = item.Month11;
|
|
|
|
|
|
row[16] = item.Month12;
|
2023-09-12 17:09:35 +08:00
|
|
|
|
if (item.SortIndex == 8)
|
|
|
|
|
|
{
|
2025-10-10 14:33:21 +08:00
|
|
|
|
if (sum5 > 0 && (sum5 - sum6) > 0)
|
2023-09-12 17:09:35 +08:00
|
|
|
|
{
|
|
|
|
|
|
row[17] = ((sum5 - sum6) / sum5 * 100).ToString("0.##") + "%";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 11)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (sum9 > 0 && (sum9 - sum10) > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
row[17] = ((sum9 - sum10) / sum9 * 100).ToString("0.##") + "%";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 14)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (sum12 > 0 && sum13 > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
row[17] = (sum13 / sum12 * 100).ToString("0.##") + "%";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 17)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (sum15 > 0 && sum16 > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
row[17] = (sum16 / sum15 * 100).ToString("0.##") + "%";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 21)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (sum18 > 0 && sum20 > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
row[17] = (sum20 / sum18 * 100).ToString("0.##") + "%";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 25)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (sum22 > 0 && sum24 > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
row[17] = (sum24 / sum22 * 100).ToString("0.##") + "%";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
row[17] = item.MonthSum;
|
|
|
|
|
|
}
|
2023-09-12 09:09:49 +08:00
|
|
|
|
row[18] = item.SortIndex;
|
|
|
|
|
|
table.Rows.Add(row);
|
2023-09-12 17:09:35 +08:00
|
|
|
|
if (item.SortIndex == 5)
|
|
|
|
|
|
{
|
|
|
|
|
|
sum5 = Funs.GetNewDecimalOrZero(item.MonthSum);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 6)
|
|
|
|
|
|
{
|
|
|
|
|
|
sum6 = Funs.GetNewDecimalOrZero(item.MonthSum);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 9)
|
|
|
|
|
|
{
|
|
|
|
|
|
sum9 = Funs.GetNewDecimalOrZero(item.MonthSum);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 10)
|
|
|
|
|
|
{
|
|
|
|
|
|
sum10 = Funs.GetNewDecimalOrZero(item.MonthSum);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 12)
|
|
|
|
|
|
{
|
|
|
|
|
|
sum12 = Funs.GetNewDecimalOrZero(item.MonthSum);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 13)
|
|
|
|
|
|
{
|
|
|
|
|
|
sum13 = Funs.GetNewDecimalOrZero(item.MonthSum);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 15)
|
|
|
|
|
|
{
|
|
|
|
|
|
sum15 = Funs.GetNewDecimalOrZero(item.MonthSum);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 16)
|
|
|
|
|
|
{
|
|
|
|
|
|
sum16 = Funs.GetNewDecimalOrZero(item.MonthSum);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 18)
|
|
|
|
|
|
{
|
|
|
|
|
|
sum18 = Funs.GetNewDecimalOrZero(item.MonthSum);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 20)
|
|
|
|
|
|
{
|
|
|
|
|
|
sum20 = Funs.GetNewDecimalOrZero(item.MonthSum);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 22)
|
|
|
|
|
|
{
|
|
|
|
|
|
sum22 = Funs.GetNewDecimalOrZero(item.MonthSum);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.SortIndex == 24)
|
|
|
|
|
|
{
|
|
|
|
|
|
sum24 = Funs.GetNewDecimalOrZero(item.MonthSum);
|
|
|
|
|
|
}
|
2023-09-12 09:09:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
return table;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 获取父级名称
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取父级名称
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="i"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
private string getSupCQMSContent(int i)
|
|
|
|
|
|
{
|
|
|
|
|
|
string name = string.Empty;
|
|
|
|
|
|
switch (i)
|
|
|
|
|
|
{
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
name = "质量缺陷/不合格项整改关闭情况";
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
name = "无损检测情况";
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
name = "焊工资格评定情况";
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 4:
|
|
|
|
|
|
name = "质量验收情况";
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
name = "";
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
return name;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 获取父级ID
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取父级名称
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="i"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
private string getSupID(int sortIndex)
|
|
|
|
|
|
{
|
|
|
|
|
|
string supId = "-1";
|
|
|
|
|
|
if (sortIndex <= 4)
|
|
|
|
|
|
{
|
|
|
|
|
|
supId = "1";
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (sortIndex > 4 && sortIndex <= 11)
|
|
|
|
|
|
{
|
|
|
|
|
|
supId = "2";
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (sortIndex > 11 && sortIndex <= 17)
|
|
|
|
|
|
{
|
|
|
|
|
|
supId = "3";
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (sortIndex > 17)
|
|
|
|
|
|
{
|
|
|
|
|
|
supId = "4";
|
|
|
|
|
|
}
|
|
|
|
|
|
return supId;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string getNewSortIndex(int sortIndex)
|
|
|
|
|
|
{
|
|
|
|
|
|
int supId = 1;
|
|
|
|
|
|
if (sortIndex <= 6)
|
|
|
|
|
|
{
|
|
|
|
|
|
supId = sortIndex;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (sortIndex >= 8 && sortIndex <= 18)
|
|
|
|
|
|
{
|
|
|
|
|
|
supId = sortIndex - 7;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (sortIndex >= 22 && sortIndex <= 24)
|
|
|
|
|
|
{
|
|
|
|
|
|
supId = sortIndex - 21;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (sortIndex >= 25 && sortIndex <= 35)
|
|
|
|
|
|
{
|
|
|
|
|
|
supId = sortIndex - 24;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (sortIndex >= 36 && sortIndex <= 37)
|
|
|
|
|
|
{
|
|
|
|
|
|
supId = sortIndex - 35;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (sortIndex >= 38 && sortIndex <= 39)
|
|
|
|
|
|
{
|
|
|
|
|
|
supId = sortIndex - 37;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return supId.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 绑定数据Grid2
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绑定数据Grid2
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void BindGrid2()
|
|
|
|
|
|
{
|
|
|
|
|
|
string strSql = @"SELECT CQMSDataCollectSubmissionId,CQMSDataCollectId,Year,C.ProjectId,P.ProjectCode,P.ProjectName, Month1,Month2,Month3,Month4,Month5,Month6,Month7,Month8,Month9,Month10,Month11,Month12
|
|
|
|
|
|
FROM dbo.DigData_CQMSDataCollectSubmission AS C
|
|
|
|
|
|
LEFT JOIN Base_Project AS P ON C.ProjectId=P.ProjectId
|
|
|
|
|
|
WHERE (Month1 IS NOT NULL OR Month2 IS NOT NULL OR Month3 IS NOT NULL OR Month4 IS NOT NULL OR Month5 IS NOT NULL OR Month6 IS NOT NULL OR Month7 IS NOT NULL OR Month8 IS NOT NULL OR Month9 IS NOT NULL OR Month10 IS NOT NULL OR Month11 IS NOT NULL OR Month12 IS NOT NULL)
|
|
|
|
|
|
AND ProjectState ='1' ";
|
|
|
|
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
|
|
|
|
|
if (this.drpYear.SelectedValue != BLL.Const._Null)
|
|
|
|
|
|
{
|
|
|
|
|
|
strSql += " AND Year = @Year";
|
|
|
|
|
|
listStr.Add(new SqlParameter("@Year", Funs.GetNewInt(this.drpYear.SelectedValue)));
|
|
|
|
|
|
}
|
|
|
|
|
|
SqlParameter[] parameter = listStr.ToArray();
|
|
|
|
|
|
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
|
|
|
|
|
Grid2.RecordCount = tb.Rows.Count;
|
|
|
|
|
|
var table = this.GetPagedDataTable(Grid2, tb);
|
|
|
|
|
|
Grid2.DataSource = table;
|
|
|
|
|
|
Grid2.DataBind();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 查询
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void TextBox_TextChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
int year = Funs.GetNewInt(this.drpYear.SelectedValue) ?? DateTime.Now.Year;
|
|
|
|
|
|
var getCQMSDataCollect = CQMSDataCollectService.GetCQMSDataCollectByYear(year);
|
|
|
|
|
|
if (getCQMSDataCollect == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
CQMSDataCollectService.CreateCQMSDataCollectByYear(year);
|
|
|
|
|
|
}
|
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
|
this.BindGrid2();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void btnRefresh_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
int year = Funs.GetNewInt(this.drpYear.SelectedValue) ?? DateTime.Now.Year;
|
|
|
|
|
|
var getCheck_CheckMonths = from x in Funs.DB.Check_CheckMonth
|
2025-10-10 14:33:21 +08:00
|
|
|
|
where x.Months.Value.Year == year
|
|
|
|
|
|
orderby x.Months
|
2023-09-12 09:09:49 +08:00
|
|
|
|
select x;
|
|
|
|
|
|
if (getCheck_CheckMonths.Count() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var item in getCheck_CheckMonths)
|
|
|
|
|
|
{
|
|
|
|
|
|
BLL.CQMSDataCollectService.SaveCQMSDataCollectItem(item);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
|
this.BindGrid2();
|
|
|
|
|
|
ShowNotify("刷新完成!", MessageBoxIcon.Success);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void Grid2_RowCommand(object sender, GridCommandEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
int? year = Funs.GetNewInt(this.drpYear.SelectedValue);
|
|
|
|
|
|
int? month = Funs.GetNewInt(e.CommandName);
|
|
|
|
|
|
if (year.HasValue && month.HasValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
var getSubmission = Funs.DB.DigData_CQMSDataCollectSubmission.FirstOrDefault(x => x.CQMSDataCollectSubmissionId == e.RowID);
|
|
|
|
|
|
if (getSubmission != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var getMont = Funs.DB.Check_CheckMonth.FirstOrDefault(x => x.Months.Value.Year == year.Value && x.Months.Value.Month == month.Value && x.ProjectId == getSubmission.ProjectId);
|
|
|
|
|
|
if (getMont != null)
|
|
|
|
|
|
{
|
2023-09-12 17:09:35 +08:00
|
|
|
|
#region 导出质量月报
|
|
|
|
|
|
string fileId = getMont.CheckMonthId;
|
|
|
|
|
|
string rootPath = Server.MapPath("~/");
|
|
|
|
|
|
string initTemplatePath = string.Empty;
|
|
|
|
|
|
string uploadfilepath = string.Empty;
|
|
|
|
|
|
string newUrl = string.Empty;
|
|
|
|
|
|
string unitType = string.Empty;
|
|
|
|
|
|
string auditDate = string.Empty;
|
|
|
|
|
|
string filePath = string.Empty;
|
|
|
|
|
|
string auditMan1 = string.Empty;
|
|
|
|
|
|
string auditMan2 = string.Empty;
|
|
|
|
|
|
string auditDate1 = string.Empty;
|
|
|
|
|
|
string approveIdea1 = string.Empty;
|
|
|
|
|
|
string approveIdea2 = string.Empty;
|
|
|
|
|
|
string approveIdea3 = string.Empty;
|
|
|
|
|
|
string auditDate2 = string.Empty;
|
|
|
|
|
|
string auditDate3 = string.Empty;
|
|
|
|
|
|
string auditMan3 = string.Empty;
|
|
|
|
|
|
string auditMan4 = string.Empty;
|
|
|
|
|
|
string approveIdea = string.Empty;
|
|
|
|
|
|
Model.Check_CheckMonth checkMonth = CheckMonthService.GetCheckMonth(fileId);
|
|
|
|
|
|
Model.Project_Sys_Set CheckMonthStartDay = BLL.Project_SysSetService.GetSysSetBySetName("月报开始日期", this.CurrUser.LoginProjectId);
|
|
|
|
|
|
Model.Project_Sys_Set CheckMonthEndDay = BLL.Project_SysSetService.GetSysSetBySetName("月报结束日期", this.CurrUser.LoginProjectId);
|
|
|
|
|
|
DateTime startTime = Convert.ToDateTime(checkMonth.Months.Value.AddMonths(-1).Year.ToString() + "-" + checkMonth.Months.Value.AddMonths(-1).Month.ToString() + "-25");
|
|
|
|
|
|
DateTime endTime = startTime.AddMonths(1);
|
|
|
|
|
|
if (CheckMonthStartDay != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (CheckMonthStartDay.SetValue != "")
|
|
|
|
|
|
{
|
|
|
|
|
|
if (CheckMonthEndDay != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (CheckMonthEndDay.SetValue != "")
|
|
|
|
|
|
{
|
|
|
|
|
|
startTime = Convert.ToDateTime(checkMonth.Months.Value.AddMonths(-1).Year.ToString() + "-" + checkMonth.Months.Value.AddMonths(-1).Month.ToString() + "-" + CheckMonthStartDay.SetValue);
|
|
|
|
|
|
endTime = Convert.ToDateTime(checkMonth.Months.Value.AddMonths(-1).Year.ToString() + "-" + checkMonth.Months.Value.Month.ToString() + "-" + CheckMonthEndDay.SetValue);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
startTime = Convert.ToDateTime(checkMonth.Months.Value.AddMonths(-1).Year.ToString() + "-" + checkMonth.Months.Value.AddMonths(-1).Month.ToString() + "-" + CheckMonthStartDay.SetValue);
|
|
|
|
|
|
endTime = startTime.AddMonths(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
startTime = Convert.ToDateTime(checkMonth.Months.Value.AddMonths(-1).Year.ToString() + "-" + checkMonth.Months.Value.AddMonths(-1).Month.ToString() + "-" + CheckMonthStartDay.SetValue);
|
|
|
|
|
|
endTime = startTime.AddMonths(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (CheckMonthEndDay != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (CheckMonthEndDay.SetValue != "")
|
|
|
|
|
|
{
|
|
|
|
|
|
startTime = Convert.ToDateTime(checkMonth.Months.Value.AddMonths(-1).Year.ToString() + "-" + checkMonth.Months.Value.AddMonths(-1).Month.ToString() + "-" + CheckMonthEndDay.SetValue);
|
|
|
|
|
|
endTime = startTime.AddMonths(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (CheckMonthEndDay != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (CheckMonthEndDay.SetValue != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
startTime = Convert.ToDateTime(checkMonth.Months.Value.AddMonths(-1).Year.ToString() + "-" + checkMonth.Months.Value.AddMonths(-1).Month.ToString() + "-" + CheckMonthEndDay.SetValue);
|
|
|
|
|
|
endTime = startTime.AddMonths(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
initTemplatePath = Const.CheckMonthTemplateUrl;
|
|
|
|
|
|
uploadfilepath = rootPath + initTemplatePath;
|
|
|
|
|
|
newUrl = uploadfilepath.Replace(".doc", string.Format("{0:yyyy-MM}", checkMonth.Months) + ".doc");
|
|
|
|
|
|
filePath = initTemplatePath.Replace(".doc", string.Format("{0:yyyy-MM}", checkMonth.Months) + ".pdf");
|
|
|
|
|
|
File.Copy(uploadfilepath, newUrl);
|
|
|
|
|
|
//更新书签内容
|
|
|
|
|
|
Document doc = new Aspose.Words.Document(newUrl);
|
|
|
|
|
|
Bookmark bookmarkProjectName = doc.Range.Bookmarks["ProjectName"];
|
|
|
|
|
|
if (bookmarkProjectName != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var project = ProjectService.GetProjectByProjectId(checkMonth.ProjectId);
|
|
|
|
|
|
if (project != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkProjectName.Text = project.ProjectName;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkYear1 = doc.Range.Bookmarks["Year1"];
|
|
|
|
|
|
if (bookmarkYear1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkYear1.Text = startTime.Year.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkMonth1 = doc.Range.Bookmarks["Month1"];
|
|
|
|
|
|
if (bookmarkMonth1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkMonth1.Text = startTime.Month.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkDay1 = doc.Range.Bookmarks["Day1"];
|
|
|
|
|
|
if (bookmarkDay1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkDay1.Text = startTime.Day.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkYear2 = doc.Range.Bookmarks["Year2"];
|
|
|
|
|
|
if (bookmarkYear2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkYear2.Text = endTime.Year.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkMonth2 = doc.Range.Bookmarks["Month2"];
|
|
|
|
|
|
if (bookmarkMonth2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkMonth2.Text = endTime.Month.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkDay2 = doc.Range.Bookmarks["Day2"];
|
|
|
|
|
|
if (bookmarkDay2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkDay2.Text = (endTime.Day).ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkManagementOverview = doc.Range.Bookmarks["ManagementOverview"];
|
|
|
|
|
|
if (bookmarkManagementOverview != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkManagementOverview.Text = checkMonth.ManagementOverview ?? "";
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkAccidentSituation = doc.Range.Bookmarks["AccidentSituation"];
|
|
|
|
|
|
if (bookmarkAccidentSituation != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkAccidentSituation.Text = checkMonth.AccidentSituation ?? "";
|
|
|
|
|
|
}
|
|
|
|
|
|
Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc);
|
|
|
|
|
|
//质量缺陷/不合格项整改关闭情况
|
|
|
|
|
|
var MonthRectifylist = MonthRectifyService.getListData(fileId);
|
|
|
|
|
|
List<Model.View_Check_JointCheckDetail> checkLists = JointCheckDetailService.GetJointCheckDetailListByTime(CurrUser.LoginProjectId, startTime, endTime);
|
|
|
|
|
|
List<Model.View_Check_JointCheckDetail> totalCheckLists = JointCheckDetailService.GetTotalJointCheckDetailListByTime(CurrUser.LoginProjectId, endTime);
|
|
|
|
|
|
var MonthRectify1 = MonthRectifylist.FirstOrDefault(x => x.Depart == "质量监督站");
|
|
|
|
|
|
Bookmark bookmarkThisCheck1 = doc.Range.Bookmarks["ThisCheck1"];
|
|
|
|
|
|
if (bookmarkThisCheck1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCheck1.Text = MonthRectify1.ThisRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCheck1.Text = checkLists.Where(x => x.ProposeUnitType == "11").Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisOKCheck1 = doc.Range.Bookmarks["ThisOKCheck1"];
|
|
|
|
|
|
if (bookmarkThisOKCheck1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKCheck1.Text = MonthRectify1.ThisOKRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKCheck1.Text = checkLists.Where(x => x.ProposeUnitType == "11" && x.OK == 1).Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCheck1 = doc.Range.Bookmarks["TotalCheck1"];
|
|
|
|
|
|
if (bookmarkTotalCheck1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCheck1.Text = MonthRectify1.TotalRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCheck1.Text = totalCheckLists.Where(x => x.ProposeUnitType == "11").Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKCheck1 = doc.Range.Bookmarks["TotalOKCheck1"];
|
|
|
|
|
|
if (bookmarkTotalOKCheck1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKCheck1.Text = MonthRectify1.TotalOKRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKCheck1.Text = totalCheckLists.Where(x => x.ProposeUnitType == "11" && x.OK == 1).Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var MonthRectify2 = MonthRectifylist.FirstOrDefault(x => x.Depart == "集团公司");
|
|
|
|
|
|
Bookmark bookmarkThisCheck2 = doc.Range.Bookmarks["ThisCheck2"];
|
|
|
|
|
|
if (bookmarkThisCheck2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCheck2.Text = MonthRectify2.ThisRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCheck2.Text = checkLists.Where(x => x.ProposeUnitType == "8").Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisOKCheck2 = doc.Range.Bookmarks["ThisOKCheck2"];
|
|
|
|
|
|
if (bookmarkThisOKCheck2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKCheck2.Text = MonthRectify2.ThisOKRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKCheck2.Text = checkLists.Where(x => x.ProposeUnitType == "8" && x.OK == 1).Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCheck2 = doc.Range.Bookmarks["TotalCheck2"];
|
|
|
|
|
|
if (bookmarkTotalCheck2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCheck2.Text = MonthRectify2.TotalRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCheck2.Text = totalCheckLists.Where(x => x.ProposeUnitType == "8").Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKCheck2 = doc.Range.Bookmarks["TotalOKCheck2"];
|
|
|
|
|
|
if (bookmarkTotalOKCheck2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKCheck2.Text = MonthRectify2.TotalOKRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKCheck2.Text = totalCheckLists.Where(x => x.ProposeUnitType == "8" && x.OK == 1).Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var MonthRectify3 = MonthRectifylist.FirstOrDefault(x => x.Depart == "公司本部");
|
|
|
|
|
|
Bookmark bookmarkThisCheck3 = doc.Range.Bookmarks["ThisCheck3"];
|
|
|
|
|
|
if (bookmarkThisCheck3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCheck3.Text = MonthRectify3.ThisRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCheck3.Text = checkLists.Where(x => x.ProposeUnitType == "10").Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisOKCheck3 = doc.Range.Bookmarks["ThisOKCheck3"];
|
|
|
|
|
|
if (bookmarkThisOKCheck3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKCheck3.Text = MonthRectify3.ThisOKRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKCheck3.Text = checkLists.Where(x => x.ProposeUnitType == "10" && x.OK == 1).Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCheck3 = doc.Range.Bookmarks["TotalCheck3"];
|
|
|
|
|
|
if (bookmarkTotalCheck3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCheck3.Text = MonthRectify3.TotalRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCheck3.Text = totalCheckLists.Where(x => x.ProposeUnitType == "10").Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKCheck3 = doc.Range.Bookmarks["TotalOKCheck3"];
|
|
|
|
|
|
if (bookmarkTotalOKCheck3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKCheck3.Text = MonthRectify3.TotalOKRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKCheck3.Text = totalCheckLists.Where(x => x.ProposeUnitType == "10" && x.OK == 1).Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var MonthRectify4 = MonthRectifylist.FirstOrDefault(x => x.Depart == "建设单位");
|
|
|
|
|
|
Bookmark bookmarkThisCheck4 = doc.Range.Bookmarks["ThisCheck4"];
|
|
|
|
|
|
if (bookmarkThisCheck4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCheck4.Text = MonthRectify4.ThisRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCheck4.Text = checkLists.Where(x => x.ProposeUnitType == "1").Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisOKCheck4 = doc.Range.Bookmarks["ThisOKCheck4"];
|
|
|
|
|
|
if (bookmarkThisOKCheck4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKCheck4.Text = MonthRectify4.ThisOKRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKCheck4.Text = checkLists.Where(x => x.ProposeUnitType == "1" && x.OK == 1).Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCheck4 = doc.Range.Bookmarks["TotalCheck4"];
|
|
|
|
|
|
if (bookmarkTotalCheck4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCheck4.Text = MonthRectify4.TotalRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCheck4.Text = totalCheckLists.Where(x => x.ProposeUnitType == "1").Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKCheck4 = doc.Range.Bookmarks["TotalOKCheck4"];
|
|
|
|
|
|
if (bookmarkTotalOKCheck4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKCheck4.Text = MonthRectify4.TotalOKRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKCheck4.Text = totalCheckLists.Where(x => x.ProposeUnitType == "1" && x.OK == 1).Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var MonthRectify5 = MonthRectifylist.FirstOrDefault(x => x.Depart == "监理单位");
|
|
|
|
|
|
Bookmark bookmarkThisCheck5 = doc.Range.Bookmarks["ThisCheck5"];
|
|
|
|
|
|
if (bookmarkThisCheck5 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify5 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCheck5.Text = MonthRectify5.ThisRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCheck5.Text = checkLists.Where(x => x.ProposeUnitType == "2").Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisOKCheck5 = doc.Range.Bookmarks["ThisOKCheck5"];
|
|
|
|
|
|
if (bookmarkThisOKCheck5 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify5 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKCheck5.Text = MonthRectify5.ThisOKRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKCheck5.Text = checkLists.Where(x => x.ProposeUnitType == "2" && x.OK == 1).Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCheck5 = doc.Range.Bookmarks["TotalCheck5"];
|
|
|
|
|
|
if (bookmarkTotalCheck5 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify5 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCheck5.Text = MonthRectify5.TotalRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCheck5.Text = totalCheckLists.Where(x => x.ProposeUnitType == "2").Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKCheck5 = doc.Range.Bookmarks["TotalOKCheck5"];
|
|
|
|
|
|
if (bookmarkTotalOKCheck5 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify5 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKCheck5.Text = MonthRectify5.TotalOKRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKCheck5.Text = totalCheckLists.Where(x => x.ProposeUnitType == "2" && x.OK == 1).Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var MonthRectify6 = MonthRectifylist.FirstOrDefault(x => x.Depart == "总承包商项目部");
|
|
|
|
|
|
Bookmark bookmarkThisCheck6 = doc.Range.Bookmarks["ThisCheck6"];
|
|
|
|
|
|
if (bookmarkThisCheck6 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify6 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCheck6.Text = MonthRectify6.ThisRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCheck6.Text = checkLists.Where(x => x.ProposeUnitType == "5").Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisOKCheck6 = doc.Range.Bookmarks["ThisOKCheck6"];
|
|
|
|
|
|
if (bookmarkThisOKCheck6 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify6 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKCheck6.Text = MonthRectify6.ThisOKRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKCheck6.Text = checkLists.Where(x => x.ProposeUnitType == "5" && x.OK == 1).Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCheck6 = doc.Range.Bookmarks["TotalCheck6"];
|
|
|
|
|
|
if (bookmarkTotalCheck6 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify6 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCheck6.Text = MonthRectify6.TotalRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCheck6.Text = totalCheckLists.Where(x => x.ProposeUnitType == "5").Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKCheck6 = doc.Range.Bookmarks["TotalOKCheck6"];
|
|
|
|
|
|
if (bookmarkTotalOKCheck6 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MonthRectify6 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKCheck6.Text = MonthRectify6.TotalOKRectifyNum.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKCheck6.Text = totalCheckLists.Where(x => x.ProposeUnitType == "5" && x.OK == 1).Count().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//无损检测情况
|
|
|
|
|
|
builder.MoveToBookmark("Table2");
|
|
|
|
|
|
builder.StartTable();
|
|
|
|
|
|
builder.RowFormat.Alignment = Aspose.Words.Tables.RowAlignment.Center;
|
|
|
|
|
|
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
|
|
|
|
|
|
builder.CellFormat.Borders.Color = System.Drawing.Color.Black;
|
|
|
|
|
|
builder.RowFormat.LeftIndent = 5;
|
|
|
|
|
|
builder.Bold = false;
|
|
|
|
|
|
builder.RowFormat.Height = 20;
|
|
|
|
|
|
builder.Bold = false;
|
|
|
|
|
|
List<Model.Base_Unit> units = UnitService.GetUnitByProjectIdUnitTypeList(CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2);
|
|
|
|
|
|
var ndtList = BLL.MonthNDTCheckService.getListData(fileId);
|
|
|
|
|
|
foreach (Model.Base_Unit unit in units)
|
|
|
|
|
|
{
|
|
|
|
|
|
var ndt = ndtList.FirstOrDefault(x => x.UnitId == unit.UnitId);
|
|
|
|
|
|
//施工分包商
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 102;
|
|
|
|
|
|
builder.Write(unit.UnitName);
|
|
|
|
|
|
//拍片总数
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 47;
|
|
|
|
|
|
if (ndt != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write(ndt.FilmNum.ToString());
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
//不合格(张)
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 56;
|
|
|
|
|
|
if (ndt != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write(ndt.NotOKFileNum.ToString());
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
//已返修(张)
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 54;
|
|
|
|
|
|
if (ndt != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write(ndt.RepairFileNum.ToString());
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
//一次合格率
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 55;
|
|
|
|
|
|
if (ndt != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write(ndt.OneOKRate);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
//累计拍片总数
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 48;
|
|
|
|
|
|
if (ndt != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write(ndt.TotalFilmNum.ToString());
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
//累计不合格(张)
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 63;
|
|
|
|
|
|
if (ndt != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write(ndt.TotalNotOKFileNum.ToString());
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
//累计一次合格率
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 63;
|
|
|
|
|
|
if (ndt != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write(ndt.TotalOneOKRate);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
builder.EndRow();
|
|
|
|
|
|
}
|
|
|
|
|
|
//合计
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 102;
|
|
|
|
|
|
builder.Write("合计");
|
|
|
|
|
|
//拍片总数
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 47;
|
|
|
|
|
|
int sumFilmNum = ndtList.Sum(x => x.FilmNum ?? 0);
|
|
|
|
|
|
builder.Write(sumFilmNum.ToString());
|
|
|
|
|
|
//不合格(张)
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 56;
|
|
|
|
|
|
int sumNotOKFileNum = ndtList.Sum(x => x.NotOKFileNum ?? 0);
|
|
|
|
|
|
builder.Write(sumNotOKFileNum.ToString());
|
|
|
|
|
|
//已返修(张)
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 54;
|
|
|
|
|
|
int sumRepairFileNum = ndtList.Sum(x => x.RepairFileNum ?? 0);
|
|
|
|
|
|
builder.Write(sumRepairFileNum.ToString());
|
|
|
|
|
|
//一次合格率
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 55;
|
|
|
|
|
|
string sumOneOKRate = "0";
|
|
|
|
|
|
if (sumFilmNum > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var a = Convert.ToDouble(sumFilmNum - sumNotOKFileNum);
|
|
|
|
|
|
var b = Convert.ToDouble(sumFilmNum);
|
|
|
|
|
|
decimal result = decimal.Round(decimal.Parse((a / b * 100).ToString()), 2);
|
|
|
|
|
|
sumOneOKRate = result.ToString() + "%";
|
|
|
|
|
|
}
|
|
|
|
|
|
builder.Write(sumOneOKRate);
|
|
|
|
|
|
//累计拍片总数
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 48;
|
|
|
|
|
|
int sumTotalFilmNum = ndtList.Sum(x => x.TotalFilmNum ?? 0);
|
|
|
|
|
|
builder.Write(sumTotalFilmNum.ToString());
|
|
|
|
|
|
//累计不合格(张)
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 63;
|
|
|
|
|
|
int sumTotalNotOKFileNum = ndtList.Sum(x => x.TotalNotOKFileNum ?? 0);
|
|
|
|
|
|
builder.Write(sumTotalNotOKFileNum.ToString());
|
|
|
|
|
|
//累计一次合格率
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 63;
|
|
|
|
|
|
string sumTotalOneOKRate = "0";
|
|
|
|
|
|
if (sumTotalFilmNum > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var a = Convert.ToDouble(sumTotalFilmNum - sumTotalNotOKFileNum);
|
|
|
|
|
|
var b = Convert.ToDouble(sumTotalFilmNum);
|
|
|
|
|
|
decimal result = decimal.Round(decimal.Parse((a / b * 100).ToString()), 2);
|
|
|
|
|
|
sumOneOKRate = result.ToString() + "%";
|
|
|
|
|
|
}
|
|
|
|
|
|
builder.Write(sumTotalOneOKRate);
|
|
|
|
|
|
builder.EndRow();
|
|
|
|
|
|
builder.EndTable();
|
|
|
|
|
|
//焊工资格评定情况
|
|
|
|
|
|
builder.MoveToBookmark("Table3");
|
|
|
|
|
|
builder.StartTable();
|
|
|
|
|
|
builder.RowFormat.Alignment = Aspose.Words.Tables.RowAlignment.Center;
|
|
|
|
|
|
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
|
|
|
|
|
|
builder.CellFormat.Borders.Color = System.Drawing.Color.Black;
|
|
|
|
|
|
builder.RowFormat.LeftIndent = 5;
|
|
|
|
|
|
builder.Bold = false;
|
|
|
|
|
|
builder.RowFormat.Height = 20;
|
|
|
|
|
|
builder.Bold = false;
|
|
|
|
|
|
var welderList = BLL.MonthWelderService.getListData(fileId);
|
|
|
|
|
|
foreach (Model.Base_Unit unit in units)
|
|
|
|
|
|
{
|
|
|
|
|
|
var welder = welderList.FirstOrDefault(x => x.UnitId == unit.UnitId);
|
|
|
|
|
|
//施工分包商
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 102;
|
|
|
|
|
|
builder.Write(unit.UnitName);
|
|
|
|
|
|
//总人数
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 51;
|
|
|
|
|
|
if (welder != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write(welder.ThisPersonNum.ToString());
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
//合格人数
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 72;
|
|
|
|
|
|
if (welder != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write(welder.ThisOKPersonNum.ToString());
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
//合格率
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 71;
|
|
|
|
|
|
if (welder != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write(welder.ThisOKRate);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
//总人数
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 53;
|
|
|
|
|
|
if (welder != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write(welder.TotalPersonNum.ToString());
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
//合格人数
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 77;
|
|
|
|
|
|
if (welder != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write(welder.TotalOKPersonNum.ToString());
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
//合格率
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 62;
|
|
|
|
|
|
if (welder != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write(welder.TotalOKRate);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.Write("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
builder.EndRow();
|
|
|
|
|
|
}
|
|
|
|
|
|
//合计
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 102;
|
|
|
|
|
|
builder.Write("合计");
|
|
|
|
|
|
//总人数
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 51;
|
|
|
|
|
|
int sumThisPersonNum = welderList.Sum(x => x.ThisPersonNum ?? 0);
|
|
|
|
|
|
builder.Write(sumThisPersonNum.ToString());
|
|
|
|
|
|
//合格人数
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 72;
|
|
|
|
|
|
int sumThisOKPersonNum = welderList.Sum(x => x.ThisOKPersonNum ?? 0);
|
|
|
|
|
|
builder.Write(sumThisOKPersonNum.ToString());
|
|
|
|
|
|
//合格率
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 71;
|
|
|
|
|
|
string sumThisOKRate = "0";
|
|
|
|
|
|
if (sumThisPersonNum > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var a = Convert.ToDouble(sumThisOKPersonNum);
|
|
|
|
|
|
var b = Convert.ToDouble(sumThisPersonNum);
|
|
|
|
|
|
decimal result = decimal.Round(decimal.Parse((a / b * 100).ToString()), 2);
|
|
|
|
|
|
sumThisOKRate = result.ToString() + "%";
|
|
|
|
|
|
}
|
|
|
|
|
|
builder.Write(sumThisOKRate);
|
|
|
|
|
|
//总人数
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 53;
|
|
|
|
|
|
int sumTotalPersonNum = welderList.Sum(x => x.TotalPersonNum ?? 0);
|
|
|
|
|
|
builder.Write(sumTotalPersonNum.ToString());
|
|
|
|
|
|
//合格人数
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 77;
|
|
|
|
|
|
int sumTotalOKPersonNum = welderList.Sum(x => x.TotalOKPersonNum ?? 0);
|
|
|
|
|
|
builder.Write(sumTotalOKPersonNum.ToString());
|
|
|
|
|
|
//合格率
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 62;
|
|
|
|
|
|
string sumTotalOKRate = "0";
|
|
|
|
|
|
if (sumTotalPersonNum > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var a = Convert.ToDouble(sumTotalOKPersonNum);
|
|
|
|
|
|
var b = Convert.ToDouble(sumTotalPersonNum);
|
|
|
|
|
|
decimal result = decimal.Round(decimal.Parse((a / b * 100).ToString()), 2);
|
|
|
|
|
|
sumTotalOKRate = result.ToString() + "%";
|
|
|
|
|
|
}
|
|
|
|
|
|
builder.Write(sumTotalOKRate);
|
|
|
|
|
|
builder.EndRow();
|
|
|
|
|
|
builder.EndTable();
|
|
|
|
|
|
//质量验收情况
|
|
|
|
|
|
var spotCheckDetails = MonthSpotCheckDetailService.GetMonthSpotCheckDetailsByCheckMonthId(fileId);
|
|
|
|
|
|
if (spotCheckDetails.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
Bookmark bookmarkTotalNum1 = doc.Range.Bookmarks["TotalNum1"];
|
|
|
|
|
|
if (bookmarkTotalNum1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalNum1.Text = spotCheckDetails[0].TotalNum ?? "";
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisOKNum1 = doc.Range.Bookmarks["ThisOKNum1"];
|
|
|
|
|
|
if (bookmarkThisOKNum1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKNum1.Text = spotCheckDetails[0].ThisOKNum ?? "";
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKNum1 = doc.Range.Bookmarks["TotalOKNum1"];
|
|
|
|
|
|
if (bookmarkTotalOKNum1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKNum1.Text = spotCheckDetails[0].TotalOKNum ?? "";
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKRate1 = doc.Range.Bookmarks["TotalOKRate1"];
|
|
|
|
|
|
if (bookmarkTotalOKNum1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKRate1.Text = spotCheckDetails[0].TotalOKRate ?? "";
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalNum2 = doc.Range.Bookmarks["TotalNum2"];
|
|
|
|
|
|
if (bookmarkTotalNum2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalNum2.Text = spotCheckDetails[1].TotalNum ?? "";
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisOKNum2 = doc.Range.Bookmarks["ThisOKNum2"];
|
|
|
|
|
|
if (bookmarkThisOKNum2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKNum2.Text = spotCheckDetails[1].ThisOKNum ?? "";
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKNum2 = doc.Range.Bookmarks["TotalOKNum2"];
|
|
|
|
|
|
if (bookmarkTotalOKNum2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKNum2.Text = spotCheckDetails[1].TotalOKNum ?? "";
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKRate2 = doc.Range.Bookmarks["TotalOKRate2"];
|
|
|
|
|
|
if (bookmarkTotalOKNum2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKRate2.Text = spotCheckDetails[1].TotalOKRate;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalNum3 = doc.Range.Bookmarks["TotalNum3"];
|
|
|
|
|
|
if (bookmarkTotalNum3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalNum3.Text = spotCheckDetails[2].TotalNum;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisOKNum3 = doc.Range.Bookmarks["ThisOKNum3"];
|
|
|
|
|
|
if (bookmarkThisOKNum3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKNum3.Text = spotCheckDetails[2].ThisOKNum;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKNum3 = doc.Range.Bookmarks["TotalOKNum3"];
|
|
|
|
|
|
if (bookmarkTotalOKNum3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKNum3.Text = spotCheckDetails[2].TotalOKNum;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKRate3 = doc.Range.Bookmarks["TotalOKRate3"];
|
|
|
|
|
|
if (bookmarkTotalOKNum3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKRate3.Text = spotCheckDetails[2].TotalOKRate;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalNum4 = doc.Range.Bookmarks["TotalNum4"];
|
|
|
|
|
|
if (bookmarkTotalNum4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalNum4.Text = spotCheckDetails[3].TotalNum;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisOKNum4 = doc.Range.Bookmarks["ThisOKNum4"];
|
|
|
|
|
|
if (bookmarkThisOKNum4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisOKNum4.Text = spotCheckDetails[3].ThisOKNum;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKNum4 = doc.Range.Bookmarks["TotalOKNum4"];
|
|
|
|
|
|
if (bookmarkTotalOKNum4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKNum4.Text = spotCheckDetails[3].TotalOKNum;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalOKRate4 = doc.Range.Bookmarks["TotalOKRate4"];
|
|
|
|
|
|
if (bookmarkTotalOKNum4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalOKRate4.Text = spotCheckDetails[3].TotalOKRate;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
List<Model.View_Check_SoptCheckDetail> spotCheckDetailOKLists = SpotCheckDetailService.GetOKSpotCheckDetailListByTime1(CurrUser.LoginProjectId, startTime, endTime);
|
|
|
|
|
|
List<Model.View_Check_SoptCheckDetail> spotCheckDetailLists = SpotCheckDetailService.GetAllSpotCheckDetailListByTime(CurrUser.LoginProjectId, startTime, endTime);
|
|
|
|
|
|
List<Model.View_Check_SoptCheckDetail> TotalCheckDetailOKLists = SpotCheckDetailService.GetTotalOKSpotCheckDetailListByTime1(CurrUser.LoginProjectId, endTime);
|
|
|
|
|
|
List<Model.View_Check_SoptCheckDetail> TotalCheckDetailLists = SpotCheckDetailService.GetTotalAllSpotCheckDetailListByTime(CurrUser.LoginProjectId, endTime);
|
|
|
|
|
|
//质量记录本月同步率
|
|
|
|
|
|
List<Model.View_Check_SoptCheckDetail> spotCheckDetailDataOKLists = SpotCheckDetailService.GetMonthDataOkSpotCheckDetailListByTime(CurrUser.LoginProjectId, startTime, endTime);
|
|
|
|
|
|
//质量记录累计同步率
|
|
|
|
|
|
List<Model.View_Check_SoptCheckDetail> TotalCheckDetailDataOKLists = SpotCheckDetailService.GetAllDataOkSpotCheckDetailListByTime(CurrUser.LoginProjectId, endTime);
|
|
|
|
|
|
Bookmark bookmarkMonthOkqualificationRate = doc.Range.Bookmarks["MonthOkqualificationRate"];
|
|
|
|
|
|
if (bookmarkMonthOkqualificationRate != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
decimal result = 12.30M;
|
|
|
|
|
|
if (!string.IsNullOrEmpty(checkMonth.MonthOk))
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkMonthOkqualificationRate.Text = checkMonth.MonthOk;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (spotCheckDetailOKLists.Count > 0 && spotCheckDetailLists.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var a = Convert.ToDouble(spotCheckDetailOKLists.Count);
|
|
|
|
|
|
var b = Convert.ToDouble(spotCheckDetailLists.Count);
|
|
|
|
|
|
result = decimal.Round(decimal.Parse((a / b * 100).ToString()), 2);
|
|
|
|
|
|
bookmarkMonthOkqualificationRate.Text = result.ToString() + "%" ?? "";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkOkqualificationRate = doc.Range.Bookmarks["OkqualificationRate"];
|
|
|
|
|
|
if (bookmarkOkqualificationRate != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
decimal result = 12.30M;
|
|
|
|
|
|
if (!string.IsNullOrEmpty(checkMonth.AllOk))
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkOkqualificationRate.Text = checkMonth.AllOk;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (TotalCheckDetailOKLists.Count > 0 && TotalCheckDetailLists.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var a = Convert.ToDouble(TotalCheckDetailOKLists.Count);
|
|
|
|
|
|
var b = Convert.ToDouble(TotalCheckDetailLists.Count);
|
|
|
|
|
|
result = decimal.Round(decimal.Parse((a / b * 100).ToString()), 2);
|
|
|
|
|
|
bookmarkOkqualificationRate.Text = result.ToString() + "%" ?? "";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkMonthDataOkqualificationRate = doc.Range.Bookmarks["MonthDataOkqualificationRate"];
|
|
|
|
|
|
if (bookmarkMonthDataOkqualificationRate != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
decimal result = 12.30M;
|
|
|
|
|
|
if (!string.IsNullOrEmpty(checkMonth.MonthDataOk))
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkMonthDataOkqualificationRate.Text = checkMonth.MonthDataOk;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (spotCheckDetailOKLists.Count > 0 && spotCheckDetailDataOKLists.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var a = Convert.ToDouble(spotCheckDetailDataOKLists.Count);
|
|
|
|
|
|
var b = Convert.ToDouble(spotCheckDetailOKLists.Where(x => x.IsDataOK != "2").ToList().Count);
|
|
|
|
|
|
result = decimal.Round(decimal.Parse((a / b * 100).ToString()), 2);
|
|
|
|
|
|
bookmarkMonthDataOkqualificationRate.Text = result.ToString() + "%" ?? "";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkDataOkqualificationRate = doc.Range.Bookmarks["DataOkqualificationRate"];
|
|
|
|
|
|
if (bookmarkDataOkqualificationRate != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
decimal result = 12.30M;
|
|
|
|
|
|
if (!string.IsNullOrEmpty(checkMonth.AllDataOk))
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkDataOkqualificationRate.Text = checkMonth.AllDataOk;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (TotalCheckDetailOKLists.Count > 0 && TotalCheckDetailDataOKLists.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var a = Convert.ToDouble(TotalCheckDetailDataOKLists.Count);
|
|
|
|
|
|
var b = Convert.ToDouble(TotalCheckDetailOKLists.Where(x => x.IsDataOK != "2").ToList().Count);
|
|
|
|
|
|
result = decimal.Round(decimal.Parse((a / b * 100).ToString()), 2);
|
|
|
|
|
|
bookmarkDataOkqualificationRate.Text = result.ToString() + "%" ?? "";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//特种设备安装告知、监检情况
|
|
|
|
|
|
var specialEquipmentDetails = SpecialEquipmentDetailService.GetList(fileId);
|
|
|
|
|
|
if (specialEquipmentDetails.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
Bookmark bookmarkETotalNum1 = doc.Range.Bookmarks["ETotalNum1"];
|
|
|
|
|
|
if (bookmarkETotalNum1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkETotalNum1.Text = specialEquipmentDetails[0].TotalNum;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisCompleteNum1 = doc.Range.Bookmarks["ThisCompleteNum1"];
|
|
|
|
|
|
if (bookmarkThisCompleteNum1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCompleteNum1.Text = specialEquipmentDetails[0].ThisCompleteNum1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCompleteNum1 = doc.Range.Bookmarks["TotalCompleteNum1"];
|
|
|
|
|
|
if (bookmarkTotalCompleteNum1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCompleteNum1.Text = specialEquipmentDetails[0].TotalCompleteNum1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalRate1 = doc.Range.Bookmarks["TotalRate1"];
|
|
|
|
|
|
if (bookmarkTotalRate1 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalRate1.Text = specialEquipmentDetails[0].TotalRate1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisCompleteNum6 = doc.Range.Bookmarks["ThisCompleteNum6"];
|
|
|
|
|
|
if (bookmarkThisCompleteNum6 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCompleteNum6.Text = specialEquipmentDetails[0].ThisCompleteNum2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCompleteNum6 = doc.Range.Bookmarks["TotalCompleteNum6"];
|
|
|
|
|
|
if (bookmarkTotalCompleteNum6 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCompleteNum6.Text = specialEquipmentDetails[0].TotalCompleteNum2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalRate6 = doc.Range.Bookmarks["TotalRate6"];
|
|
|
|
|
|
if (bookmarkTotalRate6 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalRate6.Text = specialEquipmentDetails[0].TotalRate2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkETotalNum2 = doc.Range.Bookmarks["ETotalNum2"];
|
|
|
|
|
|
if (bookmarkETotalNum2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkETotalNum2.Text = specialEquipmentDetails[1].TotalNum;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisCompleteNum2 = doc.Range.Bookmarks["ThisCompleteNum2"];
|
|
|
|
|
|
if (bookmarkThisCompleteNum2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCompleteNum2.Text = specialEquipmentDetails[1].ThisCompleteNum1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCompleteNum2 = doc.Range.Bookmarks["TotalCompleteNum2"];
|
|
|
|
|
|
if (bookmarkTotalCompleteNum2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCompleteNum2.Text = specialEquipmentDetails[1].TotalCompleteNum1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalRate2 = doc.Range.Bookmarks["TotalRate2"];
|
|
|
|
|
|
if (bookmarkTotalRate2 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalRate2.Text = specialEquipmentDetails[1].TotalRate1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisCompleteNum7 = doc.Range.Bookmarks["ThisCompleteNum7"];
|
|
|
|
|
|
if (bookmarkThisCompleteNum7 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCompleteNum7.Text = specialEquipmentDetails[1].ThisCompleteNum2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCompleteNum7 = doc.Range.Bookmarks["TotalCompleteNum7"];
|
|
|
|
|
|
if (bookmarkTotalCompleteNum7 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCompleteNum7.Text = specialEquipmentDetails[1].TotalCompleteNum2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalRate7 = doc.Range.Bookmarks["TotalRate7"];
|
|
|
|
|
|
if (bookmarkTotalRate7 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalRate7.Text = specialEquipmentDetails[1].TotalRate2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkETotalNum3 = doc.Range.Bookmarks["ETotalNum3"];
|
|
|
|
|
|
if (bookmarkETotalNum3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkETotalNum3.Text = specialEquipmentDetails[2].TotalNum;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisCompleteNum3 = doc.Range.Bookmarks["ThisCompleteNum3"];
|
|
|
|
|
|
if (bookmarkThisCompleteNum3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCompleteNum3.Text = specialEquipmentDetails[2].ThisCompleteNum1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCompleteNum3 = doc.Range.Bookmarks["TotalCompleteNum3"];
|
|
|
|
|
|
if (bookmarkTotalCompleteNum3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCompleteNum3.Text = specialEquipmentDetails[2].TotalCompleteNum1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalRate3 = doc.Range.Bookmarks["TotalRate3"];
|
|
|
|
|
|
if (bookmarkTotalRate3 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalRate3.Text = specialEquipmentDetails[2].TotalRate1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisCompleteNum8 = doc.Range.Bookmarks["ThisCompleteNum8"];
|
|
|
|
|
|
if (bookmarkThisCompleteNum8 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCompleteNum8.Text = specialEquipmentDetails[2].ThisCompleteNum2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCompleteNum8 = doc.Range.Bookmarks["TotalCompleteNum8"];
|
|
|
|
|
|
if (bookmarkTotalCompleteNum8 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCompleteNum8.Text = specialEquipmentDetails[2].TotalCompleteNum2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalRate8 = doc.Range.Bookmarks["TotalRate8"];
|
|
|
|
|
|
if (bookmarkTotalRate8 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalRate8.Text = specialEquipmentDetails[2].TotalRate2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkETotalNum4 = doc.Range.Bookmarks["ETotalNum4"];
|
|
|
|
|
|
if (bookmarkETotalNum4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkETotalNum4.Text = specialEquipmentDetails[3].TotalNum;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisCompleteNum4 = doc.Range.Bookmarks["ThisCompleteNum4"];
|
|
|
|
|
|
if (bookmarkThisCompleteNum4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCompleteNum4.Text = specialEquipmentDetails[3].ThisCompleteNum1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCompleteNum4 = doc.Range.Bookmarks["TotalCompleteNum4"];
|
|
|
|
|
|
if (bookmarkTotalCompleteNum4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCompleteNum4.Text = specialEquipmentDetails[3].TotalCompleteNum1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalRate4 = doc.Range.Bookmarks["TotalRate4"];
|
|
|
|
|
|
if (bookmarkTotalRate4 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalRate4.Text = specialEquipmentDetails[3].TotalRate1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisCompleteNum9 = doc.Range.Bookmarks["ThisCompleteNum9"];
|
|
|
|
|
|
if (bookmarkThisCompleteNum9 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCompleteNum9.Text = specialEquipmentDetails[3].ThisCompleteNum2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCompleteNum9 = doc.Range.Bookmarks["TotalCompleteNum9"];
|
|
|
|
|
|
if (bookmarkTotalCompleteNum9 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCompleteNum9.Text = specialEquipmentDetails[3].TotalCompleteNum2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalRate9 = doc.Range.Bookmarks["TotalRate9"];
|
|
|
|
|
|
if (bookmarkTotalRate9 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalRate9.Text = specialEquipmentDetails[3].TotalRate2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkETotalNum5 = doc.Range.Bookmarks["ETotalNum5"];
|
|
|
|
|
|
if (bookmarkETotalNum5 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkETotalNum5.Text = specialEquipmentDetails[4].TotalNum;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisCompleteNum5 = doc.Range.Bookmarks["ThisCompleteNum5"];
|
|
|
|
|
|
if (bookmarkThisCompleteNum5 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCompleteNum5.Text = specialEquipmentDetails[4].ThisCompleteNum1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCompleteNum5 = doc.Range.Bookmarks["TotalCompleteNum5"];
|
|
|
|
|
|
if (bookmarkTotalCompleteNum5 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCompleteNum5.Text = specialEquipmentDetails[4].TotalCompleteNum1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalRate5 = doc.Range.Bookmarks["TotalRate5"];
|
|
|
|
|
|
if (bookmarkTotalRate5 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalRate5.Text = specialEquipmentDetails[4].TotalRate1;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkThisCompleteNum10 = doc.Range.Bookmarks["ThisCompleteNum10"];
|
|
|
|
|
|
if (bookmarkThisCompleteNum10 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkThisCompleteNum10.Text = specialEquipmentDetails[4].ThisCompleteNum2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalCompleteNum10 = doc.Range.Bookmarks["TotalCompleteNum10"];
|
|
|
|
|
|
if (bookmarkTotalCompleteNum10 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalCompleteNum10.Text = specialEquipmentDetails[4].TotalCompleteNum2;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkTotalRate10 = doc.Range.Bookmarks["TotalRate10"];
|
|
|
|
|
|
if (bookmarkTotalRate10 != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkTotalRate10.Text = specialEquipmentDetails[4].TotalRate2;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//设计变更情况
|
|
|
|
|
|
builder.MoveToBookmark("Table4");
|
|
|
|
|
|
builder.StartTable();
|
|
|
|
|
|
builder.RowFormat.Alignment = Aspose.Words.Tables.RowAlignment.Center;
|
|
|
|
|
|
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
|
|
|
|
|
|
builder.CellFormat.Borders.Color = System.Drawing.Color.Black;
|
|
|
|
|
|
builder.RowFormat.LeftIndent = 5;
|
|
|
|
|
|
builder.Bold = false;
|
|
|
|
|
|
builder.RowFormat.Height = 20;
|
|
|
|
|
|
builder.Bold = false;
|
|
|
|
|
|
var designs = from x in Funs.DB.Check_Design
|
|
|
|
|
|
where x.ProjectId == CurrUser.LoginProjectId && x.DesignDate >= startTime && x.DesignDate < endTime
|
|
|
|
|
|
select x;
|
|
|
|
|
|
int num = 1;
|
|
|
|
|
|
string mainItemName = string.Empty;
|
|
|
|
|
|
string CNProfessionalName = string.Empty;
|
|
|
|
|
|
string state = string.Empty;
|
|
|
|
|
|
var designList = BLL.MonthDesignService.getListData(fileId);
|
|
|
|
|
|
if (designList.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (Model.Check_MonthDesign design in designList)
|
|
|
|
|
|
{
|
|
|
|
|
|
//序号
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 42;
|
|
|
|
|
|
builder.Write(num.ToString());
|
|
|
|
|
|
//编号
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 132;
|
|
|
|
|
|
builder.Write(design.DesignCode);
|
|
|
|
|
|
//主项
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 67;
|
|
|
|
|
|
if (!string.IsNullOrEmpty(design.MainItemId))
|
|
|
|
|
|
{
|
|
|
|
|
|
var mainItem = MainItemService.GetMainItemByMainItemId(design.MainItemId);
|
|
|
|
|
|
if (mainItem != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainItemName = mainItem.MainItemName;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
builder.Write(mainItemName);
|
|
|
|
|
|
//专业
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 67;
|
|
|
|
|
|
var cn = DesignProfessionalService.GetDesignProfessional(design.DesignProfessionalId);
|
|
|
|
|
|
if (cn != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
CNProfessionalName = cn.ProfessionalName;
|
|
|
|
|
|
}
|
|
|
|
|
|
builder.Write(CNProfessionalName);
|
|
|
|
|
|
//施工完成情况
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 112;
|
|
|
|
|
|
builder.Write(design.State);
|
|
|
|
|
|
//备注
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 68;
|
|
|
|
|
|
builder.Write(design.Remark);
|
|
|
|
|
|
builder.EndRow();
|
|
|
|
|
|
num++;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (Model.Check_Design design in designs)
|
|
|
|
|
|
{
|
|
|
|
|
|
//序号
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 42;
|
|
|
|
|
|
builder.Write(num.ToString());
|
|
|
|
|
|
//编号
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 132;
|
|
|
|
|
|
builder.Write(design.DesignCode);
|
|
|
|
|
|
//主项
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 67;
|
|
|
|
|
|
if (!string.IsNullOrEmpty(design.MainItemId))
|
|
|
|
|
|
{
|
|
|
|
|
|
var mainItem = MainItemService.GetMainItemByMainItemId(design.MainItemId);
|
|
|
|
|
|
if (mainItem != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainItemName = mainItem.MainItemName;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
builder.Write(mainItemName);
|
|
|
|
|
|
//专业
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 67;
|
|
|
|
|
|
var cn = DesignProfessionalService.GetDesignProfessional(design.CNProfessionalCode);
|
|
|
|
|
|
if (cn != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
CNProfessionalName = cn.ProfessionalName;
|
|
|
|
|
|
}
|
|
|
|
|
|
builder.Write(CNProfessionalName);
|
|
|
|
|
|
//施工完成情况
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 112;
|
|
|
|
|
|
if (design.State == Const.Design_Complete)
|
|
|
|
|
|
{
|
|
|
|
|
|
state = "已完成";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
state = "未完成";
|
|
|
|
|
|
}
|
|
|
|
|
|
builder.Write(state);
|
|
|
|
|
|
//备注
|
|
|
|
|
|
builder.InsertCell();
|
|
|
|
|
|
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
|
|
|
|
|
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
|
|
|
|
|
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
|
|
|
|
|
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
|
|
|
|
|
builder.CellFormat.Width = 68;
|
|
|
|
|
|
builder.Write(string.Empty);
|
|
|
|
|
|
builder.EndRow();
|
|
|
|
|
|
num++;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
builder.EndTable();
|
|
|
|
|
|
Bookmark bookmarkConstructionData = doc.Range.Bookmarks["ConstructionData"];
|
|
|
|
|
|
if (bookmarkConstructionData != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(checkMonth.ConstructionData))
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkConstructionData.Text = checkMonth.ConstructionData;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkNextMonthPlan = doc.Range.Bookmarks["NextMonthPlan"];
|
|
|
|
|
|
if (bookmarkNextMonthPlan != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(checkMonth.NextMonthPlan))
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkNextMonthPlan.Text = checkMonth.NextMonthPlan;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
Bookmark bookmarkNeedSolved = doc.Range.Bookmarks["NeedSolved"];
|
|
|
|
|
|
if (bookmarkNeedSolved != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(checkMonth.NeedSolved))
|
|
|
|
|
|
{
|
|
|
|
|
|
bookmarkNeedSolved.Text = checkMonth.NeedSolved;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
doc.Save(newUrl);
|
|
|
|
|
|
//生成PDF文件
|
|
|
|
|
|
string pdfUrl = newUrl.Replace(".doc", ".pdf");
|
|
|
|
|
|
Document doc1 = new Aspose.Words.Document(newUrl);
|
|
|
|
|
|
//验证参数
|
|
|
|
|
|
if (doc1 == null) { throw new Exception("Word文件无效"); }
|
|
|
|
|
|
doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式
|
|
|
|
|
|
string fileName = Path.GetFileName(filePath);
|
|
|
|
|
|
FileInfo info = new FileInfo(pdfUrl);
|
|
|
|
|
|
long fileSize = info.Length;
|
|
|
|
|
|
Response.Clear();
|
|
|
|
|
|
Response.ContentType = "application/x-zip-compressed";
|
|
|
|
|
|
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
|
|
|
|
|
|
Response.AddHeader("Content-Length", fileSize.ToString());
|
|
|
|
|
|
Response.TransmitFile(pdfUrl, 0, fileSize);
|
|
|
|
|
|
Response.Flush();
|
|
|
|
|
|
Response.Close();
|
|
|
|
|
|
File.Delete(newUrl);
|
|
|
|
|
|
File.Delete(pdfUrl);
|
|
|
|
|
|
#endregion
|
2023-09-12 09:09:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInParent("当前月报不存在!", MessageBoxIcon.Warning);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//protected void Grid1_Collapse(object sender, EventArgs e)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// this.Grid2.Collapsed = !this.Grid1.Collapsed;
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
//protected void Grid2_Collapse(object sender, EventArgs e)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// this.Grid1.Collapsed = !this.Grid2.Collapsed;
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
protected void rblShow_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.rblShow.SelectedValue == "1")
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Grid1.Hidden = false;
|
|
|
|
|
|
this.Grid2.Hidden = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (this.rblShow.SelectedValue == "2")
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Grid1.Hidden = true;
|
|
|
|
|
|
this.Grid2.Hidden = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Grid1.Hidden = false;
|
|
|
|
|
|
this.Grid2.Hidden = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void btnDel_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(this.drpYear.SelectedValue))
|
|
|
|
|
|
{
|
|
|
|
|
|
int year = Funs.GetNewInt(this.drpYear.SelectedValue) ?? DateTime.Now.Year;
|
|
|
|
|
|
CQMSDataCollectService.DeleteCQMSDataCollect(year);
|
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
|
this.BindGrid2();
|
|
|
|
|
|
ShowNotify("删除成功!", MessageBoxIcon.Success);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|