首检添加数据看板

This commit is contained in:
2024-06-07 11:04:26 +08:00
parent c93711290e
commit 769d2da1e0
344 changed files with 1772 additions and 2526 deletions

View File

@@ -1,18 +1,10 @@
using Microsoft.AspNetCore.SignalR;
using ZR.Admin.WebApi.Controllers;
using ZR.Admin.WebApi.Hubs;
using ZR.Service.mes.qc.IService;
using Microsoft.AspNetCore.Mvc;
using ZR.Model.MES.qc;
using System.Collections.Generic;
using ZR.Model.MES.qc.DTO;
using NPOI.HSSF.UserModel;
using NPOI.XSSF.UserModel;
using Microsoft.AspNetCore.Mvc;
using NPOI.SS.UserModel;
using ZR.Model.MES.wms;
using SqlSugar;
using NPOI.SS.Util;
using NPOI.HSSF.Util;
using NPOI.XSSF.UserModel;
using ZR.Model.MES.qc;
using ZR.Model.MES.qc.DTO;
using ZR.Service.mes.qc.IService;
namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
{
@@ -112,11 +104,11 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
style.Alignment = HorizontalAlignment.Center;
style.VerticalAlignment = VerticalAlignment.Center;
// 标题列表
string[] titleDict = { "工单号", "零件号", "颜色", "描述", "生产投入数", "班次", "合格数", "合格率", "抛光总数", "打磨总数", "报废总数", "开始时间", "结束时间"};
string[] titleGroupDict = {"油漆", "设备", "毛坯", "程序", "班组操作" };
string[] titleDict = { "工单号", "零件号", "颜色", "描述", "生产投入数", "班次", "合格数", "合格率", "抛光总数", "打磨总数", "报废总数", "开始时间", "结束时间" };
string[] titleGroupDict = { "油漆", "设备", "毛坯", "程序", "班组操作" };
int[] titleGroupIndex = { 14, 20, 27, 33, 38 };
string[] titleDetailDict = {
"备注",
string[] titleDetailDict = {
"备注",
"缩孔", "针孔", "失光","色差","点子","其他",
"水斑", "脏点", "变形","油珠","脱落","撞伤","其他",
"毛刺", "缩印", "擦伤","砂印","脏点","打磨",
@@ -132,7 +124,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
var titleCell1 = groupTitle.CreateCell(0);
titleCell1.SetCellValue("工单信息");
titleCell1.CellStyle = style;
for (int i = 0; i < titleGroupDict.Length;i++)
for (int i = 0; i < titleGroupDict.Length; i++)
{
var cell = groupTitle.CreateCell(titleGroupIndex[i]);
cell.SetCellValue(titleGroupDict[i]);
@@ -142,7 +134,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
titleDict = titleDict.Concat(titleDetailDict).ToArray();
// 合并标题列
CellRangeAddress titleRange1 = new(0, 0, 0, titleGroupIndex[0]-1);
CellRangeAddress titleRange1 = new(0, 0, 0, titleGroupIndex[0] - 1);
sheet.AddMergedRegion(titleRange1);
CellRangeAddress titleRange2 = new(0, 0, titleGroupIndex[0], titleGroupIndex[1] - 1);
sheet.AddMergedRegion(titleRange2);
@@ -165,9 +157,10 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
string _lastWorkOrderId = "";
// 数据开始行
int rowIndex = startTitle + 1;
for (int i = 0;i< excelDataList.Count;i++) {
for (int i = 0; i < excelDataList.Count; i++)
{
var item = excelDataList[i];
if (!isShowDetail &&_lastWorkOrderId == item.WorkorderId)
if (!isShowDetail && _lastWorkOrderId == item.WorkorderId)
{
continue;
}
@@ -215,7 +208,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
var cell13 = row.CreateCell(12);
cell13.SetCellValue(item.EndTime.ToString());
cell13.CellStyle = style;
if(isShowDetail)
if (isShowDetail)
{
// 备注
var cell14 = row.CreateCell(13);
@@ -223,7 +216,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
cell14.CellStyle = style;
// 油漆
var cell15 = row.CreateCell(14);
cell15.SetCellValue(item.PaintSuokong.ToString() == "0"? "": item.PaintSuokong.ToString());
cell15.SetCellValue(item.PaintSuokong.ToString() == "0" ? "" : item.PaintSuokong.ToString());
cell15.CellStyle = style;
var cell16 = row.CreateCell(15);
cell16.SetCellValue(item.PaintZhengkong.ToString() == "0" ? "" : item.PaintZhengkong.ToString());
@@ -341,12 +334,12 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
}
}
}
}
_lastWorkOrderId = item.WorkorderId;
rowIndex++;
}
// 导出