/// <summary> /// 根据类型类型,调取对应的服务 /// </summary> /// <param name="dto"></param> /// <returns></returns> public BaseAuditService CreateAuditService(AuditCallbackRequest dto) { var bussinessType = int.Parse(dto.BussinessCode); BaseAuditService service = null; long auditId = long.Parse(dto.ApplyNumber); switch (bussinessType) { case (int)AuditBusinessType.Term: //学期审核服务 service = TermAuditService.CreateByAutitId(auditId); break; case (int)AuditBusinessType.TermCourseTimetable: //排课审核服务 service = TermCourseTimetableAuditService.CreateByAutitId(auditId); break; case (int)AuditBusinessType.ScholarshipGive: service = CouponRuleAuditService.CreateByAutitId(auditId); break; default: break; } if (service == null) //审核单据类型不存在 { throw new BussinessException((byte)ModelType.Audit, 13); } if (service.TblAutAudit.BizType != bussinessType) //审核单据类型不一致 { throw new BussinessException((byte)ModelType.Audit, 14); } return(service); }
public void Post(AuditCallbackRequest dto) { //业务类型 var auditService = AuditFlowFactory.Instance.CreateAuditService(dto); auditService.AuditComplete(dto); }
/// <summary> /// 描述:保存审批信息 /// <para>作 者:瞿琦</para> /// <para>创建时间:2018.09.21</para> /// </summary> /// <param name="dto">审核信息</param> /// <returns>无</returns> private void SaveAuditComplete(AuditCallbackRequest dto) { this.TblAutAudit.AuditStatus = (int)dto.Status; this.TblAutAudit.AuditUserId = dto.AuditUserId; this.TblAutAudit.AuditUserName = dto.AuditUserName; this.TblAutAudit.AuditDate = dto.AuditTime; this.TblAutAudit.UpdateTime = DateTime.Now; this.TblAutAudit.DataExt = dto.Remark; this._tblAutAuditRepository.Update(this.TblAutAudit); }
/// <summary> ///描述: 审核完成调取方法,写入数据到正式表 ///<para>作 者:瞿琦</para> ///<para>创建时间:2018.09.21</para> /// </summary> /// <param name="dto">审核信息</param> /// <returns>无</returns> public virtual void AuditComplete(AuditCallbackRequest dto) { //1.验证是否已经提交 this.ValidateAuditComplete(); //2.保存审核信息 this.SaveAuditComplete(dto); if (dto.Status == AuditStatus.Success) { ProcessAuditSuccess(); } else if (dto.Status == AuditStatus.Return) { ProcessAuditReturn(dto); } }
/// <summary> /// 描述:退回提交人 (没有特殊业务要求,暂不实现该方法) /// <para>作 者:瞿琦</para> /// <para>创建时间:2018.9.19</para> /// </summary> public override void ProcessAuditReturn(AuditCallbackRequest dto) { }
/// <summary> /// 描述:退回提交人 /// <para>作 者:瞿琦</para> /// <para>创建时间:2018.09.21</para> /// </summary> public abstract void ProcessAuditReturn(AuditCallbackRequest dto);