import { RhSafeAny } from 'rh-base/model'; import { YGProductsDto, EditionsDto, AuxiliaryDataDictionaryQueryDto, ConfigGroupDatasDto, FileInfoConfigQueryDto, FileInfoConfigDto, ConfigGroupDatasQueryDto, MessageFileDto, MessageEngineConfigQueryDto, GetMessageEngineConfigListOutput, CreateMailMessageEngineConfigAsyncInput, CreateEnterpriseWechatMessageEngineConfigAsyncInput, GetMessageEngineUserGroupConfigNameListOutput, MessageEngineUserGroupConfigQueryDto, GetMessageEngineUserGroupConfigListOutput, MessageEngineUserGroupConfigDataDto, GetReceivedMessageListAsyncInput, GetReceivedMessageListAsyncOutput, IdQueryDto, GetReceivedMessageDetailOutput, GetSendMessageListAsyncInput, GetSendMessageListAsyncOutput, GetSendMessageDetailAsyncOutput, GetSendRecordByConfigIdAsyncQueryDto, GetSendRecordByMsgConfigNameAsyncOutput, MsgSendTriggerAsyncInput, EnableMsgConfigAsyncInput, CreateAndSendSimpleMessageAsyncInput, AllMessageNotificationDto, CreateAndSendUserGroupMessageAsyncInput, OrganizationUnitRoleQueryDto, ExistUserDto, MailServerConfigDto, DatabaseBackupConfigDto, WebApiInvokeLogQueryDto, WebApiInvokeLog, PublishMessageLogQueryDto, PublishMessageLog, TransactOperationLogQueryDto, TransactOperationLog, EmployeeMessageNotifyEmployeeGroupConfigDto, EmployeeMessageNotifyGroupConfigQueryDto, EmployeeMessageNotifyGroupConfigDto, FileUploadInput, JobDto, StateQueryDto, QuartzJobQueryDto, QuartzJobDto } from './syc-models'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { DataResultT, OpResult, RhTreeNode, RhAuxiliaryDataDictionaryDto } from 'rh-base/model'; import { RhPortType, RhPortLocalFieldType } from 'rh-base/model'; import { RhApiUrlsService } from 'rh-base/core'; @Injectable() export class RhSycService { YGSysConfigApi = 'YGSysConfigApi'; EagleEyeLogApi = 'EagleEyeLogApi'; constructor(private apiUrls: RhApiUrlsService) {} /** * 获取产品列表 */ GetProducts(): Observable> { return this.apiUrls.GetPp(this.YGSysConfigApi, 'GetProducts'); } /** * 存储产品信息 */ StoreProduct(dto: YGProductsDto): Observable { return this.apiUrls.PostPp(this.YGSysConfigApi, 'StoreProduct', dto); } /** * 存储版本信息 */ StoreEdition(dto: EditionsDto): Observable { return this.apiUrls.PostPp('YGAacApi', 'StoreEdition', dto); } /** * 载入版本信息 */ LoadEditions(): Observable { return this.apiUrls.GetPp('YGAacApi', 'LoadEditions'); } /** * 移除版本信息 */ RemoveEdition(dto: EditionsDto): Observable { return this.apiUrls.PostPp('YGAacApi', 'RemoveEdition', dto); } /** * 获取辅字典配置数据 */ GetAuxiliaryDicTreeNodes(queryDto: AuxiliaryDataDictionaryQueryDto): Observable> { return this.apiUrls.PostPp(this.YGSysConfigApi, 'GetAuxiliaryDicTreeNodes', queryDto); } /** * 获取配置组件列表 */ GetConfigGroupDatas(groupKey: string): Observable> { return this.apiUrls.GetPp(this.YGSysConfigApi, 'GetConfigGroupDatas', { params: { groupKey } }); } /** * 获取配置组列表 */ GetConfigGroupList(moduleKey: string): Observable> { return this.apiUrls.GetPp(this.YGSysConfigApi, 'GetConfigGroupList', { params: { moduleKey } }); } /** * 存储辅配置数据 */ StoreAuxiliaryDicConfigDatas(dto: RhAuxiliaryDataDictionaryDto): Observable { return this.apiUrls.PostPp(this.YGSysConfigApi, 'StoreAuxiliaryDicConfigDatas', dto); } /** * 移除辅配置数据 */ RemoveAuxiliaryDicConfigDatas(dto: RhAuxiliaryDataDictionaryDto): Observable { return this.apiUrls.PostPp(this.YGSysConfigApi, 'RemoveAuxiliaryDicConfigDatas', dto); } /** * 获取文件信息配置数据 */ GetFileInfoConfigDatas(queryDto: FileInfoConfigQueryDto): Observable> { return this.apiUrls.PostPp(this.YGSysConfigApi, 'GetFileInfoConfigDatas', queryDto); } /** * 移除文件信息配置数据 */ RemoveFileInfoConfigDatas(dataset: FileInfoConfigDto[]): Observable { return this.apiUrls.PostPp(this.YGSysConfigApi, 'RemoveFileInfoConfigDatas', dataset); } /** * 存储文件信息配置数据 */ StoreFileInfoConfigDatas(dto: FileInfoConfigDto): Observable { return this.apiUrls.PostPp(this.YGSysConfigApi, 'StoreFileInfoConfigDatas', dto); } //#region 分组管理区域 /** * 获取组配置数据 */ GetGroupConfigDatas(queryDto: ConfigGroupDatasQueryDto): Observable> { return this.apiUrls.PostPp(this.YGSysConfigApi, 'GetGroupConfigDatas', queryDto); } /** * 存储组配置数据 */ StoreGroupConfigDatas(dto: ConfigGroupDatasDto): Observable { return this.apiUrls.PostPp(this.YGSysConfigApi, 'StoreGroupConfigDatas', dto); } /** * 移除组配置数据 */ RemoveConfigGroupDatas(dto: ConfigGroupDatasDto[]): Observable { return this.apiUrls.PostPp(this.YGSysConfigApi, 'RemoveConfigGroupDatas', dto); } /** * 获取配置组名称列表 */ GetConfigGroupNameList(): Observable> { return this.apiUrls.GetPp(this.YGSysConfigApi, 'GetConfigGroupNameList'); } //#endregion 分组管理区域结束 //#region 消息配置区域开始 // ---------------------------------------------消息引擎配置------------------------------------------------- public download_msg(file: MessageFileDto) { const url = this.apiUrls.GetApiOperateUrl( RhPortType.msg, 'MessageNotifyApi', `GetMessageFile?filePath=${file.FilePath}&fileName=${file.FileName}`, RhPortLocalFieldType.msg ); const a = document.createElement('a'); a.href = url; a.target = '_blank'; a.id = 'file_download'; document.body.appendChild(a); const alink = document.getElementById('file_download'); alink?.click(); alink?.parentNode?.removeChild(a); } /** * 获取消息引擎配置信息列表 */ public GetMessageEngineConfigListAsync(dto: MessageEngineConfigQueryDto): Observable> { return this.apiUrls.PostMsg('MessageNotifyApi', 'GetMessageEngineConfigListAsync', dto); } /** * 创建邮件消息引擎配置 */ public CreateOrUpdateMailMessageEngineConfigAsync(dto: CreateMailMessageEngineConfigAsyncInput): Observable { return this.apiUrls.PostMsg('MessageNotifyApi', 'CreateOrUpdateMailMessageEngineConfigAsync', dto); } /** * 创建企业微信消息引擎配置 */ public CreateOrUpdateEnterpriseWechatMessageEngineConfigAsync( dto: CreateEnterpriseWechatMessageEngineConfigAsyncInput ): Observable { return this.apiUrls.PostMsg('MessageNotifyApi', 'CreateOrUpdateEnterpriseWechatMessageEngineConfigAsync', dto); } /** * 获取消息引擎用户组配置名称列表 */ public GetMessageEngineUserGroupConfigNameListAsync(): Observable> { return this.apiUrls.PostMsg('MessageNotifyApi', 'GetMessageEngineUserGroupConfigNameListAsync'); } /** * 获取消息引擎用户组配置列表 */ public GetMessageEngineUserGroupConfigListAsync( dto: MessageEngineUserGroupConfigQueryDto ): Observable> { return this.apiUrls.PostMsg('MessageNotifyApi', 'GetMessageEngineUserGroupConfigListAsync', dto); } /** * 保存消息引擎用户组配置数据 */ public CreateOrUpdateMessageEngineUserGroupConfigDataAsync(dto: MessageEngineUserGroupConfigDataDto): Observable { return this.apiUrls.PostMsg('MessageNotifyApi', 'CreateOrUpdateMessageEngineUserGroupConfigDataAsync', dto); } /** * 获取收到的消息列表 */ public GetReceivedMessageListAsync(dto: GetReceivedMessageListAsyncInput): Observable> { return this.apiUrls.PostMsg('MessageNotifyApi', 'GetReceivedMessageListAsync', dto); } /** 获取消息引擎用户组配置详情 */ public GetMessageEngineUserGroupConfigDetailAsync(dto: IdQueryDto): Observable> { return this.apiUrls.PostMsg('MessageNotifyApi', 'GetMessageEngineUserGroupConfigDetailAsync', dto); } /** * 获取收到的消息详细信息 */ public GetReceivedMessageDetailAsync(dto: IdQueryDto): Observable> { return this.apiUrls.PostMsg('MessageNotifyApi', 'GetReceivedMessageDetailAsync', dto); } /** * 获取发送的消息列表 */ public GetSendMessageListAsync(dto: GetSendMessageListAsyncInput): Observable> { return this.apiUrls.PostMsg('MessageNotifyApi', 'GetSendMessageListAsync', dto); } /** * 获取发送的消息详细信息 */ public GetSendMessageDetailAsync(dto: IdQueryDto): Observable> { return this.apiUrls.PostMsg('MessageNotifyApi', 'GetSendMessageDetailAsync', dto); } /** * 通过配置名称获取发送记录 */ public GetSendRecordByMsgConfigIdAsync( dto: GetSendRecordByConfigIdAsyncQueryDto ): Observable> { return this.apiUrls.PostMsg('MessageNotifyApi', 'GetSendRecordByMsgConfigIdAsync', dto); } /** * 触发消息发送 */ public MsgSendTriggerAsync(dto: MsgSendTriggerAsyncInput): Observable { return this.apiUrls.PostMsg('MessageNotifyApi', 'MsgSendTriggerAsync', dto); } /** * 启用禁用消息配置 */ public EnableMsgConfigAsync(dto: EnableMsgConfigAsyncInput): Observable { return this.apiUrls.PostMsg('MessageNotifyApi', 'EnableMsgConfigAsync', dto); } /** * 下载消息通知附件文件 */ public GetMessageFile(dto: MessageFileDto) { return this.apiUrls.GetMsg('MessageNotifyApi', `GetMessageFile?filePath=${dto.FilePath}&fileName=${dto.FileName}`); } /** 创建简单消息通知并发送 */ public CreateAndSendSimpleMessageAsync(dto: CreateAndSendSimpleMessageAsyncInput): Observable { return this.apiUrls.PostMsg('MessageNotifyApi', 'CreateAndSendSimpleMessageAsync', dto); } /** 创建高级消息通知并发送 */ public CreateAndSendAdvancedMessageAsync(dto: AllMessageNotificationDto): Observable { return this.apiUrls.PostMsg('MessageNotifyApi', 'CreateAndSendAdvancedMessageAsync', dto); } /** 创建用户组消息通知并发送 */ public CreateAndSendUserGroupMessageAsync(dto: CreateAndSendUserGroupMessageAsyncInput): Observable { return this.apiUrls.PostMsg('MessageNotifyApi', 'CreateAndSendUserGroupMessageAsync', dto); } /** 上传消息附件 */ public UploadMessageFile(dto: FormData): Observable { return this.apiUrls.PostMsg('MessageNotifyApi', 'UploadMessageFile', dto); } /** * 上传消息附件 */ UploadMessageFileNew(dto: FileUploadInput): Observable { return this.apiUrls.PostMsg('MessageNotifyApi', 'UploadMessageFile', dto); } /** * 根据部门ID和角色ID获取已经注册的用户账号信息 */ GetRegistedUsers(queryDto: OrganizationUnitRoleQueryDto): Observable> { return this.apiUrls.PostPp('YGAacApi', 'GetRegistedUsers', queryDto); } /** * 获取消息通知组配置数据 */ GetEmployeeMessageNotifyGroupConfigDatas( queryDto: EmployeeMessageNotifyGroupConfigQueryDto ): Observable> { return this.apiUrls.PostMdp('EmployeeWebApi', 'GetEmployeeMessageNotifyGroupConfigDatas', queryDto); } /** * 通过组键删除消息组数据 */ RemoveEmployeeMessageNotifyEmployeeGroupDatasByGroupKey(dto: EmployeeMessageNotifyEmployeeGroupConfigDto): Observable { return this.apiUrls.PostMdp('EmployeeWebApi', 'RemoveEmployeeMessageNotifyEmployeeGroupDatasByGroupKey', dto); } /** * 批量存储员工消息通知组配置数据 */ StoreEmployeeMessageNotifyEmployeeGroupDatas(dtos: EmployeeMessageNotifyEmployeeGroupConfigDto[]): Observable { return this.apiUrls.PostMdp('EmployeeWebApi', 'StoreEmployeeMessageNotifyEmployeeGroupDatas', dtos); } /** * 批量删除员工消息通知组配置数据 */ RemoveEmployeeMessageNotifyEmployeeGroupDatas(dtos: EmployeeMessageNotifyEmployeeGroupConfigDto[]): Observable { return this.apiUrls.PostMdp('EmployeeWebApi', 'RemoveEmployeeMessageNotifyEmployeeGroupDatas', dtos); } //#endregion 消息配置区域结束 /** * 存储邮箱服务器备份配置数据 */ StoreMailServerConfigData(dto: MailServerConfigDto): Observable { return this.apiUrls.PostPp(this.YGSysConfigApi, 'StoreMailServerConfigData', dto); } /** * 存储数据库备份配置数据 */ StoreDatabaseBackupConfigData(dto: DatabaseBackupConfigDto): Observable { return this.apiUrls.PostPp(this.YGSysConfigApi, 'StoreDatabaseBackupConfigData', dto); } //#region 日志管理区域开始 /** * 后去webapi调用日志 * @param queryDto webapi日志查询对象 */ GetWebApiInvokeLogs(queryDto: WebApiInvokeLogQueryDto): Observable> { return this.apiUrls.PostPp(this.EagleEyeLogApi, 'GetWebApiInvokeLogs', queryDto); } /** * 获取发布信息日志 * @param queryDto 发布信息日志查询对象 */ GetPublishMessageLogs(queryDto: PublishMessageLogQueryDto): Observable> { return this.apiUrls.PostPp(this.EagleEyeLogApi, 'GetPublishMessageLogs', queryDto); } /** * 获取事务操作日志信息 * @param queryDto 事务操作日志查询对象 */ GetTransactOperationLogs(queryDto: TransactOperationLogQueryDto): Observable> { return this.apiUrls.PostPp(this.EagleEyeLogApi, 'GetTransactOperationLogs', queryDto); } //#endregion 日志管理区域结束 // #region 我的消息 /** * 查看成功失败删除统计 */ GetJobCountData(): Observable> { return this.apiUrls.GetMsg('BackgroundWorkApi', 'GetJobCountData'); } /** * 查看正在运行job */ GetProcessingJob(): Observable> { return this.apiUrls.GetMsg('BackgroundWorkApi', 'GetProcessingJob'); } /** * 查看计划job */ GetScheduledJob(): Observable> { return this.apiUrls.PostMsg('BackgroundWorkApi', 'GetScheduledJob'); } /** * 查看hangfirejob队列 */ // GetJobQueueData(): Observable> { // return this.apiUrls.GetMsg('BackgroundWorkApi', 'GetJobQueueData'); // } /** * 查看Hangfirejob */ GetHangfirejobData(): Observable> { return this.apiUrls.PostMsg('BackgroundWorkApi', 'GetHangfirejobData'); } /** * 查看已经删除job */ GetDeletedJob(): Observable> { return this.apiUrls.PostMsg('BackgroundWorkApi', 'GetDeletedJob'); } /** * 查看错误job */ GetFailedJob(): Observable> { return this.apiUrls.PostMsg('BackgroundWorkApi', 'GetFailedJob'); } /** * 查看成功job */ GetSucceededJob(): Observable> { // Record: 10 // SkipCount: 50 return this.apiUrls.PostMsg('BackgroundWorkApi', 'GetSucceededJob'); } /** * 查看job参数 */ GetJobParameter(dto: { JobId: string }): Observable> { return this.apiUrls.PostMsg('BackgroundWorkApi', 'GetJobParameter', dto); } /** * 再次执行后台任务 */ RequeueHangfireJob(dto: { OldHangfired: string }): Observable { return this.apiUrls.PostMsg('BackgroundWorkApi', 'RequeueHangfireJob', dto); } /** * 查看job运行状态 */ GetJobSateData(queryDto: StateQueryDto): Observable> { return this.apiUrls.PostMsg('BackgroundWorkApi', 'GetJobSateData', queryDto); } /** * 删除后台任务列表 */ Delete(dto: { OldHangfired: string }): Observable> { return this.apiUrls.PostMsg('BackgroundWorkApi', 'Delete', dto); } /** * 查看重复job */ GetRetryJob(): Observable> { return this.apiUrls.PostMsg('BackgroundWorkApi', 'GetRetryJob'); } /** * 获取定时任务列表 */ GetQuartzJobs(options: QuartzJobQueryDto): Observable> { return this.apiUrls.PostMsg('BackgroundWorkApi', 'GetQuartzJobs', options); } /** * 更新定时任务Corn表达式 */ UpdateQuartz(options: QuartzJobDto): Observable { return this.apiUrls.PostMsg('BackgroundWorkApi', 'UpdateQuartz', options); } /** * 删除Quartz任务 */ RemoveQuartzJob(dto: QuartzJobDto): Observable { return this.apiUrls.PostMsg('BackgroundWorkApi', 'RemoveQuartzJob', dto); } /** * 再次执行定时任务 */ RequeueQuartzJob(dto: QuartzJobDto): Observable { return this.apiUrls.PostMsg('BackgroundWorkApi', 'RequeueQuartzJob', dto); } // MaxResultCount: 10 // Mode: null // OpSign: 1 // Options: {} // PdfRelativePath: null // SkipCount: 20 // #region 我的消息结束 }