From 425a8186282f2ae872ca988370e8d42cbd6be31a Mon Sep 17 00:00:00 2001 From: Yang <903110162@qq.com> Date: Fri, 1 Dec 2023 17:41:06 +0800 Subject: [PATCH] commit by yzf --- FactorySystemApi/Controllers/FormulaController.cs | 2 +- FactorySystemApi/Controllers/TeamworkController.cs | 10 +++++++--- FactorySystemBll/FormulaBll.cs | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/FactorySystemApi/Controllers/FormulaController.cs b/FactorySystemApi/Controllers/FormulaController.cs index d28761c..a13183b 100644 --- a/FactorySystemApi/Controllers/FormulaController.cs +++ b/FactorySystemApi/Controllers/FormulaController.cs @@ -746,7 +746,7 @@ namespace FactorySystemApi.Controllers MaterialBll materialBll = new MaterialBll(); TFS_Material tFS_Material = materialBll.GetMaterialListByFCode(item.SP_VALUE).FirstOrDefault(); - if (tFS_Material != null) + if (tFS_Material != null&& !string.IsNullOrWhiteSpace(tFS_Material.OldCode)) { item.ASapCode = tFS_Material.OldCode; } diff --git a/FactorySystemApi/Controllers/TeamworkController.cs b/FactorySystemApi/Controllers/TeamworkController.cs index 37374a9..69bef5f 100644 --- a/FactorySystemApi/Controllers/TeamworkController.cs +++ b/FactorySystemApi/Controllers/TeamworkController.cs @@ -1667,6 +1667,7 @@ namespace FactorySystemApi.Controllers if (forIdList.IndexOf(mId) != -1) { DataRow main = dtList.Copy().Select("FMaterialID=" + item.mId)[0]; + if (parent != null) { TFS_ViewMaterial temp = BaseBll.GetTempModel("FMaterialID=" + parent.mId); @@ -1724,8 +1725,8 @@ namespace FactorySystemApi.Controllers DataRow drTi = dtList.Copy().Select("FMaterialID=" + item.mId)[0]; drTi["子项编码"] = vTi == null ? mTi.FCode : vTi.FBaseMaterialCode; drTi["子件描述"] = vTi == null ? mTi.FName : vTi.FBaseMaterialDesc; - drTi["组件数量"] = vTi == null ? drTi["组件数量"] : vTi.FExtraQuantity; - drTi["计量单位"] = vTi == null ? mTi.FBaseUnit : vTi.FBaseBasicMeter; + //drTi["组件数量"] = vTi == null ? drTi["组件数量"] : vTi.FExtraQuantity; + //drTi["计量单位"] = vTi == null ? mTi.FBaseUnit : vTi.FBaseBasicMeter; drTi["物料供应标识符"] = mTi == null ? iTi.FCustomerCode : mTi.FSupplyCode; drTi["生产仓储地点"] = vTi == null ? iTi.FStoreHouse : vTi.FMRP2ExternalStoragePlace; drTi["成本核算标识相关"] = (mTi != null ? mTi.FSupplyCode : drTi["物料供应标识符"].ToString()) == "K" ? "" : "X"; @@ -1734,7 +1735,10 @@ namespace FactorySystemApi.Controllers } } } - if (type == 2) main["BOM用途"] = "Y"; + if (type == 2) { main["BOM用途"] = "1"; } + else if (type == 1) { + main["BOM用途"] = ""; + } rowList[0].Add(main); } } diff --git a/FactorySystemBll/FormulaBll.cs b/FactorySystemBll/FormulaBll.cs index 48e9578..058db65 100644 --- a/FactorySystemBll/FormulaBll.cs +++ b/FactorySystemBll/FormulaBll.cs @@ -82,7 +82,7 @@ namespace FactorySystemBll List list = db.Queryable() .WhereIF(tr.FPlmCode != null, s => s.Change_Content.Contains(tr.FPlmCode)) .WhereIF(tr.FTestCode != null, s => s.SP_VALUE.Contains(tr.FTestCode)) - .WhereIF(tr.FStatus != null, s => s.Status.Contains(tr.FStatus)) + .WhereIF(tr.FStatus != null, s => s.Status.Contains(tr.FStatus)).OrderByDescending(m=>m.Change_Time) .Select("*").ToPageList(tr.FPageIndex, tr.FPageSize, ref totalNumber); return list; }