public string GetAppvalProcAndOperator([FromUri] GAppvalRecordModel recordModel) { if (recordModel == null || recordModel.ProcPhid == 0) { return(DCHelper.ErrorMessage("审批流程id为空!")); } if (recordModel.PostPhid == 0) { return(DCHelper.ErrorMessage("审批岗位id为空!")); } try { //根据审批流程id查找审批流程 GAppvalProcModel procModel = GAppvalProcService.FindSingle(recordModel.ProcPhid); //根据审批流程id,当前岗位的id,查找下一岗位的审批人 GAppvalPostModel postModel = GAppvalPostService.GetNextStepOperator(procModel.PhId, recordModel.PostPhid, recordModel.RefbillPhid, recordModel.FBilltype); return(DataConverterHelper.SerializeObject(new { Status = "success", Process = procModel, AppvalPost = postModel })); } catch (Exception e) { return(DCHelper.ErrorMessage(e.Message)); } }
public string GetBackApprovalPost([FromUri] GAppvalRecordModel recordModel) { if (recordModel == null || recordModel.ProcPhid == 0) { return(DCHelper.ErrorMessage("审批流程id为空!")); } if (recordModel.PostPhid == 0) { return(DCHelper.ErrorMessage("审批岗位id为空!")); } try { List <GAppvalPostModel> postModels = GAppvalPostService.GetBackApprovalPost(recordModel); if (postModels != null && postModels.Count > 0) { foreach (var post in postModels) { post.IsSpanBack = 0; } } //如果是跨审批流回退,打上标记 if (recordModel.IsSpanBack == 1) { IList <GAppvalRecordModel> recordList = new List <GAppvalRecordModel>(); recordList = this.GAppvalRecordService.Find(t => t.RefbillPhid == recordModel.RefbillPhid && t.FBilltype == BillType.BeginProject).Data; if (recordList != null && recordList.Count > 0) { var procPhid = recordList.ToList().OrderByDescending(t => t.FSendDate).ToList()[0].ProcPhid; List <GAppvalPostModel> postModels2 = GAppvalPostService.GetBackApprovalPost2(recordModel.RefbillPhid, procPhid); if (postModels2 != null && postModels2.Count > 0) { foreach (var post in postModels2) { post.IsSpanBack = 1; post.BackProcPhid = procPhid; } } postModels2.AddRange(postModels); postModels = postModels2; } } return(DataConverterHelper.SerializeObject(new { Status = "success", Data = postModels })); } catch (Exception e) { return(DCHelper.ErrorMessage(e.Message)); } }
public string GetApprovalPost([FromUri] GAppvalRecordModel recordModel) { if (recordModel == null || recordModel.ProcPhid == 0) { return(DCHelper.ErrorMessage("流程id为空!")); } try { List <GAppvalPostModel> postModels = GAppvalPostService.GetApprovalPost(recordModel.ProcPhid); return(DataConverterHelper.SerializeObject(new { Status = "success", Data = postModels })); } catch (Exception e) { return(DCHelper.ErrorMessage(e.Message)); } }
public string GetFirstStepOperator([FromUri] GAppvalProcModel procModel) { if (procModel == null || procModel.PhId == 0) { return(DCHelper.ErrorMessage("单据ID为空!")); } try { GAppvalPostModel postModel = GAppvalPostService.GetFirstStepOperator(procModel.PhId); return(DataConverterHelper.SerializeObject(new { Status = "success", Data = postModel })); } catch (Exception e) { return(DCHelper.ErrorMessage(e.Message)); } }
public string GetOperators([FromUri] GAppvalRecordModel recordModel) { if (recordModel == null) { return(DCHelper.ErrorMessage("请求参数为空!")); } try { List <GAppvalPost4OperModel> operModels = GAppvalPostService.GetOperators(recordModel); return(DataConverterHelper.SerializeObject(new { Status = "success", Data = operModels })); } catch (Exception e) { return(DCHelper.ErrorMessage(e.Message)); } }