private void SetInfo(Foresight.DataAccess.CustomerService data) { this.tdServiceFullName.InnerHtml = data.ServiceFullName; this.tdAddCustomerName.InnerHtml = data.AddCustomerName; this.tdAddTime.InnerHtml = data.AddTime.ToString("yyyy-MM-dd HH:mm:ss"); this.tdServiceContent.InnerHtml = data.ServiceContent; }
private void SetInfo(Foresight.DataAccess.CustomerService data) { ProjectID = data.ProjectID; this.tdFullName.Value = data.ServiceFullName; this.tdProjectName.Value = data.ProjectName; this.tdServiceType.Value = data.ServiceTypeID == int.MinValue ? "" : data.ServiceTypeID.ToString(); if (data.ServiceTypeID > 0) { var servicetype = Foresight.DataAccess.ServiceType.GetServiceType(data.ServiceTypeID); if (servicetype != null) { this.hdServiceTypeName.Value = servicetype.ServiceTypeName; } } this.sAddUserName.InnerHtml = this.tdAddUserName.Value = string.IsNullOrEmpty(data.AddUserName) ? data.AddMan : data.AddUserName; this.sStartTime.InnerHtml = this.tdStartTime.Value = data.StartTime == DateTime.MinValue ? (data.AddTime > DateTime.MinValue ? data.AddTime.ToString("yyyy-MM-dd HH:mm:ss") : "") : data.StartTime.ToString("yyyy-MM-dd HH:mm:ss"); this.tdServiceArea.Value = data.ServiceArea; this.tdServiceNumber.Value = data.ServiceNumber; this.tdAddCustomerName.Value = data.AddCustomerName; this.tdAddCallPhone.Value = data.AddCallPhone; this.tdServiceContent.Value = data.ServiceContent; this.tdAcceptMan.Value = (!string.IsNullOrEmpty(data.ServiceAccpetManID) && data.ServiceAccpetManID.Equals("0")) ? string.Empty : data.ServiceAccpetManID.Replace("[", "").Replace("]", ""); this.tdAppointTime.Value = data.ServiceAppointTime == DateTime.MinValue ? "" : data.ServiceAppointTime.ToString("yyyy-MM-dd HH:mm:ss"); this.tdHandelFee.Value = data.HandelFee; this.tdTotalFee.Value = data.TotalFee > 0 ? data.TotalFee.ToString() : ""; this.tdIsRequireCost.Checked = data.IsRequireCost; this.tdIsRequireProduct.Checked = data.IsRequireCost; this.tdIsSendAPP.Checked = data.IsAPPShow; this.tdTaskType.Value = data.TaskType > 0 ? data.TaskType.ToString() : ""; this.tdAcceptManInput.Value = data.ServiceAccpetMan; this.hdDepartmentID.Value = this.tdBelongTeamName.Value = data.DepartmentID > 0 ? data.DepartmentID.ToString() : ""; }
protected void Page_Load(object sender, EventArgs e) { guid = System.Guid.NewGuid().ToString(); int ID = 0; 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.CustomerService.GetCustomerService(ID); if (service != null) { SetInfo(service); } else { Response.Write("ID不合法"); Response.End(); return; } }
private void SetInfo(Foresight.DataAccess.CustomerService service) { this.CompanyName.InnerHtml = WebUtil.GetCompany(this.Context).CompanyName; this.tdServiceType.InnerHtml = service.ServiceTypeName; if (service.TaskType > 0) { var tasktype = Foresight.DataAccess.CustomerService_Task.GetCustomerService_Task(service.TaskType); this.tdTaskType.InnerHtml = tasktype != null ? tasktype.TaskName : ""; } this.tdServiceNumber.InnerHtml = service.ServiceNumber; this.tdAddUserName.InnerHtml = service.AddUserName; if (service.SendUserID > 0) { var user = Foresight.DataAccess.User.GetUser(service.SendUserID); this.tdAddUserName.InnerHtml = user == null ? service.SendUserName : user.RealName; this.tdServiceAccpetManPhone.InnerHtml = user != null ? user.PhoneNumber : ""; } this.tdAcceptMan.InnerHtml = service.FinalServiceAccpetMan; this.tdAPPSendTime.InnerHtml = service.APPSendTime == DateTime.MinValue ? "" : service.APPSendTime.ToString("yyyy-MM-dd HH:mm"); this.tdAddCustomerName.InnerHtml = service.AddCustomerName; this.tdAppointTime.InnerHtml = service.ServiceAppointTime == DateTime.MinValue ? "" : service.ServiceAppointTime.ToString("yyyy-MM-dd HH:mm"); this.tdAddCallPhone.InnerHtml = service.AddCallPhone; this.tdFullName.InnerHtml = service.ServiceFullName; this.tdServiceContent.InnerHtml = service.ServiceContent; this.tdAcceptTime.InnerHtml = service.AcceptTime == DateTime.MinValue ? "" : service.AcceptTime.ToString("yyyy-MM-dd HH:mm"); this.tdBanJieTime.InnerHtml = service.BanJieTime == DateTime.MinValue ? "" : service.BanJieTime.ToString("yyyy-MM-dd HH:mm"); this.tdBanJieNote.InnerHtml = service.BanJieNote; this.tdChargeStatus.InnerHtml = "未收取费用"; if (service.IsRequireCost && service.TotalFee > 0) { this.tdChargeStatus.InnerHtml = "已收取费用"; } this.tdTotalFee.InnerHtml = service.TotalFee > 0 ? service.TotalFee.ToString() : ""; }
/// <summary> /// /// </summary> /// <param name="ServiceID"></param> /// <param name="ErrorMsg"></param> /// <param name="title"></param> /// <param name="SendUserID"></param> /// <param name="SendUserName"></param> /// <param name="service"></param> /// <param name="AccpetUserType">1-通知接单人 2-通知处理人</param> /// <returns></returns> public static bool SendJpushMsgByServiceID(int ServiceID, out string ErrorMsg, string title = "", int SendUserID = 0, string SendUserName = "", Foresight.DataAccess.CustomerService service = null, List <int> ServiceAccpetManIDList = null, List <int> ServiceProcessManIDList = null, bool isReturnNotify = false) { ErrorMsg = ""; var config = new Utility.SiteConfig(); if (string.IsNullOrEmpty(config.JPushKey_User)) { ErrorMsg = "推送未配置"; return(false); } if (service == null) { service = Foresight.DataAccess.CustomerService.GetCustomerService(ServiceID); } if (service == null) { ErrorMsg = "ID不合法"; return(false); } string result = string.Empty; string result_push = string.Empty; string result_ios = string.Empty; #region 派单人推送 if (service.ServiceStatus == 10 || service.ServiceStatus == 3) { if (ServiceAccpetManIDList == null) { ServiceAccpetManIDList = Foresight.DataAccess.CustomerService_Accpet.GetCustomerService_AccpetListByServiceID(ServiceID, new int[] { 0, 1 }, AccpetUserType: 1).Select(p => p.AccpetManID).ToList(); } if (ServiceAccpetManIDList.Count > 0)//待派单 { var users = Foresight.DataAccess.User.GetPushUserListByIDListByIDList(ServiceAccpetManIDList); if (users.Length > 0) { Dictionary <string, object> extras = new Dictionary <string, object>(); string pushMsg = string.Empty; if (isReturnNotify) { pushMsg = "您有新工单需要重新派单,请尽快处理"; } var extra_model = new Utility.JpushContent(service.ServiceStatus, Msg: pushMsg, Type: "customerservice"); extras["code"] = extra_model.code; extras["msg"] = extra_model.msg; extras["type"] = extra_model.type; extras["id"] = service.ID; extras["status"] = service.ServiceStatus; extras["isreturn"] = isReturnNotify; var users_android = users.Where(p => p.APPUserDeviceType.Equals("android")).ToArray(); var users_ios = users.Where(p => p.APPUserDeviceType.Equals("ios")).ToArray(); string[] android_cids = new string[] { }; string[] ios_cids = new string[] { }; if (users_android.Length > 0) { android_cids = users_android.Select(p => p.APPUserDeviceID).ToArray(); } if (users_ios.Length > 0) { ios_cids = users_ios.Select(p => p.APPUserDeviceID).ToArray(); } result_push = JPush.JpushAPI.PushMessage(title, extras, android_cids, ios_cids, extra_model.msg); Foresight.DataAccess.JPushLog.Insert_JPushLog(android_cids, ios_cids, extras, result_push, 1, service.ID, true, title); } } } #endregion #region 处理人推送 if (service.ServiceStatus == 0) { if (ServiceProcessManIDList == null) { ServiceProcessManIDList = Foresight.DataAccess.CustomerService_Accpet.GetCustomerService_AccpetListByServiceID(ServiceID, new int[] { 0, 1 }, AccpetUserType: 2).Select(p => p.AccpetManID).ToList(); } if (ServiceProcessManIDList.Count > 0)//通知处理人 { var users = Foresight.DataAccess.User.GetPushUserListByIDListByIDList(ServiceProcessManIDList); if (users.Length > 0) { Dictionary <string, object> extras = new Dictionary <string, object>(); var extra_model = new Utility.JpushContent(service.ServiceStatus, Type: "customerservice"); extras["code"] = extra_model.code; extras["msg"] = extra_model.msg; extras["type"] = extra_model.type; extras["id"] = service.ID; extras["status"] = service.ServiceStatus; var users_android = users.Where(p => p.APPUserDeviceType.Equals("android")).ToArray(); var users_ios = users.Where(p => p.APPUserDeviceType.Equals("ios")).ToArray(); string[] android_cids = new string[] { }; string[] ios_cids = new string[] { }; if (users_android.Length > 0) { android_cids = users_android.Select(p => p.APPUserDeviceID).ToArray(); } if (users_ios.Length > 0) { ios_cids = users_ios.Select(p => p.APPUserDeviceID).ToArray(); } result_push = JPush.JpushAPI.PushMessage(title, extras, android_cids, ios_cids, extra_model.msg); Foresight.DataAccess.JPushLog.Insert_JPushLog(android_cids, ios_cids, extras, result_push, 1, service.ID, true, title); } } } #endregion service.IsAPPSend = true; service.SendUserID = SendUserID; service.SendUserName = SendUserName; service.APPSendTime = DateTime.Now; service.APPSendResult = result_push; service.Save(); return(true); }
private void savewxservice(HttpContext context) { int ProjectID = WebUtil.GetIntValue(context, "ProjectID"); if (ProjectID <= 0) { WebUtil.WriteJsonError(context, ErrorCode.InvalideRequest, "请选择项目"); return; } var service = new Foresight.DataAccess.CustomerService(); service.AddTime = DateTime.Now; service.AddMan = context.Request.Params["AddMan"]; service.AddUserID = 0; service.IsSuggestion = WebUtil.GetBoolValue(context, "IsSuggestion"); service.ServiceStatus = 3; service.ServiceFullName = context.Request["FullName"]; service.ProjectID = ProjectID; service.ServiceType1ID = WebUtil.GetIntValue(context, "TypeID1"); int TypeID2 = WebUtil.GetIntValue(context, "TypeID2"); int TypeID3 = WebUtil.GetIntValue(context, "TypeID3"); if (TypeID2 > 0) { service.ServiceType2ID = "[" + TypeID2 + "]"; } if (TypeID3 > 0) { service.ServiceType3ID = "[" + TypeID3 + "]"; } service.ProjectName = context.Request["ProjectName"]; service.ServiceFullName = service.ProjectName; service.AddUserName = "******"; service.StartTime = DateTime.Now;//反应时间 int OrderNumberID = 0; string ServiceNumber = Foresight.DataAccess.CustomerService.GetLastestCustomerServiceNumber(Foresight.DataAccess.OrderTypeNameDefine.customerservice.ToString(), 0, out OrderNumberID); service.ServiceNumber = ServiceNumber; service.OrderNumberID = OrderNumberID; service.AddCustomerName = context.Request["AddCustomerName"]; //反映人 service.AddCallPhone = context.Request["PhoneNo"]; //反映人联系电话 service.ServiceContent = context.Request["Content"]; service.ServiceAppointTime = WebUtil.GetDateValue(context, "AppointTime"); service.ServiceFrom = Utility.EnumModel.WechatServiceFromDefine.weixin.ToString(); List <Foresight.DataAccess.CustomerServiceAttach> attachlist = new List <Foresight.DataAccess.CustomerServiceAttach>(); string FilePaths = context.Request["FilePaths"]; List <Dictionary <string, object> > FilePathList = new List <Dictionary <string, object> >(); if (!string.IsNullOrEmpty(FilePaths)) { FilePathList = Utility.JsonConvert.DeserializeObject <List <Dictionary <string, object> > >(FilePaths); } HttpFileCollection uploadFiles = context.Request.Files; foreach (var item in FilePathList) { Foresight.DataAccess.CustomerServiceAttach attach = new Foresight.DataAccess.CustomerServiceAttach(); attach.FileOriName = item["FileOriName"].ToString(); attach.AttachedFilePath = item["FilePath"].ToString(); attach.AddTime = DateTime.Now; attachlist.Add(attach); } using (SqlHelper helper = new SqlHelper()) { try { helper.BeginTransaction(); service.Save(helper); foreach (var item in attachlist) { item.ServiceID = service.ID; item.Save(helper); } helper.Commit(); } catch (Exception ex) { Utility.LogHelper.WriteError("ServiceHandler", "命令: savewxservice", ex); helper.Rollback(); WebUtil.WriteJsonError(context, ErrorCode.InvalideRequest, ex.Message); return; } } if (!service.IsSuggestion) { string title = new Utility.SiteConfig().CompanyName; APPCode.SocketNotify.PushSocketNotifyAlert(EnumModel.SocketNotifyDefine.notifyservice, ID: service.ID); } else { string notify_msg = APPCode.SocketNotify.PushSocketNotifyAlert(EnumModel.SocketNotifyDefine.notifysuggestion, ID: service.ID); } WebUtil.WriteJsonResult(context, "Success"); }