diff --git a/DOAN.Model/MES/product/Dto/ProWorkorderDto.cs b/DOAN.Model/MES/product/Dto/ProWorkorderDto.cs
index e5a686c..8ff341c 100644
--- a/DOAN.Model/MES/product/Dto/ProWorkorderDto.cs
+++ b/DOAN.Model/MES/product/Dto/ProWorkorderDto.cs
@@ -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
///
public class ProWorkorderDto
{
+
+ ///
+ /// 雪花id
+ ///
public string Id { get; set; }
- public string ProductionName { get; set; }
+
+ ///
+ /// 工单号
+ ///
public string Workorder { get; set; }
+ ///
+ /// 存货编码
+ ///
public string ProductionCode { get; set; }
+ ///
+ /// 产品名称
+ ///
+ public string ProductionName { get; set; }
+
+ ///
+ /// 规格型号
+ ///
+ public string Specification { get; set; }
+
+ ///
+ /// 客户编码
+ ///
public string CustomCode { get; set; }
- public int? DeliveryNum { get; set; }
-
+ ///
+ /// 单位
+ ///
public string Unit { get; set; }
- public int? PackageNum { get; set; }
- public int? GroupId { get; set; }
+ ///
+ /// 交货数量
+ ///
+ public int? DeliveryNum { get; set; }
- public string FkRouteCode { get; set; }
+
+ ///
+ /// 是否是纸箱
+ ///
+ public int? IsCarton { get; set; }
+
+ ///
+ /// 装箱容量
+ ///
+ public int? PackageCapacity { get; set; }
+
+ ///
+ /// 组别
+ ///
+ public string GroupCode { get; set; }
+
+ ///
+ /// 线别
+ ///
+ public string LineCode { 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; }
+ ///
+ /// 优先级 1-100
+ ///
public int? Priority { get; set; }
+ ///
+ /// 工单状态
+ ///
public int? Status { get; set; }
+ ///
+ /// 备注
+ ///
public string Remark { get; set; }
+ ///
+ /// 创建人
+ ///
public string CreatedBy { get; set; }
+ ///
+ /// 创建时间
+ ///
public DateTime? CreatedTime { get; set; }
+ ///
+ /// 更新人
+ ///
public string UpdatedBy { get; set; }
+ ///
+ /// 更新时间
+ ///
public DateTime? UpdatedTime { get; set; }
-
}
///
/// 工单备料进度
@@ -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; }
-
+
///
/// 优先级
@@ -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; }
diff --git a/DOAN.Service/MES/product/ProWorkorderService.cs b/DOAN.Service/MES/product/ProWorkorderService.cs
index e9cf36a..86dfce3 100644
--- a/DOAN.Service/MES/product/ProWorkorderService.cs
+++ b/DOAN.Service/MES/product/ProWorkorderService.cs
@@ -77,7 +77,7 @@ namespace DOAN.Service.MES.product
Specification = m.Specification,
Unit = q.Unit,
}, true);
- var query2 = Context.Queryable(query1).LeftJoin((q, r) => q.FkRouteCode == r.Code)
+ var query2 = Context.Queryable(query1).LeftJoin((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;