| | |
| | | |
| | | private MesItems GetMesItems(ErpItems item) |
| | | { |
| | | return new MesItems |
| | | var entity = new MesItems |
| | | { |
| | | Id = Convert.ToDecimal(item.Id), |
| | | Id = string.IsNullOrEmpty(item.Id) |
| | | ? DateTimeOffset.UtcNow.ToUnixTimeSeconds() |
| | | : long.Parse(item.Id), |
| | | Type = item.Type, |
| | | ItemNo = item.FNumber, |
| | | FOldNumber = item.FOldNumber, |
| | | ItemName = item.FName, |
| | | ItemModel = item.FSpecification, |
| | | ItemUnit = item.FBaseUnitId, |
| | | Lowlimit = Convert.ToDouble(item.FSafeStock), |
| | | Highlimit = Convert.ToDouble(item.FMaxStock), |
| | | FMinStock = item.FMinStock, |
| | | PrdPack = Convert.ToDouble(item.FMinPackCount), |
| | | 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 = Convert.ToDecimal(item.FFinishReceiptOverRate), |
| | | FFinishReceiptShortRate = item.FFinishReceiptShortRate, |
| | | Ffinishreceiptoverrate = |
| | | !string.IsNullOrEmpty(item.FFinishReceiptOverRate) |
| | | ? Convert.ToInt32(item.FFinishReceiptOverRate) |
| | | : null, |
| | | Fissuetype = item.FIssueType, |
| | | Fisbatchmanage = Convert.ToInt32(item.FIsBatchManage), |
| | | Fisbatchmanage = !string.IsNullOrEmpty(item.FIsBatchManage) |
| | | ? Convert.ToInt32(item.FIsBatchManage) |
| | | : null, |
| | | Fpurchaserid = item.FPurchaserId, |
| | | FDefaultVendor = item.FDefaultVendor, |
| | | Fpurchaseunitid = Convert.ToDecimal(item.FPurchaseUnitId), |
| | | Fpurchaseunitid = item.FPurchaseUnitId, |
| | | Storeunit = item.FStoreUnitID, |
| | | Saleunit = item.FSaleUnitId, |
| | | FDocumentStatus = item.FDocumentStatus, |
| | | Fforbidstatus = item.FForbidStatus, |
| | | MaterialProperti = item.FErpClsID, |
| | | FMfgPolicyId = item.FMfgPolicyId, |
| | | ProductionWorkshop = item.FWorkShopId, |
| | | FBOMUnitId = item.FBOMUnitId, |
| | | ProduceUnit = item.FPRODUCEUNITID, |
| | | FIsKitting = item.FIsKitting, |
| | | FIsCoby = item.FIsCoby, |
| | | FOverControlMode = item.FOverControlMode, |
| | | SubconUnit = item.FSUBCONUNITID, |
| | | Fumbrella = item.FCreateOrgId, |
| | | FSubsidiary = item.FUseOrgId, |
| | | FLOSSPERCENT = item.FLOSSPERCENT, |
| | | FSubsidiary = string.IsNullOrEmpty(item.FUseOrgId) |
| | | ? "1" |
| | | : item.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(item.FCreateOrgId) |
| | | ? "1" |
| | | : item.FCreateOrgId, |
| | | LossPercent = item.FLOSSPERCENT, |
| | | MnemonicCode = item.FMnemonicCode, |
| | | FExpPeriod = item.FExpPeriod, |
| | | EItemId = long.Parse(item.Id), |
| | | ItemId = long.Parse(item.Id), |
| | | ExpPeriod = item.FExpPeriod, |
| | | 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, |