仓库-新增出库记录,当为0时删除成品库记录

This commit is contained in:
2024-04-23 15:04:27 +08:00
parent 1ea312d30a
commit 8d1395e111

View File

@@ -81,7 +81,14 @@ namespace ZR.Service.mes.wms
{
updateModel.GoodsNumAction = 0;
}
Context.Updateable(updateModel).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
if (updateModel.GoodsNumAction == 0)
{
Context.Deleteable<WmGoodsNowProduction>().Where(it => it.Id == updateModel.Id).ExecuteCommand();
}
else
{
Context.Updateable(updateModel).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
}
return Context.Insertable(model).ExecuteReturnEntity();
}