public async Task <IActionResult> AcctImport([FromBody] BaseInput input) { var master = await _importMasterApp.GetForm(input.KeyValue); var list = await _importDetailApp.GetList(master.F_Id); foreach (var item in list) { var storageEntity = await _storageApp.GetFormByItemId(item.F_ItemId) ?? new StorageEntity(); if (storageEntity.F_Amount == null) { storageEntity.F_Amount = 0; } storageEntity.F_Amount = storageEntity.F_Amount.ToInt() + item.F_Amount.ToInt(); storageEntity.F_Charges = item.F_Charges; storageEntity.F_Code = item.F_Code; storageEntity.F_ImpClass = master.F_ImpClass; storageEntity.F_ItemId = item.F_ItemId; storageEntity.F_Name = item.F_Name; storageEntity.F_Spec = item.F_Spec; storageEntity.F_Storage = master.F_Storage; storageEntity.F_Unit = item.F_Unit; storageEntity.F_TotalCharges = (storageEntity.F_Charges * storageEntity.F_Amount).ToFloat(2); await _storageApp.SubmitForm(storageEntity, storageEntity.F_Id); } //更改记账标识 master.F_IsAcct = true; await _importMasterApp.SubmitForm(master, input.KeyValue); return(Success("增加库存成功。")); }