Ejemplo n.º 1
0
        public static ViewCustomerService[] GetViewCustomerServiceListByID(List <int> IDList, string orderby)
        {
            ResetCache();
            List <SqlParameter> parameters = new List <SqlParameter>();
            List <string>       conditions = new List <string>();

            conditions.Add("1=1");
            string cmdwhere = string.Empty;

            if (IDList.Count > 0)
            {
                conditions.Add("[ID] in (" + string.Join(",", IDList.ToArray()) + ")");
            }
            ViewCustomerService[] list = new ViewCustomerService[] { };
            string cmdorderby          = string.Empty;

            if (!string.IsNullOrEmpty(orderby))
            {
                if (orderby.ToLower().Trim().StartsWith("order by"))
                {
                    cmdorderby = orderby;
                }
                else
                {
                    cmdorderby = "order by " + orderby;
                }
            }
            string cmdText = "select * from [ViewCustomerService] where " + string.Join(" and ", conditions.ToArray()) + cmdorderby;

            list = GetList <ViewCustomerService>(cmdText, parameters).ToArray();
            return(list);
        }
        public static void SetViewCustomerServiceData(ViewCustomerService item, CustomerService_TimeShiXiao myTimeItem)
        {
            if (myTimeItem == null || item == null)
            {
                return;
            }
            item.XiaDanDate            = myTimeItem.XiaDanDate;
            item.XiaDanTakeHour        = myTimeItem.XiaDanTakeHour;
            item.XiaDanTimeOutStatus   = myTimeItem.XiaDanTimeOutStatus;
            item.XiaDanChaoShiTakeHour = myTimeItem.XiaDanChaoShiTakeHour;

            item.PaiDanDate            = myTimeItem.PaiDanDate;
            item.PaiDanTakeHour        = myTimeItem.PaiDanTakeHour;
            item.PaiDanTimeOutStatus   = myTimeItem.PaiDanTimeOutStatus;
            item.PaiDanChaoShiTakeHour = myTimeItem.PaiDanChaoShiTakeHour;

            item.ResponseTime            = myTimeItem.ResponseTime;
            item.ResponseTakeHour        = myTimeItem.ResponseTakeHour;
            item.ResponseTimeOutStatus   = myTimeItem.ResponseTimeOutStatus;
            item.ResponseChaoShiTakeHour = myTimeItem.ResponseChaoShiTakeHour;

            item.ResponseTime            = myTimeItem.ResponseTime;
            item.ResponseTakeHour        = myTimeItem.ResponseTakeHour;
            item.ResponseTimeOutStatus   = myTimeItem.ResponseTimeOutStatus;
            item.ResponseChaoShiTakeHour = myTimeItem.ResponseChaoShiTakeHour;

            item.CheckTime            = myTimeItem.CheckTime;
            item.CheckTakeHour        = myTimeItem.CheckTakeHour;
            item.CheckTimeOutStatus   = myTimeItem.CheckTimeOutStatus;
            item.CheckChaoShiTakeHour = myTimeItem.CheckChaoShiTakeHour;

            item.ChuliDate              = myTimeItem.ChuliDate;
            item.ProcessTakeHour        = myTimeItem.ProcessTakeHour;
            item.ProcessTimeOutStatus   = myTimeItem.ProcessTimeOutStatus;
            item.ProcessChaoShiTakeHour = myTimeItem.ProcessChaoShiTakeHour;

            //item.BanJieTime = myTimeItem.BanJieTime;
            item.BanJieTakeHour        = myTimeItem.BanJieTakeHour;
            item.BanJieTimeOutStatus   = myTimeItem.BanJieTimeOutStatus;
            item.BanJieChaoShiTakeHour = myTimeItem.BanJieChaoShiTakeHour;

            //item.CloseTime = myTimeItem.CloseTime;
            item.CloseTakeHour        = myTimeItem.CloseTakeHour;
            item.CloseTimeOutStatus   = myTimeItem.CloseTimeOutStatus;
            item.CloseChaoShiTakeHour = myTimeItem.CloseChaoShiTakeHour;
        }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(Request.QueryString["op"]))
     {
         op = Request.QueryString["op"];
     }
     if (op.Equals("complete"))
     {
         isComplete = 1;
     }
     if (string.IsNullOrEmpty(Request.QueryString["ID"]))
     {
         Response.Write("ID不合法");
         Response.End();
         return;
     }
     int.TryParse(Request.QueryString["ID"], out ID);
     if (ID <= 0)
     {
         Response.Write("ID不合法");
         Response.End();
         return;
     }
     service = Foresight.DataAccess.ViewCustomerService.GetViewCustomerServiceByID(ID);
     if (service == null)
     {
         Response.Write("ID不合法");
         Response.End();
         return;
     }
     this.tdServiceType1.Value = service.ServiceType1ID > 0 ? service.ServiceType1ID.ToString() : "";
     if (service.ServiceType2IDList.Length > 0)
     {
         this.tdServiceType2.Value = string.Join(",", service.ServiceType2IDList);
     }
     if (service.ServiceType3IDList.Length > 0)
     {
         this.tdServiceType3.Value = string.Join(",", service.ServiceType3IDList);
     }
     this.tdResponseTime.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
     this.tdCheckTime.Value    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
     this.tdChuLiTime.Value    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
     this.tdBanJieTime.Value   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
     this.WuYeBaoShiServiceID  = new Utility.SiteConfig().WuYeBaoShiServiceID;
 }
