质量月报导出问题处理

This commit is contained in:
夏菊 2025-04-24 20:01:19 +08:00
parent 9df2becf42
commit 6bebbe15ef
1 changed files with 52 additions and 61 deletions

View File

@ -251,7 +251,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
select x).FirstOrDefault(); select x).FirstOrDefault();
Bookmark bkmark = doc.Range.Bookmarks["username"]; Bookmark bkmark = doc.Range.Bookmarks["username"];
if (bkmark != null) { if (bkmark != null)
{
if (unitsYz != null) if (unitsYz != null)
{ {
@ -283,7 +284,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
} }
bkmark = doc.Range.Bookmarks["quamanagername"]; bkmark = doc.Range.Bookmarks["quamanagername"];
if (bkmark != null) { if (bkmark != null)
{
//var zlName = ""; //var zlName = "";
////根据项目获取质量经理 ////根据项目获取质量经理
//var puserList = db.Project_ProjectUser.Where(x => x.ProjectId == weekModel.ProjectId && x.RoleId.Contains(BLL.Const.QAManager)).ToList(); //var puserList = db.Project_ProjectUser.Where(x => x.ProjectId == weekModel.ProjectId && x.RoleId.Contains(BLL.Const.QAManager)).ToList();
@ -338,7 +340,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
whileIndex += 1; whileIndex += 1;
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true); table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
} }
else{ else
{
isYm = false; isYm = false;
} }
} }
@ -677,9 +680,11 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
} }
} }
int i = 1; int i = 1;
var cNProfessionals = from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId var cNProfessionals = from x in Funs.DB.Base_CNProfessional
where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId
&& x.CNProfessionalId != BLL.Const.ComprehensiveId && x.CNProfessionalId != BLL.Const.ComprehensiveId
orderby x.SortIndex select x; orderby x.SortIndex
select x;
foreach (var item in cNProfessionals) foreach (var item in cNProfessionals)
{ {
//专业下所有集合 //专业下所有集合
@ -958,7 +963,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
//自动设置表格样式 //自动设置表格样式
table.AutoFit(AutoFitBehavior.FixedColumnWidths); table.AutoFit(AutoFitBehavior.FixedColumnWidths);
} }
else { else
{
isYm = true; isYm = true;
numberIndex = 1; numberIndex = 1;
whileIndex += 1; whileIndex += 1;
@ -1003,24 +1009,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
int? totalNum0 = 0, totalNum1 = 0;//拍片数量合计 int? totalNum0 = 0, totalNum1 = 0;//拍片数量合计
endDate = endDate.AddDays(1);
foreach (var item in units) foreach (var item in units)
{ {
int? num0 = 0, num1 = 0;//拍片数量小计 int? num0 = 0, num1 = 0;//拍片数量小计
var query = from c in db.ProcessControl_NondestructiveTest_New var query = from c in db.ProcessControl_NondestructiveTest_New
join u in db.Base_Unit on c.UnitId equals u.UnitId join u in db.Base_Unit on c.UnitId equals u.UnitId
where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId
&& c.CreateDate >= Convert.ToDateTime(startDate) && c.CreateDate <= Convert.ToDateTime(endDate) && c.CreateDate >= Convert.ToDateTime(startDate) && c.CreateDate < Convert.ToDateTime(endDate)
orderby c.CreateDate descending orderby c.CreateDate descending
select new select new
{ {
c.CreateDate, c.CreateDate,
c.ProjectId, c.ProjectId,
@ -1040,7 +1038,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
model.Id = Guid.NewGuid().ToString(); model.Id = Guid.NewGuid().ToString();
model.CreateMan = item.UnitName;//用作存储施工单位名称 model.CreateMan = item.UnitName;//用作存储施工单位名称
model.ProfessionalName = "工艺管道"; model.ProfessionalName = "工艺管道";
if (gygdModel != null) if (gygdModel != null)
{ {
model.MonthQuantity = gygdModel.MonthQuantity; model.MonthQuantity = gygdModel.MonthQuantity;
@ -1068,9 +1065,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
NondestructiveTestlist.Add(model); NondestructiveTestlist.Add(model);
} }
//地管 //地管
gygdModel = query.FirstOrDefault(x => x.ProfessionalName == "地管"); gygdModel = query.FirstOrDefault(x => x.ProfessionalName == "地管");
model = new Model.ProcessControl_NondestructiveTest_New(); model = new Model.ProcessControl_NondestructiveTest_New();
@ -1175,11 +1169,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
int pageCount = 1; int pageCount = 1;
foreach (var item in NondestructiveTestlist) foreach (var item in NondestructiveTestlist)
{ {
//创建行 //创建行
Row row = new Row(doc); Row row = new Row(doc);
//如果是第一列,或者 //如果是第一列,或者
if (numberIndex == 1 || Unitname != item.CreateMan) if (numberIndex == 1 || Unitname != item.CreateMan)
{ {
@ -1199,8 +1190,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
Unitname = item.CreateMan; Unitname = item.CreateMan;
} }
row.Cells.Add(CreateCell(item.ProfessionalName.ToString(), doc, table.Rows[0].Cells[2].CellFormat.Width)); row.Cells.Add(CreateCell(item.ProfessionalName.ToString(), doc, table.Rows[0].Cells[2].CellFormat.Width));
row.Cells.Add(CreateCell(item.MonthQuantity.ToString(), doc, table.Rows[0].Cells[3].CellFormat.Width)); row.Cells.Add(CreateCell(item.MonthQuantity.ToString(), doc, table.Rows[0].Cells[3].CellFormat.Width));
row.Cells.Add(CreateCell(item.TotalQuantity.ToString(), doc, table.Rows[0].Cells[4].CellFormat.Width)); row.Cells.Add(CreateCell(item.TotalQuantity.ToString(), doc, table.Rows[0].Cells[4].CellFormat.Width));
@ -1233,7 +1222,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
//自动设置表格样式 //自动设置表格样式
table.AutoFit(AutoFitBehavior.FixedColumnWidths); table.AutoFit(AutoFitBehavior.FixedColumnWidths);
} }
else { else
{
isYm = true; isYm = true;
numberIndex = 1; numberIndex = 1;
whileIndex += 1; whileIndex += 1;
@ -1324,7 +1314,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
//自动设置表格样式 //自动设置表格样式
table.AutoFit(AutoFitBehavior.FixedColumnWidths); table.AutoFit(AutoFitBehavior.FixedColumnWidths);
} }
else { else
{
isYm = true; isYm = true;
numberIndex = 1; numberIndex = 1;
whileIndex += 1; whileIndex += 1;