public Jinher.AMP.App.Deploy.ApplicationDTO GetAppById(System.Guid appId) { Jinher.AMP.App.Deploy.ApplicationDTO applicationDTO = null; try { //*********** 暂时注释调试 //applicationDTO = GlobalCacheWrapper.GetData(RedisKeyConst.AppInfo, appId.ToString(), CacheTypeEnum.redisSS, "BTPCache") as Jinher.AMP.App.Deploy.ApplicationDTO; //if (applicationDTO != null) //{ // return applicationDTO; //} //Jinher.AMP.App.IBP.Facade.AppManagerFacade appManagerFacade = new App.IBP.Facade.AppManagerFacade(); //appManagerFacade.ContextDTO = AuthorizeHelper.CoinInitAuthorizeInfo(); //applicationDTO = appManagerFacade.GetAppById(appId); //if (applicationDTO != null) //{ // string json = JsonHelper.JsonSerializer<Jinher.AMP.App.Deploy.ApplicationDTO>(applicationDTO); // GlobalCacheWrapper.Add(RedisKeyConst.AppInfo, appId.ToString(), json, CacheTypeEnum.redisSS, "BTPCache"); //} Jinher.AMP.App.IBP.Facade.AppManagerFacade appManagerFacade = new App.IBP.Facade.AppManagerFacade(); appManagerFacade.ContextDTO = AuthorizeHelper.CoinInitAuthorizeInfo(); applicationDTO = appManagerFacade.GetAppById(appId); } catch (Exception ex) { LogHelper.Error(string.Format("APPBP.GetAppById服务异常:获取应用信息异常。 appId:{0}", appId), ex); } return(applicationDTO); }
/// <summary> /// /// </summary> /// <param name="title">后台接收消息的标题</param> /// <param name="content">后台接收消息的内容</param> /// <param name="mobilemess">手机接收的消息</param> /// <param name="state">1.只给手机发送2.只给后台发送3.同时给手机和后台发消息</param> /// <param name="appId"></param> /// <param name="afterSalesMessages"></param> public void SendMessageCommon(string title, string content, string mobilemess, int state, System.Guid appId, string Id, string code, ContextDTO contextDTO, bool isAfterSales) { Jinher.AMP.App.Deploy.ApplicationDTO applicationDTO = null; try { applicationDTO = APPBP.Instance.GetAppById(appId); } catch (Exception ex) { LogHelper.Error(string.Format("SendMessageCommon AppManagerSV服务异常:获取应用信息异常。title:{0},content:{1},mobilemess:{2},state:{3},appId:{4},Id:{5},code:{6}", title, content, mobilemess, state, appId, Id, code), ex); } try { if (applicationDTO != null && applicationDTO.OwnerId != null && applicationDTO.OwnerId.Value != Guid.Empty) { List <Guid> LGuid = new List <Guid>(); string messages = mobilemess; LGuid = EBCSV.GetOrderMenuUsers(applicationDTO); if (LGuid == null || !LGuid.Any()) { return; } System.Text.StringBuilder strOrgUserIds = new System.Text.StringBuilder(); foreach (Guid orgUserId in LGuid) { strOrgUserIds.Append(orgUserId).Append(","); } strOrgUserIds.Remove(strOrgUserIds.Length - 1, 1); AddMessages(Id, strOrgUserIds.ToString(), appId, code, state, messages, "orderAppOwner", isAfterSales); //后台发消息 Jinher.AMP.Info.Deploy.CustomDTO.MessageForAddDTO messageAdd = new Info.Deploy.CustomDTO.MessageForAddDTO(); //推送消息 messageAdd.PublishTime = DateTime.Now; messageAdd.ReceiverUserId = LGuid; //messageAdd.SenderOrgId = employeeDTO.EBCOrganizationId; messageAdd.SenderType = Info.Deploy.Enum.SenderType.System; messageAdd.Title = title; messageAdd.Content = content; //messageAdd.MessageType = "OrgDisableMessage"; messageAdd.ReceiverRange = Info.Deploy.Enum.ReceiverRange.SpecifiedUser; var retret = Jinher.AMP.BTP.TPS.InfoSV.Instance.AddSystemMessage(messageAdd); LogHelper.Info(string.Format("SendMessageCommon后台发送消息服务成功。messageAdd:{0}", JsonHelper.JsonSerializer(messageAdd))); } } catch (Exception ex) { LogHelper.Error(string.Format("SendMessageCommon发送消息服务异常:。title:{0},content:{1},mobilemess:{2},state:{3},appId:{4},Id:{5},code:{6}", title, content, mobilemess, state, appId, Id, code), ex); } }
public Jinher.AMP.App.Deploy.ApplicationDTO GetAppByIdInfo(System.Guid appId, ContextDTO contextDTO) { Jinher.AMP.App.Deploy.ApplicationDTO applicationDTO = null; try { Jinher.AMP.App.IBP.Facade.AppManagerFacade appManagerFacade = new App.IBP.Facade.AppManagerFacade(); appManagerFacade.ContextDTO = AuthorizeHelper.CoinInitAuthorizeInfo(); applicationDTO = appManagerFacade.GetAppById(appId); } catch (Exception ex) { LogHelper.Error(string.Format("APPSV.GetAppByIdInfo服务异常:获取应用信息异常。 appId:{0}", appId), ex); } return(applicationDTO); }
/// <summary> /// 获取应用下有“订单管理”菜单权限的用户列表 /// </summary> /// <param name="applicationDTO"></param> /// <returns></returns> public static List <Guid> GetOrderMenuUsers(Jinher.AMP.App.Deploy.ApplicationDTO applicationDTO) { List <Guid> result = new List <Guid>(); if (applicationDTO != null && applicationDTO.OwnerId != null && applicationDTO.OwnerId.Value != Guid.Empty) { //定制应用和免费应用的“订单管理”菜单id不一样 string orderMenuId = applicationDTO.TemplateId == 8 ? "40038046" : "40030004"; if (applicationDTO.OwnerType == App.Deploy.Enum.AppOwnerTypeEnum.Personal) { result.Add(applicationDTO.OwnerId.Value); } else if (applicationDTO.OwnerType == App.Deploy.Enum.AppOwnerTypeEnum.Org) { result = Instance.GetRoleUserInfo(applicationDTO.OwnerId.Value, orderMenuId, applicationDTO.Id); } } return(result); }