/// <summary> /// 20191212 增加返回 岗位串,对函数改造 /// </summary> /// <param name="procPredictionModel"></param> /// <returns></returns> private (string ApproveName, string ApproverPositions) GetApproveName(ProcPredictionModel procPredictionModel) { List <UserModel> userList = new List <UserModel>(); if (procPredictionModel.Approvers == null) { return(null, null); } foreach (ApproversGroupModel item in procPredictionModel.Approvers) { if (item.Users != null) { userList.AddRange(item.Users); } } HashSet <UserModel> list = new HashSet <UserModel>(); foreach (UserModel item in userList) { //不要加入重复审批人 if (list.FirstOrDefault(f => f.UserAccount == item.UserAccount && f.ActionName == item.ActionName) == null) { list.Add(item); } } return(string.Join(";", list.Select(r => r.UserDisplayName)), string.Join(";", list.Select(r => r.UserPositionName))); }
private List <UserModel> GetApproves(ProcPredictionModel procPredictionModel) { List <UserModel> userList = new List <UserModel>(); if (procPredictionModel.Approvers == null || procPredictionModel.Approvers.Count == 0) { return(userList); } foreach (ApproversGroupModel item in procPredictionModel.Approvers) { if (item.Users != null) { userList.AddRange(item.Users); } } HashSet <UserModel> list = new HashSet <UserModel>(); foreach (UserModel item in userList) { if (list.FirstOrDefault(f => f.UserAccount == item.UserAccount && f.ActionName == item.ActionName) == null) { list.Add(item); } } return(list.ToList()); }