快乐的昕的电脑
5 天以前 dceaef6216586bed2a22ac425c4ac07cb1136ae4
物料编码转ID
已修改2个文件
32 ■■■■ 文件已修改
MES.Service/Modes/MesRohInData.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/MesRohInManager.cs 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/Modes/MesRohInData.cs
@@ -33,7 +33,7 @@
    public string? OrderLineId { get; set; }
    /// <summary>
    ///     物料编码
    ///     物料ID
    /// </summary>
    [SugarColumn(ColumnName = "ITEM_ID")]
    public string? ItemId { get; set; }
MES.Service/service/BasicData/MesRohInManager.cs
@@ -77,9 +77,9 @@
        //}
        //传什么,c就改成什么
        if (type == "3" || (mesRohIn.DocumentStatus != null && mesRohIn.DocumentStatus != "F"))//C表示已审核状态
        if (type == "3" || (mesRohIn.DocumentStatus != null && mesRohIn.DocumentStatus != "Y"))//Y表示已审核状态
        {
            mesRohIn.BillNo = mesRohIn.BillNo + "F" + mesRohIn.EbelnK3id.ToString();
            mesRohIn.BillNo = mesRohIn.BillNo + "Y" + mesRohIn.EbelnK3id.ToString();
        }
        if (mesRohIn.Guid != null)
@@ -146,7 +146,7 @@
            mesRohIn.PurchaseDate = DateTime.ParseExact(rohIn.FDate,
                "yyyy-MM-dd HH:mm:ss", null);
        //供应商转编码
        //供应商编码转ID
        var mesRohInSupplier = Db.Queryable<MesSupplier>()
            .Where(x => x.SuppNo == rohIn.FSupplierId)
            .Select(x => x.Id.ToString())
@@ -169,7 +169,7 @@
        //mesRohIn.PurchaseOrg = rohIn.FPurchaseOrgId;
        mesRohIn.PurchaseOrg = string.IsNullOrEmpty(rohIn.FPurchaseOrgId) ? "1" : rohIn.FPurchaseOrgId;//采购组织
        //采购部门转编码
        //采购部门编码转ID
        var mesRohInPurchaseDept = Db.Queryable<SysDepartment>()
            .Where(x => x.Departmentcode == rohIn.FPurchaseDeptId)
            .Select(x => x.Departmentid.ToString())
@@ -330,7 +330,7 @@
                SalesOrderId = s.F_UNW_Text_xsddh
            };
            //采购单位转编码
            //采购单位编码转ID
            var entityPurchaseUnit = Db.Queryable<MesUnit>()
                .Where(x => x.Fnumber == s.FUnitId)
                .Select(x => x.Id.ToString())
@@ -348,7 +348,7 @@
                entity.PurchaseUnit = "0";
            }
            //计价单位转编码
            //计价单位编码转ID
            var entityPricingUnit = Db.Queryable<MesUnit>()
                .Where(x => x.Fnumber == s.FPriceUnitId)
                .Select(x => x.Id.ToString())
@@ -366,6 +366,24 @@
                entity.PricingUnit = "0";
            }
            //物料编码转ID
            var entityItemId = Db.Queryable<MesItems>()
                .Where(x => x.ItemNo == s.FMaterialId)
                .Select(x => x.Id.ToString())
                .First();
            if (!string.IsNullOrWhiteSpace(entityItemId))
            {
                entity.ItemId = entityItemId;
            }
            else if (!string.IsNullOrWhiteSpace(s.FMaterialId))
            {
                entity.ItemId = s.FMaterialId;
            }
            else
            {
                entity.ItemId = "0";
            }
            if (s.FFreezeDate != null)
                if (!s.FFreezerId.IsNullOrEmpty())
                    entity.FreezeTime =