质量检验-导出全部数据
This commit is contained in:
@@ -1,13 +1,18 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Mapster;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Security.AccessControl;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.mes.md;
|
||||
using ZR.Model.MES.qc;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
using ZR.Model.MES.qu;
|
||||
using ZR.Service.mes.qc.IService;
|
||||
|
||||
@@ -191,5 +196,71 @@ namespace ZR.Service.mes.qc
|
||||
return num;
|
||||
|
||||
}
|
||||
List<QcQualityStatisticsFirstDto> IQCStatisticsService.DownloadStatisticsTableExcel(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize, int type)
|
||||
{
|
||||
try
|
||||
{
|
||||
pageNum = 1;
|
||||
pageSize = 5000;
|
||||
return type switch
|
||||
{
|
||||
// 首检
|
||||
1 => DoFirstExcel(starttime, endTime, workorderid, partnumber, product_description, team, pageNum, pageSize),
|
||||
// 抛光
|
||||
2 => DoSecondExcel(starttime, endTime, workorderid, partnumber, product_description, team, pageNum, pageSize),
|
||||
// 包装
|
||||
3 => DoThirdExcel(starttime, endTime, workorderid, partnumber, product_description, team, pageNum, pageSize),
|
||||
// 总表
|
||||
4 => DoTotalExcel(starttime, endTime, workorderid, partnumber, product_description, team, pageNum, pageSize),
|
||||
_ => throw new Exception("获取的报表类型错误!" + type),
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception(ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
public List<QcQualityStatisticsFirstDto> DoFirstExcel(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize)
|
||||
{
|
||||
|
||||
List<QcQualityStatisticsFirst> list = GetQualityStatisticsTable_first(starttime, endTime, workorderid, partnumber, product_description, team, pageNum, pageSize).Item1;
|
||||
List<QcQualityStatisticsFirstDto> newList = list.Select(item => new QcQualityStatisticsFirstDto()
|
||||
{
|
||||
WorkorderId = item.WorkorderId,
|
||||
FinishedPartNumber = item.FinishedPartNumber,
|
||||
ProductDescription = product_description,
|
||||
Color = item.Color,
|
||||
RequireNumber = item.RequireNumber,
|
||||
Team = item.Team,
|
||||
QualifiedNumber = item.QualifiedNumber,
|
||||
QualifiedRate = item.QualifiedRate ?? 0,
|
||||
PaoguangTotal = item.PaoguangTotal ?? 0,
|
||||
DamoTotal = item.DamoTotal ?? 0,
|
||||
BaofeiTotal = item.BaofeiTotal ?? 0,
|
||||
StartTime = item.StartTime,
|
||||
EndTime = item.EndTime,
|
||||
}).ToList();
|
||||
return newList;
|
||||
}
|
||||
public List<QcQualityStatisticsFirstDto> DoSecondExcel(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize)
|
||||
{
|
||||
List<QcQualityStatisticsAgain> list = GetQualityStatisticsTable_again(starttime, endTime, workorderid, partnumber, product_description, team, pageNum, pageSize).Item1;
|
||||
List<QcQualityStatisticsFirstDto> newList = list.Select(item => new QcQualityStatisticsFirstDto()).ToList();
|
||||
return newList;
|
||||
}
|
||||
|
||||
public List<QcQualityStatisticsFirstDto> DoThirdExcel(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize)
|
||||
{
|
||||
List<QcQualityStatisticsFinal> list = GetQualityStatisticsTable_final(starttime, endTime, workorderid, partnumber, product_description, team, pageNum, pageSize).Item1;
|
||||
List<QcQualityStatisticsFirstDto> newList = list.Select(item => new QcQualityStatisticsFirstDto()).ToList();
|
||||
return newList;
|
||||
}
|
||||
public List<QcQualityStatisticsFirstDto> DoTotalExcel(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize)
|
||||
{
|
||||
List<QcQualityStatisticsTotal> list = GetQualityStatisticsTable_total(starttime, endTime, workorderid, partnumber, product_description, team, pageNum, pageSize).Item1;
|
||||
List<QcQualityStatisticsFirstDto> newList = list.Select(item => new QcQualityStatisticsFirstDto()).ToList();
|
||||
return newList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user