/// <summary> /// 自动完成任务 /// </summary> /// <param name="inn"></param> /// <param name="id"></param> /// <param name="ChoicePath"></param> public void AutomaticCompletionTask(Innovator inn, string id, decimal totalAmount, bool b_IsBudgetary, string b_Type, string lineLeader, string departmentLeader, ref WORKFLOW_PROCESS_PATH ChoicePath) { //获取当前活动 Item activityItem = ActivityDA.GetActivityByItemId(inn, id, "innovator.b_ExpenseReimbursement"); if (!activityItem.isError() && activityItem.getItemCount() > 0) { string activityId = activityItem.getItemByIndex(0).getProperty("activityid"); string keyedName = activityItem.getItemByIndex(0).getProperty("keyed_name"); //获取当前任务的操作权限 bool isOperate = false; Item identitys = IdentityDA.GetIdentityByActivityId(inn, activityId); if (!identitys.isError() && identitys.getItemCount() == 1) { isOperate = true; } if (isOperate) { string lineName = GetLineNameByActivityName(inn, activityId, keyedName, totalAmount, b_IsBudgetary); WORKFLOW_PROCESS_PATH newChoicePath = WorkFlowBll.AutoCompleteActivityByParam(id, "innovator.b_ExpenseReimbursement", lineName); if (newChoicePath != null) { ChoicePath = newChoicePath; AutomaticCompletionTask(inn, id, totalAmount, b_IsBudgetary, b_Type, lineLeader, departmentLeader, ref ChoicePath); } } } }
/// <summary> /// 自动完成任务 /// </summary> /// <param name="inn"></param> /// <param name="id"></param> /// <param name="ChoicePath"></param> public void AutomaticCompletionTask(Innovator inn, string id, string b_PrType, string versionNo, ref WORKFLOW_PROCESS_PATH ChoicePath) { //获取当前活动 Item activityItem = ActivityDA.GetActivityByItemId(inn, id, "innovator.B_PRMANAGE"); if (!activityItem.isError() && activityItem.getItemCount() > 0) { string activityId = activityItem.getItemByIndex(0).getProperty("activityid"); string keyedName = activityItem.getItemByIndex(0).getProperty("keyed_name"); //获取当前任务的操作权限 bool isOperate = false; Item identitys = IdentityDA.GetIdentityByActivityId(inn, activityId); if (!identitys.isError() && identitys.getItemCount() == 1) { isOperate = true; } if (isOperate) { string lineName = GetLineNameByActivityName(inn, id, activityId, keyedName, b_PrType, versionNo); WORKFLOW_PROCESS_PATH newChoicePath = WorkFlowBll.AutoCompleteActivityByParam(id, "innovator.B_PRMANAGE", lineName); if (newChoicePath != null) { ChoicePath = newChoicePath; AutomaticCompletionTask(inn, id, b_PrType, versionNo, ref ChoicePath); } } } }
/// <summary> /// 自动完成任务 /// </summary> public static void AutomaticCompletionTask(Innovator inn, string id, UserInfo userInfo, ref WORKFLOW_PROCESS_PATH ChoicePath) { Item activityItem = ActivityDA.GetActivityByItemId(inn, id, "innovator.B_PRMANAGE"); if (!activityItem.isError() && activityItem.getItemCount() > 0) { string activityId = activityItem.getItemByIndex(0).getProperty("activityid"); string keyedName = activityItem.getItemByIndex(0).getProperty("keyed_name"); //获取当前任务的操作权限 bool isOperate = false; Item identitys = IdentityDA.GetIdentityByActivityId(inn, activityId); if (!identitys.isError() && identitys.getItemCount() > 0) { for (int i = 0; i < identitys.getItemCount(); i++) { string dentityId = identitys.getItemByIndex(i).getProperty("id"); if (userInfo.Roles.Contains(dentityId)) { isOperate = true; } } } if ((keyedName == "Dept.Director" || keyedName == "Dept.VP" || keyedName == "GM" || keyedName == "PMT/PAT Leader" || keyedName == "Project Manager" || keyedName == "Project Director") && isOperate) { WORKFLOW_PROCESS_PATH newChoicePath = WorkFlowBll.AutoCompleteActivityByParam(id, "innovator.B_PRMANAGE"); if (newChoicePath != null) { ChoicePath = newChoicePath; AutomaticCompletionTask(inn, id, userInfo, ref ChoicePath); } } } }
public static void AddBusinessTraveAudit(Innovator inn, string id, string region, string B_CENTRE, bool isAdministrativeSupport, string b_TripType) { //删除财务分析员 List <string> activitys = new List <string> { "Administrative approval", "GM" }; ActivityBll.DeleteActivityAuthById(inn, id, "innovator.b_BusinessTravel", activitys); if (b_TripType == "International") { //添加CEO审核 if (B_CENTRE == "盛和") { WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "GMSH", "", "GM", "innovator.b_BusinessTravel"); } else if (B_CENTRE == "骏盛") { WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "GMJS", "", "GM", "innovator.b_BusinessTravel"); } else { WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "CEO", "", "GM", "innovator.b_BusinessTravel"); } } if (isAdministrativeSupport) { //行政人员 WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "行政人员(" + region + ")", region, "Administrative approval", "innovator.b_BusinessTravel"); } }
/// <summary> /// 添加审核权限 /// </summary> /// <param name="inn"></param> /// <param name="id"></param> /// <param name="region"></param> public static void AddTripReimbursementAudit(Innovator inn, string id, string region, List <string> analysisAuditStr, List <string> accountAuditStr, string B_CENTRE) { List <string> activityids = new List <string> { "Financial Analyst", "Expense Accountant Check", "GM", "Financial Director", "Expense Accountant Creation" }; ActivityBll.DeleteActivityAuthById(inn, id, "innovator.b_TripReimbursementForm", activityids); //添加财务员审批 ActivityBll.AddActivityAudit(inn, id, "Financial Analyst", "innovator.b_TripReimbursementForm", analysisAuditStr); if (B_CENTRE.Trim() == "盛和") { WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "GMSH", "", "GM", "innovator.b_TripReimbursementForm"); } else if (B_CENTRE.Trim() == "骏盛") { WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "GMJS", "", "GM", "innovator.b_TripReimbursementForm"); } else { //添加CEO审批 WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "CEO", "", "GM", "innovator.b_TripReimbursementForm"); } //费用会计审核 ActivityBll.AddActivityAudit(inn, id, "Expense Accountant Check", "innovator.b_TripReimbursementForm", accountAuditStr); //财务总监 WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "财务总监(" + region + ")", region, "Financial Director", "innovator.b_TripReimbursementForm"); //费用会计制证 ActivityBll.AddActivityAudit(inn, id, "Expense Accountant Creation", "innovator.b_TripReimbursementForm", accountAuditStr); }
/// <summary> /// 挂起自动完成审核 /// </summary> /// <param name="inn"></param> /// <param name="id">数据ID</param> /// <param name="b_HangUpActivityName">挂起所在的流程节点</param> /// <param name="b_TotalAmount">总费用</param> /// <param name="b_IsBudgetary">是否在预算内</param> /// <param name="b_Type">项目类型</param> /// <param name="choicePath">选择的路线</param> public static void HangUpAutoAudit(Innovator inn, string id, string b_HangUpActivityName, decimal b_TotalAmount, bool b_IsBudgetary, string b_Type, string departmentLeader, ref WORKFLOW_PROCESS_PATH choicePath) { //获取当前活动 Item activityItem = ActivityDA.GetActivityByItemId(inn, id, "innovator.b_ExpenseReimbursement"); //获取当前活动的流程名称 string activityId = activityItem.getItemByIndex(0).getProperty("activityid"); string keyedName = activityItem.getItemByIndex(0).getProperty("keyed_name"); //当前流程节点的名称,不等于挂机的流程名称时,执行自动完成! if (b_HangUpActivityName != keyedName) { string lineName = GetLineNameByActivityName(inn, activityId, keyedName, b_TotalAmount, b_IsBudgetary); choicePath = WorkFlowBll.AutoCompleteActivityByParam(id, "innovator.b_ExpenseReimbursement", lineName); HangUpAutoAudit(inn, id, b_HangUpActivityName, b_TotalAmount, b_IsBudgetary, b_Type, departmentLeader, ref choicePath); } }
/// <summary> /// 挂起自动完成审核 /// </summary> /// <param name="inn"></param> /// <param name="id"></param> /// <param name="b_HangUpActivityName"></param> /// <param name="b_TripType"></param> /// <param name="b_Type"></param> /// <param name="b_Director"></param> /// <param name="choicePath"></param> public static void HangUpAutoAudit(Innovator inn, string id, string b_HangUpActivityName, ref WORKFLOW_PROCESS_PATH choicePath) { //获取当前活动 Item activityItem = ActivityDA.GetActivityByItemId(inn, id, "innovator.b_BusinessTravel"); //获取当前活动的流程名称 string activityId = activityItem.getItemByIndex(0).getProperty("activityid"); string keyedName = activityItem.getItemByIndex(0).getProperty("keyed_name"); //当前流程节点的名称,不等于挂机的流程名称时,执行自动完成! if (b_HangUpActivityName != keyedName) { string lineName = GetLineNameByActivityName(inn, keyedName); choicePath = WorkFlowBll.AutoCompleteActivityByParam(id, "innovator.b_BusinessTravel", lineName); HangUpAutoAudit(inn, id, b_HangUpActivityName, ref choicePath); } }
/// <summary> /// 添加审核权限 /// </summary> public static void AddExpenseReimbursementAudit(Innovator inn, string id, string region, List <string> analysisAuditStr, List <string> accountAuditStr, string B_CENTRE) { //删除财务分析员 List <string> activitys = new List <string> { "Financial Analyst", "Expense Accountant Check", "GM", "Financial Director", "Expense Accountant Creation" }; ActivityBll.DeleteActivityAuthById(inn, id, "innovator.b_ExpenseReimbursement", activitys); //添加财务员审批 //WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "财务分析员(" + region + ")", region, "Financial Analyst", "innovator.b_ExpenseReimbursement"); ActivityBll.AddActivityAudit(inn, id, "Financial Analyst", "innovator.b_ExpenseReimbursement", analysisAuditStr); //添加CEO审核 if (B_CENTRE == "盛和") { WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "GMSH", "", "GM", "innovator.b_ExpenseReimbursement"); } else if (B_CENTRE == "骏盛") { WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "GMJS", "", "GM", "innovator.b_ExpenseReimbursement"); } else { WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "CEO", "", "GM", "innovator.b_ExpenseReimbursement"); } //费用会计审核 //WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "费用会计(" + region + ")", region, "Expense Accountant Check", "innovator.b_ExpenseReimbursement"); ActivityBll.AddActivityAudit(inn, id, "Expense Accountant Check", "innovator.b_ExpenseReimbursement", accountAuditStr); //财务总监 WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "财务总监(" + region + ")", region, "Financial Director", "innovator.b_ExpenseReimbursement"); //费用会计制证 //WorkFlowBll.AddWorkFlowRoleAuditByRegion(inn, id, "费用会计(" + region + ")", region, "Expense Accountant Creation", "innovator.b_ExpenseReimbursement"); ActivityBll.AddActivityAudit(inn, id, "Expense Accountant Creation", "innovator.b_ExpenseReimbursement", accountAuditStr); }