Ejemplo n.º 1
0
        public OperationReturn GetRealPassword(RecordEncryptInfo encryptInfo)
        {
            OperationReturn optReturn = new OperationReturn();

            optReturn.Result = true;
            optReturn.Code   = 0;
            try
            {
                if (Session == null)
                {
                    optReturn.Result  = false;
                    optReturn.Code    = RET_NO_SESSION;
                    optReturn.Message = string.Format("SessionInfo is null");
                    return(optReturn);
                }
                if (mRecordInfo == null)
                {
                    optReturn.Result  = false;
                    optReturn.Code    = RET_NO_RECORDINFO;
                    optReturn.Message = string.Format("RecordInfo is null");
                    return(optReturn);
                }
                if (encryptInfo == null)
                {
                    optReturn.Result  = false;
                    optReturn.Code    = Defines.RET_OBJECT_NULL;
                    optReturn.Message = string.Format("EncryptInfo is null");
                    return(optReturn);
                }
                //新密钥解老密钥
                List <string> listArgs = new List <string>();
                listArgs.Add("1");                                                                          //对象类型:1
                listArgs.Add(encryptInfo.ServerAddress);                                                    //加密对象:录音服务器的IP地址或机器名
                listArgs.Add(mRecordInfo.SerialID.ToString());                                              //录音流水号:C002
                listArgs.Add(mRecordInfo.StartRecordTime.ToString("yyyy-MM-dd HH:mm:ss"));                  //录音开始时间
                listArgs.Add(encryptInfo.EndTime.ToString("yyyy-MM-dd HH:mm:ss"));                          //密钥截至时间
                listArgs.Add(encryptInfo.Password);                                                         //新密钥
                listArgs.Add(string.Empty);                                                                 //无
                Service06ServerInfo server = new Service06ServerInfo();
                server.Host = Session.AppServerInfo.Address;
                server.Port = Session.AppServerInfo.SupportHttps
                    ? Session.AppServerInfo.Port - 7
                    : Session.AppServerInfo.Port - 6;
                OnDebug("GetRealPass", string.Format("Getting real password.\t{0}", encryptInfo.ServerAddress));
                optReturn = Service06Helper.DoOperation(server, Service06Command.GET_PASS, listArgs);
                if (!optReturn.Result)
                {
                    return(optReturn);
                }
                string   strReturn  = optReturn.Data.ToString();
                string[] listReturn = strReturn.Split(new[] { ConstValue.SPLITER_CHAR }, StringSplitOptions.None);
                if (listReturn.Length <= 0)
                {
                    optReturn.Result  = false;
                    optReturn.Code    = Defines.RET_PARAM_INVALID;
                    optReturn.Message = string.Format("Return value length invalid");
                    return(optReturn);
                }
                string strError = listReturn[0];
                strError = S3103App.DecryptString(strError);
                if (strError.StartsWith("ERROR"))
                {
                    optReturn.Result  = false;
                    optReturn.Code    = RET_GET_REAL_PASSWORD_FAIL;
                    optReturn.Message = string.Format("Get real password fail.\t{0}", strError);
                    return(optReturn);
                }
                string strKey1B = string.Empty;
                if (listReturn.Length > 2)
                {
                    strKey1B = listReturn[2];
                }
                strKey1B = S3103App.DecryptString(strKey1B);
                encryptInfo.RealPassword = strKey1B;
                OnDebug("GetRealPass",
                        string.Format("Get real password end.\t{0}", S3103App.EncryptString(strKey1B)));
            }
            catch (Exception ex)
            {
                optReturn.Result    = false;
                optReturn.Code      = Defines.RET_FAIL;
                optReturn.Message   = ex.Message;
                optReturn.Exception = ex;
            }
            return(optReturn);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 加载当前任务的任务详情
        /// </summary>
        public void InitTaskDetail()
        {
            try
            {
                try
                {
                    ListCurrentTaskDetail.Clear();
                }
                catch { }
                string isSeptable = "0";//0:不分表  1:分表
                var    tableInfo  =
                    CurrentApp.Session.ListPartitionTables.FirstOrDefault(
                        t => t.TableName == ConstValue.TABLE_NAME_RECORD && t.PartType == TablePartType.DatetimeRange);
                if (tableInfo != null)
                {
                    isSeptable = "1";
                }
                string tempStr = string.Empty;
                //判斷當前任務類型
                if (SelectTask.TaskType == 1 || SelectTask.TaskType == 2)
                {
                    tempStr = string.Format("T08.C010='3' OR T08.C010='4'");
                }
                if (SelectTask.TaskType == 3 || SelectTask.TaskType == 4)
                {
                    tempStr = string.Format("T08.C010='5' OR T08.C010='6'");
                }

                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S3103Codes.GetTaskRecordByTaskID;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(SelectTask.TaskID.ToString());
                webRequest.ListData.Add(SelectTask.TaskName);
                webRequest.ListData.Add(isSeptable);
                webRequest.ListData.Add(tempStr);//任務類型
                //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;
                }
                if (webReturn.ListData.Count > 0)
                {
                    for (int i = 0; i < webReturn.ListData.Count; i++)
                    {
                        OperationReturn optReturn = XMLHelper.DeserializeObject <TaskInfoDetail>(webReturn.ListData[i]);
                        if (!optReturn.Result)
                        {
                            ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                            return;
                        }
                        TaskInfoDetail taskdetail = optReturn.Data as TaskInfoDetail;
                        if (taskdetail != null && !ListCurrentTaskDetail.Contains(taskdetail))
                        {
                            //AllotTypeName:1任务分配过来,2从其它任务移动过来的 3推荐录音 4申诉审批到复检
                            taskdetail.AllotTypeName = GetAllotTypeName(taskdetail.AllotType);
                            taskdetail.IsLock        = taskdetail.IsLock == "Y" ? CurrentApp.GetLanguageInfo("3103T00022", "Yes") : CurrentApp.GetLanguageInfo("3103T00023", "No");
                            taskdetail.strDirection  = taskdetail.Direction == 1 ? CurrentApp.GetLanguageInfo("3103T00089", "Call In") : CurrentApp.GetLanguageInfo("3103T00090", "Call Out");
                            taskdetail.CalledID      = S3103App.DecryptString(taskdetail.CalledID);
                            taskdetail.CallerID      = S3103App.DecryptString(taskdetail.CallerID);
                            if (string.IsNullOrWhiteSpace(taskdetail.AgtOrExtID))
                            {
                                taskdetail.AgtOrExtID = AgentAndUserFullName(taskdetail.AgtOrExtName, 1);
                            }
                            taskdetail.AgentFullName = AgentAndUserFullName(taskdetail.AgtOrExtID, 0);
                            ListCurrentTaskDetail.Add(taskdetail);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }