Beispiel #1
0
        /// <summary>
        /// 获取物料对应关系
        /// </summary>
        /// <returns>0:partNumber;1:materialCode;2:出熱mes物料編碼</returns>
        public String[] getMaterialMapping(String materialOrPart)
        {
            // 0:partNumber;1:materialCode;2:出熱mes物料編碼
            String[]          materialMapping = new String[3];
            DirectoryResource material        = MDManager.GetMaterialDefinition(materialOrPart);

            // 物料编码
            if (material.Exists)
            {
                materialMapping[0] = this.ServiceDirManager.IMaterial.ReadMaterialValue(material, "partNumber").StringValue(CultureInfo.CurrentCulture);
                materialMapping[1] = material.DisplayName;
                materialMapping[2] = this.ServiceDirManager.IMaterial.ReadMaterialValue(material, "heatingOutCode").StringValue(CultureInfo.CurrentCulture);
            }
            else
            {
                // 零件号
                DirectoryResource code = MDManager.GetMaterialDefinitionIdWithPartNumber(materialOrPart);
                if (code != null)
                {
                    materialMapping[0] = materialOrPart;
                    materialMapping[1] = code.DisplayName;
                    materialMapping[2] = this.ServiceDirManager.IMaterial.ReadMaterialValue(code, "heatingOutCode").StringValue(CultureInfo.CurrentCulture);
                }
                else
                {
                    // 出热物料编码,目前不做考虑
                }
            }
            return(materialMapping);
        }
Beispiel #2
0
        public VersionBasePath(DirectoryResource dir)
        {
            var basePath    = Path.Combine(Kooboo.Settings.BaseDirectory, PathEx.BasePath);
            var versionPath = Path.Combine(basePath, VersionPathName);

            this.PhysicalPath = dir.PhysicalPath.Replace(basePath, versionPath);
        }
Beispiel #3
0
        public VersionBasePath(DirectoryResource dir)
        {
            var baseDir     = Kooboo.CMS.Common.Runtime.EngineContext.Current.Resolve <IBaseDir>();
            var basePath    = baseDir.Cms_DataPhysicalPath;
            var versionPath = Path.Combine(basePath, VersionPathName);

            this.PhysicalPath = dir.PhysicalPath.Replace(basePath, versionPath);
        }
Beispiel #4
0
                public EquipmentRequirement(string equipmentId, double quantity, DirectoryResource equipment, IEnumerable <Parameter> parameters)
                {
                    this.EquipmentId = equipmentId;
                    this.Quantity    = quantity;

                    this.Equipment = equipment;

                    this.Parameters = parameters;
                }
Beispiel #5
0
                public PersonnelRequirement(string personId, double quantity, DirectoryResource person, IEnumerable <Parameter> parameters)
                {
                    this.PersonId = personId;
                    this.Quantity = quantity;

                    this.Person = person;

                    this.Parameters = parameters;
                }
Beispiel #6
0
                internal MaterialProduced(Guid materialLotId, DirectoryResource materialDefinition, string materialDefinitionPrimaryUnitOfMeasure, string serialNumber, double quantity)
                {
                    this.MaterialLotId      = materialLotId;
                    this.MaterialDefinition = materialDefinition;
                    this.MaterialDefinitionPrimaryUnitOfMeasure = materialDefinitionPrimaryUnitOfMeasure;

                    this.SerialNumber = serialNumber;
                    this.Quantity     = quantity;
                }
Beispiel #7
0
                internal MaterialConsumed(string materialLotS95Id, DirectoryResource materialDefinition, string materialDefinitionPrimaryUnitOfMeasure, double quantity)
                {
                    this.MaterialLotS95Id   = materialLotS95Id;
                    this.MaterialDefinition = materialDefinition;
                    this.MaterialDefinitionPrimaryUnitOfMeasure = materialDefinitionPrimaryUnitOfMeasure;


                    this.Quantity = quantity;
                }
Beispiel #8
0
        public DirectoryEntry(DirectoryResource rootDir, DirectoryResource parent, string name)
            : base(parent.Site, name)
        {
            this.virtualPath      = UrlUtility.Combine(parent.VirtualPath, name);
            this.physicalPath     = Path.Combine(parent.PhysicalPath, name);
            this.basePhysicalPath = parent.PhysicalPath;
            this.baseVirtualPath  = parent.VirtualPath;

            this.RootDir = rootDir;
        }
