void BtnConfirm_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(txbTaskName.Text.ToString())) { ShowInformation(CurrentApp.GetLanguageInfo("3105T00122", "Task Infomation Is Full.")); return; } List <CtrolQA> lstControlQaTemp = new List <CtrolQA>(); GetQAIsCheck(ref lstControlQaTemp); if (lstControlQaTemp.Count == 0) { ShowInformation(CurrentApp.GetLanguageInfo("3105T00123", "Please Select a QA")); return; } UserTasksInfoShow userTaskInfoShow = new UserTasksInfoShow(); userTaskInfoShow.TaskName = txbTaskName.Text.ToString(); userTaskInfoShow.TaskType = 3; // 分配任务类型复检手动任务 userTaskInfoShow.IsShare = "N"; userTaskInfoShow.AssignTime = DateTime.Now.ToUniversalTime().ToString("yyyy/MM/dd HH:mm"); userTaskInfoShow.AssignUser = CurrentApp.Session.UserInfo.UserID; userTaskInfoShow.AssignUserFName = CurrentApp.Session.UserInfo.UserName; userTaskInfoShow.BelongYear = (int)cmbYear.SelectedValue; userTaskInfoShow.BelongMonth = (int)cmbMonth.SelectedValue; if (DateDeadLineTime.Value == null) { ShowInformation(CurrentApp.GetLanguageInfo("3105T00124", "Expired Time can not be null.")); return; } userTaskInfoShow.DealLine = DateTime.Parse(DateDeadLineTime.Value.ToString()).ToUniversalTime().ToString("yyyy/MM/dd HH:mm"); //查询这条录音的录音信息 if (!GetRecordInfoByRef(SelCheckData.RecoredReference)) { return; } List <RecordInfoItem> lstRecordInfoItem = new List <RecordInfoItem>(); lstRecordInfoItem.Add(mListCurrentRecord); //分配到任务 SaveTask(userTaskInfoShow, lstControlQaTemp, lstRecordInfoItem); //更改申诉表信息 string error = PrePage.UpdateReCheckData("8", AppealFlowItemID, SelCheckData); if (!string.IsNullOrEmpty(error)) { ShowException(error); } else { ShowInformation(CurrentApp.GetLanguageInfo("3105T00022", "Operation Succeed.")); PrePage.UpdateTable19("8"); ParentPage.ApprovalHistory(); ParentPage.BindData(); ParentPage.ShowProcessReCheck(false); #region 写操作日志 string strLog = string.Format("{0} {1}", Utils.FormatOptLogString("3105T00001"), SelCheckData.RecoredReference); CurrentApp.WriteOperationLog(S3105Consts.OPT_Approval.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog); #endregion } }
void BtnConfirm_Click(object sender, RoutedEventArgs e) { ColAlias.UserTasksInfoShow currentTask = (ColAlias.UserTasksInfoShow)LvDoubleTaskData.SelectedItem; if (currentTask == null) { ShowInformation(CurrentApp.GetLanguageInfo("3105T000145", "No Task Is Select")); return; } //查询这条录音的录音信息 if (!GetRecordInfoByRef(SelCheckData.RecoredReference)) { return; } List <RecordInfoItem> lstRecordInfoItem = new List <RecordInfoItem>(); lstRecordInfoItem.Add(mListCurrentRecord); currentTask.TaskAllRecordLength = currentTask.TaskAllRecordLength + mListCurrentRecord.Duration; currentTask.AssignNum = currentTask.AssignNum + 1; try { //先更新表T_31_020_TaskList //提交任务 WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)ColAlias.S3103Codes.UpdateTask; OperationReturn optReturn = XMLHelper.SeriallizeObject(currentTask); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } webRequest.Data = optReturn.Data.ToString(); string strrecords = ""; //Service31031Client client = new Service31031Client(); Service31031Client client = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031")); //WebHelper.SetServiceClient(client); WebReturn webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } else { //再更新表T_31_022_TaskListMappingRecord webReturn = new WebReturn(); webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)ColAlias.S3103Codes.SaveTaskRecord; ColAlias::TaskInfoDetail taskinfodetail; foreach (RecordInfoItem record in lstRecordInfoItem) { strrecords += record.SerialID + ","; taskinfodetail = new ColAlias:: TaskInfoDetail(); taskinfodetail.TaskID = currentTask.TaskID; taskinfodetail.RecoredReference = record.SerialID; taskinfodetail.IsLock = "N"; taskinfodetail.AllotType = 4; //对应T_31_022表的C006 4表示录音是从审批通过分配到任务中的录音 taskinfodetail.FromTaskID = -1; taskinfodetail.TaskType = "3"; //对应T-31_022表的C010 taskinfodetail.StartRecordTime = Convert.ToDateTime(record.StartRecordTime).ToUniversalTime(); taskinfodetail.Duration = record.Duration.ToString(); taskinfodetail.Extension = record.Extension; taskinfodetail.CalledID = record.CalledID; taskinfodetail.CallerID = record.CallerID; taskinfodetail.Direction = int.Parse(record.Direction); List <CtrolAgent> templst = new List <CtrolAgent>(); //if (S3103App.GroupingWay.Contains("A")) //以后这个工程加了分组方式后再启用 //{ // templst = S3103App.ListCtrolAgentInfos.Where(p => p.AgentName == record.ReAgent).ToList(); //} //else if (S3103App.GroupingWay.Contains("R")) //{ // templst = S3103App.ListCtrolRealityExtension.Where(p => p.AgentName == record.ReAgent).ToList(); //} //else if (S3103App.GroupingWay.Contains("E")) //{ // templst = S3103App.ListCtrolExtension.Where(p => p.AgentName == record.ReAgent).ToList(); //} //if (templst.Count() > 0) //{ // taskinfodetail.AgtOrExtID = templst[0].AgentID; // taskinfodetail.AgtOrExtName = templst[0].AgentName; //} //else //{ // taskinfodetail.AgtOrExtID = ""; // taskinfodetail.AgtOrExtName = ""; //} templst = S3105App.ListCtrolAgentInfos.Where(p => p.AgentName == record.Agent).ToList(); optReturn = XMLHelper.SeriallizeObject(taskinfodetail); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } webRequest.ListData.Add(optReturn.Data.ToString()); } webRequest.Data = currentTask.TaskID.ToString(); //client = new Service31031Client(); client = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031")); //WebHelper.SetServiceClient(client); webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } //将任务号更新到录音表 var tableInfo = CurrentApp.Session.ListPartitionTables.FirstOrDefault( t => t.TableName == ConstValue.TABLE_NAME_RECORD && t.PartType == VoiceCyber.UMP.Common.TablePartType.DatetimeRange); if (tableInfo == null) { string tableName = ConstValue.TABLE_NAME_RECORD; foreach (RecordInfoItem r in lstRecordInfoItem) { webReturn = new WebReturn(); webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)ColAlias::S3103Codes.UpdateTaskID2Record; webRequest.ListData.Add(currentTask.TaskID.ToString()); webRequest.ListData.Add(tableName); webRequest.ListData.Add("2");//1 初检任务 2复检 webRequest.ListData.Add(r.SerialID.ToString()); //client = new Service31031Client(); client = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031")); //WebHelper.SetServiceClient(client); webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } } } else { string tableName = string.Empty; foreach (RecordInfoItem r in lstRecordInfoItem) { webReturn = new WebReturn(); webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)ColAlias::S3103Codes.UpdateTaskID2Record; webRequest.ListData.Add(currentTask.TaskID.ToString()); tableName = ReturnTableName(Convert.ToDateTime(r.StartRecordTime)); webRequest.ListData.Add(tableName); webRequest.ListData.Add("2");//1 初检任务 2复检 webRequest.ListData.Add(r.SerialID.ToString()); //client = new Service31031Client(); client = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031")); //WebHelper.SetServiceClient(client); webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } } } } } catch (Exception ex) { CurrentApp.WriteOperationLog(ColAlias.S3103Consts.OPT_DoubleTaskAssign.ToString(), ConstValue.OPT_RESULT_FAIL, ""); ShowException(ex.Message); } //更改申诉表信息 string error = PrePage.UpdateReCheckData("8", AppealFlowItemID, SelCheckData); if (!string.IsNullOrEmpty(error)) { ShowException(error); } else { ShowInformation(CurrentApp.GetLanguageInfo("3105T00022", "Operation Succeed.")); PrePage.UpdateTable19("8"); ParentPage.ApprovalHistory(); ParentPage.BindData(); ParentPage.ShowProcessReCheck(false); #region 写操作日志 string strLog = string.Format("{0} {1}", Utils.FormatOptLogString("3105T00001"), SelCheckData.RecoredReference); CurrentApp.WriteOperationLog(S3105Consts.OPT_Approval.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog); #endregion } }