出入库,增加工单关联

This commit is contained in:
2026-01-12 11:34:28 +08:00
parent 36a19c5dce
commit fa9f9e14d8
5 changed files with 23 additions and 0 deletions

View File

@@ -110,6 +110,11 @@ namespace DOAN.Model.BZFM.Dto
[ExcelColumn(Name = "入库类型")] [ExcelColumn(Name = "入库类型")]
public string TransactionTypeLabel { get; set; } public string TransactionTypeLabel { get; set; }
/// <summary>
/// 工单号(一旦确定,不可更改)
/// </summary>
public string Workorder { get; set; }
// 1-蓝单正向 2-红单逆向 // 1-蓝单正向 2-红单逆向
public int ReceiptType { get; set; } = 1; public int ReceiptType { get; set; } = 1;
} }

View File

@@ -104,6 +104,11 @@ namespace DOAN.Model.BZFM.Dto
[ExcelColumn(Name = "出库类型")] [ExcelColumn(Name = "出库类型")]
public string TransactionTypeLabel { get; set; } public string TransactionTypeLabel { get; set; }
/// <summary>
/// 工单号(一旦确定,不可更改)
/// </summary>
public string Workorder { get; set; }
// 1-蓝单正向 2-红单逆向 // 1-蓝单正向 2-红单逆向
public int ReceiptType { get; set; } = 1; public int ReceiptType { get; set; } = 1;
} }

View File

@@ -123,5 +123,9 @@ namespace DOAN.Model.BZFM
[SugarColumn(ColumnName = "inbound_no")] [SugarColumn(ColumnName = "inbound_no")]
public string InboundNo { get; set; } public string InboundNo { get; set; }
/// <summary>
/// 工单号(一旦确定,不可更改)
/// </summary>
public string Workorder { get; set; }
} }
} }

View File

@@ -99,5 +99,10 @@ namespace DOAN.Model.BZFM
[SugarColumn(ColumnName = "created_time")] [SugarColumn(ColumnName = "created_time")]
public DateTime? CreatedTime { get; set; } public DateTime? CreatedTime { get; set; }
/// <summary>
/// 工单号(一旦确定,不可更改)
/// </summary>
public string Workorder { get; set; }
} }
} }

View File

@@ -175,6 +175,7 @@ namespace DOAN.Service.BZFM
} }
} }
// 入库单
public string CreateInboundReceipt(InboundReceiptDto parm) public string CreateInboundReceipt(InboundReceiptDto parm)
{ {
try try
@@ -269,6 +270,7 @@ namespace DOAN.Service.BZFM
Quantity = delta, Quantity = delta,
Unit = parm.Unit, Unit = parm.Unit,
ProductionDate = parm.ProductionDate, ProductionDate = parm.ProductionDate,
Workorder = parm.Workorder,
ExpiryDate = parm.ExpiryDate, ExpiryDate = parm.ExpiryDate,
CreatedTime = nowDate, CreatedTime = nowDate,
TransactionType = parm.TransactionType, TransactionType = parm.TransactionType,
@@ -365,11 +367,13 @@ namespace DOAN.Service.BZFM
LocationName = mmLocation.LocationName, LocationName = mmLocation.LocationName,
WarehouseCode = mmLocation.WarehouseCode, WarehouseCode = mmLocation.WarehouseCode,
WarehouseName = mmLocation.WarehouseName, WarehouseName = mmLocation.WarehouseName,
//TODO 待调整(可能涉及记录汇总) //TODO 待调整(可能涉及记录汇总)
Quantity = -delta, Quantity = -delta,
Unit = parm.Unit, Unit = parm.Unit,
CreatedTime = nowDate, CreatedTime = nowDate,
TransactionType = parm.TransactionType, TransactionType = parm.TransactionType,
Workorder = parm.Workorder,
Remarks = parm.Remarks, Remarks = parm.Remarks,
}; };
Context.Insertable(newRecord).ExecuteCommand(); Context.Insertable(newRecord).ExecuteCommand();