Beispiel #9
0
        public DirectoryEntry(DirectoryResource rootDir, string relativePath)
            : base("")
        {
            this.physicalPath     = Path.Combine(rootDir.PhysicalPath, relativePath);
            this.virtualPath      = UrlUtility.GetVirtualPath(physicalPath);
            this.basePhysicalPath = Path.GetDirectoryName(this.physicalPath);
            var paths = this.virtualPath.Split("/".ToArray(), StringSplitOptions.RemoveEmptyEntries);

            this.baseVirtualPath = UrlUtility.Combine(paths.Take(paths.Count() - 1).ToArray());

            this.RootDir = rootDir;
        }
 /// <summary>
 /// 更新设备的属性值
 /// </summary>
 /// <param name="equipName">设备名称</param>
 /// <param name="propertyName">设备属性名称</param>
 /// <param name="value">设备属性值</param>
 public void WriteEquipmentPropertyValue(string equipName, string propertyName, object value)
 {
     try
     {
         DirectoryResource ownerAddress = EQManager.GetWorkCell(equipName);
         this.ServiceDirManager.IEquipment.WriteEquipmentValue(ownerAddress, propertyName, value);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #11
0
 public List <DirectoryResource> GetEquipmentChildren(DirectoryResource parentEquipment, bool immediateOnly)
 {
     return(this.ServiceDirectoryManager.IDirectorySearch.Search2(
                new DirectoryResource[] { parentEquipment },
                new Proficy.Platform.Services.Navigation.Interfaces.ClassificationExpression(),
                new Proficy.Platform.Services.Navigation.Interfaces.ClassificationExpression(),
                immediateOnly,
                "",
                "",
                true,
                1
                ).Results.ToList());
 }
Beispiel #12
0
 public DirectoryResource GetEquipmentChild(DirectoryResource parentEquipment, string equipmentName, bool immediateOnly)
 {
     return(this.ServiceDirectoryManager.IDirectorySearch.Search2(
                new DirectoryResource[] { parentEquipment },
                new Proficy.Platform.Services.Navigation.Interfaces.ClassificationExpression(),
                new Proficy.Platform.Services.Navigation.Interfaces.ClassificationExpression(),
                immediateOnly,
                equipmentName,
                "",
                true,
                1
                ).Results.FirstOrDefault());
 }
        /// <summary>
        /// 根据零件号查找物料编码
        /// </summary>
        /// <param name="partNumber"></param>
        /// <returns></returns>
        public DirectoryResource GetMaterialDefinitionIdWithPartNumber(String partNumber)
        {
            string           storedProcedureName = "uspMa_GetMaterialDefinitionIdWithPartNumber";
            List <Parameter> inputparams         = new List <Parameter>();

            DirectoryResource mdresource = null;

            inputparams.Add(new Parameter("@PartNumber", new CrudItem(1, partNumber)));
            var spresult = this.DatabaseManager.ExecuteProcedure(storedProcedureName, inputparams);

            if (spresult.FirstTable.Rows != null && spresult.FirstTable.Rows.Any())
            {
                mdresource = new DirectoryResource(spresult.FirstTable.Rows[0]["MD_ADDRESS"].ToString());
            }
            return(mdresource);
        }
Beispiel #14
0
        /// <summary>
        /// 创建物料
        /// </summary>
        /// <param name="materialName">物料号</param>
        /// <param name="description">描述</param>
        public bool createMaterial(String materialName, string description)
        {
            bool result = false;

            try
            {
                MaterialDefinitionAttributes attr = new MaterialDefinitionAttributes()
                {
                    S95Id       = materialName,
                    Description = description
                };
                AspectChangeRequest request = new AspectChangeRequest();

                this.ServiceDirManager.IMaterial.CreateMaterialDefinition(attr, request);

                DirectoryResource material = MDManager.GetMaterialDefinition(materialName);
                if (material == null)
                {
                    return(false);
                }
                //根据setid去查找码表项
                List <string> itemList = MDManager.GetCodeItemsBySetIdFromDB("MA01");
                if (itemList != null && itemList.Count > 0)
                {
                    DirectoryResource dir_class = null;
                    foreach (var item in itemList)
                    {
                        dir_class = MDManager.GetMaterialClass(item);
                        if (dir_class != null)
                        {
                            this.ServiceDirManager.IMaterial.AddClass(material, dir_class);
                        }
                    }
                }
                result = true;
            }
            catch (Exception ex)
            {
                throw;
            }
            return(result);
        }
        /// <summary>
        /// Get Material Defintion from Custom Query
        /// </summary>
        /// <param name="definitionName"></param>
        /// <returns></returns>
        public DirectoryResource GetMaterialDefinitionFromDB(string definitionName)
        {
            if (string.IsNullOrEmpty(definitionName))
            {
                return(null);
            }

            string            storedProcedureName = "uspWip_GetMaterialDefinition";
            DirectoryResource mdresource          = null;
            List <Parameter>  inputparams         = new List <Parameter>();

            inputparams.Add(new Parameter("@PartNumber", new CrudItem(1, definitionName)));
            var spresult = this.DatabaseManager.ExecuteProcedure(storedProcedureName, inputparams);

            if (spresult.FirstTable.Rows != null && spresult.FirstTable.Rows.Any())
            {
                mdresource = new DirectoryResource(spresult.FirstTable.Rows[0]["MD_ADDRESS"].ToString(), spresult.FirstTable.Rows[0]["mName"].ToString(), "");
            }
            return(mdresource);
        }
Beispiel #16
0
        internal DirectoryResource[] GetEquipmentClasses(string _Expression)
        {
            try
            {
                // this.ServiceDirectoryManager.IDirectorySearch _search = (this.ServiceDirectoryManager.IDirectorySearch)UC.GetDefaultProvider("NAVIGATION_IDIRECTORYSEARCH");

                DirectoryResource _root = new DirectoryResource("CN=Equipment,CN=SOAProject,CN=Projects,OU=Publications,O=Proficy");

                Proficy.Platform.Services.Navigation.Interfaces.ClassificationExpression IncludedClassifications = new Proficy.Platform.Services.Navigation.Interfaces.ClassificationExpression(_Expression);
                Proficy.Platform.Services.Navigation.Interfaces.ClassificationExpression ExcludedClassifications = new Proficy.Platform.Services.Navigation.Interfaces.ClassificationExpression(null, "");

                DirectoryResource[] _EquipmentClasses = this.ServiceDirectoryManager.IDirectorySearch.Search(
                    _root, IncludedClassifications, ExcludedClassifications, null, null);

                return(_EquipmentClasses);
            }
            catch (System.Exception ex)
            {
                throw;
            }
        }
Beispiel #17
0
 public Dictionary <String, String> GetAllProperty(String materialName)
 {
     try
     {
         DirectoryResource material = MDManager.GetMaterialDefinition(materialName);
         if (material == null)
         {
             return(null);
         }
         NameDataValueCollection     allValues = this.ServiceDirManager.IMaterial.ReadAllMaterialValues(material);
         Dictionary <String, String> res       = new Dictionary <String, String>();
         foreach (var iV in allValues)
         {
             res.Add(iV.Key, iV.Value.StringValue(CultureInfo.CurrentCulture));
         }
         return(res);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #18
0
        /// <summary>
        /// 批量修改物料属性值
        /// </summary>
        /// <param name="materialName">物料号</param>
        /// <param name="propDict">物料属性字典集合</param>
        public bool batchWriteProperty(String materialName, IDictionary <string, string> propDict)
        {
            bool result = false;

            try
            {
                DirectoryResource material = MDManager.GetMaterialDefinition(materialName);
                if (material != null && propDict != null)
                {
                    IMaterial iMaterial = this.ServiceDirManager.IMaterial;
                    foreach (var item in propDict.Keys)
                    {
                        iMaterial.WriteMaterialValue(material, item, propDict[item]);
                    }
                    result = true;
                }
            }
            catch
            {
                throw;
            }
            return(result);
        }
Beispiel #19
0
        public FileEntry(DirectoryResource rootDir, string relativePath)
            : base("")
        {
            this.physicalPath = Path.Combine(rootDir.PhysicalPath, relativePath);
            this.virtualPath  = UrlUtility.GetVirtualPath(physicalPath);

            this.basePhysicalPath = Path.GetDirectoryName(this.physicalPath);
            var paths = this.virtualPath.Split("/".ToArray(), StringSplitOptions.RemoveEmptyEntries);

            this.baseVirtualPath = UrlUtility.Combine(paths.Take(paths.Count() - 1).ToArray());
            this.FileName        = paths.Last();
            if (this.FileName.Contains('.'))
            {
                this.Name          = FileName.Substring(0, FileName.IndexOf("."));
                this.FileExtension = FileExtension.Substring(FileExtension.IndexOf(".") + 1);
            }
            else
            {
                this.Name = FileName;
            }

            this.RootDir = rootDir;
            //this.RelativePath = relativeVirtualPath;
        }
Beispiel #20
0
        public void writeProperty(String materialName, String propNmae, String value)
        {
            DirectoryResource material = MDManager.GetMaterialDefinition(materialName);

            this.ServiceDirManager.IMaterial.WriteMaterialValue(material, propNmae, value);
        }
 public string GetResourceName(DirectoryResource person)
 {
     return(GetResourceName(person.DisplayName));
 }
 public Guid CreateMaterialLot(DirectoryResource materialDefinition, string serialNumber, double qty, DirectoryResource Location, string status)
 {
     return(this.ServiceDirectoryManager.IMaterial.CreateMaterialLot(materialDefinition, serialNumber, serialNumber, Location, status, qty, "UOM"));
 }
Beispiel #23
0
        protected override MenuItem GenerateItem(Site site, ControllerContext controllerContext, DirectoryResource directoryResource)
        {
            var item = base.GenerateItem(site, controllerContext, directoryResource);

            if (controllerContext.RequestContext.GetRequestValue("ThemeName") == null)
            {
                item.RouteValues["ThemeName"] = directoryResource.Name;
            }

            return(item);
        }
Beispiel #24
0
        public WorkOrder(string site, string s95Id, string description, DateTime?earliestStartTime, DateTime?latestEndTime, DirectoryResource producedMaterial, DirectoryResource productionLine, bool producedMaterial_IsSerializedPart, int quantity, string uoM, IEnumerable <Parameter> parameters, IEnumerable <Operation> operations)
        {
            this.Site              = site;
            this.S95Id             = s95Id;
            this.Description       = description;
            this.EarliestStartTime = earliestStartTime;
            this.LatestEndTime     = latestEndTime;
            this.ProducedMaterial  = producedMaterial;
            this.ProductionLine    = productionLine;
            this.ProducedMaterial_IsSerializedPart = producedMaterial_IsSerializedPart;
            this.Quantity = quantity;
            this.UoM      = uoM;

            this.Parameters = parameters;

            this.Operations = operations;
        }
Beispiel #25
0
        protected virtual MenuItem GenerateItem(Site site, ControllerContext controllerContext, DirectoryResource directoryResource)
        {
            var menuItem = new MenuItem
            {
                Text        = directoryResource.Name,
                Area        = "Sites",
                Action      = "Index",
                Controller  = "File",
                Initializer = new FileFolderItemInitializer(),
                Localizable = false
            };

            menuItem.RouteValues = new System.Web.Routing.RouteValueDictionary();

            menuItem.RouteValues["folderPath"] = ((DirectoryEntry)directoryResource).RelativePath;
            menuItem.RouteValues["type"]       = FileManager.Type;

            var subDirs = FileManager.GetDirectories(site, ((DirectoryEntry)directoryResource).RelativePath);

            if (subDirs != null && subDirs.Count() > 0)
            {
                var subList = new List <MenuItem>();
                foreach (var sub in subDirs)
                {
                    subList.Add(GenerateItem(site, controllerContext, sub));
                }
                menuItem.Items = subList;
            }

            return(menuItem);
        }
Beispiel #26
0
        public VersionPath(DirectoryResource dir, int version)
        {
            var versionBasePath = new VersionBasePath(dir);

            this.PhysicalPath = Path.Combine(versionBasePath.PhysicalPath, version.ToString());
        }
Beispiel #27
0
 private DirectoryResource[] GetEquipmentByClass(DirectoryResource parentEquipment, DirectoryResource equipmentClass, string equipmentName)
 {
     return(this.GetEquipmentByClassificationExpression(new Proficy.Platform.Services.Navigation.Interfaces.ClassificationExpression(string.Format("EquipmentClass:{0}", equipmentClass.GetId())), equipmentName));
 }
Beispiel #28
0
        public DirectoryResource GetSiteEquipment(string siteName, string equipmentName)
        {
            DirectoryResource site = this.GetSite(siteName);

            return(this.GetEquipmentChild(site, equipmentName, false));
        }