Ejemplo n.º 4
0
        public static bool CheckCanCallbackService(List <int> IDList, out string error)
        {
            error = string.Empty;
            var list = ViewCustomerService.GetViewCustomerServiceByIDList(IDList);

            if (list.Length == 0)
            {
                error = "请选择工单";
                return(false);
            }
            foreach (var item in list)
            {
                if (item.CallBackServiceType == 1)
                {
                    if (!item.IsClosed)
                    {
                        error = "工单未关单,不能回访";
                        return(false);
                    }
                    continue;
                }
                if (item.CallBackServiceType == 2)
                {
                    if (item.ServiceStatus != 1)
                    {
                        error = "工单未办结,不能回访";
                        return(false);
                    }
                    continue;
                }
                if (item.BanJieServiceType == 3)
                {
                    continue;
                }
            }
            return(true);
        }
Ejemplo n.º 5
0
        public static bool CheckCanCompleteService(List <int> IDList, out string error)
        {
            error = string.Empty;
            var list = ViewCustomerService.GetViewCustomerServiceByIDList(IDList);

            if (list.Length == 0)
            {
                error = "请选择工单";
                return(false);
            }
            var sServiceIDList = list.Select(p => p.ID).ToList();
            var chuliList      = CustomerServiceChuli.GetCustomerServiceChuliListByServiceIDList(sServiceIDList);

            foreach (var item in list)
            {
                if (item.ServiceStatus == 1)
                {
                    error = "工单已办结,不能重复办结";
                    return(false);
                }
                //if (item.BanJieServiceType == 1)
                //{
                //    var myItemList = chuliList.Where(p => p.ServiceID == item.ID).ToArray();
                //    if (myItemList.Length == 0)
                //    {
                //        error = "工单未处理,不能办结";
                //        return false;
                //    }
                //    continue;
                //}
                if (item.BanJieServiceType == 2)
                {
                    continue;
                }
            }
            return(true);
        }
