Esempio n. 1
0
 private void GetInfoByTaskID()
 {
     Entities.OrderCRMStopCustTaskInfo model_task = BLL.OrderCRMStopCustTask.Instance.GetOrderCRMStopCustTask(TaskID);
     if (model_task != null)
     {
         Entities.StopCustApply model_cust = BLL.StopCustApply.Instance.GetStopCustApply((int)model_task.RelationID);
         if (model_cust != null)
         {
             DeleteMemberID = model_cust.DeleteMemberID;
             CustID         = model_cust.CustID;
         }
     }
 }
Esempio n. 2
0
        private string UpdateTask(string taskID)
        {
            string relationID = string.Empty;

            Entities.OrderCRMStopCustTaskInfo model_task = BLL.OrderCRMStopCustTask.Instance.GetOrderCRMStopCustTask(taskID);
            if (model_task != null)
            {
                //审核,已处理
                model_task.TaskStatus = (int)Entities.StopCustTaskStatus.Sumbit;//已提交
                model_task.SubmitTime = DateTime.Now;
                BLL.OrderCRMStopCustTask.Instance.Update(model_task);
                relationID = model_task.RelationID.ToString();
            }
            return(relationID);
        }
Esempio n. 3
0
        //type=1:审批通过;type=2:驳回
        public void OperDeal(int CRMStopCustApplyID, string taskID, int type, string reason, out string msg)
        {
            msg = "result:'false'";

            Entities.OrderCRMStopCustTaskInfo model_task = BLL.OrderCRMStopCustTask.Instance.GetOrderCRMStopCustTask(taskID);
            if (model_task == null)
            {
                msg = "result:'false',msg:'未找到该任务'";
                return;
            }

            if (model_task.AssignUserID_Value != BLL.Util.GetLoginUserID())
            {
                msg = "result:'false',msg:'该任务不属于您!'";
                return;
            }

            bool result = type == 1 ? BitAuto.YanFa.Crm2009.BLL.CustApply.Instance.ApprovePass(CRMStopCustApplyID, reason) :
                          BitAuto.YanFa.Crm2009.BLL.CustApply.Instance.ApproveRefuse(CRMStopCustApplyID, reason);

            BLL.Util.InsertUserLog("CRM客户停用任务ID=" + taskID + " 审核操作:" + (type == 1 ? "审核通过时" : "驳回时") + ",调用CRM接口,结果:" + (result == false ? "失败" : "成功"));

            if (result)
            {
                //审核,已处理
                string relationID = UpdateTask(taskID);

                if (relationID != string.Empty)
                {
                    int intRelationID;
                    if (int.TryParse(relationID, out intRelationID))
                    {
                        UpdateStopCustApply(type, intRelationID, reason, taskID.ToString());
                        //审核,已处理
                        InsertOperationLog(type, (int)Entities.StopCustTaskStatus.Sumbit, taskID, reason);
                        msg = "result:'true'";
                    }
                    else
                    {
                        msg = "result:'false',msg:'RelationID不能转换为int类型,导致更新客户停用状态不能执行'";
                    }
                }
            }
            else
            {
                msg = "result:'false',msg:'接口返回失败'";
            }
        }
