11
啊鑫
2025-08-25 cdd325cf78ca5bac74f941a917d8c90f34fa63e6
MES.Service/service/BasicData/MesItemsManager.cs
@@ -113,7 +113,7 @@
    private MesItems GetMesItems(ErpItems item)
    {
        return new MesItems
        var entity = new MesItems
        {
            Id = string.IsNullOrEmpty(item.Id)
                ? DateTimeOffset.UtcNow.ToUnixTimeSeconds()
@@ -123,15 +123,26 @@
            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,
@@ -150,13 +161,27 @@
            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,