示例#1
0
        public async Task <TaskInstanceDto> InstanceInit(InstanceInitDto input)
        {
            var taskTmpl = _repoTemplate.FirstOrDefault(x => x.TenantId == AbpSession.TenantId && x.TaskCode == input.TaskCode);

            if (taskTmpl == null)
            {
                throw new Abp.UI.UserFriendlyException("TheTaskCodeIsNotExistsInTemplates.");
            }
            TaskInstanceDto task = new TaskInstanceDto
            {
                TaskCode            = input.TaskCode,
                TaskName            = taskTmpl.TaskName,
                UseConditionControl = taskTmpl.UseConditionControl,
                Condition1Name      = taskTmpl.Condition1Name,
                Condition1Value     = input.Condition1Value,
                Condition2Name      = taskTmpl.Condition2Name,
                Condition2Value     = input.Condition2Value,
                Condition3Name      = taskTmpl.Condition3Name,
                Condition3Value     = input.Condition3Value,
                KeyInfo             = input.KeyInfo,
                FormUri             = input.FormUri,
                CanAppendPhase      = taskTmpl.CanAppendPhase,
                NotifyTitle         = input.NotifyTitle,
                NotifyContent       = "您好!有流程任务需要您处理.流程类型:" + taskTmpl.TaskName + ".概要信息:" + input.KeyInfo,
                FinalService        = input.FinalService,
                StartService        = input.StartService,
                AbortService        = input.AbortService,
                PhaseService        = input.PhaseService,
                Status              = "1",
                Revocable           = taskTmpl.Revocable,
                ReturnType          = taskTmpl.ReturnType,
                ResubmitType        = taskTmpl.ResubmitType,
                Originator          = AbpSession.UserName,
                LastPhaseHandleTime = Abp.Timing.Clock.Now,
                CurrentActors       = AbpSession.UserName,
                CurrentPhaseCode    = "00"
            };
            //以FormUri作为数据key
            var t = _repository.FirstOrDefault(x => x.TenantId == AbpSession.TenantId && x.FormUri == input.FormUri);

            if (t != null)
            {
                task.Id           = t.Id;
                task.InstanceCode = t.InstanceCode;
                return(await Update(task));
            }
            else
            {
                task.InstanceCode = _sequenceNumberAppService.GetSequenceNumberStringByCode("TaskInstanceCode");
                return(await Create(task));
            }
        }
示例#2
0
 public override Task <TaskTemplateDto> Create(TaskTemplateDto input)
 {
     input.TaskCode = _sequenceNumberAppService.GetSequenceNumberStringByCode("TaskCode");
     return(base.Create(input));
 }
示例#3
0
 public override Task <LeaveApplicationDto> Create(LeaveApplicationDto input)
 {
     input.AppliNumber = _sequenceNumberAppService.GetSequenceNumberStringByCode("LeaveApplicationNumber");
     return(base.Create(input));
 }