From ebbea512f0121a67bc5236febe9021e48821e44a Mon Sep 17 00:00:00 2001 From: leo <10200039@qq.com> Date: Mon, 8 May 2023 15:27:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99=E4=BF=AE=E6=94=B9=E8=B7=AF?= =?UTF-8?q?=E7=BA=BF=E7=9A=84=E6=9D=83=E9=99=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/MaterialTeamworkController.cs | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/FactorySystemApi/Controllers/MaterialTeamworkController.cs b/FactorySystemApi/Controllers/MaterialTeamworkController.cs index d7075d1..0825fae 100644 --- a/FactorySystemApi/Controllers/MaterialTeamworkController.cs +++ b/FactorySystemApi/Controllers/MaterialTeamworkController.cs @@ -14,6 +14,7 @@ using System.Data; using System.IO; using System.Security.Cryptography; using System.Threading.Tasks; +using System.Web.UI.WebControls; namespace FactorySystemApi.Controllers { @@ -436,7 +437,11 @@ namespace FactorySystemApi.Controllers result.Add("ViewId", vmId); } - List users = MaterialTaskBll.GetTaskUsers(1, view.FMRP1ProductType, factory.FID); + string productType = view.FMRP1ProductType; + string materialName = material.FName; + string vType = GetViewType(productType, materialName); + + List users = MaterialTaskBll.GetTaskUsers(1, vType, factory.FID); if (users == null || users.Count > 0) { @@ -595,6 +600,40 @@ namespace FactorySystemApi.Controllers return vType; } + private string GetViewType(string viewType, string materialName) + { + string vType = null; + + // 成品视图 + if ("10".Equals(viewType)) + { + vType = "1"; + } + // 半成品视图 + else if ("20".Equals(viewType)) + { + vType = "2"; + } + // 中间品视图 + else if ("30".Equals(viewType)) + { + vType = "3"; + + // 香基视图 + if (materialName.Contains("香基")) + { + vType = "4"; + } + } + // 原料视图 + else if ("40".Equals(viewType)) + { + vType = "5"; + } + + return vType; + } + #endregion public T Clone(T obj) where T : class