| | |
| | | [HttpGet("workPieceProcessMachiningPage")] |
| | | public async Task<PageResult<WorkPieceProcessOutput>> WorkPieceProcessMachiningPage([FromQuery] WorkPieceProcessSearch input) |
| | | { |
| | | //var LeftJoin = from emp in ListOfEmployees |
| | | // join dept in ListOfDepartment |
| | | // on emp.DeptID equals dept.ID into JoinedEmpDept |
| | | // from dept in JoinedEmpDept.DefaultIfEmpty() |
| | | // select new |
| | | // { |
| | | // EmployeeName = emp.Name, |
| | | // DepartmentName = dept != null ? dept.Name : null |
| | | // }; |
| | | var workPieceProcesss = await (from process in _workPieceProcessRep.DetachedEntities |
| | | join baseinfo in _equipmentBaseInfoRep.DetachedEntities on process.EquipmentID equals baseinfo.EquipmentId into joinedEmpty |
| | | from baseinfo2 in joinedEmpty.DefaultIfEmpty() |
| | |
| | | && 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) |
| | | |
| | | && 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.StartTimeEndTime.HasValue ? input.StartTimeEndTime : DateTime.MaxValue) |
| | | select new WorkPieceProcessOutput |
| | | { |
| | | UpdatedUserName = process.UpdatedUserName, |
| | | DataCapturePointCname = process.DataCapturePointCname, |
| | | UpdateDataCapturePointCname = process.UpdateDataCapturePointCname, |
| | | QualityNoOk = process.QualityNoOk, |
| | | QualityNoOkReason = process.QualityNoOkReason, |
| | | Id = process.Id, |
| | |
| | | .ProjectToType<WorkPieceProcessOutput>() |
| | | .ToADPagedListAsync(input.PageNo, input.PageSize); |
| | | |
| | | // var workPieceProcesss1 = _workPieceProcessRep.DetachedEntities.GroupJoin(_equipmentBaseInfoRep.DetachedEntities |
| | | // , process => process.EquipmentID |
| | | //, baseinfo => baseinfo.EquipmentId |
| | | //, (process, baseinfo) => new { a = process, b = baseinfo.FirstOrDefault() }) |
| | | // .Where(!string.IsNullOrEmpty(input.WorkPieceID), u => u.a.WorkPieceID.Contains(input.WorkPieceID)) |
| | | //.Where(!string.IsNullOrEmpty(input.QualityState.ToString()), u => u.a.QualityState == input.QualityState) |
| | | //.Where(!string.IsNullOrEmpty(input.EquipmentID), u => u.a.EquipmentID.Equals(input.EquipmentID)) |
| | | //.Where(!string.IsNullOrEmpty(input.WorkingProcedureCurrent), u => u.a.WorkingProcedureCurrent.Equals(input.WorkingProcedureCurrent)) |
| | | //.Where(!string.IsNullOrEmpty(input.StartTime.ToString()), u => u.a.StartTime >= input.StartTime) |
| | | //.Where(!string.IsNullOrEmpty(input.EndTime.ToString()), u => u.a.EndTime <= input.EndTime) |
| | | //.Select(s => new WorkPieceProcessOutput |
| | | //{ |
| | | // Id = s.a.Id, |
| | | // WorkPieceID = s.a.WorkPieceID, |
| | | // EquipmentID = s.a.EquipmentID, |
| | | // EquipmentName = (s.b == null ? "" : s.b.EquipmentName), |
| | | // WorkingProcedureCurrent = s.a.WorkingProcedureCurrent, |
| | | // StartTime = s.a.StartTime, |
| | | // EndTime = s.a.EndTime, |
| | | // QualityState = s.a.QualityState, |
| | | // QualityDataInfoID = s.a.QualityDataInfoID |
| | | //}).ToList(); |
| | | // .OrderBy(PageInputOrder.OrderBuilder<WorkPieceProcessSearch>(input)) |
| | | //.ProjectToType<WorkPieceProcessOutput>() |
| | | // .ToADPagedListAsync(input.PageNo, input.PageSize) |
| | | ; |
| | | |
| | | |
| | | //var workPieceProcesss = await _workPieceProcessRep.DetachedEntities |
| | | // .Join(_equipmentBaseInfoRep.DetachedEntities, a => a.EquipmentID, b => b.EquipmentId, (a, b) => new { a, b }) |
| | | // .Join(_sysDictDataRep.DetachedEntities, e => e.a.QualityState.ToString(), f => f.Code, (e, f) => new { e, f }) |
| | | // .Join(_sysDictTypeRep.DetachedEntities, g => g.f.TypeId, h => h.Id, (f, g) => new { f, g }) |
| | | // .Where(x => (x.g.Code.Equals("quality_state"))) |
| | | // .Where(!string.IsNullOrEmpty(input.WorkPieceID), u => u.f.e.a.WorkPieceID.Contains(input.WorkPieceID)) |
| | | // .Where(!string.IsNullOrEmpty(input.EquipmentID), u => u.f.e.a.EquipmentID.Equals(input.EquipmentID)) |
| | | // .Where(!string.IsNullOrEmpty(input.QualityState.ToString()), u => u.f.e.a.QualityState == input.QualityState) |
| | | // .Where(!string.IsNullOrEmpty(input.WorkingProcedureCurrent), u => u.f.e.a.WorkingProcedureCurrent.Equals(input.WorkingProcedureCurrent)) |
| | | // .Where(input.OnlineTimeBeginTime != null, u => u.f.e.a.StartTime >= input.OnlineTimeBeginTime) |
| | | // .Where(input.OnlineTimeEndTime != null, u => u.f.e.a.StartTime <= input.OnlineTimeEndTime) |
| | | // .Select(s => new WorkPieceProcessOutput |
| | | // { |
| | | // Id = s.f.e.a.Id, |
| | | // WorkPieceID = s.f.e.a.WorkPieceID, |
| | | // WorkingProcedureCurrent = s.f.e.a.WorkingProcedureCurrent, |
| | | // EquipmentID = s.f.e.a.EquipmentID, |
| | | // EquipmentName = s.f.e.b.EquipmentName, |
| | | // StartTime = s.f.e.a.StartTime, |
| | | // EndTime = s.f.e.a.EndTime, |
| | | // QualityStateName = s.f.f.Value, |
| | | // }) |
| | | // .Distinct() |
| | | // .OrderBy(PageInputOrder.OrderBuilder<WorkPieceProcessSearch>(input)) |
| | | // .ProjectToType<WorkPieceProcessOutput>() |
| | | // .ToADPagedListAsync(input.PageNo, input.PageSize); |
| | | return workPieceProcesss; |
| | | } |
| | | |
| | |
| | | && process.WorkingProcedureCurrent == (string.IsNullOrEmpty(input.WorkingProcedureCurrent) ? process.WorkingProcedureCurrent : input.WorkingProcedureCurrent) |
| | | && process.EquipmentID == (string.IsNullOrEmpty(input.EquipmentID) ? process.EquipmentID : input.EquipmentID) |
| | | && 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) |
| | | |
| | | && 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, |
| | |
| | | .ProjectToType<WorkPieceProcessExcelOutput>() |
| | | .ToListAsync(); |
| | | |
| | | //var workPieceMachiningInfos = await _workPieceProcessRep.DetachedEntities |
| | | // .Join(_equipmentBaseInfoRep.DetachedEntities, a => a.EquipmentID, b => b.EquipmentId, (a, b) => new { a, b }) |
| | | // .Join(_sysDictDataRep.DetachedEntities, e => e.a.QualityState.ToString(), f => f.Code, (e, f) => new { e, f }) |
| | | // .Join(_sysDictTypeRep.DetachedEntities, g => g.f.TypeId, h => h.Id, (f, g) => new { f, g }) |
| | | // .Where(x => (x.g.Code.Equals("quality_state"))) |
| | | // .Where(!string.IsNullOrEmpty(input.WorkPieceID), u => u.f.e.a.WorkPieceID.Contains(input.WorkPieceID)) |
| | | // .Where(!string.IsNullOrEmpty(input.EquipmentID), u => u.f.e.a.EquipmentID.Equals(input.EquipmentID)) |
| | | // .Where(!string.IsNullOrEmpty(input.QualityState.ToString()), u => u.f.e.a.QualityState == input.QualityState) |
| | | // .Where(!string.IsNullOrEmpty(input.WorkingProcedureCurrent), u => u.f.e.a.WorkingProcedureCurrent.Equals(input.WorkingProcedureCurrent)) |
| | | // .Where(input.OnlineTimeBeginTime != null, u => u.f.e.a.StartTime >= input.OnlineTimeBeginTime) |
| | | // .Where(input.OnlineTimeEndTime != null, u => u.f.e.a.StartTime <= input.OnlineTimeEndTime) |
| | | // .Select(s => new WorkPieceProcessExcelOutput |
| | | // { |
| | | // Id = s.f.e.a.Id, |
| | | // WorkPieceID = s.f.e.a.WorkPieceID, |
| | | // WorkingProcedureCurrent = s.f.e.a.WorkingProcedureCurrent, |
| | | // EquipmentName = s.f.e.b.EquipmentName, |
| | | // StartTime = s.f.e.a.StartTime.ToString(), |
| | | // EndTime = s.f.e.a.EndTime.ToString(), |
| | | // QualityStateName = s.f.f.Value, |
| | | // }) |
| | | // .Distinct() |
| | | // .OrderBy(PageInputOrder.OrderBuilder<WorkPieceProcessSearch>(input)) |
| | | // .ProjectToType<WorkPieceProcessExcelOutput>() |
| | | // .ToListAsync(); |
| | | |
| | | foreach (WorkPieceProcessExcelOutput item in workPieceMachiningInfos) |
| | | { |