提交代码

This commit is contained in:
2023-11-29 18:02:03 +08:00
parent a8799ec7bb
commit d7ae172c39
17 changed files with 1188 additions and 14 deletions
@@ -148,6 +148,28 @@ namespace FineUIPro.Web.PZHGL.InformationProject
summary2.Add("Num" + i.ToString(), sum2[i]);
}
Grid2.SummaryData = summary2;
decimal sumTodayCompleteSize = 0, sumTotalCompleteSize = 0, sumTotalSize = 0, sumTomorrowPlanSize = 0;
foreach (JObject mergedRow in Grid6.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
sumTodayCompleteSize += Funs.GetNewDecimalOrZero(values.Value<string>("TodayCompleteSize"));
sumTotalCompleteSize += Funs.GetNewDecimalOrZero(values.Value<string>("TotalCompleteSize"));
sumTotalSize += Funs.GetNewDecimalOrZero(values.Value<string>("TotalSize"));
sumTomorrowPlanSize += Funs.GetNewDecimalOrZero(values.Value<string>("TomorrowPlanSize"));
}
string sumRate = "/";
if (sumTotalSize > 0)
{
sumRate = decimal.Round(sumTotalCompleteSize / sumTotalSize * 100, 2) + "%";
}
JObject summary3 = new JObject();
summary3.Add("UnitWorkName", "合计");
summary3.Add("TodayCompleteSize", sumTodayCompleteSize);
summary3.Add("TotalCompleteSize", sumTotalCompleteSize);
summary3.Add("TotalSize", sumTotalSize);
summary3.Add("TotalRate", sumRate);
summary3.Add("TomorrowPlanSize", sumTomorrowPlanSize);
Grid6.SummaryData = summary3;
}
#region
@@ -863,6 +885,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject
cell3.CellStyle = cellStyle0;
sheet.AddMergedRegion(new CellRangeAddress(8, 8, 0, 1 + list.Count));
int rowCount = 10;
int[] sum1 = new int[list.Count];
List<string> unitWorklist = Funs.GetStrListByStr(log.UnitWorks, ',');
for (int i = 0; i < unitWorklist.Count; i++)
{
@@ -880,9 +903,24 @@ namespace FineUIPro.Web.PZHGL.InformationProject
int num = 0;
num = persons.Where(x => x.UnitWorkId == unitWorklist[i] && x.WorkPostId == list[j]).ToList().Sum(x => x.Num ?? 0);
cell3.SetCellValue(num.ToString());
sum1[j] += Funs.GetNewIntOrZero(num.ToString());
}
}
rowCount += unitWorklist.Count;
row1 = sheet.GetRow(rowCount);
cell3 = row1.CreateCell(0);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue("");
cell3 = row1.CreateCell(1);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue("合计");
for (int i = 0; i < sum1.Length; i++)
{
cell3 = row1.CreateCell(i + 2);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue(sum1[i].ToString());
}
rowCount++;
int rowMachineTitle = rowCount;
row1 = sheet.GetRow(rowCount);
cell3 = row1.CreateCell(0);
@@ -908,6 +946,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject
cell3.CellStyle = cellStyle0;
sheet.AddMergedRegion(new CellRangeAddress(rowMachineTitle, rowMachineTitle, 0, 1 + list2.Count));
rowCount++;
int[] sum2 = new int[list2.Count];
for (int i = 0; i < unitWorklist.Count; i++)
{
row1 = sheet.GetRow(rowCount + i);
@@ -924,11 +963,125 @@ namespace FineUIPro.Web.PZHGL.InformationProject
int num = 0;
num = machines.Where(x => x.UnitWorkId == unitWorklist[i] && x.MachineId == list2[j]).ToList().Sum(x => x.Num ?? 0);
cell3.SetCellValue(num.ToString());
sum2[j] += Funs.GetNewIntOrZero(num.ToString());
}
}
rowCount += unitWorklist.Count;
row1 = sheet.GetRow(rowCount);
cell3 = row1.CreateCell(0);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue("");
cell3 = row1.CreateCell(1);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue("合计");
for (int i = 0; i < sum2.Length; i++)
{
cell3 = row1.CreateCell(i + 2);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue(sum2[i].ToString());
}
rowCount++;
int rowHJGLTitle = rowCount;
row1 = sheet.GetRow(rowCount);
cell3 = row1.CreateCell(0);
cell3.CellStyle = cellStyle3;
cell3.SetCellValue("焊接数据");
rowCount++;
row1 = sheet.GetRow(rowCount);
cell3 = row1.CreateCell(0);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue("序号");
cell3 = row1.CreateCell(1);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue("单位工程");
cell3 = row1.CreateCell(2);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue("今日完成(DIN");
cell3 = row1.CreateCell(3);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue("累计完成(DIN");
cell3 = row1.CreateCell(4);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue("总量(DIN");
cell3 = row1.CreateCell(5);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue("累计完成百分比");
cell3 = row1.CreateCell(6);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue("明日计划(DIN");
row1 = sheet.GetRow(rowHJGLTitle);
cell3 = row1.CreateCell(6);
cell3.CellStyle = cellStyle0;
sheet.AddMergedRegion(new CellRangeAddress(rowHJGLTitle, rowHJGLTitle, 0, 6));
rowCount++;
var hjgls = (from x in db.ZHGL_ConstructionLogHJGL
where personLogIds.Contains(x.ConstructionLogId)
orderby x.UnitWorkId
select x).ToList();
if (hjgls.Count > 0)
{
decimal sumTodayCompleteSize = 0, sumTotalCompleteSize = 0, sumTotalSize = 0, sumTomorrowPlanSize = 0;
for (int i = 0; i < hjgls.Count; i++)
{
row1 = sheet.GetRow(rowCount + i);
cell3 = row1.CreateCell(0);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue((i + 1).ToString());
cell3 = row1.CreateCell(1);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue(BLL.UnitWorkService.GetUnitWorkName(hjgls[i].UnitWorkId));
cell3 = row1.CreateCell(2);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue(hjgls[i].TodayCompleteSize.Value.ToString("0.###"));
cell3 = row1.CreateCell(3);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue(hjgls[i].TotalCompleteSize.Value.ToString("0.###"));
cell3 = row1.CreateCell(4);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue(hjgls[i].TotalSize.Value.ToString("0.###"));
cell3 = row1.CreateCell(5);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue(hjgls[i].TotalRate);
cell3 = row1.CreateCell(6);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue(hjgls[i].TomorrowPlanSize.Value.ToString("0.###"));
sumTodayCompleteSize += hjgls[i].TodayCompleteSize.Value;
sumTotalCompleteSize += hjgls[i].TotalCompleteSize.Value;
sumTotalSize += hjgls[i].TotalSize.Value;
sumTomorrowPlanSize += hjgls[i].TomorrowPlanSize.Value;
}
rowCount += hjgls.Count;
row1 = sheet.GetRow(rowCount);
cell3 = row1.CreateCell(0);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue("");
cell3 = row1.CreateCell(1);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue("合计");
cell3 = row1.CreateCell(2);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue(sumTodayCompleteSize.ToString("0.###"));
cell3 = row1.CreateCell(3);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue(sumTotalCompleteSize.ToString("0.###"));
cell3 = row1.CreateCell(4);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue(sumTotalSize.ToString("0.###"));
cell3 = row1.CreateCell(5);
cell3.CellStyle = cellStyle0;
string sumRate = "/";
if (sumTotalSize > 0)
{
sumRate = decimal.Round(sumTotalCompleteSize / sumTotalSize * 100, 2) + "%";
}
cell3.SetCellValue(sumRate);
cell3 = row1.CreateCell(6);
cell3.CellStyle = cellStyle0;
cell3.SetCellValue(sumTomorrowPlanSize.ToString("0.###"));
rowCount++;
}
row1 = sheet.GetRow(rowCount);
cell3 = row1.CreateCell(0);
cell3.CellStyle = cellStyle3;
cell3.SetCellValue("专业管理");
cell3 = row1.CreateCell(2);
@@ -1989,6 +2142,9 @@ namespace FineUIPro.Web.PZHGL.InformationProject
var allRecords = from x in db.ZHGL_ConstructionLogRecord
where personLogIds.Contains(x.ConstructionLogId)
select x;
var allHJGLs = from x in db.ZHGL_ConstructionLogHJGL
where personLogIds.Contains(x.ConstructionLogId)
select x;
List<Model.ConstructionLogPersonItem> personItems = new List<Model.ConstructionLogPersonItem>();
List<string> workPostList = Funs.GetStrListByStr(this.hdWorkPostId.Text, ',');
workPostList.Distinct();
@@ -2212,6 +2368,8 @@ namespace FineUIPro.Web.PZHGL.InformationProject
this.Grid4.DataBind();
this.Grid5.DataSource = allRecords;
this.Grid5.DataBind();
this.Grid6.DataSource = allHJGLs;
this.Grid6.DataBind();
}
}