From 2b05362eba2f989b7857349cc9a3a1c12f8181b6 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周五, 26 9月 2025 11:35:50 +0800 Subject: [PATCH] 222 --- iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceProcess/WorkPieceProcessService.cs | 38 +++++++++++++++++++++++++++++++++++--- 1 files changed, 35 insertions(+), 3 deletions(-) diff --git a/iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceProcess/WorkPieceProcessService.cs b/iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceProcess/WorkPieceProcessService.cs index 851e6ff..23a863c 100644 --- a/iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceProcess/WorkPieceProcessService.cs +++ b/iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceProcess/WorkPieceProcessService.cs @@ -76,22 +76,35 @@ from baseinfo2 in joinedEmpty.DefaultIfEmpty() join workPiece in _workPieceInfoRep.DetachedEntities on process.WorkPieceID equals workPiece.WorkPieceID into joined2Empty from workPiece2 in joined2Empty.DefaultIfEmpty() + + where process.IsDeleted == false && process.WorkPieceID.Contains(string.IsNullOrEmpty(input.WorkPieceID) ? "" : input.WorkPieceID) && process.QualityState == (input.QualityState.HasValue ? input.QualityState.Value : process.QualityState) && process.EquipmentID == (string.IsNullOrEmpty(input.EquipmentID) ? process.EquipmentID : input.EquipmentID) && process.WorkingProcedureCurrent == (string.IsNullOrEmpty(input.WorkingProcedureCurrent) ? process.WorkingProcedureCurrent : input.WorkingProcedureCurrent) && workPiece2.OP80NewCode == (string.IsNullOrEmpty(input.OP80NewCode) ? workPiece2.OP80NewCode : input.OP80NewCode) - + && process.CreatedUserName.Contains(string.IsNullOrEmpty(input.createUserName) ? "" : input.createUserName) && process.UpdatedUserName.Contains(string.IsNullOrEmpty(input.updatedUserName) ? "" : input.updatedUserName) - + + && ( + (input.IsHaveOP80Code == "N" && string.IsNullOrEmpty(workPiece2.OP80NewCode)) + || (input.IsHaveOP80Code == "Y" && !string.IsNullOrEmpty(workPiece2.OP80NewCode)) + || (string.IsNullOrEmpty(input.IsHaveOP80Code) && 1 == 1) + ) + && process.EquipmentID == (string.IsNullOrEmpty(input.EquipmentID) ? process.EquipmentID : input.EquipmentID) && process.OperationType == (string.IsNullOrEmpty(input.OperationType) ? process.OperationType : input.OperationType) && !string.IsNullOrEmpty(process.WorkPieceID) && process.StartTime >= (input.StartTimeBeginTime.HasValue ? input.StartTimeBeginTime : DateTime.MinValue) && process.StartTime <= (input.StartTimeEndTime.HasValue ? input.StartTimeEndTime : DateTime.MaxValue) + + + + select new WorkPieceProcessOutput { + JiaJuGongWei = process.JiaJuGongWei, UpdatedUserName = process.UpdatedUserName, DataCapturePointCname = process.DataCapturePointCname, UpdateDataCapturePointCname = process.UpdateDataCapturePointCname, @@ -141,13 +154,20 @@ && process.CreatedUserName.Contains(string.IsNullOrEmpty(input.createUserName) ? "" : input.createUserName) && process.UpdatedUserName.Contains(string.IsNullOrEmpty(input.updatedUserName) ? "" : input.updatedUserName) + + && ( + (input.IsHaveOP80Code == "N" && string.IsNullOrEmpty(workPiece2.OP80NewCode)) + || (input.IsHaveOP80Code == "Y" && !string.IsNullOrEmpty(workPiece2.OP80NewCode)) + || (string.IsNullOrEmpty(input.IsHaveOP80Code) && 1 == 1) + ) + && process.OperationType == (string.IsNullOrEmpty(input.OperationType) ? process.OperationType : input.OperationType) && !string.IsNullOrEmpty(process.WorkPieceID) && process.StartTime >= (input.StartTimeBeginTime.HasValue ? input.StartTimeBeginTime : DateTime.MinValue) && process.StartTime <= (input.StartTimeEndTime.HasValue ? input.StartTimeEndTime : DateTime.MaxValue) select new WorkPieceProcessExcelOutput { - + OP80NewCode = workPiece2.OP80NewCode, Id = process.Id, @@ -276,6 +296,10 @@ .Where(!string.IsNullOrEmpty(input.WorkPieceID), u => u.WorkPieceID.Contains(input.WorkPieceID)) .Where(!string.IsNullOrEmpty(input.workingProcedure), u => u.WorkingProcedure.Contains(input.workingProcedure)) .Where(!string.IsNullOrEmpty(input.createdUserName), u => u.CreatedUserName.Contains(input.createdUserName)) + .Where(!string.IsNullOrEmpty(input.DataCapturePointCname), u => u.DataCapturePointCname.Contains(input.DataCapturePointCname)) + .Where(!string.IsNullOrEmpty(input.PieceLogTypeName), u => u.PieceLogTypeName.Contains(input.PieceLogTypeName)) + .Where(input.PieceLogType != null, u => u.PieceLogType == input.PieceLogType) + .Where(!string.IsNullOrEmpty(input.remarks), u => u.Remarks.Contains(input.remarks)) .Where(!string.IsNullOrEmpty(input.StartTimeBeginTime.ToString()), u => u.CreatedTime >= input.StartTimeBeginTime) .Where(!string.IsNullOrEmpty(input.StartTimeEndTime.ToString()), u => u.CreatedTime <= input.StartTimeEndTime) @@ -328,6 +352,10 @@ .Where(x => (x.g.Code.Equals("workpiece_state") && (string.IsNullOrEmpty(input.WorkPieceState.ToString()) ? true : x.f.f.Code.Equals(input.WorkPieceState.ToString())))) .Where(!string.IsNullOrEmpty(input.WorkPieceID), u => u.f.e.a.WorkPieceID.Contains(input.WorkPieceID)) .Where(!string.IsNullOrEmpty(input.OP80NewCode), u => u.f.e.a.OP80NewCode.Contains(input.OP80NewCode)) + + .Where(input.IsHaveOP80Code == "Y", u => !string.IsNullOrEmpty(u.f.e.a.OP80NewCode)) + .Where(input.IsHaveOP80Code == "N", u => string.IsNullOrEmpty(u.f.e.a.OP80NewCode)) + .Where(!string.IsNullOrEmpty(input.WorkPieceState.ToString()), u => u.f.e.a.WorkPieceState == input.WorkPieceState) .Where(!string.IsNullOrEmpty(input.EquipmentID), u => u.f.e.a.EquipmentID.Equals(input.EquipmentID)) .Where(!string.IsNullOrEmpty(input.WorkingProcedureCurrent), u => u.f.e.a.WorkingProcedureCurrent.Equals(input.WorkingProcedureCurrent)) @@ -377,6 +405,10 @@ .Where(x => (x.g.Code.Equals("workpiece_state") && (string.IsNullOrEmpty(input.WorkPieceState.ToString()) ? true : x.f.f.Code.Equals(input.WorkPieceState.ToString())))) .Where(!string.IsNullOrEmpty(input.WorkPieceID), u => u.f.e.a.WorkPieceID.Contains(input.WorkPieceID)) .Where(!string.IsNullOrEmpty(input.OP80NewCode), u => u.f.e.a.OP80NewCode.Contains(input.OP80NewCode)) + + .Where(input.IsHaveOP80Code == "Y", u => !string.IsNullOrEmpty(u.f.e.a.OP80NewCode)) + .Where(input.IsHaveOP80Code == "N", u => string.IsNullOrEmpty(u.f.e.a.OP80NewCode)) + .Where(!string.IsNullOrEmpty(input.WorkPieceState.ToString()), u => u.f.e.a.WorkPieceState == input.WorkPieceState) .Where(!string.IsNullOrEmpty(input.EquipmentID), u => u.f.e.a.EquipmentID.Equals(input.EquipmentID)) .Where(!string.IsNullOrEmpty(input.WorkingProcedureCurrent), u => u.f.e.a.WorkingProcedureCurrent.Equals(input.WorkingProcedureCurrent)) -- Gitblit v1.9.3