This commit is contained in:
2024-07-19 08:50:02 +08:00
parent 9326b55a8e
commit 6e3bda642a
7 changed files with 255 additions and 35 deletions

View File

@@ -96,27 +96,18 @@ namespace Tnb.ProductionMgr
item.id = SnowflakeIdHelper.NextId();
item.mo_source = "1";
item.mo_type = moTypeDic[item.mo_type];
item.mo_code = item.mo_code+"-"+item.erp_lineno;
item.mo_code = item.mo_code;
item.create_id = WmsWareHouseConst.AdministratorUserId;
item.create_time = DateTime.Now;
item.mo_status = DictConst.ToBeScheduledId;
item.erp_mo_pk = item.erp_mo_pk;
item.erp_lineno = item.erp_lineno;
moList.Add(item);
extendFieldList.Add(new ErpExtendField()
{
org_id =WmsWareHouseConst.AdministratorOrgId,
table_name = "prd_mo",
table_id = item.id,
erp_lineno = item.erp_lineno,
erp_line_pk = item.erp_line_pk,
erp_mo_pk = item.erp_mo_pk,
create_time = DateTime.Now
});
}
DbResult<bool> result = await _db.Ado.UseTranAsync(async () =>
{
await _db.Insertable(moList).ExecuteCommandAsync();
await _db.Insertable(extendFieldList).ExecuteCommandAsync();
});
return !result.IsSuccess ? result.ErrorMessage : "保存成功";