Esempio n. 4
0
        public void RecedeTask(string TaskIDS, string AssignUserID, out string msg)
        {
            msg = "result:'false'";
            int userId = BLL.Util.GetLoginUserID();

            if (!BLL.Util.CheckRight(userId, "SYS024BUT130402"))  //增加“任务列表--客户核实”回收功能验证逻辑
            {
                msg = "result:'false',error:'没有回收权限'";
                return;
            }
            string error = string.Empty;

            if (TaskIDS == string.Empty)
            {
                msg = "result:'false',error:'任务ID串不能为空'";
                return;
            }

            #region ID列表串

            string taskIDStr = "";

            string[] tidList = TaskIDS.Split(',');

            foreach (string item in tidList)
            {
                taskIDStr += "'" + item + "',";
            }
            if (taskIDStr != "")
            {
                taskIDStr = taskIDStr.Substring(0, taskIDStr.Length - 1);
            }
            else
            {
                error += "请选择任务";
                return;
            }

            #endregion

            #region 判断任务状态

            //判断任务状态
            DataTable taskDt = BLL.OrderCRMStopCustTask.Instance.GetListByTaskIDs(taskIDStr);

            if (taskDt != null)
            {
                foreach (DataRow dr in taskDt.Rows)
                {
                    //所能回收的任务为: 未处理-2;处理中-3
                    if (dr["TaskStatus"].ToString() != "2" && dr["TaskStatus"].ToString() != "3")
                    {
                        error += "所选任务中,存在不允许回收的任务";
                        break;
                    }
                }
            }
            else
            {
                error += "没找到对应任务";
            }

            if (error != "")
            {
                msg = "result:'false',error:'" + error + "'";
                return;
            }
            #endregion

            DateTime dtime = DateTime.Now;
            foreach (string tid in tidList)
            {
                Entities.OrderCRMStopCustTaskInfo model = BLL.OrderCRMStopCustTask.Instance.GetOrderCRMStopCustTask(tid);
                //回收任务,未分配
                int oldAssignUserID = model.AssignUserID.GetValueOrDefault(-1);
                model.TaskStatus   = (int)Entities.StopCustTaskStatus.NoAllocation;
                model.AssignUserID = -2;
                model.AssignTime   = dtime;
                model.Status       = 0;
                BLL.OrderCRMStopCustTask.Instance.Update(model);

                InsertOperationLog(tid, (int)Entities.StopCustTaskOperStatus.Recover, (int)model.TaskStatus, "回收坐席:" + BLL.EmployeeAgent.Instance.GetAgentNumberAndUserNameByUserId(oldAssignUserID));
            }
            msg = "result:'true'";
        }
Esempio n. 5
0
        public void AssignTaskByUseid(string TaskIDS, string AssignUserID, out string msg)
        {
            msg = "result:'false'";
            string error = string.Empty;

            if (TaskIDS == string.Empty)
            {
                msg = "result:'false',error:'任务ID串不能为空'";
                return;
            }

            #region ID列表串
            string   taskIDStr = "";
            string[] tidList   = TaskIDS.Split(',');
            foreach (string item in tidList)
            {
                taskIDStr += "'" + item + "',";
            }
            if (taskIDStr != "")
            {
                taskIDStr = taskIDStr.Substring(0, taskIDStr.Length - 1);
            }
            else
            {
                error += "请选择任务";
                return;
            }
            #endregion

            #region 判断任务状态

            //判断任务状态
            DataTable taskDt = BLL.OrderCRMStopCustTask.Instance.GetListByTaskIDs(taskIDStr);

            if (taskDt != null)
            {
                foreach (DataRow dr in taskDt.Rows)
                {
                    //所能分配的任务为:1-未分配;未处理-2;处理中-3
                    if (dr["TaskStatus"].ToString() != "1" && dr["TaskStatus"].ToString() != "2" && dr["TaskStatus"].ToString() != "3")
                    {
                        error += "所选任务中,存在不允许分配的任务";
                        break;
                    }
                }
            }
            else
            {
                error += "没找到对应任务";
            }

            if (error != "")
            {
                msg = "result:'false',error:'" + error + "'";
                return;
            }
            #endregion

            DateTime dtime = DateTime.Now;
            foreach (string tid in tidList)
            {
                Entities.OrderCRMStopCustTaskInfo model = BLL.OrderCRMStopCustTask.Instance.GetOrderCRMStopCustTask(tid);
                //分配任务,待处理
                model.TaskStatus   = (int)Entities.StopCustTaskStatus.NoProcess;
                model.AssignUserID = int.Parse(AssignUserID);
                model.AssignTime   = dtime;
                model.Status       = 0;
                BLL.OrderCRMStopCustTask.Instance.Update(model);

                InsertOperationLog(tid, (int)Entities.StopCustTaskOperStatus.Allocation, (int)Entities.StopCustTaskStatus.NoProcess,
                                   "分配坐席:" + BLL.EmployeeAgent.Instance.GetAgentNumberAndUserNameByUserId(model.AssignUserID.Value));
            }
            msg = "result:'true'";
        }