/// <summary> /// 开始考试 生成考试号 服务端 /// </summary> private bool BeginExamApi() { var ml = new BeginExamModel() { exam_id = GlobalUser.SelectPaperNumber.Split('#')[0] }; var result1 = WebProxy(ml, ApiType.BeginExam, GlobalUser.USER.Token); if (result1.retCode == 4001 && result1.retMsg.ToLower().Contains("token")) { //回到登录 GlobalUser.CleanUp(); Messenger.Default.Send(new ExamScoreNavigateMessage(), "LoginFailure"); return(false); } if (result1.retCode == 40400) { Messenger.Default.Send(new MainDialogMessage(result1.retMsg), "MainMessageDialog"); return(false); } GlobalUser.AttendPaperItemId = result1.retData.exam_attend_id; GlobalUser.SelectExamAttendResult = ""; return(true); }
public void BeginExam(BeginExamModel data) { var proxy = new WorkflowProxy(); string processName = data.ProcessName; //获取下一步的NodeName,用于获取该Node对应的Team和用户列表 string nodeName = proxy.GetFirstNodeName(processName); //获取node对应的用户 List <User> users = teamRepo.GetAllUsersByNodeName(processName, nodeName); foreach (User user in users) { var processInstance = new ProcessInstance { ProcessName = processName, Actor = user.UserID, ActorName = user.UserName }; var taskUser = new TaskUser(); taskUser.UserId = user.UserID; taskUser.UserName = user.UserName; taskUser.UserRole = "Student"; processInstance.IncludeActors.Add(taskUser); processInstance = proxy.CreateProcessInstance(processInstance); LogHelper.Instanse.WriteInfo( string.Format("发起流程,用户-{0},InstanceID-{1}", taskUser.UserId, processInstance.InstanceID)); } }
/// <summary> /// 开始考试 /// </summary> private void BeginExamApi() { var ml = new BeginExamModel() { exam_id = GlobalUser.SelectPaperNumber.Split('#')[0] }; var result1 = WebProxy(ml, ApiType.BeginExam, GlobalUser.USER.Token); GlobalUser.AttendPaperItemId = result1.retData.exam_attend_id; GlobalUser.SelectExamAttendResult = ""; }
public ApiResponse InitExam([FromBody] InitExamModel data) { taskService.InitExam(data); BeginExamModel begin = new BeginExamModel() { ProcessName = data.ProcessName, UserId = data.User.UserID, UserName = data.User.UserName }; taskService.BeginExam(begin); return(ApiOk()); }
public ApiResponse BeginExam([FromBody] BeginExamModel data) { taskService.BeginExam(data); return(ApiOk()); }