/// <summary> /// 审核流程的建立 /// </summary> /// <param name="dfv">要发起审核流程的文件信息</param> /// <param name="userNo">用户名</param> /// <returns>处理结果</returns> public string CreateApprove(ModelView.DmsFileView dfv, string userNo) { if (dfv == null) { return("文件不存在!"); } //获取第一个审核流程视图 ApoItemCtrl aic = new ApoItemCtrl(); ModelView.ApoItemView aiv = aic.GetFirst(dfv.file_type_name); if (aiv == null) { return("未找到审核流程!"); } //获取下一个审核流程视图 ModelView.ApoItemView aivNext = aic.GetNext(aiv.apo_no, aiv.apo_item_no); if (aivNext == null) { return("该审核流程有误!"); } //用户构建 GlobalDataCtrl gdc = new GlobalDataCtrl(); string userName = gdc.GetStrByField("user_name", "sys_user", "user_no", userNo); //文件视图及审核流程视图创建Act视图并处理 ModelView.ApoActView aav = new ModelView.ApoActView(); aav.id = string.Empty; aav.status_no = "310"; aav.status_name = "已确认"; aav.act_no = string.Empty; aav.apo_no = aiv.apo_no; aav.apo_item_no = aiv.apo_item_no; aav.apo_item_name = aiv.apo_item_name; aav.apo_index = aiv.apo_index; aav.next_item_no = aiv.next_item_no; aav.next_item_name = aivNext.apo_item_name; aav.next_user_name = aivNext.apo_user_name; aav.act_desc = dfv.file_desc; aav.act_result = "通过"; aav.act_step = "0"; aav.act_user_no = userNo; aav.act_user_name = userName; aav.act_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); aav.ralate_no = dfv.file_no; aav.ralate_file_name = dfv.file_name; aav.ralate_file_extension = dfv.file_extension; aav.ralate_type_no = dfv.file_type_no; aav.step_finished = "否"; aav.apo_finished = "否"; aav.dept_no = string.Empty; aav.dept_name = string.Empty; //数据写入 ApoActCtrl aac = new ApoActCtrl(); return(aac.Insert(aav) > 0 ? "success" : "数据写入失败!"); }
/// <summary> /// 结束当前审核流程 /// </summary> /// <param name="currentApoActView"></param> /// <returns></returns> public string FinishApprove(ModelView.ApoActView currentApoActView) { string msg = UpdateApprove(currentApoActView.ralate_no); if (msg == "success") { ApoActCtrl apoActCtrl = new ApoActCtrl(); msg = apoActCtrl.Insert(currentApoActView) > 0?"success":"结束流程数据写入失败!"; } return(msg); }
/// <summary> /// 写入并移动向下一审核流程 /// </summary> /// <param name="currentApoActView"></param> /// <returns></returns> private string Move2NextApprove(ModelView.ApoActView currentApoActView) { ApoActCtrl apoActCtrl = new ApoActCtrl(); return(apoActCtrl.Insert(currentApoActView) > 0 ? "success" : "审核通过数据写入失败!"); }