工单修改

This commit is contained in:
qianhao.xu 2024-09-13 17:10:11 +08:00
parent 08ab545d51
commit f3beb7bf1f
2 changed files with 111 additions and 41 deletions

View File

@ -18,11 +18,7 @@ namespace DOAN.Model.MES.product.Dto
public DateTime[] WorkorderDate { get; set; } = new DateTime[2];
public int? Year { get; set; }
public int? Week { get; set; }
public int? Date { get; set; }
}
@ -39,52 +35,120 @@ namespace DOAN.Model.MES.product.Dto
/// </summary>
public class ProWorkorderDto
{
/// <summary>
/// 雪花id
/// </summary>
public string Id { get; set; }
public string ProductionName { get; set; }
/// <summary>
/// 工单号
/// </summary>
public string Workorder { get; set; }
/// <summary>
/// 存货编码
/// </summary>
public string ProductionCode { get; set; }
/// <summary>
/// 产品名称
/// </summary>
public string ProductionName { get; set; }
/// <summary>
/// 规格型号
/// </summary>
public string Specification { get; set; }
/// <summary>
/// 客户编码
/// </summary>
public string CustomCode { get; set; }
public int? DeliveryNum { get; set; }
/// <summary>
/// 单位
/// </summary>
public string Unit { get; set; }
public int? PackageNum { get; set; }
public int? GroupId { get; set; }
/// <summary>
/// 交货数量
/// </summary>
public int? DeliveryNum { get; set; }
public string FkRouteCode { get; set; }
/// <summary>
/// 是否是纸箱
/// </summary>
public int? IsCarton { get; set; }
/// <summary>
/// 装箱容量
/// </summary>
public int? PackageCapacity { get; set; }
/// <summary>
/// 组别
/// </summary>
public string GroupCode { get; set; }
/// <summary>
/// 线别
/// </summary>
public string LineCode { get; set; }
/// <summary>
/// 序号
/// </summary>
public int? Sort { get; set; }
/// <summary>
/// 工单日期
/// </summary>
public DateTime? WorkorderDate { get; set; }
public int? Year { get; set; }
public int? Week { get; set; }
public int? Date { get; set; }
/// <summary>
/// 优先级 1-100
/// </summary>
public int? Priority { get; set; }
/// <summary>
/// 工单状态
/// </summary>
public int? Status { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string CreatedBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreatedTime { get; set; }
/// <summary>
/// 更新人
/// </summary>
public string UpdatedBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime? UpdatedTime { get; set; }
}
/// <summary>
/// 工单备料进度
@ -138,22 +202,15 @@ namespace DOAN.Model.MES.product.Dto
public string Unit { get; set; }
public int? PackageNum { get; set; }
public int? GroupId { get; set; }
public string FkRouteCode { get; set; }
public int? Sort { get; set; }
public DateTime? WorkorderDate { get; set; }
public int? Year { get; set; }
public int? Week { get; set; }
public int? Date { get; set; }
/// <summary>
/// 优先级
@ -197,11 +254,7 @@ namespace DOAN.Model.MES.product.Dto
public string Unit { get; set; }
public int? PackageNum { get; set; }
public int? GroupId { get; set; }
public string FkRouteCode { get; set; }
public int? Sort { get; set; }
@ -261,21 +314,14 @@ namespace DOAN.Model.MES.product.Dto
public string Unit { get; set; }
public int? PackageNum { get; set; }
public string LineCode { get; set; }
public int? GroupId { get; set; }
public string FkRouteCode { get; set; }
public int? Sort { get; set; }
public DateTime? WorkorderDate { get; set; }
public int? Year { get; set; }
public int? Week { get; set; }
public int? Date { get; set; }
public int? Priority { get; set; }

View File

@ -77,7 +77,7 @@ namespace DOAN.Service.MES.product
Specification = m.Specification,
Unit = q.Unit,
}, true);
var query2 = Context.Queryable(query1).LeftJoin<BaseWorkRoute>((q, r) => q.FkRouteCode == r.Code)
var query2 = Context.Queryable(query1).LeftJoin<BaseWorkRoute>((q, r) => q.LineCode == r.Code)
.Select((q, r) => new ProWorkorderDto3()
{
LackId = r.Id,
@ -577,11 +577,31 @@ namespace DOAN.Service.MES.product
// 组别code
NPOI.SS.UserModel.ICell currentCell_09 = currentRow.GetCell(7);
workorder.GroupCode = currentCell_09.StringCellValue;
if (currentCell_09.CellType == CellType.Numeric)
{
workorder.GroupCode = currentCell_09.NumericCellValue.ToString();
}
else
{
workorder.GroupCode = currentCell_09.StringCellValue;
}
// 线别code
NPOI.SS.UserModel.ICell currentCell_10 = currentRow.GetCell(8);
workorder.LineCode = currentCell_10.StringCellValue;
if (currentCell_10.CellType == CellType.Numeric)
{
workorder.LineCode = currentCell_10.NumericCellValue.ToString();
}
else
{
workorder.LineCode = currentCell_10.StringCellValue;
}
// 优先级
NPOI.SS.UserModel.ICell currentCell_11 = currentRow.GetCell(9);
@ -611,6 +631,10 @@ namespace DOAN.Service.MES.product
workorder.CreatedTime = DateTime.Now;
workorder.WorkorderDate = dateValue;
workorder.Status = 1;
//工单 2024-9-13-组-线-序号
int index = (row - 2);
workorder.Workorder = dateValue.ToString("yyyyMMdd") +"_"+ workorder.GroupCode + "_" + workorder.LineCode+"_" + index.ToString("000");
workorder.Sort = index * 10;
CultureInfo culture = CultureInfo.CurrentCulture;