import { RhSelectItem, RhSafeAny, DataResultT, OpResult } from 'rh-base/model'; import { RhApiUrlsService } from 'rh-base/core'; import { Injectable } from '@angular/core'; import { AndonCallHandleRulesDto, BusinessDocQueryDto, EmployeeMessageNotifyEmployeeGroupConfigDto, EmployeeMessageNotifyGroupConfigDto, EmployeeMessageNotifyGroupConfigQueryDto, GetMessageEngineConfigListOutput, MessageEngineConfigQueryDto, SelectItem } from '../andon-module'; import { Observable, Subject } from 'rxjs'; @Injectable() export class RhAndonSystemService { constructor(private apiUrls: RhApiUrlsService) { // } public messageSource = new Subject(); public sendMessage(message: string): void { this.messageSource.next(message); } public getMessageSource(): Observable { return this.messageSource.asObservable(); } public valueSource = new Subject(); public sendValue(message: RhSafeAny): void { this.valueSource.next(message); } public getValueSource(): Observable { return this.valueSource.asObservable(); } /** * 提交安灯呼叫处理规则 */ SubmitAndonCallHandleRule(dto: AndonCallHandleRulesDto): Observable { return this.apiUrls.PostEmp('AndonCallConfigurationWebApi', 'SubmitAndonCallHandleRule', dto); } /** * 获取处理规则下拉列表 */ GetHandleRuleSelectItem(params: { CallRuleLevelCode: string; CallCategoryCode: string; CallCategoryItemCode: string; }): Observable { return this.apiUrls.GetEmp('AndonCallConfigurationWebApi', 'GetHandleRuleSelectItem', { params: params }); } /** * 审核安灯呼叫处理规则 */ AuditAndonCallHandleRule(dto: AndonCallHandleRulesDto): Observable { return this.apiUrls.PostEmp('AndonCallConfigurationWebApi', 'AuditAndonCallHandleRule', dto); } /** * 审核安灯呼叫处理规则 */ AuditAndonCallHandleRules(AndonCallHandleRulesDto: AndonCallHandleRulesDto[]): Observable { return this.apiUrls.PostEmp('AndonCallConfigurationWebApi', 'AuditAndonCallHandleRules', AndonCallHandleRulesDto); } /** * 获取消息通知组配置数据 */ 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); } /** * 获取消息引擎配置信息列表 */ public GetMessageEngineConfigListAsync(dto: MessageEngineConfigQueryDto): Observable> { return this.apiUrls.PostMsg('MessageNotifyApi', 'GetMessageEngineConfigListAsync', dto); } /** * 获取业务字典下拉数据 */ GetBusinessSelectItems(queryDto: BusinessDocQueryDto): Observable { return this.apiUrls.PostRdp('BusinessDocWebApi', 'GetBusinessSelectItems', queryDto); } }