From 0cb9162dfd5404e9072e6fca35a79b580de878fc Mon Sep 17 00:00:00 2001 From: "qianhao.xu" Date: Mon, 19 Feb 2024 09:08:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A8=E9=87=8F=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/qc/FQC/FirstFQCController.cs | 9 + .../mes/qc/FQC/QCStatisticsController.cs | 72 +++++ ZR.Model/MES/qc/QcQualityStatisticsAgain.cs | 263 +++++++++++++++++ ZR.Model/MES/qc/QcQualityStatisticsFinal.cs | 265 ++++++++++++++++++ ZR.Model/MES/qc/QcQualityStatisticsFirst.cs | 265 ++++++++++++++++++ ZR.Model/MES/qc/QcQualityStatisticsTotal.cs | 265 ++++++++++++++++++ ZR.Service/mes/qc/FirstFQCService.cs | 205 ++++++++++++-- .../mes/qc/IService/IFirstFQCService.cs | 2 + .../mes/qc/IService/IQCStatisticsService.cs | 26 ++ ZR.Service/mes/qc/QCStatisticsService.cs | 149 ++++++++++ 10 files changed, 1499 insertions(+), 22 deletions(-) create mode 100644 ZR.Admin.WebApi/Controllers/mes/qc/FQC/QCStatisticsController.cs create mode 100644 ZR.Model/MES/qc/QcQualityStatisticsAgain.cs create mode 100644 ZR.Model/MES/qc/QcQualityStatisticsFinal.cs create mode 100644 ZR.Model/MES/qc/QcQualityStatisticsFirst.cs create mode 100644 ZR.Model/MES/qc/QcQualityStatisticsTotal.cs create mode 100644 ZR.Service/mes/qc/IService/IQCStatisticsService.cs create mode 100644 ZR.Service/mes/qc/QCStatisticsService.cs diff --git a/ZR.Admin.WebApi/Controllers/mes/qc/FQC/FirstFQCController.cs b/ZR.Admin.WebApi/Controllers/mes/qc/FQC/FirstFQCController.cs index 0a514d12..f3d41fcb 100644 --- a/ZR.Admin.WebApi/Controllers/mes/qc/FQC/FirstFQCController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/qc/FQC/FirstFQCController.cs @@ -283,6 +283,15 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC return SUCCESS(result); } + + // 更改工单状态为完成态 + [HttpGet("generateQualityStatisticsTable")] + public IActionResult GenerateQualityStatisticsTable(string workorderID,string team) + { + int result = fQCService.GenerateQualityStatisticsTable(workorderID, team); + return SUCCESS(result); + } + } } diff --git a/ZR.Admin.WebApi/Controllers/mes/qc/FQC/QCStatisticsController.cs b/ZR.Admin.WebApi/Controllers/mes/qc/FQC/QCStatisticsController.cs new file mode 100644 index 00000000..704b502b --- /dev/null +++ b/ZR.Admin.WebApi/Controllers/mes/qc/FQC/QCStatisticsController.cs @@ -0,0 +1,72 @@ +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; + +namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC +{ + [Route("mes/qc/statistics")] + public class QCStatisticsController : BaseController + { + private readonly IQCStatisticsService qcStatistics; + public QCStatisticsController(IQCStatisticsService qcStatistics) + { + this.qcStatistics = qcStatistics; + } + + /// + /// 获取 统计表 首检 + /// + /// + [HttpGet("queryQualityStatisticsTable_first")] + public IActionResult GetQualityStatisticsTable_first(DateTime starttime,DateTime endTime,string workorderid,string partnumber,string product_description,string team,int pageNum,int pageSize) + { + (List, int) list = qcStatistics.GetQualityStatisticsTable_first(starttime, endTime, workorderid, partnumber, product_description, team, pageNum, pageSize); + + return SUCCESS(list); + } + /// + /// 获取 统计表 二检 + /// + /// + [HttpGet("queryQualityStatisticsTable_again")] + public IActionResult GetQualityStatisticsTable_again(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize) + { + (List, int) list = qcStatistics.GetQualityStatisticsTable_again(starttime, endTime, workorderid, partnumber, product_description, team, pageNum, pageSize); + + return SUCCESS(list); + } + + /// + /// 获取 统计表 三检 + /// + /// + [HttpGet("queryQualityStatisticsTable_final")] + public IActionResult GetQualityStatisticsTable_final(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize) + { + (List, int) list = qcStatistics.GetQualityStatisticsTable_final(starttime, endTime, workorderid, partnumber, product_description, team, pageNum, pageSize); + + return SUCCESS(list); + } + + /// + /// 获取 统计表 总 + /// + /// + [HttpGet("queryQualityStatisticsTable_total")] + public IActionResult GetQualityStatisticsTable_total(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize) + { + (List, int) list = qcStatistics.GetQualityStatisticsTable_total(starttime, endTime, workorderid, partnumber, product_description, team, pageNum, pageSize); + + return SUCCESS(list); + } + + + + + } +} + + diff --git a/ZR.Model/MES/qc/QcQualityStatisticsAgain.cs b/ZR.Model/MES/qc/QcQualityStatisticsAgain.cs new file mode 100644 index 00000000..c9253f96 --- /dev/null +++ b/ZR.Model/MES/qc/QcQualityStatisticsAgain.cs @@ -0,0 +1,263 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.MES.qc +{ + /// + /// 质量统计-二检 + /// + [SugarTable("qc_quality_statistics_again2")] + public class QcQualityStatisticsAgain + { + /// + /// id + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true)] + public string Id { get; set; } + /// + /// 工单号 + /// + [SugarColumn(ColumnName = "workorder_id")] + public string WorkorderId { get; set; } + /// + /// 零件号 + /// + [SugarColumn(ColumnName = "finished_part_number")] + public string FinishedPartNumber { get; set; } + /// + /// 描述 + /// + [SugarColumn(ColumnName = "product_description")] + public string ProductDescription { get; set; } + /// + /// 生产投入数 + /// + [SugarColumn(ColumnName = "require_number")] + public int? RequireNumber { get; set; } + /// + /// 合格率 + /// + [SugarColumn(ColumnName = "qualified_rate")] + public decimal? QualifiedRate { get; set; } + /// + /// 合格数 + /// + [SugarColumn(ColumnName = "qualified_number")] + public int? QualifiedNumber { get; set; } + /// + /// 班次 + /// + [SugarColumn(ColumnName = "team")] + public string Team { get; set; } + /// + /// 抛光总数 + /// + [SugarColumn(ColumnName = "paoguang_total")] + public int? PaoguangTotal { get; set; } + /// + /// 打磨总数 + /// + [SugarColumn(ColumnName = "damo_total")] + public int? DamoTotal { get; set; } + /// + /// 报废总数 + /// + [SugarColumn(ColumnName = "baofei_total")] + public int? BaofeiTotal { get; set; } + /// + /// 结束时间 + /// + [SugarColumn(ColumnName = "end_time")] + public DateTime? EndTime { get; set; } + /// + /// 开始时间 + /// + [SugarColumn(ColumnName = "start_time")] + public DateTime? StartTime { get; set; } + /// + /// 备注(报废,打磨,抛光) + /// + [SugarColumn(ColumnName = "remark")] + public string Remark { get; set; } + + /// + /// 备注(报废1,打磨2,抛光3) + /// + [SugarColumn(ColumnName = "remark2")] + public int Remark2 { get; set; } + + + /// + /// 油漆-缩孔 + /// + [SugarColumn(ColumnName = "paint_suokong")] + public int? PaintSuokong { get; set; } + /// + /// 油漆-针孔 + /// + [SugarColumn(ColumnName = "paint_zhengkong")] + public int? PaintZhengkong { get; set; } + /// + /// 油漆-失光 + /// + [SugarColumn(ColumnName = "paint_shiguang")] + public int? PaintShiguang { get; set; } + /// + /// 油漆-色差 + /// + [SugarColumn(ColumnName = "paint_secha")] + public int? PaintSecha { get; set; } + /// + /// 油漆-点子 + /// + [SugarColumn(ColumnName = "paint_dianzi")] + public int? PaintDianzi { get; set; } + /// + /// 油漆-其他 + /// + [SugarColumn(ColumnName = "paint_other")] + public int? PaintOther { get; set; } + /// + /// 设备-水斑 + /// + [SugarColumn(ColumnName = "device_shuiban")] + public int? DeviceShuiban { get; set; } + /// + /// 设备-变形 + /// + [SugarColumn(ColumnName = "device_bianxing")] + public int? DeviceBianxing { get; set; } + /// + /// 设备-脏点 + /// + [SugarColumn(ColumnName = "device_zandian")] + public int? DeviceZandian { get; set; } + /// + /// 设备-脱落 + /// + [SugarColumn(ColumnName = "device_tuoluo")] + public int? DeviceTuoluo { get; set; } + /// + /// 设备-油珠 + /// + [SugarColumn(ColumnName = "device_youzhu")] + public int? DeviceYouzhu { get; set; } + /// + /// 设备-撞伤 + /// + [SugarColumn(ColumnName = "device_zhuangshang")] + public int? DeviceZhuangshang { get; set; } + /// + /// 设备-其他 + /// + [SugarColumn(ColumnName = "device_other")] + public int? DeviceOther { get; set; } + /// + /// 毛坯-毛刺 + /// + [SugarColumn(ColumnName = "blank_maoci")] + public int? BlankMaoci { get; set; } + /// + /// 毛坯-缩印 + /// + [SugarColumn(ColumnName = "blank_suoyin")] + public int? BlankSuoyin { get; set; } + /// + /// 毛坯-擦伤 + /// + [SugarColumn(ColumnName = "blank_canshuang")] + public int? BlankCanshuang { get; set; } + /// + /// 毛坯-砂印 + /// + [SugarColumn(ColumnName = "blank_shaying")] + public int? BlankShaying { get; set; } + /// + /// 毛坯-脏点 + /// + [SugarColumn(ColumnName = "blank_zangdian")] + public int? BlankZangdian { get; set; } + /// + /// 毛坯-打磨 + /// + [SugarColumn(ColumnName = "blank_damo")] + public int? BlankDamo { get; set; } + /// + /// 程序-流挂 + /// + [SugarColumn(ColumnName = "program_liuguang")] + public int? ProgramLiuguang { get; set; } + /// + /// 程序-色漆缺漆 + /// + [SugarColumn(ColumnName = "program_seqiqueqi")] + public int? ProgramSeqiqueqi { get; set; } + /// + /// 程序-清漆缺漆 + /// + [SugarColumn(ColumnName = "program_qingqiqueqi")] + public int? ProgramQingqiqueqi { get; set; } + /// + /// 程序-桔皮 + /// + [SugarColumn(ColumnName = "program_jupi")] + public int? ProgramJupi { get; set; } + /// + /// 程序-其他 + /// + [SugarColumn(ColumnName = "program_other")] + public int? ProgramOther { get; set; } + /// + /// 班组操作-脱落擦伤 + /// + [SugarColumn(ColumnName = "team_tuoluocanshuang")] + public int? TeamTuoluocanshuang { get; set; } + /// + /// 班组操作-清漆漆块 + /// + [SugarColumn(ColumnName = "team_qingqiqikuai")] + public int? TeamQingqiqikuai { get; set; } + /// + /// 班组操作-色漆漆块 + /// + [SugarColumn(ColumnName = "team_seqiqikuai")] + public int? TeamSeqiqikuai { get; set; } + /// + /// 班组操作-发花 + /// + [SugarColumn(ColumnName = "team_fahua")] + public int? TeamFahua { get; set; } + /// + /// 班组操作-亮斑 + /// + [SugarColumn(ColumnName = "team_liangbang")] + public int? TeamLiangbang { get; set; } + /// + /// 班组操作-喷漏 + /// + [SugarColumn(ColumnName = "team_penglou")] + public int? TeamPenglou { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "UPDATED_TIME")] + public DateTime? UpdatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "UPDATED_BY")] + public string UpdatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "CREATED_TIME")] + public DateTime? CreatedTime { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "CREATED_BY")] + public string CreatedBy { get; set; } + } +} diff --git a/ZR.Model/MES/qc/QcQualityStatisticsFinal.cs b/ZR.Model/MES/qc/QcQualityStatisticsFinal.cs new file mode 100644 index 00000000..64d969cf --- /dev/null +++ b/ZR.Model/MES/qc/QcQualityStatisticsFinal.cs @@ -0,0 +1,265 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.MES.qc +{ + /// + /// 质量统计-三检 + /// + [SugarTable("qc_quality_statistics_final2")] + public class QcQualityStatisticsFinal + { + /// + /// id + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true)] + public string Id { get; set; } + /// + /// 工单号 + /// + [SugarColumn(ColumnName = "workorder_id")] + public string WorkorderId { get; set; } + /// + /// 零件号 + /// + [SugarColumn(ColumnName = "finished_part_number")] + public string FinishedPartNumber { get; set; } + /// + /// 班次 + /// + [SugarColumn(ColumnName = "team")] + public string Team { get; set; } + /// + /// 生产投入数 + /// + [SugarColumn(ColumnName = "require_number")] + public int? RequireNumber { get; set; } + /// + /// 描述 + /// + [SugarColumn(ColumnName = "product_description")] + public string ProductDescription { get; set; } + /// + /// 合格数 + /// + [SugarColumn(ColumnName = "qualified_number")] + public int? QualifiedNumber { get; set; } + /// + /// 合格率 + /// + [SugarColumn(ColumnName = "qualified_rate")] + public decimal? QualifiedRate { get; set; } + /// + /// 抛光总数 + /// + [SugarColumn(ColumnName = "paoguang_total")] + public int? PaoguangTotal { get; set; } + /// + /// 打磨总数 + /// + [SugarColumn(ColumnName = "damo_total")] + public int? DamoTotal { get; set; } + /// + /// 报废总数 + /// + [SugarColumn(ColumnName = "baofei_total")] + public int? BaofeiTotal { get; set; } + /// + /// 开始时间 + /// + [SugarColumn(ColumnName = "start_time")] + public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// + [SugarColumn(ColumnName = "end_time")] + public DateTime? EndTime { get; set; } + /// + /// 备注(报废,打磨,抛光) + /// + [SugarColumn(ColumnName = "remark")] + public string Remark { get; set; } + + + /// + /// 备注(报废1,打磨2,抛光3) + /// + [SugarColumn(ColumnName = "remark2")] + public int Remark2 { get; set; } + + + /// + /// 油漆-缩孔 + /// + [SugarColumn(ColumnName = "paint_suokong")] + public int? PaintSuokong { get; set; } + /// + /// 油漆-针孔 + /// + [SugarColumn(ColumnName = "paint_zhengkong")] + public int? PaintZhengkong { get; set; } + /// + /// 油漆-失光 + /// + [SugarColumn(ColumnName = "paint_shiguang")] + public int? PaintShiguang { get; set; } + /// + /// 油漆-色差 + /// + [SugarColumn(ColumnName = "paint_secha")] + public int? PaintSecha { get; set; } + /// + /// 油漆-点子 + /// + [SugarColumn(ColumnName = "paint_dianzi")] + public int? PaintDianzi { get; set; } + /// + /// 油漆-其他 + /// + [SugarColumn(ColumnName = "paint_other")] + public int? PaintOther { get; set; } + /// + /// 设备-水斑 + /// + [SugarColumn(ColumnName = "device_shuiban")] + public int? DeviceShuiban { get; set; } + /// + /// 设备-脏点 + /// + [SugarColumn(ColumnName = "device_zandian")] + public int? DeviceZandian { get; set; } + /// + /// 设备-变形 + /// + [SugarColumn(ColumnName = "device_bianxing")] + public int? DeviceBianxing { get; set; } + /// + /// 设备-油珠 + /// + [SugarColumn(ColumnName = "device_youzhu")] + public int? DeviceYouzhu { get; set; } + /// + /// 设备-脱落 + /// + [SugarColumn(ColumnName = "device_tuoluo")] + public int? DeviceTuoluo { get; set; } + /// + /// 设备-撞伤 + /// + [SugarColumn(ColumnName = "device_zhuangshang")] + public int? DeviceZhuangshang { get; set; } + /// + /// 设备-其他 + /// + [SugarColumn(ColumnName = "device_other")] + public int? DeviceOther { get; set; } + /// + /// 毛坯-毛刺 + /// + [SugarColumn(ColumnName = "blank_maoci")] + public int? BlankMaoci { get; set; } + /// + /// 毛坯-缩印 + /// + [SugarColumn(ColumnName = "blank_suoyin")] + public int? BlankSuoyin { get; set; } + /// + /// 毛坯-擦伤 + /// + [SugarColumn(ColumnName = "blank_canshuang")] + public int? BlankCanshuang { get; set; } + /// + /// 毛坯-砂印 + /// + [SugarColumn(ColumnName = "blank_shaying")] + public int? BlankShaying { get; set; } + /// + /// 毛坯-脏点 + /// + [SugarColumn(ColumnName = "blank_zangdian")] + public int? BlankZangdian { get; set; } + /// + /// 毛坯-打磨 + /// + [SugarColumn(ColumnName = "blank_damo")] + public int? BlankDamo { get; set; } + /// + /// 程序-流挂 + /// + [SugarColumn(ColumnName = "program_liuguang")] + public int? ProgramLiuguang { get; set; } + /// + /// 程序-色漆缺漆 + /// + [SugarColumn(ColumnName = "program_seqiqueqi")] + public int? ProgramSeqiqueqi { get; set; } + /// + /// 程序-清漆缺漆 + /// + [SugarColumn(ColumnName = "program_qingqiqueqi")] + public int? ProgramQingqiqueqi { get; set; } + /// + /// 程序-桔皮 + /// + [SugarColumn(ColumnName = "program_jupi")] + public int? ProgramJupi { get; set; } + /// + /// 程序-其他 + /// + [SugarColumn(ColumnName = "program_other")] + public int? ProgramOther { get; set; } + /// + /// 班组操作-脱落擦伤 + /// + [SugarColumn(ColumnName = "team_tuoluocanshuang")] + public int? TeamTuoluocanshuang { get; set; } + /// + /// 班组操作-清漆漆块 + /// + [SugarColumn(ColumnName = "team_qingqiqikuai")] + public int? TeamQingqiqikuai { get; set; } + /// + /// 班组操作-色漆漆块 + /// + [SugarColumn(ColumnName = "team_seqiqikuai")] + public int? TeamSeqiqikuai { get; set; } + /// + /// 班组操作-发花 + /// + [SugarColumn(ColumnName = "team_fahua")] + public int? TeamFahua { get; set; } + /// + /// 班组操作-亮斑 + /// + [SugarColumn(ColumnName = "team_liangbang")] + public int? TeamLiangbang { get; set; } + /// + /// 班组操作-喷漏 + /// + [SugarColumn(ColumnName = "team_penglou")] + public int? TeamPenglou { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "UPDATED_TIME")] + public DateTime? UpdatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "UPDATED_BY")] + public string UpdatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "CREATED_TIME")] + public DateTime? CreatedTime { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "CREATED_BY")] + public string CreatedBy { get; set; } + } +} + diff --git a/ZR.Model/MES/qc/QcQualityStatisticsFirst.cs b/ZR.Model/MES/qc/QcQualityStatisticsFirst.cs new file mode 100644 index 00000000..f1fcf791 --- /dev/null +++ b/ZR.Model/MES/qc/QcQualityStatisticsFirst.cs @@ -0,0 +1,265 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.MES.qc +{ + /// + /// 质量统计-首检 + /// + [SugarTable("qc_quality_statistics_first")] + public class QcQualityStatisticsFirst + { + /// + /// id + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true)] + public string Id { get; set; } + /// + /// 工单号 + /// + [SugarColumn(ColumnName = "workorder_id")] + public string WorkorderId { get; set; } + /// + /// 零件号 + /// + [SugarColumn(ColumnName = "finished_part_number")] + public string FinishedPartNumber { get; set; } + /// + /// 描述 + /// + [SugarColumn(ColumnName = "product_description")] + public string ProductDescription { get; set; } + /// + /// 生产投入数 + /// + [SugarColumn(ColumnName = "require_number")] + public int? RequireNumber { get; set; } + /// + /// 班次 + /// + [SugarColumn(ColumnName = "team")] + public string Team { get; set; } + /// + /// 合格数 + /// + [SugarColumn(ColumnName = "qualified_number")] + public int? QualifiedNumber { get; set; } + /// + /// 合格率 + /// + [SugarColumn(ColumnName = "qualified_rate")] + public decimal? QualifiedRate { get; set; } + /// + /// 抛光总数 + /// + [SugarColumn(ColumnName = "paoguang_total")] + public int? PaoguangTotal { get; set; } + /// + /// 打磨总数 + /// + [SugarColumn(ColumnName = "damo_total")] + public int? DamoTotal { get; set; } + /// + /// 报废总数 + /// + [SugarColumn(ColumnName = "baofei_total")] + public int? BaofeiTotal { get; set; } + /// + /// 开始时间 + /// + [SugarColumn(ColumnName = "start_time")] + public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// + [SugarColumn(ColumnName = "end_time")] + public DateTime? EndTime { get; set; } + /// + /// 备注(报废,打磨,抛光) + /// + [SugarColumn(ColumnName = "remark")] + public string Remark { get; set; } + + + /// + /// 备注(报废1,打磨2,抛光3) + /// + [SugarColumn(ColumnName = "remark2")] + public int Remark2 { get; set; } + + + + /// + /// 油漆-缩孔 + /// + [SugarColumn(ColumnName = "paint_suokong")] + public int? PaintSuokong { get; set; } + /// + /// 油漆-针孔 + /// + [SugarColumn(ColumnName = "paint_zhengkong")] + public int? PaintZhengkong { get; set; } + /// + /// 油漆-失光 + /// + [SugarColumn(ColumnName = "paint_shiguang")] + public int? PaintShiguang { get; set; } + /// + /// 油漆-色差 + /// + [SugarColumn(ColumnName = "paint_secha")] + public int? PaintSecha { get; set; } + /// + /// 油漆-点子 + /// + [SugarColumn(ColumnName = "paint_dianzi")] + public int? PaintDianzi { get; set; } + /// + /// 油漆-其他 + /// + [SugarColumn(ColumnName = "paint_other")] + public int? PaintOther { get; set; } + /// + /// 设备-水斑 + /// + [SugarColumn(ColumnName = "device_shuiban")] + public int? DeviceShuiban { get; set; } + /// + /// 设备-脏点 + /// + [SugarColumn(ColumnName = "device_zandian")] + public int? DeviceZandian { get; set; } + /// + /// 设备-变形 + /// + [SugarColumn(ColumnName = "device_bianxing")] + public int? DeviceBianxing { get; set; } + /// + /// 设备-油珠 + /// + [SugarColumn(ColumnName = "device_youzhu")] + public int? DeviceYouzhu { get; set; } + /// + /// 设备-脱落 + /// + [SugarColumn(ColumnName = "device_tuoluo")] + public int? DeviceTuoluo { get; set; } + /// + /// 设备-撞伤 + /// + [SugarColumn(ColumnName = "device_zhuangshang")] + public int? DeviceZhuangshang { get; set; } + /// + /// 设备-其他 + /// + [SugarColumn(ColumnName = "device_other")] + public int? DeviceOther { get; set; } + /// + /// 毛坯-毛刺 + /// + [SugarColumn(ColumnName = "blank_maoci")] + public int? BlankMaoci { get; set; } + /// + /// 毛坯-缩印 + /// + [SugarColumn(ColumnName = "blank_suoyin")] + public int? BlankSuoyin { get; set; } + /// + /// 毛坯-擦伤 + /// + [SugarColumn(ColumnName = "blank_canshuang")] + public int? BlankCanshuang { get; set; } + /// + /// 毛坯-砂印 + /// + [SugarColumn(ColumnName = "blank_shaying")] + public int? BlankShaying { get; set; } + /// + /// 毛坯-脏点 + /// + [SugarColumn(ColumnName = "blank_zangdian")] + public int? BlankZangdian { get; set; } + /// + /// 毛坯-打磨 + /// + [SugarColumn(ColumnName = "blank_damo")] + public int? BlankDamo { get; set; } + /// + /// 程序-流挂 + /// + [SugarColumn(ColumnName = "program_liuguang")] + public int? ProgramLiuguang { get; set; } + /// + /// 程序-色漆缺漆 + /// + [SugarColumn(ColumnName = "program_seqiqueqi")] + public int? ProgramSeqiqueqi { get; set; } + /// + /// 程序-清漆缺漆 + /// + [SugarColumn(ColumnName = "program_qingqiqueqi")] + public int? ProgramQingqiqueqi { get; set; } + /// + /// 程序-桔皮 + /// + [SugarColumn(ColumnName = "program_jupi")] + public int? ProgramJupi { get; set; } + /// + /// 程序-其他 + /// + [SugarColumn(ColumnName = "program_other")] + public int? ProgramOther { get; set; } + /// + /// 班组操作-脱落擦伤 + /// + [SugarColumn(ColumnName = "team_tuoluocanshuang")] + public int? TeamTuoluocanshuang { get; set; } + /// + /// 班组操作-清漆漆块 + /// + [SugarColumn(ColumnName = "team_qingqiqikuai")] + public int? TeamQingqiqikuai { get; set; } + /// + /// 班组操作-色漆漆块 + /// + [SugarColumn(ColumnName = "team_seqiqikuai")] + public int? TeamSeqiqikuai { get; set; } + /// + /// 班组操作-发花 + /// + [SugarColumn(ColumnName = "team_fahua")] + public int? TeamFahua { get; set; } + /// + /// 班组操作-亮斑 + /// + [SugarColumn(ColumnName = "team_liangbang")] + public int? TeamLiangbang { get; set; } + /// + /// 班组操作-喷漏 + /// + [SugarColumn(ColumnName = "team_penglou")] + public int? TeamPenglou { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "UPDATED_TIME")] + public DateTime? UpdatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "UPDATED_BY")] + public string UpdatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "CREATED_TIME")] + public DateTime? CreatedTime { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "CREATED_BY")] + public string CreatedBy { get; set; } + } +} diff --git a/ZR.Model/MES/qc/QcQualityStatisticsTotal.cs b/ZR.Model/MES/qc/QcQualityStatisticsTotal.cs new file mode 100644 index 00000000..7f1c9b08 --- /dev/null +++ b/ZR.Model/MES/qc/QcQualityStatisticsTotal.cs @@ -0,0 +1,265 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.MES.qc +{ + /// + /// 质量统计-总 + /// + [SugarTable("qc_quality_statistics_total")] + public class QcQualityStatisticsTotal + { + /// + /// id + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true)] + public string Id { get; set; } + /// + /// 工单号 + /// + [SugarColumn(ColumnName = "workorder_id")] + public string WorkorderId { get; set; } + /// + /// 零件号 + /// + [SugarColumn(ColumnName = "finished_part_number")] + public string FinishedPartNumber { get; set; } + /// + /// 描述 + /// + [SugarColumn(ColumnName = "product_description")] + public string ProductDescription { get; set; } + /// + /// 生产投入数 + /// + [SugarColumn(ColumnName = "require_number")] + public int? RequireNumber { get; set; } + /// + /// 班次 + /// + [SugarColumn(ColumnName = "team")] + public string Team { get; set; } + /// + /// 合格数 + /// + [SugarColumn(ColumnName = "qualified_number")] + public int? QualifiedNumber { get; set; } + /// + /// 抛光总数 + /// + [SugarColumn(ColumnName = "paoguang_total")] + public int? PaoguangTotal { get; set; } + /// + /// 合格率 + /// + [SugarColumn(ColumnName = "qualified_rate")] + public decimal? QualifiedRate { get; set; } + /// + /// 打磨总数 + /// + [SugarColumn(ColumnName = "damo_total")] + public int? DamoTotal { get; set; } + /// + /// 报废总数 + /// + [SugarColumn(ColumnName = "baofei_total")] + public int? BaofeiTotal { get; set; } + /// + /// 开始时间 + /// + [SugarColumn(ColumnName = "start_time")] + public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// + [SugarColumn(ColumnName = "end_time")] + public DateTime? EndTime { get; set; } + /// + /// 备注(报废,打磨,抛光) + /// + [SugarColumn(ColumnName = "remark")] + public string Remark { get; set; } + + /// + /// 备注(报废1,打磨2,抛光3) + /// + [SugarColumn(ColumnName = "remark2")] + public int Remark2 { get; set; } + + + /// + /// 油漆-缩孔 + /// + [SugarColumn(ColumnName = "paint_suokong")] + public int? PaintSuokong { get; set; } + /// + /// 油漆-针孔 + /// + [SugarColumn(ColumnName = "paint_zhengkong")] + public int? PaintZhengkong { get; set; } + /// + /// 油漆-失光 + /// + [SugarColumn(ColumnName = "paint_shiguang")] + public int? PaintShiguang { get; set; } + /// + /// 油漆-色差 + /// + [SugarColumn(ColumnName = "paint_secha")] + public int? PaintSecha { get; set; } + /// + /// 油漆-点子 + /// + [SugarColumn(ColumnName = "paint_dianzi")] + public int? PaintDianzi { get; set; } + /// + /// 设备-水斑 + /// + [SugarColumn(ColumnName = "device_shuiban")] + public int? DeviceShuiban { get; set; } + /// + /// 油漆-其他 + /// + [SugarColumn(ColumnName = "paint_other")] + public int? PaintOther { get; set; } + /// + /// 设备-脏点 + /// + [SugarColumn(ColumnName = "device_zandian")] + public int? DeviceZandian { get; set; } + /// + /// 设备-变形 + /// + [SugarColumn(ColumnName = "device_bianxing")] + public int? DeviceBianxing { get; set; } + /// + /// 设备-油珠 + /// + [SugarColumn(ColumnName = "device_youzhu")] + public int? DeviceYouzhu { get; set; } + /// + /// 设备-脱落 + /// + [SugarColumn(ColumnName = "device_tuoluo")] + public int? DeviceTuoluo { get; set; } + /// + /// 设备-撞伤 + /// + [SugarColumn(ColumnName = "device_zhuangshang")] + public int? DeviceZhuangshang { get; set; } + /// + /// 设备-其他 + /// + [SugarColumn(ColumnName = "device_other")] + public int? DeviceOther { get; set; } + /// + /// 毛坯-毛刺 + /// + [SugarColumn(ColumnName = "blank_maoci")] + public int? BlankMaoci { get; set; } + /// + /// 毛坯-缩印 + /// + [SugarColumn(ColumnName = "blank_suoyin")] + public int? BlankSuoyin { get; set; } + /// + /// 毛坯-擦伤 + /// + [SugarColumn(ColumnName = "blank_canshuang")] + public int? BlankCanshuang { get; set; } + /// + /// 毛坯-砂印 + /// + [SugarColumn(ColumnName = "blank_shaying")] + public int? BlankShaying { get; set; } + /// + /// 毛坯-脏点 + /// + [SugarColumn(ColumnName = "blank_zangdian")] + public int? BlankZangdian { get; set; } + /// + /// 毛坯-打磨 + /// + [SugarColumn(ColumnName = "blank_damo")] + public int? BlankDamo { get; set; } + /// + /// 程序-流挂 + /// + [SugarColumn(ColumnName = "program_liuguang")] + public int? ProgramLiuguang { get; set; } + /// + /// 程序-色漆缺漆 + /// + [SugarColumn(ColumnName = "program_seqiqueqi")] + public int? ProgramSeqiqueqi { get; set; } + /// + /// 程序-清漆缺漆 + /// + [SugarColumn(ColumnName = "program_qingqiqueqi")] + public int? ProgramQingqiqueqi { get; set; } + /// + /// 程序-桔皮 + /// + [SugarColumn(ColumnName = "program_jupi")] + public int? ProgramJupi { get; set; } + /// + /// 班组操作-脱落擦伤 + /// + [SugarColumn(ColumnName = "team_tuoluocanshuang")] + public int? TeamTuoluocanshuang { get; set; } + /// + /// 程序-其他 + /// + [SugarColumn(ColumnName = "program_other")] + public int? ProgramOther { get; set; } + /// + /// 班组操作-清漆漆块 + /// + [SugarColumn(ColumnName = "team_qingqiqikuai")] + public int? TeamQingqiqikuai { get; set; } + /// + /// 班组操作-色漆漆块 + /// + [SugarColumn(ColumnName = "team_seqiqikuai")] + public int? TeamSeqiqikuai { get; set; } + /// + /// 班组操作-发花 + /// + [SugarColumn(ColumnName = "team_fahua")] + public int? TeamFahua { get; set; } + /// + /// 班组操作-亮斑 + /// + [SugarColumn(ColumnName = "team_liangbang")] + public int? TeamLiangbang { get; set; } + /// + /// 班组操作-喷漏 + /// + [SugarColumn(ColumnName = "team_penglou")] + public int? TeamPenglou { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "UPDATED_TIME")] + public DateTime? UpdatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "UPDATED_BY")] + public string UpdatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "CREATED_TIME")] + public DateTime? CreatedTime { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "CREATED_BY")] + public string CreatedBy { get; set; } + + + } +} diff --git a/ZR.Service/mes/qc/FirstFQCService.cs b/ZR.Service/mes/qc/FirstFQCService.cs index 34662cd7..34a3c02c 100644 --- a/ZR.Service/mes/qc/FirstFQCService.cs +++ b/ZR.Service/mes/qc/FirstFQCService.cs @@ -622,8 +622,8 @@ namespace ZR.Service.mes.qc public static QcCurrentWorkorderDto Now_producting_Workorder_first = null; //当前生产工单 首检 public static QcCurrentWorkorderDto Now_producting_Workorder_again = null; //当前生产工单 二检 public static QcCurrentWorkorderDto Now_producting_Workorder_thirty = null; //当前生产工单 三检 - - + + /// /// 获取当前_生产中_工单列表 /// @@ -753,7 +753,7 @@ namespace ZR.Service.mes.qc public QcCurrentWorkorderDto GetcurrentWorkorder_next_first() { - + //获取状态为1的生产工单列表 @@ -1093,7 +1093,7 @@ namespace ZR.Service.mes.qc { int result = 0; //TODO 获取已知的的检测项 +1 - QcFirstinspectionRecord exist_record= Context.Queryable() + QcFirstinspectionRecord exist_record = Context.Queryable() .Where(it => it.FKWorkorderId == workorder_id && it.FKInpectionId == checkid.ToString()) .First(); @@ -1111,28 +1111,28 @@ namespace ZR.Service.mes.qc record.UpdatedTime = DateTime.Now; record.CreatedBy = name; record.UpdatedBy = name; - Context.Insertable(record).ExecuteCommand(); + Context.Insertable(record).ExecuteCommand(); result = 1; } else { - result= Context.Updateable() - .SetColumns(it=>it.Counter==(exist_record.Counter+ number)) - .SetColumns(it=>it.UpdatedTime== DateTime.Now) - .SetColumns(it=>it.UpdatedBy == name) - .Where(it=>it.FKInpectionId==checkid.ToString()&&it.FKWorkorderId==workorder_id) + result = Context.Updateable() + .SetColumns(it => it.Counter == (exist_record.Counter + number)) + .SetColumns(it => it.UpdatedTime == DateTime.Now) + .SetColumns(it => it.UpdatedBy == name) + .Where(it => it.FKInpectionId == checkid.ToString() && it.FKWorkorderId == workorder_id) .ExecuteCommand(); result = (int)exist_record.Counter + number; } - - - + + + return result; @@ -1148,7 +1148,7 @@ namespace ZR.Service.mes.qc public int Accumulator_again(string workorder_id, int checkid, int number, string InspectionModule, string name) { - + int result = 0; //TODO 获取已知的的检测项 +1 QcAgaininspectionRecord exist_record = Context.Queryable() @@ -1279,7 +1279,7 @@ namespace ZR.Service.mes.qc public int CalculatePackagingInvestment(string workorder_id) { - + int OnePassNumber = 0; int polishPassNumber = 0; @@ -1287,8 +1287,8 @@ namespace ZR.Service.mes.qc { //TODO 一次合格数=计划数-所有缺陷数 var workorder = Context.Queryable().Where(it => it.ClientWorkorder == workorder_id).First(); - - if(workorder != null) + + if (workorder != null) { var list = Context.Queryable() @@ -1340,7 +1340,7 @@ namespace ZR.Service.mes.qc } }); - + return OnePassNumber + polishPassNumber; } @@ -1353,10 +1353,171 @@ namespace ZR.Service.mes.qc public int UpdateWorkorderStatus(string workorder_id) { - return Context.Updateable() - .SetColumns(it => it.Status == 2) - .Where(it => it.ClientWorkorder == workorder_id) - .ExecuteCommand(); + return Context.Updateable() + .SetColumns(it => it.Status == 2) + .Where(it => it.ClientWorkorder == workorder_id) + .ExecuteCommand(); + } + + /// + /// 生成质量统计表 + /// + /// + /// + /// + /// + public int GenerateQualityStatisticsTable(string workorderID, string team) + { + if (!string.IsNullOrEmpty(workorderID)) + { + #region 首检 + QcQualityStatisticsFirst first = new QcQualityStatisticsFirst(); + first.Id = DateTime.Now.ToString("YYMMddHHmmss"); + first.WorkorderId = workorderID; + + ProWorkorder_v2 workorder_item = Context.Queryable().Where(it => it.ClientWorkorder == workorderID).First(); + if (workorder_item != null) + { + first.FinishedPartNumber = workorder_item.FinishedPartNumber; + first.ProductDescription = workorder_item.ProductDescription; + first.RequireNumber = workorder_item.PreviousNumber; + first.StartTime = workorder_item.CreatedTime;//这地方是不妥的 + + + } + + + + + first.Team = team; + first.QualifiedNumber = 0; + first.QualifiedRate = 0; + first.PaoguangTotal = 0; + first.DamoTotal = 0; + first.BaofeiTotal = 0; + + first.EndTime = DateTime.Now; + first.Remark = "抛光"; + first.Remark2 = 1; + + List firstrecordList = Context.Queryable().Where(it => it.FKWorkorderId == workorderID).ToList(); + if (firstrecordList != null && firstrecordList.Count > 0) + { + for (int i = 0; i < firstrecordList.Count; i++) + { + + if (firstrecordList[i].FKInpectionId=="111") + { + first.PaintSuokong = firstrecordList[i].Counter; + } + + if (firstrecordList[i].FKInpectionId == "112") + { + first.PaintZhengkong = firstrecordList[i].Counter; + } + + if (firstrecordList[i].FKInpectionId == "113") + { + first.PaintShiguang = firstrecordList[i].Counter; + } + + + if (firstrecordList[i].FKInpectionId == "114") + { + first.PaintSecha = firstrecordList[i].Counter; + } + + + if (firstrecordList[i].FKInpectionId == "115") + { + first.PaintDianzi = firstrecordList[i].Counter; + } + + + if (firstrecordList[i].FKInpectionId == "116") + { + first.PaintOther = firstrecordList[i].Counter; + } + + if (firstrecordList[i].FKInpectionId == "211") + { + first.DeviceShuiban = firstrecordList[i].Counter; + } + + + + + + } + + } + + + + + first.DeviceShuiban = 0; + first.DeviceZandian = 0; + first.DeviceBianxing = 0; + first.DeviceYouzhu = 0; + first.DeviceTuoluo = 0; + first.DeviceZhuangshang = 0; + first.DeviceOther = 0; + first.BlankMaoci = 0; + first.BlankSuoyin = 0; + first.BlankCanshuang = 0; + first.BlankShaying = 0; + first.BlankZangdian = 0; + first.BlankDamo = 0; + first.ProgramLiuguang = 0; + first.ProgramSeqiqueqi = 0; + first.ProgramQingqiqueqi = 0; + first.ProgramJupi = 0; + first.ProgramOther = 0; + first.TeamTuoluocanshuang = 0; + first.TeamQingqiqikuai = 0; + first.TeamSeqiqikuai = 0; + first.TeamFahua = 0; + first.TeamLiangbang = 0; + first.TeamPenglou = 0; + first.UpdatedTime = DateTime.Now; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + //二检 + //三检 + //总报表 + + } + + throw new NotImplementedException(); } } } diff --git a/ZR.Service/mes/qc/IService/IFirstFQCService.cs b/ZR.Service/mes/qc/IService/IFirstFQCService.cs index 736b3ca7..4774be27 100644 --- a/ZR.Service/mes/qc/IService/IFirstFQCService.cs +++ b/ZR.Service/mes/qc/IService/IFirstFQCService.cs @@ -42,6 +42,8 @@ namespace ZR.Service.mes.qc.IService public int UpdateWorkorderStatus(string workorder_id); + public int GenerateQualityStatisticsTable(string workorderID, string team); + } } diff --git a/ZR.Service/mes/qc/IService/IQCStatisticsService.cs b/ZR.Service/mes/qc/IService/IQCStatisticsService.cs new file mode 100644 index 00000000..34147448 --- /dev/null +++ b/ZR.Service/mes/qc/IService/IQCStatisticsService.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ZR.Model.MES.qc; + +namespace ZR.Service.mes.qc.IService +{ + public interface IQCStatisticsService + { + + #region 获取统计表 + //获取 首检 + (List,int) GetQualityStatisticsTable_first(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize); + + //获取 二检 + + ( List,int) GetQualityStatisticsTable_again(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize); + //获取 三检 + (List,int) GetQualityStatisticsTable_final(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize); + //获取 总检 + (List,int) GetQualityStatisticsTable_total(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize); + #endregion + } +} diff --git a/ZR.Service/mes/qc/QCStatisticsService.cs b/ZR.Service/mes/qc/QCStatisticsService.cs new file mode 100644 index 00000000..f86da622 --- /dev/null +++ b/ZR.Service/mes/qc/QCStatisticsService.cs @@ -0,0 +1,149 @@ +using Infrastructure.Attribute; +using Microsoft.Extensions.DependencyInjection; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ZR.Model.mes.md; +using ZR.Model.MES.qc; +using ZR.Model.MES.qu; +using ZR.Service.mes.qc.IService; + +namespace ZR.Service.mes.qc +{ + [AppService(ServiceType = typeof(IQCStatisticsService), ServiceLifetime = LifeTime.Transient)] + public class QCStatisticsService : BaseService, IQCStatisticsService + { + /// + /// 获取质量统计表 首检 + /// + /// + /// + /// 工单号 + /// + /// + /// + /// + /// + /// + /// + public (List, int) GetQualityStatisticsTable_first(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize) + { + int totalNum = 0; + var predicate = Expressionable.Create() + .AndIF(starttime>new DateTime(2023, 1, 1, 0,0, 0), it => it.StartTime>=starttime) + .AndIF(endTime > new DateTime(2023, 1, 1, 0,0, 0), it => it.EndTime<=endTime) + .AndIF(!string.IsNullOrEmpty(workorderid),it=>it.Equals(workorderid)) + .AndIF(!string.IsNullOrEmpty(partnumber),it=>it.Equals(partnumber)) + .AndIF(!string.IsNullOrEmpty(team),it=>it.Equals(team)) + .AndIF(!string.IsNullOrEmpty(product_description), it => it.ProductDescription.Contains(product_description)) + .ToExpression(); + + + List data = Context.Queryable().Where(predicate).OrderBy(it => it.WorkorderId).OrderBy(it=>it.Remark2).ToPageList(pageNum, pageSize, ref totalNum); + + + return (data, totalNum); + } + + + /// + /// 获取质量统计表 二检 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public (List,int) GetQualityStatisticsTable_again(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize) + { + int totalNum = 0; + var predicate = Expressionable.Create() + .AndIF(starttime > new DateTime(2023, 1, 1, 0, 0, 0), it => it.StartTime >= starttime) + .AndIF(endTime > new DateTime(2023, 1, 1, 0, 0, 0), it => it.EndTime <= endTime) + .AndIF(!string.IsNullOrEmpty(workorderid), it => it.Equals(workorderid)) + .AndIF(!string.IsNullOrEmpty(partnumber), it => it.Equals(partnumber)) + .AndIF(!string.IsNullOrEmpty(team), it => it.Equals(team)) + .AndIF(!string.IsNullOrEmpty(product_description), it => it.ProductDescription.Contains(product_description)) + .ToExpression(); + + + List data = Context.Queryable().Where(predicate).OrderBy(it => it.WorkorderId).OrderBy(it => it.Remark2).ToPageList(pageNum, pageSize, ref totalNum); + + + return (data, totalNum); + } + + /// + /// 获取质量统计表 三检 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public (List,int) GetQualityStatisticsTable_final(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize) + { + int totalNum = 0; + var predicate = Expressionable.Create() + .AndIF(starttime > new DateTime(2023, 1, 1, 0, 0, 0), it => it.StartTime >= starttime) + .AndIF(endTime > new DateTime(2023, 1, 1, 0, 0, 0), it => it.EndTime <= endTime) + .AndIF(!string.IsNullOrEmpty(workorderid), it => it.Equals(workorderid)) + .AndIF(!string.IsNullOrEmpty(partnumber), it => it.Equals(partnumber)) + .AndIF(!string.IsNullOrEmpty(team), it => it.Equals(team)) + .AndIF(!string.IsNullOrEmpty(product_description), it => it.ProductDescription.Contains(product_description)) + .ToExpression(); + + + List data = Context.Queryable().Where(predicate).OrderBy(it => it.WorkorderId).OrderBy(it => it.Remark2).ToPageList(pageNum, pageSize, ref totalNum); + + + return (data, totalNum); + } + + + /// + /// 获取质量统计表 总表 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public (List,int) GetQualityStatisticsTable_total(DateTime starttime, DateTime endTime, string workorderid, string partnumber, string product_description, string team, int pageNum, int pageSize) + { + int totalNum = 0; + var predicate = Expressionable.Create() + .AndIF(starttime > new DateTime(2023, 1, 1, 0, 0, 0), it => it.StartTime >= starttime) + .AndIF(endTime > new DateTime(2023, 1, 1, 0, 0, 0), it => it.EndTime <= endTime) + .AndIF(!string.IsNullOrEmpty(workorderid), it => it.Equals(workorderid)) + .AndIF(!string.IsNullOrEmpty(partnumber), it => it.Equals(partnumber)) + .AndIF(!string.IsNullOrEmpty(team), it => it.Equals(team)) + .AndIF(!string.IsNullOrEmpty(product_description), it => it.ProductDescription.Contains(product_description)) + .ToExpression(); + + + List data = Context.Queryable().Where(predicate).OrderBy(it => it.WorkorderId).OrderBy(it => it.Remark2).ToPageList(pageNum, pageSize, ref totalNum); + + + return (data, totalNum); + } + } +}