コード例 #1
0
        /// <summary>
        /// 驳回
        /// </summary>
        /// <returns></returns>
        public virtual async Task NodeReject(FlowVerifySubmitDto reqest)
        {
            var user = await GetCurrentUserAsync();

            FlowInstance flowInstance = await Manager.GetByIdAsync(reqest.FlowInstanceId);

            FlowRuntime wfruntime = new FlowRuntime(flowInstance);

            string resnode = "";

            resnode = string.IsNullOrEmpty(reqest.NodeRejectStep) ? wfruntime.RejectNode() : reqest.NodeRejectStep;

            var tag = new Tag
            {
                Description = reqest.VerificationOpinion,
                Taged       = TagState.Reject,
                UserId      = user.Id,
                UserName    = user.Name
            };

            wfruntime.MakeTagNode(wfruntime.currentNodeId, tag);
            flowInstance.InstanceStatus = InstanceStatus.Reject;//4表示驳回(需要申请者重新提交表单)
            if (resnode != "")
            {
                var currentNode = wfruntime.Nodes[resnode];
                flowInstance.PreviousId   = flowInstance.ActivityId;
                flowInstance.ActivityId   = resnode;
                flowInstance.ActivityType = wfruntime.GetNodeType(resnode);
                flowInstance.ActivityName = currentNode.name;
                //如果是开始节点,则取流程实例的创建者
                flowInstance.MakerList = flowInstance.ActivityType == 3?$",{flowInstance.CreatorUserId},": GetNodeMakers(currentNode);//当前节点可执行的人信息

                await AddTransHistory(wfruntime);
            }
            flowInstance.SchemeContent = Newtonsoft.Json.JsonConvert.SerializeObject(wfruntime.ToSchemeObj());

            await Manager.UpdateAsync(flowInstance);

            await FlowInstanceOperationHistoryRepository.InsertAsync(new FlowInstanceOperationHistory
            {
                FlowInstanceId = reqest.FlowInstanceId,
                Content        = "【"
                                 + wfruntime.currentNode.name
                                 + "】【" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "】驳回,备注:"
                                 + reqest.VerificationOpinion
            });
        }
コード例 #2
0
        /// <summary>
        /// 审核流程
        /// <para>李玉宝于2017-01-20 15:44:45</para>
        /// </summary>
        public virtual async Task Verification(FlowVerifySubmitDto request)
        {
            var user = await GetCurrentUserAsync();

            var tag = new Tag
            {
                UserName    = user.Name,
                UserId      = user.Id,
                Description = request.VerificationOpinion,
                Taged       = request.VerificationFinally
            };

            //驳回
            if (request.VerificationFinally == TagState.Reject)
            {
                await NodeReject(request);
            }
            else
            {
                await NodeVerification(request.FlowInstanceId, tag);
            }
        }