diff --git a/DOAN.Admin.WebApi/Controllers/JobKanban/WorkOrderProgressController.cs b/DOAN.Admin.WebApi/Controllers/JobKanban/WorkOrderProgressController.cs index eed2187..3b280ef 100644 --- a/DOAN.Admin.WebApi/Controllers/JobKanban/WorkOrderProgressController.cs +++ b/DOAN.Admin.WebApi/Controllers/JobKanban/WorkOrderProgressController.cs @@ -77,6 +77,21 @@ public class WorkOrderProgressController : BaseController return SUCCESS(response); } + //TODO 获取不同状态的工单 (PDA用) + //TODO 根据班组,日期 + [HttpGet("get_workorder_status_list")] + public IActionResult GetWorkOrderStatusList(string group_code,int status, DateTime handleDate) + { + handleDate=DOANConvertDateTime.ConvertLocalDate(handleDate); + if (string.IsNullOrEmpty(group_code) || handleDate == DateTime.MinValue) + throw new CustomException("传入空值异常"); + + var response = workorderProgressService.GetWorkOrderStatusList(group_code, status, handleDate); + + return SUCCESS(response); + + } + // 获取工单详情 [HttpGet("get_workorder_detail")] diff --git a/DOAN.Model/MES/product/Dto/ProReportworkDto.cs b/DOAN.Model/MES/product/Dto/ProReportworkDto.cs index 0bba002..00c7908 100644 --- a/DOAN.Model/MES/product/Dto/ProReportworkDto.cs +++ b/DOAN.Model/MES/product/Dto/ProReportworkDto.cs @@ -35,9 +35,9 @@ namespace DOAN.Model.MES.product.Dto public string FkWorkorder { get; set; } - public int? DispatchNum { get; set; } + public int DispatchNum { get; set; } - public int? FinishedNum { get; set; } + public int FinishedNum { get; set; } public string ProductionCode { get; set; } @@ -49,13 +49,13 @@ namespace DOAN.Model.MES.product.Dto public string LineCode { get; set; } - public int? QualifiedNumber { get; set; } + public int QualifiedNumber { get; set; } - public int? UnqualifiedNumber { get; set; } + public int UnqualifiedNumber { get; set; } - public int? ReworkNumber { get; set; } + public int ReworkNumber { get; set; } - public int? ScrapNumber { get; set; } + public int ScrapNumber { get; set; } public string Remark { get; set; } diff --git a/DOAN.Model/MES/product/Dto/ProWorkorderDto.cs b/DOAN.Model/MES/product/Dto/ProWorkorderDto.cs index 2c061e8..29bd749 100644 --- a/DOAN.Model/MES/product/Dto/ProWorkorderDto.cs +++ b/DOAN.Model/MES/product/Dto/ProWorkorderDto.cs @@ -7,26 +7,22 @@ namespace DOAN.Model.MES.product.Dto /// public class ProWorkorderQueryDto : PagerInfo { - public string ProductionName { get; set; } public string ProductionCode { get; set; } - public string LineCode { get; set; } public string GroupCode { get; set; } + public int Status { get; set; } + public DateTime[] WorkorderDate { get; set; } = new DateTime[2]; - - - } public class ProWorkorderQueryDto2 { public DateTime WorkorderDate { get; set; } - } @@ -36,14 +32,12 @@ namespace DOAN.Model.MES.product.Dto /// public class ProWorkorderDto { - /// /// 雪花id /// public string Id { get; set; } - /// /// 工单号 /// @@ -81,7 +75,6 @@ namespace DOAN.Model.MES.product.Dto public int? DeliveryNum { get; set; } - /// /// 是否是纸箱 /// @@ -116,7 +109,7 @@ namespace DOAN.Model.MES.product.Dto /// 优先级 1-100 /// public int? Priority { get; set; } - + /// /// 节拍 (秒) /// @@ -163,8 +156,6 @@ namespace DOAN.Model.MES.product.Dto /// 更新时间 /// public DateTime? UpdatedTime { get; set; } - - } /// /// 工单备料进度 @@ -197,19 +188,12 @@ namespace DOAN.Model.MES.product.Dto /// public class ProWorkorderDto4: ProWorkorderDto { - - /// /// 完成数量 /// public int? FinishNum { get; set; } public MaterialPreparationProgress progress { get; set; } - - - - - } public class ProWorkorderDto2: ProWorkorderDto @@ -219,10 +203,6 @@ namespace DOAN.Model.MES.product.Dto /// public string next_id { get; set; } - - - - } /// @@ -242,7 +222,6 @@ namespace DOAN.Model.MES.product.Dto public string IsMatch_material_name { get; set; } - /// /// 工艺路线是否存在 /// @@ -259,11 +238,6 @@ namespace DOAN.Model.MES.product.Dto /// 单位是否存在 /// public string IsMatch_Unit { get; set; } - - - - - } /// /// 工单BOM 及其所需数量 @@ -271,7 +245,6 @@ namespace DOAN.Model.MES.product.Dto public class WorkOrderBom { - /// /// 子件编码 /// @@ -283,7 +256,7 @@ namespace DOAN.Model.MES.product.Dto /// public string SubInvName { get; set; } - + /// /// 单件数量 /// @@ -300,7 +273,6 @@ namespace DOAN.Model.MES.product.Dto /// public string BOMVersion { get; set; } - } /// @@ -308,7 +280,6 @@ namespace DOAN.Model.MES.product.Dto /// public class ProWorkorderTranceProgressDto { - /// /// 雪花id /// @@ -383,21 +354,16 @@ namespace DOAN.Model.MES.product.Dto public DateTime? EndTime { get; set; } - /// /// 计划数量 /// public int? PlanNum { get; set; } - /// /// 实际数量 /// public int? ActualNum { get; set; } - - - } diff --git a/DOAN.Service/JobKanban/IService/IWorkorderProgressService.cs b/DOAN.Service/JobKanban/IService/IWorkorderProgressService.cs index 67afa0e..74c758d 100644 --- a/DOAN.Service/JobKanban/IService/IWorkorderProgressService.cs +++ b/DOAN.Service/JobKanban/IService/IWorkorderProgressService.cs @@ -21,6 +21,8 @@ namespace DOAN.Service.JobKanban.IService List GetWorkOrderList(string group_code, string line_code, DateTime handleDate); + List GetWorkOrderStatusList(string group_code, int status, DateTime handleDate); + ProWorkorderDto4 GetWorkOrderDetail(string workorder); diff --git a/DOAN.Service/JobKanban/WorkorderProgressService.cs b/DOAN.Service/JobKanban/WorkorderProgressService.cs index 5f20f03..232c33c 100644 --- a/DOAN.Service/JobKanban/WorkorderProgressService.cs +++ b/DOAN.Service/JobKanban/WorkorderProgressService.cs @@ -33,6 +33,14 @@ public class WorkorderProgressService : BaseService, IWorkorderPro .ToList(); } + public List GetWorkOrderStatusList(string group_code, int status, DateTime handleDate) + { + return Context.Queryable().Where(it => it.GroupCode == group_code) + .Where(it => it.Status == status) + .Where(it => it.WorkorderDate == handleDate) + .ToList(); + } + public List GetReportWorkRecord(string group_code, string line_code, DateTime handleDate) { diff --git a/DOAN.Service/MES/product/ProReportworkService.cs b/DOAN.Service/MES/product/ProReportworkService.cs index acb132b..81958db 100644 --- a/DOAN.Service/MES/product/ProReportworkService.cs +++ b/DOAN.Service/MES/product/ProReportworkService.cs @@ -60,7 +60,7 @@ namespace DOAN.Service.MES.product FkWorkorder =w.Workorder, GroupCode = w.GroupCode, LineCode = w.LineCode, - DispatchNum=w.DeliveryNum, + DispatchNum=w.DeliveryNum??0, Priority = w.Priority, Status = w.Status, Beat = w.Beat diff --git a/DOAN.Service/MES/product/ProWorkorderService.cs b/DOAN.Service/MES/product/ProWorkorderService.cs index 6d577f6..c93dcdf 100644 --- a/DOAN.Service/MES/product/ProWorkorderService.cs +++ b/DOAN.Service/MES/product/ProWorkorderService.cs @@ -718,8 +718,8 @@ namespace DOAN.Service.MES.product //装箱容积 - NPOI.SS.UserModel.ICell currentCell_0811 = currentRow.GetCell(6); - workorder.PackageCapacity = (int)currentCell_0811?.NumericCellValue; + /*NPOI.SS.UserModel.ICell currentCell_0811 = currentRow.GetCell(6); + workorder.PackageCapacity = (int)currentCell_0811?.NumericCellValue;*/ @@ -727,7 +727,7 @@ namespace DOAN.Service.MES.product // 组别code - NPOI.SS.UserModel.ICell currentCell_09 = currentRow.GetCell(7); + NPOI.SS.UserModel.ICell currentCell_09 = currentRow.GetCell(6); if (currentCell_09 == null) { workorder.GroupCode = string.Empty; @@ -750,7 +750,7 @@ namespace DOAN.Service.MES.product // 线别code - NPOI.SS.UserModel.ICell currentCell_10 = currentRow.GetCell(8); + NPOI.SS.UserModel.ICell currentCell_10 = currentRow.GetCell(7); if (currentCell_10 == null) { @@ -772,7 +772,7 @@ namespace DOAN.Service.MES.product // 优先级 - NPOI.SS.UserModel.ICell currentCell_11 = currentRow.GetCell(9); + NPOI.SS.UserModel.ICell currentCell_11 = currentRow.GetCell(8); if (currentCell_11.StringCellValue == "紧急") { workorder.Priority = 3; @@ -791,12 +791,12 @@ namespace DOAN.Service.MES.product } } - NPOI.SS.UserModel.ICell currentCell_12 = currentRow.GetCell(10); + NPOI.SS.UserModel.ICell currentCell_12 = currentRow.GetCell(9); workorder.Beat = (int)currentCell_12?.NumericCellValue; - NPOI.SS.UserModel.ICell currentCell_010 = currentRow.GetCell(11); + NPOI.SS.UserModel.ICell currentCell_010 = currentRow.GetCell(10); workorder.Remark = currentCell_010.StringCellValue; workorder.Id = XueHua; @@ -1033,6 +1033,7 @@ namespace DOAN.Service.MES.product .AndIF(!string.IsNullOrEmpty(query.GroupCode), it => it.GroupCode == query.GroupCode) .AndIF(query.WorkorderDate != null && query.WorkorderDate[0] > DateTime.MinValue, it => it.WorkorderDate >= query.WorkorderDate[0]) .AndIF(query.WorkorderDate != null && query.WorkorderDate[1] > DateTime.MinValue, it => it.WorkorderDate <= query.WorkorderDate[1]) + .AndIF(query.Status>-1,it=>it.Status==query.Status) ; var query2 = Queryable()