| | |
| | | |
| | | private MesItems GetMesItems(ErpItems item) |
| | | { |
| | | return new MesItems |
| | | var entity = new MesItems |
| | | { |
| | | Id = string.IsNullOrEmpty(item.Id) |
| | | ? DateTimeOffset.UtcNow.ToUnixTimeSeconds() |
| | |
| | | ItemName = item.FName, |
| | | ItemModel = item.FSpecification, |
| | | ItemUnit = item.FBaseUnitId, |
| | | Lowlimit = !string.IsNullOrEmpty(item.FSafeStock) ? Convert.ToDecimal(item.FSafeStock) : null, |
| | | Highlimit = !string.IsNullOrEmpty(item.FMaxStock) ? Convert.ToDecimal(item.FMaxStock) : null, |
| | | PrdPack = !string.IsNullOrEmpty(item.FMinPackCount) ? Convert.ToDecimal(item.FMinPackCount) : null, |
| | | Lowlimit = !string.IsNullOrEmpty(item.FSafeStock) |
| | | ? Convert.ToDecimal(item.FSafeStock) |
| | | : null, |
| | | Highlimit = !string.IsNullOrEmpty(item.FMaxStock) |
| | | ? Convert.ToDecimal(item.FMaxStock) |
| | | : null, |
| | | PrdPack = !string.IsNullOrEmpty(item.FMinPackCount) |
| | | ? Convert.ToDecimal(item.FMinPackCount) |
| | | : null, |
| | | DepotCode = item.FStockId, |
| | | Fmaterialgroup = item.FMaterialGroup, |
| | | Remarks = item.FDescription, |
| | | Ffinishreceiptoverrate = !string.IsNullOrEmpty(item.FFinishReceiptOverRate) ? Convert.ToInt32(item.FFinishReceiptOverRate) : null, |
| | | Ffinishreceiptoverrate = |
| | | !string.IsNullOrEmpty(item.FFinishReceiptOverRate) |
| | | ? Convert.ToInt32(item.FFinishReceiptOverRate) |
| | | : null, |
| | | Fissuetype = item.FIssueType, |
| | | Fisbatchmanage = !string.IsNullOrEmpty(item.FIsBatchManage) ? Convert.ToInt32(item.FIsBatchManage) : null, |
| | | Fisbatchmanage = !string.IsNullOrEmpty(item.FIsBatchManage) |
| | | ? Convert.ToInt32(item.FIsBatchManage) |
| | | : null, |
| | | Fpurchaserid = item.FPurchaserId, |
| | | Fpurchaseunitid = item.FPurchaseUnitId, |
| | | Storeunit = item.FStoreUnitID, |
| | |
| | | LossPercent = item.FLOSSPERCENT, |
| | | MnemonicCode = item.FMnemonicCode, |
| | | ExpPeriod = item.FExpPeriod, |
| | | EItemId = !string.IsNullOrEmpty(item.Id) ? long.Parse(item.Id) : null, |
| | | ItemId = !string.IsNullOrEmpty(item.Id) ? long.Parse(item.Id) : null, |
| | | EItemId = !string.IsNullOrEmpty(item.Id) |
| | | ? long.Parse(item.Id) |
| | | : null, |
| | | ItemId = |
| | | !string.IsNullOrEmpty(item.Id) ? long.Parse(item.Id) : null, |
| | | LastupdateDate = DateTime.Now, |
| | | CreateDate = DateTime.Now, |
| | | Company = "1000", |
| | | Factory = "1000" |
| | | }; |
| | | |
| | | var mesItems = Db.Queryable<MesItems>() |
| | | .Where(s => s.ItemNo == entity.ItemNo) |
| | | .First(); |
| | | |
| | | if (mesItems != null) |
| | | { |
| | | entity.Id = mesItems.Id; |
| | | } |
| | | |
| | | return entity; |
| | | } |
| | | |
| | | private bool UpdateItemStatusBatch(SqlSugarScope db, |