コード例 #1
0
        /// <summary>
        /// 获取卷册信息根据任务ID
        /// </summary>
        /// <param name="TaskID"></param>
        /// <returns></returns>
        public EngineeringVolumeInfo GetVolumeInfo(int TaskID)
        {
            var userTask = _IUserTaskService.Get(TaskID);

            var processInfo = _IObjectProcessService.Get(userTask.ProcessID.ToString());

            if (processInfo == null)
            {
                return(null);
            }

            if (processInfo.ObjectKey != this.Const_BusinessKeyName)
            {
                return(null);
            }


            var volume = _DB.Get(processInfo.ObjectID);

            var info = new EngineeringVolumeInfo(volume);

            info.Engineering = _PMContext.EngineeringEntity.Find(info.EngineeringID);

            return(info);
        }
コード例 #2
0
 public EngineeringVolumeEntity(EngineeringVolumeInfo Info)
 {
     this.ID            = Info.ID;
     this.EngineeringID = Info.EngineeringID;
     this.SpecialtyID   = Info.SpecialtyID;
     this.Number        = Info.Number;
     this.Name          = Info.Name;
     this.Designer      = Info.Designer;
     this.Checker       = Info.Checker;
     this.StartDate     = Info.StartDate;
     this.EndDate       = Info.EndDate;
     this.Note          = Info.Note;
     this.IsDone        = Info.IsDone;
 }
コード例 #3
0
        public EngineeringVolumeEntity Finish(int VolumeID)
        {
            var entity = this._DB.Get(VolumeID);

            entity.IsDone     = true;
            entity.FinishDate = DateTime.Now;

            this._DB.Edit(entity);

            var vol = new EngineeringVolumeInfo(entity);

            var users = vol.GetParentMainUsers();

            var engInfo = _IEngineeringService.Get(entity.EngineeringID);

            var specInfo = _IEnum.GetEnumItemInfo("System3", "Specialty", entity.SpecialtyID.ToString());

            // 工程记事
            _IEngineeringNoteService.Add(new EngineeringNoteInfo()
            {
                Content       = string.Format("卷册:[{0}]{1}完成", entity.Number, entity.Name),
                EngineeringID = entity.EngineeringID,
                NoteDate      = DateTime.Now,
                NoteType      = (int)EnumEngineeringNoteType.完成,
                UserID        = 0,
            });

            // 给每个相关人员发送专业完成提醒
            users.ForEach(u =>
            {
                _INotificationService.Add(new NotificationInfo()
                {
                    ReceiveUser = u,
                    Head        = "卷册完成",
                    Title       = "卷册完成",
                    Info        = string.Format("工程:{0},专业:{1},卷册:[{2}]{3}", engInfo.Name, specInfo.Text, entity.Number, entity.Name),
                    SendUser    = 0,
                    CreateDate  = DateTime.Now,
                    EffectDate  = DateTime.Now, // 生效日期
                    SourceID    = VolumeID,
                    SourceName  = "EngineeringVolume",
                    SourceTag   = "Finish",
                });
            });

            return(entity);
        }
コード例 #4
0
        public List <BizObject> GetSpecialtyVolumesV2(int EngineeringID, long SpecialtyID, bool WithTasks = false)
        {
            var volumes = this._DB.GetList(v => v.EngineeringID == EngineeringID && v.SpecialtyID == SpecialtyID && !v.IsDelete);
            var result  = new List <BizObject>();

            foreach (var v in volumes)
            {
                var vol = new EngineeringVolumeInfo(v);

                if (WithTasks)
                {
                    var processInfo = this._IObjectProcessService.Get(this.Const_BusinessKeyName, v.ID);
                    vol.Tasks = this._IBPMTaskInstanceService.GetList(t => t.ProcessID == processInfo.ProcessID && t.Type == (int)TaskType.Manual && !t.IsDelete);
                }

                result.Add(vol);
            }

            return(result);
        }