fix(生产管理): 修复工单数量类型及完善出货逻辑

将工单数量字段从可空类型改为非可空类型并添加默认值
添加成品入库数量字段并完善相关业务逻辑
修复出货失败时的错误响应
完善撤销入库/出库操作时的工单数量调整
增加出货数量与成品入库数量的校验
This commit is contained in:
2026-02-10 15:07:59 +08:00
parent 176f854aaa
commit 9793fdd42f
7 changed files with 107 additions and 72 deletions

View File

@@ -377,13 +377,33 @@ namespace DOAN.Service.MES.product
customerOrder,
worker
);
if (result == 0)
{
throw new Exception("数据库操作失败");
}
if (result == 2)
{
throw new Exception("订单号不存在");
}
if (result == 3)
{
throw new Exception("订单超额");
}
if (result == 4)
{
throw new Exception("工单不存在");
}
if (result == 5)
{
throw new Exception("主体型号和订单物料不匹配");
}
return result == 1;
}
catch (Exception ex)
{
// 集成现有系统的日志记录
// Log.Error("出货操作失败", ex);
throw;
throw new Exception(ex.Message);
}
}
@@ -429,8 +449,8 @@ namespace DOAN.Service.MES.product
productionCode = mri.MaterialName,
MaterialCode = mri.MaterialCode,
MaterialName = mri.MaterialName,
ShipmentNum = pro.ShipmentNum ?? 0,
PlanNum = pro.PlanNum ?? 0,
ShipmentNum = pro.ShipmentNum,
PlanNum = pro.PlanNum,
Remark01 = mri.Remarks
},
true