public bool Validata(AuditFltRetApplyQueryModel auditFltRetApplyQuery)
        {
            ValidataAuditContext context = new ValidataAuditContext()
            {
                FltRetModApply = auditFltRetApplyQuery.FltRetApply,
                AuditStep      = auditFltRetApplyQuery.AuditStep,
                AuditCid       = auditFltRetApplyQuery.AuditCustomer.Cid,
                ApplyType      = 1
            };

            AuditAbstractValidate alreadyAuditedValidate = new AlreadyRetModApplyAuditedValidate();
            AuditAbstractValidate auditeCidValidate      = new AuditeRetModApplyCidValidate();

            alreadyAuditedValidate.SetNextNode(auditeCidValidate);

            return(alreadyAuditedValidate.ActionValidate(context));
        }
        public bool Validata(AuditFltOrderQueryModel auditFltOrderQuery)
        {
            ValidataAuditContext context = new ValidataAuditContext()
            {
                FltOrder  = auditFltOrderQuery.FltOrder,
                AuditStep = auditFltOrderQuery.AuditStep,
                AuditCid  = auditFltOrderQuery.AuditCustomer.Cid
            };


            AuditAbstractValidate alreadyAuditedValidate = new AlreadyAuditedValidate();
            AuditAbstractValidate auditeCidValidate      = new AuditeCidValidate();

            alreadyAuditedValidate.SetNextNode(auditeCidValidate);


            return(alreadyAuditedValidate.ActionValidate(context));
        }
        public override bool ActionValidate(ValidataAuditContext context)
        {
            List <string> checkStatusList = new List <string>()
            {
                "T", "S", "J"
            };

            if (context.FltOrder.CheckType != "E")
            {
                throw new Exception("当前订单不支持系统审批");
            }

            if (!checkStatusList.Contains(context.AuditStep))
            {
                throw new Exception("当前审批状态不正确");
            }
            string checkStatus = context.FltOrder.CheckStatus; //当前订单的审核状态

            if (context.AuditStep != checkStatus)
            {
                throw new Exception("当前订单已审批");
            }
            if (checkStatus == "J")
            {
                throw new Exception("当前订单被审批否决,不能继续审批");
            }
            if (context.FltOrder.Orderstatus == "C")
            {
                throw new Exception("当前订单已取消,不能审批");
            }

            if ((context.FltOrder.ProcessStatus & 4) != 4)
            {
                throw new Exception("当前订单无法被审批");
            }

            this.NextNode?.ActionValidate(context);
            return(true);
        }
Example #4
0
        public override bool ActionValidate(ValidataAuditContext context)
        {
            int?auditCid = null;

            if (context.AuditStep == "T") //待一级审核
            {
                auditCid = context.FltOrder.CPId;
            }
            if (context.AuditStep == "S") //待二级审核
            {
                auditCid = context.FltOrder.CPIdSecond;
            }
            if (!auditCid.HasValue)
            {
                throw new Exception("当前订单没有设置审批人,不能审批");
            }
            if (context.AuditCid != auditCid.Value)
            {
                throw new Exception("无权审批该订单");
            }

            this.NextNode?.ActionValidate(context);
            return(true);
        }
Example #5
0
 public override bool ActionValidate(ValidataAuditContext context)
 {
     this.NextNode?.ActionValidate(context);
     return(true);
 }
Example #6
0
 /// <summary>
 /// 验证
 /// </summary>
 /// <returns></returns>
 public abstract bool ActionValidate(ValidataAuditContext context);