| | |
| | | if (itemBarcodeDetails == null) |
| | | throw new Exception("条码不存在,请核对!"); |
| | | |
| | | if (!itemBarcodeDetails.ComeFlg.Value) |
| | | if (itemBarcodeDetails.ComeFlg == 0) |
| | | throw new Exception("此条码不属于到货条码,无法用采购入库!"); |
| | | |
| | | var inventory = Db.Queryable<MesInvItemArn>() |
| | |
| | | if (inventory == null) |
| | | throw new Exception("此条码找不到对应收货单!"); |
| | | |
| | | // var inventoryDetails = Db.Queryable<MesInvItemArnDetail>() |
| | | // .Where(it => it.ParentGuid == inventory.Guid |
| | | // && it.ItemId == itemBarcodeDetails.ItemId |
| | | // && it.EbelnLine == itemBarcodeDetails.WorkLine |
| | | // && it.Ebeln == itemBarcodeDetails.WorkNo) |
| | | // .First(); |
| | | |
| | | var inventoryDetails = Db.Queryable<MesInvItemArnDetail>() |
| | | .Where(it => it.ParentGuid == inventory.Guid |
| | | && it.ItemId == itemBarcodeDetails.ItemId |
| | | && it.EbelnLine == itemBarcodeDetails.WorkLine |
| | | && it.Ebeln == itemBarcodeDetails.WorkNo) |
| | | .Where(it => it.Guid == itemBarcodeDetails.AboutGuid) |
| | | .First(); |
| | | |
| | | if (inventoryDetails == null) |
| | |
| | | mesDepost = Db.Queryable<MesDepots>() |
| | | .Where(s => s.DepotId.ToString() == depotCode2).First(); |
| | | |
| | | if (depotCode != mesDepost.Guid) |
| | | throw new Exception("扫描库位与采购入库库位不一致!"); |
| | | // if (depotCode != mesDepost.Guid) |
| | | // throw new Exception("扫描库位与采购入库库位不一致!"); |
| | | } |
| | | else |
| | | { |
| | |
| | | UseTransaction(db => |
| | | { |
| | | var existingRecord = db.Queryable<MesInvItemIns>() |
| | | .Where(it => it.InsDate.Value.Date == DateTime.Now.Date |
| | | .Where(it => it.InsDate.Value.ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd") |
| | | && it.Status == 0 |
| | | && it.TransctionNo == transactionNo |
| | | && it.BillNo == itemBarcodeDetails.BillNo |
| | |
| | | LastupdateBy = user, |
| | | LastupdateDate = DateTime.Now, |
| | | UrgentFlag = itemBarcodeDetails.UrgentFlag.Value |
| | | ? (byte)1 |
| | | : (byte)0, |
| | | ? "1" |
| | | : "0", |
| | | CbillNo = itemBarcodeDetails.BillNo, |
| | | Fstatus = 0, |
| | | Status = 0 |
| | | Status = 0, |
| | | ReceiveOrgId = inventory.ReceiveOrgId |
| | | }).IgnoreColumns(true).ExecuteCommand(); |
| | | } |
| | | |
| | |
| | | TaskNo = detail.WorkNo, |
| | | EbelnK3id = detail.EbelnK3id, |
| | | LineK3id = detail.LineK3id, |
| | | ItemId = detail.ItemId |
| | | ItemId = detail.ItemId, |
| | | ReceiveOrgId = inventory.ReceiveOrgId |
| | | }).IgnoreColumns(true).ExecuteCommand(); |
| | | } |
| | | else |
| | |
| | | TaskNo = detail.WorkNo, |
| | | EbelnK3id = detail.EbelnK3id, |
| | | LineK3id = detail.LineK3id, |
| | | ItemId = detail.ItemId |
| | | ItemId = detail.ItemId, |
| | | ReceiveOrgId = inventory.ReceiveOrgId |
| | | }).IgnoreColumns(true).ExecuteCommand(); |
| | | |
| | | cSyQty = 0; // Remaining quantity fulfilled |
| | |
| | | Ischeck = true, |
| | | CheckDate = inventoryDetails.CheckDate, |
| | | CheckRes = inventoryDetails.CheckRes, |
| | | CheckStates = inventoryDetails.CheckStates |
| | | CheckStates = inventoryDetails.CheckStates, |
| | | ReceiveOrgId = inventory.ReceiveOrgId |
| | | }).IgnoreColumns(true).ExecuteCommand(); |
| | | |
| | | // 插入 mes_inv_business2 表 |
| | |
| | | EbelnK3id = itemBarcodeDetails.EbelnK3id, |
| | | LineK3id = itemBarcodeDetails.LineK3id, |
| | | ItemId = itemBarcodeDetails.ItemId, |
| | | BillNo = itemBarcodeDetails.BillNo |
| | | BillNo = itemBarcodeDetails.BillNo, |
| | | DepotId = Convert.ToInt32(depotCode2) |
| | | }).IgnoreColumns(true).ExecuteCommand(); |
| | | |
| | | itemBarcodeDetails.Hbdy ??= 0; |