出入库单判定依据调整

This commit is contained in:
2026-01-17 13:26:48 +08:00
parent d33966dfea
commit a587c39f70
2 changed files with 11 additions and 3 deletions

View File

@@ -262,6 +262,15 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
.Where(it => it.TransactionType == "生产入库")
.Where(it => it.Remarks != "已撤销")
.First();
MmMaterial mmMaterial = Context
.Queryable<MmMaterial>()
.Where(it => it.MaterialCode == proWorkorder.productionCode)
.First();
if (mmMaterial == null)
{
Context.Ado.RollbackTran();
throw new Exception($"物料档案不存在,无法成品入库:{proWorkorder.productionCode}");
}
if (inboundRecord == null)
{
//做生产入库单
@@ -272,7 +281,7 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
BatchNo = proWorkorder.FeedOrder,
LocationCode = "CP001",
WarehouseCode = "WH001",
SupplierCode = "",
SupplierCode = mmMaterial.SupplierCode,
StoveCode = proWorkorder.StoveCode,
Workorder = workorder,
Operator = Worker,