VOL框架 审批最后一步事务处理
public override WebResponseContent Audit(object[] keys, int? auditStatus, string auditReason) { Tools tools = new Tools(); int laststep = tools.LastStep((string)keys[0], "ST_LockUnlock"); //status当前审批状态,lastAudit是否最后一个审批节点 AuditWorkFlowExecuting = (ST_LockUnlock lockUnlock, AuditStatus status, bool lastAudit) => { return webResponse.OK(); }; //status当前审批状态,nextUserIds下一个节点审批人的帐号id(可以从sys_user表中查询用户具体信息),lastAudit是否最后一个审批节点 AuditWorkFlowExecuted = (ST_LockUnlock lockUnlock, AuditStatus status, List<int> nextUserIds, bool lastAudit) => { //lastAudit=true时,流程已经结束 if (!lastAudit) { if (laststep == 1 && auditStatus == 1) { //获取表码调整记录及对应的日记录信息 string bql = $@" SELECT MeterID,ReqType,WorkDate FROM ST_LockUnlock WHERE LockUnlockID={keys[0]} "; var data = DBServerProvider.SqlDapper.QueryDynamicFirst(bql, ""); if (data.MeterID == null) { return webResponse.Error("无仪表信息!"); } if (data.ReqType == null) { return webResponse.Error("开关类型为空!"); } if (data.WorkDate == null) { return webResponse.Error("施工日期为空!"); } //更新到仪表信息表 ST_CodeMeter string cql = $@"UPDATE ST_CodeMeter SET ValveState='{data.ReqType}',LockunlockDate='{data.WorkDate}' WHERE MeterID={data.MeterID}"; repository.ExecuteSqlCommand(cql); } } //审批流程回退功能,回到第一个审批人重新审批(重新生成审批流程) //if (status==AuditStatus.审核未通过||status==AuditStatus.驳回) //{ // base.RewriteFlow(order); //} return webResponse.OK(); }; return base.Audit(keys, auditStatus, auditReason); }
标签:status,return,框架,VOL,lastAudit,事务处理,ST,审批,data From: https://www.cnblogs.com/wishit/p/18053604