Ejemplo n.º 6
0
        public static Ui.DataGrid GetCustomerServiceGridByKeywords(string Keywords, List <int> RoomIDList, DateTime StartTime, DateTime EndTime, int ServiceStatus, int PayStatus, int ServiceAccpetManID, string orderBy, long startRowIndex, int pageSize, int UserID, List <int> EqualProjectIDList = null, List <int> InProjectIDList = null, int ServiceType = 0, int ServiceRange = 1, List <int> PublicProjectIDList = null, bool canexport = false)
        {
            ResetCache();
            long totalRows = 0;
            List <SqlParameter> parameters = new List <SqlParameter>();
            List <string>       conditions = new List <string>();
            List <string>       cmdlist    = new List <string>();

            conditions.Add("1=1");
            #region 关键字查询
            string cmd = string.Empty;
            if (!string.IsNullOrEmpty(Keywords))
            {
                string[] keywords = Keywords.Trim().Split(' ');
                for (int i = 0; i < keywords.Length; i++)
                {
                    if (string.IsNullOrEmpty(keywords[i].ToString()))
                    {
                        continue;
                    }
                    if (i + 1 == keywords.Length)
                    {
                        if (keywords.Length == 1)
                        {
                            cmd += "  and  (isnull([ServiceNumber],'') like '%" + keywords[i] + "%' or [AddCustomerName] like '%" + keywords[i] + "%' or [AddCallPhone] like '%" + keywords[i] + "%' or [ServiceAccpetMan] like '%" + keywords[i] + "%' or [ServiceFullName] like '%" + keywords[i] + "%' or [ServiceContent] like '%" + keywords[i] + "%')";
                        }
                        else
                        {
                            cmd += "  (isnull([ServiceNumber],'') like '%" + keywords[i] + "%' or [AddCustomerName] like '%" + keywords[i] + "%' or [AddCallPhone] like '%" + keywords[i] + "%' or [ServiceAccpetMan] like '%" + keywords[i] + "%' or [ServiceFullName] like '%" + keywords[i] + "%' or [ServiceContent] like '%" + keywords[i] + "%'))";
                        }
                    }
                    else if (i == 0)
                    {
                        cmd += " and ((isnull([ServiceNumber],'') like '%" + keywords[i] + "%' or [AddCustomerName] like '%" + keywords[i] + "%' or [AddCallPhone] like '%" + keywords[i] + "%' or [ServiceAccpetMan] like '%" + keywords[i] + "%' or [ServiceFullName] like '%" + keywords[i] + "%' or [ServiceContent] like '%" + keywords[i] + "%') or";
                    }
                    else
                    {
                        cmd += "  (isnull([ServiceNumber],'') like '%" + keywords[i] + "%' or [AddCustomerName] like '%" + keywords[i] + "%' or [AddCallPhone] like '%" + keywords[i] + "%' or [ServiceAccpetMan] like '%" + keywords[i] + "%' or [ServiceFullName] like '%" + keywords[i] + "%' or [ServiceContent] like '%" + keywords[i] + "%') or ";
                    }
                }
            }
            #endregion
            if (ServiceType == 2)
            {
                conditions.Add("isnull([IsSuggestion],0)=1");
            }
            else
            {
                conditions.Add("isnull([IsSuggestion],0)=0");
                cmdlist = new List <string>();
                if (ServiceRange == 1)
                {
                    conditions.Add("isnull([PublicProjectID],0)=0");
                }
                if (ServiceRange == 2)
                {
                    conditions.Add("isnull([PublicProjectID],0)>0");
                    conditions.Add("isnull([ProjectID],0)=0");
                }
                if (InProjectIDList != null && InProjectIDList.Count > 0)
                {
                    cmdlist = ViewRoomFeeHistory.GetProjectIDListConditions(InProjectIDList, IncludeRelation: false, RoomIDName: "[ProjectID]", UserID: UserID);
                }
                if (EqualProjectIDList != null && EqualProjectIDList.Count > 0)
                {
                    cmdlist.Add("([ProjectID] in (" + string.Join(",", EqualProjectIDList.ToArray()) + "))");
                }
                if (PublicProjectIDList != null && PublicProjectIDList.Count > 0)
                {
                    cmdlist.Add("[PublicProjectID] in (" + string.Join(",", PublicProjectIDList.ToArray()) + ")");
                }
                if (cmdlist.Count > 0)
                {
                    conditions.Add("(" + string.Join(" or ", cmdlist.ToArray()) + ")");
                }
                if (ServiceAccpetManID > 0)
                {
                    conditions.Add("REPLACE(REPLACE([ServiceAccpetManID],'[',','),']',',') like '%," + ServiceAccpetManID.ToString() + ",%'");
                }
                if (PayStatus == 0)
                {
                    conditions.Add("isnull([TotalFee],0)=0");
                }
                if (PayStatus == 1)
                {
                    conditions.Add("isnull([TotalFee],0)>0");
                }
                if (RoomIDList.Count > 0)
                {
                    cmdlist = new List <string>();
                    cmdlist = ViewRoomFeeHistory.GetRoomIDListConditions(RoomIDList, IncludeRelation: false, RoomIDName: "[ProjectID]");
                    conditions.Add("(" + string.Join(" or ", cmdlist.ToArray()) + ")");
                }
                if (StartTime > DateTime.MinValue)
                {
                    conditions.Add("[StartTime]>=@StartTime");
                    parameters.Add(new SqlParameter("@StartTime", StartTime));
                }
                if (EndTime > DateTime.MinValue)
                {
                    conditions.Add("[StartTime]<=@EndTime");
                    parameters.Add(new SqlParameter("@EndTime", EndTime));
                }
                if (ServiceStatus > -1)
                {
                    if (ServiceStatus == 100)
                    {
                        conditions.Add("[ServiceStatus] in (3,10)");
                    }
                    else
                    {
                        conditions.Add("[ServiceStatus]=@ServiceStatus");
                    }
                    parameters.Add(new SqlParameter("@ServiceStatus", ServiceStatus));
                }
            }
            string fieldList           = "[ViewCustomerService].*";
            string Statement           = " from [ViewCustomerService] where  " + string.Join(" and ", conditions.ToArray()) + cmd;
            ViewCustomerService[] list = new ViewCustomerService[] { };
            if (canexport)
            {
                list      = GetList <ViewCustomerService>("select " + fieldList + Statement + " " + orderBy, parameters).ToArray();
                totalRows = list.Length;
            }
            else
            {
                list = GetList <ViewCustomerService>(fieldList, Statement, parameters, orderBy, startRowIndex, pageSize, out totalRows).ToArray();
            }
            string footer_text        = "select '合计' as [ServiceFullName],100 as [ServiceStatus],sum(CASE WHEN ISNUMERIC(HandelFee)=1 THEN convert(decimal(18,2),HandelFee) ELSE 0 END) as HandelFee,sum(isnull(TotalFee,0)) as TotalFee from [ViewCustomerService] where  " + string.Join(" and ", conditions.ToArray()) + cmd;
            DataAccess.Ui.DataGrid dg = new Ui.DataGrid();
            dg.rows   = list;
            dg.total  = totalRows;
            dg.page   = pageSize;
            dg.footer = GetList <ViewCustomerService>(footer_text, parameters).ToArray();
            return(dg);
        }
        public static void SetTimeShiXiaoData(ViewCustomerService item, CustomerService_TimeShiXiao myTimeItem, List <string> sqlList)
        {
            string cmdtext = string.Empty;

            if (item == null)
            {
                return;
            }
            if (item.ServiceStatus != 1 || !item.IsClosed)
            {
                if (myTimeItem != null)
                {
                    cmdtext = $"delete from [CustomerService_TimeShiXiao] where ServiceID={item.ID};";
                }
            }
            else if (myTimeItem == null)
            {
                cmdtext = $@"insert into [CustomerService_TimeShiXiao] ([ServiceID]
           ,[XiaDanDate]
           ,[XiaDanTakeHour]
           ,[XiaDanTimeOutStatus]
           ,[XiaDanChaoShiTakeHour]
           ,[PaiDanDate]
           ,[PaiDanTakeHour]
           ,[PaiDanTimeOutStatus]
           ,[PaiDanChaoShiTakeHour]
           ,[ResponseTime]
           ,[ResponseTakeHour]
           ,[ResponseTimeOutStatus]
           ,[ResponseChaoShiTakeHour]
           ,[CheckTime]
           ,[CheckTakeHour]
           ,[CheckTimeOutStatus]
           ,[CheckChaoShiTakeHour]
           ,[ChuliDate]
           ,[ProcessTakeHour]
           ,[ProcessTimeOutStatus]
           ,[ProcessChaoShiTakeHour]
           ,[BanJieTime]
           ,[BanJieTakeHour]
           ,[BanJieTimeOutStatus]
           ,[BanJieChaoShiTakeHour]
           ,[CloseTime]
           ,[CloseTakeHour]
           ,[CloseTimeOutStatus]
           ,[CloseChaoShiTakeHour]) values({item.ID}
            ,{GetDateTimeStr(item.XiaDanDate)}
           ,{item.XiaDanTakeHour}
           ,{item.XiaDanTimeOutStatus}
           ,{item.XiaDanChaoShiTakeHour}
           ,{GetDateTimeStr(item.PaiDanDate)}
           ,{item.PaiDanTakeHour}
           ,{item.PaiDanTimeOutStatus}
           ,{item.PaiDanChaoShiTakeHour}
           ,{GetDateTimeStr(item.ResponseTime)}
           ,{item.ResponseTakeHour}
           ,{item.ResponseTimeOutStatus}
           ,{item.ResponseChaoShiTakeHour}
           ,{GetDateTimeStr(item.CheckTime)}
           ,{item.CheckTakeHour}
           ,{item.CheckTimeOutStatus}
           ,{item.CheckChaoShiTakeHour}
           ,{GetDateTimeStr(item.ChuliDate)}
           ,{item.ProcessTakeHour}
           ,{item.ProcessTimeOutStatus}
           ,{item.ProcessChaoShiTakeHour}
           ,{GetDateTimeStr(item.BanJieTime)}
           ,{item.BanJieTakeHour}
           ,{item.BanJieTimeOutStatus}
           ,{item.BanJieChaoShiTakeHour}
           ,{GetDateTimeStr(item.CloseTime)}
           ,{item.CloseTakeHour}
           ,{item.CloseTimeOutStatus}
           ,{item.CloseChaoShiTakeHour});";
            }
            else
            {
                cmdtext = $@"update [CustomerService_TimeShiXiao] set [ServiceID] = {item.ID}
      ,[XiaDanDate] ={GetDateTimeStr(item.XiaDanDate)}
      ,[XiaDanTakeHour] = {item.XiaDanTakeHour}
      ,[XiaDanTimeOutStatus] = {item.XiaDanTimeOutStatus}
      ,[XiaDanChaoShiTakeHour] = {item.XiaDanChaoShiTakeHour}
      ,[PaiDanDate] = {GetDateTimeStr(item.PaiDanDate)}
      ,[PaiDanTakeHour] = {item.PaiDanTakeHour}
      ,[PaiDanTimeOutStatus] = {item.PaiDanTimeOutStatus}
      ,[PaiDanChaoShiTakeHour] = {item.PaiDanChaoShiTakeHour}
      ,[ResponseTime] = {GetDateTimeStr(item.ResponseTime)}
      ,[ResponseTakeHour] = {item.ResponseTakeHour}
      ,[ResponseTimeOutStatus] = {item.ResponseTimeOutStatus}
      ,[ResponseChaoShiTakeHour] = {item.ResponseChaoShiTakeHour}
      ,[CheckTime] = {GetDateTimeStr(item.CheckTime)}
      ,[CheckTakeHour] = {item.CheckTakeHour}
      ,[CheckTimeOutStatus] = {item.CheckTimeOutStatus}
      ,[CheckChaoShiTakeHour] = {item.CheckChaoShiTakeHour}
      ,[ChuliDate] = {GetDateTimeStr(item.ChuliDate)}
      ,[ProcessTakeHour] = {item.ProcessTakeHour}
      ,[ProcessTimeOutStatus] = {item.ProcessTimeOutStatus}
      ,[ProcessChaoShiTakeHour] = {item.ProcessChaoShiTakeHour}
      ,[BanJieTime] = {GetDateTimeStr(item.BanJieTime)}
      ,[BanJieTakeHour] = {item.BanJieTakeHour}
      ,[BanJieTimeOutStatus] = {item.BanJieTimeOutStatus}
      ,[BanJieChaoShiTakeHour] = {item.BanJieChaoShiTakeHour}
      ,[CloseTime] = {GetDateTimeStr(item.CloseTime)}
      ,[CloseTakeHour] = {item.CloseTakeHour}
      ,[CloseTimeOutStatus] = {item.CloseTimeOutStatus}
      ,[CloseChaoShiTakeHour] = {item.CloseChaoShiTakeHour} where ServiceID={item.ID};";
            }
            if (!string.IsNullOrEmpty(cmdtext.Trim()))
            {
                sqlList.Add(cmdtext);
            }
            return;
        }
