获取不同状态的工单 (PDA用)

This commit is contained in:
qianhao.xu 2024-11-15 16:06:55 +08:00
parent d30d5e9638
commit c430656351
7 changed files with 44 additions and 52 deletions

View File

@ -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")]

View File

@ -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; }

View File

@ -7,26 +7,22 @@ namespace DOAN.Model.MES.product.Dto
/// </summary>
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
/// </summary>
public class ProWorkorderDto
{
/// <summary>
/// 雪花id
/// </summary>
public string Id { get; set; }
/// <summary>
/// 工单号
/// </summary>
@ -81,7 +75,6 @@ namespace DOAN.Model.MES.product.Dto
public int? DeliveryNum { get; set; }
/// <summary>
/// 是否是纸箱
/// </summary>
@ -116,7 +109,7 @@ namespace DOAN.Model.MES.product.Dto
/// 优先级 1-100
/// </summary>
public int? Priority { get; set; }
/// <summary>
/// 节拍 (秒)
/// </summary>
@ -163,8 +156,6 @@ namespace DOAN.Model.MES.product.Dto
/// 更新时间
/// </summary>
public DateTime? UpdatedTime { get; set; }
}
/// <summary>
/// 工单备料进度
@ -197,19 +188,12 @@ namespace DOAN.Model.MES.product.Dto
/// </summary>
public class ProWorkorderDto4: ProWorkorderDto
{
/// <summary>
/// 完成数量
/// </summary>
public int? FinishNum { get; set; }
public MaterialPreparationProgress progress { get; set; }
}
public class ProWorkorderDto2: ProWorkorderDto
@ -219,10 +203,6 @@ namespace DOAN.Model.MES.product.Dto
/// </summary>
public string next_id { get; set; }
}
/// <summary>
@ -242,7 +222,6 @@ namespace DOAN.Model.MES.product.Dto
public string IsMatch_material_name { get; set; }
/// <summary>
/// 工艺路线是否存在
/// </summary>
@ -259,11 +238,6 @@ namespace DOAN.Model.MES.product.Dto
/// 单位是否存在
/// </summary>
public string IsMatch_Unit { get; set; }
}
/// <summary>
/// 工单BOM 及其所需数量
@ -271,7 +245,6 @@ namespace DOAN.Model.MES.product.Dto
public class WorkOrderBom
{
/// <summary>
/// 子件编码
/// </summary>
@ -283,7 +256,7 @@ namespace DOAN.Model.MES.product.Dto
/// </summary>
public string SubInvName { get; set; }
/// <summary>
/// 单件数量
/// </summary>
@ -300,7 +273,6 @@ namespace DOAN.Model.MES.product.Dto
/// </summary>
public string BOMVersion { get; set; }
}
/// <summary>
@ -308,7 +280,6 @@ namespace DOAN.Model.MES.product.Dto
/// </summary>
public class ProWorkorderTranceProgressDto
{
/// <summary>
/// 雪花id
/// </summary>
@ -383,21 +354,16 @@ namespace DOAN.Model.MES.product.Dto
public DateTime? EndTime { get; set; }
/// <summary>
/// 计划数量
/// </summary>
public int? PlanNum { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public int? ActualNum { get; set; }
}

View File

@ -21,6 +21,8 @@ namespace DOAN.Service.JobKanban.IService
List<ProWorkorder> GetWorkOrderList(string group_code, string line_code, DateTime handleDate);
List<ProWorkorder> GetWorkOrderStatusList(string group_code, int status, DateTime handleDate);
ProWorkorderDto4 GetWorkOrderDetail(string workorder);

View File

@ -33,6 +33,14 @@ public class WorkorderProgressService : BaseService<ProWorkorder>, IWorkorderPro
.ToList();
}
public List<ProWorkorder> GetWorkOrderStatusList(string group_code, int status, DateTime handleDate)
{
return Context.Queryable<ProWorkorder>().Where(it => it.GroupCode == group_code)
.Where(it => it.Status == status)
.Where(it => it.WorkorderDate == handleDate)
.ToList();
}
public List<ProReportwork> GetReportWorkRecord(string group_code, string line_code, DateTime handleDate)
{

View File

@ -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

View File

@ -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()