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