Exemplo n.º 1
0
        public Deskwork Complete()
        {
            EnsureActive();

            if (Completion != EWorkCompletion.未完成)
            {
                return(this);
            }

            if (Steps.Any(x => !x.Done))
            {
                throw new UserFriendlyException("请先完成所有子流程");
            }

            CompletionTime = Clock.Now;

            if (CreationTime.AddHours(TimeLimit) <= CompletionTime)
            {
                Completion = EWorkCompletion.时完成;
            }
            else
            {
                Completion = EWorkCompletion.超时完成;
            }

            foreach (var step in Steps)
            {
                step.Completion = Completion; // 工单流程的完成情况与工单一致
            }

            DomainEvents.Add(new WorkCompletionEventData());
            return(this);
        }
Exemplo n.º 2
0
 public TicketInfo()
 {
     CreationTime = DateTime.Now;
     ExpireTime   = CreationTime.AddHours(2);//默认有效期:2小时
     Claims       = new List <NameValue>();
 }