Ejemplo n.º 8
0
        public static bool CheckCanCloseService(List <int> IDList, out string error)
        {
            error = string.Empty;
            var list = ViewCustomerService.GetViewCustomerServiceByIDList(IDList);

            if (list.Length == 0)
            {
                error = "请选择工单";
                return(false);
            }
            var sServiceIDList = list.Select(p => p.ID).ToList();
            var callBackList   = CustomerServiceHuifang.GetCustomerServiceHuifangListByServiceIDList(sServiceIDList);
            int MinServiceID   = list.Min(p => p.ID);
            int MaxServiceID   = list.Max(p => p.ID);
            var recordList     = PhoneRecord.GetPhoneRecordDetailByServiceIDList(MinServiceID, MaxServiceID);

            foreach (var item in list)
            {
                if (item.IsImportantTouSu)
                {
                    continue;
                }
                if (item.IsClosed)
                {
                    error = "工单已关单,不能重复关单";
                    return(false);
                }
                if (item.CloseServiceType == 1 || item.IsImportantTouSu)
                {
                    if (item.ServiceStatus != 1)
                    {
                        error = "工单未办结,不能关单";
                        return(false);
                    }
                    continue;
                }
                if (item.CloseServiceType == 2)
                {
                    var myRecordList   = recordList.Where(p => p.ServiceID == item.ID && p.PhoneType == 2).ToArray();
                    var myCallBackList = callBackList.Where(p => p.ServiceID == item.ID).ToArray();
                    if (myRecordList.FirstOrDefault(p => p.PickUpTime > DateTime.MinValue) != null)
                    {
                        continue;
                    }
                    if (myCallBackList.FirstOrDefault(p => p.PhoneCallBackType == 1) != null)
                    {
                        continue;
                    }
                    if (myRecordList.Length >= 2)
                    {
                        continue;
                    }
                    if (myCallBackList.Where(p => p.PhoneCallBackType == 2).ToArray().Length >= 2)
                    {
                        continue;
                    }
                    if (myRecordList.Length == 1)
                    {
                        error = "投诉类工单仅回访一次且未接电话,不能关单";
                        return(false);
                    }
                    if (myCallBackList.Where(p => p.PhoneCallBackType == 2).ToArray().Length == 1)
                    {
                        error = "投诉类工单仅回访一次且未接电话,不能关单";
                        return(false);
                    }
                    error = "投诉类工单未回访,不能关单";
                    return(false);
                }
                if (item.CloseServiceType == 3)
                {
                    if (item.ConfirmStatus != 1)
                    {
                        error = "廉洁举报类工单未审计确认,不能关单";
                        return(false);
                    }
                    continue;
                }
                if (item.CloseServiceType == 4)
                {
                    continue;
                }
            }
            return(true);
        }